befly-vscode 1.7.0 → 1.8.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,6 +1,6 @@
1
1
  {
2
2
  "name": "befly-vscode",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "private": false,
5
5
  "description": "Befly VSCode - VSCode 扩展构建工具集",
6
6
  "bin": {
@@ -1,6 +1,16 @@
1
1
  #!/usr/bin/env node
2
- /* eslint-disable no-console */
3
2
  import { spawn } from "node:child_process";
3
+ /* eslint-disable no-console */
4
+ import { createRequire } from "node:module";
5
+ import { dirname, resolve } from "node:path";
6
+ import { fileURLToPath } from "node:url";
7
+
8
+ const dirname2 = dirname(fileURLToPath(import.meta.url));
9
+ const require = createRequire(import.meta.url);
10
+
11
+ const obfuscatorBin = resolve(require.resolve("javascript-obfuscator/package.json"), "../bin/javascript-obfuscator");
12
+ const obfuscatorConfig = resolve(dirname2, "../configs/obfuscator.config.json");
13
+ const vsceBin = resolve(require.resolve("@vscode/vsce/package.json"), "../vsce");
4
14
 
5
15
  const type = process.argv[2];
6
16
  const allowed = ["major", "minor", "patch"];
@@ -27,6 +37,6 @@ function run(cmd, args) {
27
37
  });
28
38
  }
29
39
 
30
- await run("bunx", ["javascript-obfuscator", "./dist/extension.mjs", "--output", "./dist/extension.mjs", "--config", "node_modules/befly-vscode/configs/obfuscator.config.json"]);
40
+ await run("node", [obfuscatorBin, "./dist/extension.mjs", "--output", "./dist/extension.mjs", "--config", obfuscatorConfig]);
31
41
 
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", "."]);
42
+ await run("node", [vsceBin, "publish", type, "--no-dependencies", "--no-git-tag-version", "--allow-missing-repository", "--allow-unused-files-pattern", "--skip-license", "--skip-duplicate", "--baseImagesUrl", ".", "--baseContentUrl", "."]);