-
-
Notifications
You must be signed in to change notification settings - Fork 9.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17697 from storybookjs/1621-auto-disable-docgen
Addon-docs: Auto-disable docs presets if docs/controls unused
- Loading branch information
Showing
33 changed files
with
256 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
import path from 'path'; | ||
import { StorybookConfig } from '@storybook/core-common'; | ||
import { hasDocsOrControls } from '@storybook/docs-tools'; | ||
|
||
export const config: StorybookConfig['config'] = (entry = [], options) => { | ||
console.log({ options }); | ||
if (!hasDocsOrControls(options)) return entry; | ||
return [...entry, path.join(__dirname, '../../../dist/ts3.9/client/docs/config')]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('./dist/cjs/server/framework-preset-babel-ember'); | ||
module.exports = require('./dist/cjs/server/preset'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
import type { StorybookConfig } from '@storybook/core-common'; | ||
import { findDistEsm } from '@storybook/core-common'; | ||
import { hasDocsOrControls } from '@storybook/docs-tools'; | ||
|
||
export const config: StorybookConfig['config'] = (entry = []) => { | ||
export const config: StorybookConfig['config'] = (entry = [], options) => { | ||
if (!hasDocsOrControls(options)) return entry; | ||
return [...entry, findDistEsm(__dirname, 'client/docs/config')]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { StorybookConfig } from '@storybook/core-common'; | ||
|
||
export const addons: StorybookConfig['addons'] = [ | ||
require.resolve('./framework-preset-babel-ember'), | ||
require.resolve('./framework-preset-ember-docs'), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('./dist/cjs/server/framework-preset-html'); | ||
module.exports = require('./dist/cjs/server/preset'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
import { findDistEsm, StorybookConfig } from '@storybook/core-common'; | ||
import type { StorybookConfig } from '@storybook/core-common'; | ||
import { findDistEsm } from '@storybook/core-common'; | ||
import { hasDocsOrControls } from '@storybook/docs-tools'; | ||
|
||
export const config: StorybookConfig['config'] = (entry = []) => { | ||
export const config: StorybookConfig['config'] = (entry = [], options) => { | ||
if (!hasDocsOrControls(options)) return entry; | ||
return [...entry, findDistEsm(__dirname, 'client/docs/config')]; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import type { StorybookConfig } from '@storybook/core-common'; | ||
|
||
export const addons: StorybookConfig['addons'] = [ | ||
require.resolve('./framework-preset-html'), | ||
require.resolve('./framework-preset-html-docs'), | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module.exports = require('./dist/cjs/server/framework-preset-svelte'); | ||
module.exports = require('./dist/cjs/server/preset'); |
Oops, something went wrong.