Skip to content

Commit

Permalink
codemod -> legacyAPI
Browse files Browse the repository at this point in the history
  • Loading branch information
xeho91 committed Sep 5, 2024
1 parent 5ad4c30 commit c2c49d2
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -331,9 +331,9 @@ You can fix this collision by providing a unique `exportName` prop with`<Story e

See more in [the `exportName` API docs](./README.md#custom-export-name).

## `CODEMOD`
## `LEGACY_API`

### `SB_SVELTE_CSF_CODEMOD_0001`
### `SB_SVELTE_CSF_LEGACY_API_0001`

`<Story/>` component prop `template` value must be a text with string reference to existing `<Template />`'s `id` prop.

Expand All @@ -347,7 +347,7 @@ It cannot be a shorthand or a dynamic value.
/>
```

### `SB_SVELTE_CSF_CODEMOD_0002`
### `SB_SVELTE_CSF_LEGACY_API_0002`

You are using legacy template API, with deprecated components.\
To enable support for legacy API, tweak this addon options in your _(`./.storybook/main.(j|t)s`)_ file:
Expand Down
2 changes: 1 addition & 1 deletion src/utils/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export abstract class StorybookSvelteCSFError extends Error {
parserAnalyseDefineMeta: 'PARSER_ANALYSE_DEFINE_META',
parserAnalyseStory: 'PARSER_ANALYSE_STORY',
compiler: 'COMPILER',
codemod: 'CODEMOD',
legacyAPI: 'LEGACY_API',
} as const;

/**
Expand Down
4 changes: 2 additions & 2 deletions src/utils/error/codemod/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import dedent from 'dedent';
import type { Attribute } from 'svelte/compiler';

export class InvalidTemplateAttribute extends StorybookSvelteCSFError {
readonly category = StorybookSvelteCSFError.CATEGORY.codemod;
readonly category = StorybookSvelteCSFError.CATEGORY.legacyAPI;
readonly code = 1;
public documentation = true;

Expand All @@ -31,7 +31,7 @@ export class InvalidTemplateAttribute extends StorybookSvelteCSFError {
}

export class LegacyTemplateNotEnabledError extends StorybookSvelteCSFError {
readonly category = StorybookSvelteCSFError.CATEGORY.codemod;
readonly category = StorybookSvelteCSFError.CATEGORY.legacyAPI;
readonly code = 2;
public documentation = true;

Expand Down

0 comments on commit c2c49d2

Please sign in to comment.