@sparkelf/dsh-plus 0.2.9-alpha.81 → 0.2.9-alpha.82
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/LICENSE +21 -0
- package/lib/apply-DycMqLJO.js +852 -0
- package/lib/apply.js +1 -1
- package/lib/bin.js +1 -1
- package/lib/types/apply.js +37 -2
- package/package.json +496 -496
- package/patches/responses-reasoning-status.patch +175 -17
package/lib/apply.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { i as runApply, n as parseOfficialWorkspacePackages, r as resolvePatchPackageNames, t as materializeOfficialPackageScope } from "./apply-
|
|
1
|
+
import { i as runApply, n as parseOfficialWorkspacePackages, r as resolvePatchPackageNames, t as materializeOfficialPackageScope } from "./apply-DycMqLJO.js";
|
|
2
2
|
export { materializeOfficialPackageScope, parseOfficialWorkspacePackages, resolvePatchPackageNames, runApply };
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { a as readPatchSet, i as runApply } from "./apply-
|
|
2
|
+
import { a as readPatchSet, i as runApply } from "./apply-DycMqLJO.js";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { execFileSync, spawn, spawnSync } from "node:child_process";
|
|
5
5
|
import { createWriteStream, existsSync, mkdirSync, readFileSync, readdirSync, realpathSync, renameSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
package/lib/types/apply.js
CHANGED
|
@@ -49,9 +49,44 @@ function requireStringArray(value, label) {
|
|
|
49
49
|
throw new Error(label + ' must not contain duplicates');
|
|
50
50
|
return strings;
|
|
51
51
|
}
|
|
52
|
-
|
|
52
|
+
/**
|
|
53
|
+
* Resolve one installed package's manifest directory.
|
|
54
|
+
*
|
|
55
|
+
* `require.resolve(name + '/package.json')` respects the package's `exports`
|
|
56
|
+
* map, so a dependency that publishes only `"."` — `@sparkelf/dsh-quant`
|
|
57
|
+
* 0.91.0-sparkelf.13 among the `personal` edition's packages — fails to
|
|
58
|
+
* resolve even though the package is installed. Reading a manifest is not a
|
|
59
|
+
* public-export lookup, so resolve the package entry and walk up to the
|
|
60
|
+
* manifest that names it.
|
|
61
|
+
* @param distributionDirectory - directory whose resolution anchors the lookup.
|
|
62
|
+
* @param packageName - dependency name to locate.
|
|
63
|
+
* @returns path of the `package.json` that declares `packageName`.
|
|
64
|
+
*/
|
|
65
|
+
function resolvePackageManifest(distributionDirectory, packageName) {
|
|
53
66
|
const requireFromDistribution = createRequire(resolve(distributionDirectory, 'package.json'));
|
|
54
|
-
|
|
67
|
+
try {
|
|
68
|
+
return requireFromDistribution.resolve(packageName + '/package.json');
|
|
69
|
+
}
|
|
70
|
+
catch {
|
|
71
|
+
// Exports does not carry the subpath; fall through to the entry walk.
|
|
72
|
+
}
|
|
73
|
+
let directory = dirname(requireFromDistribution.resolve(packageName));
|
|
74
|
+
for (;;) {
|
|
75
|
+
const candidate = resolve(directory, 'package.json');
|
|
76
|
+
if (existsSync(candidate)) {
|
|
77
|
+
const names = JSON.parse(readFileSync(candidate, 'utf8'));
|
|
78
|
+
if (names.name === packageName)
|
|
79
|
+
return candidate;
|
|
80
|
+
}
|
|
81
|
+
const parent = dirname(directory);
|
|
82
|
+
if (parent === directory) {
|
|
83
|
+
throw new Error(packageName + ' is installed but no package.json naming it was found');
|
|
84
|
+
}
|
|
85
|
+
directory = parent;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
function resolveInstalledPackage(distributionDirectory, packageName) {
|
|
89
|
+
const manifestPath = resolvePackageManifest(distributionDirectory, packageName);
|
|
55
90
|
const manifest = readJsonObject(manifestPath, packageName + ' manifest');
|
|
56
91
|
return {
|
|
57
92
|
name: packageName,
|