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

Tech: cleanup babel prepare related code & dependencies #20156

Merged
merged 28 commits into from
Jan 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c558aef
migrate addonstoryshots away from the prepare script and use tsc dire…
ndelangen Dec 8, 2022
04b684b
use tsup to prep ember framework
ndelangen Dec 8, 2022
a99310d
fixes
ndelangen Dec 8, 2022
299cdb0
Merge branch 'tech/tsc-addon-storyshots' into tech/tsup-ember
ndelangen Dec 8, 2022
7a23644
cleanup the babel prepare scripts
ndelangen Dec 8, 2022
804070d
fix babel config for tests
ndelangen Dec 8, 2022
29c30c7
cleanup dependencies
ndelangen Dec 8, 2022
b80af43
more cleanup
ndelangen Dec 8, 2022
30da3a7
cleanup
ndelangen Dec 8, 2022
52a07c8
delete cypress.json
ndelangen Dec 8, 2022
29ba6e1
fix path to ts-node
ndelangen Dec 8, 2022
5970e5b
fix tests by removing regeneratorRuntime
ndelangen Dec 8, 2022
72bf0a9
ran lint commands over codebase to ensure they still work well after …
ndelangen Dec 8, 2022
ad059b0
cleanup
ndelangen Dec 8, 2022
f9c9992
Merge branch 'tech/tsup-cli' into tech/tsc-addon-storyshots
ndelangen Dec 8, 2022
b87727d
Merge branch 'tech/tsc-addon-storyshots' into tech/tsup-ember
ndelangen Dec 8, 2022
d46f5f5
Merge branch 'tech/tsup-ember' into tech/remove-prepare-babel
ndelangen Dec 8, 2022
ac929a3
cleanup
ndelangen Dec 8, 2022
5b5ab4a
cleanup
ndelangen Dec 8, 2022
5ff04b3
Merge branch 'tech/tsup-cli' into tech/tsc-addon-storyshots
ndelangen Dec 20, 2022
3a1babd
Merge branch 'tech/tsc-addon-storyshots' into tech/tsup-ember
ndelangen Dec 20, 2022
c9f282b
Merge branch 'tech/tsup-ember' into tech/remove-prepare-babel
ndelangen Dec 20, 2022
fb531c9
fix
ndelangen Dec 20, 2022
4de1d86
Merge branch 'tech/tsup-cli' into tech/tsc-addon-storyshots
ndelangen Dec 20, 2022
d590401
Merge branch 'tech/tsc-addon-storyshots' into tech/tsup-ember
ndelangen Dec 20, 2022
1156ebe
Merge branch 'tech/tsup-ember' into tech/remove-prepare-babel
ndelangen Dec 20, 2022
a68c268
Merge branch 'norbert/tsc-script-ember' into tech/remove-prepare-babel
ndelangen Jan 6, 2023
c43672e
upgrade lockfiles
ndelangen Jan 6, 2023
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: 0 additions & 2 deletions code/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ scripts/storage
scripts/repros-generator
*.bundle.js
*.js.map
examples/ember-cli/.storybook/preview-head.html
examples/official-storybook/tests/addon-jest.test.js
ember-output
.yarn
!.remarkrc.js
Expand Down
6 changes: 0 additions & 6 deletions code/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,16 @@ dist
coverage/
*.lerna_backup
build
packages/examples/automated-*
/**/LICENSE
docs/public
packs/*.tgz
package-lock.json
.nvmrc
storybook-static
integration/__image_snapshots__/__diff_output__
.jest-test-results.json
lib/*.jar
lib/**/dll
/false
/addons/docs/common/config-*
built-storybooks
cypress/videos
cypress/screenshots
.verdaccio-cache
tsconfig.tsbuildinfo
junit.xml
Expand Down
2 changes: 0 additions & 2 deletions code/.yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ logFilters:
level: discard
- code: YN0076
level: discard
- level: discard
pattern: '@workspace:examples'
- level: discard
pattern: '@storybook/root@workspace:.'
- level: discard
Expand Down
6 changes: 2 additions & 4 deletions code/addons/storyshots-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@
"*.d.ts"
],
"scripts": {
"build-storybook": "sb build",
"example": "jest storyshot.test",
"prep": "../../../scripts/prepare/tsc.ts",
"storybook": "yarn sb dev -p 6006"
"prep": "../../../scripts/prepare/tsc.ts"
},
"dependencies": {
"@jest/transform": "^29.3.1",
Expand Down Expand Up @@ -72,6 +69,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-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-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"]
}
3 changes: 2 additions & 1 deletion code/addons/storyshots-puppeteer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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.20",
Expand Down
23 changes: 23 additions & 0 deletions code/addons/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"]
}
7 changes: 0 additions & 7 deletions code/cypress.json

This file was deleted.

4 changes: 0 additions & 4 deletions code/jest.init.base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ import '@testing-library/jest-dom';
import { configure } from 'enzyme';
// @ts-expect-error (Converted from ts-ignore)
import Adapter from 'enzyme-adapter-react-16';
// @ts-expect-error (Converted from ts-ignore)
import regeneratorRuntime from 'regenerator-runtime';
import registerRequireContextHook from '@storybook/babel-plugin-require-context-hook/register';

registerRequireContextHook();
Expand All @@ -24,8 +22,6 @@ const localStorageMock = {
};
// @ts-expect-error (Converted from ts-ignore)
global.localStorage = localStorageMock;
// @ts-expect-error (Converted from ts-ignore)
global.regeneratorRuntime = regeneratorRuntime;

configure({ adapter: new Adapter() });

Expand Down
2 changes: 1 addition & 1 deletion code/lib/cli/src/generators/ANGULAR/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const generator: Generator = async (packageManager, npmOptions, options) => {
}
*/

// to the user's angular.json file. see: https://github.com/storybookjs/storybook/blob/next/examples/angular-cli/angular.json#L78
// to the user's angular.json file.

// then we want to add these scripts to package.json
// packageManager.addScripts({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import Button from './Button';

export default {
title: 'Some.Button',
decorators: [withKnobs, storyFn => <div className="foo">{storyFn}</div>],
decorators: [withKnobs, (storyFn) => <div className="foo">{storyFn}</div>],
};

export const story1 = () => <Button label="The Button" />;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ import Button from './Button';
// This isn't a valid story, but it tests the `import { comp } from ...` case
storiesOf('Some.Button', module)
.addDecorator(withKnobs)
.addDecorator(storyFn => <div className="foo">{storyFn}</div>)
.addDecorator((storyFn) => <div className="foo">{storyFn}</div>)
.add('with decorator', () => <Button label="The Button" />);
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ export function someHelper() {
}

storiesOf('ComponentItem', module)
.addDecorator(storyFn => <div style={{ margin: '1rem' }}>{storyFn()}</div>)
.addDecorator((storyFn) => <div style={{ margin: '1rem' }}>{storyFn()}</div>)
.add('loading', () => <ComponentItem loading />);
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import Button from './Button';
storiesOf('Some.Button', module)
.add('with story params and decorators', () => <Button label="The Button" />, {
bar: 1,
decorators: [withKnobs, storyFn => <div className="foo">{storyFn}</div>],
decorators: [withKnobs, (storyFn) => <div className="foo">{storyFn}</div>],
})
.add('with story decorators', () => <Button label="The Button" />, {
decorators: [withKnobs],
Expand Down
Loading