Skip to content

Commit

Permalink
Merge branch 'next' of github.com:storybookjs/addon-svelte-csf into c…
Browse files Browse the repository at this point in the history
…hildren-to-template
  • Loading branch information
JReinhold committed Jan 21, 2025
2 parents e697925 + 7bcba35 commit d4c983e
Show file tree
Hide file tree
Showing 111 changed files with 1,598 additions and 1,656 deletions.
9 changes: 9 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ jobs:
pnpm install
--frozen-lockfile
- name: Install Playwright Dependencies
# Required for Vitest browser-mode
run: pnpm exec playwright install chromium --with-deps

- name: Build package
# Required for testing stories
run: >
pnpm build
- name: Run tests with Vitest
# https://vitest.dev/guide/cli.html
run: >
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ package-lock.json

# .d.ts files generated by `svelte-package`
examples/**/*.d.ts
tests/extractor.d.ts
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
22
3 changes: 2 additions & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ const config: StorybookConfig = {
},
},
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@chromatic-com/storybook',
'@storybook/experimental-addon-test',
],
};

Expand Down
8 changes: 8 additions & 0 deletions .storybook/vitest.setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import { beforeAll } from 'vitest';
import { setProjectAnnotations } from '@storybook/svelte';

// This is an important step to apply the right configuration when testing your stories.
// More info at: https://storybook.js.org/docs/api/portable-stories/portable-stories-vitest#setprojectannotations
const project = setProjectAnnotations([]);

beforeAll(project.beforeAll);
14 changes: 2 additions & 12 deletions ERRORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,30 +218,20 @@ You most likely forgot to destructure the return value.

### `SB_SVELTE_CSF_PARSER_ANALYSE_DEFINE_META_0003`

The addon automatically adds a `meta` identifier to the return value of `defineMeta()` during compilation.
But for some reason, this couldn't be found in the compiled output.

