@seayoo-web/scripts 2.0.1 → 2.0.3
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/dist/index.js +7 -4
- package/package.json +11 -11
- package/types/src/postcss.d.ts +7 -0
- package/types/src/stylelint.d.ts +1 -0
- package/types/src/vite.app.d.ts +1 -1
package/dist/index.js
CHANGED
|
@@ -72,18 +72,20 @@ function getBuildEnv(command, mode) {
|
|
|
72
72
|
const s = `${EnvPrefix}SENTRY_AUTH_TOKEN`;
|
|
73
73
|
const u = `${EnvPrefix}DEPLOY_USER`;
|
|
74
74
|
const k = `${EnvPrefix}DEPLOY_KEY`;
|
|
75
|
-
const
|
|
75
|
+
const paths = process.cwd().replace(/\\/g, "/").split("/");
|
|
76
|
+
const execDirWithPackage = paths.slice(-2).join("/");
|
|
77
|
+
const execDir = paths.slice(-1)[0];
|
|
76
78
|
const packageFile = join(process.cwd(), "./package.json");
|
|
77
79
|
if (!existsSync(packageFile)) {
|
|
78
80
|
console.error("执行代码有误,没有找到 package.json".red);
|
|
79
81
|
process.exit(1);
|
|
80
82
|
}
|
|
81
83
|
const packageJson = JSON.parse(readFileSync(packageFile, { encoding: "utf-8" }).toString());
|
|
82
|
-
if (!packageJson || !packageJson.name || packageJson.name
|
|
83
|
-
console.error(`工程 package.json/name
|
|
84
|
+
if (!packageJson || !packageJson.name || !(packageJson.name + "").endsWith(`/${execDir}`)) {
|
|
85
|
+
console.error(`工程 package.json/name 属性设置错误,应该跟目录名保持一致,请先调整`.red);
|
|
84
86
|
process.exit(1);
|
|
85
87
|
}
|
|
86
|
-
envConfig.page =
|
|
88
|
+
envConfig.page = execDirWithPackage;
|
|
87
89
|
if (envConfig.command === "build") {
|
|
88
90
|
if (process.env.NODE_ENV !== "production") {
|
|
89
91
|
console.error("部署时需要设置 NODE_ENV 为 production,请检查环境变量设置".red);
|
|
@@ -286,6 +288,7 @@ const stylelintConfig = {
|
|
|
286
288
|
}
|
|
287
289
|
],
|
|
288
290
|
rules: {
|
|
291
|
+
"selector-class-pattern": /^[a-z\d-_]+$/,
|
|
289
292
|
"selector-pseudo-class-no-unknown": [
|
|
290
293
|
true,
|
|
291
294
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@seayoo-web/scripts",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.3",
|
|
4
4
|
"description": "scripts for seayoo web repos",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"source": "index.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">=22"
|
|
29
29
|
},
|
|
30
30
|
"author": "web@seayoo.com",
|
|
31
31
|
"license": "MIT",
|
|
@@ -33,9 +33,9 @@
|
|
|
33
33
|
"access": "public"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@sentry/vite-plugin": "^3.
|
|
37
|
-
"@vitejs/plugin-legacy": "^6.0
|
|
38
|
-
"@vitejs/plugin-vue": "^5.2.
|
|
36
|
+
"@sentry/vite-plugin": "^3.3.1",
|
|
37
|
+
"@vitejs/plugin-legacy": "^6.1.0",
|
|
38
|
+
"@vitejs/plugin-vue": "^5.2.3",
|
|
39
39
|
"@vue/eslint-config-prettier": "^10.2.0",
|
|
40
40
|
"@vue/eslint-config-typescript": "^14.5.0",
|
|
41
41
|
"colors": "^1.4.0",
|
|
@@ -43,21 +43,21 @@
|
|
|
43
43
|
"eslint-plugin-import": "^2.31.0",
|
|
44
44
|
"eslint-plugin-vue": "^9.33.0",
|
|
45
45
|
"fs-extra": "^11.3.0",
|
|
46
|
-
"inquirer": "^12.5.
|
|
46
|
+
"inquirer": "^12.5.2",
|
|
47
47
|
"jiti": "^2.4.2",
|
|
48
48
|
"ora": "^8.2.0",
|
|
49
49
|
"postcss-html": "^1.8.0",
|
|
50
50
|
"terser": "^5.39.0",
|
|
51
51
|
"vite-plugin-stylelint": "^6.0.0",
|
|
52
|
-
"vite-plugin-vue-devtools": "^7.7.
|
|
52
|
+
"vite-plugin-vue-devtools": "^7.7.5",
|
|
53
53
|
"@seayoo-web/finder": "^2.0.13"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"@types/fs-extra": "^11.0.4",
|
|
57
|
-
"@types/node": "^22.
|
|
58
|
-
"@typescript-eslint/utils": "^8.
|
|
59
|
-
"eslint": "^9.
|
|
60
|
-
"stylelint": "^16.
|
|
57
|
+
"@types/node": "^22.14.1",
|
|
58
|
+
"@typescript-eslint/utils": "^8.30.1",
|
|
59
|
+
"eslint": "^9.25.0",
|
|
60
|
+
"stylelint": "^16.18.0",
|
|
61
61
|
"stylelint-config-recess-order": "^6.0.0",
|
|
62
62
|
"stylelint-config-standard": "^37.0.0",
|
|
63
63
|
"@seayoo-web/tsconfig": "^1.0.3"
|
package/types/src/stylelint.d.ts
CHANGED
package/types/src/vite.app.d.ts
CHANGED