@ijfw/install 1.3.2 → 1.4.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/dist/ijfw.js +1124 -105
- package/dist/install.js +25 -9
- package/package.json +1 -1
package/dist/install.js
CHANGED
|
@@ -19,11 +19,15 @@ import {
|
|
|
19
19
|
chmodSync,
|
|
20
20
|
mkdirSync as mkdirSync2,
|
|
21
21
|
realpathSync,
|
|
22
|
-
statSync
|
|
22
|
+
statSync,
|
|
23
|
+
lstatSync,
|
|
24
|
+
openSync,
|
|
25
|
+
closeSync,
|
|
26
|
+
constants as fsConstants
|
|
23
27
|
} from "node:fs";
|
|
24
|
-
import { dirname as dirname3, basename, join as join3, normalize, delimiter } from "node:path";
|
|
28
|
+
import { dirname as dirname3, basename, join as join3, normalize, delimiter, resolve as resolve3, sep } from "node:path";
|
|
25
29
|
import { homedir as homedir2 } from "node:os";
|
|
26
|
-
import { createHash } from "node:crypto";
|
|
30
|
+
import { createHash, randomBytes as randomBytes2 } from "node:crypto";
|
|
27
31
|
function printOk(msg) {
|
|
28
32
|
process.stdout.write(` [ok] ${msg}
|
|
29
33
|
`);
|
|
@@ -60,7 +64,7 @@ function nativePath(p) {
|
|
|
60
64
|
function writeAtomic(path3, contents, opts = {}) {
|
|
61
65
|
const mode = opts.mode ?? 384;
|
|
62
66
|
mkdirSync2(dirname3(path3), { recursive: true });
|
|
63
|
-
const tmp = `${path3}.tmp.${process.pid}`;
|
|
67
|
+
const tmp = `${path3}.tmp.${process.pid}.${randomBytes2(4).toString("hex")}`;
|
|
64
68
|
writeFileSync2(tmp, contents, { mode });
|
|
65
69
|
renameSync2(tmp, path3);
|
|
66
70
|
try {
|
|
@@ -498,10 +502,22 @@ function clineMerge(serverJs, home, ts) {
|
|
|
498
502
|
writeAtomic(dst, JSON.stringify(doc, null, 2), { mode: 384 });
|
|
499
503
|
return dst;
|
|
500
504
|
}
|
|
501
|
-
var IS_WIN;
|
|
505
|
+
var IS_WIN, EXTENSION_PLATFORM_SKILL_DIRS;
|
|
502
506
|
var init_install_helpers = __esm({
|
|
503
507
|
"src/install-helpers.js"() {
|
|
504
508
|
IS_WIN = process.platform === "win32";
|
|
509
|
+
EXTENSION_PLATFORM_SKILL_DIRS = Object.freeze([
|
|
510
|
+
{ id: "claude", rel: "claude/skills" },
|
|
511
|
+
{ id: "codex", rel: "codex/skills" },
|
|
512
|
+
{ id: "gemini", rel: "gemini/extensions/ijfw/skills" },
|
|
513
|
+
{ id: "cursor", rel: "cursor/skills" },
|
|
514
|
+
{ id: "windsurf", rel: "windsurf/skills" },
|
|
515
|
+
{ id: "copilot", rel: "copilot/skills" },
|
|
516
|
+
{ id: "hermes", rel: "hermes/skills" },
|
|
517
|
+
{ id: "wayland", rel: "wayland/skills" },
|
|
518
|
+
{ id: "shared", rel: "shared/skills" },
|
|
519
|
+
{ id: "universal", rel: "universal/skills" }
|
|
520
|
+
]);
|
|
505
521
|
}
|
|
506
522
|
});
|
|
507
523
|
|
|
@@ -1781,7 +1797,7 @@ var init_install_flow = __esm({
|
|
|
1781
1797
|
// src/install.js
|
|
1782
1798
|
import { spawnSync as spawnSync2 } from "node:child_process";
|
|
1783
1799
|
import { existsSync as existsSync5, rmSync, mkdirSync as mkdirSync4, realpathSync as realpathSync2, renameSync as renameSync3 } from "node:fs";
|
|
1784
|
-
import { resolve as
|
|
1800
|
+
import { resolve as resolve4, join as join5, dirname as dirname5 } from "node:path";
|
|
1785
1801
|
import { homedir as homedir3, platform as platform2 } from "node:os";
|
|
1786
1802
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
1787
1803
|
|
|
@@ -2042,8 +2058,8 @@ function findBash() {
|
|
|
2042
2058
|
return null;
|
|
2043
2059
|
}
|
|
2044
2060
|
function resolveTarget(opt) {
|
|
2045
|
-
if (opt.dir) return
|
|
2046
|
-
if (process.env.IJFW_HOME) return
|
|
2061
|
+
if (opt.dir) return resolve4(opt.dir);
|
|
2062
|
+
if (process.env.IJFW_HOME) return resolve4(process.env.IJFW_HOME);
|
|
2047
2063
|
return join5(homedir3(), ".ijfw");
|
|
2048
2064
|
}
|
|
2049
2065
|
function runCheck(cmd, args, opts) {
|
|
@@ -2107,7 +2123,7 @@ function cloneOrPull(dir, branch) {
|
|
|
2107
2123
|
}
|
|
2108
2124
|
async function runInstallScript(dir) {
|
|
2109
2125
|
const canonicalDir = join5(homedir3(), ".ijfw");
|
|
2110
|
-
const isCustomDir =
|
|
2126
|
+
const isCustomDir = resolve4(dir) !== canonicalDir;
|
|
2111
2127
|
const { runInstall: runInstall2 } = await Promise.resolve().then(() => (init_install_flow(), install_flow_exports));
|
|
2112
2128
|
await runInstall2({
|
|
2113
2129
|
targets: void 0,
|