If you see this error, please open a [bug report](https://github.com/storybookjs/addon-svelte-csf/issues/new).

While you create an issue, please provide original code of the stories file that caused this error.
It will help us investigate the occurred issue better.

### `SB_SVELTE_CSF_PARSER_ANALYSE_DEFINE_META_0004`

When analysing the object passed to `defineMeta({ ... })`, invalid properties were found. The following properties must be **static string literals**, but got something else:

- `title`
- `name`

Dynamically generating these properties with functions or with template strings is not supported.

### `SB_SVELTE_CSF_PARSER_ANALYSE_DEFINE_META_0005`
### `SB_SVELTE_CSF_PARSER_ANALYSE_DEFINE_META_0004`

When analysing the object passed to `defineMeta({ ... })`, invalid properties were found. The `tags` property must be a **static array of static string literals**, but got something else

Dynamically generating the array or the entries with functions or with template strings is not supported.

### `SB_SVELTE_CSF_PARSER_ANALYSE_DEFINE_META_0006`
### `SB_SVELTE_CSF_PARSER_ANALYSE_DEFINE_META_0005`

When analysing the object passed to `defineMeta({ ... })`, invalid properties were found. The `tags` property must be a **static array of static string literals**, but got something else

Expand Down
5 changes: 5 additions & 0 deletions chromatic.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"onlyChanged": true,
"projectId": "Project:6042cb92fd1bb200234586ee",
"zip": true
}
57 changes: 27 additions & 30 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,6 @@
},
"license": "MIT",
"type": "module",
"imports": {
"#tests/*": {
"development": "./tests/*.ts"
},
"#*": {
"development": "./src/*.ts",
"default": "./dist/*.js"
}
},
"exports": {
".": {
"types": "./dist/index.d.ts",
Expand All @@ -44,7 +35,7 @@
"README.md"
],
"scripts": {
"build": "svelte-package --input ./src --types",
"build": "svelte-package --types",
"build-storybook": "storybook build",
"check": "svelte-check",
"chromatic": "chromatic --exit-zero-on-changes",
Expand All @@ -54,15 +45,14 @@
"lint": "eslint --cache --cache-location=.cache/eslint --ext .js,.json,.html,.svelte,.ts --report-unused-disable-directives",
"prepublish": "pnpm run clean && pnpm run build",
"release": "pnpm run build && auto shipit",
"start": "concurrently \"pnpm run storybook --quiet\" \"pnpm run build --watch\"",
"start": "pnpm run build && concurrently \"pnpm run build --watch\" \"pnpm run storybook --quiet\"",
"storybook": "storybook dev --port 6006 --no-open",
"test": "vitest run",
"test:watch": "vitest watch"
},
"dependencies": {
"@storybook/csf": "^0.1.11",
"@storybook/docs-tools": "^8.0.0",
"@storybook/node-logger": "^8.0.0",
"@storybook/types": "^8.0.0",
"dedent": "^1.5.3",
"es-toolkit": "^1.26.1",
Expand All @@ -73,48 +63,55 @@
},
"devDependencies": {
"@auto-it/released": "^11.1.6",
"@storybook/addon-actions": "^8.0.0",
"@storybook/addon-essentials": "^8.0.0",
"@storybook/addon-interactions": "^8.0.0",
"@storybook/client-logger": "^8.0.0",
"@chromatic-com/storybook": "^3.2.3",
"@storybook/addon-actions": "8.5.0-beta.11",
"@storybook/addon-essentials": "8.5.0-beta.11",
"@storybook/eslint-config-storybook": "^4.0.0",
"@storybook/preview-api": "^8.0.0",
"@storybook/svelte": "^8.0.0",
"@storybook/svelte-vite": "^8.0.0",
"@storybook/test": "^8.0.0",
"@storybook/experimental-addon-test": "^8.5.0-beta.11",
"@storybook/preview-api": "8.5.0-beta.11",
"@storybook/svelte": "8.5.0-beta.11",
"@storybook/svelte-vite": "8.5.0-beta.11",
"@storybook/test": "8.5.0-beta.11",
"@sveltejs/package": "^2.3.7",
"@sveltejs/vite-plugin-svelte": "4.0.0",
"@tsconfig/svelte": "^5.0.4",
"@types/estree": "^1.0.6",
"@types/node": "^20.14.9",
"@vitest/ui": "^1.6.0",
"@vitest/browser": "2.1.4",
"@vitest/coverage-v8": "2.1.4",
"@vitest/ui": "^2.1.4",
"auto": "^11.1.6",
"chromatic": "^11.16.1",
"concurrently": "^8.2.2",
"eslint": "^7.32.0",
"eslint-plugin-storybook": "^0.11.0",
"happy-dom": "^15.11.0",
"eslint-plugin-storybook": "^0.8.0",
"happy-dom": "^15.11.4",
"playwright": "^1.49.1",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.5",
"rimraf": "^5.0.7",
"rollup": "^4.18.0",
"storybook": "^8.0.0",
"rollup": "^4.25.0",
"storybook": "8.5.0-beta.11",
"svelte": "^5.0.0",
"svelte-check": "^4.0.5",
"tslib": "^2.6.3",
"type-fest": "^4.20.1",
"typescript": "^5.5.2",
"typescript-svelte-plugin": "^0.3.42",
"vite": "^5.3.2",
"vite-plugin-inspect": "^0.8.4",
"vite": "^5.4.11",
"vite-plugin-inspect": "^0.8.7",
"vite-plugin-virtual": "^0.3.0",
"vitest": "^1.6.0"
"vitest": "^2.1.4"
},
"peerDependencies": {
"@storybook/svelte": "^8.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0",
"@sveltejs/vite-plugin-svelte": "^4.0.0 || ^5.0.0",
"svelte": "^5.0.0",
"vite": "^5.0.0"
"vite": "^5.0.0 || ^6.0.0"
},
"resolutions": {
"@storybook/docs-tools": "8.5.0-beta.11",
"@storybook/types": "8.5.0-beta.11"
},
"packageManager": "[email protected]+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee",
"publishConfig": {
Expand Down
Loading

0 comments on commit d4c983e

Please sign in to comment.