create-packer 1.39.3 → 1.40.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/lib/workspace/packages/react/package.json +4 -0
- package/template/lib/workspace/packages/ts/package.json +1 -0
- package/template/web-app/react-rsbuild/index.html +0 -1
- package/template/web-app/react-rsbuild/rsbuild.config.ts +9 -8
- package/template/web-app/react-webpack/.editorconfig +0 -14
- package/template/web-app/react-webpack/.env +0 -2
- package/template/web-app/react-webpack/.env.dev +0 -2
- package/template/web-app/react-webpack/.gitignore +0 -27
- package/template/web-app/react-webpack/.husky/commit-msg +0 -4
- package/template/web-app/react-webpack/.husky/pre-commit +0 -4
- package/template/web-app/react-webpack/.prettierignore +0 -6
- package/template/web-app/react-webpack/.prettierrc +0 -18
- package/template/web-app/react-webpack/.stylelintignore +0 -4
- package/template/web-app/react-webpack/.stylelintrc +0 -24
- package/template/web-app/react-webpack/.vscode/extensions.json +0 -8
- package/template/web-app/react-webpack/.vscode/settings.json +0 -4
- package/template/web-app/react-webpack/README.md +0 -13
- package/template/web-app/react-webpack/commitlint.config.js +0 -1
- package/template/web-app/react-webpack/domain/app/app.model.ts +0 -7
- package/template/web-app/react-webpack/domain/app/app.styled.ts +0 -3
- package/template/web-app/react-webpack/domain/app/components/app-context.tsx +0 -17
- package/template/web-app/react-webpack/domain/app/components/app.tsx +0 -24
- package/template/web-app/react-webpack/domain/app/components/index.ts +0 -1
- package/template/web-app/react-webpack/domain/app/index.ts +0 -2
- package/template/web-app/react-webpack/domain/router/components/index.ts +0 -2
- package/template/web-app/react-webpack/domain/router/components/route-layout.tsx +0 -19
- package/template/web-app/react-webpack/domain/router/components/sub-route-outlet.tsx +0 -22
- package/template/web-app/react-webpack/domain/router/home/ids.ts +0 -3
- package/template/web-app/react-webpack/domain/router/home/index.ts +0 -2
- package/template/web-app/react-webpack/domain/router/home/routes.tsx +0 -13
- package/template/web-app/react-webpack/domain/router/ids.ts +0 -6
- package/template/web-app/react-webpack/domain/router/index.ts +0 -4
- package/template/web-app/react-webpack/domain/router/router.tsx +0 -28
- package/template/web-app/react-webpack/domain/router/router.types.ts +0 -3
- package/template/web-app/react-webpack/eslint.config.js +0 -104
- package/template/web-app/react-webpack/global.d.ts +0 -26
- package/template/web-app/react-webpack/index.css +0 -3
- package/template/web-app/react-webpack/index.html +0 -12
- package/template/web-app/react-webpack/main.tsx +0 -4
- package/template/web-app/react-webpack/package.json +0 -84
- package/template/web-app/react-webpack/pages/home/index.ts +0 -1
- package/template/web-app/react-webpack/pages/home/view.styled.ts +0 -7
- package/template/web-app/react-webpack/pages/home/view.tsx +0 -10
- package/template/web-app/react-webpack/pages/index.tsx +0 -18
- package/template/web-app/react-webpack/pages/not-found.tsx +0 -3
- package/template/web-app/react-webpack/postcss.config.js +0 -7
- package/template/web-app/react-webpack/public/react.svg +0 -1
- package/template/web-app/react-webpack/shared/assets/react.svg +0 -1
- package/template/web-app/react-webpack/shared/components/componentInstance.tsx +0 -78
- package/template/web-app/react-webpack/shared/components/index.ts +0 -1
- package/template/web-app/react-webpack/shared/constant/index.ts +0 -0
- package/template/web-app/react-webpack/shared/hooks/defineRouter/defineRouter.types.ts +0 -33
- package/template/web-app/react-webpack/shared/hooks/defineRouter/deineRouter.tsx +0 -160
- package/template/web-app/react-webpack/shared/hooks/defineRouter/index.ts +0 -2
- package/template/web-app/react-webpack/shared/hooks/index.ts +0 -6
- package/template/web-app/react-webpack/shared/hooks/useInterval.ts +0 -26
- package/template/web-app/react-webpack/shared/hooks/useLoadingAction.ts +0 -27
- package/template/web-app/react-webpack/shared/hooks/useLowPriorityState.ts +0 -26
- package/template/web-app/react-webpack/shared/hooks/useSyncState.ts +0 -15
- package/template/web-app/react-webpack/shared/hooks/useVisible.ts +0 -27
- package/template/web-app/react-webpack/shared/service/home.ts +0 -8
- package/template/web-app/react-webpack/shared/service/index.ts +0 -2
- package/template/web-app/react-webpack/shared/service/request.ts +0 -5
- package/template/web-app/react-webpack/shared/theme/index.ts +0 -1
- package/template/web-app/react-webpack/shared/theme/theme.styled.ts +0 -56
- package/template/web-app/react-webpack/shared/tools/index.ts +0 -0
- package/template/web-app/react-webpack/shared/types/index.ts +0 -1
- package/template/web-app/react-webpack/shared/types/utils.ts +0 -2
- package/template/web-app/react-webpack/tsconfig.json +0 -27
- package/template/web-app/react-webpack/tsconfig.node.json +0 -9
- package/template/web-app/react-webpack/webpack.config.mjs +0 -161
- package/template/web-app/react-webpack/webpack_config/constant.mjs +0 -5
- package/template/web-app/react-webpack/webpack_config/index.mjs +0 -2
- package/template/web-app/react-webpack/webpack_config/styles.mjs +0 -22
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './utils'
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"baseUrl": ".",
|
|
4
|
-
"target": "ESNext",
|
|
5
|
-
"useDefineForClassFields": true,
|
|
6
|
-
"lib": ["DOM", "DOM.Iterable", "ESNext"],
|
|
7
|
-
"allowJs": true,
|
|
8
|
-
"strictNullChecks": true,
|
|
9
|
-
"skipLibCheck": true,
|
|
10
|
-
"esModuleInterop": false,
|
|
11
|
-
"allowSyntheticDefaultImports": true,
|
|
12
|
-
"strict": true,
|
|
13
|
-
"forceConsistentCasingInFileNames": true,
|
|
14
|
-
"strictPropertyInitialization": false,
|
|
15
|
-
"module": "ESNext",
|
|
16
|
-
"moduleResolution": "Node",
|
|
17
|
-
"resolveJsonModule": true,
|
|
18
|
-
"isolatedModules": true,
|
|
19
|
-
"noEmit": true,
|
|
20
|
-
"jsx": "react-jsx",
|
|
21
|
-
"paths": {
|
|
22
|
-
"@/*": ["./*"]
|
|
23
|
-
}
|
|
24
|
-
},
|
|
25
|
-
"include": ["**/*.tsx", "**/*.ts"],
|
|
26
|
-
"exclude": ["scripts"]
|
|
27
|
-
}
|
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import path from 'path'
|
|
2
|
-
import webpack from 'webpack'
|
|
3
|
-
import WebpackBar from 'webpackbar'
|
|
4
|
-
import { EsbuildPlugin } from 'esbuild-loader'
|
|
5
|
-
import HtmlWebpackPlugin from 'html-webpack-plugin'
|
|
6
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
|
7
|
-
import EslintWebpackPlugin from 'eslint-webpack-plugin'
|
|
8
|
-
import StylelintWebpackPlugin from 'stylelint-webpack-plugin'
|
|
9
|
-
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin'
|
|
10
|
-
import { BundleAnalyzerPlugin } from 'webpack-bundle-analyzer'
|
|
11
|
-
import * as dotenv from 'dotenv'
|
|
12
|
-
import { ROOT, OUTPUT, createCssLoader, createStyleLoader } from './webpack_config/index.mjs'
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
* @param {String} mode
|
|
17
|
-
* @param {boolean} isProd
|
|
18
|
-
* @returns {object}
|
|
19
|
-
*/
|
|
20
|
-
function getEnvConfig(mode, isProd) {
|
|
21
|
-
const envConfig = dotenv.config({
|
|
22
|
-
path: isProd ? '.env' : `.env.${mode}`
|
|
23
|
-
}).parsed
|
|
24
|
-
Object.keys(envConfig).forEach(k => {
|
|
25
|
-
envConfig[k] = JSON.stringify(envConfig[k])
|
|
26
|
-
})
|
|
27
|
-
return envConfig
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default function (env) {
|
|
31
|
-
const isProd = ['prod', 'analyse'].includes(env.mode)
|
|
32
|
-
const envConfig = getEnvConfig(env.mode, isProd)
|
|
33
|
-
const publicPath = JSON.parse(envConfig.ENV_BASE_URL)
|
|
34
|
-
|
|
35
|
-
return {
|
|
36
|
-
entry: {
|
|
37
|
-
index: [path.join(ROOT, 'main.tsx')]
|
|
38
|
-
},
|
|
39
|
-
output: {
|
|
40
|
-
filename: isProd ? 'js/[name].[chunkhash].js' : 'js/[name].js',
|
|
41
|
-
chunkFilename: isProd ? 'js/[name].[chunkhash].js' : 'js/[name].js',
|
|
42
|
-
path: OUTPUT,
|
|
43
|
-
publicPath,
|
|
44
|
-
clean: true
|
|
45
|
-
},
|
|
46
|
-
mode: isProd ? 'production' : 'development',
|
|
47
|
-
stats: isProd ? 'normal' : 'errors-only',
|
|
48
|
-
performance: {
|
|
49
|
-
hints: false
|
|
50
|
-
},
|
|
51
|
-
devServer: {
|
|
52
|
-
host: '0.0.0.0',
|
|
53
|
-
hot: true,
|
|
54
|
-
open: publicPath,
|
|
55
|
-
static: {
|
|
56
|
-
publicPath
|
|
57
|
-
},
|
|
58
|
-
historyApiFallback: {
|
|
59
|
-
disableDotRule: true,
|
|
60
|
-
index: publicPath
|
|
61
|
-
},
|
|
62
|
-
devMiddleware: {
|
|
63
|
-
publicPath
|
|
64
|
-
},
|
|
65
|
-
proxy: [
|
|
66
|
-
{
|
|
67
|
-
'/api': {
|
|
68
|
-
target: 'http://127.0.0.1:3000',
|
|
69
|
-
changeOrigin: true,
|
|
70
|
-
secure: false,
|
|
71
|
-
pathRewrite: {
|
|
72
|
-
'^/api': ''
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
]
|
|
77
|
-
},
|
|
78
|
-
module: {
|
|
79
|
-
rules: [
|
|
80
|
-
{
|
|
81
|
-
test: /\.[jt]sx?$/,
|
|
82
|
-
loader: 'esbuild-loader',
|
|
83
|
-
options: {
|
|
84
|
-
target: 'chrome82',
|
|
85
|
-
drop: isProd ? ['console', 'debugger'] : []
|
|
86
|
-
}
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
test: /\.(png|jpg|jpeg|gif)$/i,
|
|
90
|
-
type: 'asset/resource'
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
test: /\.svg$/i,
|
|
94
|
-
type: 'asset/resource',
|
|
95
|
-
resourceQuery: /url/ // *.svg?url
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
test: /\.svg$/i,
|
|
99
|
-
issuer: /\.[jt]sx?$/,
|
|
100
|
-
resourceQuery: { not: [/url/] }, // exclude react component if *.svg?url
|
|
101
|
-
use: ['@svgr/webpack']
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
test: /\.(woff|woff2|eot|ttf|otf)$/i,
|
|
105
|
-
type: 'asset/resource'
|
|
106
|
-
},
|
|
107
|
-
{
|
|
108
|
-
test: /\.css$/,
|
|
109
|
-
exclude: /\.module\.css$/,
|
|
110
|
-
use: [createStyleLoader(isProd), createCssLoader(), 'postcss-loader']
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
test: /\.module\.css$/,
|
|
114
|
-
use: [createStyleLoader(isProd), createCssLoader(true), 'postcss-loader']
|
|
115
|
-
}
|
|
116
|
-
]
|
|
117
|
-
},
|
|
118
|
-
plugins: [
|
|
119
|
-
new WebpackBar(),
|
|
120
|
-
new HtmlWebpackPlugin({
|
|
121
|
-
filename: 'index.html',
|
|
122
|
-
template: path.resolve(ROOT, 'index.html')
|
|
123
|
-
}),
|
|
124
|
-
new EslintWebpackPlugin(),
|
|
125
|
-
new StylelintWebpackPlugin(),
|
|
126
|
-
new ForkTsCheckerWebpackPlugin(),
|
|
127
|
-
new webpack.DefinePlugin(envConfig),
|
|
128
|
-
new MiniCssExtractPlugin({
|
|
129
|
-
filename: isProd ? 'css/[name].[contenthash].css' : 'css/[name].css',
|
|
130
|
-
chunkFilename: isProd ? 'css/[name].[contenthash].css' : 'css/[name].css'
|
|
131
|
-
}),
|
|
132
|
-
env.mode === 'analyzer' && new BundleAnalyzerPlugin()
|
|
133
|
-
],
|
|
134
|
-
optimization: {
|
|
135
|
-
minimizer: [new EsbuildPlugin()],
|
|
136
|
-
splitChunks: {
|
|
137
|
-
minChunks: 1,
|
|
138
|
-
cacheGroups: {
|
|
139
|
-
react: {
|
|
140
|
-
test: /[\\/]node_modules[\\/](react|react-dom)[\\/]/,
|
|
141
|
-
chunks: 'all',
|
|
142
|
-
name: 'react'
|
|
143
|
-
},
|
|
144
|
-
vendors: {
|
|
145
|
-
test: /[\\/]node_modules[\\/]/,
|
|
146
|
-
chunks: 'all',
|
|
147
|
-
name: 'vendors',
|
|
148
|
-
priority: -1
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
},
|
|
153
|
-
resolve: {
|
|
154
|
-
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
|
|
155
|
-
alias: {
|
|
156
|
-
'@': ROOT
|
|
157
|
-
},
|
|
158
|
-
modules: ['node_modules']
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import MiniCssExtractPlugin from 'mini-css-extract-plugin'
|
|
2
|
-
import { SCOPE_CLASS_NAME } from './constant.mjs'
|
|
3
|
-
|
|
4
|
-
export function createStyleLoader(build) {
|
|
5
|
-
return build ? MiniCssExtractPlugin.loader : 'style-loader'
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export function createCssLoader(module) {
|
|
9
|
-
if (module) {
|
|
10
|
-
return {
|
|
11
|
-
loader: 'css-loader',
|
|
12
|
-
options: {
|
|
13
|
-
importLoaders: 1,
|
|
14
|
-
modules: {
|
|
15
|
-
mode: 'local',
|
|
16
|
-
localIdentName: SCOPE_CLASS_NAME
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return 'css-loader'
|
|
22
|
-
}
|