@camstack/server 1.2.307 → 1.2.308

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.
@@ -0,0 +1,59 @@
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.resolveClosureNodeModules = resolveClosureNodeModules;
37
+ /**
38
+ * The directory holding the closure's own copy of each `@camstack` package.
39
+ *
40
+ * The launcher runs from `<root>/node_modules/@camstack/server/dist`. Every
41
+ * addon the server declares is HOISTED to that top-level `node_modules`, not
42
+ * nested under the server package — npm does not create
43
+ * `<server>/node_modules` at all.
44
+ *
45
+ * This existed inline as `path.resolve(__dirname, '..', 'node_modules')`, which
46
+ * is the server package's own directory plus a `node_modules` that is never
47
+ * there. It read as plausible and returned a path that does not exist, so
48
+ * every closure version came back absent: the first-boot plan then computed
49
+ * `twoVersions: false` for everything and printed "8 package(s), 0 to install"
50
+ * on every boot for a month while six addons sat up to nineteen versions
51
+ * behind. A wrong path that answers "nothing" is indistinguishable from a
52
+ * closure that carries nothing, which is why it survived.
53
+ */
54
+ const path = __importStar(require("node:path"));
55
+ /** @param serverDistDir typically `__dirname` of the launcher. */
56
+ function resolveClosureNodeModules(serverDistDir) {
57
+ // dist → server → @camstack → node_modules
58
+ return path.resolve(serverDistDir, '..', '..', '..');
59
+ }
@@ -101,6 +101,17 @@ function formatFirstBootPlan(plan, mode) {
101
101
  const target = d.action === 'install-npm' ? '@latest' : '';
102
102
  lines.push(` ${d.pkg}${target} — ${d.action}: ${d.reason}`);
103
103
  }
104
+ // A closure that carries NOTHING is either a dev layout or a path that does
105
+ // not resolve, and until 2026-09-17 those were indistinguishable: the reader
106
+ // looked one directory up from the server package instead of three, found an
107
+ // empty `node_modules`, and reported `twoVersions: false` for everything. Six
108
+ // addons sat up to nineteen versions behind while this printed "0 to install"
109
+ // and nothing else, every boot, for a month. Silence is what made it survive.
110
+ if (plan.decisions.length > 0 && plan.decisions.every((d) => d.closureVersion === null)) {
111
+ lines.push(` the closure carries NO version for any of the ${plan.decisions.length} package(s) — ` +
112
+ `either this is a dev layout, or the closure path does not resolve (it is ` +
113
+ `<root>/node_modules, NOT <server>/node_modules; see closure-node-modules.ts)`);
114
+ }
104
115
  if (plan.twoVersions.length > 0) {
105
116
  lines.push(` two versions on this node (installed vs this closure's own copy): ${plan.twoVersions.join(', ')} — ` +
106
117
  'INFO: the installed copy is the one that runs');
package/dist/launcher.js CHANGED
@@ -60,6 +60,7 @@ const addon_root_inventory_js_1 = require("./addon-root-inventory.js");
60
60
  const bootstrap_packages_js_1 = require("./bootstrap-packages.js");
61
61
  const first_boot_addon_plan_js_1 = require("./first-boot-addon-plan.js");
62
62
  const addon_realign_plan_js_1 = require("./core/addon/addon-realign-plan.js");
63
+ const closure_node_modules_js_1 = require("./closure-node-modules.js");
63
64
  const framework_nodepath_js_1 = require("./framework-nodepath.js");
64
65
  const package_inventory_js_1 = require("./package-inventory.js");
65
66
  /** Path of the manifest file embedded inside every archive. */
@@ -426,7 +427,7 @@ async function launch() {
426
427
  //
427
428
  // Diagnostics, so it can never end a boot: same policy as the inventories.
428
429
  try {
429
- const closureNodeModules = path.resolve(__dirname, '..', 'node_modules');
430
+ const closureNodeModules = (0, closure_node_modules_js_1.resolveClosureNodeModules)(__dirname);
430
431
  const plan = (0, first_boot_addon_plan_js_1.planFirstBootAddons)({
431
432
  required: bootstrapRequired,
432
433
  installed: readInstalledAddonVersions(addonsDir, bootstrapRequired),
@@ -465,7 +466,7 @@ async function launch() {
465
466
  // re-alignment that throws must never end a boot. An addon that stays behind
466
467
  // is the status quo; a node that will not start is not.
467
468
  try {
468
- const closureNodeModules = path.resolve(__dirname, '..', 'node_modules');
469
+ const closureNodeModules = (0, closure_node_modules_js_1.resolveClosureNodeModules)(__dirname);
469
470
  const decisions = (0, addon_realign_plan_js_1.planAddonRealignment)(bootstrapRequired.flatMap((pkg) => {
470
471
  const installedVersion = readInstalledAddonVersions(addonsDir, [pkg])[pkg];
471
472
  if (typeof installedVersion !== 'string')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/server",
3
- "version": "1.2.307",
3
+ "version": "1.2.308",
4
4
  "private": false,
5
5
  "files": [
6
6
  "dist",