@meridiona/meridian 1.16.0 → 1.17.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.
Files changed (2) hide show
  1. package/bin/meridian.js +31 -10
  2. package/package.json +2 -2
package/bin/meridian.js CHANGED
@@ -54,7 +54,9 @@ function npmGlobalWritable() {
54
54
  // root. The rest of `update` (setup: per-user launchd agents, venv) must NOT run
55
55
  // as root, so we never sudo the whole command — just this one install.
56
56
  function npmInstallLatest() {
57
- const args = ['install', '-g', '@meridiona/meridian@latest'];
57
+ // Install both packages explicitly — npm won't always upgrade the optional
58
+ // arch package when only the main package is requested.
59
+ const args = ['install', '-g', '@meridiona/meridian@latest', '@meridiona/meridian-darwin-arm64@latest'];
58
60
  if (npmGlobalWritable()) {
59
61
  return spawnSync('npm', args, { stdio: 'inherit' });
60
62
  }
@@ -83,15 +85,34 @@ if (typeof process.getuid === 'function' && process.getuid() === 0) {
83
85
  if (cmd === 'setup' || cmd === 'install') {
84
86
  const bundle = resolveBundle();
85
87
  run('bash', [path.join(bundle, 'scripts', 'meridian-npm-setup.sh'), bundle, ...rest]);
86
- } else if (cmd === 'update') {
87
- console.log('meridian update: downloading latest release…');
88
- console.log(' The package includes a pre-built Python venv (~160 MB).');
89
- console.log(' First update after 1.15.0 will take ~1-3 min; subsequent updates are faster.');
90
- const _updateStart = Date.now();
91
- const up = npmInstallLatest();
92
- if (up.status) process.exit(up.status);
93
- const _elapsed = Math.round((Date.now() - _updateStart) / 1000);
94
- console.log(` Downloaded in ${_elapsed}s`);
88
+ } else if (cmd === 'update' || cmd === '_update-continue') {
89
+ if (cmd === 'update') {
90
+ // Step 1: update the thin launcher only. The current process runs the OLD
91
+ // launcher in memory fixes to also install darwin-arm64 may only be in the
92
+ // NEW launcher on disk. Re-exec the newly installed launcher so step 2 always
93
+ // uses the latest code, even when invoked by an old launcher.
94
+ console.log('meridian update: downloading latest release…');
95
+ console.log(' The package includes a pre-built Python venv (~160 MB).');
96
+ console.log(' First update after 1.15.0 will take ~1-3 min; subsequent updates are faster.');
97
+ const _start = Date.now();
98
+ const up = spawnSync('npm', ['install', '-g', '@meridiona/meridian@latest'], { stdio: 'inherit' });
99
+ if (up.status) process.exit(up.status);
100
+ console.log(` Launcher updated in ${Math.round((Date.now() - _start) / 1000)}s`);
101
+ // Re-exec the freshly installed launcher to continue with the correct code.
102
+ const npmRoot = (spawnSync('npm', ['root', '-g'], { encoding: 'utf8' }).stdout || '').trim();
103
+ const newLauncher = path.join(npmRoot, '@meridiona', 'meridian', 'bin', 'meridian.js');
104
+ if (fs.existsSync(newLauncher)) {
105
+ const r = spawnSync(process.execPath, [newLauncher, '_update-continue'], { stdio: 'inherit' });
106
+ process.exit(r.status ?? 1);
107
+ }
108
+ // Fallback: new launcher not found, continue in this process.
109
+ }
110
+ // Step 2 (runs in new launcher): install bundle + run setup.
111
+ const _bundleStart = Date.now();
112
+ const bup = spawnSync('npm', ['install', '-g', '@meridiona/meridian-darwin-arm64@latest'],
113
+ { stdio: 'inherit', env: { ...process.env } });
114
+ if (bup.status) process.exit(bup.status);
115
+ console.log(` Bundle downloaded in ${Math.round((Date.now() - _bundleStart) / 1000)}s`);
95
116
  const bundle = resolveBundle();
96
117
  run('bash', [path.join(bundle, 'scripts', 'meridian-npm-setup.sh'), bundle, '--skip-permissions']);
97
118
  } else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@meridiona/meridian",
3
- "version": "1.16.0",
3
+ "version": "1.17.1",
4
4
  "description": "Your project management, written by your work — local-first PM automation from real dev activity (macOS, Apple Silicon).",
5
5
  "homepage": "https://github.com/Meridiona/meridian",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "node": ">=18"
25
25
  },
26
26
  "optionalDependencies": {
27
- "@meridiona/meridian-darwin-arm64": "1.16.0"
27
+ "@meridiona/meridian-darwin-arm64": "1.17.1"
28
28
  },
29
29
  "publishConfig": {
30
30
  "access": "public"