-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #160 from storybookjs/future/tsup
let's migrate to TS, and migrate to more modern tooling and output
- Loading branch information
Showing
54 changed files
with
1,577 additions
and
3,063 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,14 @@ | ||
module.exports = { | ||
"parser": "babel-eslint", | ||
"parserOptions": { | ||
"ecmaVersion": 8 | ||
}, | ||
"plugins": [ | ||
"react", | ||
"jasmine" | ||
], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:react/recommended", | ||
"plugin:jasmine/recommended" | ||
], | ||
"env": { | ||
"browser": true, | ||
"node": true, | ||
"es6": true, | ||
"jasmine": true | ||
}, | ||
"rules": { | ||
"react/prop-types": [0], | ||
"react/display-name": [0], | ||
"jasmine/new-line-before-expect": [0], | ||
"react/no-unescaped-entities": [0] | ||
}, | ||
"settings": { | ||
"react": { | ||
"version": "16.8", // React version. "detect" automatically picks the version you have installed. | ||
}, | ||
} | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
plugins: ['@typescript-eslint', 'prettier'], | ||
extends: ['plugin:@typescript-eslint/recommended', 'prettier'], | ||
rules: { | ||
'prettier/prettier': ['error'], | ||
'@typescript-eslint/ban-ts-comment': 'warn', | ||
}, | ||
ignorePatterns: ['dist', 'node_modules'], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"bracketSpacing": true, | ||
"jsxBracketSameLine": true, | ||
"printWidth": 80, | ||
"printWidth": 120, | ||
"singleQuote": true, | ||
"trailingComma": "es5" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,6 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
stories: ['../stories/*.*'], | ||
webpackFinal: (config, {configType}) => { | ||
if (configType !== 'PRODUCTION') { | ||
config.module.rules.push({ | ||
test: /\.(js|jsx)$/, | ||
loaders: ['react-hot-loader'], | ||
include: [path.join(__dirname, 'src')], | ||
}); | ||
} | ||
|
||
return config; | ||
}, | ||
core: { | ||
builder: 'webpack5' | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,8 +30,17 @@ | |
}, | ||
"license": "MIT", | ||
"author": "Xiaoyi Chen <[email protected]> (https://github.com/xyc)", | ||
"main": "dist/cjs/react-inspector.js", | ||
"module": "dist/es/react-inspector.js", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.js", | ||
"import": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts" | ||
}, | ||
"./package.json": "./package.json" | ||
}, | ||
"main": "dist/index.js", | ||
"module": "dist/index.mjs", | ||
"types": "dist/index.d.ts", | ||
"files": [ | ||
"dist/*/", | ||
"README.md", | ||
|
@@ -41,29 +50,19 @@ | |
".d.ts" | ||
], | ||
"scripts": { | ||
"build": "rollup -c", | ||
"build": "tsup", | ||
"build-storybook": "build-storybook", | ||
"chromatic": "chromatic --project-token=17yeg4lpa7q", | ||
"clean": "rimraf dist", | ||
"lint": "eslint src --fix", | ||
"prerelease": "npm run lint && npm run test && npm run clean && npm run build", | ||
"lint": "eslint src stories --fix", | ||
"prerelease": "npm run lint && npm run test && npm run build", | ||
"release": "npm publish . --access public", | ||
"storybook": "start-storybook -p 9001", | ||
"test": "jest src", | ||
"test-updatesnapshot": "jest src --update-snapshot", | ||
"test-watch": "npm run test -- --watch" | ||
}, | ||
"dependencies": { | ||
"@babel/runtime": "^7.0.0", | ||
"is-dom": "^1.0.0", | ||
"prop-types": "^15.0.0" | ||
"test": "jest src" | ||
}, | ||
"devDependencies": { | ||
"@babel/cli": "^7.11.6", | ||
"@babel/core": "^7.11.6", | ||
"@babel/plugin-proposal-class-properties": "^7.10.4", | ||
"@babel/plugin-proposal-do-expressions": "^7.10.4", | ||
"@babel/plugin-proposal-export-default-from": "^7.10.4", | ||
"@babel/plugin-proposal-logical-assignment-operators": "^7.11.0", | ||
"@babel/plugin-proposal-nullish-coalescing-operator": "^7.10.4", | ||
"@babel/plugin-proposal-object-rest-spread": "^7.11.0", | ||
|
@@ -73,33 +72,30 @@ | |
"@babel/plugin-transform-runtime": "^7.11.5", | ||
"@babel/preset-env": "^7.11.5", | ||
"@babel/preset-react": "^7.10.4", | ||
"@babel/preset-typescript": "^7.18.6", | ||
"@babel/register": "^7.11.5", | ||
"@storybook/react": "^6.0.21", | ||
"babel-eslint": "^10.1.0", | ||
"@storybook/builder-webpack5": "^6.5.9", | ||
"@storybook/manager-webpack5": "^6.5.9", | ||
"@storybook/react": "^6.5.9", | ||
"@types/is-dom": "^1.1.0", | ||
"@types/react": "^16", | ||
"@typescript-eslint/eslint-plugin": "^5.30.4", | ||
"@typescript-eslint/parser": "^5.30.4", | ||
"babel-loader": "^8.1.0", | ||
"chromatic": "^5.1.0", | ||
"core-js": "^3.6.5", | ||
"css-loader": "^4.3.0", | ||
"eslint": "^7.8.1", | ||
"eslint-plugin-jasmine": "^4.1.1", | ||
"eslint-plugin-react": "^7.20.6", | ||
"chromatic": "^6.7.0", | ||
"eslint": "^8.19.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.2.1", | ||
"expect": "^26.4.2", | ||
"is-dom": "^1.1.0", | ||
"jest": "^26.4.2", | ||
"prettier": "^2.1.1", | ||
"react": "^16.13.1", | ||
"react-dom": "^16.13.1", | ||
"react-hot-loader": "^4.12.21", | ||
"react-test-renderer": "^16.13.1", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.26.11", | ||
"rollup-plugin-babel": "^4.4.0", | ||
"rollup-plugin-cleanup": "^3.1.1", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
"rollup-plugin-node-resolve": "^5.2.0", | ||
"style-loader": "^1.2.1", | ||
"webpack": "^4.44.1", | ||
"webpack-cli": "^3.3.12", | ||
"webpack-dev-server": "^3.11.0" | ||
"tsup": "^6.1.3", | ||
"typescript": "^4.7.4", | ||
"webpack": "^5" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.8.4 || ^17.0.0 || ^18.0.0" | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.