swico 0.8.5-beta9 → 0.8.6
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/README.md
CHANGED
|
@@ -7,15 +7,15 @@ Swico,发音类似于“斯威扣”。
|
|
|
7
7
|
|
|
8
8
|
## 主要特性
|
|
9
9
|
|
|
10
|
-
- 构建工具基于
|
|
10
|
+
- 构建工具基于Webpack5,并配合esbuild-loader和swc-loader提升编译构建速率。
|
|
11
11
|
|
|
12
|
-
- 提供
|
|
12
|
+
- 提供Vue3和React18两种开发模板选择,默认集成TypeScript5。同时最大化统一这两种模板的开发API。
|
|
13
13
|
|
|
14
|
-
- 提供可配置化路由方案,基于
|
|
14
|
+
- 提供可配置化路由方案,基于React-Router6和Vue-Router4进行二次封装,支持路由嵌套,懒加载,动态参数,装饰校验等功能。
|
|
15
15
|
|
|
16
|
-
- 内置
|
|
16
|
+
- 内置ESLint + Prettier + Husky三大前端编码风格以及代码提交规范约束插件,保证代码风格统一以及 Git 提交规范。
|
|
17
17
|
|
|
18
18
|
- 提供配置文件可对部分项目配置进行修改扩展,例如Alias映射,本地请求代理等。
|
|
19
19
|
|
|
20
20
|
|
|
21
|
-
详见:[SWICO 官方文档](
|
|
21
|
+
详见:[SWICO 官方文档](https://scw1997.github.io/swico-docs)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "swico",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.6",
|
|
4
4
|
"description": "Simple, efficient, and practical front-end framework",
|
|
5
5
|
"main": "./src/index.js",
|
|
6
6
|
"types": "./src/index.d.ts",
|
|
@@ -38,7 +38,6 @@
|
|
|
38
38
|
"history": "5.3.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@babel/types": "7.23.9",
|
|
42
41
|
"@types/react": "18.2.79",
|
|
43
42
|
"@types/react-dom": "18.2.25",
|
|
44
43
|
"@vue/compiler-sfc": "3.4.14",
|
|
@@ -53,6 +52,7 @@
|
|
|
53
52
|
"webpack-dev-server": "4.15.2",
|
|
54
53
|
"webpack-merge": "5.9.0",
|
|
55
54
|
"webpackbar": "6.0.1",
|
|
55
|
+
"@babel/types": "7.23.9",
|
|
56
56
|
"@commitlint/cli": "18.5.0",
|
|
57
57
|
"@commitlint/config-conventional": "18.5.0",
|
|
58
58
|
"@swc/core": "1.4.6",
|
|
@@ -85,7 +85,6 @@
|
|
|
85
85
|
"style-loader": "3.3.0",
|
|
86
86
|
"swc-loader": "0.2.6",
|
|
87
87
|
"ts-node": "10.9.1",
|
|
88
|
-
"ts-loader": "9.5.1",
|
|
89
88
|
"typescript": "5.3.3"
|
|
90
89
|
}
|
|
91
90
|
}
|
|
@@ -63,9 +63,7 @@ var path_1 = __importDefault(require("path"));
|
|
|
63
63
|
var mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
64
64
|
var config_1 = require("../utils/config");
|
|
65
65
|
var html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
|
|
66
|
-
var fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
|
|
67
66
|
var webpack_1 = __importDefault(require("webpack"));
|
|
68
|
-
var tools_1 = require("../utils/tools");
|
|
69
67
|
function default_1(_a) {
|
|
70
68
|
var _b, _c, _d;
|
|
71
69
|
var projectPath = _a.projectPath, entryPath = _a.entryPath, env = _a.env, customConfig = _a.customConfig;
|
|
@@ -260,20 +258,6 @@ function default_1(_a) {
|
|
|
260
258
|
},
|
|
261
259
|
hash: true
|
|
262
260
|
}),
|
|
263
|
-
new fork_ts_checker_webpack_plugin_1.default({
|
|
264
|
-
logger: {
|
|
265
|
-
log: function () { },
|
|
266
|
-
error: function (message) {
|
|
267
|
-
tools_1.toast.error(message, { title: 'TypeScript errors' });
|
|
268
|
-
}
|
|
269
|
-
},
|
|
270
|
-
typescript: {
|
|
271
|
-
diagnosticOptions: {
|
|
272
|
-
semantic: true,
|
|
273
|
-
syntactic: true
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
}),
|
|
277
261
|
new mini_css_extract_plugin_1.default({
|
|
278
262
|
filename: env === 'dev' ? 'css/[name].css' : 'css/[name].[contenthash].css',
|
|
279
263
|
ignoreOrder: true
|
|
@@ -27,6 +27,8 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
|
|
|
27
27
|
options: {
|
|
28
28
|
jsc: {
|
|
29
29
|
parser: {
|
|
30
|
+
syntax: string;
|
|
31
|
+
tsx: boolean;
|
|
30
32
|
decorators: boolean;
|
|
31
33
|
dynamicImport: boolean;
|
|
32
34
|
};
|
|
@@ -36,17 +38,6 @@ export default function ({ projectPath, entryPath, env, customConfig }: GlobalDa
|
|
|
36
38
|
}[];
|
|
37
39
|
loader?: undefined;
|
|
38
40
|
oneOf?: undefined;
|
|
39
|
-
} | {
|
|
40
|
-
test: RegExp;
|
|
41
|
-
exclude: RegExp;
|
|
42
|
-
use: {
|
|
43
|
-
loader: string;
|
|
44
|
-
options: {
|
|
45
|
-
appendTsSuffixTo: RegExp[];
|
|
46
|
-
};
|
|
47
|
-
};
|
|
48
|
-
loader?: undefined;
|
|
49
|
-
oneOf?: undefined;
|
|
50
41
|
} | {
|
|
51
42
|
oneOf: ({
|
|
52
43
|
test: RegExp;
|
|
@@ -63,10 +63,8 @@ var path_1 = __importDefault(require("path"));
|
|
|
63
63
|
var mini_css_extract_plugin_1 = __importDefault(require("mini-css-extract-plugin"));
|
|
64
64
|
var config_1 = require("../utils/config");
|
|
65
65
|
var html_webpack_plugin_1 = __importDefault(require("html-webpack-plugin"));
|
|
66
|
-
var fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
|
|
67
66
|
var webpack_1 = __importDefault(require("webpack"));
|
|
68
67
|
var vue_loader_1 = require("vue-loader");
|
|
69
|
-
var tools_1 = require("../utils/tools");
|
|
70
68
|
function default_1(_a) {
|
|
71
69
|
var _b, _c, _d;
|
|
72
70
|
var projectPath = _a.projectPath, entryPath = _a.entryPath, env = _a.env, customConfig = _a.customConfig;
|
|
@@ -117,7 +115,7 @@ function default_1(_a) {
|
|
|
117
115
|
exclude: /node_modules/
|
|
118
116
|
},
|
|
119
117
|
{
|
|
120
|
-
test: /\.js$/,
|
|
118
|
+
test: /\.(ts|js)$/,
|
|
121
119
|
exclude: /node_modules/,
|
|
122
120
|
use: [
|
|
123
121
|
{
|
|
@@ -125,6 +123,8 @@ function default_1(_a) {
|
|
|
125
123
|
options: {
|
|
126
124
|
jsc: {
|
|
127
125
|
parser: {
|
|
126
|
+
syntax: 'typescript',
|
|
127
|
+
tsx: false,
|
|
128
128
|
decorators: true,
|
|
129
129
|
dynamicImport: true
|
|
130
130
|
},
|
|
@@ -134,16 +134,6 @@ function default_1(_a) {
|
|
|
134
134
|
}
|
|
135
135
|
]
|
|
136
136
|
},
|
|
137
|
-
{
|
|
138
|
-
test: /\.ts$/,
|
|
139
|
-
exclude: /node_modules/,
|
|
140
|
-
use: {
|
|
141
|
-
loader: 'ts-loader',
|
|
142
|
-
options: {
|
|
143
|
-
appendTsSuffixTo: [/\.vue$/]
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
},
|
|
147
137
|
{
|
|
148
138
|
oneOf: [
|
|
149
139
|
{
|
|
@@ -285,20 +275,6 @@ function default_1(_a) {
|
|
|
285
275
|
},
|
|
286
276
|
hash: true
|
|
287
277
|
}),
|
|
288
|
-
new fork_ts_checker_webpack_plugin_1.default({
|
|
289
|
-
logger: {
|
|
290
|
-
log: function () { },
|
|
291
|
-
error: function (message) {
|
|
292
|
-
tools_1.toast.error(message, { title: 'TypeScript errors' });
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
typescript: {
|
|
296
|
-
diagnosticOptions: {
|
|
297
|
-
semantic: true,
|
|
298
|
-
syntactic: true
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
}),
|
|
302
278
|
new mini_css_extract_plugin_1.default({
|
|
303
279
|
filename: env === 'dev' ? 'css/[name].css' : 'css/[name].[contenthash].css',
|
|
304
280
|
ignoreOrder: true
|
|
@@ -86,6 +86,8 @@ var config_1 = require("../utils/config");
|
|
|
86
86
|
var path_1 = __importDefault(require("path"));
|
|
87
87
|
var webpack_merge_1 = require("webpack-merge");
|
|
88
88
|
var eslint_webpack_plugin_1 = __importDefault(require("eslint-webpack-plugin"));
|
|
89
|
+
var fork_ts_checker_webpack_plugin_1 = __importDefault(require("fork-ts-checker-webpack-plugin"));
|
|
90
|
+
var tools_1 = require("../utils/tools");
|
|
89
91
|
function default_1(options) {
|
|
90
92
|
var _a, _b, _c, _d, _e;
|
|
91
93
|
return __awaiter(this, void 0, void 0, function () {
|
|
@@ -126,6 +128,20 @@ function default_1(options) {
|
|
|
126
128
|
server: customConfig.dev.https === true ? 'https' : 'http'
|
|
127
129
|
},
|
|
128
130
|
plugins: __spreadArray([
|
|
131
|
+
new fork_ts_checker_webpack_plugin_1.default({
|
|
132
|
+
logger: {
|
|
133
|
+
log: function () { },
|
|
134
|
+
error: function (message) {
|
|
135
|
+
tools_1.toast.error(message, { title: 'TypeScript errors' });
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
typescript: {
|
|
139
|
+
diagnosticOptions: {
|
|
140
|
+
semantic: true,
|
|
141
|
+
syntactic: true
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}),
|
|
129
145
|
new eslint_webpack_plugin_1.default({
|
|
130
146
|
context: path_1.default.join(projectPath, '/src'),
|
|
131
147
|
failOnError: false,
|
|
@@ -168,9 +168,9 @@ function default_1(options) {
|
|
|
168
168
|
new BundleAnalyzerPlugin({
|
|
169
169
|
analyzerMode: 'server',
|
|
170
170
|
analyzerHost: '127.0.0.1',
|
|
171
|
-
analyzerPort:
|
|
171
|
+
analyzerPort: 'auto',
|
|
172
172
|
reportFilename: 'report.html',
|
|
173
|
-
defaultSizes: '
|
|
173
|
+
defaultSizes: 'stat',
|
|
174
174
|
openAnalyzer: true,
|
|
175
175
|
generateStatsFile: false,
|
|
176
176
|
statsFilename: 'analyze.json',
|