@guandata/guanwf 0.1.3 → 0.1.4
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/CHANGELOG.md +4 -0
- package/README.md +4 -0
- package/bin/run.js +36 -1
- package/binaries/guanwf-darwin-arm64 +0 -0
- package/binaries/guanwf-darwin-x64 +0 -0
- package/binaries/guanwf-linux-arm64 +0 -0
- package/binaries/guanwf-linux-x64 +0 -0
- package/binaries/guanwf-win32-x64.exe +0 -0
- package/package.json +8 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
package/bin/run.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
const { execFileSync, execSync, spawnSync } = require("child_process");
|
|
6
6
|
const path = require("path");
|
|
7
7
|
const fs = require("fs");
|
|
8
|
+
const os = require("os");
|
|
8
9
|
|
|
9
10
|
const PLATFORM_MAP = {
|
|
10
11
|
"darwin-arm64": "guanwf-darwin-arm64",
|
|
@@ -35,6 +36,38 @@ function getBinaryPath() {
|
|
|
35
36
|
return binaryPath;
|
|
36
37
|
}
|
|
37
38
|
|
|
39
|
+
function copyDirectory(src, dest) {
|
|
40
|
+
fs.mkdirSync(dest, { recursive: true });
|
|
41
|
+
for (const entry of fs.readdirSync(src, { withFileTypes: true })) {
|
|
42
|
+
const srcPath = path.join(src, entry.name);
|
|
43
|
+
const destPath = path.join(dest, entry.name);
|
|
44
|
+
if (entry.isDirectory()) {
|
|
45
|
+
copyDirectory(srcPath, destPath);
|
|
46
|
+
} else if (entry.isSymbolicLink()) {
|
|
47
|
+
fs.symlinkSync(fs.readlinkSync(srcPath), destPath);
|
|
48
|
+
} else {
|
|
49
|
+
fs.copyFileSync(srcPath, destPath);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
function installCodeBuddySkill(pkgRoot, skill) {
|
|
55
|
+
try {
|
|
56
|
+
const srcDir = path.join(pkgRoot, "skills", skill);
|
|
57
|
+
if (!fs.existsSync(path.join(srcDir, "SKILL.md"))) {
|
|
58
|
+
console.warn(`Warning: skipping CodeBuddy/WorkBuddy install; skill not found: ${srcDir}`);
|
|
59
|
+
return;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const configDir = process.env.CODEBUDDY_CONFIG_DIR || path.join(os.homedir(), ".codebuddy");
|
|
63
|
+
const destDir = path.join(configDir, "skills", skill);
|
|
64
|
+
copyDirectory(srcDir, destDir);
|
|
65
|
+
console.log(`Installed ${skill} to CodeBuddy/WorkBuddy: ${destDir}`);
|
|
66
|
+
} catch (err) {
|
|
67
|
+
console.warn(`Warning: CodeBuddy/WorkBuddy install failed for ${skill}: ${err.message}`);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
38
71
|
if (process.argv[2] === "version" && process.argv.length === 3) {
|
|
39
72
|
const pkg = JSON.parse(fs.readFileSync(path.join(__dirname, "..", "package.json"), "utf8"));
|
|
40
73
|
console.log(pkg.version);
|
|
@@ -57,7 +90,9 @@ if (process.argv[2] === "install-skill") {
|
|
|
57
90
|
console.log("Installing guanwf to AI coding assistants...");
|
|
58
91
|
const result = spawnSync("npx", args, { stdio: "inherit", env: process.env, shell: true });
|
|
59
92
|
if (result.error) throw result.error;
|
|
60
|
-
|
|
93
|
+
const status = result.status || 0;
|
|
94
|
+
if (status === 0) installCodeBuddySkill(pkgRoot, "guanwf");
|
|
95
|
+
process.exit(status);
|
|
61
96
|
}
|
|
62
97
|
|
|
63
98
|
const binary = getBinaryPath();
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@guandata/guanwf",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.4",
|
|
4
4
|
"description": "观远工作流数据流编辑工具 - 创建、编辑、导出、预览、保存数据流",
|
|
5
5
|
"bin": {
|
|
6
6
|
"guanwf": "bin/run.js"
|
|
7
7
|
},
|
|
8
|
+
"scripts": {
|
|
9
|
+
"build": "node scripts/build.js && node scripts/sync-skill.js",
|
|
10
|
+
"changelog": "node ../../scripts/generate-release-changelog.js .",
|
|
11
|
+
"check-changelog": "node ../../scripts/check-release-changelog.js .",
|
|
12
|
+
"prepublishOnly": "npm run check-changelog && npm run build && node scripts/preflight.js"
|
|
13
|
+
},
|
|
8
14
|
"files": [
|
|
9
15
|
"bin/",
|
|
10
16
|
"binaries/",
|
|
@@ -29,6 +35,7 @@
|
|
|
29
35
|
"node": ">=14"
|
|
30
36
|
},
|
|
31
37
|
"publishConfig": {
|
|
38
|
+
"registry": "https://registry.npmjs.org/",
|
|
32
39
|
"access": "public"
|
|
33
40
|
}
|
|
34
41
|
}
|