mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-15 05:02:24 +08:00
Merge branch 'next' of github.com:storybookjs/storybook into deprecate-vite-cjs
This commit is contained in:
commit
7bdb8b6249
@ -322,7 +322,7 @@ jobs:
|
||||
at: .
|
||||
- run:
|
||||
name: Starting Event Collector
|
||||
command: yarn ts-node ./event-log-collector.ts
|
||||
command: node --loader esbuild-register/loader -r esbuild-register ./event-log-collector.ts
|
||||
working_directory: scripts
|
||||
background: true
|
||||
- run:
|
||||
@ -330,7 +330,12 @@ jobs:
|
||||
command: yarn task --task build --template $(yarn get-template --cadence << pipeline.parameters.workflow >> --task build) --no-link --start-from=never --junit
|
||||
- run:
|
||||
name: Verifying Telemetry
|
||||
command: yarn ts-node ./event-log-checker build $(yarn get-template --cadence << pipeline.parameters.workflow >> --task build)
|
||||
command: |
|
||||
TEMPLATE=$(yarn get-template --cadence << pipeline.parameters.workflow >> --task build)
|
||||
if [[ $TEMPLATE != bench/* ]]
|
||||
then
|
||||
node --loader esbuild-register/loader -r esbuild-register ./event-log-checker build $TEMPLATE
|
||||
fi
|
||||
working_directory: scripts
|
||||
- report-workflow-on-failure:
|
||||
template: $(yarn get-template --cadence << pipeline.parameters.workflow >> --task build)
|
||||
@ -640,4 +645,3 @@ workflows:
|
||||
# parallelism: 4
|
||||
# requires:
|
||||
# - create-sandboxes
|
||||
|
||||
|
40
.github/DISCUSSION_TEMPLATE/help.yml
vendored
Normal file
40
.github/DISCUSSION_TEMPLATE/help.yml
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
body:
|
||||
- type: markdown
|
||||
id: intro
|
||||
attributes:
|
||||
value: |
|
||||
Thanks for taking the time to start a new discussion!
|
||||
|
||||
### Before you post
|
||||
Check if someone has already asked/answered your question in a previous discussion.
|
||||
|
||||
### When you're ready to post
|
||||
Add labels to your discussion (e.g. React, Vue, Vite) to make it clearer for other users.
|
||||
|
||||
- type: textarea
|
||||
id: summary
|
||||
attributes:
|
||||
label: Summary
|
||||
description: How can we help?
|
||||
validations:
|
||||
required: true
|
||||
|
||||
- type: textarea
|
||||
id: additional-info
|
||||
attributes:
|
||||
label: Additional information
|
||||
description: |
|
||||
Share Your Storybook configuration (`main.js` or `main.ts`), your Storybook version number, any error messages, and any relevant dependencies. These help us get a clearer understanding of what might be going wrong.
|
||||
|
||||
P.S. Please [share code as text](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks) rather than as a screenshot! It makes debugging much easier and faster.
|
||||
validations:
|
||||
required: false
|
||||
|
||||
- type: input
|
||||
id: reproduction
|
||||
attributes:
|
||||
label: Create a reproduction
|
||||
description: |
|
||||
Help us debug by creating a minimal reproduction with [https://storybook.new](https://storybook.new). Learn more about creating a reproduction [here](https://storybook.js.org/docs/react/contribute/how-to-reproduce).
|
||||
validations:
|
||||
required: false
|
13
.github/ISSUE_TEMPLATE/config.yml
vendored
13
.github/ISSUE_TEMPLATE/config.yml
vendored
@ -3,15 +3,18 @@ contact_links:
|
||||
- name: View documentation 📚
|
||||
url: https://storybook.js.org/docs/
|
||||
about: Check out the official docs for answers to common questions.
|
||||
- name: Feature Requests 💡
|
||||
- name: Feature requests 💡
|
||||
url: https://github.com/storybookjs/storybook/discussions/new?category=ideas
|
||||
about: Suggest a feature idea for this project.
|
||||
- name: Open an RFC 🦄
|
||||
url: https://github.com/storybookjs/storybook/discussions/new?category=rfc
|
||||
about: Do you want to propose a more involved change to Storybook? Open an RFC (Request for Comments) to start a discussion.
|
||||
- name: Questions & discussions 🤔
|
||||
- name: Questions 💭
|
||||
url: https://github.com/storybookjs/storybook/discussions/new?category=help
|
||||
about: Need support with a Storybook problem? Open up a help request.
|
||||
- name: Discussions 🙌
|
||||
url: https://github.com/storybookjs/storybook/discussions
|
||||
about: Ask questions, show off your Storybook, etc.
|
||||
- name: Community Discord 💬
|
||||
about: Show off your Storybook or discuss the project.
|
||||
- name: Community Discord 🎉
|
||||
url: https://discord.gg/storybook
|
||||
about: Community discussions, interactive support, contributor help
|
||||
about: Meet other community members and get contributor help.
|
||||
|
@ -30,7 +30,10 @@ jobs:
|
||||
git config --global user.name "Storybook Bot"
|
||||
git config --global user.email "bot@storybook.js.org"
|
||||
- name: Install dependencies
|
||||
run: node ./scripts/check-dependencies.js
|
||||
run: |
|
||||
cd ./scripts
|
||||
node --experimental-modules ./check-dependencies.js
|
||||
cd ..
|
||||
- name: Compile Storybook libraries
|
||||
run: yarn task --task compile --start-from=auto --no-link
|
||||
- name: Publishing to local registry
|
||||
|
@ -30,7 +30,10 @@ jobs:
|
||||
git config --global user.name "Storybook Bot"
|
||||
git config --global user.email "bot@storybook.js.org"
|
||||
- name: Install dependencies
|
||||
run: node ./scripts/check-dependencies.js
|
||||
run: |
|
||||
cd ./scripts
|
||||
node --experimental-modules ./check-dependencies.js
|
||||
cd ..
|
||||
- name: Compile Storybook libraries
|
||||
run: yarn task --task compile --start-from=auto --no-link
|
||||
- name: Publishing to local registry
|
||||
|
@ -1,3 +1,35 @@
|
||||
## 7.6.0-alpha.6
|
||||
|
||||
- Addon: Move Visual Test addon to the code directory - [#24771](https://github.com/storybookjs/storybook/pull/24771), thanks [@cdedreuille](https://github.com/cdedreuille)!
|
||||
- FastBuild: Improve config loading & naming - [#24837](https://github.com/storybookjs/storybook/pull/24837), thanks [@ndelangen](https://github.com/ndelangen)!
|
||||
- TestBuild: Revert defaulting to SWC in test build, but keep using esbuild for minification - [#24843](https://github.com/storybookjs/storybook/pull/24843), thanks [@kasperpeulen](https://github.com/kasperpeulen)!
|
||||
- Viewport: Add newer device viewports - [#24777](https://github.com/storybookjs/storybook/pull/24777), thanks [@Tomo5524](https://github.com/Tomo5524)!
|
||||
- Vite: Prevent non-deterministic build output - [#24833](https://github.com/storybookjs/storybook/pull/24833), thanks [@henkerik](https://github.com/henkerik)!
|
||||
|
||||
## 7.6.0-alpha.5
|
||||
|
||||
- Addons, core: Make `react` and Storybook packages `devDependencies` where possible - [#24676](https://github.com/storybookjs/storybook/pull/24676), thanks [@JReinhold](https://github.com/JReinhold)!
|
||||
- Angular: Handle nested module metadata - [#24798](https://github.com/storybookjs/storybook/pull/24798), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
- Angular: Include object configured styles - [#24768](https://github.com/storybookjs/storybook/pull/24768), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
- Angular: Support v17 - [#24717](https://github.com/storybookjs/storybook/pull/24717), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
- ReactNative: Fix missing assert dep in docs-tools - [#24732](https://github.com/storybookjs/storybook/pull/24732), thanks [@dannyhw](https://github.com/dannyhw)!
|
||||
- SWC: Add settings for react and preact - [#24805](https://github.com/storybookjs/storybook/pull/24805), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
- Svelte: Fix source with decorators always showing the `SlotDecorator` component - [#24800](https://github.com/storybookjs/storybook/pull/24800), thanks [@JReinhold](https://github.com/JReinhold)!
|
||||
- TestBuild: Disable composition when `--test` is `true` - [#24799](https://github.com/storybookjs/storybook/pull/24799), thanks [@ndelangen](https://github.com/ndelangen)!
|
||||
- TestBuild: Disable docs related stuff for test builds - [#24691](https://github.com/storybookjs/storybook/pull/24691), thanks [@ndelangen](https://github.com/ndelangen)!
|
||||
- TestBuild: Disable telemetry for test builds - [#24706](https://github.com/storybookjs/storybook/pull/24706), thanks [@kasperpeulen](https://github.com/kasperpeulen)!
|
||||
- TestBuild: Disable warnOnIncompatibleAddons - [#24797](https://github.com/storybookjs/storybook/pull/24797), thanks [@ndelangen](https://github.com/ndelangen)!
|
||||
- TestBuild: Globalize `@storybook/blocks` if `build.test.emptyBlocks` is `true` - [#24650](https://github.com/storybookjs/storybook/pull/24650), thanks [@ndelangen](https://github.com/ndelangen)!
|
||||
- TestBuild: Implement builder options for test build - [#24826](https://github.com/storybookjs/storybook/pull/24826), thanks [@kasperpeulen](https://github.com/kasperpeulen)!
|
||||
- TestBuild: No sourcemaps for test builds - [#24804](https://github.com/storybookjs/storybook/pull/24804), thanks [@ndelangen](https://github.com/ndelangen)!
|
||||
- UI: Fix horizontal scroll bar in Canvas hidden by styling - [#24408](https://github.com/storybookjs/storybook/pull/24408), thanks [@yoshi2no](https://github.com/yoshi2no)!
|
||||
- UI: Logo fixed value - [#24726](https://github.com/storybookjs/storybook/pull/24726), thanks [@black-arm](https://github.com/black-arm)!
|
||||
- UI: improve A11Y remove redundant styling rules, update icon color - [#24402](https://github.com/storybookjs/storybook/pull/24402), thanks [@tolkadot](https://github.com/tolkadot)!
|
||||
- Webpack5: Add export-order-loader and remove babel-plugin-named-exports-order - [#24749](https://github.com/storybookjs/storybook/pull/24749), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
- Webpack5: Add react-docgen loader and remove babel-plugin-react-docgen - [#24762](https://github.com/storybookjs/storybook/pull/24762), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
- Webpack5: Fix race condition for export-order loader - [#24817](https://github.com/storybookjs/storybook/pull/24817), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
- Webpack5: Hide critical dependency warning - [#24784](https://github.com/storybookjs/storybook/pull/24784), thanks [@valentinpalkovic](https://github.com/valentinpalkovic)!
|
||||
|
||||
## 7.6.0-alpha.4
|
||||
|
||||
- CLI: Ensure errors with opening the browser are caught - [#24668](https://github.com/storybookjs/storybook/pull/24668), thanks [@xueyawei](https://github.com/xueyawei)!
|
||||
|
96
MIGRATION.md
96
MIGRATION.md
@ -1,12 +1,14 @@
|
||||
<h1>Migration</h1>
|
||||
|
||||
- [From version 7.5.0 to 7.6.0](#from-version-750-to-760)
|
||||
- [CommonJS with Vite is deprecated](#commonjs-with-vite-is-deprecated)
|
||||
- [Using implicit actions during rendering is deprecated](#using-implicit-actions-during-rendering-is-deprecated)
|
||||
- [typescript.skipBabel deprecated](#typescriptskipbabel-deprecated)
|
||||
- [Primary doc block accepts of prop](#primary-doc-block-accepts-of-prop)
|
||||
- [Addons no longer need a peer dependency on React](#addons-no-longer-need-a-peer-dependency-on-react)
|
||||
- [From version 7.4.0 to 7.5.0](#from-version-740-to-750)
|
||||
- [`storyStoreV6` and `storiesOf` is deprecated](#storystorev6-and-storiesof-is-deprecated)
|
||||
- [`storyIndexers` is replaced with `experimental_indexers`](#storyindexers-is-replaced-with-experimental_indexers)
|
||||
- [From version 7.3.0 to 7.4.0](#from-version-730-to-740)
|
||||
- [CommonJS with Vite is deprecated](#commonjs-with-vite-is-deprecated)
|
||||
- [From version 7.0.0 to 7.2.0](#from-version-700-to-720)
|
||||
- [Addon API is more type-strict](#addon-api-is-more-type-strict)
|
||||
- [From version 6.5.x to 7.0.0](#from-version-65x-to-700)
|
||||
@ -311,10 +313,92 @@
|
||||
|
||||
## From version 7.5.0 to 7.6.0
|
||||
|
||||
#### CommonJS with Vite is deprecated
|
||||
|
||||
Using CommonJS in the `main` configuration with `main.cjs` or `main.cts` is deprecated, and will be removed in Storybook 8.0. This is a necessary change because [Vite will remove support for CommonJS in an upcoming release](https://github.com/vitejs/vite/discussions/13928).
|
||||
|
||||
You can address this by converting your `main` configuration file to ESM syntax and renaming it to `main.mjs` or `main.mts` if your project does not have `"type": "module"` in its `package.json`. To convert the config file to ESM you will need to replace any CommonJS syntax like `require()`, `module.exports`, or `__dirname`. If you haven't already, you may also consider adding `"type": "module"` to your package.json and converting your project to ESM.
|
||||
|
||||
#### Using implicit actions during rendering is deprecated
|
||||
|
||||
In Storybook 7, we inferred if the component accepts any action props,
|
||||
by checking if it starts with `onX` (for example `onClick`), or as configured by `actions.argTypesRegex`.
|
||||
If that was the case, we would fill in jest spies for those args automatically.
|
||||
|
||||
```ts
|
||||
export default {
|
||||
component: Button,
|
||||
};
|
||||
|
||||
export const ButtonClick = {
|
||||
play: async ({ args, canvasElement }) => {
|
||||
await userEvent.click(within(canvasElement).getByRole('button'));
|
||||
// args.onClick is a jest spy in 7.0
|
||||
await expect(args.onClick).toHaveBeenCalled();
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
In Storybook 8 this feature will be removed, and spies have to added explicitly:
|
||||
|
||||
```ts
|
||||
import { fn } from '@storybook/test';
|
||||
|
||||
export default {
|
||||
component: Button,
|
||||
args: {
|
||||
onClick: fn(),
|
||||
},
|
||||
};
|
||||
|
||||
export const ButtonClick = {
|
||||
play: async ({ args, canvasElement }) => {
|
||||
await userEvent.click(within(canvasElement).getByRole('button'));
|
||||
await expect(args.onClick).toHaveBeenCalled();
|
||||
},
|
||||
};
|
||||
```
|
||||
|
||||
For more context, see this RFC:
|
||||
https://github.com/storybookjs/storybook/discussions/23649
|
||||
|
||||
To summarize:
|
||||
|
||||
- This makes CSF files less magical and more portable, so that CSF files will render the same in a test environment where docgen is not available.
|
||||
- This allows users and (test) integrators to run or build storybook without docgen, boosting the user performance and allows tools to give quicker feedback.
|
||||
- This will make sure that we can one day lazy load docgen, without changing how stories are rendered.
|
||||
|
||||
#### typescript.skipBabel deprecated
|
||||
|
||||
We will remove the `typescript.skipBabel` option in Storybook 8.0.0. Please use `typescirpt.skipCompiler` instead.
|
||||
|
||||
#### Primary doc block accepts of prop
|
||||
|
||||
The `Primary` doc block now also accepts an `of` prop as described in the [Doc Blocks](#doc-blocks) section. It still accepts being passed `name` or no props at all.
|
||||
|
||||
#### Addons no longer need a peer dependency on React
|
||||
|
||||
Historically the majority of addons have had a peer dependency on React and a handful of Storybook core packages. In most cases this has not been necessary since 7.0 because the Storybook manager makes those available on the global scope. It has created an unnecessary burden for users in non-React projects.
|
||||
|
||||
We've migrated all the core addons (except for `addon-docs`) to not depend on these packages by:
|
||||
|
||||
1. Moving `react`, `react-dom` and the globalized Storybook packages from `peerDependencies` to `devDependencies`
|
||||
2. Added the list of globalized packages to the `externals` property in the `tsup` configuration, to ensure they are not part of the bundle.
|
||||
|
||||
As of Storybook 7.6.0 the list of globalized packages can be imported like this:
|
||||
|
||||
```ts
|
||||
// tsup.config.ts
|
||||
|
||||
import { globalPackages as globalManagerPackages } from '@storybook/manager/globals';
|
||||
import { globalPackages as globalPreviewPackages } from '@storybook/preview/globals';
|
||||
|
||||
const allGlobalPackages = [...globalManagerPackages, ...globalPreviewPackages];
|
||||
```
|
||||
|
||||
We recommend checking out [the updates we've made to the addon-kit](https://github.com/storybookjs/addon-kit/pull/60/files#diff-8fed899bdbc24789a7bb4973574e624ed6207c6ce572338bc3c3e117672b2a20), that can serve as a base for the changes you can do in your own addon. These changes are not necessary for your addon to keep working, but they will remove the need for your users to unnecessary install `react` and `react-dom` to their projects, and they'll significantly reduce the install size of your addon.
|
||||
These changes should not be breaking for your users, unless you support Storybook pre-v7.
|
||||
|
||||
## From version 7.4.0 to 7.5.0
|
||||
|
||||
#### `storyStoreV6` and `storiesOf` is deprecated
|
||||
@ -381,14 +465,6 @@ export default {
|
||||
|
||||
As an addon author you can support previous versions of Storybook by setting both `storyIndexers` and `indexers_experimental`, without triggering the deprecation warning.
|
||||
|
||||
## From version 7.3.0 to 7.4.0
|
||||
|
||||
#### CommonJS with Vite is deprecated
|
||||
|
||||
Using CommonJS in the `main` configuration with `main.cjs` or `main.cts` is deprecated, and will be removed in Storybook 8.0. This is a necessary change because [Vite will remove support for CommonJS in an upcoming release](https://github.com/vitejs/vite/discussions/13928).
|
||||
|
||||
You can address this by converting your `main` configuration file to ESM syntax and renaming it to `main.mjs` or `main.mts` if your project does not have `"type": "module"` in its `package.json`. To convert the config file to ESM you will need to replace any CommonJS syntax like `require()`, `module.exports`, or `__dirname`. If you haven't already, you may also consider adding `"type": "module"` to your package.json and converting your project to ESM.
|
||||
|
||||
## From version 7.0.0 to 7.2.0
|
||||
|
||||
#### Addon API is more type-strict
|
||||
|
@ -1,10 +1,22 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const scriptPath = path.join(__dirname, '..', 'scripts');
|
||||
|
||||
const addonsPackages = fs
|
||||
.readdirSync(path.join(__dirname, 'addons'))
|
||||
.filter((p) => fs.statSync(path.join(__dirname, 'addons', p)).isDirectory());
|
||||
const libPackages = fs
|
||||
.readdirSync(path.join(__dirname, 'lib'))
|
||||
.filter((p) => fs.statSync(path.join(__dirname, 'lib', p)).isDirectory());
|
||||
const uiPackages = fs
|
||||
.readdirSync(path.join(__dirname, 'ui'))
|
||||
.filter((p) => fs.statSync(path.join(__dirname, 'ui', p)).isDirectory())
|
||||
.filter((p) => !p.startsWith('.'));
|
||||
|
||||
module.exports = {
|
||||
root: true,
|
||||
extends: [path.join(scriptPath, '.eslintrc.js')],
|
||||
extends: [path.join(scriptPath, '.eslintrc.cjs')],
|
||||
parserOptions: {
|
||||
tsconfigRootDir: __dirname,
|
||||
project: ['./tsconfig.json'],
|
||||
@ -53,7 +65,6 @@ module.exports = {
|
||||
project: null,
|
||||
},
|
||||
rules: {
|
||||
// '@typescript-eslint/no-var-requires': 'off',
|
||||
'@typescript-eslint/dot-notation': 'off',
|
||||
'@typescript-eslint/no-implied-eval': 'off',
|
||||
'@typescript-eslint/no-throw-literal': 'off',
|
||||
@ -77,15 +88,7 @@ module.exports = {
|
||||
},
|
||||
{
|
||||
// these packages use pre-bundling, dependencies will be bundled, and will be in devDepenencies
|
||||
files: [
|
||||
'addons/**/*',
|
||||
'frameworks/**/*',
|
||||
'lib/**/*',
|
||||
'builders/**/*',
|
||||
'deprecated/**/*',
|
||||
'renderers/**/*',
|
||||
'ui/**/*',
|
||||
],
|
||||
files: ['frameworks/**/*', 'builders/**/*', 'deprecated/**/*', 'renderers/**/*'],
|
||||
excludedFiles: ['frameworks/angular/**/*', 'frameworks/ember/**/*', 'lib/core-server/**/*'],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': [
|
||||
@ -95,11 +98,47 @@ module.exports = {
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/ui/*', '**/ui/.storybook/*'],
|
||||
files: ['**/ui/.storybook/**'],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': ['error', { packageDir: __dirname }],
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{ packageDir: [__dirname], devDependencies: true },
|
||||
],
|
||||
},
|
||||
},
|
||||
...addonsPackages.map((directory) => ({
|
||||
files: [path.join('**', 'addons', directory, '**', '*.*')],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
packageDir: [__dirname, path.join(__dirname, 'addons', directory)],
|
||||
devDependencies: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
})),
|
||||
...uiPackages.map((directory) => ({
|
||||
files: [path.join('**', 'ui', directory, '**', '*.*')],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{ packageDir: [__dirname, path.join(__dirname, 'ui', directory)], devDependencies: true },
|
||||
],
|
||||
},
|
||||
})),
|
||||
...libPackages.map((directory) => ({
|
||||
files: [path.join('**', 'lib', directory, '**', '*.*')],
|
||||
rules: {
|
||||
'import/no-extraneous-dependencies': [
|
||||
'error',
|
||||
{
|
||||
packageDir: [__dirname, path.join(__dirname, 'lib', directory)],
|
||||
devDependencies: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
})),
|
||||
{
|
||||
files: [
|
||||
'**/__tests__/**',
|
||||
@ -121,16 +160,24 @@ module.exports = {
|
||||
'react/require-default-props': 'off',
|
||||
},
|
||||
},
|
||||
{ files: '**/.storybook/config.js', rules: { 'global-require': 'off' } },
|
||||
{
|
||||
files: ['**/*.stories.*'],
|
||||
rules: {
|
||||
'no-console': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/renderers/preact/**/*'],
|
||||
rules: {
|
||||
'react/react-in-jsx-scope': 'off',
|
||||
'react/prop-types': 'off',
|
||||
},
|
||||
},
|
||||
{
|
||||
files: ['**/*.tsx', '**/*.ts'],
|
||||
rules: {
|
||||
'no-shadow': 'off',
|
||||
'@typescript-eslint/ban-types': 'warn', // should become error, in the future
|
||||
'react/require-default-props': 'off',
|
||||
'react/prop-types': 'off', // we should use types
|
||||
'react/forbid-prop-types': 'off', // we should use types
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-a11y",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Test component compliance with web accessibility standards",
|
||||
"keywords": [
|
||||
"a11y",
|
||||
@ -32,21 +32,9 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
@ -60,48 +48,41 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addon-highlight": "workspace:*",
|
||||
"axe-core": "^4.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/channels": "workspace:*",
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"axe-core": "^4.2.0",
|
||||
"lodash": "^4.17.21",
|
||||
"react-resize-detector": "^7.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@testing-library/react": "^11.2.2",
|
||||
"lodash": "^4.17.21",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"react-resize-detector": "^7.1.2",
|
||||
"resize-observer-polyfill": "^1.5.1",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-actions",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Get UI feedback when an action is performed on an interactive element",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -33,21 +33,9 @@
|
||||
"require": "./dist/decorator.js",
|
||||
"import": "./dist/decorator.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./register.js": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./register.js": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
@ -58,14 +46,8 @@
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
],
|
||||
"decorator": [
|
||||
"dist/decorator.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
@ -77,52 +59,42 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@types/uuid": "^9.0.1",
|
||||
"dequal": "^2.0.2",
|
||||
"polished": "^4.2.2",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"dequal": "^2.0.2",
|
||||
"lodash": "^4.17.21",
|
||||
"polished": "^4.2.2",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"react-inspector": "^6.0.0",
|
||||
"telejson": "^7.2.0",
|
||||
"ts-dedent": "^2.0.0",
|
||||
"uuid": "^9.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/lodash": "^4.14.167",
|
||||
"@types/uuid": "^9.0.1",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"exportEntries": [
|
||||
"./src/decorator.ts",
|
||||
"./src/manager.tsx",
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
|
@ -19,6 +19,7 @@ export const inferActionsFromArgTypesRegex: ArgsEnhancer<Renderer> = (context) =
|
||||
const {
|
||||
initialArgs,
|
||||
argTypes,
|
||||
id,
|
||||
parameters: { actions },
|
||||
} = context;
|
||||
if (!actions || actions.disable || !actions.argTypesRegex || !argTypes) {
|
||||
@ -32,7 +33,7 @@ export const inferActionsFromArgTypesRegex: ArgsEnhancer<Renderer> = (context) =
|
||||
|
||||
return argTypesMatchingRegex.reduce((acc, [name, argType]) => {
|
||||
if (isInInitialArgs(name, initialArgs)) {
|
||||
acc[name] = action(name, { implicit: true });
|
||||
acc[name] = action(name, { implicit: true, id });
|
||||
}
|
||||
return acc;
|
||||
}, {} as Args);
|
||||
|
@ -5,6 +5,7 @@ interface Options {
|
||||
clearOnStoryChange: boolean;
|
||||
limit: number;
|
||||
implicit: boolean;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export type ActionOptions = Partial<Options> & Partial<TelejsonOptions>;
|
||||
|
@ -1,5 +1,9 @@
|
||||
import { v4 as uuidv4 } from 'uuid';
|
||||
import type { PreviewWeb } from '@storybook/preview-api';
|
||||
import { addons } from '@storybook/preview-api';
|
||||
import type { Renderer } from '@storybook/types';
|
||||
import { global } from '@storybook/global';
|
||||
import { ImplicitActionsDuringRendering } from '@storybook/core-events/preview-errors';
|
||||
import { EVENT_ID } from '../constants';
|
||||
import type { ActionDisplay, ActionOptions, HandlerFunction } from '../models';
|
||||
import { config } from './configureActions';
|
||||
@ -54,22 +58,31 @@ export function action(name: string, options: ActionOptions = {}): HandlerFuncti
|
||||
};
|
||||
|
||||
const handler = function actionHandler(...args: any[]) {
|
||||
// TODO: Enable once codemods are finished
|
||||
// if (options.implicit) {
|
||||
// const preview =
|
||||
// '__STORYBOOK_PREVIEW__' in global
|
||||
// ? (global.__STORYBOOK_PREVIEW__ as PreviewWeb<Renderer>)
|
||||
// : undefined;
|
||||
// if (
|
||||
// preview?.storyRenders.some(
|
||||
// (render) => render.phase === 'playing' || render.phase === 'rendering'
|
||||
// )
|
||||
// ) {
|
||||
// console.warn(
|
||||
// 'Can not use implicit actions during rendering or playing of a story.'
|
||||
// );
|
||||
// }
|
||||
// }
|
||||
if (options.implicit) {
|
||||
const preview =
|
||||
'__STORYBOOK_PREVIEW__' in global
|
||||
? // eslint-disable-next-line no-underscore-dangle
|
||||
(global.__STORYBOOK_PREVIEW__ as PreviewWeb<Renderer>)
|
||||
: undefined;
|
||||
const storyRenderer = preview?.storyRenders.find(
|
||||
(render) => render.phase === 'playing' || render.phase === 'rendering'
|
||||
);
|
||||
|
||||
if (storyRenderer) {
|
||||
const deprecated = !window?.FEATURES?.disallowImplicitActionsInRenderV8;
|
||||
const error = new ImplicitActionsDuringRendering({
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
phase: storyRenderer.phase!,
|
||||
name,
|
||||
deprecated,
|
||||
});
|
||||
if (deprecated) {
|
||||
console.warn(error);
|
||||
} else {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const channel = addons.getChannel();
|
||||
// this makes sure that in js enviroments like react native you can still get an id
|
||||
|
1
code/addons/actions/src/typings.d.ts
vendored
Normal file
1
code/addons/actions/src/typings.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
declare var FEATURES: import('@storybook/types').StorybookConfig['features'];
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-backgrounds",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Switch backgrounds to view components in different settings",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -32,39 +32,14 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -73,43 +48,36 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"memoizerific": "^1.11.3",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-controls",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Interact with component inputs dynamically in the Storybook UI",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -32,31 +32,13 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -65,44 +47,36 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/blocks": "workspace:*",
|
||||
"lodash": "^4.17.21",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-common": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/node-logger": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"lodash": "^4.17.21",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx"
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"platform": "browser"
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17",
|
||||
"storybook": {
|
||||
|
@ -156,10 +156,8 @@ export default {
|
||||
|
||||
`csfPluginOptions` is an object for configuring `@storybook/csf-plugin`. When set to `null` it tells docs not to run the `csf-plugin` at all, which can be used as an optimization, or if you're already using `csf-plugin` in your `main.js`.
|
||||
|
||||
|
||||
> With the release of version 7.0, it is no longer possible to import `.md` files directly into Storybook using the `transcludeMarkdown` [option](https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#importing-plain-markdown-files-with-transcludemarkdown-has-changed). Instead, we recommend using the [`Markdown`](https://storybook.js.org/docs/react/api/doc-block-markdown) Doc Block for importing Markdown files into your Storybook documentation.
|
||||
|
||||
|
||||
## TypeScript configuration
|
||||
|
||||
As of SB6 [TypeScript is zero-config](https://storybook.js.org/docs/react/configure/typescript) and should work with SB Docs out of the box. For advanced configuration options, refer to the [Props documentation](https://github.com/storybookjs/storybook/tree/next/code/addons/docs/docs/props-tables.md).
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-docs",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Document component usage and properties in Markdown",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -94,8 +94,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/transform": "^29.3.1",
|
||||
|
@ -7,13 +7,14 @@ export function ensureReactPeerDeps() {
|
||||
require.resolve('react-dom');
|
||||
} catch (e) {
|
||||
logger.error(dedent`
|
||||
Starting in 7.0, react and react-dom are now required peer dependencies of Storybook.
|
||||
Starting in 7.0, react and react-dom are now required peer dependencies of @storybook/addon-docs.
|
||||
https://github.com/storybookjs/storybook/blob/next/MIGRATION.md#react-peer-dependencies-required
|
||||
|
||||
It seems that you haven't run Storybook's CLI to upgrade to the latest version.
|
||||
The upgrade command will install the required peer dependencies for you and will take
|
||||
care of other important auto migrations as well.
|
||||
You can continue to use Storybook without addon-docs, or you can install react and react-dom in your project:
|
||||
|
||||
You can use the upgrade command in Storybook's CLI to automatically install the required
|
||||
peer dependencies for you.
|
||||
|
||||
If you want to upgrade to the latest prerelease version, please run:
|
||||
|
||||
$ npx storybook@next upgrade --prerelease
|
||||
|
@ -194,4 +194,12 @@ const docsX = docs as any;
|
||||
|
||||
ensureReactPeerDeps();
|
||||
|
||||
export { webpackX as webpack, indexersX as experimental_indexers, docsX as docs };
|
||||
const optimizeViteDeps = [
|
||||
'@mdx-js/react',
|
||||
'@storybook/addon-docs > acorn-jsx',
|
||||
'@storybook/addon-docs',
|
||||
'@storybook/addon-essentials/docs/mdx-react-shim',
|
||||
'markdown-to-jsx',
|
||||
];
|
||||
|
||||
export { webpackX as webpack, indexersX as experimental_indexers, docsX as docs, optimizeViteDeps };
|
||||
|
1
code/addons/docs/src/typings.d.ts
vendored
1
code/addons/docs/src/typings.d.ts
vendored
@ -1,7 +1,6 @@
|
||||
declare module '@egoist/vue-to-react';
|
||||
declare module 'remark-slug';
|
||||
declare module 'remark-external-links';
|
||||
declare module 'babel-plugin-react-docgen';
|
||||
declare module 'acorn-jsx';
|
||||
declare module 'vue/dist/vue';
|
||||
declare module '@storybook/mdx1-csf';
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-essentials",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Curated addons to bring out the best of Storybook",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -28,81 +28,21 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./actions/preview": {
|
||||
"types": "./dist/actions/preview.d.ts",
|
||||
"require": "./dist/actions/preview.js",
|
||||
"import": "./dist/actions/preview.mjs"
|
||||
},
|
||||
"./actions/manager": {
|
||||
"types": "./dist/actions/manager.d.ts",
|
||||
"require": "./dist/actions/manager.js",
|
||||
"import": "./dist/actions/manager.mjs"
|
||||
},
|
||||
"./backgrounds/preview": {
|
||||
"types": "./dist/backgrounds/preview.d.ts",
|
||||
"require": "./dist/backgrounds/preview.js",
|
||||
"import": "./dist/backgrounds/preview.mjs"
|
||||
},
|
||||
"./backgrounds/manager": {
|
||||
"types": "./dist/backgrounds/manager.d.ts",
|
||||
"require": "./dist/backgrounds/manager.js",
|
||||
"import": "./dist/backgrounds/manager.mjs"
|
||||
},
|
||||
"./controls/manager": {
|
||||
"types": "./dist/controls/manager.d.ts",
|
||||
"require": "./dist/controls/manager.js",
|
||||
"import": "./dist/controls/manager.mjs"
|
||||
},
|
||||
"./docs/preview": {
|
||||
"types": "./dist/docs/preview.d.ts",
|
||||
"require": "./dist/docs/preview.js",
|
||||
"import": "./dist/docs/preview.mjs"
|
||||
},
|
||||
"./docs/preset": {
|
||||
"types": "./dist/docs/preset.d.ts",
|
||||
"require": "./dist/docs/preset.js",
|
||||
"import": "./dist/docs/preset.mjs"
|
||||
},
|
||||
"./docs/mdx-react-shim": {
|
||||
"types": "./dist/docs/mdx-react-shim.d.ts",
|
||||
"require": "./dist/docs/mdx-react-shim.js",
|
||||
"import": "./dist/docs/mdx-react-shim.mjs"
|
||||
},
|
||||
"./highlight/preview": {
|
||||
"types": "./dist/highlight/preview.d.ts",
|
||||
"require": "./dist/highlight/preview.js",
|
||||
"import": "./dist/highlight/preview.mjs"
|
||||
},
|
||||
"./measure/preview": {
|
||||
"types": "./dist/measure/preview.d.ts",
|
||||
"require": "./dist/measure/preview.js",
|
||||
"import": "./dist/measure/preview.mjs"
|
||||
},
|
||||
"./measure/manager": {
|
||||
"types": "./dist/measure/manager.d.ts",
|
||||
"require": "./dist/measure/manager.js",
|
||||
"import": "./dist/measure/manager.mjs"
|
||||
},
|
||||
"./outline/preview": {
|
||||
"types": "./dist/outline/preview.d.ts",
|
||||
"require": "./dist/outline/preview.js",
|
||||
"import": "./dist/outline/preview.mjs"
|
||||
},
|
||||
"./outline/manager": {
|
||||
"types": "./dist/outline/manager.d.ts",
|
||||
"require": "./dist/outline/manager.js",
|
||||
"import": "./dist/outline/manager.mjs"
|
||||
},
|
||||
"./toolbars/manager": {
|
||||
"types": "./dist/toolbars/manager.d.ts",
|
||||
"require": "./dist/toolbars/manager.js",
|
||||
"import": "./dist/toolbars/manager.mjs"
|
||||
},
|
||||
"./viewport/manager": {
|
||||
"types": "./dist/viewport/manager.d.ts",
|
||||
"require": "./dist/viewport/manager.js",
|
||||
"import": "./dist/viewport/manager.mjs"
|
||||
},
|
||||
"./actions/preview": "./dist/actions/preview.js",
|
||||
"./actions/manager": "./dist/actions/manager.js",
|
||||
"./backgrounds/preview": "./dist/backgrounds/preview.js",
|
||||
"./backgrounds/manager": "./dist/backgrounds/manager.js",
|
||||
"./controls/manager": "./dist/controls/manager.js",
|
||||
"./docs/preview": "./dist/docs/preview.js",
|
||||
"./docs/preset": "./dist/docs/preset.js",
|
||||
"./docs/mdx-react-shim": "./dist/docs/mdx-react-shim.js",
|
||||
"./highlight/preview": "./dist/highlight/preview.js",
|
||||
"./measure/preview": "./dist/measure/preview.js",
|
||||
"./measure/manager": "./dist/measure/manager.js",
|
||||
"./outline/preview": "./dist/outline/preview.js",
|
||||
"./outline/manager": "./dist/outline/manager.js",
|
||||
"./toolbars/manager": "./dist/toolbars/manager.js",
|
||||
"./viewport/manager": "./dist/viewport/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
@ -116,8 +56,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addon-actions": "workspace:*",
|
||||
@ -147,25 +87,28 @@
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"nodeEntries": [
|
||||
"./src/index.ts",
|
||||
"./src/actions/preview.ts",
|
||||
"./src/docs/preset.ts",
|
||||
"./src/docs/mdx-react-shim.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/actions/manager.ts",
|
||||
"./src/backgrounds/preview.ts",
|
||||
"./src/backgrounds/manager.ts",
|
||||
"./src/controls/manager.ts",
|
||||
"./src/docs/preview.ts",
|
||||
"./src/docs/preset.ts",
|
||||
"./src/docs/mdx-react-shim.ts",
|
||||
"./src/highlight/preview.ts",
|
||||
"./src/measure/preview.ts",
|
||||
"./src/measure/manager.ts",
|
||||
"./src/outline/preview.ts",
|
||||
"./src/outline/manager.ts",
|
||||
"./src/toolbars/manager.ts",
|
||||
"./src/viewport/manager.ts"
|
||||
],
|
||||
"platform": "node"
|
||||
"previewEntries": [
|
||||
"./src/actions/preview.ts",
|
||||
"./src/backgrounds/preview.ts",
|
||||
"./src/docs/preview.ts",
|
||||
"./src/highlight/preview.ts",
|
||||
"./src/measure/preview.ts",
|
||||
"./src/outline/preview.ts"
|
||||
]
|
||||
},
|
||||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17"
|
||||
}
|
||||
|
@ -1,4 +1,3 @@
|
||||
/* eslint-disable import/export */
|
||||
// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered
|
||||
|
||||
export * from '@storybook/addon-actions/preview';
|
||||
|
@ -1 +1,2 @@
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-backgrounds/manager';
|
||||
|
@ -1,4 +1,2 @@
|
||||
/* eslint-disable import/export */
|
||||
// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered
|
||||
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-backgrounds/preview';
|
||||
|
@ -1 +1,2 @@
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-controls/manager';
|
||||
|
@ -1,4 +1,2 @@
|
||||
/* eslint-disable import/export */
|
||||
// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered
|
||||
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-highlight/preview';
|
||||
|
@ -1 +1,2 @@
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-measure/manager';
|
||||
|
@ -1,4 +1,2 @@
|
||||
/* eslint-disable import/export */
|
||||
// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered
|
||||
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-measure/preview';
|
||||
|
@ -1 +1,2 @@
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-outline/manager';
|
||||
|
@ -1,4 +1,2 @@
|
||||
/* eslint-disable import/export */
|
||||
// TODO: We need to configure an eslint-import typescript resolver for export maps to be considered
|
||||
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-outline/preview';
|
||||
|
@ -1 +1,2 @@
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-toolbars/manager';
|
||||
|
@ -1 +1,2 @@
|
||||
// @ts-expect-error (no types needed for this)
|
||||
export * from '@storybook/addon-viewport/manager';
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-mdx-gfm",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "GitHub Flavored Markdown in Storybook",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -25,16 +25,8 @@
|
||||
},
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"node": "./dist/index.js",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./preset": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"node": "./dist/index.js",
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
".": "./dist/index.js",
|
||||
"./preset": "./dist/index.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
@ -48,8 +40,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/node-logger": "workspace:*",
|
||||
@ -63,11 +55,8 @@
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"nodeEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"formats": [
|
||||
"cjs"
|
||||
]
|
||||
},
|
||||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-highlight",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Highlight DOM nodes within your stories",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -30,26 +30,12 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./preview": "./dist/preview.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -58,15 +44,15 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/preview-api": "workspace:*"
|
||||
"@storybook/global": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@types/webpack-env": "^1.16.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
@ -74,8 +60,10 @@
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-interactions",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Automate, test and debug user interactions",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -28,39 +28,14 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./register.js": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./register.js": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -69,19 +44,11 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-common": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/instrumenter": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"jest-mock": "^27.0.6",
|
||||
"polished": "^4.2.2",
|
||||
@ -89,32 +56,36 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@devtools-ds/object-inspector": "^1.1.2",
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-common": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/instrumenter": "workspace:*",
|
||||
"@storybook/jest": "next",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/testing-library": "next",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@types/node": "^18.0.0",
|
||||
"formik": "^2.2.9",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"./src/preview.ts",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.ts"
|
||||
],
|
||||
"nodeEntries": [
|
||||
"./src/preset.ts"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-jest",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "React storybook addon that show component jest report",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -34,31 +34,13 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -67,45 +49,37 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"react-resize-detector": "^7.1.2",
|
||||
"tiny-invariant": "^1.3.1",
|
||||
"ts-dedent": "^2.0.0",
|
||||
"upath": "^2.0.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"react-resize-detector": "^7.1.2",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx"
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"platform": "browser"
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17",
|
||||
"storybook": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-links",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Link stories together to build demos and prototypes with your UI components",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -28,26 +28,14 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./react": {
|
||||
"types": "./dist/react/index.d.ts",
|
||||
"require": "./dist/react/index.js",
|
||||
"import": "./dist/react/index.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
@ -58,12 +46,6 @@
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
],
|
||||
"react": [
|
||||
"dist/react/index.d.ts"
|
||||
]
|
||||
@ -77,46 +59,45 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/csf": "^0.1.0",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/router": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"prop-types": "^15.7.2",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"fs-extra": "^11.1.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.ts",
|
||||
"./src/preview.ts",
|
||||
"./src/react/index.ts"
|
||||
"exportEntries": [
|
||||
"./src/react/index.ts",
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.ts"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.ts"
|
||||
],
|
||||
"post": "./scripts/fix-preview-api-reference.ts"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-measure",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Inspect layouts by visualizing the box model",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -31,21 +31,9 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
@ -72,41 +60,35 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"tiny-invariant": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-outline",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Outline all elements with CSS to help with layout placement and alignment",
|
||||
"keywords": [
|
||||
"storybook-addons",
|
||||
@ -34,39 +34,14 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -75,41 +50,35 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storyshots",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Take a code snapshot of every story automatically with Jest",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -33,8 +33,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/tsc.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/tsc.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@jest/transform": "^29.3.1",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storyshots-puppeteer",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Image snapshots addition to StoryShots based on puppeteer",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -32,8 +32,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/tsc.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/tsc.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@axe-core/puppeteer": "^4.2.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-storysource",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "View a story’s source code to see how it works and paste into your app",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -28,15 +28,8 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./preset": {
|
||||
"types": "./dist/preset.d.ts",
|
||||
"require": "./dist/preset.js"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preset": "./dist/preset.js",
|
||||
"./manager": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
@ -50,10 +43,14 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"estraverse": "^5.2.0",
|
||||
"tiny-invariant": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
@ -61,35 +58,24 @@
|
||||
"@storybook/router": "workspace:*",
|
||||
"@storybook/source-loader": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"estraverse": "^5.2.0",
|
||||
"prop-types": "^15.7.2",
|
||||
"react-syntax-highlighter": "^15.5.0",
|
||||
"tiny-invariant": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/react": "^16.14.34",
|
||||
"@types/react-syntax-highlighter": "11.0.5",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"react-syntax-highlighter": "^15.5.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"nodeEntries": [
|
||||
"./src/preset.ts"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-themes",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Switch between multiple themes for you components in Storybook",
|
||||
"keywords": [
|
||||
"css",
|
||||
@ -33,35 +33,14 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.js",
|
||||
"./package.json": "./package.json",
|
||||
"./postinstall": "./postinstall.js"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -70,10 +49,13 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
@ -81,30 +63,19 @@
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"@storybook/types": "workspace:*",
|
||||
"ts-dedent": "^2.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.tsx"
|
||||
]
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-toolbars",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Create your own toolbar items that control story rendering",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -32,31 +32,13 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -65,40 +47,29 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/theming": "workspace:*",
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"./src/manager.tsx"
|
||||
"exportEntries": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"platform": "browser"
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
]
|
||||
},
|
||||
"gitHead": "e6a7fd8a655c69780bc20b9749c2699e44beae17",
|
||||
"storybook": {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addon-viewport",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Build responsive components by adjusting Storybook’s viewport size and orientation",
|
||||
"keywords": [
|
||||
"addon",
|
||||
@ -29,39 +29,14 @@
|
||||
"require": "./dist/index.js",
|
||||
"import": "./dist/index.mjs"
|
||||
},
|
||||
"./manager": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./preview": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.ts",
|
||||
"import": "./dist/preview.mjs"
|
||||
},
|
||||
"./register": {
|
||||
"types": "./dist/manager.d.ts",
|
||||
"require": "./dist/manager.js",
|
||||
"import": "./dist/manager.mjs"
|
||||
},
|
||||
"./manager": "./dist/manager.js",
|
||||
"./preview": "./dist/preview.ts",
|
||||
"./register": "./dist/manager.js",
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"typesVersions": {
|
||||
"*": {
|
||||
"*": [
|
||||
"dist/index.d.ts"
|
||||
],
|
||||
"manager": [
|
||||
"dist/manager.d.ts"
|
||||
],
|
||||
"preview": [
|
||||
"dist/preview.d.ts"
|
||||
]
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"dist/**/*",
|
||||
"README.md",
|
||||
@ -70,10 +45,13 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/addon-bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"memoizerific": "^1.11.3"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/components": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
@ -81,32 +59,22 @@
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/theming": "workspace:*",
|
||||
"memoizerific": "^1.11.3",
|
||||
"prop-types": "^15.7.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"react": "^16.8.0",
|
||||
"react-dom": "^16.8.0",
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
"bundler": {
|
||||
"entries": [
|
||||
"./src/index.ts",
|
||||
"exportEntries": [
|
||||
"./src/models/index.ts",
|
||||
"./src/manager.tsx",
|
||||
"./src/index.ts"
|
||||
],
|
||||
"managerEntries": [
|
||||
"./src/manager.tsx"
|
||||
],
|
||||
"previewEntries": [
|
||||
"./src/preview.ts"
|
||||
]
|
||||
},
|
||||
|
@ -89,6 +89,62 @@ export const INITIAL_VIEWPORTS: ViewportMap = {
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
iphoneSE3: {
|
||||
name: 'iPhone SE 3rd generation',
|
||||
styles: {
|
||||
height: '667px',
|
||||
width: '375px',
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
iphone13: {
|
||||
name: 'iPhone 13',
|
||||
styles: {
|
||||
height: '844px',
|
||||
width: '390px',
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
iphone13pro: {
|
||||
name: 'iPhone 13 Pro',
|
||||
styles: {
|
||||
height: '844px',
|
||||
width: '390px',
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
iphone13promax: {
|
||||
name: 'iPhone 13 Pro Max',
|
||||
styles: {
|
||||
height: '926px',
|
||||
width: '428px',
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
iphone14: {
|
||||
name: 'iPhone 14',
|
||||
styles: {
|
||||
height: '844px',
|
||||
width: '390px',
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
iphone14pro: {
|
||||
name: 'iPhone 14 Pro',
|
||||
styles: {
|
||||
height: '852px',
|
||||
width: '393px',
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
iphone14promax: {
|
||||
name: 'iPhone 14 Pro Max',
|
||||
styles: {
|
||||
height: '932px',
|
||||
width: '430px',
|
||||
},
|
||||
type: 'mobile',
|
||||
},
|
||||
ipad: {
|
||||
name: 'iPad',
|
||||
styles: {
|
||||
@ -105,6 +161,14 @@ export const INITIAL_VIEWPORTS: ViewportMap = {
|
||||
},
|
||||
type: 'tablet',
|
||||
},
|
||||
ipad11p: {
|
||||
name: 'iPad Pro 11-in',
|
||||
styles: {
|
||||
height: '1194px',
|
||||
width: '834px',
|
||||
},
|
||||
type: 'tablet',
|
||||
},
|
||||
ipad12p: {
|
||||
name: 'iPad Pro 12.9-in',
|
||||
styles: {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-manager",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook manager builder",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -40,8 +40,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",
|
||||
|
@ -9,8 +9,8 @@ import { pnpPlugin } from '@yarnpkg/esbuild-plugin-pnp';
|
||||
import aliasPlugin from 'esbuild-plugin-alias';
|
||||
|
||||
import { stringifyProcessEnvs } from '@storybook/core-common';
|
||||
import { globalsModuleInfoMap } from '@storybook/manager/globals-module-info';
|
||||
import { getTemplatePath, renderHTML } from './utils/template';
|
||||
import { definitions } from './utils/globals';
|
||||
import { wrapManagerEntries } from './utils/managerEntries';
|
||||
import type {
|
||||
BuilderBuildResult,
|
||||
@ -89,7 +89,7 @@ export const getConfig: ManagerBuilder['getConfig'] = async (options) => {
|
||||
util: require.resolve('util/util.js'),
|
||||
assert: require.resolve('browser-assert'),
|
||||
}),
|
||||
globalExternals(definitions),
|
||||
globalExternals(globalsModuleInfoMap),
|
||||
pnpPlugin(),
|
||||
],
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
export { definitions } from '@storybook/manager/dist/globals';
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-vite",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "A plugin to run and build Storybooks with Vite",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/builders/builder-vite/#readme",
|
||||
"bugs": {
|
||||
@ -39,8 +39,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "workspace:*",
|
||||
|
@ -12,11 +12,18 @@ export async function build(options: Options) {
|
||||
build: {
|
||||
outDir: options.outputDir,
|
||||
emptyOutDir: false, // do not clean before running Vite build - Storybook has already added assets in there!
|
||||
sourcemap: true,
|
||||
rollupOptions: {
|
||||
// Do not try to bundle the storybook runtime, it is copied into the output dir after the build.
|
||||
external: ['./sb-preview/runtime.js'],
|
||||
},
|
||||
...(options.test
|
||||
? {
|
||||
reportCompressedSize: false,
|
||||
sourcemap: !options.build?.test?.disableSourcemaps,
|
||||
target: 'esnext',
|
||||
treeshake: !options.build?.test?.disableTreeShaking,
|
||||
}
|
||||
: {}),
|
||||
},
|
||||
}).build;
|
||||
|
||||
|
@ -9,21 +9,27 @@ export async function listStories(options: Options) {
|
||||
const { normalizePath } = await import('vite');
|
||||
|
||||
return (
|
||||
await Promise.all(
|
||||
normalizeStories(await options.presets.apply('stories', [], options), {
|
||||
configDir: options.configDir,
|
||||
workingDir: options.configDir,
|
||||
}).map(({ directory, files }) => {
|
||||
const pattern = path.join(directory, files);
|
||||
const absolutePattern = path.isAbsolute(pattern)
|
||||
? pattern
|
||||
: path.join(options.configDir, pattern);
|
||||
(
|
||||
await Promise.all(
|
||||
normalizeStories(await options.presets.apply('stories', [], options), {
|
||||
configDir: options.configDir,
|
||||
workingDir: options.configDir,
|
||||
}).map(({ directory, files }) => {
|
||||
const pattern = path.join(directory, files);
|
||||
const absolutePattern = path.isAbsolute(pattern)
|
||||
? pattern
|
||||
: path.join(options.configDir, pattern);
|
||||
|
||||
return glob(slash(absolutePattern), {
|
||||
...commonGlobOptions(absolutePattern),
|
||||
follow: true,
|
||||
});
|
||||
})
|
||||
return glob(slash(absolutePattern), {
|
||||
...commonGlobOptions(absolutePattern),
|
||||
follow: true,
|
||||
});
|
||||
})
|
||||
)
|
||||
)
|
||||
).reduce((carry, stories) => carry.concat(stories.map(normalizePath)), []);
|
||||
.reduce((carry, stories) => carry.concat(stories.map(normalizePath)), [])
|
||||
// Sort stories to prevent a non-deterministic build. The result of Glob is not sorted an may differ
|
||||
// for each invocation. This results in a different bundle file hashes from one build to the next.
|
||||
.sort()
|
||||
);
|
||||
}
|
||||
|
@ -8,21 +8,9 @@ const INCLUDE_CANDIDATES = [
|
||||
'@emotion/core',
|
||||
'@emotion/is-prop-valid',
|
||||
'@emotion/styled',
|
||||
'@mdx-js/react',
|
||||
'@storybook/addon-docs > acorn-jsx',
|
||||
'@storybook/addon-docs',
|
||||
'@storybook/addon-essentials/docs/mdx-react-shim',
|
||||
'@storybook/channels',
|
||||
'@storybook/client-api',
|
||||
'@storybook/client-logger',
|
||||
'@storybook/core/client',
|
||||
'@storybook/global',
|
||||
'@storybook/preview-api',
|
||||
'@storybook/preview-web',
|
||||
'@storybook/react > acorn-jsx',
|
||||
'@storybook/react',
|
||||
'@storybook/svelte',
|
||||
'@storybook/types',
|
||||
'@storybook/vue3',
|
||||
'acorn-jsx',
|
||||
'acorn-walk',
|
||||
@ -79,7 +67,6 @@ const INCLUDE_CANDIDATES = [
|
||||
'lodash/uniq',
|
||||
'lodash/upperFirst.js',
|
||||
'lodash/upperFirst',
|
||||
'markdown-to-jsx',
|
||||
'memoizerific',
|
||||
'overlayscrollbars',
|
||||
'polished',
|
||||
@ -126,6 +113,8 @@ const asyncFilter = async (arr: string[], predicate: (val: string) => Promise<bo
|
||||
Promise.all(arr.map(predicate)).then((results) => arr.filter((_v, index) => results[index]));
|
||||
|
||||
export async function getOptimizeDeps(config: ViteInlineConfig, options: Options) {
|
||||
const extraOptimizeDeps = await options.presets.apply('optimizeViteDeps', []);
|
||||
|
||||
const { root = process.cwd() } = config;
|
||||
const { normalizePath, resolveConfig } = await import('vite');
|
||||
const absoluteStories = await listStories(options);
|
||||
@ -136,7 +125,10 @@ export async function getOptimizeDeps(config: ViteInlineConfig, options: Options
|
||||
// This function converts ids which might include ` > ` to a real path, if it exists on disk.
|
||||
// See https://github.com/vitejs/vite/blob/67d164392e8e9081dc3f0338c4b4b8eea6c5f7da/packages/vite/src/node/optimizer/index.ts#L182-L199
|
||||
const resolve = resolvedConfig.createResolver({ asSrc: false });
|
||||
const include = await asyncFilter(INCLUDE_CANDIDATES, async (id) => Boolean(await resolve(id)));
|
||||
const include = await asyncFilter(
|
||||
Array.from(new Set([...INCLUDE_CANDIDATES, ...extraOptimizeDeps])),
|
||||
async (id) => Boolean(await resolve(id))
|
||||
);
|
||||
|
||||
const optimizeDeps: UserConfig['optimizeDeps'] = {
|
||||
...config.optimizeDeps,
|
||||
|
@ -22,7 +22,7 @@ export async function transformIframeHtml(html: string, options: Options) {
|
||||
}));
|
||||
|
||||
const otherGlobals = {
|
||||
...(build?.test?.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}),
|
||||
...(build?.test?.disableBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}),
|
||||
};
|
||||
|
||||
return html
|
||||
|
@ -8,7 +8,7 @@ import type {
|
||||
InlineConfig,
|
||||
} from 'vite';
|
||||
import { isPreservingSymlinks, getFrameworkName, getBuilderOptions } from '@storybook/core-common';
|
||||
import { globals } from '@storybook/preview/globals';
|
||||
import { globalsNameReferenceMap } from '@storybook/preview/globals';
|
||||
import type { Options } from '@storybook/types';
|
||||
import {
|
||||
codeGeneratorPlugin,
|
||||
@ -79,8 +79,10 @@ export async function pluginConfig(options: Options) {
|
||||
const frameworkName = await getFrameworkName(options);
|
||||
const build = await options.presets.apply('build');
|
||||
|
||||
if (build?.test?.emptyBlocks) {
|
||||
globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__';
|
||||
const externals: Record<string, string> = globalsNameReferenceMap;
|
||||
|
||||
if (build?.test?.disableBlocks) {
|
||||
externals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__';
|
||||
}
|
||||
|
||||
const plugins = [
|
||||
@ -101,7 +103,7 @@ export async function pluginConfig(options: Options) {
|
||||
}
|
||||
},
|
||||
},
|
||||
await externalGlobalsPlugin(globals),
|
||||
await externalGlobalsPlugin(externals),
|
||||
] as PluginOption[];
|
||||
|
||||
// TODO: framework doesn't exist, should move into framework when/if built
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/builder-webpack5",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -57,8 +57,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.23.2",
|
||||
@ -78,7 +78,7 @@
|
||||
"case-sensitive-paths-webpack-plugin": "^2.4.0",
|
||||
"constants-browserify": "^1.0.0",
|
||||
"css-loader": "^6.7.1",
|
||||
"es-module-lexer": "^0.9.3",
|
||||
"es-module-lexer": "^1.4.1",
|
||||
"express": "^4.17.3",
|
||||
"fork-ts-checker-webpack-plugin": "^8.0.0",
|
||||
"fs-extra": "^11.1.0",
|
||||
|
@ -6,16 +6,25 @@ export default async function loader(this: LoaderContext<any>, source: string) {
|
||||
const callback = this.async();
|
||||
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention
|
||||
const [_, exports] = parse(source);
|
||||
// Do NOT remove await here. The types are wrong! It has to be awaited,
|
||||
// otherwise it will return a Promise<Promise<...>> when wasm isn't loaded.
|
||||
const [, exports = []] = await parse(source);
|
||||
|
||||
if (exports.includes('__namedExportsOrder')) {
|
||||
const namedExportsOrder = exports.some(
|
||||
(e) => source.substring(e.s, e.e) === '__namedExportsOrder'
|
||||
);
|
||||
|
||||
if (namedExportsOrder) {
|
||||
return callback(null, source);
|
||||
}
|
||||
|
||||
const magicString = new MagicString(source);
|
||||
const orderedExports = exports.filter((e) => e !== 'default');
|
||||
magicString.append(`;export const __namedExportsOrder = ${JSON.stringify(orderedExports)};`);
|
||||
const orderedExports = exports.filter((e) => source.substring(e.s, e.e) !== 'default');
|
||||
magicString.append(
|
||||
`;export const __namedExportsOrder = ${JSON.stringify(
|
||||
orderedExports.map((e) => source.substring(e.s, e.e))
|
||||
)};`
|
||||
);
|
||||
|
||||
const map = magicString.generateMap({ hires: true });
|
||||
return callback(null, magicString.toString(), map);
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { dirname, isAbsolute, join, resolve } from 'path';
|
||||
import { dirname, join, resolve } from 'path';
|
||||
import { DefinePlugin, HotModuleReplacementPlugin, ProgressPlugin, ProvidePlugin } from 'webpack';
|
||||
import type { Configuration } from 'webpack';
|
||||
import HtmlWebpackPlugin from 'html-webpack-plugin';
|
||||
@ -7,24 +7,20 @@ import CaseSensitivePathsPlugin from 'case-sensitive-paths-webpack-plugin';
|
||||
import TerserWebpackPlugin from 'terser-webpack-plugin';
|
||||
import VirtualModulePlugin from 'webpack-virtual-modules';
|
||||
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
|
||||
import slash from 'slash';
|
||||
|
||||
import type { Options, CoreConfig, DocsOptions, PreviewAnnotation } from '@storybook/types';
|
||||
import { globals } from '@storybook/preview/globals';
|
||||
import type { TransformOptions as EsbuildOptions } from 'esbuild';
|
||||
import type { JsMinifyOptions as SwcOptions } from '@swc/core';
|
||||
import type { Options, CoreConfig, DocsOptions } from '@storybook/types';
|
||||
import { globalsNameReferenceMap } from '@storybook/preview/globals';
|
||||
import {
|
||||
getBuilderOptions,
|
||||
getRendererName,
|
||||
stringifyProcessEnvs,
|
||||
handlebars,
|
||||
interpolate,
|
||||
normalizeStories,
|
||||
readTemplate,
|
||||
loadPreviewOrConfigFile,
|
||||
isPreservingSymlinks,
|
||||
} from '@storybook/core-common';
|
||||
import { toRequireContextString, toImportFn } from '@storybook/core-webpack';
|
||||
import type { BuilderOptions } from '@storybook/core-webpack';
|
||||
import { getVirtualModuleMapping } from '@storybook/core-webpack';
|
||||
import { dedent } from 'ts-dedent';
|
||||
import type { BuilderOptions, TypescriptOptions } from '../types';
|
||||
import type { TypescriptOptions } from '../types';
|
||||
import { createBabelLoader, createSWCLoader } from './loaders';
|
||||
|
||||
const getAbsolutePath = <I extends string>(input: I): I =>
|
||||
@ -113,93 +109,8 @@ export default async (
|
||||
|
||||
const builderOptions = await getBuilderOptions<BuilderOptions>(options);
|
||||
|
||||
const previewAnnotations = [
|
||||
...(await presets.apply<PreviewAnnotation[]>('previewAnnotations', [], options)).map(
|
||||
(entry) => {
|
||||
// If entry is an object, use the absolute import specifier.
|
||||
// This is to maintain back-compat with community addons that bundle other addons
|
||||
// and package managers that "hide" sub dependencies (e.g. pnpm / yarn pnp)
|
||||
// The vite builder uses the bare import specifier.
|
||||
if (typeof entry === 'object') {
|
||||
return entry.absolute;
|
||||
}
|
||||
|
||||
// TODO: Remove as soon as we drop support for disabled StoryStoreV7
|
||||
if (isAbsolute(entry)) {
|
||||
return entry;
|
||||
}
|
||||
|
||||
return slash(entry);
|
||||
}
|
||||
),
|
||||
loadPreviewOrConfigFile(options),
|
||||
].filter(Boolean);
|
||||
|
||||
const virtualModuleMapping: Record<string, string> = {};
|
||||
if (features?.storyStoreV7) {
|
||||
const storiesFilename = 'storybook-stories.js';
|
||||
const storiesPath = resolve(join(workingDir, storiesFilename));
|
||||
|
||||
const needPipelinedImport = !!builderOptions.lazyCompilation && !isProd;
|
||||
virtualModuleMapping[storiesPath] = toImportFn(stories, { needPipelinedImport });
|
||||
const configEntryPath = resolve(join(workingDir, 'storybook-config-entry.js'));
|
||||
virtualModuleMapping[configEntryPath] = handlebars(
|
||||
await readTemplate(
|
||||
require.resolve(
|
||||
'@storybook/builder-webpack5/templates/virtualModuleModernEntry.js.handlebars'
|
||||
)
|
||||
),
|
||||
{
|
||||
storiesFilename,
|
||||
previewAnnotations,
|
||||
}
|
||||
// We need to double escape `\` for webpack. We may have some in windows paths
|
||||
).replace(/\\/g, '\\\\');
|
||||
entries.push(configEntryPath);
|
||||
} else {
|
||||
const rendererName = await getRendererName(options);
|
||||
|
||||
const rendererInitEntry = resolve(join(workingDir, 'storybook-init-renderer-entry.js'));
|
||||
virtualModuleMapping[rendererInitEntry] = `import '${slash(rendererName)}';`;
|
||||
entries.push(rendererInitEntry);
|
||||
|
||||
const entryTemplate = await readTemplate(
|
||||
join(__dirname, '..', '..', 'templates', 'virtualModuleEntry.template.js')
|
||||
);
|
||||
|
||||
previewAnnotations.forEach((previewAnnotationFilename: string | undefined) => {
|
||||
if (!previewAnnotationFilename) return;
|
||||
|
||||
// Ensure that relative paths end up mapped to a filename in the cwd, so a later import
|
||||
// of the `previewAnnotationFilename` in the template works.
|
||||
const entryFilename = previewAnnotationFilename.startsWith('.')
|
||||
? `${previewAnnotationFilename.replace(/(\w)(\/|\\)/g, '$1-')}-generated-config-entry.js`
|
||||
: `${previewAnnotationFilename}-generated-config-entry.js`;
|
||||
// NOTE: although this file is also from the `dist/cjs` directory, it is actually a ESM
|
||||
// file, see https://github.com/storybookjs/storybook/pull/16727#issuecomment-986485173
|
||||
virtualModuleMapping[entryFilename] = interpolate(entryTemplate, {
|
||||
previewAnnotationFilename,
|
||||
});
|
||||
entries.push(entryFilename);
|
||||
});
|
||||
if (stories.length > 0) {
|
||||
const storyTemplate = await readTemplate(
|
||||
join(__dirname, '..', '..', 'templates', 'virtualModuleStory.template.js')
|
||||
);
|
||||
// NOTE: this file has a `.cjs` extension as it is a CJS file (from `dist/cjs`) and runs
|
||||
// in the user's webpack mode, which may be strict about the use of require/import.
|
||||
// See https://github.com/storybookjs/storybook/issues/14877
|
||||
const storiesFilename = resolve(join(workingDir, `generated-stories-entry.cjs`));
|
||||
virtualModuleMapping[storiesFilename] = interpolate(storyTemplate, {
|
||||
rendererName,
|
||||
})
|
||||
// Make sure we also replace quotes for this one
|
||||
.replace("'{{stories}}'", stories.map(toRequireContextString).join(','));
|
||||
entries.push(storiesFilename);
|
||||
}
|
||||
}
|
||||
|
||||
const shouldCheckTs = typescriptOptions.check && !typescriptOptions.skipBabel;
|
||||
const shouldCheckTs =
|
||||
typescriptOptions.check && !typescriptOptions.skipBabel && !typescriptOptions.skipCompiler;
|
||||
const tsCheckOptions = typescriptOptions.checkOptions || {};
|
||||
|
||||
const cacheConfig = builderOptions.fsCache ? { cache: { type: 'filesystem' as const } } : {};
|
||||
@ -219,15 +130,22 @@ export default async (
|
||||
`);
|
||||
}
|
||||
|
||||
if (build?.test?.emptyBlocks) {
|
||||
globals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__';
|
||||
const externals: Record<string, string> = globalsNameReferenceMap;
|
||||
if (build?.test?.disableBlocks) {
|
||||
externals['@storybook/blocks'] = '__STORYBOOK_BLOCKS_EMPTY_MODULE__';
|
||||
}
|
||||
|
||||
const virtualModuleMapping = await getVirtualModuleMapping(options);
|
||||
|
||||
Object.keys(virtualModuleMapping).forEach((key) => {
|
||||
entries.push(key);
|
||||
});
|
||||
|
||||
return {
|
||||
name: 'preview',
|
||||
mode: isProd ? 'production' : 'development',
|
||||
bail: isProd,
|
||||
devtool: 'cheap-module-source-map',
|
||||
devtool: options.build?.test?.disableSourcemaps ? false : 'cheap-module-source-map',
|
||||
entry: entries,
|
||||
output: {
|
||||
path: resolve(process.cwd(), outputDir),
|
||||
@ -241,7 +159,7 @@ export default async (
|
||||
watchOptions: {
|
||||
ignored: /node_modules/,
|
||||
},
|
||||
externals: globals,
|
||||
externals,
|
||||
ignoreWarnings: [
|
||||
{
|
||||
message: /export '\S+' was not found in 'global'/,
|
||||
@ -275,7 +193,7 @@ export default async (
|
||||
importPathMatcher: specifier.importPathMatcher.source,
|
||||
})),
|
||||
DOCS_OPTIONS: docsOptions,
|
||||
...(build?.test?.emptyBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}),
|
||||
...(build?.test?.disableBlocks ? { __STORYBOOK_BLOCKS_EMPTY_MODULE__: {} } : {}),
|
||||
},
|
||||
headHtmlSnippet,
|
||||
bodyHtmlSnippet,
|
||||
@ -300,9 +218,12 @@ export default async (
|
||||
shouldCheckTs ? new ForkTsCheckerWebpackPlugin(tsCheckOptions) : null,
|
||||
].filter(Boolean),
|
||||
module: {
|
||||
// Disable warning for dynamic requires
|
||||
unknownContextCritical: false,
|
||||
rules: [
|
||||
{
|
||||
test: /\.stories\.([tj])sx?$|(stories|story)\.mdx$/,
|
||||
enforce: 'post',
|
||||
use: [
|
||||
{
|
||||
loader: require.resolve('@storybook/builder-webpack5/loaders/export-order-loader'),
|
||||
@ -320,7 +241,7 @@ export default async (
|
||||
},
|
||||
},
|
||||
builderOptions.useSWC
|
||||
? createSWCLoader(Object.keys(virtualModuleMapping))
|
||||
? await createSWCLoader(Object.keys(virtualModuleMapping), options)
|
||||
: createBabelLoader(babelOptions, typescriptOptions, Object.keys(virtualModuleMapping)),
|
||||
{
|
||||
test: /\.md$/,
|
||||
@ -352,17 +273,29 @@ export default async (
|
||||
},
|
||||
runtimeChunk: true,
|
||||
sideEffects: true,
|
||||
usedExports: isProd,
|
||||
usedExports: options.build?.test?.disableTreeShaking ? false : isProd,
|
||||
moduleIds: 'named',
|
||||
...(isProd
|
||||
? {
|
||||
minimize: true,
|
||||
minimizer: builderOptions.useSWC
|
||||
// eslint-disable-next-line no-nested-ternary
|
||||
minimizer: options.build?.test?.esbuildMinify
|
||||
? [
|
||||
new TerserWebpackPlugin({
|
||||
new TerserWebpackPlugin<EsbuildOptions>({
|
||||
parallel: true,
|
||||
minify: TerserWebpackPlugin.esbuildMinify,
|
||||
terserOptions: {
|
||||
sourcemap: !options.build?.test?.disableSourcemaps,
|
||||
treeShaking: !options.build?.test?.disableTreeShaking,
|
||||
},
|
||||
}),
|
||||
]
|
||||
: builderOptions.useSWC
|
||||
? [
|
||||
new TerserWebpackPlugin<SwcOptions>({
|
||||
minify: TerserWebpackPlugin.swcMinify,
|
||||
terserOptions: {
|
||||
sourceMap: true,
|
||||
sourceMap: !options.build?.test?.disableSourcemaps,
|
||||
mangle: false,
|
||||
keep_fnames: true,
|
||||
},
|
||||
@ -372,7 +305,7 @@ export default async (
|
||||
new TerserWebpackPlugin({
|
||||
parallel: true,
|
||||
terserOptions: {
|
||||
sourceMap: true,
|
||||
sourceMap: !options.build?.test?.disableSourcemaps,
|
||||
mangle: false,
|
||||
keep_fnames: true,
|
||||
},
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { getProjectRoot } from '@storybook/core-common';
|
||||
import type { Options } from '@swc/core';
|
||||
import type { Options as SwcOptions } from '@swc/core';
|
||||
import { dedent } from 'ts-dedent';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
import type { Options } from '@storybook/types';
|
||||
import type { TypescriptOptions } from '../types';
|
||||
|
||||
export const createBabelLoader = (
|
||||
@ -9,6 +10,7 @@ export const createBabelLoader = (
|
||||
typescriptOptions: TypescriptOptions,
|
||||
excludes: string[] = []
|
||||
) => {
|
||||
logger.info(dedent`Using Babel compiler`);
|
||||
return {
|
||||
test: typescriptOptions.skipBabel ? /\.(mjs|jsx?)$/ : /\.(mjs|tsx?|jsx?)$/,
|
||||
use: [
|
||||
@ -22,14 +24,22 @@ export const createBabelLoader = (
|
||||
};
|
||||
};
|
||||
|
||||
export const createSWCLoader = (excludes: string[] = []) => {
|
||||
logger.warn(dedent`
|
||||
The SWC loader is an experimental feature and may change or even be removed at any time.
|
||||
`);
|
||||
export const createSWCLoader = async (excludes: string[] = [], options: Options) => {
|
||||
logger.info(dedent`Using SWC compiler`);
|
||||
|
||||
const config: Options = {
|
||||
const swc = await options.presets.apply('swc', {}, options);
|
||||
const typescriptOptions = await options.presets.apply<{ skipCompiler?: boolean }>(
|
||||
'typescript',
|
||||
{},
|
||||
options
|
||||
);
|
||||
|
||||
const config: SwcOptions = {
|
||||
...swc,
|
||||
jsc: {
|
||||
...(swc.jsc ?? {}),
|
||||
parser: {
|
||||
...(swc.jsc?.parser ?? {}),
|
||||
syntax: 'typescript',
|
||||
tsx: true,
|
||||
dynamicImport: true,
|
||||
@ -37,13 +47,9 @@ export const createSWCLoader = (excludes: string[] = []) => {
|
||||
},
|
||||
};
|
||||
return {
|
||||
test: /\.(mjs|cjs|tsx?|jsx?)$/,
|
||||
use: [
|
||||
{
|
||||
loader: require.resolve('swc-loader'),
|
||||
options: config,
|
||||
},
|
||||
],
|
||||
test: typescriptOptions.skipCompiler ? /\.(mjs|cjs|jsx?)$/ : /\.(mjs|cjs|tsx?|jsx?)$/,
|
||||
loader: require.resolve('swc-loader'),
|
||||
options: config,
|
||||
include: [getProjectRoot()],
|
||||
exclude: [/node_modules/, ...excludes],
|
||||
};
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/addons",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook addons store",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -40,18 +40,14 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/types": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channel-postmessage",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -40,8 +40,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/channel-websocket",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -40,8 +40,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/channels": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/client-api",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook Client API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -39,8 +39,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/core-client",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook framework-agnostic API",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -31,8 +31,8 @@
|
||||
"module": "dist/entry.mjs",
|
||||
"types": "dist/entry.d.ts",
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/api",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook Manager API (facade)",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -39,25 +39,13 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
"@storybook/manager-api": "workspace:*"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"react": {
|
||||
"optional": true
|
||||
},
|
||||
"react-dom": {
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preview-web",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -39,8 +39,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/store",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -39,8 +39,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/facade.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/facade.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/client-logger": "workspace:*",
|
||||
|
@ -31,18 +31,22 @@ test.describe('addon-controls', () => {
|
||||
);
|
||||
const toggle = sbPage.panelContent().locator('input[name=primary]');
|
||||
await toggle.click();
|
||||
await expect(sbPage.previewRoot().locator('button')).toHaveCSS(
|
||||
'background-color',
|
||||
'rgba(0, 0, 0, 0)'
|
||||
);
|
||||
await expect(async () => {
|
||||
await expect(sbPage.previewRoot().locator('button')).toHaveCSS(
|
||||
'background-color',
|
||||
'rgba(0, 0, 0, 0)'
|
||||
);
|
||||
}).toPass();
|
||||
|
||||
// Color picker: Background color
|
||||
const color = sbPage.panelContent().locator('input[placeholder="Choose color..."]');
|
||||
await color.fill('red');
|
||||
await expect(sbPage.previewRoot().locator('button')).toHaveCSS(
|
||||
'background-color',
|
||||
'rgb(255, 0, 0)'
|
||||
);
|
||||
await expect(async () => {
|
||||
await expect(sbPage.previewRoot().locator('button')).toHaveCSS(
|
||||
'background-color',
|
||||
'rgb(255, 0, 0)'
|
||||
);
|
||||
}).toPass();
|
||||
|
||||
// TODO: enable this once the controls for size are aligned in all CLI templates.
|
||||
// Radio buttons: Size
|
||||
|
@ -1,6 +1,7 @@
|
||||
/* eslint-disable jest/no-disabled-tests */
|
||||
import { test, expect } from '@playwright/test';
|
||||
import process from 'process';
|
||||
import dedent from 'ts-dedent';
|
||||
import { SbPage } from './util';
|
||||
|
||||
const storybookUrl = process.env.STORYBOOK_URL || 'http://localhost:6006';
|
||||
@ -37,4 +38,16 @@ test.describe('Svelte', () => {
|
||||
const argsTable = root.locator('.docblock-argstable');
|
||||
await expect(argsTable).toContainText('Rounds the button');
|
||||
});
|
||||
|
||||
test('Decorators are excluded from generated source code', async ({ page }) => {
|
||||
const sbPage = new SbPage(page);
|
||||
|
||||
await sbPage.navigateToStory('stories/renderers/svelte/slot-decorators', 'docs');
|
||||
const root = sbPage.previewRoot();
|
||||
const showCodeButton = (await root.locator('button', { hasText: 'Show Code' }).all())[0];
|
||||
await showCodeButton.click();
|
||||
const sourceCode = root.locator('pre.prismjs');
|
||||
const expectedSource = '<ButtonJavaScript primary/>';
|
||||
await expect(sourceCode.textContent()).resolves.toContain(expectedSource);
|
||||
});
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/angular",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Angular: Develop Angular components in isolation with hot reloading.",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -33,8 +33,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/node_modules/.bin/tsc",
|
||||
"prep": "../../../scripts/prepare/tsc.ts"
|
||||
"check": "node ../../../scripts/node_modules/.bin/tsc",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/tsc.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
@ -46,7 +46,6 @@
|
||||
"@storybook/core-webpack": "workspace:*",
|
||||
"@storybook/docs-tools": "workspace:*",
|
||||
"@storybook/global": "^5.0.0",
|
||||
"@storybook/manager-api": "workspace:*",
|
||||
"@storybook/node-logger": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
"@storybook/telemetry": "workspace:*",
|
||||
@ -102,8 +101,6 @@
|
||||
"@angular/platform-browser": ">=14.1.0 < 18.0.0",
|
||||
"@angular/platform-browser-dynamic": ">=14.1.0 < 18.0.0",
|
||||
"@babel/core": "*",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"rxjs": "^6.0.0 || ^7.4.0",
|
||||
"typescript": "^4.0.0 || ^5.0.0",
|
||||
"zone.js": ">= 0.11.1 < 1.0.0"
|
||||
|
@ -14,7 +14,7 @@ export const isComponentAlreadyDeclared = (
|
||||
): boolean => {
|
||||
if (
|
||||
moduleDeclarations &&
|
||||
moduleDeclarations.some((declaration) => declaration === componentToFind)
|
||||
moduleDeclarations.flat().some((declaration) => declaration === componentToFind)
|
||||
) {
|
||||
// Found component in declarations array
|
||||
return true;
|
||||
@ -23,7 +23,7 @@ export const isComponentAlreadyDeclared = (
|
||||
return false;
|
||||
}
|
||||
|
||||
return moduleImports.some((importItem) => {
|
||||
return moduleImports.flat().some((importItem) => {
|
||||
const extractedNgModuleMetadata = extractNgModuleMetadata(importItem);
|
||||
if (!extractedNgModuleMetadata) {
|
||||
// Not an NgModule
|
||||
|
@ -41,5 +41,6 @@ export const typescript: PresetProperty<'typescript', StorybookConfig> = async (
|
||||
return {
|
||||
...config,
|
||||
skipBabel: true,
|
||||
skipCompiler: true,
|
||||
};
|
||||
};
|
||||
|
@ -66,6 +66,9 @@ exports.getWebpackConfig = async (baseConfig, { builderOptions, builderContext }
|
||||
|
||||
// Options provided by user
|
||||
...builderOptions,
|
||||
styles: builderOptions.styles
|
||||
?.map((style) => (typeof style === 'string' ? style : style.input))
|
||||
.filter((style) => typeof style === 'string' || style.inject !== false),
|
||||
|
||||
// Fixed options
|
||||
optimization: false,
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/ember",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Ember: Develop Ember Component in isolation with Hot Reloading.",
|
||||
"homepage": "https://github.com/storybookjs/storybook/tree/next/code/frameworks/ember",
|
||||
"bugs": {
|
||||
@ -28,8 +28,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/tsc.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/tsc.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
@ -49,9 +49,7 @@
|
||||
"@types/ember__component": "4.0.8",
|
||||
"babel-plugin-ember-modules-api-polyfill": "^2.12.0",
|
||||
"babel-plugin-htmlbars-inline-precompile": "2 || 3",
|
||||
"ember-source": "~3.28.1",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"ember-source": "~3.28.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html-vite",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for HTML and Vite: Develop HTML in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/addons": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/html-webpack5",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for HTML: View HTML snippets in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
@ -58,9 +58,7 @@
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "*",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"@babel/core": "*"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|
@ -122,7 +122,12 @@ export default {
|
||||
framework: {
|
||||
// name: '@storybook/react-webpack5', // Remove this
|
||||
name: '@storybook/nextjs', // Add this
|
||||
options: {},
|
||||
options: {
|
||||
builder: {
|
||||
// Set useSWC to true if you want to try out the experimental SWC compiler in Next.js >= 14.0.0
|
||||
useSWC: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
};
|
||||
```
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/nextjs",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Next.js",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -29,18 +29,19 @@
|
||||
},
|
||||
"./dist/image-context": {
|
||||
"types": "./dist/image-context.d.ts",
|
||||
"require": "./dist/image-context.mjs",
|
||||
"require": "./dist/image-context.js",
|
||||
"import": "./dist/image-context.mjs"
|
||||
},
|
||||
"./preset": {
|
||||
"types": "./dist/preset.d.ts",
|
||||
"require": "./dist/preset.js"
|
||||
},
|
||||
"./preview.js": {
|
||||
"types": "./dist/preview.d.ts",
|
||||
"require": "./dist/preview.js",
|
||||
"import": "./dist/preview.mjs"
|
||||
"./font/webpack/loader/storybook-nextjs-font-loader": {
|
||||
"types": "./dist/font/webpack/loader/storybook-nextjs-font-loader.d.ts",
|
||||
"require": "./dist/font/webpack/loader/storybook-nextjs-font-loader.js",
|
||||
"import": "./dist/font/webpack/loader/storybook-nextjs-font-loader.mjs"
|
||||
},
|
||||
"./dist/preview.mjs": "./dist/preview.mjs",
|
||||
"./next-image-loader-stub.js": {
|
||||
"types": "./dist/next-image-loader-stub.d.ts",
|
||||
"require": "./dist/next-image-loader-stub.js",
|
||||
@ -70,8 +71,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/core": "^7.23.2",
|
||||
@ -87,10 +88,12 @@
|
||||
"@babel/preset-react": "^7.22.15",
|
||||
"@babel/preset-typescript": "^7.23.2",
|
||||
"@babel/runtime": "^7.23.2",
|
||||
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
|
||||
"@storybook/addon-actions": "workspace:*",
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
"@storybook/core-common": "workspace:*",
|
||||
"@storybook/core-events": "workspace:*",
|
||||
"@storybook/core-webpack": "workspace:*",
|
||||
"@storybook/node-logger": "workspace:*",
|
||||
"@storybook/preset-react-webpack": "workspace:*",
|
||||
"@storybook/preview-api": "workspace:*",
|
||||
@ -121,7 +124,7 @@
|
||||
"@types/babel__plugin-transform-runtime": "^7",
|
||||
"@types/babel__preset-env": "^7",
|
||||
"@types/loader-utils": "^2.0.5",
|
||||
"next": "^14.0.0",
|
||||
"next": "^14.0.2",
|
||||
"typescript": "^4.9.3",
|
||||
"webpack": "^5.65.0"
|
||||
},
|
||||
@ -136,9 +139,6 @@
|
||||
"@next/font": {
|
||||
"optional": true
|
||||
},
|
||||
"@storybook/addon-actions": {
|
||||
"optional": true
|
||||
},
|
||||
"typescript": {
|
||||
"optional": true
|
||||
},
|
||||
@ -163,7 +163,8 @@
|
||||
"./src/images/next-future-image.tsx",
|
||||
"./src/images/next-legacy-image.tsx",
|
||||
"./src/images/next-image.tsx",
|
||||
"./src/font/webpack/loader/storybook-nextjs-font-loader.ts"
|
||||
"./src/font/webpack/loader/storybook-nextjs-font-loader.ts",
|
||||
"./src/swc/next-swc-loader-patch.ts"
|
||||
],
|
||||
"externals": [
|
||||
"sb-original/next/image",
|
||||
|
@ -34,6 +34,9 @@ export const configureCss = (baseConfig: WebpackConfig, nextConfig: NextConfig):
|
||||
},
|
||||
require.resolve('postcss-loader'),
|
||||
],
|
||||
// We transform the "target.css" files from next.js into Javascript
|
||||
// for Next.js to support fonts, so it should be ignored by the css-loader.
|
||||
exclude: /next\/.*\/target.css$/,
|
||||
};
|
||||
}
|
||||
});
|
||||
|
@ -1,14 +1,22 @@
|
||||
import type { Configuration } from 'webpack';
|
||||
|
||||
export function configureNextFont(baseConfig: Configuration) {
|
||||
baseConfig.plugins = [...(baseConfig.plugins || [])];
|
||||
baseConfig.resolveLoader = {
|
||||
...baseConfig.resolveLoader,
|
||||
alias: {
|
||||
...baseConfig.resolveLoader?.alias,
|
||||
'storybook-nextjs-font-loader': require.resolve(
|
||||
'./font/webpack/loader/storybook-nextjs-font-loader'
|
||||
),
|
||||
},
|
||||
};
|
||||
export function configureNextFont(baseConfig: Configuration, isSWC?: boolean) {
|
||||
const fontLoaderPath = require.resolve(
|
||||
'@storybook/nextjs/font/webpack/loader/storybook-nextjs-font-loader'
|
||||
);
|
||||
|
||||
if (isSWC) {
|
||||
baseConfig.module?.rules?.push({
|
||||
test: /next\/.*\/target.css$/,
|
||||
loader: fontLoaderPath,
|
||||
});
|
||||
} else {
|
||||
baseConfig.resolveLoader = {
|
||||
...baseConfig.resolveLoader,
|
||||
alias: {
|
||||
...baseConfig.resolveLoader?.alias,
|
||||
'storybook-nextjs-font-loader': fontLoaderPath,
|
||||
},
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -1,6 +1,7 @@
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
||||
// @ts-expect-error
|
||||
import loaderUtils from 'next/dist/compiled/loader-utils3';
|
||||
import { getProjectRoot } from '@storybook/core-common';
|
||||
import path from 'path';
|
||||
|
||||
import type { LoaderOptions } from '../types';
|
||||
@ -11,7 +12,9 @@ export async function getFontFaceDeclarations(options: LoaderOptions, rootContex
|
||||
const localFontSrc = options.props.src as LocalFontSrc;
|
||||
|
||||
// Parent folder relative to the root context
|
||||
const parentFolder = path.dirname(options.filename).replace(rootContext, '');
|
||||
const parentFolder = path
|
||||
.dirname(path.join(getProjectRoot(), options.filename))
|
||||
.replace(rootContext, '');
|
||||
|
||||
const { validateData } = require('../utils/local-font-utils');
|
||||
const { weight, style, variable } = validateData('', options.props);
|
||||
|
@ -14,18 +14,34 @@ type FontFaceDeclaration = {
|
||||
};
|
||||
|
||||
export default async function storybookNextjsFontLoader(this: any) {
|
||||
const options = this.getOptions() as LoaderOptions;
|
||||
const loaderOptions = this.getOptions() as LoaderOptions;
|
||||
let options;
|
||||
|
||||
if (Object.keys(loaderOptions).length > 0) {
|
||||
// handles Babel mode
|
||||
options = loaderOptions;
|
||||
} else {
|
||||
// handles SWC mode
|
||||
const importQuery = JSON.parse(this.resourceQuery.slice(1));
|
||||
|
||||
options = {
|
||||
filename: importQuery.path,
|
||||
fontFamily: importQuery.import,
|
||||
props: importQuery.arguments[0],
|
||||
source: this.context.replace(this.rootContext, ''),
|
||||
};
|
||||
}
|
||||
|
||||
// get execution context
|
||||
const rootCtx = this.rootContext;
|
||||
|
||||
let fontFaceDeclaration: FontFaceDeclaration | undefined;
|
||||
|
||||
if (options.source === 'next/font/google' || options.source === '@next/font/google') {
|
||||
if (options.source.endsWith('next/font/google') || options.source.endsWith('@next/font/google')) {
|
||||
fontFaceDeclaration = await getGoogleFontFaceDeclarations(options);
|
||||
}
|
||||
|
||||
if (options.source === 'next/font/local' || options.source === '@next/font/local') {
|
||||
if (options.source.endsWith('next/font/local') || options.source.endsWith('@next/font/local')) {
|
||||
fontFaceDeclaration = await getLocalFontFaceDeclarations(options, rootCtx);
|
||||
}
|
||||
|
||||
|
@ -24,7 +24,8 @@ export function configureNextImport(baseConfig: WebpackConfig) {
|
||||
baseConfig.plugins.push(
|
||||
new IgnorePlugin({
|
||||
// ignore next/dist/shared/lib/hooks-client-context and next/legacy/image imports
|
||||
resourceRegExp: /(next\/dist\/shared\/lib\/hooks-client-context|next\/legacy\/image)$/,
|
||||
resourceRegExp:
|
||||
/(next\/dist\/shared\/lib\/hooks-client-context|next\/dist\/shared\/lib\/hooks-client-context\.shared-runtime|next\/legacy\/image)$/,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ import { configureNextFont } from './font/webpack/configureNextFont';
|
||||
import nextBabelPreset from './babel/preset';
|
||||
import { configureNodePolyfills } from './nodePolyfills/webpack';
|
||||
import { configureAliasing } from './dependency-map';
|
||||
import { configureSWCLoader } from './swc/loader';
|
||||
|
||||
export const addons: PresetProperty<'addons', StorybookConfig> = [
|
||||
dirname(require.resolve(join('@storybook/preset-react-webpack', 'package.json'))),
|
||||
@ -61,7 +62,9 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti
|
||||
name: dirname(
|
||||
require.resolve(join('@storybook/builder-webpack5', 'package.json'))
|
||||
) as '@storybook/builder-webpack5',
|
||||
options: typeof framework === 'string' ? {} : framework.options.builder || {},
|
||||
options: {
|
||||
...(typeof framework === 'string' ? {} : framework.options.builder || {}),
|
||||
},
|
||||
},
|
||||
renderer: dirname(require.resolve(join('@storybook/react', 'package.json'))),
|
||||
};
|
||||
@ -69,7 +72,7 @@ export const core: PresetProperty<'core', StorybookConfig> = async (config, opti
|
||||
|
||||
export const previewAnnotations: StorybookConfig['previewAnnotations'] = (entry = []) => [
|
||||
...entry,
|
||||
require.resolve('@storybook/nextjs/preview.js'),
|
||||
join(dirname(require.resolve('@storybook/nextjs/package.json')), 'dist/preview.mjs'),
|
||||
];
|
||||
|
||||
// Not even sb init - automigrate - running dev
|
||||
@ -135,7 +138,7 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig,
|
||||
const frameworkOptions = await options.presets.apply<{ options: FrameworkOptions }>(
|
||||
'frameworkOptions'
|
||||
);
|
||||
const { options: { nextConfigPath } = {} } = frameworkOptions;
|
||||
const { options: { nextConfigPath, builder } = {} } = frameworkOptions;
|
||||
const nextConfig = await configureConfig({
|
||||
baseConfig,
|
||||
nextConfigPath,
|
||||
@ -143,7 +146,7 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig,
|
||||
});
|
||||
|
||||
configureAliasing(baseConfig);
|
||||
configureNextFont(baseConfig);
|
||||
configureNextFont(baseConfig, builder?.useSWC);
|
||||
configureNextImport(baseConfig);
|
||||
configureRuntimeNextjsVersionResolution(baseConfig);
|
||||
configureImports({ baseConfig, configDir: options.configDir });
|
||||
@ -152,5 +155,10 @@ export const webpackFinal: StorybookConfig['webpackFinal'] = async (baseConfig,
|
||||
configureStyledJsx(baseConfig);
|
||||
configureNodePolyfills(baseConfig);
|
||||
|
||||
// TODO: In Storybook 8.0, we have to check whether the babel-compiler addon is used. Otherwise, swc should be used.
|
||||
if (builder?.useSWC) {
|
||||
await configureSWCLoader(baseConfig, options, nextConfig);
|
||||
}
|
||||
|
||||
return baseConfig;
|
||||
};
|
||||
|
@ -1,48 +1,16 @@
|
||||
import React from 'react';
|
||||
import type {
|
||||
LayoutRouterContext as TLayoutRouterContext,
|
||||
AppRouterContext as TAppRouterContext,
|
||||
GlobalLayoutRouterContext as TGlobalLayoutRouterContext,
|
||||
import {
|
||||
LayoutRouterContext,
|
||||
AppRouterContext,
|
||||
GlobalLayoutRouterContext,
|
||||
} from 'next/dist/shared/lib/app-router-context.shared-runtime';
|
||||
import type {
|
||||
PathnameContext as TPathnameContext,
|
||||
SearchParamsContext as TSearchParamsContext,
|
||||
import {
|
||||
PathnameContext,
|
||||
SearchParamsContext,
|
||||
} from 'next/dist/shared/lib/hooks-client-context.shared-runtime';
|
||||
import type { FlightRouterState } from 'next/dist/server/app-render/types';
|
||||
import type { RouteParams } from './types';
|
||||
|
||||
/**
|
||||
* Normally dynamic imports are necessary because otherwise
|
||||
* older versions of Next.js will throw an error
|
||||
* because AppRouterProviders only exists in Next.js > v13
|
||||
* Using React.lazy though is currently not supported in SB decorators
|
||||
* therefore using the try/catch workaround
|
||||
*/
|
||||
let AppRouterContext: typeof TAppRouterContext;
|
||||
let LayoutRouterContext: typeof TLayoutRouterContext;
|
||||
let PathnameContext: typeof TPathnameContext;
|
||||
let SearchParamsContext: typeof TSearchParamsContext;
|
||||
let GlobalLayoutRouterContext: typeof TGlobalLayoutRouterContext;
|
||||
|
||||
try {
|
||||
AppRouterContext =
|
||||
require('next/dist/shared/lib/app-router-context.shared-runtime').AppRouterContext;
|
||||
LayoutRouterContext =
|
||||
require('next/dist/shared/lib/app-router-context.shared-runtime').LayoutRouterContext;
|
||||
PathnameContext =
|
||||
require('next/dist/shared/lib/hooks-client-context.shared-runtime').PathnameContext;
|
||||
SearchParamsContext =
|
||||
require('next/dist/shared/lib/hooks-client-context.shared-runtime').SearchParamsContext;
|
||||
GlobalLayoutRouterContext =
|
||||
require('next/dist/shared/lib/app-router-context.shared-runtime').GlobalLayoutRouterContext;
|
||||
} catch {
|
||||
AppRouterContext = React.Fragment as any;
|
||||
LayoutRouterContext = React.Fragment as any;
|
||||
PathnameContext = React.Fragment as any;
|
||||
SearchParamsContext = React.Fragment as any;
|
||||
GlobalLayoutRouterContext = React.Fragment as any;
|
||||
}
|
||||
|
||||
type AppRouterProviderProps = {
|
||||
action: (name: string) => (...args: any[]) => void;
|
||||
routeParams: RouteParams;
|
||||
@ -58,7 +26,11 @@ const getParallelRoutes = (segmentsList: Array<string>): FlightRouterState => {
|
||||
return [] as any;
|
||||
};
|
||||
|
||||
const AppRouterProvider: React.FC<AppRouterProviderProps> = ({ children, action, routeParams }) => {
|
||||
export const AppRouterProvider: React.FC<AppRouterProviderProps> = ({
|
||||
children,
|
||||
action,
|
||||
routeParams,
|
||||
}) => {
|
||||
const { pathname, query, segments = [], ...restRouteParams } = routeParams;
|
||||
|
||||
const tree: FlightRouterState = [pathname, { children: getParallelRoutes([...segments]) }];
|
||||
@ -121,5 +93,3 @@ const AppRouterProvider: React.FC<AppRouterProviderProps> = ({ children, action,
|
||||
</PathnameContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export default AppRouterProvider;
|
||||
|
@ -1,20 +1,10 @@
|
||||
import * as React from 'react';
|
||||
// this will be aliased by webpack at runtime (this is just for typing)
|
||||
import type { action as originalAction } from '@storybook/addon-actions';
|
||||
import type { Addon_StoryContext } from '@storybook/types';
|
||||
import AppRouterProvider from './app-router-provider';
|
||||
|
||||
import PageRouterProvider from './page-router-provider';
|
||||
import { action } from '@storybook/addon-actions';
|
||||
import { PageRouterProvider } from './page-router-provider';
|
||||
import type { AppRouterProvider as TAppRouterProvider } from './app-router-provider';
|
||||
import type { RouteParams, NextAppDirectory } from './types';
|
||||
|
||||
let action: typeof originalAction;
|
||||
|
||||
try {
|
||||
action = require('@storybook/addon-actions').action;
|
||||
} catch {
|
||||
action = () => () => {};
|
||||
}
|
||||
|
||||
const defaultRouterParams: RouteParams = {
|
||||
pathname: '/',
|
||||
query: {},
|
||||
@ -27,7 +17,23 @@ export const RouterDecorator = (
|
||||
const nextAppDirectory =
|
||||
(parameters.nextjs?.appDirectory as NextAppDirectory | undefined) ?? false;
|
||||
|
||||
const [AppRouterProvider, setAppRouterProvider] = React.useState<
|
||||
typeof TAppRouterProvider | undefined
|
||||
>();
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!nextAppDirectory) {
|
||||
return;
|
||||
}
|
||||
import('./app-router-provider').then((exports) =>
|
||||
setAppRouterProvider(() => exports.AppRouterProvider)
|
||||
);
|
||||
}, [nextAppDirectory]);
|
||||
|
||||
if (nextAppDirectory) {
|
||||
if (!AppRouterProvider) {
|
||||
return null;
|
||||
}
|
||||
return (
|
||||
<AppRouterProvider
|
||||
action={action}
|
||||
|
@ -9,7 +9,7 @@ type PageRouterProviderProps = {
|
||||
globals: Globals;
|
||||
};
|
||||
|
||||
const PageRouterProvider: React.FC<PageRouterProviderProps> = ({
|
||||
export const PageRouterProvider: React.FC<PageRouterProviderProps> = ({
|
||||
children,
|
||||
action,
|
||||
routeParams,
|
||||
@ -66,5 +66,3 @@ const PageRouterProvider: React.FC<PageRouterProviderProps> = ({
|
||||
{children}
|
||||
</RouterContext.Provider>
|
||||
);
|
||||
|
||||
export default PageRouterProvider;
|
||||
|
68
code/frameworks/nextjs/src/swc/loader.ts
Normal file
68
code/frameworks/nextjs/src/swc/loader.ts
Normal file
@ -0,0 +1,68 @@
|
||||
import { getProjectRoot } from '@storybook/core-common';
|
||||
import { getVirtualModuleMapping } from '@storybook/core-webpack';
|
||||
import type { Options } from '@storybook/types';
|
||||
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
|
||||
import type { NextConfig } from 'next';
|
||||
import path from 'path';
|
||||
import type { RuleSetRule } from 'webpack';
|
||||
import semver from 'semver';
|
||||
import { NextjsSWCNotSupportedError } from '@storybook/core-events/server-errors';
|
||||
import { getNextjsVersion } from '../utils';
|
||||
|
||||
export const configureSWCLoader = async (
|
||||
baseConfig: any,
|
||||
options: Options,
|
||||
nextConfig: NextConfig
|
||||
) => {
|
||||
const isDevelopment = options.configType !== 'PRODUCTION';
|
||||
const version = getNextjsVersion();
|
||||
|
||||
if (semver.lt(version, '14.0.0')) {
|
||||
throw new NextjsSWCNotSupportedError();
|
||||
}
|
||||
|
||||
const dir = getProjectRoot();
|
||||
|
||||
baseConfig.plugins = [
|
||||
...baseConfig.plugins,
|
||||
new ReactRefreshWebpackPlugin({
|
||||
overlay: {
|
||||
sockIntegration: 'whm',
|
||||
},
|
||||
}),
|
||||
];
|
||||
|
||||
const virtualModules = await getVirtualModuleMapping(options);
|
||||
|
||||
baseConfig.module.rules = [
|
||||
// TODO: Remove filtering in Storybook 8.0
|
||||
...baseConfig.module.rules.filter((r: RuleSetRule) => {
|
||||
return !r.loader?.includes('swc-loader');
|
||||
}),
|
||||
{
|
||||
test: /\.(m?(j|t)sx?)$/,
|
||||
include: [getProjectRoot()],
|
||||
exclude: [/(node_modules)/, ...Object.keys(virtualModules)],
|
||||
enforce: 'post',
|
||||
use: {
|
||||
// we use our own patch because we need to remove tracing from the original code
|
||||
// which is not possible otherwise
|
||||
loader: require.resolve('./swc/next-swc-loader-patch.js'),
|
||||
options: {
|
||||
isServer: false,
|
||||
rootDir: dir,
|
||||
pagesDir: `${dir}/pages`,
|
||||
appDir: `${dir}/apps`,
|
||||
hasReactRefresh: isDevelopment,
|
||||
nextConfig,
|
||||
supportedBrowsers: require('next/dist/build/utils').getSupportedBrowsers(
|
||||
dir,
|
||||
isDevelopment
|
||||
),
|
||||
swcCacheDir: path.join(dir, nextConfig?.distDir ?? '.next', 'cache', 'swc'),
|
||||
bundleTarget: 'default',
|
||||
},
|
||||
},
|
||||
},
|
||||
];
|
||||
};
|
193
code/frameworks/nextjs/src/swc/next-swc-loader-patch.ts
Normal file
193
code/frameworks/nextjs/src/swc/next-swc-loader-patch.ts
Normal file
@ -0,0 +1,193 @@
|
||||
// THIS IS A PATCH over the original code from Next 14.0.0
|
||||
// we use our own patch because we need to remove tracing from the original code
|
||||
// which is not possible otherwise
|
||||
|
||||
/* eslint-disable no-restricted-syntax */
|
||||
/*
|
||||
Copyright (c) 2017 The swc Project Developers
|
||||
Permission is hereby granted, free of charge, to any
|
||||
person obtaining a copy of this software and associated
|
||||
documentation files (the "Software"), to deal in the
|
||||
Software without restriction, including without
|
||||
limitation the rights to use, copy, modify, merge,
|
||||
publish, distribute, sublicense, and/or sell copies of
|
||||
the Software, and to permit persons to whom the Software
|
||||
is furnished to do so, subject to the following
|
||||
conditions:
|
||||
The above copyright notice and this permission notice
|
||||
shall be included in all copies or substantial portions
|
||||
of the Software.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
|
||||
ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
|
||||
TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
|
||||
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
|
||||
SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
|
||||
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
|
||||
IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
import type { NextConfig } from 'next';
|
||||
import { isWasm, transform } from 'next/dist/build/swc';
|
||||
import { getLoaderSWCOptions } from 'next/dist/build/swc/options';
|
||||
import path, { isAbsolute } from 'path';
|
||||
|
||||
export interface SWCLoaderOptions {
|
||||
rootDir: string;
|
||||
isServer: boolean;
|
||||
pagesDir?: string;
|
||||
appDir?: string;
|
||||
hasReactRefresh: boolean;
|
||||
optimizeServerReact?: boolean;
|
||||
nextConfig: NextConfig;
|
||||
jsConfig: any;
|
||||
supportedBrowsers: string[] | undefined;
|
||||
swcCacheDir: string;
|
||||
serverComponents?: boolean;
|
||||
isReactServerLayer?: boolean;
|
||||
}
|
||||
|
||||
const mockCurrentTraceSpan = {
|
||||
traceChild: (name: string) => mockCurrentTraceSpan,
|
||||
traceAsyncFn: async (fn: any) => fn(),
|
||||
};
|
||||
|
||||
async function loaderTransform(this: any, parentTrace: any, source?: string, inputSourceMap?: any) {
|
||||
// Make the loader async
|
||||
const filename = this.resourcePath;
|
||||
|
||||
const loaderOptions: SWCLoaderOptions = this.getOptions() || {};
|
||||
|
||||
const {
|
||||
isServer,
|
||||
rootDir,
|
||||
pagesDir,
|
||||
appDir,
|
||||
hasReactRefresh,
|
||||
nextConfig,
|
||||
jsConfig,
|
||||
supportedBrowsers,
|
||||
swcCacheDir,
|
||||
serverComponents,
|
||||
isReactServerLayer,
|
||||
} = loaderOptions;
|
||||
const isPageFile = filename.startsWith(pagesDir);
|
||||
const relativeFilePathFromRoot = path.relative(rootDir, filename);
|
||||
|
||||
const swcOptions = getLoaderSWCOptions({
|
||||
pagesDir,
|
||||
appDir,
|
||||
filename,
|
||||
isServer,
|
||||
isPageFile,
|
||||
development: this.mode === 'development',
|
||||
hasReactRefresh,
|
||||
modularizeImports: nextConfig?.modularizeImports,
|
||||
optimizePackageImports: nextConfig?.experimental?.optimizePackageImports,
|
||||
swcPlugins: nextConfig?.experimental?.swcPlugins,
|
||||
compilerOptions: nextConfig?.compiler,
|
||||
optimizeServerReact: nextConfig?.experimental?.optimizeServerReact,
|
||||
jsConfig,
|
||||
supportedBrowsers,
|
||||
swcCacheDir,
|
||||
relativeFilePathFromRoot,
|
||||
serverComponents,
|
||||
isReactServerLayer,
|
||||
});
|
||||
|
||||
const programmaticOptions = {
|
||||
...swcOptions,
|
||||
filename,
|
||||
inputSourceMap: inputSourceMap ? JSON.stringify(inputSourceMap) : undefined,
|
||||
|
||||
// Set the default sourcemap behavior based on Webpack's mapping flag,
|
||||
sourceMaps: this.sourceMap,
|
||||
inlineSourcesContent: this.sourceMap,
|
||||
|
||||
// Ensure that Webpack will get a full absolute path in the sourcemap
|
||||
// so that it can properly map the module back to its internal cached
|
||||
// modules.
|
||||
sourceFileName: filename,
|
||||
};
|
||||
|
||||
if (!programmaticOptions.inputSourceMap) {
|
||||
delete programmaticOptions.inputSourceMap;
|
||||
}
|
||||
|
||||
// auto detect development mode
|
||||
if (
|
||||
this.mode &&
|
||||
programmaticOptions.jsc &&
|
||||
programmaticOptions.jsc.transform &&
|
||||
programmaticOptions.jsc.transform.react &&
|
||||
!Object.prototype.hasOwnProperty.call(programmaticOptions.jsc.transform.react, 'development')
|
||||
) {
|
||||
programmaticOptions.jsc.transform.react.development = this.mode === 'development';
|
||||
}
|
||||
|
||||
const swcSpan = parentTrace.traceChild('next-swc-transform');
|
||||
return swcSpan.traceAsyncFn(() =>
|
||||
transform(source as any, programmaticOptions).then((output) => {
|
||||
if (output.eliminatedPackages && this.eliminatedPackages) {
|
||||
for (const pkg of JSON.parse(output.eliminatedPackages)) {
|
||||
this.eliminatedPackages.add(pkg);
|
||||
}
|
||||
}
|
||||
return [output.code, output.map ? JSON.parse(output.map) : undefined];
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const EXCLUDED_PATHS = /[\\/](cache[\\/][^\\/]+\.zip[\\/]node_modules|__virtual__)[\\/]/g;
|
||||
|
||||
export function pitch(this: any) {
|
||||
const callback = this.async();
|
||||
(async () => {
|
||||
if (
|
||||
// TODO: investigate swc file reading in PnP mode?
|
||||
!process.versions.pnp &&
|
||||
!EXCLUDED_PATHS.test(this.resourcePath) &&
|
||||
this.loaders.length - 1 === this.loaderIndex &&
|
||||
isAbsolute(this.resourcePath) &&
|
||||
!(await isWasm())
|
||||
) {
|
||||
const loaderSpan = mockCurrentTraceSpan.traceChild('next-swc-loader');
|
||||
this.addDependency(this.resourcePath);
|
||||
return loaderSpan.traceAsyncFn(() => loaderTransform.call(this, loaderSpan));
|
||||
}
|
||||
|
||||
return null;
|
||||
})().then((r) => {
|
||||
if (r) return callback(null, ...r);
|
||||
callback();
|
||||
return null;
|
||||
}, callback);
|
||||
}
|
||||
|
||||
function sanitizeSourceMap(rawSourceMap: any): any {
|
||||
const { sourcesContent, ...sourceMap } = rawSourceMap ?? {};
|
||||
|
||||
// JSON parse/stringify trick required for swc to accept the SourceMap
|
||||
return JSON.parse(JSON.stringify(sourceMap));
|
||||
}
|
||||
|
||||
export default function swcLoader(this: any, inputSource: string, inputSourceMap: any) {
|
||||
const loaderSpan = mockCurrentTraceSpan.traceChild('next-swc-loader');
|
||||
const callback = this.async();
|
||||
loaderSpan
|
||||
.traceAsyncFn(() =>
|
||||
loaderTransform.call(this, loaderSpan, inputSource, sanitizeSourceMap(inputSourceMap))
|
||||
)
|
||||
.then(
|
||||
([transformedSource, outputSourceMap]: any) => {
|
||||
callback(null, transformedSource, outputSourceMap || inputSourceMap);
|
||||
},
|
||||
(err: Error) => {
|
||||
callback(err);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
// accept Buffers instead of strings
|
||||
export const raw = true;
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact-vite",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Preact and Vite: Develop Preact components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@preact/preset-vite": "^2.0.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/preact-webpack5",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Preact: Develop Preact Component in isolation.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
@ -59,9 +59,7 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "*",
|
||||
"preact": "^8.0.0||^10.0.0",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
"preact": "^8.0.0||^10.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-vite",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for React and Vite: Develop React components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@joshwooding/vite-plugin-react-docgen-typescript": "0.3.0",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/react-webpack5",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for React: Develop React Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/server-webpack5",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Server: View HTML snippets from a server in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
@ -56,10 +56,6 @@
|
||||
"devDependencies": {
|
||||
"typescript": "~4.9.3"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-vite",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Svelte and Vite: Develop Svelte components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "workspace:*",
|
||||
|
@ -3,7 +3,7 @@ import MagicString from 'magic-string';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import svelteDoc from 'sveltedoc-parser';
|
||||
import type { SvelteParserOptions } from 'sveltedoc-parser';
|
||||
import type { SvelteComponentDoc, SvelteParserOptions } from 'sveltedoc-parser';
|
||||
import { logger } from '@storybook/node-logger';
|
||||
import { preprocess } from 'svelte/compiler';
|
||||
import { createFilter } from 'vite';
|
||||
@ -120,7 +120,7 @@ export function svelteDocgen(svelteOptions: Record<string, any> = {}): PluginOpt
|
||||
|
||||
const s = new MagicString(src);
|
||||
|
||||
let componentDoc: any;
|
||||
let componentDoc: SvelteComponentDoc & { keywords?: string[] };
|
||||
try {
|
||||
componentDoc = await svelteDoc.parse(options);
|
||||
} catch (error: any) {
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/svelte-webpack5",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Svelte: Develop Svelte Component in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-webpack5": "workspace:*",
|
||||
@ -59,8 +59,6 @@
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@babel/core": "*",
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"svelte": "^3.48.0 || ^4.0.0",
|
||||
"svelte-loader": "*"
|
||||
},
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/sveltekit",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for SvelteKit",
|
||||
"keywords": [
|
||||
"storybook",
|
||||
@ -46,8 +46,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "workspace:*",
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@storybook/vue-vite",
|
||||
"version": "7.6.0-alpha.4",
|
||||
"version": "7.6.0-alpha.6",
|
||||
"description": "Storybook for Vue2 and Vite: Develop Vue2 Components in isolation with Hot Reloading.",
|
||||
"keywords": [
|
||||
"storybook"
|
||||
@ -43,8 +43,8 @@
|
||||
"!src/**/*"
|
||||
],
|
||||
"scripts": {
|
||||
"check": "../../../scripts/prepare/check.ts",
|
||||
"prep": "../../../scripts/prepare/bundle.ts"
|
||||
"check": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/check.ts",
|
||||
"prep": "node --loader ../../../scripts/node_modules/esbuild-register/loader.js -r ../../../scripts/node_modules/esbuild-register/register.js ../../../scripts/prepare/bundle.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@storybook/builder-vite": "workspace:*",
|
||||
@ -60,8 +60,6 @@
|
||||
"vue": "^2.7.10"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
|
||||
"vite": "^3.0.0 || ^4.0.0 || ^5.0.0",
|
||||
"vue": "^2.7.0"
|
||||
},
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user