befly-vscode 1.7.0 → 1.9.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 CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "befly-vscode",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "private": false,
5
5
  "description": "Befly VSCode - VSCode 扩展构建工具集",
6
6
  "bin": {
7
- "vscode-release": "scripts/release.mjs"
7
+ "vscode-release": "scripts/release.js"
8
8
  },
9
9
  "files": [
10
10
  "utils/",
@@ -25,8 +25,6 @@
25
25
  },
26
26
  "dependencies": {
27
27
  "@vitejs/plugin-vue": "^6.0.7",
28
- "@vscode/vsce": "^3.9.2",
29
- "javascript-obfuscator": "^5.4.3",
30
28
  "vite-bundle-analyzer": "^1.3.8"
31
29
  },
32
30
  "engines": {
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env node
2
+ import { spawn } from "node:child_process";
3
+ /* eslint-disable no-console */
4
+ import { dirname, resolve } from "node:path";
5
+ import { fileURLToPath } from "node:url";
6
+
7
+ const dirname2 = dirname(fileURLToPath(import.meta.url));
8
+
9
+ const obfuscatorConfig = resolve(dirname2, "../configs/obfuscator.config.json");
10
+
11
+ const type = process.argv[2];
12
+ const allowed = ["major", "minor", "patch"];
13
+
14
+ if (!allowed.includes(type)) {
15
+ console.error("用法: vscode-release <major|minor|patch>");
16
+ console.error(" major (rx) - 大版本");
17
+ console.error(" minor (ry) - 中版本");
18
+ console.error(" patch (rz) - 小版本");
19
+ process.exit(1);
20
+ }
21
+
22
+ const shell = process.platform === "win32";
23
+
24
+ function run(cmd, args) {
25
+ return new Promise((onOk, onErr) => {
26
+ const child = spawn(cmd, args, { stdio: "inherit", env: process.env, shell: shell });
27
+ child.on("error", onErr);
28
+ child.on("exit", (code) => {
29
+ if (code === 0) {
30
+ onOk();
31
+ return;
32
+ }
33
+ onErr(new Error(`命令执行失败: ${cmd} ${args.join(" ")}`));
34
+ });
35
+ });
36
+ }
37
+
38
+ await run("javascript-obfuscator", ["./dist/extension.mjs", "--output", "./dist/extension.mjs", "--config", obfuscatorConfig]);
39
+
40
+ await run("vsce", ["publish", type, "--no-dependencies", "--no-git-tag-version", "--allow-missing-repository", "--allow-unused-files-pattern", "--skip-license", "--skip-duplicate", "--baseImagesUrl", ".", "--baseContentUrl", "."]);
@@ -1,32 +0,0 @@
1
- #!/usr/bin/env node
2
- /* eslint-disable no-console */
3
- import { spawn } from "node:child_process";
4
-
5
- const type = process.argv[2];
6
- const allowed = ["major", "minor", "patch"];
7
-
8
- if (!allowed.includes(type)) {
9
- console.error("用法: vscode-release <major|minor|patch>");
10
- console.error(" major (rx) - 大版本");
11
- console.error(" minor (ry) - 中版本");
12
- console.error(" patch (rz) - 小版本");
13
- process.exit(1);
14
- }
15
-
16
- function run(cmd, args) {
17
- return new Promise((resolve, reject) => {
18
- const child = spawn(cmd, args, { stdio: "inherit", env: process.env });
19
- child.on("error", reject);
20
- child.on("exit", (code) => {
21
- if (code === 0) {
22
- resolve();
23
- return;
24
- }
25
- reject(new Error(`命令执行失败: ${cmd} ${args.join(" ")}`));
26
- });
27
- });
28
- }
29
-
30
- await run("bunx", ["javascript-obfuscator", "./dist/extension.mjs", "--output", "./dist/extension.mjs", "--config", "node_modules/befly-vscode/configs/obfuscator.config.json"]);
31
-
32
- await run("bunx", ["@vscode/vsce", "publish", type, "--no-dependencies", "--no-git-tag-version", "--allow-missing-repository", "--allow-unused-files-pattern", "--skip-license", "--skip-duplicate", "--baseImagesUrl", ".", "--baseContentUrl", "."]);