forked from heylight/jdt-cli
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #1 from 314857493/v2.2.0-alpha
V2.2.0
- Loading branch information
Showing
105 changed files
with
20,741 additions
and
752 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
京东科技-平台研发部 前端模板生成工具 | ||
京东科技-技术与产品创新部-应用产品部 前端模板生成工具 | ||
|
||
### 安装 | ||
|
||
|
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,6 +1,6 @@ | ||
{ | ||
"name": "jdt-cli", | ||
"version": "2.1.18", | ||
"version": "2.2.0", | ||
"description": "", | ||
"bin": { | ||
"jdt": "bin/jdt" | ||
|
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
Empty file.
Empty file.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module.exports = { | ||
extends: [require.resolve("@umijs/fabric/dist/eslint")], | ||
globals: {}, | ||
plugins: ["react-hooks"], | ||
rules: { | ||
"no-restricted-syntax": 0, | ||
"no-param-reassign": 0, | ||
"no-unused-expressions": 0, | ||
"react-hooks/exhaustive-deps": 0, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
|
||
# testing | ||
/coverage | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
.env.local | ||
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
yarn lint |
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"quotes": true, | ||
"semi": true, | ||
"tabWidth": 2 | ||
} |
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# 使用 create-react-app 及 craco 搭建的 react 模板 | ||
|
||
## 使用 eslint 进行格式校验 | ||
|
||
使用@umijs/fabric 作为 eslint 插件 | ||
|
||
## 使用 husky 进行提交校验 | ||
|
||
使用 husky 对提交内容进行校验 | ||
|
||
## 使用 craco 对 webpack 配置进行修改 | ||
|
||
可以使用 craco 来配置 webpack 相关内容,不需要使用 eject 对配置内容进行弹出 | ||
|
||
## 使用技术栈 | ||
|
||
vite+react+redux+react-router(v5)+ts+antd+ahooks | ||
|
||
## 模板后端服务 | ||
|
||
见[https://github.com/314857493/test-nest](https://github.com/314857493/test-nest) |
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
const CracoLessPlugin = require("craco-less"); | ||
const path = require("path"); | ||
const TerserPlugin = require("terser-webpack-plugin"); | ||
const CssMinimizerPlugin = require("css-minimizer-webpack-plugin"); | ||
const merge = require("webpack-merge"); | ||
const BundleAnalyzerPlugin = | ||
require("webpack-bundle-analyzer").BundleAnalyzerPlugin; | ||
|
||
module.exports = { | ||
devServer: { | ||
host: "{{host}}", | ||
port: 4000, | ||
proxy: { | ||
"/api": { | ||
target: "http://{{proxy}}/", | ||
changeOrigin: true, | ||
}, | ||
}, | ||
}, | ||
plugins: [ | ||
{ | ||
plugin: CracoLessPlugin, | ||
options: { | ||
lessLoaderOptions: { | ||
lessOptions: { | ||
javascriptEnabled: true, | ||
modifyVars: { | ||
"primary-color": "#4762fe", | ||
}, | ||
}, | ||
}, | ||
}, | ||
}, | ||
], | ||
eslint: { | ||
enable: true, | ||
}, | ||
typescript: { | ||
enableTypeChecking: true, | ||
}, | ||
webpack: { | ||
alias: { | ||
"@": path.resolve(__dirname, "./src"), | ||
}, | ||
configure: (webpackConfig, { env, paths }) => { | ||
const analyzerMode = process.env.REACT_APP_INTERACTIVE_ANALYZE | ||
? "server" | ||
: "json"; | ||
|
||
const assignConfig = { | ||
optimization: { | ||
minimize: true, | ||
minimizer: [ | ||
new TerserPlugin({ | ||
parallel: true, | ||
terserOptions: { | ||
compress: { | ||
drop_console: true, | ||
drop_debugger: true, | ||
pure_funcs: ["console.log", "console.info", "console.warn"], | ||
}, | ||
format: { | ||
comments: false, | ||
}, | ||
}, | ||
extractComments: false, | ||
}), | ||
new CssMinimizerPlugin(), | ||
], | ||
}, | ||
}; | ||
const mergeConfig = { | ||
plugins: [new BundleAnalyzerPlugin({ analyzerMode })], | ||
}; | ||
const config = merge( | ||
Object.assign(webpackConfig, assignConfig), | ||
mergeConfig | ||
); | ||
return process.env.NODE_ENV === "production" ? config : webpackConfig; | ||
}, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
{ | ||
"name": "{{name}}", | ||
"version": "0.1.0", | ||
"scripts": { | ||
"analyze": "REACT_APP_INTERACTIVE_ANALYZE=1 yarn build", | ||
"start": "craco start", | ||
"build": "craco build", | ||
"test": "craco test", | ||
"eject": "react-scripts eject", | ||
"lint": "eslint . --ext .js,.ts,.jsx,tsx --ignore-path .gitignore", | ||
"prepare": "husky install" | ||
}, | ||
"dependencies": { | ||
"@craco/craco": "^6.4.3", | ||
"@reduxjs/toolkit": "^1.7.1", | ||
"@testing-library/jest-dom": "^5.14.1", | ||
"@testing-library/react": "^12.0.0", | ||
"@testing-library/user-event": "^13.2.1", | ||
"ahooks": "^3.1.5", | ||
"antd": "^4.18.2", | ||
"axios": "^0.24.0", | ||
"craco-less": "^2.0.0", | ||
"dayjs": "^1.10.7", | ||
"less": "^4.1.2", | ||
"less-loader": "^10.2.0", | ||
"react": "^17.0.2", | ||
"react-dom": "^17.0.2", | ||
"react-redux": "^7.2.6", | ||
"react-router": "^5.2.0", | ||
"react-router-dom": "^5.2.0", | ||
"react-scripts": "5.0.0", | ||
"web-vitals": "^2.1.0" | ||
}, | ||
"devDependencies": { | ||
"@types/craco__craco": "^6.4.0", | ||
"@types/node": "^17.0.8", | ||
"@types/react": "^17.0.38", | ||
"@types/react-dom": "^17.0.10", | ||
"@types/react-redux": "^7.1.21", | ||
"@types/react-router": "^5.1.17", | ||
"@types/react-router-dom": "^5.3.2", | ||
"@umijs/fabric": "^2.10.0", | ||
"@vitejs/plugin-react": "^1.1.4", | ||
"husky": "^7.0.4", | ||
"typescript": "^4.4.4", | ||
"webpack-bundle-analyzer": "^4.5.0" | ||
}, | ||
"eslintConfig": { | ||
"extends": [ | ||
"react-app", | ||
"react-app/jest" | ||
] | ||
}, | ||
"browserslist": { | ||
"production": [ | ||
">0.2%", | ||
"not dead", | ||
"not op_mini all" | ||
], | ||
"development": [ | ||
"last 1 chrome version", | ||
"last 1 firefox version", | ||
"last 1 safari version" | ||
] | ||
} | ||
} |
Binary file not shown.
Oops, something went wrong.