Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Essentials: Prototype removing addon-docs from addon-essentials #23479

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
4ff3133
step1: remove docs from essentials
ndelangen Jul 17, 2023
56e3e8e
step2: remove the re-exports
ndelangen Jul 17, 2023
eeaecad
step3: remove unneeded dependencies
ndelangen Jul 17, 2023
08050bb
step4: remove docs from script generating sandboxes
ndelangen Jul 17, 2023
ba8c38d
step5: remove mdx inclusion in sandboxes and init
ndelangen Jul 17, 2023
36461cd
step6: remove autodocs from templates
ndelangen Jul 17, 2023
70315cb
Merge branch 'release/7.2' into norbert/no-docs-addon-in-essentials-n…
ndelangen Jul 18, 2023
120f34e
Merge branch 'release/7.2' into norbert/no-docs-addon-in-essentials-n…
ndelangen Jul 18, 2023
224f4e3
Merge branch 'release/7.2' into norbert/no-docs-addon-in-essentials-n…
ndelangen Jul 18, 2023
31e69e1
Merge branch 'release/7.2' into norbert/no-docs-addon-in-essentials-n…
ndelangen Jul 18, 2023
02d5c56
Merge branch 'release/7.2' into norbert/no-docs-addon-in-essentials-n…
ndelangen Jul 19, 2023
f44a842
add addon-docs to the UI storybook
ndelangen Jul 19, 2023
45fe518
update snapshots
ndelangen Jul 19, 2023
6e4a699
add docs to init, to preserve the addon existing after init
ndelangen Jul 19, 2023
93b3649
add autodocs back, considering I added addon-docs back true direct im…
ndelangen Jul 19, 2023
4ffba02
Discard changes to scripts/tasks/sandbox-parts.ts
ndelangen Jul 19, 2023
7748b1b
Merge branch 'norbert/no-docs-addon-in-essentials-no-mdx-less-react' …
ndelangen Jul 19, 2023
0518aef
Discard changes to code/lib/cli/src/generators/configure.test.ts
ndelangen Jul 19, 2023
7a462dc
Discard changes to code/lib/cli/src/generators/configure.ts
ndelangen Jul 19, 2023
51566cb
Merge branch 'release/7.2' into norbert/no-docs-addon-in-essentials-n…
ndelangen Jul 19, 2023
bcda497
Merge branch 'release/7.2' into norbert/no-docs-addon-in-essentials-n…
ndelangen Jul 19, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 1 addition & 95 deletions code/addons/essentials/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,81 +28,6 @@
"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"
},
"./package.json": "./package.json"
},
"main": "dist/index.js",
Expand All @@ -122,20 +47,16 @@
"@storybook/addon-actions": "7.1.0",
"@storybook/addon-backgrounds": "7.1.0",
"@storybook/addon-controls": "7.1.0",
"@storybook/addon-docs": "7.1.0",
"@storybook/addon-highlight": "7.1.0",
"@storybook/addon-measure": "7.1.0",
"@storybook/addon-outline": "7.1.0",
"@storybook/addon-toolbars": "7.1.0",
"@storybook/addon-viewport": "7.1.0",
"@storybook/core-common": "7.1.0",
"@storybook/manager-api": "7.1.0",
"@storybook/node-logger": "7.1.0",
"@storybook/preview-api": "7.1.0",
"ts-dedent": "^2.0.0"
},
"devDependencies": {
"@storybook/vue": "7.1.0",
"typescript": "^4.9.3"
},
"peerDependencies": {
Expand All @@ -147,22 +68,7 @@
},
"bundler": {
"entries": [
"./src/index.ts",
"./src/actions/preview.ts",
"./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"
"./src/index.ts"
],
"platform": "node"
},
Expand Down
1 change: 0 additions & 1 deletion code/addons/essentials/src/actions/manager.ts

This file was deleted.

4 changes: 0 additions & 4 deletions code/addons/essentials/src/actions/preview.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/addons/essentials/src/backgrounds/manager.ts

This file was deleted.

4 changes: 0 additions & 4 deletions code/addons/essentials/src/backgrounds/preview.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/addons/essentials/src/controls/manager.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/addons/essentials/src/docs/mdx-react-shim.ts

