@camstack/server 1.1.69 → 1.1.71
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/dist/core/addon/addon-registry.service.js +26 -17
- package/dist/core/server-update/server-update.service.js +10 -10
- package/dist/launcher.js +13 -0
- package/dist/server-root/index.js +436 -416
- package/dist/starter.js +3 -3
- package/package.json +14 -14
- package/dist/core/addon/system-addons-sync.js +0 -121
package/dist/starter.js
CHANGED
|
@@ -41,9 +41,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
41
41
|
*
|
|
42
42
|
* The boot flow lives in the SHARED node-root core (`runNodeStarter`,
|
|
43
43
|
* bundled into `./server-root/index.js` at build time — see the barrel's
|
|
44
|
-
* BUILD NOTE): workspace defer →
|
|
45
|
-
*
|
|
46
|
-
*
|
|
44
|
+
* BUILD NOTE): workspace defer → apply a staged root swap + migrate the legacy
|
|
45
|
+
* layout to the single `current/` copy → host-external resolver hooks → load
|
|
46
|
+
* the single copy (or the baked seed). This file only binds the hub's names:
|
|
47
47
|
* `@camstack/server`, `dist/launcher.js`, the `CAMSTACK_SERVER_*` env
|
|
48
48
|
* markers and the `CAMSTACK_DATA` data dir.
|
|
49
49
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.71",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"test:watch": "vitest"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@camstack/addon-admin-ui": "1.1.
|
|
27
|
-
"@camstack/addon-advanced-notifier": "1.1.
|
|
28
|
-
"@camstack/addon-auth": "1.1.
|
|
29
|
-
"@camstack/addon-decoder-nodeav": "1.1.
|
|
30
|
-
"@camstack/addon-notifiers": "1.1.
|
|
31
|
-
"@camstack/addon-pipeline": "1.1.
|
|
32
|
-
"@camstack/addon-pipeline-orchestrator": "1.1.
|
|
33
|
-
"@camstack/addon-post-analysis": "1.1.
|
|
34
|
-
"@camstack/sdk": "1.1.
|
|
35
|
-
"@camstack/shm-ring": "1.0.
|
|
36
|
-
"@camstack/system": "1.1.
|
|
37
|
-
"@camstack/types": "1.1.
|
|
38
|
-
"@camstack/ui-library": "1.1.
|
|
26
|
+
"@camstack/addon-admin-ui": "1.1.58",
|
|
27
|
+
"@camstack/addon-advanced-notifier": "1.1.30",
|
|
28
|
+
"@camstack/addon-auth": "1.1.15",
|
|
29
|
+
"@camstack/addon-decoder-nodeav": "1.1.18",
|
|
30
|
+
"@camstack/addon-notifiers": "1.1.30",
|
|
31
|
+
"@camstack/addon-pipeline": "1.1.64",
|
|
32
|
+
"@camstack/addon-pipeline-orchestrator": "1.1.53",
|
|
33
|
+
"@camstack/addon-post-analysis": "1.1.36",
|
|
34
|
+
"@camstack/sdk": "1.1.30",
|
|
35
|
+
"@camstack/shm-ring": "1.0.29",
|
|
36
|
+
"@camstack/system": "1.1.57",
|
|
37
|
+
"@camstack/types": "1.1.51",
|
|
38
|
+
"@camstack/ui-library": "1.1.42",
|
|
39
39
|
"@fastify/compress": "^9.0.0",
|
|
40
40
|
"@fastify/cookie": "^11.0.2",
|
|
41
41
|
"@fastify/multipart": "^10.0.0",
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.isVersionNewer = isVersionNewer;
|
|
37
|
-
exports.syncSystemAddonsCopy = syncSystemAddonsCopy;
|
|
38
|
-
/**
|
|
39
|
-
* system-addons-sync — reconcile the ADDONS-DIR copy of `@camstack/system`
|
|
40
|
-
* with the hub's own (active server-root closure) copy at boot.
|
|
41
|
-
*
|
|
42
|
-
* Builtins are loaded from `CAMSTACK_ADDONS_DIR/@camstack/system` (the addon
|
|
43
|
-
* loader scans only that dir), but NO update channel refreshes that copy on an
|
|
44
|
-
* image hub: the seed-addons stage excludes framework packages, applyServerUpdate
|
|
45
|
-
* swaps only /data/server-root, and `camstack deploy packages/system` is
|
|
46
|
-
* rejected once a release image runs. Live incident 2026-07-17: the snapshot
|
|
47
|
-
* builtin ran system 1.1.49 (no media endpoint) while the active closure
|
|
48
|
-
* carried 1.1.51 — shipped builtin code silently never executed.
|
|
49
|
-
*
|
|
50
|
-
* The sync copies `dist/` + `package.json` from the closure copy over the
|
|
51
|
-
* addons copy when the closure version is NEWER (semver-wise). The addons
|
|
52
|
-
* copy's own `node_modules/` is preserved: third-party deps also resolve via
|
|
53
|
-
* NODE_PATH (the framework dir), and `@camstack/*` deps are host-provided.
|
|
54
|
-
* Staged copy + rename swap so a crash mid-sync never leaves a gutted dist.
|
|
55
|
-
* An addons copy that is newer or equal (dev live-update flow) is left alone.
|
|
56
|
-
*/
|
|
57
|
-
const fs = __importStar(require("node:fs"));
|
|
58
|
-
const path = __importStar(require("node:path"));
|
|
59
|
-
/** Loose semver compare on dotted numeric parts; non-numeric parts compare 0. */
|
|
60
|
-
function isVersionNewer(candidate, current) {
|
|
61
|
-
const a = candidate.split('.').map((p) => Number.parseInt(p, 10) || 0);
|
|
62
|
-
const b = current.split('.').map((p) => Number.parseInt(p, 10) || 0);
|
|
63
|
-
for (let i = 0; i < Math.max(a.length, b.length); i += 1) {
|
|
64
|
-
const d = (a[i] ?? 0) - (b[i] ?? 0);
|
|
65
|
-
if (d !== 0)
|
|
66
|
-
return d > 0;
|
|
67
|
-
}
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
function readVersion(pkgDir) {
|
|
71
|
-
try {
|
|
72
|
-
const raw = JSON.parse(fs.readFileSync(path.join(pkgDir, 'package.json'), 'utf-8'));
|
|
73
|
-
return typeof raw.version === 'string' ? raw.version : null;
|
|
74
|
-
}
|
|
75
|
-
catch {
|
|
76
|
-
return null;
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
/**
|
|
80
|
-
* Reconcile once. Returns what happened (for the caller's log/telemetry).
|
|
81
|
-
* Never throws — a failed sync leaves the previous copy running (same as
|
|
82
|
-
* before this fix existed) and reports `'failed'`.
|
|
83
|
-
*/
|
|
84
|
-
function syncSystemAddonsCopy(input) {
|
|
85
|
-
const { addonsDir, closureSystemDir, log } = input;
|
|
86
|
-
const addonsCopyDir = path.join(addonsDir, '@camstack', 'system');
|
|
87
|
-
if (!fs.existsSync(path.join(addonsCopyDir, 'package.json')))
|
|
88
|
-
return 'absent';
|
|
89
|
-
const closureVersion = readVersion(closureSystemDir);
|
|
90
|
-
const addonsVersion = readVersion(addonsCopyDir);
|
|
91
|
-
if (closureVersion === null || addonsVersion === null)
|
|
92
|
-
return 'failed';
|
|
93
|
-
if (!isVersionNewer(closureVersion, addonsVersion))
|
|
94
|
-
return 'up-to-date';
|
|
95
|
-
try {
|
|
96
|
-
const srcDist = path.join(closureSystemDir, 'dist');
|
|
97
|
-
const nextDist = path.join(addonsCopyDir, `.dist.next-${process.pid}`);
|
|
98
|
-
const oldDist = path.join(addonsCopyDir, `.dist.old-${process.pid}`);
|
|
99
|
-
fs.rmSync(nextDist, { recursive: true, force: true });
|
|
100
|
-
fs.cpSync(srcDist, nextDist, { recursive: true });
|
|
101
|
-
// Swap: rename-aside then rename-in (metadata ops on the same mount).
|
|
102
|
-
fs.rmSync(oldDist, { recursive: true, force: true });
|
|
103
|
-
if (fs.existsSync(path.join(addonsCopyDir, 'dist'))) {
|
|
104
|
-
fs.renameSync(path.join(addonsCopyDir, 'dist'), oldDist);
|
|
105
|
-
}
|
|
106
|
-
fs.renameSync(nextDist, path.join(addonsCopyDir, 'dist'));
|
|
107
|
-
fs.copyFileSync(path.join(closureSystemDir, 'package.json'), path.join(addonsCopyDir, 'package.json'));
|
|
108
|
-
fs.rmSync(oldDist, { recursive: true, force: true });
|
|
109
|
-
log('addons-dir @camstack/system synced from closure', {
|
|
110
|
-
from: addonsVersion,
|
|
111
|
-
to: closureVersion,
|
|
112
|
-
});
|
|
113
|
-
return 'synced';
|
|
114
|
-
}
|
|
115
|
-
catch (err) {
|
|
116
|
-
log('addons-dir @camstack/system sync FAILED — stale builtins keep running', {
|
|
117
|
-
error: err instanceof Error ? err.message : String(err),
|
|
118
|
-
});
|
|
119
|
-
return 'failed';
|
|
120
|
-
}
|
|
121
|
-
}
|