@lark-apaas/coding-template-nestjs-react-fullstack 0.1.23 → 0.1.24
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/package-lock.json +17 -17
- package/template/package.json +2 -2
- package/template/scripts/lint.js +22 -7
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"name": "fullstack-nestjs-template",
|
|
9
9
|
"version": "2.2.5",
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@lark-apaas/fullstack-nestjs-core": "^1.1.
|
|
11
|
+
"@lark-apaas/fullstack-nestjs-core": "^1.1.59",
|
|
12
12
|
"@nestjs/axios": "^4.0.1",
|
|
13
13
|
"@nestjs/cache-manager": "^3.1.3",
|
|
14
14
|
"@nestjs/common": "^10.4.20",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@headlessui/react": "^2.2.9",
|
|
38
38
|
"@heroicons/react": "^2.2.0",
|
|
39
39
|
"@hookform/resolvers": "^5.2.2",
|
|
40
|
-
"@lark-apaas/client-toolkit": "^1.2.
|
|
40
|
+
"@lark-apaas/client-toolkit": "^1.2.63",
|
|
41
41
|
"@lark-apaas/fullstack-presets": "^1.1.0",
|
|
42
42
|
"@lark-apaas/fullstack-vite-preset": "^1.0.34",
|
|
43
43
|
"@nestjs/cli": "^10.4.9",
|
|
@@ -3100,9 +3100,9 @@
|
|
|
3100
3100
|
}
|
|
3101
3101
|
},
|
|
3102
3102
|
"node_modules/@lark-apaas/client-toolkit": {
|
|
3103
|
-
"version": "1.2.
|
|
3104
|
-
"resolved": "https://registry.npmmirror.com/@lark-apaas/client-toolkit/-/client-toolkit-1.2.
|
|
3105
|
-
"integrity": "sha512
|
|
3103
|
+
"version": "1.2.63",
|
|
3104
|
+
"resolved": "https://registry.npmmirror.com/@lark-apaas/client-toolkit/-/client-toolkit-1.2.63.tgz",
|
|
3105
|
+
"integrity": "sha512-/ZtOLOb72bWob1rV950B30C9E9Msda8BdwAFQeMWs7khaVjHBJq/k2vdJksWip14frlsUAPBPcuGe3XafBIcPw==",
|
|
3106
3106
|
"dev": true,
|
|
3107
3107
|
"dependencies": {
|
|
3108
3108
|
"@ant-design/colors": "^7.2.1",
|
|
@@ -3251,16 +3251,16 @@
|
|
|
3251
3251
|
}
|
|
3252
3252
|
},
|
|
3253
3253
|
"node_modules/@lark-apaas/fullstack-nestjs-core": {
|
|
3254
|
-
"version": "1.1.
|
|
3255
|
-
"resolved": "https://registry.npmmirror.com/@lark-apaas/fullstack-nestjs-core/-/fullstack-nestjs-core-1.1.
|
|
3256
|
-
"integrity": "sha512-
|
|
3254
|
+
"version": "1.1.59",
|
|
3255
|
+
"resolved": "https://registry.npmmirror.com/@lark-apaas/fullstack-nestjs-core/-/fullstack-nestjs-core-1.1.59.tgz",
|
|
3256
|
+
"integrity": "sha512-oJs91O+XrrZ36JPyZLi63KKKIphGKXC8Ima3WM6l5Do7wm+VwtGkZKIKa4y44Y4Xv+0kqSotfS9rxs1FwlRPwg==",
|
|
3257
3257
|
"license": "MIT",
|
|
3258
3258
|
"dependencies": {
|
|
3259
3259
|
"@lark-apaas/cache-service": "^0.1.1",
|
|
3260
3260
|
"@lark-apaas/file-service": "^0.1.2",
|
|
3261
3261
|
"@lark-apaas/http-client": "^0.1.7",
|
|
3262
|
-
"@lark-apaas/nestjs-authnpaas": "^1.0.
|
|
3263
|
-
"@lark-apaas/nestjs-authzpaas": "^0.1.
|
|
3262
|
+
"@lark-apaas/nestjs-authnpaas": "^1.0.7",
|
|
3263
|
+
"@lark-apaas/nestjs-authzpaas": "^0.1.14",
|
|
3264
3264
|
"@lark-apaas/nestjs-capability": "^0.1.14",
|
|
3265
3265
|
"@lark-apaas/nestjs-common": "^0.1.9",
|
|
3266
3266
|
"@lark-apaas/nestjs-datapaas": "^1.0.21",
|
|
@@ -3912,9 +3912,9 @@
|
|
|
3912
3912
|
}
|
|
3913
3913
|
},
|
|
3914
3914
|
"node_modules/@lark-apaas/nestjs-authnpaas": {
|
|
3915
|
-
"version": "1.0.
|
|
3916
|
-
"resolved": "https://registry.npmmirror.com/@lark-apaas/nestjs-authnpaas/-/nestjs-authnpaas-1.0.
|
|
3917
|
-
"integrity": "sha512-
|
|
3915
|
+
"version": "1.0.7",
|
|
3916
|
+
"resolved": "https://registry.npmmirror.com/@lark-apaas/nestjs-authnpaas/-/nestjs-authnpaas-1.0.7.tgz",
|
|
3917
|
+
"integrity": "sha512-MIx73hgunGCPCPmWyBGHc99O275Hi9g2MTe/rr4xkXC4AtCxPVuZco/RqBt1gH1HslDNZKJ54Nuq2D8tJ/hDZA==",
|
|
3918
3918
|
"license": "MIT",
|
|
3919
3919
|
"dependencies": {
|
|
3920
3920
|
"reflect-metadata": "^0.1.13"
|
|
@@ -3930,13 +3930,13 @@
|
|
|
3930
3930
|
}
|
|
3931
3931
|
},
|
|
3932
3932
|
"node_modules/@lark-apaas/nestjs-authzpaas": {
|
|
3933
|
-
"version": "0.1.
|
|
3934
|
-
"resolved": "https://registry.npmmirror.com/@lark-apaas/nestjs-authzpaas/-/nestjs-authzpaas-0.1.
|
|
3935
|
-
"integrity": "sha512
|
|
3933
|
+
"version": "0.1.14",
|
|
3934
|
+
"resolved": "https://registry.npmmirror.com/@lark-apaas/nestjs-authzpaas/-/nestjs-authzpaas-0.1.14.tgz",
|
|
3935
|
+
"integrity": "sha512-/FmzjpB1v70EUcKs8VlinM5k4Jw3lvUgNA2+ot2XU3qEFKEiUDfswPKZgj1wIRjvtBxBCpUNaYQ2zm0UjK6Uxw==",
|
|
3936
3936
|
"license": "MIT",
|
|
3937
3937
|
"dependencies": {
|
|
3938
3938
|
"@casl/ability": "^6.7.3",
|
|
3939
|
-
"@lark-apaas/nestjs-authnpaas": "^1.0.
|
|
3939
|
+
"@lark-apaas/nestjs-authnpaas": "^1.0.7",
|
|
3940
3940
|
"@lark-apaas/nestjs-common": "^0.1.9",
|
|
3941
3941
|
"jsonwebtoken": "^9.0.3",
|
|
3942
3942
|
"reflect-metadata": "^0.1.13",
|
package/template/package.json
CHANGED
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"upgrade": "npx -y @lark-apaas/fullstack-cli sync --disable-gen-openapi"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@lark-apaas/fullstack-nestjs-core": "^1.1.
|
|
36
|
+
"@lark-apaas/fullstack-nestjs-core": "^1.1.59",
|
|
37
37
|
"@nestjs/axios": "^4.0.1",
|
|
38
38
|
"@nestjs/common": "^10.4.20",
|
|
39
39
|
"@nestjs/cache-manager": "^3.1.3",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"@headlessui/react": "^2.2.9",
|
|
63
63
|
"@heroicons/react": "^2.2.0",
|
|
64
64
|
"@hookform/resolvers": "^5.2.2",
|
|
65
|
-
"@lark-apaas/client-toolkit": "^1.2.
|
|
65
|
+
"@lark-apaas/client-toolkit": "^1.2.63",
|
|
66
66
|
"@lark-apaas/fullstack-presets": "^1.1.0",
|
|
67
67
|
"@lark-apaas/fullstack-vite-preset": "^1.0.34",
|
|
68
68
|
"@nestjs/cli": "^10.4.9",
|
package/template/scripts/lint.js
CHANGED
|
@@ -72,20 +72,35 @@ const STYLELINT_CONFIG_FILES = [
|
|
|
72
72
|
];
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
|
-
* 老模板(fullstack-nestjs-template 1.x
|
|
76
|
-
*
|
|
75
|
+
* 老模板(fullstack-nestjs-template 1.x 时代)的应用跑不了 stylelint,跑了就挂、把 pre-commit
|
|
76
|
+
* 卡死。两种形态都实测过:
|
|
77
|
+
*
|
|
78
|
+
* - 缺 scripts.stylelint → `npm error Missing script: "stylelint"`
|
|
79
|
+
* - 缺 .stylelintrc.* → `ConfigurationError: No configuration provided`
|
|
80
|
+
*
|
|
81
|
+
* 注意光判断 stylelint 装没装拦不住:@lark-apaas/fullstack-presets 的 dependencies 里有
|
|
82
|
+
* stylelint,只要 dep 了 presets 二进制就在。缺任一件就跳过这一步。
|
|
77
83
|
*/
|
|
78
|
-
function
|
|
84
|
+
function canRunStylelint() {
|
|
85
|
+
let pkg;
|
|
86
|
+
try {
|
|
87
|
+
pkg = JSON.parse(fs.readFileSync(path.join(cwd, 'package.json'), 'utf8'));
|
|
88
|
+
} catch {
|
|
89
|
+
return false;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (!pkg.scripts || !pkg.scripts.stylelint) return false;
|
|
93
|
+
|
|
79
94
|
return STYLELINT_CONFIG_FILES.some(file => fs.existsSync(path.join(cwd, file)));
|
|
80
95
|
}
|
|
81
96
|
|
|
82
97
|
async function runDefaultLint() {
|
|
83
98
|
const commands = ['npm run eslint', 'npm run type:check'];
|
|
84
99
|
|
|
85
|
-
if (
|
|
100
|
+
if (canRunStylelint()) {
|
|
86
101
|
commands.push('npm run stylelint');
|
|
87
102
|
} else {
|
|
88
|
-
console.warn('[lint] Skip stylelint:
|
|
103
|
+
console.warn('[lint] Skip stylelint: missing scripts.stylelint or stylelint config');
|
|
89
104
|
}
|
|
90
105
|
|
|
91
106
|
const code = await runCommand(getBinName('npx'), ['concurrently', ...commands]);
|
|
@@ -126,8 +141,8 @@ async function runSelectiveLint(inputFiles) {
|
|
|
126
141
|
tasks.push(runCommand(getBinName('npx'), ['eslint', '--quiet', ...eslintFiles]));
|
|
127
142
|
}
|
|
128
143
|
|
|
129
|
-
if (stylelintFiles.length > 0 && !
|
|
130
|
-
console.warn('[lint] Skip stylelint:
|
|
144
|
+
if (stylelintFiles.length > 0 && !canRunStylelint()) {
|
|
145
|
+
console.warn('[lint] Skip stylelint: missing scripts.stylelint or stylelint config');
|
|
131
146
|
} else if (stylelintFiles.length > 0) {
|
|
132
147
|
tasks.push(runCommand(getBinName('npx'), ['stylelint', '--quiet', ...stylelintFiles]));
|
|
133
148
|
}
|