vaultfs 1.0.0 → 1.0.1
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/bin/postinstall.js +11 -19
- package/bin/vaultfs-npm.js +9 -8
- package/package.json +1 -1
- package/version.txt +1 -1
package/bin/postinstall.js
CHANGED
|
@@ -91,35 +91,27 @@ try {
|
|
|
91
91
|
}
|
|
92
92
|
success("Source files copied");
|
|
93
93
|
|
|
94
|
+
// ─── Platform-aware commands ───────────────────────────────
|
|
95
|
+
const npmCmd = platform === "win32" ? "npm.cmd" : "npm";
|
|
96
|
+
const npxCmd = platform === "win32" ? "npx.cmd" : "npx";
|
|
97
|
+
|
|
94
98
|
// ─── Build frontend ────────────────────────────────────────
|
|
95
99
|
info("Installing frontend dependencies...");
|
|
96
100
|
const frontendDir = path.join(installDir, "frontend");
|
|
97
|
-
execSync(
|
|
101
|
+
execSync(`${npmCmd} install`, { cwd: frontendDir, stdio: "inherit" });
|
|
98
102
|
success("Dependencies installed");
|
|
99
103
|
|
|
100
104
|
info("Building React app...");
|
|
101
|
-
execSync(
|
|
105
|
+
execSync(`${npxCmd} vite build`, { cwd: frontendDir, stdio: "inherit" });
|
|
102
106
|
success("Frontend built");
|
|
103
107
|
|
|
104
108
|
// ─── Compile Java ──────────────────────────────────────────
|
|
105
109
|
info("Compiling Java sources...");
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
"
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
"src/auth/*.java",
|
|
112
|
-
"src/sync/*.java",
|
|
113
|
-
"src/filesystem/*.java",
|
|
114
|
-
"src/Main.java"
|
|
115
|
-
].join(" ");
|
|
116
|
-
|
|
117
|
-
// On Windows, use cmd /c for glob expansion
|
|
118
|
-
if (platform === "win32") {
|
|
119
|
-
execSync(`cmd /c "${javacCmd.replace(/\//g, "\\")}"`, { cwd: installDir, stdio: "inherit" });
|
|
120
|
-
} else {
|
|
121
|
-
execSync(javacCmd, { cwd: installDir, stdio: "inherit", shell: true });
|
|
122
|
-
}
|
|
110
|
+
execSync("javac -d out src/models/*.java src/datastructures/*.java src/utils/*.java src/auth/*.java src/sync/*.java src/filesystem/*.java src/Main.java", {
|
|
111
|
+
cwd: installDir,
|
|
112
|
+
stdio: "inherit",
|
|
113
|
+
shell: true
|
|
114
|
+
});
|
|
123
115
|
success("All sources compiled");
|
|
124
116
|
|
|
125
117
|
// ─── Done ──────────────────────────────────────────────────
|
package/bin/vaultfs-npm.js
CHANGED
|
@@ -12,6 +12,8 @@ const GREEN = "\x1b[32m";
|
|
|
12
12
|
const CYAN = "\x1b[36m";
|
|
13
13
|
|
|
14
14
|
const installDir = path.join(os.homedir(), ".vaultfs");
|
|
15
|
+
const npmCmd = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
16
|
+
const npxCmd = process.platform === "win32" ? "npx.cmd" : "npx";
|
|
15
17
|
const versionFile = path.join(installDir, "version.txt");
|
|
16
18
|
const args = process.argv.slice(2);
|
|
17
19
|
const cmd = args[0];
|
|
@@ -43,16 +45,15 @@ if (cmd === "update") {
|
|
|
43
45
|
|
|
44
46
|
// Rebuild frontend
|
|
45
47
|
const frontendDir = path.join(installDir, "frontend");
|
|
46
|
-
execSync(
|
|
47
|
-
execSync(
|
|
48
|
+
execSync(`${npmCmd} install`, { cwd: frontendDir, stdio: "inherit" });
|
|
49
|
+
execSync(`${npxCmd} vite build`, { cwd: frontendDir, stdio: "inherit" });
|
|
48
50
|
|
|
49
51
|
// Recompile Java
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
}
|
|
52
|
+
execSync("javac -d out src/models/*.java src/datastructures/*.java src/utils/*.java src/auth/*.java src/sync/*.java src/filesystem/*.java src/Main.java", {
|
|
53
|
+
cwd: installDir,
|
|
54
|
+
stdio: "inherit",
|
|
55
|
+
shell: true
|
|
56
|
+
});
|
|
56
57
|
|
|
57
58
|
const ver = fs.readFileSync(versionFile, "utf8").trim();
|
|
58
59
|
console.log(`✅ VaultFS updated to v${ver}!`);
|
package/package.json
CHANGED
package/version.txt
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.0.
|
|
1
|
+
1.0.1
|