@sparkelf/dsh-plus 0.2.9-alpha.54 → 0.2.9-alpha.55
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/lib/{apply-B7DcTB5T.js → apply-DpmD0ljp.js} +28 -2
- package/lib/apply.js +2 -2
- package/lib/bin.js +1 -1
- package/lib/types/apply.d.ts +10 -0
- package/lib/types/apply.js +36 -1
- package/package.json +1 -1
|
@@ -156,6 +156,32 @@ function requireSourceBase(root, baseRevision) {
|
|
|
156
156
|
if (checkoutRevision !== baseRevision) throw new Error("DSH checkout must be exact official base " + baseRevision + ", found " + checkoutRevision);
|
|
157
157
|
return checkoutRevision;
|
|
158
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Names of the packages that carry `dshPatch` variants.
|
|
161
|
+
*
|
|
162
|
+
* The distribution moved from a flat `dshPlus.patchPackages` list to `dshPlus.patchSet`, whose
|
|
163
|
+
* entries name their target packages per patch. Older tarballs still carry the flat list, so it
|
|
164
|
+
* wins when present; otherwise the union of every entry's `target.packages` is used.
|
|
165
|
+
*
|
|
166
|
+
* @param plus - Parsed `dshPlus` block of the distribution manifest.
|
|
167
|
+
*/
|
|
168
|
+
function resolvePatchPackageNames(plus) {
|
|
169
|
+
const declared = plus.patchPackages;
|
|
170
|
+
if (declared !== void 0) {
|
|
171
|
+
const names = requireStringArray(declared, "dshPlus.patchPackages");
|
|
172
|
+
if (names.length > 0) return names;
|
|
173
|
+
}
|
|
174
|
+
const entries = requireObject(plus.patchSet, "dshPlus.patchSet").entries;
|
|
175
|
+
if (!Array.isArray(entries) || entries.length === 0) throw new Error("dshPlus.patchSet.entries must be a non-empty array");
|
|
176
|
+
const names = /* @__PURE__ */ new Set();
|
|
177
|
+
for (const [index, value] of entries.entries()) {
|
|
178
|
+
const target = requireObject(requireObject(value, "dshPlus.patchSet.entries[" + String(index) + "]").target, "dshPlus.patchSet.entries[" + String(index) + "].target");
|
|
179
|
+
if (!Array.isArray(target.packages)) continue;
|
|
180
|
+
for (const name of requireStringArray(target.packages, "dshPlus.patchSet.entries[" + String(index) + "].target.packages")) names.add(name);
|
|
181
|
+
}
|
|
182
|
+
if (names.size === 0) throw new Error("dshPlus.patchSet must name at least one patch package");
|
|
183
|
+
return [...names].sort();
|
|
184
|
+
}
|
|
159
185
|
function patchPackageVariants(distributionDirectory, names) {
|
|
160
186
|
const variants = [];
|
|
161
187
|
for (const name of names) {
|
|
@@ -186,7 +212,7 @@ function prepareSelection(distributionDirectory, profileDirectory, dshRoot) {
|
|
|
186
212
|
if (typeof allowed !== "boolean") throw new Error("dshPlus.profile.allowBuilds." + name + " must be a boolean");
|
|
187
213
|
allowBuilds[name] = allowed;
|
|
188
214
|
}
|
|
189
|
-
const patchPackageNames =
|
|
215
|
+
const patchPackageNames = resolvePatchPackageNames(plus);
|
|
190
216
|
const dependencies = requireObject(distributionManifest.dependencies, "Plus distribution dependencies");
|
|
191
217
|
const dshVersion = requireVersion(readJsonObject(resolve(dshRoot, "package.json"), "DSH source manifest").version, "DSH source version");
|
|
192
218
|
if (!satisfies(dshVersion, dshRange, { includePrerelease: true })) throw new Error(distributionName + "@" + distributionVersion + " requires DSH " + dshRange + ", found " + dshVersion);
|
|
@@ -639,4 +665,4 @@ function runApply(argv) {
|
|
|
639
665
|
process.stdout.write("[dsh-plus] applied " + String(selection.patches.length) + " patches; lock " + lock + "\n");
|
|
640
666
|
}
|
|
641
667
|
//#endregion
|
|
642
|
-
export { parseOfficialWorkspacePackages as n,
|
|
668
|
+
export { runApply as i, parseOfficialWorkspacePackages as n, resolvePatchPackageNames as r, materializeOfficialPackageScope as t };
|
package/lib/apply.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as parseOfficialWorkspacePackages, r as
|
|
2
|
-
export { materializeOfficialPackageScope, parseOfficialWorkspacePackages, runApply };
|
|
1
|
+
import { i as runApply, n as parseOfficialWorkspacePackages, r as resolvePatchPackageNames, t as materializeOfficialPackageScope } from "./apply-DpmD0ljp.js";
|
|
2
|
+
export { materializeOfficialPackageScope, parseOfficialWorkspacePackages, resolvePatchPackageNames, runApply };
|
package/lib/bin.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { i as runApply } from "./apply-DpmD0ljp.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.d.ts
CHANGED
|
@@ -4,6 +4,16 @@ export interface OfficialWorkspacePackage {
|
|
|
4
4
|
name: string;
|
|
5
5
|
directory: string;
|
|
6
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Names of the packages that carry `dshPatch` variants.
|
|
9
|
+
*
|
|
10
|
+
* The distribution moved from a flat `dshPlus.patchPackages` list to `dshPlus.patchSet`, whose
|
|
11
|
+
* entries name their target packages per patch. Older tarballs still carry the flat list, so it
|
|
12
|
+
* wins when present; otherwise the union of every entry's `target.packages` is used.
|
|
13
|
+
*
|
|
14
|
+
* @param plus - Parsed `dshPlus` block of the distribution manifest.
|
|
15
|
+
*/
|
|
16
|
+
export declare function resolvePatchPackageNames(plus: Record<string, unknown>): string[];
|
|
7
17
|
/**
|
|
8
18
|
* Parse pnpm's workspace roster into exact official package directories.
|
|
9
19
|
* @param dshRoot - exact official DSH checkout root.
|
package/lib/types/apply.js
CHANGED
|
@@ -148,6 +148,41 @@ function requireSourceBase(root, baseRevision) {
|
|
|
148
148
|
}
|
|
149
149
|
return checkoutRevision;
|
|
150
150
|
}
|
|
151
|
+
/**
|
|
152
|
+
* Names of the packages that carry `dshPatch` variants.
|
|
153
|
+
*
|
|
154
|
+
* The distribution moved from a flat `dshPlus.patchPackages` list to `dshPlus.patchSet`, whose
|
|
155
|
+
* entries name their target packages per patch. Older tarballs still carry the flat list, so it
|
|
156
|
+
* wins when present; otherwise the union of every entry's `target.packages` is used.
|
|
157
|
+
*
|
|
158
|
+
* @param plus - Parsed `dshPlus` block of the distribution manifest.
|
|
159
|
+
*/
|
|
160
|
+
export function resolvePatchPackageNames(plus) {
|
|
161
|
+
const declared = plus.patchPackages;
|
|
162
|
+
if (declared !== undefined) {
|
|
163
|
+
const names = requireStringArray(declared, 'dshPlus.patchPackages');
|
|
164
|
+
if (names.length > 0)
|
|
165
|
+
return names;
|
|
166
|
+
}
|
|
167
|
+
const patchSet = requireObject(plus.patchSet, 'dshPlus.patchSet');
|
|
168
|
+
const entries = patchSet.entries;
|
|
169
|
+
if (!Array.isArray(entries) || entries.length === 0) {
|
|
170
|
+
throw new Error('dshPlus.patchSet.entries must be a non-empty array');
|
|
171
|
+
}
|
|
172
|
+
const names = new Set();
|
|
173
|
+
for (const [index, value] of entries.entries()) {
|
|
174
|
+
const entry = requireObject(value, 'dshPlus.patchSet.entries[' + String(index) + ']');
|
|
175
|
+
const target = requireObject(entry.target, 'dshPlus.patchSet.entries[' + String(index) + '].target');
|
|
176
|
+
if (!Array.isArray(target.packages))
|
|
177
|
+
continue;
|
|
178
|
+
for (const name of requireStringArray(target.packages, 'dshPlus.patchSet.entries[' + String(index) + '].target.packages')) {
|
|
179
|
+
names.add(name);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (names.size === 0)
|
|
183
|
+
throw new Error('dshPlus.patchSet must name at least one patch package');
|
|
184
|
+
return [...names].sort();
|
|
185
|
+
}
|
|
151
186
|
function patchPackageVariants(distributionDirectory, names) {
|
|
152
187
|
const variants = [];
|
|
153
188
|
for (const name of names) {
|
|
@@ -192,7 +227,7 @@ function prepareSelection(distributionDirectory, profileDirectory, dshRoot) {
|
|
|
192
227
|
throw new Error('dshPlus.profile.allowBuilds.' + name + ' must be a boolean');
|
|
193
228
|
allowBuilds[name] = allowed;
|
|
194
229
|
}
|
|
195
|
-
const patchPackageNames =
|
|
230
|
+
const patchPackageNames = resolvePatchPackageNames(plus);
|
|
196
231
|
const dependencies = requireObject(distributionManifest.dependencies, 'Plus distribution dependencies');
|
|
197
232
|
const dshManifest = readJsonObject(resolve(dshRoot, 'package.json'), 'DSH source manifest');
|
|
198
233
|
const dshVersion = requireVersion(dshManifest.version, 'DSH source version');
|
package/package.json
CHANGED