@sagentlab/navarch-runtime 0.1.69 → 0.1.70
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.
|
@@ -60,9 +60,9 @@ async function stageRuntimeUpdate(configDir, directive, runner = defaultRunner)
|
|
|
60
60
|
await runner(process.execPath, [staged.bin_path, "--help"]);
|
|
61
61
|
return staged;
|
|
62
62
|
}
|
|
63
|
-
catch
|
|
64
|
-
|
|
65
|
-
|
|
63
|
+
catch {
|
|
64
|
+
// A missing, partial, or unrunnable earlier staging (for example one that lost its
|
|
65
|
+
// dependencies) is replaced by a fresh, integrity-checked install instead of failing forever.
|
|
66
66
|
await node_fs_1.promises.rm(targetDir, { recursive: true, force: true });
|
|
67
67
|
}
|
|
68
68
|
const stagingDir = node_path_1.default.join(versionsDir, `.staging-${(0, node_crypto_1.randomUUID)()}`);
|
|
@@ -99,6 +99,11 @@ async function stageRuntimeUpdate(configDir, directive, runner = defaultRunner)
|
|
|
99
99
|
const installedPackage = node_path_1.default.join(installDir, "node_modules", "@sagentlab", "navarch-runtime");
|
|
100
100
|
await node_fs_1.promises.writeFile(node_path_1.default.join(installedPackage, ".navarch-integrity"), `${directive.integrity}\n`, { mode: 0o600 });
|
|
101
101
|
await node_fs_1.promises.rename(installedPackage, targetDir);
|
|
102
|
+
// npm hoists dependencies next to the package; carry them along so the moved package can
|
|
103
|
+
// resolve them from its own node_modules.
|
|
104
|
+
const hoistedModules = node_path_1.default.join(installDir, "node_modules");
|
|
105
|
+
await node_fs_1.promises.rm(node_path_1.default.join(hoistedModules, "@sagentlab"), { recursive: true, force: true });
|
|
106
|
+
await node_fs_1.promises.rename(hoistedModules, node_path_1.default.join(targetDir, "node_modules"));
|
|
102
107
|
const staged = await verifyInstalledPackage(targetDir, directive.target_version, directive.integrity);
|
|
103
108
|
await runner(process.execPath, [staged.bin_path, "--help"]);
|
|
104
109
|
return staged;
|
package/package.json
CHANGED