Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Build: use tsc prep-script for addon storyshots #20523

Merged
merged 3 commits into from
Jan 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion code/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ module.exports = {
'**/__testfixtures__/**',
'**/*.test.*',
'**/*.stories.*',
'**/storyshots/**/stories/**',
'**/storyshots-*/**/stories/**',
],
rules: {
'@typescript-eslint/no-empty-function': 'off',
Expand Down
2 changes: 1 addition & 1 deletion code/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ logFilters:
- level: discard
pattern: '@storybook/root@workspace:.'
- level: discard
pattern: '@workspace:addons/storyshots/'
pattern: '@workspace:addons/storyshots-*/'

nodeLinker: node-modules

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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": "node ../../../../scripts/prepare.js",
"prep": "../../../scripts/prepare/tsc.ts",
"storybook": "yarn sb dev -p 6006"
},
"dependencies": {
Expand Down Expand Up @@ -142,6 +143,7 @@
"publishConfig": {
"access": "public"
},
"bundler": {},
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde",
"storybook": {
"displayName": "Storyshots",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import path from 'path';
import { getPreviewFile, getMainFile } from './configure';

// eslint-disable-next-line global-require, jest/no-mocks-import
jest.mock('fs', () => require('../../../../../__mocks__/fs'));
jest.mock('fs', () => require('../../../../__mocks__/fs'));
const setupFiles = (files: Record<string, string>) => {
// eslint-disable-next-line no-underscore-dangle, global-require
require('fs').__setMockFiles(files);
Expand Down
12 changes: 12 additions & 0 deletions code/addons/storyshots-puppeteer/jest.config.js
Original file line number Diff line number Diff line change
@@ -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),
};
Original file line number Diff line number Diff line change
Expand Up @@ -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": "node ../../../../scripts/prepare.js"
"prep": "../../../scripts/prepare/tsc.ts"
},
"dependencies": {
"@axe-core/puppeteer": "^4.2.0",
Expand All @@ -56,5 +57,6 @@
"publishConfig": {
"access": "public"
},
"bundler": {},
"gitHead": "22701aedf564e467511887eb041f32ae0c96bcde"
}
4 changes: 0 additions & 4 deletions code/addons/storyshots/README.md

This file was deleted.

2 changes: 1 addition & 1 deletion code/jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
];
Expand Down
1 change: 0 additions & 1 deletion code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
"workspaces": {
"packages": [
"addons/*",
"addons/storyshots/*",
"examples/*",
"examples-native/*",
"frameworks/*",
Expand Down
4 changes: 2 additions & 2 deletions code/workspace.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
8 changes: 4 additions & 4 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ logFilters:
- level: discard
pattern: '@storybook/root@workspace:.'
- level: discard
pattern: '@workspace:addons/storyshots/'
pattern: '@workspace:addons/storyshots-*'

nodeLinker: node-modules

Expand Down
4 changes: 2 additions & 2 deletions test-storybooks/ember-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions test-storybooks/external-docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -125,4 +125,4 @@
"@storybook/web-components": "portal:../../code/renderers/web-components",
"@storybook/manager": "portal:../../code/ui/manager"
}
}
}
4 changes: 2 additions & 2 deletions test-storybooks/server-kitchen-sink/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions test-storybooks/standalone-preview/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down