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 for addon-storyshots prepare #20153

Closed
wants to merge 6 commits into from
Closed
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
6 changes: 2 additions & 4 deletions code/addons/storyshots/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,7 @@
"*.d.ts"
],
"scripts": {
"build-storybook": "sb build",
"example": "jest storyshot.test",
"prep": "node ../../../../scripts/prepare.js",
"storybook": "yarn sb dev -p 6006"
"prep": "rimraf dist && ../../../../scripts/node_modules/.bin/tsc --project tsconfig.build.json && echo \"Preventing passing flags to tsc\""
},
"dependencies": {
"@jest/transform": "^29.3.1",
Expand Down Expand Up @@ -71,6 +68,7 @@
"jest-preset-angular": "^8.3.2",
"jest-vue-preprocessor": "^1.7.1",
"react-test-renderer": "^16",
"rimraf": "^3.0.2",
"rxjs": "^6.6.3",
"vue-jest": "^5.0.0-alpha.8"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function integrityTest(integrityOptions: any, stories2snapsConverter: any) {
const snapshotExtension = stories2snapsConverter.getSnapshotExtension();
const storyshots = glob.sync(`**/*${snapshotExtension}`, integrityOptions);

// @ts-expect-error (ts doesn't 'get' the extension happening on line 9)
expect(storyshots).notToBeAbandoned(stories2snapsConverter);
});
});
Expand Down
23 changes: 23 additions & 0 deletions code/addons/storyshots/storyshots-core/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "./tsconfig.json",
"compileOnSave": false,
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"lib": ["es2020", "dom"],
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": true,
"outDir": "dist",
"types": ["node"],
"skipLibCheck": true,
"resolveJsonModule": true,
"allowJs": true,
"pretty": true,
"noErrorTruncation": true,
"listEmittedFiles": false,
"noUnusedLocals": false
},
"include": ["src/**/*", "src/**/*.json"]
}
3 changes: 1 addition & 2 deletions code/addons/storyshots/storyshots-core/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
"declaration": true,
"jsx": "preserve",
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"types": ["jest", "testing-library__jest-dom"]
"skipDefaultLibCheck": true
},
"include": ["src/**/*.ts"]
}
5 changes: 3 additions & 2 deletions code/addons/storyshots/storyshots-puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"*.d.ts"
],
"scripts": {
"prep": "node ../../../../scripts/prepare.js"
"prep": "rimraf dist && ../../../../scripts/node_modules/.bin/tsc --project tsconfig.build.json && echo \"Preventing passing flags to tsc\""
},
"dependencies": {
"@axe-core/puppeteer": "^4.2.0",
Expand All @@ -42,7 +42,8 @@
},
"devDependencies": {
"@types/puppeteer": "^5.4.0",
"puppeteer": "^2.0.0 || ^3.0.0"
"puppeteer": "^2.0.0 || ^3.0.0",
"rimraf": "^3.0.2"
},
"peerDependencies": {
"@storybook/addon-storyshots": "7.0.0-beta.19",
Expand Down
23 changes: 23 additions & 0 deletions code/addons/storyshots/storyshots-puppeteer/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"extends": "./tsconfig.json",
"compileOnSave": false,
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"lib": ["es2020", "dom"],
"esModuleInterop": true,
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"declaration": true,
"outDir": "dist",
"types": ["node"],
"skipLibCheck": true,
"resolveJsonModule": true,
"allowJs": true,
"pretty": true,
"noErrorTruncation": true,
"listEmittedFiles": false,
"noUnusedLocals": false
},
"include": ["src/**/*", "src/**/*.json"]
}
2 changes: 2 additions & 0 deletions code/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5675,6 +5675,7 @@ __metadata:
"@types/puppeteer": ^5.4.0
jest-image-snapshot: ^6.0.0
puppeteer: ^2.0.0 || ^3.0.0
rimraf: ^3.0.2
peerDependencies:
"@storybook/addon-storyshots": 7.0.0-beta.19
puppeteer: ">=2.0.0"
Expand Down Expand Up @@ -5718,6 +5719,7 @@ __metadata:
pretty-format: ^29.0.0
react-test-renderer: ^16
read-pkg-up: ^7.0.1
rimraf: ^3.0.2
rxjs: ^6.6.3
ts-dedent: ^2.0.0
vue-jest: ^5.0.0-alpha.8
Expand Down