Skip to content

Commit

Permalink
Merge pull request #4977 from storybooks/ts-migration/channels
Browse files Browse the repository at this point in the history
TypeScript migration: @storybook/channels
  • Loading branch information
kroeder authored Dec 20, 2018
2 parents bc55f27 + a92a3c5 commit eb7071b
Show file tree
Hide file tree
Showing 17 changed files with 413 additions and 379 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ module.exports = {
},
overrides: [
{
files: ['**/__tests__/**', '**/*.test.js/**', '**/*.spec.js/**'],
files: ['**/__tests__/**', '**/*.test.js/**'],
rules: {
'import/no-extraneous-dependencies': ignore,
},
Expand Down
2 changes: 1 addition & 1 deletion examples/angular-cli/.storybook/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": "../src/tsconfig.app.json",
"exclude": ["../src/test.ts", "../src/**/*.spec.ts"],
"exclude": ["../src/karma.ts", "../src/**/*.spec.ts"],
"include": ["../src/**/*"]
}
2 changes: 1 addition & 1 deletion examples/angular-cli/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"main": "src/karma.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
Expand Down
4 changes: 2 additions & 2 deletions examples/angular-cli/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module.exports = {
},
roots: [__dirname],
transform: {
...config.transform,
'^.+\\.jsx?$': '<rootDir>/scripts/babel-jest.js',
'^.+[/\\\\].storybook[/\\\\]config\\.ts$': '<rootDir>/scripts/jest-ts-babel.js',
'^.+\\.(ts|html)$': '<rootDir>/node_modules/jest-preset-angular/preprocessor.js',
},
moduleFileExtensions: [...config.moduleFileExtensions, 'ts', 'tsx', 'html'],
moduleFileExtensions: [...config.moduleFileExtensions, 'html'],
};
File renamed without changes.
2 changes: 1 addition & 1 deletion examples/angular-cli/src/tsconfig.app.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
]
},
"exclude": [
"test.ts",
"karma.ts",
"**/*.spec.ts"
]
}
2 changes: 1 addition & 1 deletion examples/angular-cli/src/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
]
},
"files": [
"test.ts"
"karma.ts"
],
"include": [
"**/*.spec.ts",
Expand Down
10 changes: 6 additions & 4 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ module.exports = {
snapshotSerializers: ['@emotion/snapshot-serializer'],
transform: {
'^.+\\.jsx?$': '<rootDir>/scripts/babel-jest.js',
'^.+\\.tsx?$': '<rootDir>/node_modules/ts-jest',
},
testMatch: ['**/__tests__/**/*.(j|t)s?(x)', '**/?(*.)+(spek|test).(j|t)s?(x)'],
testPathIgnorePatterns: ['/node_modules/', '/dist/', 'addon-jest.test.js', '/cli/test/'],
collectCoverage: false,
collectCoverageFrom: [
'app/**/*.{js,jsx}',
'lib/**/*.{js,jsx}',
'addons/**/*.{js,jsx}',
'app/**/*.{js,jsx,ts,tsx}',
'lib/**/*.{js,jsx,ts,tsx}',
'addons/**/*.{js,jsx,ts,tsx}',
'!**/cli/test/**',
'!**/dist/**',
'!**/generators/**',
Expand All @@ -44,5 +46,5 @@ module.exports = {
setupFiles: ['raf/polyfill'],
testURL: 'http://localhost',
modulePathIgnorePatterns: ['/dist/.*/__mocks__/'],
moduleFileExtensions: ['js', 'jsx', 'json', 'node'],
moduleFileExtensions: ['js', 'jsx', 'ts', 'tsx', 'json', 'node'],
};
2 changes: 1 addition & 1 deletion lib/channels/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"license": "MIT",
"main": "dist/index.js",
"jsnext:main": "src/index.js",
"jsnext:main": "src/index.ts",
"scripts": {
"prepare": "node ../../scripts/prepare.js"
},
Expand Down
110 changes: 0 additions & 110 deletions lib/channels/src/index.js

This file was deleted.

Loading

0 comments on commit eb7071b

Please sign in to comment.