Skip to content

Commit

Permalink
chore: 所有包的 build, lint, test 都通过根目录统一管理
Browse files Browse the repository at this point in the history
1. 删除不必要的包
2. 所有的包都不再拥有自己的 devDep
3. build, lint, test 全部通过根目录的依赖统一完成

chore: 使用 eslint 格式化所有代码

chore: 使用 eslint 格式化所有代码

chore: 使用根目录 tsconfig.json 控制 ts 代码

chore: 所有包的 build, lint, test 都通过根目录统一管理
  • Loading branch information
yuche authored and luckyadam committed Nov 19, 2019
1 parent 6e8490e commit 2565563
Show file tree
Hide file tree
Showing 623 changed files with 43,518 additions and 138,111 deletions.
5 changes: 4 additions & 1 deletion .eslintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
dist
__tests__
lib
node_modules
*.d.ts
coverage/
69 changes: 45 additions & 24 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,30 +1,51 @@
module.exports = {
extends: ['standard', 'standard-jsx'],
env: {
browser: true,
node: true,
es6: true,
jest: true
'parser': '@typescript-eslint/parser',
'plugins': ['@typescript-eslint', 'jest', 'react'],
'extends': [
'standard',
'plugin:@typescript-eslint/recommended'
],
'rules': {
'no-unused-vars': 'off',
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/indent': ['error', 2],
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-use-before-define': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/interface-name-prefix': 0,
'@typescript-eslint/member-delimiter-style': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/no-namespace': 0,
'standard/no-callback-literal': 0,
'no-console': ['error', { allow: ['warn', 'error'] }],
'prefer-spread': 0,
'prefer-rest-params': 0,
'no-prototype-builtins': 0,
'react/jsx-uses-vars': 'warn',
'camelcase': ['error', {allow: ['^internal_', '^unstable_']}]
},
globals: {
wx: true,
my: true,
swan: true,
tt: true,
qq: true,
getApp: true,
__wxRoute: true,
getCurrentPages: true,
requirePlugin: true
'env': {
'jest/globals': true,
'browser': true,
'node': true,
'es6': true,
},
rules: {
'no-unused-expressions': 0,
'no-useless-constructor': 0
'globals': {
'testRule': 'readonly',
'wx': 'readonly',
'qq': 'readonly',
'tt': 'readonly',
'swan': 'readonly',
'my': 'readonly',
'getCurrentPages': 'readonly',
'getApp': 'readonly'
},
settings: {
react: {
pragma: 'Nerv'
'parserOptions': {
'ecmaFeatures': {
'jsx': true
}
},
parser: 'babel-eslint'
}
}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ lerna-debug.log
yarn-error.log
_book
.idea
.vscode
temp
website/build
website/package.json
Expand Down
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"printWidth": 120
}
14 changes: 14 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"eslint.validate": [
"javascript",
"javascriptreact",
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
]
}
60 changes: 7 additions & 53 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -1,61 +1,15 @@
{
"lerna": "2.10.0",
"packages": [
"packages/taro",
"packages/taro-utils",
"packages/taro-async-await",
"packages/taro-cli",
"packages/taro-components",
"packages/taro-components-rn",
"packages/taro-components-qa",
"packages/taro-h5",
"packages/taro-plugin-babel",
"packages/taro-plugin-csso",
"packages/taro-plugin-sass",
"packages/taro-plugin-uglifyjs",
"packages/taro-plugin-typescript",
"packages/taro-plugin-less",
"packages/taro-plugin-stylus",
"packages/taro-redux",
"packages/taro-redux-h5",
"packages/taro-redux-rn",
"packages/taro-rn",
"packages/taro-router-rn",
"packages/taro-rn-runner",
"packages/taro-router",
"packages/taro-weapp",
"packages/taro-swan",
"packages/taro-alipay",
"packages/taro-tt",
"packages/taro-quickapp",
"packages/taro-qq",
"packages/taro-jd",
"packages/taro-webpack-runner",
"packages/taro-mini-runner",
"packages/postcss-plugin-constparse",
"packages/eslint-config-taro",
"packages/eslint-plugin-taro",
"packages/taro-transformer-wx",
"packages/postcss-pxtransform",
"packages/postcss-unit-transform",
"packages/babel-plugin-transform-jsx-to-stylesheet",
"packages/babel-plugin-transform-taroapi",
"packages/taro-mobx",
"packages/taro-mobx-common",
"packages/taro-mobx-h5",
"packages/taro-mobx-rn",
"packages/taro-with-weapp",
"packages/taroize",
"packages/stylelint-taro-rn",
"packages/stylelint-config-taro-rn",
"packages/css-to-react-native",
"packages/runtime"
],
"lerna": "3.16.5",
"useWorkspaces": true,
"command": {
"publish": {
"message": "chore(release): publish %s"
},
"create": {
"homepage": "https://github.com/nervjs/taro",
"license": "MIT"
}
},
"version": "1.3.22",
"version": "1.3.15",
"npmClient": "npm"
}
4 changes: 4 additions & 0 deletions lint.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@

> @tarojs/taro@ lint /Users/yuche/Developer/taro
> eslint packages/ --ext .js --ext .ts --fix

96 changes: 67 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
"description": "Nerv-multi多端开发解决方案",
"main": "index.js",
"scripts": {
"lint": "eslint packages/*/src/**/*.js --fix",
"lint": "eslint packages/ --ext .js --ext .ts --fix",
"docs": "cd website && docusaurus-build",
"docs:serve": "cd website && docusaurus-start",
"docs:version": "cd website && docusaurus-version",
"docs:rename-version": "cd website && docusaurus-rename-version",
"clear-all": "rimraf package-lock.json packages/*/node_modules packages/*/package-lock.json",
"bootstrap:ci": "lerna bootstrap --npm-client=yarn",
"bootstrap:lerna": "lerna bootstrap -- --ignore-engines",
"bootstrap:lerna": "lerna bootstrap",
"bootstrap": "npm-run-all clear-all bootstrap:lerna",
"build": "lerna run build",
"build:docs": "node ./build/docs.js",
Expand All @@ -25,7 +25,7 @@
"type": "git",
"url": "git+https://github.com/NervJS/taro.git"
},
"lint-staged": {
"//lint-staged": {
"*.{js,jsx}": [
"eslint --fix",
"git add"
Expand All @@ -34,7 +34,7 @@
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
"//pre-commit": "lint-staged"
}
},
"keywords": [
Expand All @@ -48,56 +48,94 @@
},
"homepage": "https://github.com/NervJS/taro#readme",
"devDependencies": {
"@babel/core": "^7.0.0-beta.42",
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.42",
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.42",
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.44",
"@babel/plugin-transform-react-jsx": "^7.0.0-beta.41",
"@babel/preset-env": "^7.0.0-beta.42",
"@babel/core": "^7.6.2",
"@babel/plugin-proposal-class-properties": "^7.5.5",
"@babel/plugin-proposal-object-rest-spread": "^7.6.2",
"@babel/plugin-syntax-dynamic-import": "^7.2.0",
"@babel/plugin-transform-react-jsx": "^7.3.0",
"@babel/preset-env": "^7.6.2",
"@babel/preset-react": "^7.0.0",
"@commitlint/cli": "^7.2.1",
"@commitlint/config-conventional": "^7.1.2",
"@types/babel-generator": "^6.25.3",
"@types/babel-traverse": "^6.25.5",
"@types/babel-types": "^7.0.7",
"@types/jest": "^24.0.18",
"@types/lodash": "^4.14.142",
"@types/node": "^12.7.11",
"@types/react": "^16.9.5",
"@types/sinon": "^7.5.0",
"@typescript-eslint/eslint-plugin": "^2.3.3",
"@typescript-eslint/parser": "^2.3.3",
"babel-core": "^6.26.3",
"babel-eslint": "^10.0.1",
"babel-loader": "^8.0.0-beta.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"conventional-changelog-cli": "^2.0.1",
"css-loader": "^0.28.10",
"docusaurus": "^2.0.0-alpha.23",
"eslint": "^4.18.2",
"eslint-config-standard": "^11.0.0",
"enzyme": "^3.10.0",
"enzyme-adapter-react-16": "^1.14.0",
"enzyme-to-json": "^3.4.2",
"eslint": "^6.5.1",
"eslint-config-prettier": "^6.4.0",
"eslint-config-standard": "^14.1.0",
"eslint-config-standard-jsx": "^4.0.2",
"eslint-loader": "^2.0.0",
"eslint-plugin-flowtype": "^3.2.0",
"eslint-plugin-import": "^2.9.0",
"eslint-plugin-jest": "^22.0.0",
"eslint-plugin-node": "^6.0.1",
"eslint-plugin-promise": "^3.7.0",
"eslint-plugin-import": "^2.18.2",
"eslint-plugin-jest": "^22.17.0",
"eslint-plugin-node": "^10.0.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-react": "^7.4.0",
"eslint-plugin-standard": "^3.0.1",
"eslint-plugin-standard": "^4.0.1",
"gh-pages": "^1.1.0",
"gulp": "^4.0.2",
"gulp-typescript": "^5.0.1",
"html-webpack-plugin": "^3.0.6",
"husky": "^1.2.0",
"jest": "23",
"jest-dom": "^1.3.1",
"lerna": "^2.10.0",
"jest-localstorage-mock": "^2.4.0",
"jest-mock-console": "^1.0.0",
"lerna": "^3.16.5",
"lint-staged": "^8.1.0",
"mocha": "^6.2.1",
"mock-socket": "^9.0.1",
"nerv-markdown-loader": "0.0.1",
"node-sass": "^4.12.0",
"npm-run-all": "^4.1.2",
"ora": "^2.1.0",
"prettier": "^1.18.2",
"react": "^16.10.2",
"react-dom": "^16.10.2",
"react-native": "^0.61.2",
"react-native-mock-render": "^0.1.5",
"react-test-renderer": "^16.10.2",
"redux": "^4.0.4",
"rimraf": "^2.6.2",
"rollup": "^0.57.1",
"rollup-plugin-alias": "^1.4.0",
"rollup-plugin-babel": "^4.0.0-beta.2",
"rollup-plugin-buble": "^0.19.2",
"rollup-plugin-commonjs": "^9.1.0",
"rollup-plugin-node-resolve": "^3.3.0",
"rollup-plugin-postcss": "^1.6.1",
"rollup": "^1.23.1",
"rollup-plugin-alias": "^2.0.1",
"rollup-plugin-babel": "^4.3.3",
"rollup-plugin-buble": "^0.19.8",
"rollup-plugin-commonjs": "^10.1.0",
"rollup-plugin-node-resolve": "^5.2.0",
"rollup-plugin-postcss": "^2.0.3",
"rollup-plugin-typescript2": "^0.24.3",
"sass-loader": "^6.0.7",
"shelljs": "^0.8.1",
"sinon": "^7.5.0",
"style-loader": "^0.20.3",
"typescript": "^3.0.1",
"webpack": "^3.11.0",
"webpack-cli": "^1.0.12",
"webpack-dev-server": "^3.1.4"
"ts-jest": "23",
"typescript": "^3.6.3",
"webpack": "^4.41.0",
"webpack-cli": "^3.3.9",
"webpack-dev-server": "^3.8.2"
}
}
10 changes: 0 additions & 10 deletions packages/babel-plugin-transform-jsx-to-stylesheet/.babelrc

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import jSXStylePlugin from '../index'
import jSXStylePlugin from '../src/index'
import syntaxJSX from 'babel-plugin-syntax-jsx'
import { transform } from 'babel-core'

Expand Down

This file was deleted.

10 changes: 0 additions & 10 deletions packages/babel-plugin-transform-jsx-to-stylesheet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,5 @@
"homepage": "https://github.com/NervJS/taro#readme",
"engines": {
"npm": ">=3.0.0"
},
"devDependencies": {
"babel-core": "^6.23.1",
"babel-jest": "^23.6.0",
"babel-plugin-syntax-jsx": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"babel-preset-stage-0": "^6.24.1",
"jest": "^23.6.0"
}
}
Loading

0 comments on commit 2565563

Please sign in to comment.