This file was deleted.

8 changes: 0 additions & 8 deletions code/addons/essentials/src/docs/preset.ts

This file was deleted.

2 changes: 0 additions & 2 deletions code/addons/essentials/src/docs/preview.ts

This file was deleted.

4 changes: 0 additions & 4 deletions code/addons/essentials/src/highlight/preview.ts

This file was deleted.

8 changes: 3 additions & 5 deletions code/addons/essentials/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import path from 'path';
import path, { dirname } from 'path';
import { logger } from '@storybook/node-logger';
import { serverRequire } from '@storybook/core-common';

interface PresetOptions {
configDir: string;
docs?: boolean;
controls?: boolean;
actions?: boolean;
backgrounds?: boolean;
Expand Down Expand Up @@ -38,7 +37,6 @@ export function addons(options: PresetOptions) {

const main = requireMain(options.configDir);
return [
'docs',
'controls',
'actions',
'backgrounds',
Expand All @@ -51,7 +49,7 @@ export function addons(options: PresetOptions) {
.filter((key) => (options as any)[key] !== false)
.filter((addon) => !checkInstalled(addon, main))
.map((addon) => {
// We point to the re-export from addon-essentials to support yarn pnp and pnpm.
return `@storybook/addon-essentials/${addon}`;
// We point to the resolved directories to support yarn pnp and pnpm.
return dirname(require.resolve(`@storybook/addon-${addon}/package.json`));
});
}
1 change: 0 additions & 1 deletion code/addons/essentials/src/measure/manager.ts

This file was deleted.

4 changes: 0 additions & 4 deletions code/addons/essentials/src/measure/preview.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/addons/essentials/src/outline/manager.ts

This file was deleted.

4 changes: 0 additions & 4 deletions code/addons/essentials/src/outline/preview.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/addons/essentials/src/toolbars/manager.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/addons/essentials/src/viewport/manager.ts

This file was deleted.

1 change: 0 additions & 1 deletion code/builders/builder-vite/src/optimizeDeps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const INCLUDE_CANDIDATES = [
'@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',
Expand Down
2 changes: 2 additions & 0 deletions code/lib/cli/src/generators/baseGenerator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,12 +232,14 @@ export async function baseGenerator(
const addons = [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-docs',
...stripVersions(extraAddonPackages),
];
// added to package.json
const addonPackages = [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-docs',
'@storybook/blocks',
...extraAddonPackages,
];
Expand Down
1 change: 1 addition & 0 deletions code/ui/.storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const config: StorybookConfig = {
stories: isBlocksOnly ? blocksOnlyStories : allStories,
addons: [
'@storybook/addon-links',
'@storybook/addon-docs',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-storysource',
Expand Down
4 changes: 2 additions & 2 deletions code/ui/manager/src/components/sidebar/Tree.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export const SingleStoryComponents: Story = {
title: 'Single',
name: 'Single',
kind: 'single',
tags: [],
tags: ['autodocs'],
isRoot: false,
isLeaf: true,
isComponent: false,
Expand Down Expand Up @@ -174,7 +174,7 @@ export const DocsOnlySingleStoryComponents = {
title: 'Single',
name: 'Single',
kind: 'single',
tags: [],
tags: ['autodocs'],
isRoot: false,
isLeaf: true,
isComponent: false,
Expand Down
4 changes: 0 additions & 4 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5711,17 +5711,13 @@ __metadata:
"@storybook/addon-actions": 7.1.0
"@storybook/addon-backgrounds": 7.1.0
"@storybook/addon-controls": 7.1.0
"@storybook/addon-docs": 7.1.0
"@storybook/addon-highlight": 7.1.0
"@storybook/addon-measure": 7.1.0
"@storybook/addon-outline": 7.1.0
"@storybook/addon-toolbars": 7.1.0
"@storybook/addon-viewport": 7.1.0
"@storybook/core-common": 7.1.0
"@storybook/manager-api": 7.1.0
"@storybook/node-logger": 7.1.0
"@storybook/preview-api": 7.1.0
"@storybook/vue": 7.1.0
ts-dedent: ^2.0.0
typescript: ^4.9.3
peerDependencies:
Expand Down