@rubytech/create-maxy 0.3.1 → 0.3.3

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.
Files changed (2) hide show
  1. package/dist/index.js +29 -19
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -107,7 +107,7 @@ function installClaudeCode() {
107
107
  return;
108
108
  }
109
109
  log("3", TOTAL, "Installing Claude Code...");
110
- shell("npm", ["install", "-g", "@anthropic-ai/claude-code"]);
110
+ shell("npm", ["install", "-g", "@anthropic-ai/claude-code"], { sudo: true });
111
111
  }
112
112
  function resetNeo4jWithFreshPassword() {
113
113
  const password = randomBytes(24).toString("base64url");
@@ -229,38 +229,48 @@ function deployPayload() {
229
229
  if (!existsSync(PAYLOAD_DIR)) {
230
230
  throw new Error(`Payload not found at ${PAYLOAD_DIR}. Package may be corrupted.`);
231
231
  }
232
- // Clean deploy remove old platform/ and maxy/ to prevent stale files
233
- // (e.g. middleware.ts → proxy.ts rename). Preserve config/ (passwords, accounts).
232
+ // Preserve config (passwords, accounts) across deploys
234
233
  const configDir = join(INSTALL_DIR, "platform/config");
234
+ const passwordFile = join(configDir, ".neo4j-password");
235
+ const accountsDir = join(configDir, "accounts");
235
236
  const configBackup = join(INSTALL_DIR, ".config-backup");
236
- if (existsSync(configDir)) {
237
- cpSync(configDir, configBackup, { recursive: true });
237
+ // Back up config before wiping
238
+ let hasPasswordBackup = false;
239
+ if (existsSync(passwordFile)) {
240
+ mkdirSync(configBackup, { recursive: true });
241
+ cpSync(passwordFile, join(configBackup, ".neo4j-password"));
242
+ hasPasswordBackup = true;
243
+ }
244
+ if (existsSync(accountsDir)) {
245
+ mkdirSync(configBackup, { recursive: true });
246
+ cpSync(accountsDir, join(configBackup, "accounts"), { recursive: true });
238
247
  }
248
+ // Wipe old platform/maxy to prevent stale files
239
249
  for (const dir of ["platform", "maxy", "docs", ".claude"]) {
240
250
  const target = join(INSTALL_DIR, dir);
241
251
  if (existsSync(target)) {
242
252
  rmSync(target, { recursive: true });
243
253
  }
244
254
  }
245
- // Restore config after clean
246
- if (existsSync(configBackup)) {
247
- mkdirSync(configDir, { recursive: true });
248
- cpSync(configBackup, configDir, { recursive: true });
249
- rmSync(configBackup, { recursive: true });
250
- }
251
255
  mkdirSync(INSTALL_DIR, { recursive: true });
256
+ // Deploy payload
252
257
  cpSync(PAYLOAD_DIR, INSTALL_DIR, {
253
258
  recursive: true,
254
259
  force: true,
255
- filter: (src) => {
256
- // Don't overwrite the password file or live account data
257
- if (src.includes(".neo4j-password"))
258
- return false;
259
- if (src.includes("/config/accounts/") && !src.endsWith("/accounts"))
260
- return false;
261
- return true;
262
- },
263
260
  });
261
+ // Restore backed-up config (password + accounts)
262
+ mkdirSync(configDir, { recursive: true });
263
+ if (hasPasswordBackup && existsSync(join(configBackup, ".neo4j-password"))) {
264
+ cpSync(join(configBackup, ".neo4j-password"), passwordFile);
265
+ console.log(" Restored Neo4j password from previous install.");
266
+ }
267
+ if (existsSync(join(configBackup, "accounts"))) {
268
+ cpSync(join(configBackup, "accounts"), accountsDir, { recursive: true, force: true });
269
+ console.log(" Restored account data from previous install.");
270
+ }
271
+ if (existsSync(configBackup)) {
272
+ rmSync(configBackup, { recursive: true });
273
+ }
264
274
  console.log(` Deployed to ${INSTALL_DIR}`);
265
275
  }
266
276
  function buildPlatform() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rubytech/create-maxy",
3
- "version": "0.3.1",
3
+ "version": "0.3.3",
4
4
  "description": "Install Maxy — your personal AI assistant",
5
5
  "bin": {
6
6
  "create-maxy": "./dist/index.js"