@camstack/system 1.2.2 → 1.2.4
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/addon-runner.js +2 -2
- package/dist/addon-runner.mjs +2 -2
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +6 -2
- package/dist/builtins/device-manager/device-manager.addon.mjs +6 -2
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-DTTTjPCL.mjs → dist-72yufD8v.mjs} +2 -1
- package/dist/{dist-CkdNC8US.js → dist-CQZxGJ8u.js} +2 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +289 -12
- package/dist/index.mjs +286 -14
- package/dist/kernel/deps/ensure-addon-natives.d.ts +41 -0
- package/dist/kernel/deps/ensure-native-prebuilds.d.ts +40 -0
- package/dist/kernel/deps/manifest-native-deps.d.ts +17 -0
- package/dist/{manifest-python-deps-s_-uULmp.mjs → manifest-python-deps-6__QF75g.mjs} +88 -2
- package/dist/{manifest-python-deps-DRq5MreI.js → manifest-python-deps-Cd7ocUBi.js} +93 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-CQZxGJ8u.js");
|
|
3
3
|
let _camstack_types_node = require("@camstack/types/node");
|
|
4
4
|
let node_http = require("node:http");
|
|
5
5
|
let node_fs = require("node:fs");
|
|
@@ -439,6 +439,92 @@ function copyPrebuiltNativeDep(name, addonDir, logger) {
|
|
|
439
439
|
}
|
|
440
440
|
return false;
|
|
441
441
|
}
|
|
442
|
+
/**
|
|
443
|
+
* Native packages the packaged desktop ships PREBUILT inside each bundled addon
|
|
444
|
+
* copy (`scripts/stage-deps.mjs` plants them), keyed to the platform SIBLING
|
|
445
|
+
* scopes that hold the N-API binary. The traditional `better-sqlite3` carries
|
|
446
|
+
* its `.node` in its own dir; `sharp`/`node-av` carry it in a `@img`/`@seydx`
|
|
447
|
+
* sibling.
|
|
448
|
+
*/
|
|
449
|
+
var BUNDLED_NATIVE_SIBLING_SCOPES = {
|
|
450
|
+
"better-sqlite3": [],
|
|
451
|
+
sharp: ["@img"],
|
|
452
|
+
"node-av": ["@seydx"]
|
|
453
|
+
};
|
|
454
|
+
/** Bounded recursive scan for ANY `*.node` under `dir`. */
|
|
455
|
+
function hasAnyDotNode(dir, maxDepth) {
|
|
456
|
+
let entries;
|
|
457
|
+
try {
|
|
458
|
+
entries = node_fs.readdirSync(dir, { withFileTypes: true });
|
|
459
|
+
} catch {
|
|
460
|
+
return false;
|
|
461
|
+
}
|
|
462
|
+
for (const entry of entries) if (entry.isFile() && entry.name.endsWith(".node")) return true;
|
|
463
|
+
if (maxDepth <= 0) return false;
|
|
464
|
+
for (const entry of entries) if (entry.isDirectory() && hasAnyDotNode(node_path.join(dir, entry.name), maxDepth - 1)) return true;
|
|
465
|
+
return false;
|
|
466
|
+
}
|
|
467
|
+
/** Copy `<src>` → `<dst>` when `<src>` carries a `.node`. Best-effort. */
|
|
468
|
+
function copyPrebuiltModuleDir(src, dst, label, logger) {
|
|
469
|
+
if (!hasAnyDotNode(src, 5)) return;
|
|
470
|
+
if (hasAnyDotNode(dst, 5)) return;
|
|
471
|
+
try {
|
|
472
|
+
node_fs.rmSync(dst, {
|
|
473
|
+
recursive: true,
|
|
474
|
+
force: true
|
|
475
|
+
});
|
|
476
|
+
node_fs.mkdirSync(node_path.dirname(dst), { recursive: true });
|
|
477
|
+
node_fs.cpSync(src, dst, {
|
|
478
|
+
recursive: true,
|
|
479
|
+
dereference: true
|
|
480
|
+
});
|
|
481
|
+
logger.info("Prebuilt native module propagated from bundled addon copy", { meta: {
|
|
482
|
+
module: label,
|
|
483
|
+
src,
|
|
484
|
+
dst
|
|
485
|
+
} });
|
|
486
|
+
} catch (err) {
|
|
487
|
+
logger.warn("Prebuilt native module propagation failed (npm install will retry)", { meta: {
|
|
488
|
+
module: label,
|
|
489
|
+
src,
|
|
490
|
+
error: (0, _camstack_types_addon.errMsg)(err)
|
|
491
|
+
} });
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
/**
|
|
495
|
+
* Propagate PREBUILT native modules from a bundled addon copy's own
|
|
496
|
+
* `node_modules` (the packaged-desktop 'local' source at
|
|
497
|
+
* `<resources>/addons/<addon>`) into the freshly-copied target
|
|
498
|
+
* (`<data>/addons/@camstack/<addon>`), BEFORE the target's `npm install` runs.
|
|
499
|
+
*
|
|
500
|
+
* Why (Mac desktop first-boot FATAL, 2026-07-21): `installCopy` copies only
|
|
501
|
+
* `dist/` then `npm install`s the addon's runtime deps. On a toolchain-less Mac
|
|
502
|
+
* that install leaves the traditional native `better-sqlite3` SOURCE-ONLY in
|
|
503
|
+
* `<addon>/node_modules` — a broken copy that then SHADOWS the good hoisted
|
|
504
|
+
* `.node` NODE_PATH would otherwise resolve, crashing the runner with "Could
|
|
505
|
+
* not locate the bindings file". Seeding the prebuilt copy here makes the npm
|
|
506
|
+
* install treat the native as satisfied (no re-run of `prebuild-install`), so
|
|
507
|
+
* the good `.node` stays in place. A no-op in dev / docker where the source
|
|
508
|
+
* carries no bundled natives.
|
|
509
|
+
*/
|
|
510
|
+
function copyBundledNativeModules(sourceDir, targetDir, logger) {
|
|
511
|
+
const srcNm = node_path.join(sourceDir, "node_modules");
|
|
512
|
+
if (!node_fs.existsSync(srcNm)) return;
|
|
513
|
+
const dstNm = node_path.join(targetDir, "node_modules");
|
|
514
|
+
for (const [name, scopes] of Object.entries(BUNDLED_NATIVE_SIBLING_SCOPES)) {
|
|
515
|
+
copyPrebuiltModuleDir(node_path.join(srcNm, name), node_path.join(dstNm, name), name, logger);
|
|
516
|
+
for (const scope of scopes) {
|
|
517
|
+
const scopeSrc = node_path.join(srcNm, scope);
|
|
518
|
+
let siblings;
|
|
519
|
+
try {
|
|
520
|
+
siblings = node_fs.readdirSync(scopeSrc);
|
|
521
|
+
} catch {
|
|
522
|
+
continue;
|
|
523
|
+
}
|
|
524
|
+
for (const sibling of siblings) copyPrebuiltModuleDir(node_path.join(scopeSrc, sibling), node_path.join(dstNm, scope, sibling), `${scope}/${sibling}`, logger);
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
442
528
|
/** A package dir is "built" when it carries a compiled `.node` or a prebuilds tree. */
|
|
443
529
|
function hasBuiltBinary(pkgDir) {
|
|
444
530
|
if (!node_fs.existsSync(node_path.join(pkgDir, "package.json"))) return false;
|
|
@@ -7526,6 +7612,12 @@ Object.defineProperty(exports, "clusterEventTopic", {
|
|
|
7526
7612
|
return clusterEventTopic;
|
|
7527
7613
|
}
|
|
7528
7614
|
});
|
|
7615
|
+
Object.defineProperty(exports, "copyBundledNativeModules", {
|
|
7616
|
+
enumerable: true,
|
|
7617
|
+
get: function() {
|
|
7618
|
+
return copyBundledNativeModules;
|
|
7619
|
+
}
|
|
7620
|
+
});
|
|
7529
7621
|
Object.defineProperty(exports, "createAddonContext", {
|
|
7530
7622
|
enumerable: true,
|
|
7531
7623
|
get: function() {
|