erne-universal 0.13.0 → 0.13.2

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 (3) hide show
  1. package/README.md +6 -6
  2. package/lib/update.js +39 -41
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -268,12 +268,12 @@ Change profile: set `ERNE_PROFILE` env var, add `<!-- Hook Profile: standard -->
268
268
 
269
269
  ## ⚡ Commands
270
270
 
271
- | Category | Commands |
272
- | ----------------- | ---------------------------------------------------------------------------------------------------------------------- |
273
- | **Core** | `/plan`, `/code-review`, `/tdd`, `/build-fix`, `/perf`, `/upgrade`, `/native-module`, `/navigate`, `/code`, `/feature` |
274
- | **Extended** | `/animate`, `/deploy`, `/component`, `/debug`, `/debug-visual`, `/debug-video`, `/quality-gate` |
275
- | **Orchestration** | `/orchestrate`, `/worker` |
276
- | **Learning** | `/learn`, `/retrospective`, `/setup-device` |
271
+ | Category | Commands |
272
+ | ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
273
+ | **Core** | `/erne-plan`, `/erne-code-review`, `/erne-tdd`, `/erne-build-fix`, `/erne-perf`, `/erne-upgrade`, `/erne-native-module`, `/erne-navigate`, `/erne-code`, `/erne-feature` |
274
+ | **Extended** | `/erne-animate`, `/erne-deploy`, `/erne-component`, `/erne-debug`, `/erne-debug-visual`, `/erne-debug-video`, `/erne-quality-gate` |
275
+ | **Orchestration** | `/erne-orchestrate`, `/erne-worker` |
276
+ | **Maintenance** | `/erne-update`, `/erne-learn`, `/erne-retrospective`, `/erne-setup-device` |
277
277
 
278
278
  ---
279
279
 
package/lib/update.js CHANGED
@@ -1,75 +1,73 @@
1
1
  // lib/update.js — Update ERNE to latest version
2
- // Usage: npx erne-universal update
2
+ // Usage: erne update
3
3
 
4
4
  'use strict';
5
5
 
6
- const { execSync, execFileSync } = require('child_process');
6
+ const { execSync } = require('child_process');
7
7
  const fs = require('fs');
8
8
  const path = require('path');
9
-
10
- const SEMVER_RE = /^\d+\.\d+\.\d+(-[\w.]+)?$/;
9
+ const os = require('os');
11
10
 
12
11
  module.exports = async function update() {
13
12
  const cwd = process.cwd();
14
- const claudeDir = path.join(cwd, '.claude');
15
- const settingsPath = path.join(claudeDir, 'settings.json');
13
+ const localVersion = require('../package.json').version;
16
14
 
17
15
  console.log('\n erne — Checking for updates...\n');
18
-
19
- // Check if ERNE is installed in this project
20
- if (!fs.existsSync(settingsPath)) {
21
- console.log(' ⚠ ERNE not found in this project.');
22
- console.log(' Run "erne init" to set up.');
23
- return;
24
- }
25
-
26
- const settings = JSON.parse(fs.readFileSync(settingsPath, 'utf8'));
27
- console.log(` Current version: ${settings.erneVersion}`);
16
+ console.log(` Installed version: ${localVersion}`);
28
17
 
29
18
  // Fetch latest version from npm
30
19
  let latestVersion;
31
20
  try {
32
- latestVersion = execSync('npm view erne-universal version', { encoding: 'utf8' }).trim();
21
+ latestVersion = execSync('npm view erne-universal version', {
22
+ encoding: 'utf8',
23
+ timeout: 10000,
24
+ }).trim();
33
25
  } catch {
34
- console.log(' Could not check npm for latest version.');
35
- console.log(' Check https://erne.dev for updates.');
26
+ console.log(' \u26A0 Could not check npm for latest version.');
36
27
  return;
37
28
  }
38
29
 
39
- console.log(` Latest version: ${latestVersion}`);
30
+ console.log(` Latest version: ${latestVersion}`);
40
31
 
41
- if (settings.erneVersion === latestVersion) {
42
- console.log('\n Already up to date!\n');
32
+ if (localVersion === latestVersion) {
33
+ console.log('\n \u2713 Already up to date!\n');
43
34
  return;
44
35
  }
45
36
 
46
- if (!SEMVER_RE.test(latestVersion)) {
47
- console.error(` Invalid version format: ${latestVersion}`);
48
- return;
49
- }
50
-
51
- console.log(`\n Updating ${settings.erneVersion} → ${latestVersion}...`);
52
-
53
- // Write upgrade marker so session-start hook can announce the upgrade
37
+ // Write upgrade marker for session-start notification
54
38
  try {
55
- const os = require('os');
56
39
  const stateDir = path.join(os.homedir(), '.erne');
57
40
  if (!fs.existsSync(stateDir)) fs.mkdirSync(stateDir, { recursive: true });
58
- fs.writeFileSync(path.join(stateDir, 'just-upgraded-from'), settings.erneVersion);
41
+ fs.writeFileSync(path.join(stateDir, 'just-upgraded-from'), localVersion);
59
42
  } catch { /* non-critical */ }
60
43
 
61
- // Re-run init with preserved settings
62
- // The init command detects existing settings and preserves user choices
63
- console.log(' Running: npx erne-universal@latest init');
64
- console.log(' Your profile and MCP selections will be preserved.\n');
65
-
44
+ // Update the global package
45
+ console.log(`\n Updating ${localVersion} \u2192 ${latestVersion}...`);
66
46
  try {
67
- execFileSync('npx', [`erne-universal@${latestVersion}`, 'init'], {
47
+ execSync(`npm i -g erne-universal@${latestVersion}`, {
68
48
  stdio: 'inherit',
69
- cwd,
49
+ timeout: 60000,
70
50
  });
51
+ console.log(`\n \u2713 erne-universal updated to ${latestVersion}`);
71
52
  } catch (err) {
72
- console.error(' Update failed:', err.message);
73
- console.error(' Manual update: npm i -g erne-universal@latest && erne init');
53
+ console.error(`\n Update failed: ${err.message}`);
54
+ console.error(' Try manually: npm i -g erne-universal@latest');
55
+ return;
56
+ }
57
+
58
+ // If this project has ERNE initialized, re-run init to update local config
59
+ const settingsPath = path.join(cwd, '.claude', 'settings.json');
60
+ if (fs.existsSync(settingsPath)) {
61
+ console.log('\n Updating project configuration...');
62
+ try {
63
+ execSync('erne init', {
64
+ stdio: 'inherit',
65
+ cwd,
66
+ });
67
+ } catch {
68
+ console.log(' \u26A0 Project re-init skipped. Run "erne init" manually to update config.');
69
+ }
70
+ } else {
71
+ console.log('\n No ERNE project in current directory. Run "erne init" in a project to set up.');
74
72
  }
75
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "erne-universal",
3
- "version": "0.13.0",
3
+ "version": "0.13.2",
4
4
  "description": "Complete AI coding agent harness for React Native and Expo \u2014 13 specialized agents, autonomous worker mode, visual debugging, smart routing",
5
5
  "keywords": [
6
6
  "react-native",