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.
@@ -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("npm install --silent", { cwd: frontendDir, stdio: "inherit" });
101
+ execSync(`${npmCmd} install`, { cwd: frontendDir, stdio: "inherit" });
98
102
  success("Dependencies installed");
99
103
 
100
104
  info("Building React app...");
101
- execSync("npm run build --silent", { cwd: frontendDir, stdio: "inherit" });
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
- const javacCmd = [
107
- "javac", "-d", "out",
108
- "src/models/*.java",
109
- "src/datastructures/*.java",
110
- "src/utils/*.java",
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 ──────────────────────────────────────────────────
@@ -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("npm install", { cwd: frontendDir, stdio: "inherit" });
47
- execSync("npm run build", { cwd: frontendDir, stdio: "inherit" });
48
+ execSync(`${npmCmd} install`, { cwd: frontendDir, stdio: "inherit" });
49
+ execSync(`${npxCmd} vite build`, { cwd: frontendDir, stdio: "inherit" });
48
50
 
49
51
  // Recompile Java
50
- const javacCmd = "javac -d out src/models/*.java src/datastructures/*.java src/utils/*.java src/auth/*.java src/sync/*.java src/filesystem/*.java src/Main.java";
51
- if (process.platform === "win32") {
52
- execSync(`cmd /c "${javacCmd.replace(/\//g, "\\")}"`, { cwd: installDir, stdio: "inherit" });
53
- } else {
54
- execSync(javacCmd, { cwd: installDir, stdio: "inherit", shell: true });
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vaultfs",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A CLI-based secure file system simulator with OAuth 2.0 authentication and advanced data structures",
5
5
  "bin": {
6
6
  "vaultfs": "bin/vaultfs-npm.js"
package/version.txt CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.1