From 5e5b05188c45a9c3f4e3e17bc40c40ea6a501dfb Mon Sep 17 00:00:00 2001 From: Simon Jentsch Date: Fri, 28 May 2021 18:08:30 +0200 Subject: [PATCH 1/4] fix(cli): Make stories with same name possible --- packages/cli/fakeStorybookAddons.js | 5 +- .../src/steps/analyze/getStoriesMetadata.ts | 4 +- packages/cli/src/steps/analyze/index.tsx | 2 +- packages/cli/src/steps/compile/index.tsx | 2 +- .../steps/scan/getExtendedStorybookFiles.ts | 2 +- .../src/utils/componentExtractLoader.spec.ts | 7 +- .../cli/src/utils/componentExtractLoader.ts | 4 +- .../src/utils/composeWebpackConfig.spec.ts | 2 +- .../cli/src/utils/composeWebpackConfig.ts | 2 +- packages/cli/src/utils/getWebpackConfig.ts | 2 +- .../__snapshots__/bundle.integration.ts.snap | 102 ++++++++-------- .../__snapshots__/bundle.integration.ts.snap | 66 +++++----- .../__snapshots__/bundle.integration.ts.snap | 114 +++++++++--------- 13 files changed, 161 insertions(+), 153 deletions(-) diff --git a/packages/cli/fakeStorybookAddons.js b/packages/cli/fakeStorybookAddons.js index e7cadf37..1c95f102 100644 --- a/packages/cli/fakeStorybookAddons.js +++ b/packages/cli/fakeStorybookAddons.js @@ -1,4 +1,5 @@ -const makeDecorator = () => story => story(); +const originalAddons = require('@storybook/addons'); +const makeDecorator = originalAddons.makeDecorator; const getChannel = () => ({ addListener: () => {}, addPeerListener: () => {}, @@ -12,7 +13,7 @@ const getChannel = () => ({ removeListener: () => {}, on: () => {}, off: () => {}, -}) +}); const addons = { makeDecorator, diff --git a/packages/cli/src/steps/analyze/getStoriesMetadata.ts b/packages/cli/src/steps/analyze/getStoriesMetadata.ts index 9f2855a0..fd9c6b7d 100644 --- a/packages/cli/src/steps/analyze/getStoriesMetadata.ts +++ b/packages/cli/src/steps/analyze/getStoriesMetadata.ts @@ -6,11 +6,11 @@ export function getStoriesMetadata( componentModules: Map> ): Record { return stories.reduce((acc, s) => { - const module = componentModules.get(s.fileName); + const module = componentModules.get(s.name); const metadata = module ? { title: (module.default && module.default.title) || camelCaseToSpaces(s.name), - fileName: s.fileName, + fileName: s.name, storyItems: Object.entries(module) .filter(([exportName]) => exportName !== 'default') .map(([exportName, storyFn]) => ({ diff --git a/packages/cli/src/steps/analyze/index.tsx b/packages/cli/src/steps/analyze/index.tsx index 05e368c0..67f9fece 100644 --- a/packages/cli/src/steps/analyze/index.tsx +++ b/packages/cli/src/steps/analyze/index.tsx @@ -45,7 +45,7 @@ async function action({ stepOutputs }: StepRunnerActionOptions - s.files.forEach(fileName => { + (s.files || []).forEach(fileName => { const foundFile = getStepOutputFiles(stepOutputs) .filter(file => JS_REGEXP.test(file.name)) .find(file => file.name === fileName); diff --git a/packages/cli/src/steps/compile/index.tsx b/packages/cli/src/steps/compile/index.tsx index b03838bf..3f1b2dc4 100644 --- a/packages/cli/src/steps/compile/index.tsx +++ b/packages/cli/src/steps/compile/index.tsx @@ -95,7 +95,7 @@ async function action({ name: sf.name, namespace, filePath: sf.filePath, - files: assets[sf.fileName], + files: assets[sf.name], }) ); diff --git a/packages/cli/src/steps/scan/getExtendedStorybookFiles.ts b/packages/cli/src/steps/scan/getExtendedStorybookFiles.ts index 89bcf931..9545e9c2 100644 --- a/packages/cli/src/steps/scan/getExtendedStorybookFiles.ts +++ b/packages/cli/src/steps/scan/getExtendedStorybookFiles.ts @@ -23,7 +23,7 @@ const getEntrypointsFromFiles = ( const fileName = matchResult[1]; return { - name: fileName, + name: filePath.replace(/\//g, '__'), filePath, gitPath: gitPath || filePath, fileName, diff --git a/packages/cli/src/utils/componentExtractLoader.spec.ts b/packages/cli/src/utils/componentExtractLoader.spec.ts index 4843dd60..e4e9d659 100644 --- a/packages/cli/src/utils/componentExtractLoader.spec.ts +++ b/packages/cli/src/utils/componentExtractLoader.spec.ts @@ -10,7 +10,12 @@ beforeEach(() => { cacheable: jest.fn(), context: '/home/MyAccount/project/Abc', resourcePath: '/home/MyAccount/project/Abc/Abc.jsx', - query: '?MyComponent', + _module: { + issuer: { + name: 'MyComponent', + }, + }, + query: '?MyComponentQuery', }; pitch = _pitch.bind(self); }); diff --git a/packages/cli/src/utils/componentExtractLoader.ts b/packages/cli/src/utils/componentExtractLoader.ts index 9fab5c83..c8677d95 100644 --- a/packages/cli/src/utils/componentExtractLoader.ts +++ b/packages/cli/src/utils/componentExtractLoader.ts @@ -11,7 +11,9 @@ export function pitch(remainingRequest) { if (this.cacheable) this.cacheable(); if (!this.query) throw new Error('query parameter is missing'); - const moduleName = JSON.stringify(this.query.substr(1)); + // eslint-disable-next-line no-underscore-dangle + const moduleName = JSON.stringify(this._module.issuer.name); + const componentHubFn = 'registerComponent'; const requirePath = JSON.stringify(`-!${newRequestPath}`); const result = ` diff --git a/packages/cli/src/utils/composeWebpackConfig.spec.ts b/packages/cli/src/utils/composeWebpackConfig.spec.ts index 3d79f2f5..72a5b458 100644 --- a/packages/cli/src/utils/composeWebpackConfig.spec.ts +++ b/packages/cli/src/utils/composeWebpackConfig.spec.ts @@ -78,7 +78,7 @@ const testCases = [ }); expect(config.output).toEqual({ path: `${process.cwd()}/bojagi`, - filename: '[name].js', + filename: '[name].[hash].js', publicPath: '__bojagi_public_path__/', globalObject: 'window', }); diff --git a/packages/cli/src/utils/composeWebpackConfig.ts b/packages/cli/src/utils/composeWebpackConfig.ts index e7c377c1..0f57376f 100644 --- a/packages/cli/src/utils/composeWebpackConfig.ts +++ b/packages/cli/src/utils/composeWebpackConfig.ts @@ -64,7 +64,7 @@ const composeWebpackConfig = ( entry, output: { path: pathUtils.join(process.cwd(), 'bojagi'), - filename: '[name].js', + filename: '[name].[hash].js', publicPath, globalObject: 'window', }, diff --git a/packages/cli/src/utils/getWebpackConfig.ts b/packages/cli/src/utils/getWebpackConfig.ts index 21ae6d87..468a645f 100644 --- a/packages/cli/src/utils/getWebpackConfig.ts +++ b/packages/cli/src/utils/getWebpackConfig.ts @@ -28,7 +28,7 @@ export async function getWebpackConfig({ const entrypoints = storyFiles.reduce( (prev, storyFile) => ({ ...prev, - [storyFile.fileName]: [ + [storyFile.name]: [ storyFile.entrypoint, pathUtils.resolve(__dirname, '../storybook/getGlobals.js'), ...(decoratorFile ? [decoratorFile] : []), diff --git a/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap b/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap index 0e815c1c..cbb13fa4 100644 --- a/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap +++ b/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap @@ -18,79 +18,79 @@ exports[`run bundle command 1`] = ` exports[`run bundle command 2`] = ` "[ { - \\"name\\": \\"vendors.js\\", + \\"name\\": \\"vendors.beaf02eae9d72e23ceeb.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.js\\" + \\"outputFilePath\\": \\"files/vendors.beaf02eae9d72e23ceeb.js\\" }, { - \\"name\\": \\"Button.stories.js\\", + \\"name\\": \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Button.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js\\" }, { - \\"name\\": \\"Header.stories.js\\", + \\"name\\": \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Header.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js\\" }, { - \\"name\\": \\"Page.stories.js\\", + \\"name\\": \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Page.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js\\" }, { - \\"name\\": \\"runtime~Button.stories.js\\", + \\"name\\": \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Button.stories.js\\" + \\"outputFilePath\\": \\"files/src__Button.stories.js.beaf02eae9d72e23ceeb.js\\" }, { - \\"name\\": \\"runtime~Header.stories.js\\", + \\"name\\": \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Header.stories.js\\" + \\"outputFilePath\\": \\"files/src__Header.stories.js.beaf02eae9d72e23ceeb.js\\" }, { - \\"name\\": \\"runtime~Page.stories.js\\", + \\"name\\": \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Page.stories.js\\" + \\"outputFilePath\\": \\"files/src__Page.stories.js.beaf02eae9d72e23ceeb.js\\" }, { - \\"name\\": \\"vendors.js.LICENSE.txt\\", + \\"name\\": \\"vendors.beaf02eae9d72e23ceeb.js.LICENSE.txt\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.js.LICENSE.txt\\" + \\"outputFilePath\\": \\"files/vendors.beaf02eae9d72e23ceeb.js.LICENSE.txt\\" }, { - \\"name\\": \\"vendors.js.map\\", + \\"name\\": \\"vendors.beaf02eae9d72e23ceeb.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.js.map\\" + \\"outputFilePath\\": \\"files/vendors.beaf02eae9d72e23ceeb.js.map\\" }, { - \\"name\\": \\"Button.stories.js.map\\", + \\"name\\": \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Button.stories.js.map\\" + \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\" }, { - \\"name\\": \\"Header.stories.js.map\\", + \\"name\\": \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Header.stories.js.map\\" + \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\" }, { - \\"name\\": \\"Page.stories.js.map\\", + \\"name\\": \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Page.stories.js.map\\" + \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\" }, { - \\"name\\": \\"runtime~Button.stories.js.map\\", + \\"name\\": \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Button.stories.js.map\\" + \\"outputFilePath\\": \\"files/src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\" }, { - \\"name\\": \\"runtime~Header.stories.js.map\\", + \\"name\\": \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Header.stories.js.map\\" + \\"outputFilePath\\": \\"files/src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\" }, { - \\"name\\": \\"runtime~Page.stories.js.map\\", + \\"name\\": \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Page.stories.js.map\\" + \\"outputFilePath\\": \\"files/src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\" }, { \\"name\\": \\"iframe.html\\", @@ -144,16 +144,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_1_x/src/Button.stories.js\\", - \\"name\\": \\"Button.stories\\", + \\"name\\": \\"src__Button.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Button.stories.js\\", \\"files\\": [ - \\"runtime~Button.stories.js\\", - \\"runtime~Button.stories.js.map\\", - \\"vendors.js\\", - \\"vendors.js.map\\", - \\"Button.stories.js\\", - \\"Button.stories.js.map\\" + \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"vendors.beaf02eae9d72e23ceeb.js\\", + \\"vendors.beaf02eae9d72e23ceeb.js.map\\", + \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\" ] }, { @@ -180,16 +180,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_1_x/src/Header.stories.js\\", - \\"name\\": \\"Header.stories\\", + \\"name\\": \\"src__Header.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Header.stories.js\\", \\"files\\": [ - \\"runtime~Header.stories.js\\", - \\"runtime~Header.stories.js.map\\", - \\"vendors.js\\", - \\"vendors.js.map\\", - \\"Header.stories.js\\", - \\"Header.stories.js.map\\" + \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"vendors.beaf02eae9d72e23ceeb.js\\", + \\"vendors.beaf02eae9d72e23ceeb.js.map\\", + \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\" ] }, { @@ -220,16 +220,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_1_x/src/Page.stories.js\\", - \\"name\\": \\"Page.stories\\", + \\"name\\": \\"src__Page.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Page.stories.js\\", \\"files\\": [ - \\"runtime~Page.stories.js\\", - \\"runtime~Page.stories.js.map\\", - \\"vendors.js\\", - \\"vendors.js.map\\", - \\"Page.stories.js\\", - \\"Page.stories.js.map\\" + \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"vendors.beaf02eae9d72e23ceeb.js\\", + \\"vendors.beaf02eae9d72e23ceeb.js.map\\", + \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\" ] } ]" diff --git a/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap b/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap index fdc7f588..87899a66 100644 --- a/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap +++ b/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap @@ -18,49 +18,49 @@ exports[`run bundle command 1`] = ` exports[`run bundle command 2`] = ` "[ { - \\"name\\": \\"vendors.js\\", + \\"name\\": \\"vendors.0b9ade441d1473d9b03f.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.js\\" + \\"outputFilePath\\": \\"files/vendors.0b9ade441d1473d9b03f.js\\" }, { - \\"name\\": \\"Button.stories.js\\", + \\"name\\": \\"runtime~src__Button.stories.js.0b9ade441d1473d9b03f.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Button.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.0b9ade441d1473d9b03f.js\\" }, { - \\"name\\": \\"Header.stories.js\\", + \\"name\\": \\"runtime~src__Header.stories.js.0b9ade441d1473d9b03f.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Header.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.0b9ade441d1473d9b03f.js\\" }, { - \\"name\\": \\"Page.stories.js\\", + \\"name\\": \\"runtime~src__Page.stories.js.0b9ade441d1473d9b03f.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Page.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.0b9ade441d1473d9b03f.js\\" }, { - \\"name\\": \\"runtime~Button.stories.js\\", + \\"name\\": \\"src__Button.stories.js.0b9ade441d1473d9b03f.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Button.stories.js\\" + \\"outputFilePath\\": \\"files/src__Button.stories.js.0b9ade441d1473d9b03f.js\\" }, { - \\"name\\": \\"runtime~Header.stories.js\\", + \\"name\\": \\"src__Header.stories.js.0b9ade441d1473d9b03f.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Header.stories.js\\" + \\"outputFilePath\\": \\"files/src__Header.stories.js.0b9ade441d1473d9b03f.js\\" }, { - \\"name\\": \\"runtime~Page.stories.js\\", + \\"name\\": \\"src__Page.stories.js.0b9ade441d1473d9b03f.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Page.stories.js\\" + \\"outputFilePath\\": \\"files/src__Page.stories.js.0b9ade441d1473d9b03f.js\\" }, { - \\"name\\": \\"vendors.js.LICENSE.txt\\", + \\"name\\": \\"vendors.0b9ade441d1473d9b03f.js.LICENSE.txt\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.js.LICENSE.txt\\" + \\"outputFilePath\\": \\"files/vendors.0b9ade441d1473d9b03f.js.LICENSE.txt\\" }, { - \\"name\\": \\"vendors.js.map\\", + \\"name\\": \\"vendors.0b9ade441d1473d9b03f.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.js.map\\" + \\"outputFilePath\\": \\"files/vendors.0b9ade441d1473d9b03f.js.map\\" }, { \\"name\\": \\"iframe.html\\", @@ -114,14 +114,14 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_2_x/src/Button.stories.js\\", - \\"name\\": \\"Button.stories\\", + \\"name\\": \\"src__Button.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Button.stories.js\\", \\"files\\": [ - \\"runtime~Button.stories.js\\", - \\"vendors.js\\", - \\"vendors.js.map\\", - \\"Button.stories.js\\" + \\"runtime~src__Button.stories.js.0b9ade441d1473d9b03f.js\\", + \\"vendors.0b9ade441d1473d9b03f.js\\", + \\"vendors.0b9ade441d1473d9b03f.js.map\\", + \\"src__Button.stories.js.0b9ade441d1473d9b03f.js\\" ] }, { @@ -148,14 +148,14 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_2_x/src/Header.stories.js\\", - \\"name\\": \\"Header.stories\\", + \\"name\\": \\"src__Header.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Header.stories.js\\", \\"files\\": [ - \\"runtime~Header.stories.js\\", - \\"vendors.js\\", - \\"vendors.js.map\\", - \\"Header.stories.js\\" + \\"runtime~src__Header.stories.js.0b9ade441d1473d9b03f.js\\", + \\"vendors.0b9ade441d1473d9b03f.js\\", + \\"vendors.0b9ade441d1473d9b03f.js.map\\", + \\"src__Header.stories.js.0b9ade441d1473d9b03f.js\\" ] }, { @@ -186,14 +186,14 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_2_x/src/Page.stories.js\\", - \\"name\\": \\"Page.stories\\", + \\"name\\": \\"src__Page.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Page.stories.js\\", \\"files\\": [ - \\"runtime~Page.stories.js\\", - \\"vendors.js\\", - \\"vendors.js.map\\", - \\"Page.stories.js\\" + \\"runtime~src__Page.stories.js.0b9ade441d1473d9b03f.js\\", + \\"vendors.0b9ade441d1473d9b03f.js\\", + \\"vendors.0b9ade441d1473d9b03f.js.map\\", + \\"src__Page.stories.js.0b9ade441d1473d9b03f.js\\" ] } ]" diff --git a/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap b/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap index 71945ef9..18767415 100644 --- a/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap +++ b/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap @@ -23,64 +23,64 @@ exports[`run bundle command 2`] = ` \\"outputFilePath\\": \\"files/718ad8b72621629b68f4ea8458266766.png\\" }, { - \\"name\\": \\"vendors.js\\", + \\"name\\": \\"vendors.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.js\\" + \\"outputFilePath\\": \\"files/vendors.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"App.bojagi.css\\", + \\"name\\": \\"src__App.bojagi.js.css\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/App.bojagi.css\\" + \\"outputFilePath\\": \\"files/src__App.bojagi.js.css\\" }, { - \\"name\\": \\"App.bojagi.js\\", + \\"name\\": \\"src__App.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/App.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__App.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"Box.bojagi.js\\", + \\"name\\": \\"src__components__Box.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Box.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__Box.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"BoxWithButtons.bojagi.js\\", + \\"name\\": \\"src__components__BoxWithButtons.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/BoxWithButtons.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__BoxWithButtons.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"Button.bojagi.js\\", + \\"name\\": \\"src__components__Button.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Button.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__Button.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"Empty.bojagi.js\\", + \\"name\\": \\"src__components__Empty.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Empty.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__Empty.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"Hooks.bojagi.js\\", + \\"name\\": \\"src__components__Hooks.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Hooks.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__Hooks.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"Lazy.bojagi.js\\", + \\"name\\": \\"src__components__Lazy.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Lazy.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__Lazy.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"Logo.bojagi.js\\", + \\"name\\": \\"src__components__Logo.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Logo.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__Logo.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"PingPong.bojagi.js\\", + \\"name\\": \\"src__components__PingPong.bojagi.js.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/PingPong.bojagi.js\\" + \\"outputFilePath\\": \\"files/src__components__PingPong.bojagi.js.3b1f4bb739288813742d.js\\" }, { - \\"name\\": \\"10.js\\", + \\"name\\": \\"10.3b1f4bb739288813742d.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/10.js\\" + \\"outputFilePath\\": \\"files/10.3b1f4bb739288813742d.js\\" }, { \\"name\\": \\"./index.html\\", @@ -118,7 +118,7 @@ exports[`run bundle command 2`] = ` exports[`run bundle command 3`] = ` "[ { - \\"title\\": \\"App.bojagi\\", + \\"title\\": \\"Src__App.bojagi.js\\", \\"fileName\\": \\"App.bojagi\\", \\"storyItems\\": [ { @@ -137,17 +137,17 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/App.bojagi.js\\", - \\"name\\": \\"App.bojagi\\", + \\"name\\": \\"src__App.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/App.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"App.bojagi.css\\", - \\"App.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__App.bojagi.js.css\\", + \\"src__App.bojagi.js.3b1f4bb739288813742d.js\\" ] }, { - \\"title\\": \\"Box.bojagi\\", + \\"title\\": \\"Src__components__Box.bojagi.js\\", \\"fileName\\": \\"Box.bojagi\\", \\"storyItems\\": [ { @@ -182,16 +182,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/components/Box.bojagi.js\\", - \\"name\\": \\"Box.bojagi\\", + \\"name\\": \\"src__components__Box.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Box.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"Box.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__components__Box.bojagi.js.3b1f4bb739288813742d.js\\" ] }, { - \\"title\\": \\"Box With Buttons.bojagi\\", + \\"title\\": \\"Src__components__Box With Buttons.bojagi.js\\", \\"fileName\\": \\"BoxWithButtons.bojagi\\", \\"storyItems\\": [ { @@ -210,16 +210,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/components/BoxWithButtons.bojagi.js\\", - \\"name\\": \\"BoxWithButtons.bojagi\\", + \\"name\\": \\"src__components__BoxWithButtons.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/BoxWithButtons.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"BoxWithButtons.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__components__BoxWithButtons.bojagi.js.3b1f4bb739288813742d.js\\" ] }, { - \\"title\\": \\"Button.bojagi\\", + \\"title\\": \\"Src__components__Button.bojagi.js\\", \\"fileName\\": \\"Button.bojagi\\", \\"storyItems\\": [ { @@ -242,16 +242,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/components/Button.bojagi.js\\", - \\"name\\": \\"Button.bojagi\\", + \\"name\\": \\"src__components__Button.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Button.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"Button.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__components__Button.bojagi.js.3b1f4bb739288813742d.js\\" ] }, { - \\"title\\": \\"Hooks.bojagi\\", + \\"title\\": \\"Src__components__Hooks.bojagi.js\\", \\"fileName\\": \\"Hooks.bojagi\\", \\"storyItems\\": [ { @@ -266,16 +266,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/components/Hooks.bojagi.js\\", - \\"name\\": \\"Hooks.bojagi\\", + \\"name\\": \\"src__components__Hooks.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Hooks.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"Hooks.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__components__Hooks.bojagi.js.3b1f4bb739288813742d.js\\" ] }, { - \\"title\\": \\"Lazy.bojagi\\", + \\"title\\": \\"Src__components__Lazy.bojagi.js\\", \\"fileName\\": \\"Lazy.bojagi\\", \\"storyItems\\": [ { @@ -294,16 +294,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/components/Lazy.bojagi.js\\", - \\"name\\": \\"Lazy.bojagi\\", + \\"name\\": \\"src__components__Lazy.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Lazy.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"Lazy.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__components__Lazy.bojagi.js.3b1f4bb739288813742d.js\\" ] }, { - \\"title\\": \\"Logo.bojagi\\", + \\"title\\": \\"Src__components__Logo.bojagi.js\\", \\"fileName\\": \\"Logo.bojagi\\", \\"storyItems\\": [ { @@ -322,16 +322,16 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/components/Logo.bojagi.js\\", - \\"name\\": \\"Logo.bojagi\\", + \\"name\\": \\"src__components__Logo.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Logo.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"Logo.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__components__Logo.bojagi.js.3b1f4bb739288813742d.js\\" ] }, { - \\"title\\": \\"Ping Pong.bojagi\\", + \\"title\\": \\"Src__components__Ping Pong.bojagi.js\\", \\"fileName\\": \\"PingPong.bojagi\\", \\"storyItems\\": [ { @@ -358,12 +358,12 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests/src/components/PingPong.bojagi.js\\", - \\"name\\": \\"PingPong.bojagi\\", + \\"name\\": \\"src__components__PingPong.bojagi.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/PingPong.bojagi.js\\", \\"files\\": [ - \\"vendors.js\\", - \\"PingPong.bojagi.js\\" + \\"vendors.3b1f4bb739288813742d.js\\", + \\"src__components__PingPong.bojagi.js.3b1f4bb739288813742d.js\\" ] } ]" From 1f15e8639a37337c447ee1109bd4d604d8ac7b70 Mon Sep 17 00:00:00 2001 From: Simon Jentsch Date: Fri, 28 May 2021 19:22:22 +0200 Subject: [PATCH 2/4] Remove hash again --- packages/cli/src/utils/composeWebpackConfig.spec.ts | 2 +- packages/cli/src/utils/composeWebpackConfig.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/utils/composeWebpackConfig.spec.ts b/packages/cli/src/utils/composeWebpackConfig.spec.ts index 72a5b458..3d79f2f5 100644 --- a/packages/cli/src/utils/composeWebpackConfig.spec.ts +++ b/packages/cli/src/utils/composeWebpackConfig.spec.ts @@ -78,7 +78,7 @@ const testCases = [ }); expect(config.output).toEqual({ path: `${process.cwd()}/bojagi`, - filename: '[name].[hash].js', + filename: '[name].js', publicPath: '__bojagi_public_path__/', globalObject: 'window', }); diff --git a/packages/cli/src/utils/composeWebpackConfig.ts b/packages/cli/src/utils/composeWebpackConfig.ts index 0f57376f..e7c377c1 100644 --- a/packages/cli/src/utils/composeWebpackConfig.ts +++ b/packages/cli/src/utils/composeWebpackConfig.ts @@ -64,7 +64,7 @@ const composeWebpackConfig = ( entry, output: { path: pathUtils.join(process.cwd(), 'bojagi'), - filename: '[name].[hash].js', + filename: '[name].js', publicPath, globalObject: 'window', }, From 9c538e9db35d4a8d4f5ab61f5e46081108ee332d Mon Sep 17 00:00:00 2001 From: Simon Jentsch Date: Fri, 28 May 2021 19:47:25 +0200 Subject: [PATCH 3/4] Questionmark for package busting --- packages/cli/fakeStorybookAddons.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/cli/fakeStorybookAddons.js b/packages/cli/fakeStorybookAddons.js index 1c95f102..1a076274 100644 --- a/packages/cli/fakeStorybookAddons.js +++ b/packages/cli/fakeStorybookAddons.js @@ -1,4 +1,6 @@ -const originalAddons = require('@storybook/addons'); +// Questionmark is here to get around module replacement and load original module +const originalAddons = require('@storybook/addons?'); + const makeDecorator = originalAddons.makeDecorator; const getChannel = () => ({ addListener: () => {}, From 1e633f062ca8e57e1fbee686345c53debe22295f Mon Sep 17 00:00:00 2001 From: Simon Jentsch Date: Fri, 28 May 2021 19:50:24 +0200 Subject: [PATCH 4/4] Fix integration tests --- .../__snapshots__/bundle.integration.ts.snap | 96 +++++++++---------- .../__snapshots__/bundle.integration.ts.snap | 60 ++++++------ .../__snapshots__/bundle.integration.ts.snap | 42 ++++---- .../__snapshots__/bundle.integration.ts.snap | 76 +++++++-------- 4 files changed, 137 insertions(+), 137 deletions(-) diff --git a/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap b/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap index cbb13fa4..4aabad04 100644 --- a/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap +++ b/packages/integration-tests-storybook-6_1_x/test/__snapshots__/bundle.integration.ts.snap @@ -18,79 +18,79 @@ exports[`run bundle command 1`] = ` exports[`run bundle command 2`] = ` "[ { - \\"name\\": \\"vendors.beaf02eae9d72e23ceeb.js\\", + \\"name\\": \\"vendors.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.beaf02eae9d72e23ceeb.js\\" + \\"outputFilePath\\": \\"files/vendors.js\\" }, { - \\"name\\": \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"name\\": \\"runtime~src__Button.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.js\\" }, { - \\"name\\": \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"name\\": \\"runtime~src__Header.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.js\\" }, { - \\"name\\": \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"name\\": \\"runtime~src__Page.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.js\\" }, { - \\"name\\": \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"name\\": \\"src__Button.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Button.stories.js.beaf02eae9d72e23ceeb.js\\" + \\"outputFilePath\\": \\"files/src__Button.stories.js.js\\" }, { - \\"name\\": \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"name\\": \\"src__Header.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Header.stories.js.beaf02eae9d72e23ceeb.js\\" + \\"outputFilePath\\": \\"files/src__Header.stories.js.js\\" }, { - \\"name\\": \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", + \\"name\\": \\"src__Page.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Page.stories.js.beaf02eae9d72e23ceeb.js\\" + \\"outputFilePath\\": \\"files/src__Page.stories.js.js\\" }, { - \\"name\\": \\"vendors.beaf02eae9d72e23ceeb.js.LICENSE.txt\\", + \\"name\\": \\"vendors.js.LICENSE.txt\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.beaf02eae9d72e23ceeb.js.LICENSE.txt\\" + \\"outputFilePath\\": \\"files/vendors.js.LICENSE.txt\\" }, { - \\"name\\": \\"vendors.beaf02eae9d72e23ceeb.js.map\\", + \\"name\\": \\"vendors.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.beaf02eae9d72e23ceeb.js.map\\" + \\"outputFilePath\\": \\"files/vendors.js.map\\" }, { - \\"name\\": \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"name\\": \\"runtime~src__Button.stories.js.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.js.map\\" }, { - \\"name\\": \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"name\\": \\"runtime~src__Header.stories.js.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.js.map\\" }, { - \\"name\\": \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"name\\": \\"runtime~src__Page.stories.js.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.js.map\\" }, { - \\"name\\": \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"name\\": \\"src__Button.stories.js.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"outputFilePath\\": \\"files/src__Button.stories.js.js.map\\" }, { - \\"name\\": \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"name\\": \\"src__Header.stories.js.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"outputFilePath\\": \\"files/src__Header.stories.js.js.map\\" }, { - \\"name\\": \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\", + \\"name\\": \\"src__Page.stories.js.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"outputFilePath\\": \\"files/src__Page.stories.js.js.map\\" }, { \\"name\\": \\"iframe.html\\", @@ -148,12 +148,12 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Button.stories.js\\", \\"files\\": [ - \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", - \\"runtime~src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\", - \\"vendors.beaf02eae9d72e23ceeb.js\\", - \\"vendors.beaf02eae9d72e23ceeb.js.map\\", - \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js\\", - \\"src__Button.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"runtime~src__Button.stories.js.js\\", + \\"runtime~src__Button.stories.js.js.map\\", + \\"vendors.js\\", + \\"vendors.js.map\\", + \\"src__Button.stories.js.js\\", + \\"src__Button.stories.js.js.map\\" ] }, { @@ -184,12 +184,12 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Header.stories.js\\", \\"files\\": [ - \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", - \\"runtime~src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\", - \\"vendors.beaf02eae9d72e23ceeb.js\\", - \\"vendors.beaf02eae9d72e23ceeb.js.map\\", - \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js\\", - \\"src__Header.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"runtime~src__Header.stories.js.js\\", + \\"runtime~src__Header.stories.js.js.map\\", + \\"vendors.js\\", + \\"vendors.js.map\\", + \\"src__Header.stories.js.js\\", + \\"src__Header.stories.js.js.map\\" ] }, { @@ -224,12 +224,12 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Page.stories.js\\", \\"files\\": [ - \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", - \\"runtime~src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\", - \\"vendors.beaf02eae9d72e23ceeb.js\\", - \\"vendors.beaf02eae9d72e23ceeb.js.map\\", - \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js\\", - \\"src__Page.stories.js.beaf02eae9d72e23ceeb.js.map\\" + \\"runtime~src__Page.stories.js.js\\", + \\"runtime~src__Page.stories.js.js.map\\", + \\"vendors.js\\", + \\"vendors.js.map\\", + \\"src__Page.stories.js.js\\", + \\"src__Page.stories.js.js.map\\" ] } ]" diff --git a/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap b/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap index 87899a66..bbc30302 100644 --- a/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap +++ b/packages/integration-tests-storybook-6_2_x/test/__snapshots__/bundle.integration.ts.snap @@ -18,49 +18,49 @@ exports[`run bundle command 1`] = ` exports[`run bundle command 2`] = ` "[ { - \\"name\\": \\"vendors.0b9ade441d1473d9b03f.js\\", + \\"name\\": \\"vendors.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.0b9ade441d1473d9b03f.js\\" + \\"outputFilePath\\": \\"files/vendors.js\\" }, { - \\"name\\": \\"runtime~src__Button.stories.js.0b9ade441d1473d9b03f.js\\", + \\"name\\": \\"runtime~src__Button.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.0b9ade441d1473d9b03f.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.js\\" }, { - \\"name\\": \\"runtime~src__Header.stories.js.0b9ade441d1473d9b03f.js\\", + \\"name\\": \\"runtime~src__Header.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.0b9ade441d1473d9b03f.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.js\\" }, { - \\"name\\": \\"runtime~src__Page.stories.js.0b9ade441d1473d9b03f.js\\", + \\"name\\": \\"runtime~src__Page.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.0b9ade441d1473d9b03f.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.js\\" }, { - \\"name\\": \\"src__Button.stories.js.0b9ade441d1473d9b03f.js\\", + \\"name\\": \\"src__Button.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Button.stories.js.0b9ade441d1473d9b03f.js\\" + \\"outputFilePath\\": \\"files/src__Button.stories.js.js\\" }, { - \\"name\\": \\"src__Header.stories.js.0b9ade441d1473d9b03f.js\\", + \\"name\\": \\"src__Header.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Header.stories.js.0b9ade441d1473d9b03f.js\\" + \\"outputFilePath\\": \\"files/src__Header.stories.js.js\\" }, { - \\"name\\": \\"src__Page.stories.js.0b9ade441d1473d9b03f.js\\", + \\"name\\": \\"src__Page.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__Page.stories.js.0b9ade441d1473d9b03f.js\\" + \\"outputFilePath\\": \\"files/src__Page.stories.js.js\\" }, { - \\"name\\": \\"vendors.0b9ade441d1473d9b03f.js.LICENSE.txt\\", + \\"name\\": \\"vendors.js.LICENSE.txt\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.0b9ade441d1473d9b03f.js.LICENSE.txt\\" + \\"outputFilePath\\": \\"files/vendors.js.LICENSE.txt\\" }, { - \\"name\\": \\"vendors.0b9ade441d1473d9b03f.js.map\\", + \\"name\\": \\"vendors.js.map\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.0b9ade441d1473d9b03f.js.map\\" + \\"outputFilePath\\": \\"files/vendors.js.map\\" }, { \\"name\\": \\"iframe.html\\", @@ -118,10 +118,10 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Button.stories.js\\", \\"files\\": [ - \\"runtime~src__Button.stories.js.0b9ade441d1473d9b03f.js\\", - \\"vendors.0b9ade441d1473d9b03f.js\\", - \\"vendors.0b9ade441d1473d9b03f.js.map\\", - \\"src__Button.stories.js.0b9ade441d1473d9b03f.js\\" + \\"runtime~src__Button.stories.js.js\\", + \\"vendors.js\\", + \\"vendors.js.map\\", + \\"src__Button.stories.js.js\\" ] }, { @@ -152,10 +152,10 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Header.stories.js\\", \\"files\\": [ - \\"runtime~src__Header.stories.js.0b9ade441d1473d9b03f.js\\", - \\"vendors.0b9ade441d1473d9b03f.js\\", - \\"vendors.0b9ade441d1473d9b03f.js.map\\", - \\"src__Header.stories.js.0b9ade441d1473d9b03f.js\\" + \\"runtime~src__Header.stories.js.js\\", + \\"vendors.js\\", + \\"vendors.js.map\\", + \\"src__Header.stories.js.js\\" ] }, { @@ -190,10 +190,10 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Page.stories.js\\", \\"files\\": [ - \\"runtime~src__Page.stories.js.0b9ade441d1473d9b03f.js\\", - \\"vendors.0b9ade441d1473d9b03f.js\\", - \\"vendors.0b9ade441d1473d9b03f.js.map\\", - \\"src__Page.stories.js.0b9ade441d1473d9b03f.js\\" + \\"runtime~src__Page.stories.js.js\\", + \\"vendors.js\\", + \\"vendors.js.map\\", + \\"src__Page.stories.js.js\\" ] } ]" diff --git a/packages/integration-tests-storybook-6_3_x/test/__snapshots__/bundle.integration.ts.snap b/packages/integration-tests-storybook-6_3_x/test/__snapshots__/bundle.integration.ts.snap index 704c9380..5846a98f 100644 --- a/packages/integration-tests-storybook-6_3_x/test/__snapshots__/bundle.integration.ts.snap +++ b/packages/integration-tests-storybook-6_3_x/test/__snapshots__/bundle.integration.ts.snap @@ -23,34 +23,34 @@ exports[`run bundle command 2`] = ` \\"outputFilePath\\": \\"files/vendors.js\\" }, { - \\"name\\": \\"Button.stories.js\\", + \\"name\\": \\"runtime~src__Button.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Button.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Button.stories.js.js\\" }, { - \\"name\\": \\"Header.stories.js\\", + \\"name\\": \\"runtime~src__Header.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Header.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Header.stories.js.js\\" }, { - \\"name\\": \\"Page.stories.js\\", + \\"name\\": \\"runtime~src__Page.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/Page.stories.js\\" + \\"outputFilePath\\": \\"files/runtime~src__Page.stories.js.js\\" }, { - \\"name\\": \\"runtime~Button.stories.js\\", + \\"name\\": \\"src__Button.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Button.stories.js\\" + \\"outputFilePath\\": \\"files/src__Button.stories.js.js\\" }, { - \\"name\\": \\"runtime~Header.stories.js\\", + \\"name\\": \\"src__Header.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Header.stories.js\\" + \\"outputFilePath\\": \\"files/src__Header.stories.js.js\\" }, { - \\"name\\": \\"runtime~Page.stories.js\\", + \\"name\\": \\"src__Page.stories.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/runtime~Page.stories.js\\" + \\"outputFilePath\\": \\"files/src__Page.stories.js.js\\" }, { \\"name\\": \\"vendors.js.LICENSE.txt\\", @@ -114,14 +114,14 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_3_x/src/Button.stories.js\\", - \\"name\\": \\"Button.stories\\", + \\"name\\": \\"src__Button.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Button.stories.js\\", \\"files\\": [ - \\"runtime~Button.stories.js\\", + \\"runtime~src__Button.stories.js.js\\", \\"vendors.js\\", \\"vendors.js.map\\", - \\"Button.stories.js\\" + \\"src__Button.stories.js.js\\" ] }, { @@ -148,14 +148,14 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_3_x/src/Header.stories.js\\", - \\"name\\": \\"Header.stories\\", + \\"name\\": \\"src__Header.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Header.stories.js\\", \\"files\\": [ - \\"runtime~Header.stories.js\\", + \\"runtime~src__Header.stories.js.js\\", \\"vendors.js\\", \\"vendors.js.map\\", - \\"Header.stories.js\\" + \\"src__Header.stories.js.js\\" ] }, { @@ -186,14 +186,14 @@ exports[`run bundle command 3`] = ` } ], \\"gitPath\\": \\"packages/integration-tests-storybook-6_3_x/src/Page.stories.js\\", - \\"name\\": \\"Page.stories\\", + \\"name\\": \\"src__Page.stories.js\\", \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/Page.stories.js\\", \\"files\\": [ - \\"runtime~Page.stories.js\\", + \\"runtime~src__Page.stories.js.js\\", \\"vendors.js\\", \\"vendors.js.map\\", - \\"Page.stories.js\\" + \\"src__Page.stories.js.js\\" ] } ]" diff --git a/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap b/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap index 18767415..f75ecac8 100644 --- a/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap +++ b/packages/integration-tests/test/__snapshots__/bundle.integration.ts.snap @@ -23,9 +23,9 @@ exports[`run bundle command 2`] = ` \\"outputFilePath\\": \\"files/718ad8b72621629b68f4ea8458266766.png\\" }, { - \\"name\\": \\"vendors.3b1f4bb739288813742d.js\\", + \\"name\\": \\"vendors.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/vendors.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/vendors.js\\" }, { \\"name\\": \\"src__App.bojagi.js.css\\", @@ -33,54 +33,54 @@ exports[`run bundle command 2`] = ` \\"outputFilePath\\": \\"files/src__App.bojagi.js.css\\" }, { - \\"name\\": \\"src__App.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__App.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__App.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__App.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__Box.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__Box.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__Box.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__Box.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__BoxWithButtons.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__BoxWithButtons.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__BoxWithButtons.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__BoxWithButtons.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__Button.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__Button.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__Button.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__Button.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__Empty.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__Empty.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__Empty.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__Empty.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__Hooks.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__Hooks.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__Hooks.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__Hooks.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__Lazy.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__Lazy.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__Lazy.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__Lazy.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__Logo.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__Logo.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__Logo.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__Logo.bojagi.js.js\\" }, { - \\"name\\": \\"src__components__PingPong.bojagi.js.3b1f4bb739288813742d.js\\", + \\"name\\": \\"src__components__PingPong.bojagi.js.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/src__components__PingPong.bojagi.js.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/src__components__PingPong.bojagi.js.js\\" }, { - \\"name\\": \\"10.3b1f4bb739288813742d.js\\", + \\"name\\": \\"10.js\\", \\"namespace\\": \\"default\\", - \\"outputFilePath\\": \\"files/10.3b1f4bb739288813742d.js\\" + \\"outputFilePath\\": \\"files/10.js\\" }, { \\"name\\": \\"./index.html\\", @@ -141,9 +141,9 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/App.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", + \\"vendors.js\\", \\"src__App.bojagi.js.css\\", - \\"src__App.bojagi.js.3b1f4bb739288813742d.js\\" + \\"src__App.bojagi.js.js\\" ] }, { @@ -186,8 +186,8 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Box.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", - \\"src__components__Box.bojagi.js.3b1f4bb739288813742d.js\\" + \\"vendors.js\\", + \\"src__components__Box.bojagi.js.js\\" ] }, { @@ -214,8 +214,8 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/BoxWithButtons.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", - \\"src__components__BoxWithButtons.bojagi.js.3b1f4bb739288813742d.js\\" + \\"vendors.js\\", + \\"src__components__BoxWithButtons.bojagi.js.js\\" ] }, { @@ -246,8 +246,8 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Button.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", - \\"src__components__Button.bojagi.js.3b1f4bb739288813742d.js\\" + \\"vendors.js\\", + \\"src__components__Button.bojagi.js.js\\" ] }, { @@ -270,8 +270,8 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Hooks.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", - \\"src__components__Hooks.bojagi.js.3b1f4bb739288813742d.js\\" + \\"vendors.js\\", + \\"src__components__Hooks.bojagi.js.js\\" ] }, { @@ -298,8 +298,8 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Lazy.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", - \\"src__components__Lazy.bojagi.js.3b1f4bb739288813742d.js\\" + \\"vendors.js\\", + \\"src__components__Lazy.bojagi.js.js\\" ] }, { @@ -326,8 +326,8 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/Logo.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", - \\"src__components__Logo.bojagi.js.3b1f4bb739288813742d.js\\" + \\"vendors.js\\", + \\"src__components__Logo.bojagi.js.js\\" ] }, { @@ -362,8 +362,8 @@ exports[`run bundle command 3`] = ` \\"namespace\\": \\"default\\", \\"filePath\\": \\"src/components/PingPong.bojagi.js\\", \\"files\\": [ - \\"vendors.3b1f4bb739288813742d.js\\", - \\"src__components__PingPong.bojagi.js.3b1f4bb739288813742d.js\\" + \\"vendors.js\\", + \\"src__components__PingPong.bojagi.js.js\\" ] } ]"