diff --git a/code/.eslintrc.js b/code/.eslintrc.js index 7679e9a71017..9ce44395500f 100644 --- a/code/.eslintrc.js +++ b/code/.eslintrc.js @@ -90,7 +90,7 @@ module.exports = { '**/__testfixtures__/**', '**/*.test.*', '**/*.stories.*', - '**/storyshots/**/stories/**', + '**/storyshots-*/**/stories/**', ], rules: { '@typescript-eslint/no-empty-function': 'off', diff --git a/code/.yarnrc.yml b/code/.yarnrc.yml index db9534270d48..2859a63fa779 100644 --- a/code/.yarnrc.yml +++ b/code/.yarnrc.yml @@ -12,7 +12,7 @@ logFilters: - level: discard pattern: '@storybook/root@workspace:.' - level: discard - pattern: '@workspace:addons/storyshots/' + pattern: '@workspace:addons/storyshots-*/' nodeLinker: node-modules diff --git a/code/addons/storyshots/storyshots-core/.eslintrc.js b/code/addons/storyshots-core/.eslintrc.js similarity index 100% rename from code/addons/storyshots/storyshots-core/.eslintrc.js rename to code/addons/storyshots-core/.eslintrc.js diff --git a/code/addons/storyshots/storyshots-core/README.md b/code/addons/storyshots-core/README.md similarity index 100% rename from code/addons/storyshots/storyshots-core/README.md rename to code/addons/storyshots-core/README.md diff --git a/code/addons/storyshots/storyshots-core/docs/storyshots-fail.png b/code/addons/storyshots-core/docs/storyshots-fail.png similarity index 100% rename from code/addons/storyshots/storyshots-core/docs/storyshots-fail.png rename to code/addons/storyshots-core/docs/storyshots-fail.png diff --git a/code/addons/storyshots/storyshots-core/docs/storyshots.png b/code/addons/storyshots-core/docs/storyshots.png similarity index 100% rename from code/addons/storyshots/storyshots-core/docs/storyshots.png rename to code/addons/storyshots-core/docs/storyshots.png diff --git a/code/addons/storyshots/storyshots-core/injectFileName.js b/code/addons/storyshots-core/injectFileName.js similarity index 100% rename from code/addons/storyshots/storyshots-core/injectFileName.js rename to code/addons/storyshots-core/injectFileName.js diff --git a/code/addons/storyshots/jest.config.js b/code/addons/storyshots-core/jest.config.js similarity index 100% rename from code/addons/storyshots/jest.config.js rename to code/addons/storyshots-core/jest.config.js diff --git a/code/addons/storyshots/storyshots-core/package.json b/code/addons/storyshots-core/package.json similarity index 93% rename from code/addons/storyshots/storyshots-core/package.json rename to code/addons/storyshots-core/package.json index b9e671031902..6e4cde038bc3 100644 --- a/code/addons/storyshots/storyshots-core/package.json +++ b/code/addons/storyshots-core/package.json @@ -7,33 +7,34 @@ "storybook", "test" ], - "homepage": "https://github.com/storybookjs/storybook/tree/main/addons/storyshots/storyshots-core", + "homepage": "https://github.com/storybookjs/storybook/tree/main/addons/storyshots-core", "bugs": { "url": "https://github.com/storybookjs/storybook/issues" }, "repository": { "type": "git", "url": "https://github.com/storybookjs/storybook.git", - "directory": "addons/storyshots/storyshots-core" + "directory": "addons/storyshots-core" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/storybook" }, "license": "MIT", - "main": "dist/types/index.js", - "module": "dist/types/index.js", - "types": "dist/types/index.d.ts", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "README.md", "*.js", + "*.mjs", "*.d.ts" ], "scripts": { "build-storybook": "sb build", "example": "jest storyshot.test", - "prep": "../../../../scripts/prepare/tsc.ts", + "prep": "../../../scripts/prepare/tsc.ts", "storybook": "yarn sb dev -p 6006" }, "dependencies": { @@ -142,6 +143,7 @@ "publishConfig": { "access": "public" }, + "bundler": {}, "gitHead": "22701aedf564e467511887eb041f32ae0c96bcde", "storybook": { "displayName": "Storyshots", diff --git a/code/addons/storyshots/storyshots-core/preset.js b/code/addons/storyshots-core/preset.js similarity index 100% rename from code/addons/storyshots/storyshots-core/preset.js rename to code/addons/storyshots-core/preset.js diff --git a/code/addons/storyshots/storyshots-core/src/Stories2SnapsConverter.test.ts b/code/addons/storyshots-core/src/Stories2SnapsConverter.test.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/Stories2SnapsConverter.test.ts rename to code/addons/storyshots-core/src/Stories2SnapsConverter.test.ts diff --git a/code/addons/storyshots/storyshots-core/src/Stories2SnapsConverter.ts b/code/addons/storyshots-core/src/Stories2SnapsConverter.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/Stories2SnapsConverter.ts rename to code/addons/storyshots-core/src/Stories2SnapsConverter.ts diff --git a/code/addons/storyshots/storyshots-core/src/api/StoryshotsOptions.ts b/code/addons/storyshots-core/src/api/StoryshotsOptions.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/api/StoryshotsOptions.ts rename to code/addons/storyshots-core/src/api/StoryshotsOptions.ts diff --git a/code/addons/storyshots/storyshots-core/src/api/ensureOptionsDefaults.ts b/code/addons/storyshots-core/src/api/ensureOptionsDefaults.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/api/ensureOptionsDefaults.ts rename to code/addons/storyshots-core/src/api/ensureOptionsDefaults.ts diff --git a/code/addons/storyshots/storyshots-core/src/api/index.ts b/code/addons/storyshots-core/src/api/index.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/api/index.ts rename to code/addons/storyshots-core/src/api/index.ts diff --git a/code/addons/storyshots/storyshots-core/src/api/integrityTestTemplate.ts b/code/addons/storyshots-core/src/api/integrityTestTemplate.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/api/integrityTestTemplate.ts rename to code/addons/storyshots-core/src/api/integrityTestTemplate.ts diff --git a/code/addons/storyshots/storyshots-core/src/api/snapshotsTestsTemplate.ts b/code/addons/storyshots-core/src/api/snapshotsTestsTemplate.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/api/snapshotsTestsTemplate.ts rename to code/addons/storyshots-core/src/api/snapshotsTestsTemplate.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/Loader.ts b/code/addons/storyshots-core/src/frameworks/Loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/Loader.ts rename to code/addons/storyshots-core/src/frameworks/Loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/SupportedFramework.ts b/code/addons/storyshots-core/src/frameworks/SupportedFramework.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/SupportedFramework.ts rename to code/addons/storyshots-core/src/frameworks/SupportedFramework.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/angular/loader.ts b/code/addons/storyshots-core/src/frameworks/angular/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/angular/loader.ts rename to code/addons/storyshots-core/src/frameworks/angular/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/angular/renderTree.ts b/code/addons/storyshots-core/src/frameworks/angular/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/angular/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/angular/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/angular/types.ts b/code/addons/storyshots-core/src/frameworks/angular/types.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/angular/types.ts rename to code/addons/storyshots-core/src/frameworks/angular/types.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/configure.test.ts b/code/addons/storyshots-core/src/frameworks/configure.test.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/configure.test.ts rename to code/addons/storyshots-core/src/frameworks/configure.test.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/configure.ts b/code/addons/storyshots-core/src/frameworks/configure.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/configure.ts rename to code/addons/storyshots-core/src/frameworks/configure.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.ts b/code/addons/storyshots-core/src/frameworks/frameworkLoader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/frameworkLoader.ts rename to code/addons/storyshots-core/src/frameworks/frameworkLoader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/hasDependency.ts b/code/addons/storyshots-core/src/frameworks/hasDependency.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/hasDependency.ts rename to code/addons/storyshots-core/src/frameworks/hasDependency.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/html/loader.ts b/code/addons/storyshots-core/src/frameworks/html/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/html/loader.ts rename to code/addons/storyshots-core/src/frameworks/html/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/html/renderTree.ts b/code/addons/storyshots-core/src/frameworks/html/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/html/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/html/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/index.ts b/code/addons/storyshots-core/src/frameworks/index.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/index.ts rename to code/addons/storyshots-core/src/frameworks/index.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/preact/loader.ts b/code/addons/storyshots-core/src/frameworks/preact/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/preact/loader.ts rename to code/addons/storyshots-core/src/frameworks/preact/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/preact/renderTree.ts b/code/addons/storyshots-core/src/frameworks/preact/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/preact/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/preact/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/rax/loader.ts b/code/addons/storyshots-core/src/frameworks/rax/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/rax/loader.ts rename to code/addons/storyshots-core/src/frameworks/rax/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/rax/renderTree.ts b/code/addons/storyshots-core/src/frameworks/rax/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/rax/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/rax/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/react-native/loader.ts b/code/addons/storyshots-core/src/frameworks/react-native/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/react-native/loader.ts rename to code/addons/storyshots-core/src/frameworks/react-native/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/react/loader.ts b/code/addons/storyshots-core/src/frameworks/react/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/react/loader.ts rename to code/addons/storyshots-core/src/frameworks/react/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/react/renderShallowTree.ts b/code/addons/storyshots-core/src/frameworks/react/renderShallowTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/react/renderShallowTree.ts rename to code/addons/storyshots-core/src/frameworks/react/renderShallowTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/react/renderTree.ts b/code/addons/storyshots-core/src/frameworks/react/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/react/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/react/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/riot/loader.ts b/code/addons/storyshots-core/src/frameworks/riot/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/riot/loader.ts rename to code/addons/storyshots-core/src/frameworks/riot/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/riot/renderTree.ts b/code/addons/storyshots-core/src/frameworks/riot/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/riot/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/riot/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/svelte/loader.ts b/code/addons/storyshots-core/src/frameworks/svelte/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/svelte/loader.ts rename to code/addons/storyshots-core/src/frameworks/svelte/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/svelte/renderTree.ts b/code/addons/storyshots-core/src/frameworks/svelte/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/svelte/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/svelte/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/vue/loader.ts b/code/addons/storyshots-core/src/frameworks/vue/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/vue/loader.ts rename to code/addons/storyshots-core/src/frameworks/vue/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/vue/renderTree.ts b/code/addons/storyshots-core/src/frameworks/vue/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/vue/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/vue/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/vue3/loader.ts b/code/addons/storyshots-core/src/frameworks/vue3/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/vue3/loader.ts rename to code/addons/storyshots-core/src/frameworks/vue3/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/vue3/renderTree.ts b/code/addons/storyshots-core/src/frameworks/vue3/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/vue3/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/vue3/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/web-components/loader.ts b/code/addons/storyshots-core/src/frameworks/web-components/loader.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/web-components/loader.ts rename to code/addons/storyshots-core/src/frameworks/web-components/loader.ts diff --git a/code/addons/storyshots/storyshots-core/src/frameworks/web-components/renderTree.ts b/code/addons/storyshots-core/src/frameworks/web-components/renderTree.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/frameworks/web-components/renderTree.ts rename to code/addons/storyshots-core/src/frameworks/web-components/renderTree.ts diff --git a/code/addons/storyshots/storyshots-core/src/index.ts b/code/addons/storyshots-core/src/index.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/index.ts rename to code/addons/storyshots-core/src/index.ts diff --git a/code/addons/storyshots/storyshots-core/src/test-bodies.ts b/code/addons/storyshots-core/src/test-bodies.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/test-bodies.ts rename to code/addons/storyshots-core/src/test-bodies.ts diff --git a/code/addons/storyshots/storyshots-core/src/typings.d.ts b/code/addons/storyshots-core/src/typings.d.ts similarity index 100% rename from code/addons/storyshots/storyshots-core/src/typings.d.ts rename to code/addons/storyshots-core/src/typings.d.ts diff --git a/code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap b/code/addons/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap rename to code/addons/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap diff --git a/code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.metadata.test.js.snap b/code/addons/storyshots-core/stories/__snapshots__/storyshot.metadata.test.js.snap similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.metadata.test.js.snap rename to code/addons/storyshots-core/stories/__snapshots__/storyshot.metadata.test.js.snap diff --git a/code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.shallow.test.js.snap b/code/addons/storyshots-core/stories/__snapshots__/storyshot.shallow.test.js.snap similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.shallow.test.js.snap rename to code/addons/storyshots-core/stories/__snapshots__/storyshot.shallow.test.js.snap diff --git a/code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.shallowWithOptions.test.js.snap b/code/addons/storyshots-core/stories/__snapshots__/storyshot.shallowWithOptions.test.js.snap similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.shallowWithOptions.test.js.snap rename to code/addons/storyshots-core/stories/__snapshots__/storyshot.shallowWithOptions.test.js.snap diff --git a/code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.snapshotWithOptionsFunction.test.js.snap b/code/addons/storyshots-core/stories/__snapshots__/storyshot.snapshotWithOptionsFunction.test.js.snap similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.snapshotWithOptionsFunction.test.js.snap rename to code/addons/storyshots-core/stories/__snapshots__/storyshot.snapshotWithOptionsFunction.test.js.snap diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/Async.stories.jsx b/code/addons/storyshots-core/stories/exported_metadata/Async.stories.jsx similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/Async.stories.jsx rename to code/addons/storyshots-core/stories/exported_metadata/Async.stories.jsx diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/Extra.stories.jsx b/code/addons/storyshots-core/stories/exported_metadata/Extra.stories.jsx similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/Extra.stories.jsx rename to code/addons/storyshots-core/stories/exported_metadata/Extra.stories.jsx diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/Text.stories.jsx b/code/addons/storyshots-core/stories/exported_metadata/Text.stories.jsx similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/Text.stories.jsx rename to code/addons/storyshots-core/stories/exported_metadata/Text.stories.jsx diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories.storyshot b/code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories.storyshot similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories.storyshot rename to code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories.storyshot diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-some-_-emoji.boo b/code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-some-_-emoji.boo similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-some-_-emoji.boo rename to code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-some-_-emoji.boo diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-text.boo b/code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-text.boo similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-text.boo rename to code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Extra.stories@Another-_-Button@with-_-text.boo diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Text.stories.storyshot b/code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Text.stories.storyshot similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/__snapshots__/Text.stories.storyshot rename to code/addons/storyshots-core/stories/exported_metadata/__snapshots__/Text.stories.storyshot diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/main.js b/code/addons/storyshots-core/stories/exported_metadata/main.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/main.js rename to code/addons/storyshots-core/stories/exported_metadata/main.js diff --git a/code/addons/storyshots/storyshots-core/stories/exported_metadata/preview.jsx b/code/addons/storyshots-core/stories/exported_metadata/preview.jsx similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/exported_metadata/preview.jsx rename to code/addons/storyshots-core/stories/exported_metadata/preview.jsx diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.async.test.js b/code/addons/storyshots-core/stories/storyshot.async.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.async.test.js rename to code/addons/storyshots-core/stories/storyshot.async.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.configFunc.test.js b/code/addons/storyshots-core/stories/storyshot.configFunc.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.configFunc.test.js rename to code/addons/storyshots-core/stories/storyshot.configFunc.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.enzyme.test.js b/code/addons/storyshots-core/stories/storyshot.enzyme.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.enzyme.test.js rename to code/addons/storyshots-core/stories/storyshot.enzyme.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.metadata.test.js b/code/addons/storyshots-core/stories/storyshot.metadata.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.metadata.test.js rename to code/addons/storyshots-core/stories/storyshot.metadata.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.renderOnly.test.js b/code/addons/storyshots-core/stories/storyshot.renderOnly.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.renderOnly.test.js rename to code/addons/storyshots-core/stories/storyshot.renderOnly.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.renderWithOptions.test.js b/code/addons/storyshots-core/stories/storyshot.renderWithOptions.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.renderWithOptions.test.js rename to code/addons/storyshots-core/stories/storyshot.renderWithOptions.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.shallow.test.js b/code/addons/storyshots-core/stories/storyshot.shallow.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.shallow.test.js rename to code/addons/storyshots-core/stories/storyshot.shallow.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.shallowWithOptions.test.js b/code/addons/storyshots-core/stories/storyshot.shallowWithOptions.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.shallowWithOptions.test.js rename to code/addons/storyshots-core/stories/storyshot.shallowWithOptions.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.snapshotWithOptionsFunction.test.js b/code/addons/storyshots-core/stories/storyshot.snapshotWithOptionsFunction.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.snapshotWithOptionsFunction.test.js rename to code/addons/storyshots-core/stories/storyshot.snapshotWithOptionsFunction.test.js diff --git a/code/addons/storyshots/storyshots-core/stories/storyshot.test.js b/code/addons/storyshots-core/stories/storyshot.test.js similarity index 100% rename from code/addons/storyshots/storyshots-core/stories/storyshot.test.js rename to code/addons/storyshots-core/stories/storyshot.test.js diff --git a/code/addons/storyshots/storyshots-core/tsconfig.json b/code/addons/storyshots-core/tsconfig.json similarity index 100% rename from code/addons/storyshots/storyshots-core/tsconfig.json rename to code/addons/storyshots-core/tsconfig.json diff --git a/code/addons/storyshots/storyshots-puppeteer/.eslintrc.js b/code/addons/storyshots-puppeteer/.eslintrc.js similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/.eslintrc.js rename to code/addons/storyshots-puppeteer/.eslintrc.js diff --git a/code/addons/storyshots/storyshots-puppeteer/README.md b/code/addons/storyshots-puppeteer/README.md similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/README.md rename to code/addons/storyshots-puppeteer/README.md diff --git a/code/addons/storyshots-puppeteer/jest.config.js b/code/addons/storyshots-puppeteer/jest.config.js new file mode 100644 index 000000000000..0115c67e5629 --- /dev/null +++ b/code/addons/storyshots-puppeteer/jest.config.js @@ -0,0 +1,12 @@ +const path = require('path'); +const baseConfig = require('../../jest.config.browser'); + +module.exports = { + ...baseConfig, + snapshotSerializers: [...baseConfig.snapshotSerializers, 'enzyme-to-json/serializer'], + transform: { + ...baseConfig.transform, + '^.+\\.stories\\.[jt]sx?$': '@storybook/addon-storyshots/injectFileName', + }, + displayName: __dirname.split(path.sep).slice(-2).join(path.posix.sep), +}; diff --git a/code/addons/storyshots/storyshots-puppeteer/package.json b/code/addons/storyshots-puppeteer/package.json similarity index 83% rename from code/addons/storyshots/storyshots-puppeteer/package.json rename to code/addons/storyshots-puppeteer/package.json index f9a30b828c6b..f91eaae807c3 100644 --- a/code/addons/storyshots/storyshots-puppeteer/package.json +++ b/code/addons/storyshots-puppeteer/package.json @@ -6,31 +6,32 @@ "addon", "storybook" ], - "homepage": "https://github.com/storybookjs/storybook/tree/main/addons/storyshots/storyshots-puppeteer", + "homepage": "https://github.com/storybookjs/storybook/tree/main/addons/storyshots-puppeteer", "bugs": { "url": "https://github.com/storybookjs/storybook/issues" }, "repository": { "type": "git", "url": "https://github.com/storybookjs/storybook.git", - "directory": "addons/storyshots/storyshots-puppeteer" + "directory": "addons/storyshots-puppeteer" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/storybook" }, "license": "MIT", - "main": "dist/types/index.js", - "module": "dist/types/index.js", - "types": "dist/types/index.d.ts", + "main": "dist/index.js", + "module": "dist/index.mjs", + "types": "dist/index.d.ts", "files": [ "dist/**/*", "README.md", "*.js", + "*.mjs", "*.d.ts" ], "scripts": { - "prep": "../../../../scripts/prepare/tsc.ts" + "prep": "../../../scripts/prepare/tsc.ts" }, "dependencies": { "@axe-core/puppeteer": "^4.2.0", @@ -56,5 +57,6 @@ "publishConfig": { "access": "public" }, + "bundler": {}, "gitHead": "22701aedf564e467511887eb041f32ae0c96bcde" } diff --git a/code/addons/storyshots/storyshots-puppeteer/preset.js b/code/addons/storyshots-puppeteer/preset.js similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/preset.js rename to code/addons/storyshots-puppeteer/preset.js diff --git a/code/addons/storyshots/storyshots-puppeteer/src/__tests__/url.test.ts b/code/addons/storyshots-puppeteer/src/__tests__/url.test.ts similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/src/__tests__/url.test.ts rename to code/addons/storyshots-puppeteer/src/__tests__/url.test.ts diff --git a/code/addons/storyshots/storyshots-puppeteer/src/axeTest.ts b/code/addons/storyshots-puppeteer/src/axeTest.ts similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/src/axeTest.ts rename to code/addons/storyshots-puppeteer/src/axeTest.ts diff --git a/code/addons/storyshots/storyshots-puppeteer/src/config.ts b/code/addons/storyshots-puppeteer/src/config.ts similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/src/config.ts rename to code/addons/storyshots-puppeteer/src/config.ts diff --git a/code/addons/storyshots/storyshots-puppeteer/src/imageSnapshot.ts b/code/addons/storyshots-puppeteer/src/imageSnapshot.ts similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/src/imageSnapshot.ts rename to code/addons/storyshots-puppeteer/src/imageSnapshot.ts diff --git a/code/addons/storyshots/storyshots-puppeteer/src/index.ts b/code/addons/storyshots-puppeteer/src/index.ts similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/src/index.ts rename to code/addons/storyshots-puppeteer/src/index.ts diff --git a/code/addons/storyshots/storyshots-puppeteer/src/puppeteerTest.ts b/code/addons/storyshots-puppeteer/src/puppeteerTest.ts similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/src/puppeteerTest.ts rename to code/addons/storyshots-puppeteer/src/puppeteerTest.ts diff --git a/code/addons/storyshots/storyshots-puppeteer/src/url.ts b/code/addons/storyshots-puppeteer/src/url.ts similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/src/url.ts rename to code/addons/storyshots-puppeteer/src/url.ts diff --git a/code/addons/storyshots/storyshots-puppeteer/tsconfig.json b/code/addons/storyshots-puppeteer/tsconfig.json similarity index 100% rename from code/addons/storyshots/storyshots-puppeteer/tsconfig.json rename to code/addons/storyshots-puppeteer/tsconfig.json diff --git a/code/addons/storyshots/README.md b/code/addons/storyshots/README.md deleted file mode 100644 index 474bf391921a..000000000000 --- a/code/addons/storyshots/README.md +++ /dev/null @@ -1,4 +0,0 @@ -# StoryShots - -- [addon-storyshots](storyshots-core) - Basic StoryShots api -- [addon-storyshots-puppeteer](storyshots-puppeteer) - Integration of StoryShots with [puppeteer](https://github.com/GoogleChrome/puppeteer) diff --git a/code/jest.config.base.js b/code/jest.config.base.js index 5c0d0c19ea1e..d268f949c710 100644 --- a/code/jest.config.base.js +++ b/code/jest.config.base.js @@ -10,7 +10,7 @@ const path = require('path'); const skipOnWindows = [ 'lib/core-server/src/utils/__tests__/server-statics.test.ts', 'lib/core-common/src/utils/__tests__/template.test.ts', - 'addons/storyshots/storyshots-core/src/frameworks/configure.test.ts', + 'addons/storyshots-core/src/frameworks/configure.test.ts', 'lib/core-common/src/utils/__tests__/interpret-files.test.ts', 'lib/cli/src/helpers.test.ts', ]; diff --git a/code/package.json b/code/package.json index 0dbca6996f9e..d5375b221ed2 100644 --- a/code/package.json +++ b/code/package.json @@ -40,7 +40,6 @@ "workspaces": { "packages": [ "addons/*", - "addons/storyshots/*", "examples/*", "examples-native/*", "frameworks/*", diff --git a/code/workspace.json b/code/workspace.json index 8b5173e38003..e7ec9fd17139 100644 --- a/code/workspace.json +++ b/code/workspace.json @@ -63,12 +63,12 @@ }, "@storybook/addon-storyshots": { "implicitDependencies": [], - "root": "addons/storyshots/storyshots-core", + "root": "addons/storyshots-core", "type": "library" }, "@storybook/addon-storyshots-puppeteer": { "implicitDependencies": [], - "root": "addons/storyshots/storyshots-puppeteer", + "root": "addons/storyshots-puppeteer", "type": "library" }, "@storybook/addon-storysource": { diff --git a/code/yarn.lock b/code/yarn.lock index 559691930f27..20594af5db54 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -5663,9 +5663,9 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-storyshots-puppeteer@workspace:*, @storybook/addon-storyshots-puppeteer@workspace:addons/storyshots/storyshots-puppeteer": +"@storybook/addon-storyshots-puppeteer@workspace:*, @storybook/addon-storyshots-puppeteer@workspace:addons/storyshots-puppeteer": version: 0.0.0-use.local - resolution: "@storybook/addon-storyshots-puppeteer@workspace:addons/storyshots/storyshots-puppeteer" + resolution: "@storybook/addon-storyshots-puppeteer@workspace:addons/storyshots-puppeteer" dependencies: "@axe-core/puppeteer": ^4.2.0 "@storybook/csf": next @@ -5684,9 +5684,9 @@ __metadata: languageName: unknown linkType: soft -"@storybook/addon-storyshots@workspace:*, @storybook/addon-storyshots@workspace:addons/storyshots/storyshots-core": +"@storybook/addon-storyshots@workspace:*, @storybook/addon-storyshots@workspace:addons/storyshots-core": version: 0.0.0-use.local - resolution: "@storybook/addon-storyshots@workspace:addons/storyshots/storyshots-core" + resolution: "@storybook/addon-storyshots@workspace:addons/storyshots-core" dependencies: "@angular/core": ^13.3.6 "@angular/platform-browser-dynamic": ^13.3.6 diff --git a/scripts/.yarnrc.yml b/scripts/.yarnrc.yml index 65319e862331..79f240f0c93b 100644 --- a/scripts/.yarnrc.yml +++ b/scripts/.yarnrc.yml @@ -12,7 +12,7 @@ logFilters: - level: discard pattern: '@storybook/root@workspace:.' - level: discard - pattern: '@workspace:addons/storyshots/' + pattern: '@workspace:addons/storyshots-*' nodeLinker: node-modules diff --git a/test-storybooks/ember-cli/package.json b/test-storybooks/ember-cli/package.json index d99c446a7739..151ea8536cb9 100644 --- a/test-storybooks/ember-cli/package.json +++ b/test-storybooks/ember-cli/package.json @@ -76,8 +76,8 @@ "@storybook/addon-links": "portal:../../code/addons/links", "@storybook/addon-measure": "portal:../../code/addons/measure", "@storybook/addon-outline": "portal:../../code/addons/outline", - "@storybook/addon-storyshots": "portal:../../code/addons/storyshots/storyshots-core", - "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots/storyshots-puppeteer", + "@storybook/addon-storyshots": "portal:../../code/addons/storyshots-core", + "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots-puppeteer", "@storybook/addon-storysource": "portal:../../code/addons/storysource", "@storybook/addon-toolbars": "portal:../../code/addons/toolbars", "@storybook/addon-viewport": "portal:../../code/addons/viewport", diff --git a/test-storybooks/external-docs/package.json b/test-storybooks/external-docs/package.json index 4bfae0607e52..efee5b12bf0d 100644 --- a/test-storybooks/external-docs/package.json +++ b/test-storybooks/external-docs/package.json @@ -54,8 +54,8 @@ "@storybook/addon-links": "portal:../../code/addons/links", "@storybook/addon-measure": "portal:../../code/addons/measure", "@storybook/addon-outline": "portal:../../code/addons/outline", - "@storybook/addon-storyshots": "portal:../../code/addons/storyshots/storyshots-core", - "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots/storyshots-puppeteer", + "@storybook/addon-storyshots": "portal:../../code/addons/storyshots-core", + "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots-puppeteer", "@storybook/addon-storysource": "portal:../../code/addons/storysource", "@storybook/addon-toolbars": "portal:../../code/addons/toolbars", "@storybook/addon-viewport": "portal:../../code/addons/viewport", @@ -125,4 +125,4 @@ "@storybook/web-components": "portal:../../code/renderers/web-components", "@storybook/manager": "portal:../../code/ui/manager" } -} +} \ No newline at end of file diff --git a/test-storybooks/server-kitchen-sink/package.json b/test-storybooks/server-kitchen-sink/package.json index 3df952a34736..aa4bc2a005be 100644 --- a/test-storybooks/server-kitchen-sink/package.json +++ b/test-storybooks/server-kitchen-sink/package.json @@ -45,8 +45,8 @@ "@storybook/addon-links": "portal:../../code/addons/links", "@storybook/addon-measure": "portal:../../code/addons/measure", "@storybook/addon-outline": "portal:../../code/addons/outline", - "@storybook/addon-storyshots": "portal:../../code/addons/storyshots/storyshots-core", - "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots/storyshots-puppeteer", + "@storybook/addon-storyshots": "portal:../../code/addons/storyshots-core", + "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots-puppeteer", "@storybook/addon-storysource": "portal:../../code/addons/storysource", "@storybook/addon-toolbars": "portal:../../code/addons/toolbars", "@storybook/addon-viewport": "portal:../../code/addons/viewport", diff --git a/test-storybooks/standalone-preview/package.json b/test-storybooks/standalone-preview/package.json index 06005847fab4..1727d6cf6260 100644 --- a/test-storybooks/standalone-preview/package.json +++ b/test-storybooks/standalone-preview/package.json @@ -30,8 +30,8 @@ "@storybook/addon-links": "portal:../../code/addons/links", "@storybook/addon-measure": "portal:../../code/addons/measure", "@storybook/addon-outline": "portal:../../code/addons/outline", - "@storybook/addon-storyshots": "portal:../../code/addons/storyshots/storyshots-core", - "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots/storyshots-puppeteer", + "@storybook/addon-storyshots": "portal:../../code/addons/storyshots-core", + "@storybook/addon-storyshots-puppeteer": "portal:../../code/addons/storyshots-puppeteer", "@storybook/addon-storysource": "portal:../../code/addons/storysource", "@storybook/addon-toolbars": "portal:../../code/addons/toolbars", "@storybook/addon-viewport": "portal:../../code/addons/viewport",