Skip to content

Commit

Permalink
fix: add missing peer deps (#500)
Browse files Browse the repository at this point in the history
* fix: add missing peer deps

* fix: add vue-docgen-api peer dep, improve error

* chore: update yarn.lock

* Update lockfile of packages

Co-authored-by: Ian VanSchooten <ian.vanschooten@gmail.com>
  • Loading branch information
adalinesimonian and IanVS authored Sep 28, 2022
1 parent f5cab5a commit 5b729ac
Show file tree
Hide file tree
Showing 13 changed files with 139 additions and 5 deletions.
9 changes: 9 additions & 0 deletions examples/lit-ts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2627,10 +2627,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/preact/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2650,10 +2650,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/react-18/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2706,10 +2706,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/react-ts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2725,10 +2725,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/react/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2731,10 +2731,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/svelte/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2636,10 +2636,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/vue2.6/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2724,10 +2724,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/vue2.7/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2724,10 +2724,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/vue3/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2889,10 +2889,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
9 changes: 9 additions & 0 deletions examples/workspaces/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2706,10 +2706,19 @@ __metadata:
sveltedoc-parser: ^4.2.1
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: node
linkType: soft

Expand Down
14 changes: 13 additions & 1 deletion packages/builder-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,23 @@
},
"peerDependencies": {
"@storybook/mdx2-csf": "^0.0.3",
"vite": ">= 3.0.0"
"@sveltejs/vite-plugin-svelte": "^1.0.0",
"@vitejs/plugin-vue": "^3.0.0",
"vite": ">= 3.0.0",
"vue-docgen-api": "^4.40.0"
},
"peerDependenciesMeta": {
"@storybook/mdx2-csf": {
"optional": true
},
"@sveltejs/vite-plugin-svelte": {
"optional": true
},
"@vitejs/plugin-vue": {
"optional": true
},
"vue-docgen-api": {
"optional": true
}
},
"publishConfig": {
Expand Down
31 changes: 27 additions & 4 deletions packages/builder-vite/vite-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,6 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig
try {
const vuePlugin = is27 ? require('@vitejs/plugin-vue2') : require('vite-plugin-vue2').createVuePlugin;
plugins.push(vuePlugin());
const { vueDocgen } = await import('./plugins/vue-docgen');
plugins.push(vueDocgen(2));
} catch (err) {
if ((err as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') {
throw new Error(`
Expand All @@ -104,14 +102,25 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig
}
throw err;
}
try {
const { vueDocgen } = await import('./plugins/vue-docgen');
plugins.push(vueDocgen(2));
} catch (err) {
if ((err as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') {
throw new Error(
'@storybook/builder-vite requires vue-docgen-api to be installed ' +
'when using @storybook/vue.' +
' Please install it and start storybook again.'
);
}
throw err;
}
}

if (framework === 'vue3') {
try {
const vuePlugin = require('@vitejs/plugin-vue');
plugins.push(vuePlugin());
const { vueDocgen } = await import('./plugins/vue-docgen');
plugins.push(vueDocgen(3));
} catch (err) {
if ((err as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') {
throw new Error(`
Expand All @@ -121,6 +130,20 @@ export async function pluginConfig(options: ExtendedOptions, _type: PluginConfig
}
throw err;
}

try {
const { vueDocgen } = await import('./plugins/vue-docgen');
plugins.push(vueDocgen(3));
} catch (err) {
if ((err as NodeJS.ErrnoException).code === 'MODULE_NOT_FOUND') {
throw new Error(
'@storybook/builder-vite requires vue-docgen-api to be installed ' +
'when using @storybook/vue3.' +
' Please install it and start storybook again.'
);
}
throw err;
}
}

if (framework === 'svelte') {
Expand Down
9 changes: 9 additions & 0 deletions packages/builder-vite/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1982,10 +1982,19 @@ __metadata:
vue-template-compiler: ^2.7.10
peerDependencies:
"@storybook/mdx2-csf": ^0.0.3
"@sveltejs/vite-plugin-svelte": ^1.0.0
"@vitejs/plugin-vue": ^3.0.0
vite: ">= 3.0.0"
vue-docgen-api: ^4.40.0
peerDependenciesMeta:
"@storybook/mdx2-csf":
optional: true
"@sveltejs/vite-plugin-svelte":
optional: true
"@vitejs/plugin-vue":
optional: true
vue-docgen-api:
optional: true
languageName: unknown
linkType: soft

Expand Down

0 comments on commit 5b729ac

Please sign in to comment.