From dc645cbd7096e5b9e0c99152b1986cceaea2b3ff Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 30 Mar 2022 23:02:20 +0800 Subject: [PATCH 1/2] Rename storybook-builder-vite to @storybook/builder-vite --- .github/workflows/buildAndPublish.yml | 2 +- CONTRIBUTING.md | 4 +- examples/react-ts/.storybook/main.ts | 2 +- examples/react-ts/package.json | 2 +- examples/react/.storybook/main.js | 2 +- examples/react/package.json | 2 +- examples/svelte/.storybook/main.js | 2 +- examples/svelte/package.json | 2 +- examples/vue/.storybook/main.js | 2 +- examples/vue/package.json | 2 +- .../packages/catalog/.storybook/main.js | 2 +- .../workspaces/packages/catalog/package.json | 2 +- package.json | 4 +- .../README.md | 18 +++---- .../build.ts | 0 .../code-generator-plugin.ts | 0 .../codegen-entries.ts | 0 .../codegen-iframe-script.ts | 0 .../codegen-importfn-script.ts | 0 .../codegen-modern-iframe-script.ts | 0 .../declarations/extract-stories.d.ts | 0 .../declarations/svetle-stories-loader.d.ts | 0 .../envs.ts | 0 .../index.ts | 2 +- .../inject-export-order-plugin.ts | 0 .../input/iframe.html | 0 .../list-stories.ts | 2 +- .../mdx-plugin.ts | 0 .../mock-core-js.ts | 0 .../optimizeDeps.ts | 0 .../package.json | 8 +-- .../plugins/vue-docgen.ts | 0 .../source-loader-plugin.ts | 0 .../svelte/csf-plugin.ts | 0 .../transform-iframe-html.ts | 0 .../tsconfig.json | 0 .../types/envs-raw.type.ts | 0 .../types/extended-options.type.ts | 0 .../types/index.ts | 0 .../vite-config.ts | 6 +-- .../vite-server.ts | 0 yarn.lock | 54 +++++++++---------- 42 files changed, 60 insertions(+), 60 deletions(-) rename packages/{storybook-builder-vite => builder-vite}/README.md (82%) rename packages/{storybook-builder-vite => builder-vite}/build.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/code-generator-plugin.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/codegen-entries.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/codegen-iframe-script.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/codegen-importfn-script.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/codegen-modern-iframe-script.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/declarations/extract-stories.d.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/declarations/svetle-stories-loader.d.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/envs.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/index.ts (96%) rename packages/{storybook-builder-vite => builder-vite}/inject-export-order-plugin.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/input/iframe.html (100%) rename packages/{storybook-builder-vite => builder-vite}/list-stories.ts (89%) rename packages/{storybook-builder-vite => builder-vite}/mdx-plugin.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/mock-core-js.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/optimizeDeps.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/package.json (78%) rename packages/{storybook-builder-vite => builder-vite}/plugins/vue-docgen.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/source-loader-plugin.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/svelte/csf-plugin.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/transform-iframe-html.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/tsconfig.json (100%) rename packages/{storybook-builder-vite => builder-vite}/types/envs-raw.type.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/types/extended-options.type.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/types/index.ts (100%) rename packages/{storybook-builder-vite => builder-vite}/vite-config.ts (92%) rename packages/{storybook-builder-vite => builder-vite}/vite-server.ts (100%) diff --git a/.github/workflows/buildAndPublish.yml b/.github/workflows/buildAndPublish.yml index 66e985c9..ca6a48fe 100644 --- a/.github/workflows/buildAndPublish.yml +++ b/.github/workflows/buildAndPublish.yml @@ -4,7 +4,7 @@ on: [workflow_dispatch] defaults: run: - working-directory: packages/storybook-builder-vite + working-directory: packages/builder-vite jobs: build: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 19b2b463..59dd27a8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -18,8 +18,8 @@ 2. Clone forked repository: ``` - git clone https://github.com/YOUR_USERNAME/storybook-builder-vite - cd storybook-builder-vite + git clone https://github.com/YOUR_USERNAME/builder-vite + cd builder-vite ``` 3. Install dependencies: diff --git a/examples/react-ts/.storybook/main.ts b/examples/react-ts/.storybook/main.ts index 17b95e7c..36b7d5fe 100644 --- a/examples/react-ts/.storybook/main.ts +++ b/examples/react-ts/.storybook/main.ts @@ -3,7 +3,7 @@ module.exports = { stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'], addons: ['@storybook/addon-a11y', '@storybook/addon-links', '@storybook/addon-essentials'], core: { - builder: 'storybook-builder-vite', + builder: '@storybook/builder-vite', }, features: { storyStoreV7: true, diff --git a/examples/react-ts/package.json b/examples/react-ts/package.json index 38ca0353..32927942 100644 --- a/examples/react-ts/package.json +++ b/examples/react-ts/package.json @@ -21,12 +21,12 @@ "@storybook/addon-a11y": "^6.5.0-alpha.49", "@storybook/addon-docs": "^6.5.0-alpha.49", "@storybook/addon-essentials": "^6.5.0-alpha.49", + "@storybook/builder-vite": "workspace:*", "@storybook/react": "^6.5.0-alpha.49", "@storybook/test-runner": "^0.0.4", "http-server": "^14.1.0", "jest": "^27.5.1", "npm-run-all": "^4.1.5", - "storybook-builder-vite": "workspace:*", "typescript": "^4.5.4", "vite": "2.9.0-beta.8", "wait-on": "^6.0.1" diff --git a/examples/react/.storybook/main.js b/examples/react/.storybook/main.js index 11d5785b..a0863cef 100644 --- a/examples/react/.storybook/main.js +++ b/examples/react/.storybook/main.js @@ -3,7 +3,7 @@ module.exports = { stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'], addons: ['@storybook/addon-a11y', '@storybook/addon-links', '@storybook/addon-essentials'], core: { - builder: 'storybook-builder-vite', + builder: '@storybook/builder-vite', }, features: { storyStoreV7: false, diff --git a/examples/react/package.json b/examples/react/package.json index 1307193b..3be00a61 100644 --- a/examples/react/package.json +++ b/examples/react/package.json @@ -21,12 +21,12 @@ "@storybook/addon-a11y": "^6.5.0-alpha.49", "@storybook/addon-docs": "^6.5.0-alpha.49", "@storybook/addon-essentials": "^6.5.0-alpha.49", + "@storybook/builder-vite": "workspace:*", "@storybook/react": "^6.5.0-alpha.49", "@storybook/test-runner": "^0.0.4", "http-server": "^14.1.0", "jest": "^27.5.1", "npm-run-all": "^4.1.5", - "storybook-builder-vite": "workspace:*", "vite": "2.9.0-beta.8", "wait-on": "^6.0.1" } diff --git a/examples/svelte/.storybook/main.js b/examples/svelte/.storybook/main.js index d7b6f420..0b2c4e05 100644 --- a/examples/svelte/.storybook/main.js +++ b/examples/svelte/.storybook/main.js @@ -5,7 +5,7 @@ module.exports = { stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx|svelte)'], addons: ['@storybook/addon-links', '@storybook/addon-essentials', '@storybook/addon-svelte-csf'], core: { - builder: 'storybook-builder-vite', + builder: '@storybook/builder-vite', }, async viteFinal(config, { configType }) { // customize the Vite config here diff --git a/examples/svelte/package.json b/examples/svelte/package.json index ab7c3e22..11bff195 100644 --- a/examples/svelte/package.json +++ b/examples/svelte/package.json @@ -21,6 +21,7 @@ "@storybook/addon-essentials": "^6.5.0-alpha.49", "@storybook/addon-links": "^6.5.0-alpha.49", "@storybook/addon-svelte-csf": "^1.1.0", + "@storybook/builder-vite": "workspace:*", "@storybook/svelte": "^6.5.0-alpha.49", "@storybook/test-runner": "^0.0.4", "@sveltejs/vite-plugin-svelte": "^1.0.0-next.37", @@ -28,7 +29,6 @@ "http-server": "^14.1.0", "jest": "^27.5.1", "npm-run-all": "^4.1.5", - "storybook-builder-vite": "workspace:*", "svelte-preprocess": "^4.10.4", "typescript": "^4.5.5", "vite": "2.9.0-beta.8", diff --git a/examples/vue/.storybook/main.js b/examples/vue/.storybook/main.js index 56ad688f..294c30d0 100644 --- a/examples/vue/.storybook/main.js +++ b/examples/vue/.storybook/main.js @@ -3,7 +3,7 @@ module.exports = { stories: ['../stories/**/*.stories.mdx', '../stories/**/*.stories.@(js|jsx|ts|tsx)'], addons: ['@storybook/addon-links', '@storybook/addon-essentials'], core: { - builder: 'storybook-builder-vite', + builder: '@storybook/builder-vite', }, async viteFinal(config, { configType }) { // customize the Vite config here diff --git a/examples/vue/package.json b/examples/vue/package.json index 6f2f8be3..1001e0ea 100644 --- a/examples/vue/package.json +++ b/examples/vue/package.json @@ -19,13 +19,13 @@ "devDependencies": { "@storybook/addon-a11y": "^6.5.0-alpha.49", "@storybook/addon-essentials": "^6.5.0-alpha.49", + "@storybook/builder-vite": "workspace:*", "@storybook/test-runner": "^0.0.4", "@storybook/vue3": "^6.5.0-alpha.49", "@vitejs/plugin-vue": "^1.10.2", "http-server": "^14.1.0", "jest": "^27.5.1", "npm-run-all": "^4.1.5", - "storybook-builder-vite": "workspace:*", "vite": "2.9.0-beta.8", "wait-on": "^6.0.1" } diff --git a/examples/workspaces/packages/catalog/.storybook/main.js b/examples/workspaces/packages/catalog/.storybook/main.js index 88f37e49..8a46559e 100644 --- a/examples/workspaces/packages/catalog/.storybook/main.js +++ b/examples/workspaces/packages/catalog/.storybook/main.js @@ -3,7 +3,7 @@ module.exports = { stories: ['../../app/stories/**/*.stories.@(js|jsx|ts|tsx|mdx)'], addons: ['@storybook/addon-a11y', '@storybook/addon-links', '@storybook/addon-essentials'], core: { - builder: 'storybook-builder-vite', + builder: '@storybook/builder-vite', }, features: { storyStoreV7: true, diff --git a/examples/workspaces/packages/catalog/package.json b/examples/workspaces/packages/catalog/package.json index fe3a6b51..dbe48c72 100644 --- a/examples/workspaces/packages/catalog/package.json +++ b/examples/workspaces/packages/catalog/package.json @@ -18,8 +18,8 @@ "@storybook/addon-a11y": "^6.5.0-alpha.49", "@storybook/addon-docs": "^6.5.0-alpha.49", "@storybook/addon-essentials": "^6.5.0-alpha.49", + "@storybook/builder-vite": "workspace:*", "@storybook/react": "^6.5.0-alpha.49", - "storybook-builder-vite": "workspace:*", "vite": "2.9.0-beta.7" } } diff --git a/package.json b/package.json index 311179fb..3f7ece5d 100644 --- a/package.json +++ b/package.json @@ -9,8 +9,8 @@ "scripts": { "build-examples": "yarn workspaces foreach --include 'example-*' -p run build-storybook", "test-ci": "yarn workspaces foreach --exclude 'example-svelte' -p run test-ci", - "start": "cd packages/storybook-builder-vite && tsc -w", - "prepublish": "cd packages/storybook-builder-vite && tsc", + "start": "cd packages/builder-vite && tsc -w", + "prepublish": "cd packages/builder-vite && tsc", "lint": "yarn lint:prettier && yarn lint:eslint", "lint:prettier": "prettier --write .", "lint:eslint": "eslint \"**/*.{ts,tsx,js,jsx,mjs,cjs}\" --fix", diff --git a/packages/storybook-builder-vite/README.md b/packages/builder-vite/README.md similarity index 82% rename from packages/storybook-builder-vite/README.md rename to packages/builder-vite/README.md index a611efd0..d32f2c15 100644 --- a/packages/storybook-builder-vite/README.md +++ b/packages/builder-vite/README.md @@ -12,29 +12,29 @@ feel free to create an issue or send a pull request! The Vite builder cannot build itself. Are you willing to contribute? -https://github.com/eirslett/storybook-builder-vite/issues/11 +https://github.com/storybookjs/builder-vite/issues/11 Please read the [How to contribute](/CONTRIBUTING.md) guide. ### Installation ```bash -npm install storybook-builder-vite --save-dev +npm install @storybook/builder-vite --save-dev ``` or ```bash -yarn add --dev storybook-builder-vite +yarn add --dev @storybook/builder-vite ``` ### Usage In your `main.js` configuration file, -set `core: { builder: "storybook-builder-vite" }`. +set `core: { builder: "@storybook/builder-vite" }`. > For autoreload of stories to work, they need to have `.stories.tsx` file suffix. -> See also [#53](https://github.com/eirslett/storybook-builder-vite/pull/53) +> See also [#53](https://github.com/storybookjs/builder-vite/pull/53) The builder supports both development mode in Storybook, and building a static production version. @@ -97,14 +97,14 @@ storybook configuration directory. This can be overridden in viteFinal. ``` npm init @vitejs/app vite-react-app --template react && cd vite-react-app npm install # or yarn -npx sb@next init --builder storybook-builder-vite && npm run storybook +npx sb@next init --builder @storybook/builder-vite && npm run storybook ``` ## Known issues -- HMR: saving a story file does not hot-module-reload. In svelte, the page is not reloaded either (https://github.com/eirslett/storybook-builder-vite/issues/209). HMR should work when saving component files. +- HMR: saving a story file does not hot-module-reload. In svelte, the page is not reloaded either (https://github.com/storybookjs/builder-vite/issues/209). HMR should work when saving component files. - Prebundling: Vite restarts if it detects new dependencies which it did not know about and needs to pre-bundle. This breaks within storybook, with confusing error messages. If you see a message in your terminal like `[vite] new dependencies found:`, please add those dependencies to your `optimizeDeps.include` in `viteFinal`. E.g. `config.optimizeDeps.include = [...(config.optimizeDeps?.include ?? []), "storybook-dark-mode"],`. -- MDX pages are broken when emotion 11 is installed: Adding the configuration [here](https://github.com/eirslett/storybook-builder-vite/issues/219#issuecomment-1023666193) should fix this. +- MDX pages are broken when emotion 11 is installed: Adding the configuration [here](https://github.com/storybookjs/builder-vite/issues/219#issuecomment-1023666193) should fix this. ## Contributing @@ -112,7 +112,7 @@ Contributions are welcome! ### About this codebase -The code is a monorepo with the core `storybook-builder-vite` package, +The code is a monorepo with the core `@storybook/builder-vite` package, and examples (like `packages/example-react`) to test the builder implementation with. Similar to the main storybook monorepo, you need yarn , because the project is organized as yarn workspaces. diff --git a/packages/storybook-builder-vite/build.ts b/packages/builder-vite/build.ts similarity index 100% rename from packages/storybook-builder-vite/build.ts rename to packages/builder-vite/build.ts diff --git a/packages/storybook-builder-vite/code-generator-plugin.ts b/packages/builder-vite/code-generator-plugin.ts similarity index 100% rename from packages/storybook-builder-vite/code-generator-plugin.ts rename to packages/builder-vite/code-generator-plugin.ts diff --git a/packages/storybook-builder-vite/codegen-entries.ts b/packages/builder-vite/codegen-entries.ts similarity index 100% rename from packages/storybook-builder-vite/codegen-entries.ts rename to packages/builder-vite/codegen-entries.ts diff --git a/packages/storybook-builder-vite/codegen-iframe-script.ts b/packages/builder-vite/codegen-iframe-script.ts similarity index 100% rename from packages/storybook-builder-vite/codegen-iframe-script.ts rename to packages/builder-vite/codegen-iframe-script.ts diff --git a/packages/storybook-builder-vite/codegen-importfn-script.ts b/packages/builder-vite/codegen-importfn-script.ts similarity index 100% rename from packages/storybook-builder-vite/codegen-importfn-script.ts rename to packages/builder-vite/codegen-importfn-script.ts diff --git a/packages/storybook-builder-vite/codegen-modern-iframe-script.ts b/packages/builder-vite/codegen-modern-iframe-script.ts similarity index 100% rename from packages/storybook-builder-vite/codegen-modern-iframe-script.ts rename to packages/builder-vite/codegen-modern-iframe-script.ts diff --git a/packages/storybook-builder-vite/declarations/extract-stories.d.ts b/packages/builder-vite/declarations/extract-stories.d.ts similarity index 100% rename from packages/storybook-builder-vite/declarations/extract-stories.d.ts rename to packages/builder-vite/declarations/extract-stories.d.ts diff --git a/packages/storybook-builder-vite/declarations/svetle-stories-loader.d.ts b/packages/builder-vite/declarations/svetle-stories-loader.d.ts similarity index 100% rename from packages/storybook-builder-vite/declarations/svetle-stories-loader.d.ts rename to packages/builder-vite/declarations/svetle-stories-loader.d.ts diff --git a/packages/storybook-builder-vite/envs.ts b/packages/builder-vite/envs.ts similarity index 100% rename from packages/storybook-builder-vite/envs.ts rename to packages/builder-vite/envs.ts diff --git a/packages/storybook-builder-vite/index.ts b/packages/builder-vite/index.ts similarity index 96% rename from packages/storybook-builder-vite/index.ts rename to packages/builder-vite/index.ts index 00cbc6ab..c8d69383 100644 --- a/packages/storybook-builder-vite/index.ts +++ b/packages/builder-vite/index.ts @@ -22,7 +22,7 @@ function iframeMiddleware(options: ExtendedOptions, server: ViteDevServer): Requ return; } - // We need to handle `html-proxy` params for style tag HMR https://github.com/eirslett/storybook-builder-vite/issues/266#issuecomment-1055677865 + // We need to handle `html-proxy` params for style tag HMR https://github.com/storybookjs/builder-vite/issues/266#issuecomment-1055677865 // e.g. /iframe.html?html-proxy&index=0.css if (req.query['html-proxy'] !== undefined) { next(); diff --git a/packages/storybook-builder-vite/inject-export-order-plugin.ts b/packages/builder-vite/inject-export-order-plugin.ts similarity index 100% rename from packages/storybook-builder-vite/inject-export-order-plugin.ts rename to packages/builder-vite/inject-export-order-plugin.ts diff --git a/packages/storybook-builder-vite/input/iframe.html b/packages/builder-vite/input/iframe.html similarity index 100% rename from packages/storybook-builder-vite/input/iframe.html rename to packages/builder-vite/input/iframe.html diff --git a/packages/storybook-builder-vite/list-stories.ts b/packages/builder-vite/list-stories.ts similarity index 89% rename from packages/storybook-builder-vite/list-stories.ts rename to packages/builder-vite/list-stories.ts index f047431e..d403cbc5 100644 --- a/packages/storybook-builder-vite/list-stories.ts +++ b/packages/builder-vite/list-stories.ts @@ -3,7 +3,7 @@ import { promise as glob } from 'glob-promise'; import type { Options, StoriesEntry } from '@storybook/core-common'; -// TODO: Merge with https://github.com/eirslett/storybook-builder-vite/pull/182 +// TODO: Merge with https://github.com/storybookjs/builder-vite/pull/182 export async function listStories({ presets, configDir }: Options) { return ( await Promise.all( diff --git a/packages/storybook-builder-vite/mdx-plugin.ts b/packages/builder-vite/mdx-plugin.ts similarity index 100% rename from packages/storybook-builder-vite/mdx-plugin.ts rename to packages/builder-vite/mdx-plugin.ts diff --git a/packages/storybook-builder-vite/mock-core-js.ts b/packages/builder-vite/mock-core-js.ts similarity index 100% rename from packages/storybook-builder-vite/mock-core-js.ts rename to packages/builder-vite/mock-core-js.ts diff --git a/packages/storybook-builder-vite/optimizeDeps.ts b/packages/builder-vite/optimizeDeps.ts similarity index 100% rename from packages/storybook-builder-vite/optimizeDeps.ts rename to packages/builder-vite/optimizeDeps.ts diff --git a/packages/storybook-builder-vite/package.json b/packages/builder-vite/package.json similarity index 78% rename from packages/storybook-builder-vite/package.json rename to packages/builder-vite/package.json index ad96464d..f04f7eca 100644 --- a/packages/storybook-builder-vite/package.json +++ b/packages/builder-vite/package.json @@ -1,5 +1,5 @@ { - "name": "storybook-builder-vite", + "name": "@storybook/builder-vite", "version": "0.1.22", "description": "An experimental plugin to run and build Storybooks with Vite", "main": "dist/index.js", @@ -8,10 +8,10 @@ "license": "MIT", "repository": { "type": "git", - "url": "https://github.com/eirslett/storybook-builder-vite.git", - "directory": "package/storybook-builder-vite" + "url": "https://github.com/storybookjs/builder-vite.git", + "directory": "packages/builder-vite" }, - "homepage": "https://github.com/eirslett/storybook-builder-vite/#readme", + "homepage": "https://github.com/storybookjs/builder-vite/#readme", "dependencies": { "@joshwooding/vite-plugin-react-docgen-typescript": "0.0.2", "@mdx-js/mdx": "^1.6.22", diff --git a/packages/storybook-builder-vite/plugins/vue-docgen.ts b/packages/builder-vite/plugins/vue-docgen.ts similarity index 100% rename from packages/storybook-builder-vite/plugins/vue-docgen.ts rename to packages/builder-vite/plugins/vue-docgen.ts diff --git a/packages/storybook-builder-vite/source-loader-plugin.ts b/packages/builder-vite/source-loader-plugin.ts similarity index 100% rename from packages/storybook-builder-vite/source-loader-plugin.ts rename to packages/builder-vite/source-loader-plugin.ts diff --git a/packages/storybook-builder-vite/svelte/csf-plugin.ts b/packages/builder-vite/svelte/csf-plugin.ts similarity index 100% rename from packages/storybook-builder-vite/svelte/csf-plugin.ts rename to packages/builder-vite/svelte/csf-plugin.ts diff --git a/packages/storybook-builder-vite/transform-iframe-html.ts b/packages/builder-vite/transform-iframe-html.ts similarity index 100% rename from packages/storybook-builder-vite/transform-iframe-html.ts rename to packages/builder-vite/transform-iframe-html.ts diff --git a/packages/storybook-builder-vite/tsconfig.json b/packages/builder-vite/tsconfig.json similarity index 100% rename from packages/storybook-builder-vite/tsconfig.json rename to packages/builder-vite/tsconfig.json diff --git a/packages/storybook-builder-vite/types/envs-raw.type.ts b/packages/builder-vite/types/envs-raw.type.ts similarity index 100% rename from packages/storybook-builder-vite/types/envs-raw.type.ts rename to packages/builder-vite/types/envs-raw.type.ts diff --git a/packages/storybook-builder-vite/types/extended-options.type.ts b/packages/builder-vite/types/extended-options.type.ts similarity index 100% rename from packages/storybook-builder-vite/types/extended-options.type.ts rename to packages/builder-vite/types/extended-options.type.ts diff --git a/packages/storybook-builder-vite/types/index.ts b/packages/builder-vite/types/index.ts similarity index 100% rename from packages/storybook-builder-vite/types/index.ts rename to packages/builder-vite/types/index.ts diff --git a/packages/storybook-builder-vite/vite-config.ts b/packages/builder-vite/vite-config.ts similarity index 92% rename from packages/storybook-builder-vite/vite-config.ts rename to packages/builder-vite/vite-config.ts index fab02332..ed7943c7 100644 --- a/packages/storybook-builder-vite/vite-config.ts +++ b/packages/builder-vite/vite-config.ts @@ -58,7 +58,7 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig } catch (err) { if ((err as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND') { throw new Error( - 'storybook-builder-vite requires @vitejs/plugin-vue to be installed ' + + '@storybook/builder-vite requires @vitejs/plugin-vue to be installed ' + 'when using @storybook/vue or @storybook/vue3.' + ' Please install it and start storybook again.' ); @@ -73,7 +73,7 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig } catch (err) { if ((err as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND') { throw new Error( - 'storybook-builder-vite requires @sveltejs/vite-plugin-svelte to be installed when using @storybook/svelte.' + + '@storybook/builder-vite requires @sveltejs/vite-plugin-svelte to be installed when using @storybook/svelte.' + ' Please install it and start storybook again.' ); } @@ -86,7 +86,7 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig } catch (err) { if ((err as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND') { throw new Error( - 'storybook-builder-vite requires @storybook/addon-svelte-csf to be installed when using @storybook/svelte.' + + '@storybook/builder-vite requires @storybook/addon-svelte-csf to be installed when using @storybook/svelte.' + ' Please install it and start storybook again.' ); } diff --git a/packages/storybook-builder-vite/vite-server.ts b/packages/builder-vite/vite-server.ts similarity index 100% rename from packages/storybook-builder-vite/vite-server.ts rename to packages/builder-vite/vite-server.ts diff --git a/yarn.lock b/yarn.lock index 87d84f69..eab8316d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3325,6 +3325,28 @@ __metadata: languageName: node linkType: hard +"@storybook/builder-vite@workspace:*, @storybook/builder-vite@workspace:packages/builder-vite": + version: 0.0.0-use.local + resolution: "@storybook/builder-vite@workspace:packages/builder-vite" + dependencies: + "@joshwooding/vite-plugin-react-docgen-typescript": 0.0.2 + "@mdx-js/mdx": ^1.6.22 + "@storybook/csf-tools": ^6.3.3 + "@storybook/source-loader": ^6.3.12 + "@types/express": ^4.17.13 + "@vitejs/plugin-react": ^1.0.8 + es-module-lexer: ^0.9.3 + glob: ^7.2.0 + glob-promise: ^4.2.0 + slash: ^3.0.0 + vite-plugin-mdx: ^3.5.6 + vue-docgen-api: ^4.40.0 + peerDependencies: + "@storybook/core-common": ^6.4.3 + vite: ">=2.6.7" + languageName: unknown + linkType: soft + "@storybook/builder-webpack4@npm:6.5.0-alpha.49": version: 6.5.0-alpha.49 resolution: "@storybook/builder-webpack4@npm:6.5.0-alpha.49" @@ -9199,6 +9221,7 @@ __metadata: "@storybook/addon-a11y": ^6.5.0-alpha.49 "@storybook/addon-docs": ^6.5.0-alpha.49 "@storybook/addon-essentials": ^6.5.0-alpha.49 + "@storybook/builder-vite": "workspace:*" "@storybook/react": ^6.5.0-alpha.49 "@storybook/test-runner": ^0.0.4 http-server: ^14.1.0 @@ -9206,7 +9229,6 @@ __metadata: npm-run-all: ^4.1.5 react: ^16.4.14 react-dom: ^16.4.14 - storybook-builder-vite: "workspace:*" typescript: ^4.5.4 vite: 2.9.0-beta.8 wait-on: ^6.0.1 @@ -9220,6 +9242,7 @@ __metadata: "@storybook/addon-a11y": ^6.5.0-alpha.49 "@storybook/addon-docs": ^6.5.0-alpha.49 "@storybook/addon-essentials": ^6.5.0-alpha.49 + "@storybook/builder-vite": "workspace:*" "@storybook/react": ^6.5.0-alpha.49 "@storybook/test-runner": ^0.0.4 http-server: ^14.1.0 @@ -9227,7 +9250,6 @@ __metadata: npm-run-all: ^4.1.5 react: ^16.4.14 react-dom: ^16.4.14 - storybook-builder-vite: "workspace:*" vite: 2.9.0-beta.8 wait-on: ^6.0.1 languageName: unknown @@ -9241,6 +9263,7 @@ __metadata: "@storybook/addon-essentials": ^6.5.0-alpha.49 "@storybook/addon-links": ^6.5.0-alpha.49 "@storybook/addon-svelte-csf": ^1.1.0 + "@storybook/builder-vite": "workspace:*" "@storybook/svelte": ^6.5.0-alpha.49 "@storybook/test-runner": ^0.0.4 "@sveltejs/vite-plugin-svelte": ^1.0.0-next.37 @@ -9248,7 +9271,6 @@ __metadata: http-server: ^14.1.0 jest: ^27.5.1 npm-run-all: ^4.1.5 - storybook-builder-vite: "workspace:*" svelte: ^3.46.4 svelte-preprocess: ^4.10.4 typescript: ^4.5.5 @@ -9263,13 +9285,13 @@ __metadata: dependencies: "@storybook/addon-a11y": ^6.5.0-alpha.49 "@storybook/addon-essentials": ^6.5.0-alpha.49 + "@storybook/builder-vite": "workspace:*" "@storybook/test-runner": ^0.0.4 "@storybook/vue3": ^6.5.0-alpha.49 "@vitejs/plugin-vue": ^1.10.2 http-server: ^14.1.0 jest: ^27.5.1 npm-run-all: ^4.1.5 - storybook-builder-vite: "workspace:*" vite: 2.9.0-beta.8 vue: ^3.2.0 wait-on: ^6.0.1 @@ -9283,10 +9305,10 @@ __metadata: "@storybook/addon-a11y": ^6.5.0-alpha.49 "@storybook/addon-docs": ^6.5.0-alpha.49 "@storybook/addon-essentials": ^6.5.0-alpha.49 + "@storybook/builder-vite": "workspace:*" "@storybook/react": ^6.5.0-alpha.49 react: ^16.4.14 react-dom: ^16.4.14 - storybook-builder-vite: "workspace:*" vite: 2.9.0-beta.7 languageName: unknown linkType: soft @@ -17039,28 +17061,6 @@ fsevents@^1.2.7: languageName: unknown linkType: soft -"storybook-builder-vite@workspace:*, storybook-builder-vite@workspace:packages/storybook-builder-vite": - version: 0.0.0-use.local - resolution: "storybook-builder-vite@workspace:packages/storybook-builder-vite" - dependencies: - "@joshwooding/vite-plugin-react-docgen-typescript": 0.0.2 - "@mdx-js/mdx": ^1.6.22 - "@storybook/csf-tools": ^6.3.3 - "@storybook/source-loader": ^6.3.12 - "@types/express": ^4.17.13 - "@vitejs/plugin-react": ^1.0.8 - es-module-lexer: ^0.9.3 - glob: ^7.2.0 - glob-promise: ^4.2.0 - slash: ^3.0.0 - vite-plugin-mdx: ^3.5.6 - vue-docgen-api: ^4.40.0 - peerDependencies: - "@storybook/core-common": ^6.4.3 - vite: ">=2.6.7" - languageName: unknown - linkType: soft - "stream-browserify@npm:^2.0.1": version: 2.0.2 resolution: "stream-browserify@npm:2.0.2" From 7334e3832bb1ac85ff15d3d608697bc013c1e5d8 Mon Sep 17 00:00:00 2001 From: Michael Shilman Date: Wed, 30 Mar 2022 23:10:11 +0800 Subject: [PATCH 2/2] Fix linting --- packages/builder-vite/vite-config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/builder-vite/vite-config.ts b/packages/builder-vite/vite-config.ts index ed7943c7..5c19c1d9 100644 --- a/packages/builder-vite/vite-config.ts +++ b/packages/builder-vite/vite-config.ts @@ -73,7 +73,8 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig } catch (err) { if ((err as NodeJS.ErrnoException).code !== 'MODULE_NOT_FOUND') { throw new Error( - '@storybook/builder-vite requires @sveltejs/vite-plugin-svelte to be installed when using @storybook/svelte.' + + '@storybook/builder-vite requires @sveltejs/vite-plugin-svelte to be installed' + + ' when using @storybook/svelte.' + ' Please install it and start storybook again.' ); }