@savvy-web/silk 3.2.9 → 3.3.0
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/changesets-changelog.cjs +976 -692
- package/changesets-changelog.d.cts +313 -106
- package/changesets-changelog.d.ts +313 -106
- package/changesets-changelog.js +993 -709
- package/changesets-markdownlint.cjs +976 -692
- package/changesets-markdownlint.d.cts +313 -106
- package/changesets-markdownlint.d.ts +313 -106
- package/changesets-markdownlint.js +993 -709
- package/lint.d.ts +2 -2
- package/lint.js +2 -2
- package/package.json +6 -6
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
package/changesets-changelog.js
CHANGED
|
@@ -21,7 +21,7 @@ import Range from "semver/classes/range.js";
|
|
|
21
21
|
import { spawn } from "node:child_process";
|
|
22
22
|
import { pipeline } from "node:stream/promises";
|
|
23
23
|
import { PassThrough } from "node:stream";
|
|
24
|
-
import * as
|
|
24
|
+
import * as readline from "node:readline";
|
|
25
25
|
import * as assert from "node:assert";
|
|
26
26
|
import * as v8 from "node:v8";
|
|
27
27
|
import validRange from "semver/ranges/valid.js";
|
|
@@ -66,7 +66,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
66
66
|
}
|
|
67
67
|
return to;
|
|
68
68
|
};
|
|
69
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp$1(target, "default", {
|
|
69
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp$1(target, "default", {
|
|
70
70
|
value: mod,
|
|
71
71
|
enumerable: true
|
|
72
72
|
}) : target, mod));
|
|
@@ -214,7 +214,7 @@ function isSilkChangelog(changelog) {
|
|
|
214
214
|
* const reader = yield* ChangesetConfigReader;
|
|
215
215
|
* return yield* reader.read(process.cwd());
|
|
216
216
|
* }).pipe(
|
|
217
|
-
* Effect.provide(
|
|
217
|
+
* Effect.provide(ChangesetConfigReader.layer),
|
|
218
218
|
* Effect.provide(NodeServices.layer),
|
|
219
219
|
* )
|
|
220
220
|
* );
|
|
@@ -223,64 +223,65 @@ function isSilkChangelog(changelog) {
|
|
|
223
223
|
* @since 0.1.0
|
|
224
224
|
* @public
|
|
225
225
|
*/
|
|
226
|
-
var ChangesetConfigReader = class extends Context.Service()("@savvy-web/silk-effects/ChangesetConfigReader") {
|
|
227
|
-
/**
|
|
228
|
-
*
|
|
229
|
-
*
|
|
230
|
-
* @remarks
|
|
231
|
-
* Requires the core `FileSystem` service. Provide `NodeServices.layer` (or
|
|
232
|
-
* `NodeFileSystem.layer`) from `@effect/platform-node` to satisfy this dependency.
|
|
233
|
-
*
|
|
234
|
-
* @since 0.1.0
|
|
235
|
-
* @public
|
|
236
|
-
*/
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
path: configPath,
|
|
250
|
-
reason: "File not found"
|
|
251
|
-
}));
|
|
252
|
-
const raw = yield* fs.readFileString(configPath).pipe(Effect.mapError(
|
|
253
|
-
/* v8 ignore next 4 -- error path requires fs.readFileString to fail */
|
|
254
|
-
(cause) => new ChangesetConfigError({
|
|
255
|
-
path: configPath,
|
|
256
|
-
reason: String(cause)
|
|
257
|
-
})
|
|
258
|
-
));
|
|
259
|
-
const parsed = yield* Effect.try({
|
|
260
|
-
try: () => JSON.parse(raw),
|
|
261
|
-
catch: (cause) => new ChangesetConfigError({
|
|
226
|
+
var ChangesetConfigReader = class extends Context.Service()("@savvy-web/silk-effects/ChangesetConfigReader") {
|
|
227
|
+
/**
|
|
228
|
+
* Production implementation of {@link ChangesetConfigReader}.
|
|
229
|
+
*
|
|
230
|
+
* @remarks
|
|
231
|
+
* Requires the core `FileSystem` service. Provide `NodeServices.layer` (or
|
|
232
|
+
* `NodeFileSystem.layer`) from `@effect/platform-node` to satisfy this dependency.
|
|
233
|
+
*
|
|
234
|
+
* @since 0.1.0
|
|
235
|
+
* @public
|
|
236
|
+
*/
|
|
237
|
+
static layer = Layer.effect(this, Effect.gen(function* () {
|
|
238
|
+
const fs = yield* FileSystem.FileSystem;
|
|
239
|
+
const read = (root) => {
|
|
240
|
+
const configPath = `${root}/.changeset/config.json`;
|
|
241
|
+
return Effect.gen(function* () {
|
|
242
|
+
if (!(yield* fs.exists(configPath).pipe(Effect.mapError(
|
|
243
|
+
/* v8 ignore next 4 -- error path requires fs.exists to fail */
|
|
244
|
+
(cause) => new ChangesetConfigError({
|
|
245
|
+
path: configPath,
|
|
246
|
+
reason: String(cause)
|
|
247
|
+
})
|
|
248
|
+
)))) return yield* Effect.fail(new ChangesetConfigError({
|
|
262
249
|
path: configPath,
|
|
263
|
-
reason:
|
|
264
|
-
})
|
|
250
|
+
reason: "File not found"
|
|
251
|
+
}));
|
|
252
|
+
const raw = yield* fs.readFileString(configPath).pipe(Effect.mapError(
|
|
253
|
+
/* v8 ignore next 4 -- error path requires fs.readFileString to fail */
|
|
254
|
+
(cause) => new ChangesetConfigError({
|
|
255
|
+
path: configPath,
|
|
256
|
+
reason: String(cause)
|
|
257
|
+
})
|
|
258
|
+
));
|
|
259
|
+
const parsed = yield* Effect.try({
|
|
260
|
+
try: () => JSON.parse(raw),
|
|
261
|
+
catch: (cause) => new ChangesetConfigError({
|
|
262
|
+
path: configPath,
|
|
263
|
+
reason: `Invalid JSON: ${String(cause)}`
|
|
264
|
+
})
|
|
265
|
+
});
|
|
266
|
+
if (isSilkChangelog(parsed.changelog)) return yield* Schema.decodeUnknownEffect(SilkChangesetConfigFile)(parsed).pipe(Effect.mapError(
|
|
267
|
+
/* v8 ignore next 4 -- error path requires schema decode failure */
|
|
268
|
+
(cause) => new ChangesetConfigError({
|
|
269
|
+
path: configPath,
|
|
270
|
+
reason: `Schema decode failed: ${String(cause)}`
|
|
271
|
+
})
|
|
272
|
+
));
|
|
273
|
+
return yield* Schema.decodeUnknownEffect(ChangesetConfigFile)(parsed).pipe(Effect.mapError(
|
|
274
|
+
/* v8 ignore next 4 -- error path requires schema decode failure */
|
|
275
|
+
(cause) => new ChangesetConfigError({
|
|
276
|
+
path: configPath,
|
|
277
|
+
reason: `Schema decode failed: ${String(cause)}`
|
|
278
|
+
})
|
|
279
|
+
));
|
|
265
280
|
});
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
reason: `Schema decode failed: ${String(cause)}`
|
|
271
|
-
})
|
|
272
|
-
));
|
|
273
|
-
return yield* Schema.decodeUnknownEffect(ChangesetConfigFile)(parsed).pipe(Effect.mapError(
|
|
274
|
-
/* v8 ignore next 4 -- error path requires schema decode failure */
|
|
275
|
-
(cause) => new ChangesetConfigError({
|
|
276
|
-
path: configPath,
|
|
277
|
-
reason: `Schema decode failed: ${String(cause)}`
|
|
278
|
-
})
|
|
279
|
-
));
|
|
280
|
-
});
|
|
281
|
-
};
|
|
282
|
-
return { read };
|
|
283
|
-
}));
|
|
281
|
+
};
|
|
282
|
+
return { read };
|
|
283
|
+
}));
|
|
284
|
+
};
|
|
284
285
|
|
|
285
286
|
//#endregion
|
|
286
287
|
//#region ../silk-effects/dist/dev/pkg/errors/PublishTargetBindingError.js
|
|
@@ -311,6 +312,7 @@ var PublishTargetBindingError = class extends Data.TaggedError("PublishTargetBin
|
|
|
311
312
|
|
|
312
313
|
//#endregion
|
|
313
314
|
//#region ../silk-effects/dist/dev/pkg/services/ChangesetConfig.js
|
|
315
|
+
const isSilk = (cfg) => "_isSilk" in cfg && cfg._isSilk === true;
|
|
314
316
|
/**
|
|
315
317
|
* Accessor service over a workspace root's `.changeset/config.json`.
|
|
316
318
|
*
|
|
@@ -322,7 +324,7 @@ var PublishTargetBindingError = class extends Data.TaggedError("PublishTargetBin
|
|
|
322
324
|
* @since 0.4.0
|
|
323
325
|
* @public
|
|
324
326
|
*/
|
|
325
|
-
var ChangesetConfig = class extends Context.Service()("@savvy-web/silk-effects/ChangesetConfig") {
|
|
327
|
+
var ChangesetConfig = class ChangesetConfig extends Context.Service()("@savvy-web/silk-effects/ChangesetConfig") {
|
|
326
328
|
/**
|
|
327
329
|
* The one ignore matcher: exact name match, or `@scope/*` wildcard.
|
|
328
330
|
*
|
|
@@ -336,55 +338,54 @@ var ChangesetConfig = class extends Context.Service()("@savvy-web/silk-effects/C
|
|
|
336
338
|
}
|
|
337
339
|
return name === pattern;
|
|
338
340
|
}
|
|
341
|
+
/**
|
|
342
|
+
* Production layer for {@link ChangesetConfig}, reading via {@link ChangesetConfigReader}, cached per root.
|
|
343
|
+
*
|
|
344
|
+
* @remarks
|
|
345
|
+
* Requires `ChangesetConfigReader` (which requires `FileSystem`). Provide
|
|
346
|
+
* `ChangesetConfigReader.layer` + a platform layer (`NodeServices.layer`).
|
|
347
|
+
*
|
|
348
|
+
* @since 0.4.0
|
|
349
|
+
* @public
|
|
350
|
+
*/
|
|
351
|
+
static layer = Layer.effect(this, Effect.gen(function* () {
|
|
352
|
+
const reader = yield* ChangesetConfigReader;
|
|
353
|
+
const cache = /* @__PURE__ */ new Map();
|
|
354
|
+
const read = (root) => Effect.gen(function* () {
|
|
355
|
+
const hit = cache.get(root);
|
|
356
|
+
if (hit !== void 0) return hit;
|
|
357
|
+
const result = yield* reader.read(root).pipe(Effect.option);
|
|
358
|
+
cache.set(root, result);
|
|
359
|
+
return result;
|
|
360
|
+
});
|
|
361
|
+
return {
|
|
362
|
+
mode: (root) => read(root).pipe(Effect.map(Option.match({
|
|
363
|
+
onNone: () => "none",
|
|
364
|
+
onSome: (cfg) => isSilk(cfg) ? "silk" : "vanilla"
|
|
365
|
+
}))),
|
|
366
|
+
versionPrivate: (root) => read(root).pipe(Effect.map(Option.match({
|
|
367
|
+
onNone: () => false,
|
|
368
|
+
onSome: (cfg) => {
|
|
369
|
+
const pp = cfg.privatePackages;
|
|
370
|
+
return pp !== void 0 && pp !== false && pp.version === true;
|
|
371
|
+
}
|
|
372
|
+
}))),
|
|
373
|
+
ignorePatterns: (root) => read(root).pipe(Effect.map(Option.match({
|
|
374
|
+
onNone: () => [],
|
|
375
|
+
onSome: (cfg) => cfg.ignore ?? []
|
|
376
|
+
}))),
|
|
377
|
+
isIgnored: (name, root) => read(root).pipe(Effect.map(Option.match({
|
|
378
|
+
onNone: () => false,
|
|
379
|
+
onSome: (cfg) => (cfg.ignore ?? []).some((p) => ChangesetConfig.matches(name, p))
|
|
380
|
+
}))),
|
|
381
|
+
fixed: (root) => read(root).pipe(Effect.map(Option.match({
|
|
382
|
+
onNone: () => [],
|
|
383
|
+
onSome: (cfg) => cfg.fixed ?? []
|
|
384
|
+
}))),
|
|
385
|
+
refresh: () => Effect.sync(() => cache.clear())
|
|
386
|
+
};
|
|
387
|
+
}));
|
|
339
388
|
};
|
|
340
|
-
const isSilk = (cfg) => "_isSilk" in cfg && cfg._isSilk === true;
|
|
341
|
-
/**
|
|
342
|
-
* Live {@link ChangesetConfig} reading via {@link ChangesetConfigReader}, cached per root.
|
|
343
|
-
*
|
|
344
|
-
* @remarks
|
|
345
|
-
* Requires `ChangesetConfigReader` (which requires `FileSystem`). Provide
|
|
346
|
-
* `ChangesetConfigReaderLive` + a platform layer (`NodeServices.layer`).
|
|
347
|
-
*
|
|
348
|
-
* @since 0.4.0
|
|
349
|
-
* @public
|
|
350
|
-
*/
|
|
351
|
-
const ChangesetConfigLive = Layer.effect(ChangesetConfig, Effect.gen(function* () {
|
|
352
|
-
const reader = yield* ChangesetConfigReader;
|
|
353
|
-
const cache = /* @__PURE__ */ new Map();
|
|
354
|
-
const read = (root) => Effect.gen(function* () {
|
|
355
|
-
const hit = cache.get(root);
|
|
356
|
-
if (hit !== void 0) return hit;
|
|
357
|
-
const result = yield* reader.read(root).pipe(Effect.option);
|
|
358
|
-
cache.set(root, result);
|
|
359
|
-
return result;
|
|
360
|
-
});
|
|
361
|
-
return {
|
|
362
|
-
mode: (root) => read(root).pipe(Effect.map(Option.match({
|
|
363
|
-
onNone: () => "none",
|
|
364
|
-
onSome: (cfg) => isSilk(cfg) ? "silk" : "vanilla"
|
|
365
|
-
}))),
|
|
366
|
-
versionPrivate: (root) => read(root).pipe(Effect.map(Option.match({
|
|
367
|
-
onNone: () => false,
|
|
368
|
-
onSome: (cfg) => {
|
|
369
|
-
const pp = cfg.privatePackages;
|
|
370
|
-
return pp !== void 0 && pp !== false && pp.version === true;
|
|
371
|
-
}
|
|
372
|
-
}))),
|
|
373
|
-
ignorePatterns: (root) => read(root).pipe(Effect.map(Option.match({
|
|
374
|
-
onNone: () => [],
|
|
375
|
-
onSome: (cfg) => cfg.ignore ?? []
|
|
376
|
-
}))),
|
|
377
|
-
isIgnored: (name, root) => read(root).pipe(Effect.map(Option.match({
|
|
378
|
-
onNone: () => false,
|
|
379
|
-
onSome: (cfg) => (cfg.ignore ?? []).some((p) => ChangesetConfig.matches(name, p))
|
|
380
|
-
}))),
|
|
381
|
-
fixed: (root) => read(root).pipe(Effect.map(Option.match({
|
|
382
|
-
onNone: () => [],
|
|
383
|
-
onSome: (cfg) => cfg.fixed ?? []
|
|
384
|
-
}))),
|
|
385
|
-
refresh: () => Effect.sync(() => cache.clear())
|
|
386
|
-
};
|
|
387
|
-
}));
|
|
388
389
|
|
|
389
390
|
//#endregion
|
|
390
391
|
//#region ../silk-effects/dist/dev/pkg/utils/TrailingSlash.js
|
|
@@ -406,7 +407,7 @@ const trimTrailingSlashes = (s) => {
|
|
|
406
407
|
//#endregion
|
|
407
408
|
//#region ../../node_modules/.pnpm/@effected+glob@0.2.1_effect@4.0.0-beta.101/node_modules/@effected/glob/internal/limits.js
|
|
408
409
|
/** Hard cap on pattern length. Upstream minimatch's MAX_PATTERN_LENGTH (64KB). */
|
|
409
|
-
const MAX_PATTERN_LENGTH =
|
|
410
|
+
const MAX_PATTERN_LENGTH = 65536;
|
|
410
411
|
/** Default brace-expansion output budget. Upstream brace-expansion's EXPANSION_MAX. */
|
|
411
412
|
const EXPANSION_MAX = 1e5;
|
|
412
413
|
/**
|
|
@@ -2350,7 +2351,7 @@ var GlobSet = class GlobSet extends Schema.Class("GlobSet")(Schema.Struct({ patt
|
|
|
2350
2351
|
};
|
|
2351
2352
|
|
|
2352
2353
|
//#endregion
|
|
2353
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
2354
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/BunExtension.js
|
|
2354
2355
|
/**
|
|
2355
2356
|
* Extension data specific to bun lockfiles, attached to `Lockfile.extension`
|
|
2356
2357
|
* when the format is `"bun"`.
|
|
@@ -2372,7 +2373,7 @@ var BunExtension = class extends Schema.Class("BunExtension")({
|
|
|
2372
2373
|
}) {};
|
|
2373
2374
|
|
|
2374
2375
|
//#endregion
|
|
2375
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2376
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.0_@effected+semver@0.3.0_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogResolver.js
|
|
2376
2377
|
/**
|
|
2377
2378
|
* Contract for resolving pnpm `catalog:` dependency specifiers to concrete
|
|
2378
2379
|
* version ranges.
|
|
@@ -2419,7 +2420,7 @@ var CatalogResolver = class CatalogResolver extends Context.Service()("@effected
|
|
|
2419
2420
|
};
|
|
2420
2421
|
|
|
2421
2422
|
//#endregion
|
|
2422
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2423
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.0_@effected+semver@0.3.0_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/WorkspaceResolver.js
|
|
2423
2424
|
/**
|
|
2424
2425
|
* Raised when a `catalog:` or `workspace:` specifier cannot be resolved
|
|
2425
2426
|
* because the resolution mechanism itself failed — not for an ordinary
|
|
@@ -2481,7 +2482,7 @@ var WorkspaceResolver = class WorkspaceResolver extends Context.Service()("@effe
|
|
|
2481
2482
|
};
|
|
2482
2483
|
|
|
2483
2484
|
//#endregion
|
|
2484
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2485
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.0_@effected+semver@0.3.0_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/CatalogAssemblyError.js
|
|
2485
2486
|
/**
|
|
2486
2487
|
* Raised when a workspace's catalogs cannot be assembled — a `pnpm-workspace.yaml`
|
|
2487
2488
|
* that is unreadable or not valid YAML, a root `package.json` `workspaces` field
|
|
@@ -2526,7 +2527,7 @@ var CatalogAssemblyError = class extends Schema.TaggedErrorClass()("CatalogAssem
|
|
|
2526
2527
|
};
|
|
2527
2528
|
|
|
2528
2529
|
//#endregion
|
|
2529
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
2530
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.0_@effected+semver@0.3.0_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySection.js
|
|
2530
2531
|
/**
|
|
2531
2532
|
* The short dependency kind: which dependency map an entry came from, named the
|
|
2532
2533
|
* way consumers branch on it.
|
|
@@ -2560,7 +2561,7 @@ const KIND_TO_FIELD = {
|
|
|
2560
2561
|
const FIELD_TO_KIND = Object.fromEntries(Object.entries(KIND_TO_FIELD).map(([kind, field]) => [field, kind]));
|
|
2561
2562
|
|
|
2562
2563
|
//#endregion
|
|
2563
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2564
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.0_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/desugar.js
|
|
2564
2565
|
const sv = (major, minor, patch, prerelease = [], build = []) => ({
|
|
2565
2566
|
major,
|
|
2566
2567
|
minor,
|
|
@@ -2650,7 +2651,7 @@ const desugarHyphen = (lower, upper) => {
|
|
|
2650
2651
|
};
|
|
2651
2652
|
|
|
2652
2653
|
//#endregion
|
|
2653
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
2654
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.0_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/grammar.js
|
|
2654
2655
|
/** Private control-flow exception; never escapes the entry points. */
|
|
2655
2656
|
var ParseFailure = class {
|
|
2656
2657
|
position;
|
|
@@ -2886,13 +2887,17 @@ const parseSimple = (s) => {
|
|
|
2886
2887
|
if (ch === "~") {
|
|
2887
2888
|
advance$1(s);
|
|
2888
2889
|
if (peek$1(s) === ">") return fail(s);
|
|
2889
|
-
|
|
2890
|
+
const partial = parsePartial(s);
|
|
2891
|
+
return desugarTilde(partial);
|
|
2890
2892
|
}
|
|
2891
2893
|
if (ch === "^") {
|
|
2892
2894
|
advance$1(s);
|
|
2893
|
-
|
|
2895
|
+
const partial = parsePartial(s);
|
|
2896
|
+
return desugarCaret(partial);
|
|
2894
2897
|
}
|
|
2895
|
-
|
|
2898
|
+
const operator = parseOperator(s);
|
|
2899
|
+
const partial = parsePartial(s);
|
|
2900
|
+
return desugarXRange(operator, partial);
|
|
2896
2901
|
};
|
|
2897
2902
|
const atRangeEnd = (s) => {
|
|
2898
2903
|
if (atEnd$1(s)) return true;
|
|
@@ -2909,7 +2914,8 @@ const parseRangeComparators = (s) => {
|
|
|
2909
2914
|
advance$1(s);
|
|
2910
2915
|
advance$1(s);
|
|
2911
2916
|
advance$1(s);
|
|
2912
|
-
|
|
2917
|
+
const upper = parsePartial(s);
|
|
2918
|
+
return desugarHyphen(lower, upper);
|
|
2913
2919
|
} catch (failure) {
|
|
2914
2920
|
if (!(failure instanceof ParseFailure)) throw failure;
|
|
2915
2921
|
s.pos = savedPos;
|
|
@@ -3046,7 +3052,7 @@ const formatComparator = (c) => {
|
|
|
3046
3052
|
const formatRange = (sets) => sets.map((set) => set.map(formatComparator).join(" ")).join(" || ");
|
|
3047
3053
|
|
|
3048
3054
|
//#endregion
|
|
3049
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3055
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.0_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/order.js
|
|
3050
3056
|
/**
|
|
3051
3057
|
* Compare two prerelease identifiers per SemVer 2.0.0 §11: numeric
|
|
3052
3058
|
* identifiers always have lower precedence than alphanumeric ones; numerics
|
|
@@ -3100,7 +3106,7 @@ const compareBuild = (a, b) => {
|
|
|
3100
3106
|
};
|
|
3101
3107
|
|
|
3102
3108
|
//#endregion
|
|
3103
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3109
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.0_effect@4.0.0-beta.101/node_modules/@effected/semver/SemVer.js
|
|
3104
3110
|
/**
|
|
3105
3111
|
* Indicates that a string could not be parsed as a valid SemVer 2.0.0 version.
|
|
3106
3112
|
*
|
|
@@ -3181,6 +3187,35 @@ var SemVer = class SemVer extends Schema.Class("SemVer")({
|
|
|
3181
3187
|
encode: (parts) => Effect.succeed(formatVersion(parts))
|
|
3182
3188
|
})));
|
|
3183
3189
|
/**
|
|
3190
|
+
* `Schema.String` refined by {@link SemVer.isValid}: an exact SemVer 2.0.0
|
|
3191
|
+
* version string whose type stays `string`.
|
|
3192
|
+
*
|
|
3193
|
+
* @remarks
|
|
3194
|
+
* For consumer structs whose field must remain a plain string — a manifest
|
|
3195
|
+
* model, an action input — while still refusing everything that is not
|
|
3196
|
+
* exactly one version: ranges, partial versions, dist-tags, and padded
|
|
3197
|
+
* input (see {@link SemVer.isValid} for the whitespace posture). Build
|
|
3198
|
+
* metadata is valid grammar and passes; reach for
|
|
3199
|
+
* {@link SemVer.PinnableVersionString} when the `+` position is spoken for.
|
|
3200
|
+
* Decode to a {@link SemVer} instance with {@link SemVer.FromString}
|
|
3201
|
+
* instead when the parsed components are wanted.
|
|
3202
|
+
*/
|
|
3203
|
+
static ExactVersionString = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => SemVer.isValid(value) ? void 0 : "Expected an exact SemVer 2.0.0 version string (ranges, partial versions, dist-tags and surrounding whitespace are not valid)")));
|
|
3204
|
+
/**
|
|
3205
|
+
* `Schema.String` refined by {@link SemVer.isPinnable}: an exact,
|
|
3206
|
+
* build-metadata-free SemVer 2.0.0 version string whose type stays
|
|
3207
|
+
* `string`.
|
|
3208
|
+
*
|
|
3209
|
+
* @remarks
|
|
3210
|
+
* The corepack-pinnable notion: what the `<name>@<version>[+<integrity>]`
|
|
3211
|
+
* pin grammar can express in its version position, where the first `+`
|
|
3212
|
+
* always begins the integrity component. `@effected/package-json`'s
|
|
3213
|
+
* `PackageManager` field model consumes this schema directly; suites that
|
|
3214
|
+
* must prove they share it rather than carrying a copy can assert object
|
|
3215
|
+
* identity against this export.
|
|
3216
|
+
*/
|
|
3217
|
+
static PinnableVersionString = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => SemVer.isPinnable(value) ? void 0 : "Expected an exact SemVer version with no build metadata (ranges, partial versions, dist-tags and surrounding whitespace are not pinnable)")));
|
|
3218
|
+
/**
|
|
3184
3219
|
* Parse a strict SemVer 2.0.0 version string, synchronously, returning a
|
|
3185
3220
|
* `Result` instead of an `Effect`.
|
|
3186
3221
|
*
|
|
@@ -3188,6 +3223,12 @@ var SemVer = class SemVer extends Schema.Class("SemVer")({
|
|
|
3188
3223
|
* identifiers and partially consumed input.
|
|
3189
3224
|
*
|
|
3190
3225
|
* @remarks
|
|
3226
|
+
* **Surrounding whitespace is TRIMMED before parsing**, matching
|
|
3227
|
+
* node-semver's constructor: `" 1.2.3"` parses successfully. When padded
|
|
3228
|
+
* input should be the caller's error rather than silently canonicalized,
|
|
3229
|
+
* reach for {@link SemVer.isValid} / {@link SemVer.ExactVersionString}
|
|
3230
|
+
* (or their pinnable twins), which deliberately reject it.
|
|
3231
|
+
*
|
|
3191
3232
|
* {@link SemVer.parse} is defined in terms of this function; the two never
|
|
3192
3233
|
* diverge. Reach for the `Effect` variant inside Effect code — it carries
|
|
3193
3234
|
* the `SemVer.parse` tracing span — and for this one at synchronous
|
|
@@ -3233,6 +3274,49 @@ var SemVer = class SemVer extends Schema.Class("SemVer")({
|
|
|
3233
3274
|
*/
|
|
3234
3275
|
static parse = Effect.fn("SemVer.parse")((input) => Effect.fromResult(SemVer.parseResult(input)));
|
|
3235
3276
|
/**
|
|
3277
|
+
* Whether `input` is a valid SemVer 2.0.0 version string, exactly as
|
|
3278
|
+
* given.
|
|
3279
|
+
*
|
|
3280
|
+
* @remarks
|
|
3281
|
+
* Strict grammar validity — the same grammar as {@link SemVer.parseResult}
|
|
3282
|
+
* — with one deliberate divergence: surrounding whitespace is **rejected**.
|
|
3283
|
+
* `parseResult` trims its input (matching node-semver, whose `SemVer`
|
|
3284
|
+
* constructor trims), so `" 1.2.3"` parses; this predicate answers a
|
|
3285
|
+
* different question — "is this string, byte for byte, a version?" — and a
|
|
3286
|
+
* padded input is the caller's bug to surface, not this package's to hide.
|
|
3287
|
+
* Build metadata is valid grammar (`isValid("1.2.3+build")` is `true`);
|
|
3288
|
+
* reach for {@link SemVer.isPinnable} when the `+` position must stay
|
|
3289
|
+
* free.
|
|
3290
|
+
*
|
|
3291
|
+
* @param input - the candidate version string
|
|
3292
|
+
* @returns `true` when `input` is a valid version string with no
|
|
3293
|
+
* surrounding whitespace.
|
|
3294
|
+
*/
|
|
3295
|
+
static isValid(input) {
|
|
3296
|
+
return input === input.trim() && Result.isSuccess(SemVer.parseResult(input));
|
|
3297
|
+
}
|
|
3298
|
+
/**
|
|
3299
|
+
* Whether `input` is a corepack-pinnable version string: valid by
|
|
3300
|
+
* {@link SemVer.isValid} **and** carrying no build metadata.
|
|
3301
|
+
*
|
|
3302
|
+
* @remarks
|
|
3303
|
+
* The notion the `<name>@<version>[+<integrity>]` pin grammar needs: there
|
|
3304
|
+
* the first `+` after the version always begins the integrity component,
|
|
3305
|
+
* so a version carrying build identifiers would encode to a string that
|
|
3306
|
+
* re-parses differently. Prerelease versions are pinnable; the whitespace
|
|
3307
|
+
* posture is {@link SemVer.isValid}'s.
|
|
3308
|
+
*
|
|
3309
|
+
* @param input - the candidate version string
|
|
3310
|
+
* @returns `true` when `input` is a valid version string with no
|
|
3311
|
+
* surrounding whitespace (the string equals its own trim) and whose
|
|
3312
|
+
* build metadata is empty.
|
|
3313
|
+
*/
|
|
3314
|
+
static isPinnable(input) {
|
|
3315
|
+
if (input !== input.trim()) return false;
|
|
3316
|
+
const parsed = SemVer.parseResult(input);
|
|
3317
|
+
return Result.isSuccess(parsed) && parsed.success.build.length === 0;
|
|
3318
|
+
}
|
|
3319
|
+
/**
|
|
3236
3320
|
* Positional convenience constructor: `SemVer.of(1, 2, 3)`.
|
|
3237
3321
|
*
|
|
3238
3322
|
* @param major - the major version component
|
|
@@ -3335,9 +3419,7 @@ var SemVer = class SemVer extends Schema.Class("SemVer")({
|
|
|
3335
3419
|
case "minor":
|
|
3336
3420
|
key = `${version.major}.${version.minor}`;
|
|
3337
3421
|
break;
|
|
3338
|
-
case "patch":
|
|
3339
|
-
key = `${version.major}.${version.minor}.${version.patch}`;
|
|
3340
|
-
break;
|
|
3422
|
+
case "patch": key = `${version.major}.${version.minor}.${version.patch}`;
|
|
3341
3423
|
}
|
|
3342
3424
|
const group = grouped[key] ?? [];
|
|
3343
3425
|
group.push(version);
|
|
@@ -3536,7 +3618,7 @@ var SemVerBump = class {
|
|
|
3536
3618
|
};
|
|
3537
3619
|
|
|
3538
3620
|
//#endregion
|
|
3539
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3621
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.0_effect@4.0.0-beta.101/node_modules/@effected/semver/Comparator.js
|
|
3540
3622
|
/**
|
|
3541
3623
|
* Indicates that a string could not be parsed as a single comparator.
|
|
3542
3624
|
*
|
|
@@ -3671,7 +3753,7 @@ var Comparator = class Comparator extends Schema.Class("Comparator")({
|
|
|
3671
3753
|
};
|
|
3672
3754
|
|
|
3673
3755
|
//#endregion
|
|
3674
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3756
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.0_effect@4.0.0-beta.101/node_modules/@effected/semver/internal/normalize.js
|
|
3675
3757
|
const operatorWeight = (op) => {
|
|
3676
3758
|
switch (op) {
|
|
3677
3759
|
case ">=": return 0;
|
|
@@ -3703,7 +3785,7 @@ const normalizeComparatorSet = (set) => sortComparators(removeDuplicates(set));
|
|
|
3703
3785
|
const normalizeSets = (sets) => sets.map(normalizeComparatorSet);
|
|
3704
3786
|
|
|
3705
3787
|
//#endregion
|
|
3706
|
-
//#region ../../node_modules/.pnpm/@effected+semver@0.
|
|
3788
|
+
//#region ../../node_modules/.pnpm/@effected+semver@0.3.0_effect@4.0.0-beta.101/node_modules/@effected/semver/Range.js
|
|
3707
3789
|
/**
|
|
3708
3790
|
* Indicates that a string could not be parsed as a range expression.
|
|
3709
3791
|
*
|
|
@@ -3982,9 +4064,7 @@ const isSetSatisfiable = (set) => {
|
|
|
3982
4064
|
case "<=":
|
|
3983
4065
|
if (cmp > 0) return false;
|
|
3984
4066
|
break;
|
|
3985
|
-
case "=":
|
|
3986
|
-
if (cmp !== 0) return false;
|
|
3987
|
-
break;
|
|
4067
|
+
case "=": if (cmp !== 0) return false;
|
|
3988
4068
|
}
|
|
3989
4069
|
}
|
|
3990
4070
|
for (const lo of lowers) for (const hi of uppers) {
|
|
@@ -4023,9 +4103,7 @@ const isComparatorImplied = (set, comp) => {
|
|
|
4023
4103
|
if (s.operator === "<=" && cmp < 0) return true;
|
|
4024
4104
|
if (s.operator === "=" && cmp < 0) return true;
|
|
4025
4105
|
break;
|
|
4026
|
-
case "=":
|
|
4027
|
-
if (s.operator === "=" && cmp === 0) return true;
|
|
4028
|
-
break;
|
|
4106
|
+
case "=": if (s.operator === "=" && cmp === 0) return true;
|
|
4029
4107
|
}
|
|
4030
4108
|
}
|
|
4031
4109
|
return false;
|
|
@@ -4036,7 +4114,7 @@ const isComparatorSetSubset = (sub, sup) => {
|
|
|
4036
4114
|
};
|
|
4037
4115
|
|
|
4038
4116
|
//#endregion
|
|
4039
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4117
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.0_@effected+semver@0.3.0_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/DependencySpecifier.js
|
|
4040
4118
|
/**
|
|
4041
4119
|
* Indicates that a string could not be parsed as a valid dependency specifier.
|
|
4042
4120
|
*
|
|
@@ -4244,9 +4322,9 @@ const DependencySpecifier = Object.assign(brandedSpecifier, {
|
|
|
4244
4322
|
});
|
|
4245
4323
|
|
|
4246
4324
|
//#endregion
|
|
4247
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4325
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.0_@effected+semver@0.3.0_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/IntegrityHash.js
|
|
4248
4326
|
const SRI_RE = /^(sha1|sha256|sha384|sha512)-[A-Za-z0-9+/]+={0,2}$/;
|
|
4249
|
-
const COREPACK_RE = /^(sha1|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
4327
|
+
const COREPACK_RE = /^(sha1|sha224|sha256|sha384|sha512)\.[0-9a-f]+$/;
|
|
4250
4328
|
const YARN_RE = /^[0-9]+(c[0-9]+)?\/[0-9a-f]+$/;
|
|
4251
4329
|
const isSri = (value) => SRI_RE.test(value);
|
|
4252
4330
|
const isCorepack = (value) => COREPACK_RE.test(value);
|
|
@@ -4296,9 +4374,61 @@ const IntegrityHash = Object.assign(brandedIntegrity, {
|
|
|
4296
4374
|
algorithmOf,
|
|
4297
4375
|
decode: decode$2
|
|
4298
4376
|
});
|
|
4377
|
+
/**
|
|
4378
|
+
* {@link (IntegrityHash:variable)} narrowed to the corepack `<algo>.<hex>` form
|
|
4379
|
+
* — `sha512.deadbeef`, and corepack's own sha224 default pins
|
|
4380
|
+
* (`sha224.877304e3…`). An SRI (`sha512-<base64>`) or yarn (`10c0/<hex>`)
|
|
4381
|
+
* hash, both valid `IntegrityHash` values, fails this schema.
|
|
4382
|
+
*
|
|
4383
|
+
* @remarks
|
|
4384
|
+
* The corepack pin tail (`<name>@<version>+<integrity>`) is the one place the
|
|
4385
|
+
* kit meets this form, and two schemas name it: `PackageManagerPin.integrity`
|
|
4386
|
+
* here and `@effected/package-json`'s `PackageManager.integrity`. Both consume
|
|
4387
|
+
* **this** schema — the restriction existed privately in each module until they
|
|
4388
|
+
* were consolidated, and a private copy is exactly how the two drift (the
|
|
4389
|
+
* widening that admitted sha224 had to be made twice).
|
|
4390
|
+
*
|
|
4391
|
+
* It decodes to the same {@link IntegrityHashBrand} the unrestricted schema
|
|
4392
|
+
* does, so a corepack-validated value assigns anywhere an `IntegrityHash` is
|
|
4393
|
+
* expected; there is no second brand. Reach for
|
|
4394
|
+
* `IntegrityHash.isCorepack(value)` to ask the same question about a raw
|
|
4395
|
+
* string without decoding.
|
|
4396
|
+
*
|
|
4397
|
+
* That single brand is also why sharing this schema is not type-enforced, and
|
|
4398
|
+
* the consequence is sharper than it looks: a `Schema.check` is **erased from
|
|
4399
|
+
* the built type**, so this schema and the unrestricted one are the same
|
|
4400
|
+
* declared type. A consumer that quietly reverts to a private copy compiles
|
|
4401
|
+
* clean, and — if the copy is faithful — passes every rejection test too.
|
|
4402
|
+
* Neither `tsc` nor behaviour can see the re-fork.
|
|
4403
|
+
*
|
|
4404
|
+
* What does see it is **object identity**, so each consumer's suite asserts
|
|
4405
|
+
* that its field schema IS this export:
|
|
4406
|
+
* `PackageManagerPin.fields.integrity.schema === CorepackIntegrityHash` (an
|
|
4407
|
+
* `optionalKey` field keeps the inner schema on `.schema`), and
|
|
4408
|
+
* `PackageManager.fields.integrity.value === CorepackIntegrityHash` on the
|
|
4409
|
+
* `@effected/package-json` side (a `Schema.Option` keeps it on `.value`). Both
|
|
4410
|
+
* assertions carry a control against the unrestricted brand, so they discriminate
|
|
4411
|
+
* rather than passing on any schema at all. That identity assertion is the only
|
|
4412
|
+
* thing standing between the two surfaces and a silent re-fork; do not replace
|
|
4413
|
+
* it with a behavioural test, which cannot fail.
|
|
4414
|
+
*
|
|
4415
|
+
* @example
|
|
4416
|
+
* ```ts
|
|
4417
|
+
* import { CorepackIntegrityHash } from "@effected/npm";
|
|
4418
|
+
* import { Schema } from "effect";
|
|
4419
|
+
*
|
|
4420
|
+
* const decode = Schema.decodeUnknownExit(CorepackIntegrityHash);
|
|
4421
|
+
*
|
|
4422
|
+
* decode("sha512.deadbeef"); // success
|
|
4423
|
+
* decode("sha512-3q2+7w=="); // failure — SRI form
|
|
4424
|
+
* ```
|
|
4425
|
+
*
|
|
4426
|
+
* @public
|
|
4427
|
+
*/
|
|
4428
|
+
const CorepackIntegrityHash = brandedIntegrity.pipe(Schema.check(Schema.makeFilter((value) => isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
|
|
4299
4429
|
|
|
4300
4430
|
//#endregion
|
|
4301
|
-
//#region ../../node_modules/.pnpm/@effected+commands@0.
|
|
4431
|
+
//#region ../../node_modules/.pnpm/@effected+commands@0.2.0_effect@4.0.0-beta.101/node_modules/@effected/commands/LocalExec.js
|
|
4302
4432
|
/**
|
|
4303
4433
|
* The package managers whose project-local exec argv this package knows.
|
|
4304
4434
|
*
|
|
@@ -4325,15 +4455,22 @@ const PREFIXES = {
|
|
|
4325
4455
|
"--no",
|
|
4326
4456
|
"--"
|
|
4327
4457
|
],
|
|
4328
|
-
dlxPrefix: ["npx"]
|
|
4458
|
+
dlxPrefix: ["npx"],
|
|
4459
|
+
scriptPrefix: [
|
|
4460
|
+
"npm",
|
|
4461
|
+
"run",
|
|
4462
|
+
"--"
|
|
4463
|
+
]
|
|
4329
4464
|
},
|
|
4330
4465
|
pnpm: {
|
|
4331
4466
|
prefix: ["pnpm", "exec"],
|
|
4332
|
-
dlxPrefix: ["pnpm", "dlx"]
|
|
4467
|
+
dlxPrefix: ["pnpm", "dlx"],
|
|
4468
|
+
scriptPrefix: ["pnpm", "run"]
|
|
4333
4469
|
},
|
|
4334
4470
|
yarn: {
|
|
4335
4471
|
prefix: ["yarn", "exec"],
|
|
4336
|
-
dlxPrefix: ["yarn", "dlx"]
|
|
4472
|
+
dlxPrefix: ["yarn", "dlx"],
|
|
4473
|
+
scriptPrefix: ["yarn", "run"]
|
|
4337
4474
|
},
|
|
4338
4475
|
bun: {
|
|
4339
4476
|
prefix: [
|
|
@@ -4341,15 +4478,16 @@ const PREFIXES = {
|
|
|
4341
4478
|
"x",
|
|
4342
4479
|
"--no-install"
|
|
4343
4480
|
],
|
|
4344
|
-
dlxPrefix: ["bun", "x"]
|
|
4481
|
+
dlxPrefix: ["bun", "x"],
|
|
4482
|
+
scriptPrefix: ["bun", "run"]
|
|
4345
4483
|
}
|
|
4346
4484
|
};
|
|
4347
4485
|
/**
|
|
4348
4486
|
* How to run a project-local binary here.
|
|
4349
4487
|
*
|
|
4350
4488
|
* @remarks
|
|
4351
|
-
* This is the whole of what tool discovery needs from a workspace:
|
|
4352
|
-
*
|
|
4489
|
+
* This is the whole of what tool discovery needs from a workspace: argv
|
|
4490
|
+
* prefixes and a directory to run them in. It deliberately carries no workspace
|
|
4353
4491
|
* root, no manifest and no package-manager semantics — `label` is for
|
|
4354
4492
|
* reporting only, and nothing in this package branches on it.
|
|
4355
4493
|
*
|
|
@@ -4362,6 +4500,8 @@ var ExecContext = class extends Schema.Class("ExecContext")({
|
|
|
4362
4500
|
prefix: Schema.Array(Schema.String),
|
|
4363
4501
|
/** argv prefix that fetch-and-runs a package binary, e.g. `["pnpm", "dlx"]`. */
|
|
4364
4502
|
dlxPrefix: Schema.Array(Schema.String),
|
|
4503
|
+
/** argv prefix that runs a `package.json` script, e.g. `["pnpm", "run"]`. */
|
|
4504
|
+
scriptPrefix: Schema.Array(Schema.String),
|
|
4365
4505
|
/** Directory the prefix must run in. Omitted means "wherever the caller is". */
|
|
4366
4506
|
directory: Schema.optionalKey(Schema.String)
|
|
4367
4507
|
}) {
|
|
@@ -4374,6 +4514,19 @@ var ExecContext = class extends Schema.Class("ExecContext")({
|
|
|
4374
4514
|
return this.withPrefix(command, this.dlxPrefix);
|
|
4375
4515
|
}
|
|
4376
4516
|
/**
|
|
4517
|
+
* As {@link ExecContext.apply}, using `scriptPrefix` — runs a
|
|
4518
|
+
* `package.json` script by name.
|
|
4519
|
+
*
|
|
4520
|
+
* @remarks
|
|
4521
|
+
* The command's `command` is the script name and its `args` are the script's
|
|
4522
|
+
* arguments. Every launcher uses the explicit `run` form, and npm's prefix
|
|
4523
|
+
* carries a trailing `--` because bare `npm run <script> --flag` silently
|
|
4524
|
+
* claims `--flag` for npm itself instead of the script.
|
|
4525
|
+
*/
|
|
4526
|
+
applyScript(command) {
|
|
4527
|
+
return this.withPrefix(command, this.scriptPrefix);
|
|
4528
|
+
}
|
|
4529
|
+
/**
|
|
4377
4530
|
* Core's `prefix` and `setCwd` both return NEW commands, so the caller's
|
|
4378
4531
|
* value is never mutated.
|
|
4379
4532
|
*/
|
|
@@ -4424,9 +4577,21 @@ var LocalExecError = class extends Schema.TaggedErrorClass()("LocalExecError", {
|
|
|
4424
4577
|
* @public
|
|
4425
4578
|
*/
|
|
4426
4579
|
var LocalExec = class LocalExec extends Context.Service()("@effected/commands/LocalExec") {
|
|
4427
|
-
/** The exec and
|
|
4580
|
+
/** The exec, dlx and script-runner argv prefixes for a launcher — the single home of that knowledge. */
|
|
4428
4581
|
static prefixes = (launcher) => PREFIXES[launcher];
|
|
4429
4582
|
/**
|
|
4583
|
+
* The argv prefix that runs a `package.json` script for `launcher`.
|
|
4584
|
+
*
|
|
4585
|
+
* @remarks
|
|
4586
|
+
* A projection of {@link LocalExec.prefixes} for the caller that only runs
|
|
4587
|
+
* scripts. Every launcher uses the explicit `run` form —
|
|
4588
|
+
* `["npm", "run", "--"]`, `["pnpm", "run"]`, `["yarn", "run"]` and
|
|
4589
|
+
* `["bun", "run"]` — and npm's carries a trailing `--` because bare
|
|
4590
|
+
* `npm run <script> --flag` silently claims `--flag` for npm itself; the
|
|
4591
|
+
* other three forward post-script arguments without it.
|
|
4592
|
+
*/
|
|
4593
|
+
static scriptPrefix = (launcher) => PREFIXES[launcher].scriptPrefix;
|
|
4594
|
+
/**
|
|
4430
4595
|
* No project-local execution context: every tool resolves globally.
|
|
4431
4596
|
*
|
|
4432
4597
|
* @remarks
|
|
@@ -4436,11 +4601,12 @@ var LocalExec = class LocalExec extends Context.Service()("@effected/commands/Lo
|
|
|
4436
4601
|
static layerNone = Layer.succeed(this, { context: Effect.succeed(Option.none()) });
|
|
4437
4602
|
/** A context for a known package manager, from the static prefix table. */
|
|
4438
4603
|
static layerFor = (launcher, options) => {
|
|
4439
|
-
const { prefix, dlxPrefix } = PREFIXES[launcher];
|
|
4604
|
+
const { prefix, dlxPrefix, scriptPrefix } = PREFIXES[launcher];
|
|
4440
4605
|
return LocalExec.layerContext(ExecContext.make({
|
|
4441
4606
|
label: launcher,
|
|
4442
4607
|
prefix,
|
|
4443
4608
|
dlxPrefix,
|
|
4609
|
+
scriptPrefix,
|
|
4444
4610
|
...options?.directory === void 0 ? {} : { directory: options.directory }
|
|
4445
4611
|
}));
|
|
4446
4612
|
};
|
|
@@ -4471,7 +4637,7 @@ var LocalExec = class LocalExec extends Context.Service()("@effected/commands/Lo
|
|
|
4471
4637
|
};
|
|
4472
4638
|
|
|
4473
4639
|
//#endregion
|
|
4474
|
-
//#region ../../node_modules/.pnpm/@effected+npm@0.
|
|
4640
|
+
//#region ../../node_modules/.pnpm/@effected+npm@0.8.0_@effected+semver@0.3.0_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/npm/ReleaseAgeGate.js
|
|
4475
4641
|
const MS_PER_MINUTE = 6e4;
|
|
4476
4642
|
/**
|
|
4477
4643
|
* A source's partial contribution to a {@link ReleaseAgeGate}: the effective
|
|
@@ -4642,7 +4808,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends Schema.Class("ReleaseAgeGate")
|
|
|
4642
4808
|
};
|
|
4643
4809
|
|
|
4644
4810
|
//#endregion
|
|
4645
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4811
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/ImporterDependency.js
|
|
4646
4812
|
/**
|
|
4647
4813
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
4648
4814
|
*
|
|
@@ -4681,7 +4847,7 @@ var ImporterDependency = class extends Schema.Class("ImporterDependency")({
|
|
|
4681
4847
|
}) {};
|
|
4682
4848
|
|
|
4683
4849
|
//#endregion
|
|
4684
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4850
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/LockfileImporter.js
|
|
4685
4851
|
/**
|
|
4686
4852
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
4687
4853
|
*
|
|
@@ -4706,7 +4872,7 @@ var LockfileImporter = class extends Schema.Class("LockfileImporter")({
|
|
|
4706
4872
|
}) {};
|
|
4707
4873
|
|
|
4708
4874
|
//#endregion
|
|
4709
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4875
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/ResolvedPackage.js
|
|
4710
4876
|
const EMPTY_DEPENDENCIES = {};
|
|
4711
4877
|
/**
|
|
4712
4878
|
* A package resolved from a lockfile.
|
|
@@ -4742,7 +4908,7 @@ var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
|
|
|
4742
4908
|
}) {};
|
|
4743
4909
|
|
|
4744
4910
|
//#endregion
|
|
4745
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4911
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/WorkspaceDependency.js
|
|
4746
4912
|
/**
|
|
4747
4913
|
* A directed dependency edge between two workspace packages as recorded in
|
|
4748
4914
|
* the lockfile.
|
|
@@ -4765,7 +4931,7 @@ var WorkspaceDependency = class extends Schema.Class("WorkspaceDependency")({
|
|
|
4765
4931
|
}) {};
|
|
4766
4932
|
|
|
4767
4933
|
//#endregion
|
|
4768
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4934
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/PnpmExtension.js
|
|
4769
4935
|
/**
|
|
4770
4936
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
4771
4937
|
* when the format is `"pnpm"`.
|
|
@@ -4791,7 +4957,7 @@ var PnpmExtension = class extends Schema.Class("PnpmExtension")({
|
|
|
4791
4957
|
}) {};
|
|
4792
4958
|
|
|
4793
4959
|
//#endregion
|
|
4794
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4960
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/LockfileFormat.js
|
|
4795
4961
|
/**
|
|
4796
4962
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
4797
4963
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -4812,21 +4978,25 @@ const LockfileFormat = Schema.Literals([
|
|
|
4812
4978
|
"yarn"
|
|
4813
4979
|
]);
|
|
4814
4980
|
const FILENAMES = {
|
|
4815
|
-
bun: "bun.lock",
|
|
4816
|
-
npm: "package-lock.json",
|
|
4817
|
-
pnpm: "pnpm-lock.yaml",
|
|
4818
|
-
yarn: "yarn.lock"
|
|
4981
|
+
bun: ["bun.lock", "bun.lockb"],
|
|
4982
|
+
npm: ["package-lock.json", "npm-shrinkwrap.json"],
|
|
4983
|
+
pnpm: ["pnpm-lock.yaml"],
|
|
4984
|
+
yarn: ["yarn.lock"]
|
|
4819
4985
|
};
|
|
4820
4986
|
/**
|
|
4821
4987
|
* The conventional lockfile filename for a format: `"bun.lock"`,
|
|
4822
4988
|
* `"package-lock.json"`, `"pnpm-lock.yaml"` or `"yarn.lock"`.
|
|
4823
4989
|
*
|
|
4990
|
+
* @remarks
|
|
4991
|
+
* The primary name only — the first element of {@link filenamesFor}, which is
|
|
4992
|
+
* what detection that must also see the genuine alternates should use.
|
|
4993
|
+
*
|
|
4824
4994
|
* @public
|
|
4825
4995
|
*/
|
|
4826
|
-
const filenameFor = (format) => FILENAMES[format];
|
|
4996
|
+
const filenameFor = (format) => FILENAMES[format][0];
|
|
4827
4997
|
|
|
4828
4998
|
//#endregion
|
|
4829
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
4999
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/internal/shared.js
|
|
4830
5000
|
/**
|
|
4831
5001
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
4832
5002
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -5243,9 +5413,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
|
|
|
5243
5413
|
else tokenError = "InvalidUnicode";
|
|
5244
5414
|
break;
|
|
5245
5415
|
}
|
|
5246
|
-
default:
|
|
5247
|
-
tokenError = "InvalidEscapeCharacter";
|
|
5248
|
-
break;
|
|
5416
|
+
default: tokenError = "InvalidEscapeCharacter";
|
|
5249
5417
|
}
|
|
5250
5418
|
start = pos;
|
|
5251
5419
|
} else if (isLineBreak$1(ch)) {
|
|
@@ -6800,7 +6968,7 @@ var JsoncModifier = class {
|
|
|
6800
6968
|
};
|
|
6801
6969
|
|
|
6802
6970
|
//#endregion
|
|
6803
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
6971
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/internal/bun.js
|
|
6804
6972
|
const DepRecord$2 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6805
6973
|
const BunWorkspaceEntry = Schema.Struct({
|
|
6806
6974
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -6894,7 +7062,7 @@ const toFields$3 = (raw) => Effect.gen(function* () {
|
|
|
6894
7062
|
});
|
|
6895
7063
|
|
|
6896
7064
|
//#endregion
|
|
6897
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
7065
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/internal/npm.js
|
|
6898
7066
|
const DepRecord$1 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6899
7067
|
const NpmPackageEntry = Schema.Struct({
|
|
6900
7068
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -13905,7 +14073,7 @@ function deepEqualValues(a, b) {
|
|
|
13905
14073
|
}
|
|
13906
14074
|
|
|
13907
14075
|
//#endregion
|
|
13908
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
14076
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/internal/documents.js
|
|
13909
14077
|
/**
|
|
13910
14078
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
13911
14079
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -13976,7 +14144,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
|
|
|
13976
14144
|
});
|
|
13977
14145
|
|
|
13978
14146
|
//#endregion
|
|
13979
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
14147
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/internal/pnpm.js
|
|
13980
14148
|
const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
|
|
13981
14149
|
specifier: Schema.String,
|
|
13982
14150
|
version: Schema.String
|
|
@@ -14102,7 +14270,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
|
|
|
14102
14270
|
});
|
|
14103
14271
|
|
|
14104
14272
|
//#endregion
|
|
14105
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
14273
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/internal/yarn.js
|
|
14106
14274
|
const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
|
|
14107
14275
|
const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
14108
14276
|
const YarnEntry = Schema.Struct({
|
|
@@ -14226,7 +14394,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
14226
14394
|
};
|
|
14227
14395
|
|
|
14228
14396
|
//#endregion
|
|
14229
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
14397
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/Lockfile.js
|
|
14230
14398
|
const EMPTY_IMPORTERS = [];
|
|
14231
14399
|
/**
|
|
14232
14400
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -14471,7 +14639,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
|
|
|
14471
14639
|
};
|
|
14472
14640
|
|
|
14473
14641
|
//#endregion
|
|
14474
|
-
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.
|
|
14642
|
+
//#region ../../node_modules/.pnpm/@effected+lockfiles@0.3.0_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__@effected+npm@0._6d3ff0eb8f85b9388aafe615e49a1bcb/node_modules/@effected/lockfiles/LockfileIntegrity.js
|
|
14475
14643
|
/**
|
|
14476
14644
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
14477
14645
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -14588,7 +14756,7 @@ var LockfileIntegrity = class LockfileIntegrity extends Schema.Class("LockfileIn
|
|
|
14588
14756
|
};
|
|
14589
14757
|
|
|
14590
14758
|
//#endregion
|
|
14591
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14759
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/Dependency.js
|
|
14592
14760
|
/**
|
|
14593
14761
|
* A resolved dependency entry pairing a package name with its version
|
|
14594
14762
|
* specifier and the `kind` of map it came from (`@effected/npm`'s
|
|
@@ -14653,7 +14821,7 @@ var Dependency = class extends Schema.Class("Dependency")({
|
|
|
14653
14821
|
};
|
|
14654
14822
|
|
|
14655
14823
|
//#endregion
|
|
14656
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
14824
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/DevEngines.js
|
|
14657
14825
|
/**
|
|
14658
14826
|
* A single `devEngines` constraint with a name and optional `version` / `onFail`.
|
|
14659
14827
|
*
|
|
@@ -16251,7 +16419,7 @@ const SpdxExpression = {
|
|
|
16251
16419
|
};
|
|
16252
16420
|
|
|
16253
16421
|
//#endregion
|
|
16254
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16422
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/License.js
|
|
16255
16423
|
/**
|
|
16256
16424
|
* Indicates that a string is not a valid SPDX license identifier or expression.
|
|
16257
16425
|
*
|
|
@@ -16287,50 +16455,103 @@ const isValidSpdx = (value) => {
|
|
|
16287
16455
|
const SpdxLicense = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), Schema.brand("SpdxLicense"));
|
|
16288
16456
|
|
|
16289
16457
|
//#endregion
|
|
16290
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16291
|
-
const
|
|
16292
|
-
|
|
16293
|
-
* The `packageManager` field only ever carries corepack's `<algo>.<hex>`
|
|
16294
|
-
* integrity form (the `name@version+sha512.<hex>` tail). Restrict the
|
|
16295
|
-
* `@effected/npm` `IntegrityHash` brand — which also admits the SRI and yarn
|
|
16296
|
-
* forms — to just the corepack shape, so an SRI or yarn integrity here fails
|
|
16297
|
-
* typed rather than being accepted into a field that can never legitimately
|
|
16298
|
-
* hold it.
|
|
16299
|
-
*/
|
|
16300
|
-
const CorepackIntegrity = IntegrityHash.pipe(Schema.check(Schema.makeFilter((value) => IntegrityHash.isCorepack(value) ? void 0 : "Expected a corepack (<algo>.<hex>) integrity hash")));
|
|
16458
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageManager.js
|
|
16459
|
+
const PACKAGE_MANAGER_NAME_RE = /^[a-z]+$/;
|
|
16460
|
+
const invalid$1 = (input, message) => Effect.fail(new SchemaIssue.InvalidValue(Option.some(input), { message }));
|
|
16301
16461
|
/**
|
|
16302
16462
|
* A structured `packageManager` value with `name`, `version` and an optional
|
|
16303
16463
|
* `integrity` hash.
|
|
16304
16464
|
*
|
|
16465
|
+
* @remarks
|
|
16466
|
+
* The same `<name>@<version>[+<integrity>]` triple `@effected/npm`'s
|
|
16467
|
+
* `PackageManagerPin` models, in its `package.json` field form. Both share the
|
|
16468
|
+
* strict pieces — the version is `@effected/semver`'s
|
|
16469
|
+
* `SemVer.PinnableVersionString` (decode rules through `SemVer.isPinnable`),
|
|
16470
|
+
* the integrity is npm's `CorepackIntegrityHash` — and
|
|
16471
|
+
* both apply the first-`+`-is-integrity rule. Reach for the pin when
|
|
16472
|
+
* provisioning a package manager; reach for this class when reading or writing
|
|
16473
|
+
* the manifest field.
|
|
16474
|
+
*
|
|
16475
|
+
* **The one deliberate divergence is the name grammar**, and it points this
|
|
16476
|
+
* way: the pin closes the set to the four managers the kit can provision
|
|
16477
|
+
* (`npm | pnpm | yarn | bun`), while this field model accepts any lowercase
|
|
16478
|
+
* name. The evidence:
|
|
16479
|
+
*
|
|
16480
|
+
* - Corepack 0.34.0 (`specUtils.ts`, `parseSpec`) recognises **three** names —
|
|
16481
|
+
* `npm`, `pnpm`, `yarn` — and throws an "unsupported package manager
|
|
16482
|
+
* specification" usage error for any other. Adopting that set here would reject
|
|
16483
|
+
* `bun@1.2.20`, which is real: six published packages in this repo's own
|
|
16484
|
+
* `node_modules` carry exactly that value, and a manifest model that cannot
|
|
16485
|
+
* read them is useless for the job it has.
|
|
16486
|
+
* - Corepack does not treat the set as closed either. `parseSpec` skips the
|
|
16487
|
+
* name check entirely when the spec is a URL, so a custom name is reachable
|
|
16488
|
+
* in corepack's own grammar (behind `COREPACK_ENABLE_UNSAFE_CUSTOM_URLS`).
|
|
16489
|
+
* - npm documents no constraint on this field at all. Its `package.json`
|
|
16490
|
+
* reference constrains only `devEngines.packageManager.name` — a different
|
|
16491
|
+
* field, modeled here by `DevEngine` and out of scope for this class.
|
|
16492
|
+
*
|
|
16493
|
+
* So: field model = manifests as they exist in the wild; pin = the kit's
|
|
16494
|
+
* provisioning vocabulary. A name outside the pin's four is representable here
|
|
16495
|
+
* and simply will not be installable through the pin — which is the honest
|
|
16496
|
+
* relationship between a document model and a provisioning contract.
|
|
16497
|
+
*
|
|
16305
16498
|
* @public
|
|
16306
16499
|
*/
|
|
16307
16500
|
var PackageManager = class PackageManager extends Schema.Class("PackageManager")({
|
|
16308
|
-
/** The package-manager name (e.g. `pnpm`). */
|
|
16501
|
+
/** The package-manager name (e.g. `pnpm`). Any lowercase name — see the class remarks. */
|
|
16309
16502
|
name: Schema.String,
|
|
16310
|
-
/**
|
|
16311
|
-
version:
|
|
16312
|
-
|
|
16313
|
-
|
|
16503
|
+
/**
|
|
16504
|
+
* The version (e.g. `10.33.0`): `@effected/semver`'s
|
|
16505
|
+
* `SemVer.PinnableVersionString` — an exact SemVer 2.0.0 version with no
|
|
16506
|
+
* build metadata and no surrounding whitespace. Prerelease versions are
|
|
16507
|
+
* allowed (`10.0.0-rc.1`); ranges, partial versions, dist-tags,
|
|
16508
|
+
* leading-zero components and padded values are not, and a version
|
|
16509
|
+
* carrying build metadata is rejected at construction because the grammar
|
|
16510
|
+
* cannot express it. The shared schema is consumed by identity, not
|
|
16511
|
+
* copied — the suite asserts `fields.version === SemVer.PinnableVersionString`.
|
|
16512
|
+
*/
|
|
16513
|
+
version: SemVer.PinnableVersionString,
|
|
16514
|
+
/**
|
|
16515
|
+
* The optional integrity hash (e.g. `sha512.abc`): `@effected/npm`'s
|
|
16516
|
+
* `CorepackIntegrityHash`, the shared restriction of the `IntegrityHash`
|
|
16517
|
+
* brand to the corepack `<algo>.<hex>` form.
|
|
16518
|
+
*/
|
|
16519
|
+
integrity: Schema.Option(CorepackIntegrityHash)
|
|
16314
16520
|
}) {
|
|
16315
16521
|
/**
|
|
16316
16522
|
* Schema transformation between the `"name@version+integrity"` string and a
|
|
16317
16523
|
* {@link PackageManager}.
|
|
16524
|
+
*
|
|
16525
|
+
* @remarks
|
|
16526
|
+
* Decoding splits on the first `@`, then on the first `+` — which always
|
|
16527
|
+
* begins the integrity, never semver build metadata — and validates each
|
|
16528
|
+
* component: the name against the lowercase grammar, the version through
|
|
16529
|
+
* `@effected/semver`'s strict parse, the integrity through
|
|
16530
|
+
* `CorepackIntegrityHash`. Every failure is a typed decode failure naming
|
|
16531
|
+
* the component that failed. Encoding prints the canonical string, which is
|
|
16532
|
+
* byte-identical to any input this codec accepts.
|
|
16318
16533
|
*/
|
|
16319
16534
|
static FromString = Schema.String.pipe(Schema.decodeTo(Schema.instanceOf(PackageManager), SchemaTransformation.transformOrFail({
|
|
16320
16535
|
decode: (input) => {
|
|
16321
|
-
const
|
|
16322
|
-
if (
|
|
16323
|
-
const
|
|
16324
|
-
if (
|
|
16325
|
-
|
|
16326
|
-
|
|
16536
|
+
const at = input.indexOf("@");
|
|
16537
|
+
if (at === -1) return invalid$1(input, `Invalid packageManager format: "${input}"`);
|
|
16538
|
+
const name = input.slice(0, at);
|
|
16539
|
+
if (!PACKAGE_MANAGER_NAME_RE.test(name)) return invalid$1(input, `Invalid packageManager name: "${name}"`);
|
|
16540
|
+
const rest = input.slice(at + 1);
|
|
16541
|
+
const plus = rest.indexOf("+");
|
|
16542
|
+
const version = plus === -1 ? rest : rest.slice(0, plus);
|
|
16543
|
+
if (!SemVer.isPinnable(version)) return invalid$1(input, `Invalid packageManager version: "${version}"`);
|
|
16544
|
+
if (plus === -1) return Effect.succeed(PackageManager.make({
|
|
16545
|
+
name,
|
|
16546
|
+
version,
|
|
16327
16547
|
integrity: Option.none()
|
|
16328
16548
|
}));
|
|
16329
|
-
const
|
|
16330
|
-
|
|
16549
|
+
const rawIntegrity = rest.slice(plus + 1);
|
|
16550
|
+
const decoded = Schema.decodeUnknownExit(CorepackIntegrityHash)(rawIntegrity);
|
|
16551
|
+
if (Exit.isFailure(decoded)) return invalid$1(input, `Invalid packageManager integrity: "${rawIntegrity}"`);
|
|
16331
16552
|
return Effect.succeed(PackageManager.make({
|
|
16332
|
-
name
|
|
16333
|
-
version
|
|
16553
|
+
name,
|
|
16554
|
+
version,
|
|
16334
16555
|
integrity: Option.some(decoded.value)
|
|
16335
16556
|
}));
|
|
16336
16557
|
},
|
|
@@ -16346,7 +16567,7 @@ var PackageManager = class PackageManager extends Schema.Class("PackageManager")
|
|
|
16346
16567
|
};
|
|
16347
16568
|
|
|
16348
16569
|
//#endregion
|
|
16349
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16570
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/PackageName.js
|
|
16350
16571
|
/**
|
|
16351
16572
|
* Indicates that a string could not be used as a valid npm package name.
|
|
16352
16573
|
*
|
|
@@ -16405,7 +16626,7 @@ const PackageName = Object.assign(Schema.Union([ScopedPackageName, UnscopedPacka
|
|
|
16405
16626
|
});
|
|
16406
16627
|
|
|
16407
16628
|
//#endregion
|
|
16408
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16629
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/Person.js
|
|
16409
16630
|
const parsePersonString = (input) => {
|
|
16410
16631
|
const emailMatch = input.match(/<([^>]+)>/);
|
|
16411
16632
|
const urlMatch = input.match(/\(([^)]+)\)/);
|
|
@@ -16552,7 +16773,7 @@ var Person = class Person extends Schema.Class("Person")({
|
|
|
16552
16773
|
};
|
|
16553
16774
|
|
|
16554
16775
|
//#endregion
|
|
16555
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16776
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/Repository.js
|
|
16556
16777
|
/** The shorthand hosts npm resolves without a scheme. */
|
|
16557
16778
|
const SHORTHAND_HOSTS = /* @__PURE__ */ new Map([
|
|
16558
16779
|
["github", "https://github.com"],
|
|
@@ -16728,7 +16949,7 @@ var Bugs = class Bugs extends Schema.Class("Bugs")({
|
|
|
16728
16949
|
};
|
|
16729
16950
|
|
|
16730
16951
|
//#endregion
|
|
16731
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16952
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/internal/format.js
|
|
16732
16953
|
const KEY_INDEX = new Map([
|
|
16733
16954
|
"$schema",
|
|
16734
16955
|
"name",
|
|
@@ -16952,7 +17173,7 @@ const renderJson = (raw, options) => {
|
|
|
16952
17173
|
};
|
|
16953
17174
|
|
|
16954
17175
|
//#endregion
|
|
16955
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
17176
|
+
//#region ../../node_modules/.pnpm/@effected+package-json@0.7.1_effect@4.0.0-beta.101/node_modules/@effected/package-json/Package.js
|
|
16956
17177
|
const toHashMap = SchemaTransformation.transform({
|
|
16957
17178
|
decode: (record) => HashMap.fromIterable(Object.entries(record)),
|
|
16958
17179
|
encode: (map) => Object.fromEntries(HashMap.toEntries(map))
|
|
@@ -17273,12 +17494,13 @@ var Package = class Package extends Schema.Class("Package")({
|
|
|
17273
17494
|
* sorting and empty-map stripping unless the options opt out. Pure.
|
|
17274
17495
|
*/
|
|
17275
17496
|
toJsonString(options) {
|
|
17276
|
-
|
|
17497
|
+
const raw = Schema.encodeUnknownSync(Package.schema)(this);
|
|
17498
|
+
return renderJson(raw, resolveFormatOptions(options));
|
|
17277
17499
|
}
|
|
17278
17500
|
};
|
|
17279
17501
|
|
|
17280
17502
|
//#endregion
|
|
17281
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
17503
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspacePackage.js
|
|
17282
17504
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
17283
17505
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
17284
17506
|
/**
|
|
@@ -17880,7 +18102,7 @@ var Walker$1 = class {
|
|
|
17880
18102
|
};
|
|
17881
18103
|
|
|
17882
18104
|
//#endregion
|
|
17883
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
18105
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceRoot.js
|
|
17884
18106
|
/**
|
|
17885
18107
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
17886
18108
|
*
|
|
@@ -18068,7 +18290,7 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
|
|
|
18068
18290
|
};
|
|
18069
18291
|
|
|
18070
18292
|
//#endregion
|
|
18071
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
18293
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/limits.js
|
|
18072
18294
|
/**
|
|
18073
18295
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
18074
18296
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -18087,7 +18309,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
18087
18309
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
18088
18310
|
|
|
18089
18311
|
//#endregion
|
|
18090
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
18312
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/traverse.js
|
|
18091
18313
|
/** Directory names never descended into. */
|
|
18092
18314
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
18093
18315
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -18178,7 +18400,7 @@ var Traversal = class {
|
|
|
18178
18400
|
};
|
|
18179
18401
|
|
|
18180
18402
|
//#endregion
|
|
18181
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
18403
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/enumerate.js
|
|
18182
18404
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
18183
18405
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
18184
18406
|
/**
|
|
@@ -18249,7 +18471,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
|
|
|
18249
18471
|
});
|
|
18250
18472
|
|
|
18251
18473
|
//#endregion
|
|
18252
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
18474
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/patterns.js
|
|
18253
18475
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
18254
18476
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
18255
18477
|
const pnpmPatternsOf = (document) => {
|
|
@@ -18307,7 +18529,7 @@ const readPatterns = (root) => Effect.gen(function* () {
|
|
|
18307
18529
|
});
|
|
18308
18530
|
|
|
18309
18531
|
//#endregion
|
|
18310
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
18532
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceDiscovery.js
|
|
18311
18533
|
/**
|
|
18312
18534
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
18313
18535
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -18508,12 +18730,13 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18508
18730
|
kind: failure.kind,
|
|
18509
18731
|
cause: failure.cause
|
|
18510
18732
|
})));
|
|
18511
|
-
const
|
|
18733
|
+
const globs = yield* GlobSet.compile(patterns).pipe(Effect.mapError((error) => new WorkspacePatternError({
|
|
18512
18734
|
root,
|
|
18513
18735
|
pattern: error.pattern,
|
|
18514
18736
|
kind: "uncompilable",
|
|
18515
18737
|
detail: error.message
|
|
18516
|
-
})))
|
|
18738
|
+
})));
|
|
18739
|
+
const directories = yield* enumerate(root, globs, { maxDepth: options?.maxDepth ?? 32 }).pipe(Effect.mapError((failure) => new WorkspacePatternError({
|
|
18517
18740
|
root,
|
|
18518
18741
|
pattern: failure.pattern,
|
|
18519
18742
|
kind: patternKindOf(failure.kind),
|
|
@@ -18627,7 +18850,10 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18627
18850
|
* (a fabricated root path would leak into consumer path logic), so an
|
|
18628
18851
|
* unstubbed `info()` call is a test-wiring mistake and fails loudly as a
|
|
18629
18852
|
* defect rather than succeeding with a lie or failing with a dishonest
|
|
18630
|
-
* typed error.
|
|
18853
|
+
* typed error. A defect is not absorbed by `Effect.catch` or any
|
|
18854
|
+
* typed-error handler — deliberately, so code under test with a
|
|
18855
|
+
* best-effort `catch` cannot make the mandatory stub look optional; the
|
|
18856
|
+
* unstubbed call still fails the test.
|
|
18631
18857
|
*
|
|
18632
18858
|
* @example
|
|
18633
18859
|
* ```ts
|
|
@@ -18742,7 +18968,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18742
18968
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
18743
18969
|
|
|
18744
18970
|
//#endregion
|
|
18745
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
18971
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/DependencyGraph.js
|
|
18746
18972
|
/**
|
|
18747
18973
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
18748
18974
|
* because it contains a cycle.
|
|
@@ -18887,10 +19113,9 @@ packages: Schema.Array(WorkspacePackage) }) {
|
|
|
18887
19113
|
const { reverse } = this.#index();
|
|
18888
19114
|
const affected = /* @__PURE__ */ new Set();
|
|
18889
19115
|
const queue = [...names];
|
|
18890
|
-
|
|
18891
|
-
const current = queue
|
|
18892
|
-
|
|
18893
|
-
if (current === void 0) break;
|
|
19116
|
+
for (let head = 0; head < queue.length; head += 1) {
|
|
19117
|
+
const current = queue[head];
|
|
19118
|
+
if (current === void 0) continue;
|
|
18894
19119
|
if (affected.has(current)) continue;
|
|
18895
19120
|
affected.add(current);
|
|
18896
19121
|
for (const dependent of reverse.get(current) ?? []) if (!affected.has(dependent)) queue.push(dependent);
|
|
@@ -18921,10 +19146,9 @@ packages: Schema.Array(WorkspacePackage) }) {
|
|
|
18921
19146
|
}));
|
|
18922
19147
|
const needed = /* @__PURE__ */ new Set();
|
|
18923
19148
|
const queue = [...names];
|
|
18924
|
-
|
|
18925
|
-
const current = queue
|
|
18926
|
-
|
|
18927
|
-
if (current === void 0) break;
|
|
19149
|
+
for (let head = 0; head < queue.length; head += 1) {
|
|
19150
|
+
const current = queue[head];
|
|
19151
|
+
if (current === void 0) continue;
|
|
18928
19152
|
if (needed.has(current)) continue;
|
|
18929
19153
|
needed.add(current);
|
|
18930
19154
|
for (const dependency of forward.get(current) ?? []) if (!needed.has(dependency)) queue.push(dependency);
|
|
@@ -20390,7 +20614,7 @@ var Git = class Git extends Context.Service()("@effected/git/Git") {
|
|
|
20390
20614
|
};
|
|
20391
20615
|
|
|
20392
20616
|
//#endregion
|
|
20393
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
20617
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ChangeDetector.js
|
|
20394
20618
|
/**
|
|
20395
20619
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
20396
20620
|
*
|
|
@@ -20672,7 +20896,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
20672
20896
|
}
|
|
20673
20897
|
|
|
20674
20898
|
//#endregion
|
|
20675
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
20899
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/catalogs.js
|
|
20676
20900
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
20677
20901
|
const inlineCatalogs = (manifest) => {
|
|
20678
20902
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -20723,10 +20947,11 @@ const define = (target, key, value) => {
|
|
|
20723
20947
|
*/
|
|
20724
20948
|
const rangeOf = (catalogs, dependency, specifier) => {
|
|
20725
20949
|
if (catalogNameOf(specifier) === null) return void 0;
|
|
20726
|
-
|
|
20950
|
+
const result = resolveFromCatalog(catalogs, {
|
|
20727
20951
|
alias: dependency,
|
|
20728
20952
|
bareSpecifier: specifier
|
|
20729
|
-
})
|
|
20953
|
+
});
|
|
20954
|
+
return matchCatalogResolveResult(result, {
|
|
20730
20955
|
found: (hit) => hit.resolution.specifier,
|
|
20731
20956
|
misconfiguration: (bad) => ({
|
|
20732
20957
|
catalogName: bad.catalogName,
|
|
@@ -20737,7 +20962,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
20737
20962
|
};
|
|
20738
20963
|
|
|
20739
20964
|
//#endregion
|
|
20740
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
20965
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/ConfigDependencyHooks.js
|
|
20741
20966
|
/** Whether `value` is a non-null, non-array object. */
|
|
20742
20967
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20743
20968
|
/**
|
|
@@ -20886,7 +21111,8 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
20886
21111
|
let loaded;
|
|
20887
21112
|
let found = false;
|
|
20888
21113
|
for (const filename of ["pnpmfile.mjs", "pnpmfile.cjs"]) {
|
|
20889
|
-
const
|
|
21114
|
+
const candidatePath = join(root, "node_modules", ".pnpm-config", name, filename);
|
|
21115
|
+
const candidateUrl = pathToFileURL(candidatePath).href;
|
|
20890
21116
|
const result = yield* Effect.result(Effect.tryPromise({
|
|
20891
21117
|
try: () => import(candidateUrl),
|
|
20892
21118
|
catch: (cause) => cause
|
|
@@ -20924,7 +21150,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
20924
21150
|
};
|
|
20925
21151
|
|
|
20926
21152
|
//#endregion
|
|
20927
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
21153
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/PackageManagerName.js
|
|
20928
21154
|
/**
|
|
20929
21155
|
* The four package managers this package understands.
|
|
20930
21156
|
*
|
|
@@ -21214,6 +21440,11 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
|
|
|
21214
21440
|
* reads as a legitimate "no manager here" answer, so a consumer would branch
|
|
21215
21441
|
* on it and proceed, never learning that the test simply forgot to stub.
|
|
21216
21442
|
*
|
|
21443
|
+
* The defect is also not absorbed by `Effect.catch` or any typed-error
|
|
21444
|
+
* handler — deliberately, so code under test with a best-effort `catch`
|
|
21445
|
+
* around detection cannot make the mandatory stub look optional; the
|
|
21446
|
+
* unstubbed call still fails the test.
|
|
21447
|
+
*
|
|
21217
21448
|
* @param overrides - Members to supply; anything omitted dies on use.
|
|
21218
21449
|
*
|
|
21219
21450
|
* @example
|
|
@@ -21248,7 +21479,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
|
|
|
21248
21479
|
};
|
|
21249
21480
|
|
|
21250
21481
|
//#endregion
|
|
21251
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
21482
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/LockfileReader.js
|
|
21252
21483
|
/**
|
|
21253
21484
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
21254
21485
|
*
|
|
@@ -21429,7 +21660,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
|
|
|
21429
21660
|
};
|
|
21430
21661
|
|
|
21431
21662
|
//#endregion
|
|
21432
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
21663
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Publishability.js
|
|
21433
21664
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
21434
21665
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
21435
21666
|
/**
|
|
@@ -21566,8 +21797,15 @@ var PublishabilityDetector = class extends Context.Service()("@effected/workspac
|
|
|
21566
21797
|
* silence — `Layer.mergeAll(myDetector, Workspaces.layer())` resolved to the
|
|
21567
21798
|
* default, because `mergeAll` is last-wins. For a service that decides
|
|
21568
21799
|
* whether a package publishes and to which registry, that silent revert was
|
|
21569
|
-
* the worst available failure.
|
|
21570
|
-
*
|
|
21800
|
+
* the worst available failure.
|
|
21801
|
+
*
|
|
21802
|
+
* The composites do not *require* a detector either — nothing inside them
|
|
21803
|
+
* asks a publishability question, so their `R` stays `FileSystem | Path`.
|
|
21804
|
+
* The requirement instead surfaces in the `R` of each operation that asks
|
|
21805
|
+
* (`VersioningStrategy.detect`, e.g.): a program that asks and never wires
|
|
21806
|
+
* a detector fails to compile where that operation's `R` must close — which
|
|
21807
|
+
* can be far from the layer-wiring site — and a program that never asks
|
|
21808
|
+
* never supplies a publish policy at all.
|
|
21571
21809
|
*/
|
|
21572
21810
|
static layerNpm = Layer.succeed(this, this.npm);
|
|
21573
21811
|
/**
|
|
@@ -21582,7 +21820,7 @@ var PublishabilityDetector = class extends Context.Service()("@effected/workspac
|
|
|
21582
21820
|
};
|
|
21583
21821
|
|
|
21584
21822
|
//#endregion
|
|
21585
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
21823
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/internal/importerVersions.js
|
|
21586
21824
|
/**
|
|
21587
21825
|
* Strip pnpm's peer-disambiguation suffix from a recorded importer version.
|
|
21588
21826
|
*
|
|
@@ -21669,7 +21907,7 @@ const unanimousVersionOf = (index, dependency) => {
|
|
|
21669
21907
|
};
|
|
21670
21908
|
|
|
21671
21909
|
//#endregion
|
|
21672
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
21910
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceCatalogs.js
|
|
21673
21911
|
/**
|
|
21674
21912
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
21675
21913
|
* resolution semantic in the package.
|
|
@@ -22179,7 +22417,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
22179
22417
|
};
|
|
22180
22418
|
|
|
22181
22419
|
//#endregion
|
|
22182
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
22420
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceStateSnapshot.js
|
|
22183
22421
|
const EMPTY = Object.freeze(Object.create(null));
|
|
22184
22422
|
const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
|
|
22185
22423
|
/**
|
|
@@ -22403,7 +22641,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
22403
22641
|
};
|
|
22404
22642
|
|
|
22405
22643
|
//#endregion
|
|
22406
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
22644
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/WorkspaceSnapshots.js
|
|
22407
22645
|
/** Whether `value` is a non-null, non-array object. */
|
|
22408
22646
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22409
22647
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -22519,11 +22757,12 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
22519
22757
|
let inline;
|
|
22520
22758
|
let recorded;
|
|
22521
22759
|
if (Option.isSome(pnpmWorkspaceText)) {
|
|
22522
|
-
const
|
|
22760
|
+
const document = yield* Yaml.parse(pnpmWorkspaceText.value).pipe(Effect.mapError((cause) => new CatalogAssemblyError({
|
|
22523
22761
|
source: "manifest",
|
|
22524
22762
|
path: "pnpm-workspace.yaml",
|
|
22525
22763
|
cause
|
|
22526
|
-
})))
|
|
22764
|
+
})));
|
|
22765
|
+
const pnpmPatterns = pnpmPatternsOf(document);
|
|
22527
22766
|
patterns = pnpmPatterns.length > 0 ? pnpmPatterns : manifestPatternsOf(rootManifest);
|
|
22528
22767
|
inline = yield* CatalogSet.fromWorkspaceYaml(pnpmWorkspaceText.value);
|
|
22529
22768
|
recorded = yield* lockfileRecord(root, ref, "pnpm");
|
|
@@ -22567,7 +22806,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
22567
22806
|
return {
|
|
22568
22807
|
at: Effect.fn("WorkspaceSnapshots.at")(function* (ref) {
|
|
22569
22808
|
const root = yield* Effect.suspend(() => roots.find(options?.cwd ?? process.cwd()));
|
|
22570
|
-
const key = `${root}
|
|
22809
|
+
const key = `${root}\0${ref}`;
|
|
22571
22810
|
let memo = atCaches.get(key);
|
|
22572
22811
|
if (memo === void 0) {
|
|
22573
22812
|
const [resolveOnce, invalidate] = yield* Effect.cachedInvalidateWithTTL(computeAt(root, ref), Duration.infinity);
|
|
@@ -22625,6 +22864,13 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
22625
22864
|
* test-wiring mistake fails loudly as a defect rather than succeeding with a
|
|
22626
22865
|
* lie.
|
|
22627
22866
|
*
|
|
22867
|
+
* **A defect is not absorbed by `Effect.catch` or any typed-error handler**,
|
|
22868
|
+
* and that is the point: code under test with a best-effort `catch` around
|
|
22869
|
+
* its snapshot reads cannot make a mandatory stub look optional — the
|
|
22870
|
+
* unstubbed call still fails the test instead of quietly taking the catch
|
|
22871
|
+
* branch. Only defect-level combinators (`Effect.catchDefect`,
|
|
22872
|
+
* `Effect.exit`) would see it.
|
|
22873
|
+
*
|
|
22628
22874
|
* @example
|
|
22629
22875
|
* ```ts
|
|
22630
22876
|
* import { CatalogSet, WorkspaceSnapshots, WorkspaceStateSnapshot } from "@effected/workspaces";
|
|
@@ -22673,7 +22919,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
22673
22919
|
};
|
|
22674
22920
|
|
|
22675
22921
|
//#endregion
|
|
22676
|
-
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.
|
|
22922
|
+
//#region ../../node_modules/.pnpm/@effected+workspaces@0.9.3_@effected+jsonc@0.5.1_effect@4.0.0-beta.101__effect@4.0.0-beta.101/node_modules/@effected/workspaces/Workspaces.js
|
|
22677
22923
|
const compose = (options, catalogsFactory) => {
|
|
22678
22924
|
const roots = WorkspaceRoot.layer;
|
|
22679
22925
|
const detector = PackageManagerDetector.layer;
|
|
@@ -22706,11 +22952,12 @@ const localExecLayer = (options) => Layer.effect(LocalExec, Effect.gen(function*
|
|
|
22706
22952
|
cause
|
|
22707
22953
|
})));
|
|
22708
22954
|
if (Option.isNone(detected)) return Option.none();
|
|
22709
|
-
const { prefix, dlxPrefix } = LocalExec.prefixes(detected.value.name);
|
|
22955
|
+
const { prefix, dlxPrefix, scriptPrefix } = LocalExec.prefixes(detected.value.name);
|
|
22710
22956
|
return Option.some(ExecContext.make({
|
|
22711
22957
|
label: detected.value.name,
|
|
22712
22958
|
prefix,
|
|
22713
22959
|
dlxPrefix,
|
|
22960
|
+
scriptPrefix,
|
|
22714
22961
|
directory: root.value
|
|
22715
22962
|
}));
|
|
22716
22963
|
}) };
|
|
@@ -22724,13 +22971,23 @@ var Workspaces = class {
|
|
|
22724
22971
|
constructor() {}
|
|
22725
22972
|
/**
|
|
22726
22973
|
* Every service that needs only a filesystem: root, package-manager
|
|
22727
|
-
* detection, discovery, lockfile reading
|
|
22974
|
+
* detection, discovery, lockfile reading and catalogs.
|
|
22728
22975
|
*
|
|
22729
22976
|
* @remarks
|
|
22730
22977
|
* Requires core `FileSystem` and `Path`, which the consumer provides at the
|
|
22731
22978
|
* edge (`@effect/platform-node`, `@effect/platform-bun`, or a test's
|
|
22732
22979
|
* `FileSystem.layerNoop`).
|
|
22733
22980
|
*
|
|
22981
|
+
* **`PublishabilityDetector` is neither provided nor required here.** The
|
|
22982
|
+
* composite used to bake in npm semantics, which a naively-ordered override
|
|
22983
|
+
* silently lost to; now it supplies no default, and — because nothing inside
|
|
22984
|
+
* the composite asks a publishability question — it does not require one in
|
|
22985
|
+
* `R` either. The requirement surfaces in the `R` of each operation that
|
|
22986
|
+
* asks (`VersioningStrategy.detect`, e.g.), so a program that asks and never
|
|
22987
|
+
* wires a detector fails to compile at that operation, and a program that
|
|
22988
|
+
* never asks never supplies a publish policy. Wire one explicitly where
|
|
22989
|
+
* needed: `Layer.mergeAll(Workspaces.layer(), PublishabilityDetector.layerNpm)`.
|
|
22990
|
+
*
|
|
22734
22991
|
* **Bind the result to a `const`.** This is a parameterized factory and
|
|
22735
22992
|
* layers memoize by reference, so calling it twice builds everything twice.
|
|
22736
22993
|
*
|
|
@@ -22786,7 +23043,8 @@ var Workspaces = class {
|
|
|
22786
23043
|
* it. So `commands` declares the narrow contract and we ship the layer.
|
|
22787
23044
|
*
|
|
22788
23045
|
* **The argv knowledge is not duplicated.** `LocalExec.prefixes(name)` is
|
|
22789
|
-
* the one home of the four managers' `exec`/`dlx
|
|
23046
|
+
* the one home of the four managers' `exec`/`dlx`/script-runner prefixes;
|
|
23047
|
+
* this layer
|
|
22790
23048
|
* detects *which* manager owns the directory and asks `commands` what that
|
|
22791
23049
|
* manager's argv looks like. Neither package reimplements the other's
|
|
22792
23050
|
* half.
|
|
@@ -22956,7 +23214,7 @@ const provenanceForRegistry = (registry) => {
|
|
|
22956
23214
|
* @since 0.4.0
|
|
22957
23215
|
* @public
|
|
22958
23216
|
*/
|
|
22959
|
-
var SilkPublishability = class {
|
|
23217
|
+
var SilkPublishability = class SilkPublishability {
|
|
22960
23218
|
/**
|
|
22961
23219
|
* Apply silk publishability rules to a raw `package.json` and the bundler's resolved
|
|
22962
23220
|
* target binding. Targets-first precedence:
|
|
@@ -23088,6 +23346,56 @@ var SilkPublishability = class {
|
|
|
23088
23346
|
return out;
|
|
23089
23347
|
});
|
|
23090
23348
|
}
|
|
23349
|
+
/**
|
|
23350
|
+
* Override of `@effected/workspaces`' `PublishabilityDetector` Tag with pure silk rules.
|
|
23351
|
+
*
|
|
23352
|
+
* @remarks Requires `FileSystem` (captured at layer build); `detect` reads the raw
|
|
23353
|
+
* `package.json` from `pkg.packageJsonPath` and applies `SilkPublishability.detect`.
|
|
23354
|
+
*
|
|
23355
|
+
* @since 0.4.0
|
|
23356
|
+
* @public
|
|
23357
|
+
*/
|
|
23358
|
+
static layer = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
23359
|
+
const fs = yield* FileSystem.FileSystem;
|
|
23360
|
+
return { detect: (pkg) => Effect.gen(function* () {
|
|
23361
|
+
const raw = yield* readRaw(fs, pkg.packageJsonPath);
|
|
23362
|
+
if (!raw) return [];
|
|
23363
|
+
const binding = yield* readTargetsBinding(fs, pkg.path);
|
|
23364
|
+
return SilkPublishability.detect(pkg.name, raw, binding);
|
|
23365
|
+
}) };
|
|
23366
|
+
}));
|
|
23367
|
+
/**
|
|
23368
|
+
* Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
|
|
23369
|
+
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
23370
|
+
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
23371
|
+
*
|
|
23372
|
+
* @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
|
|
23373
|
+
* The kit's `detect` contract no longer receives the workspace root, so the changeset
|
|
23374
|
+
* lookups read it from `pkg.workspaceRoot` — the discovery root the package was found
|
|
23375
|
+
* against, never a filesystem marker walk, which could escape an unmarked root and read
|
|
23376
|
+
* the wrong `.changeset/config.json`.
|
|
23377
|
+
*
|
|
23378
|
+
* @since 0.4.0
|
|
23379
|
+
* @public
|
|
23380
|
+
*/
|
|
23381
|
+
static layerAdaptive = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
23382
|
+
const fs = yield* FileSystem.FileSystem;
|
|
23383
|
+
const config = yield* ChangesetConfig;
|
|
23384
|
+
const vanilla = PublishabilityDetector.npm;
|
|
23385
|
+
return { detect: (pkg) => Effect.gen(function* () {
|
|
23386
|
+
const root = pkg.workspaceRoot;
|
|
23387
|
+
if (yield* config.isIgnored(pkg.name, root)) return [];
|
|
23388
|
+
const mode = yield* config.mode(root);
|
|
23389
|
+
if (mode === "none") return [];
|
|
23390
|
+
if (mode === "silk") {
|
|
23391
|
+
const raw = yield* readRaw(fs, pkg.packageJsonPath);
|
|
23392
|
+
if (!raw) return [];
|
|
23393
|
+
const binding = yield* readTargetsBinding(fs, pkg.path);
|
|
23394
|
+
return SilkPublishability.detect(pkg.name, raw, binding);
|
|
23395
|
+
}
|
|
23396
|
+
return yield* vanilla.detect(pkg);
|
|
23397
|
+
}) };
|
|
23398
|
+
}));
|
|
23091
23399
|
};
|
|
23092
23400
|
/**
|
|
23093
23401
|
* Reduce a directory to a comparable package-relative POSIX path: backslashes to
|
|
@@ -23104,7 +23412,8 @@ var SilkPublishability = class {
|
|
|
23104
23412
|
*/
|
|
23105
23413
|
const normalizeDir = (dir) => {
|
|
23106
23414
|
const slashed = dir.replaceAll("\\", "/");
|
|
23107
|
-
const
|
|
23415
|
+
const withoutPrefix = slashed.startsWith("./") ? slashed.slice(2) : slashed;
|
|
23416
|
+
const normalized = trimTrailingSlashes(withoutPrefix);
|
|
23108
23417
|
return normalized === "" ? "." : normalized;
|
|
23109
23418
|
};
|
|
23110
23419
|
/** True when a built target directory's package.json is `private: true`. Missing/unreadable/malformed → false. */
|
|
@@ -23134,56 +23443,6 @@ const readTargetsBinding = (fs, pkgPath) => fs.readFileString(join(pkgPath, "dis
|
|
|
23134
23443
|
try: () => JSON.parse(content),
|
|
23135
23444
|
catch: () => /* @__PURE__ */ new Error("invalid targets.json")
|
|
23136
23445
|
})), Effect.orElseSucceed(() => null));
|
|
23137
|
-
/**
|
|
23138
|
-
* Override of `@effected/workspaces`' `PublishabilityDetector` Tag with pure silk rules.
|
|
23139
|
-
*
|
|
23140
|
-
* @remarks Requires `FileSystem` (captured at layer build); `detect` reads the raw
|
|
23141
|
-
* `package.json` from `pkg.packageJsonPath` and applies `SilkPublishability.detect`.
|
|
23142
|
-
*
|
|
23143
|
-
* @since 0.4.0
|
|
23144
|
-
* @public
|
|
23145
|
-
*/
|
|
23146
|
-
const SilkPublishabilityDetectorLive = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
23147
|
-
const fs = yield* FileSystem.FileSystem;
|
|
23148
|
-
return { detect: (pkg) => Effect.gen(function* () {
|
|
23149
|
-
const raw = yield* readRaw(fs, pkg.packageJsonPath);
|
|
23150
|
-
if (!raw) return [];
|
|
23151
|
-
const binding = yield* readTargetsBinding(fs, pkg.path);
|
|
23152
|
-
return SilkPublishability.detect(pkg.name, raw, binding);
|
|
23153
|
-
}) };
|
|
23154
|
-
}));
|
|
23155
|
-
/**
|
|
23156
|
-
* Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
|
|
23157
|
-
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
23158
|
-
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
23159
|
-
*
|
|
23160
|
-
* @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
|
|
23161
|
-
* The kit's `detect` contract no longer receives the workspace root, so the changeset
|
|
23162
|
-
* lookups read it from `pkg.workspaceRoot` — the discovery root the package was found
|
|
23163
|
-
* against, never a filesystem marker walk, which could escape an unmarked root and read
|
|
23164
|
-
* the wrong `.changeset/config.json`.
|
|
23165
|
-
*
|
|
23166
|
-
* @since 0.4.0
|
|
23167
|
-
* @public
|
|
23168
|
-
*/
|
|
23169
|
-
const PublishabilityDetectorAdaptiveLive = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
23170
|
-
const fs = yield* FileSystem.FileSystem;
|
|
23171
|
-
const config = yield* ChangesetConfig;
|
|
23172
|
-
const vanilla = PublishabilityDetector.npm;
|
|
23173
|
-
return { detect: (pkg) => Effect.gen(function* () {
|
|
23174
|
-
const root = pkg.workspaceRoot;
|
|
23175
|
-
if (yield* config.isIgnored(pkg.name, root)) return [];
|
|
23176
|
-
const mode = yield* config.mode(root);
|
|
23177
|
-
if (mode === "none") return [];
|
|
23178
|
-
if (mode === "silk") {
|
|
23179
|
-
const raw = yield* readRaw(fs, pkg.packageJsonPath);
|
|
23180
|
-
if (!raw) return [];
|
|
23181
|
-
const binding = yield* readTargetsBinding(fs, pkg.path);
|
|
23182
|
-
return SilkPublishability.detect(pkg.name, raw, binding);
|
|
23183
|
-
}
|
|
23184
|
-
return yield* vanilla.detect(pkg);
|
|
23185
|
-
}) };
|
|
23186
|
-
}));
|
|
23187
23446
|
|
|
23188
23447
|
//#endregion
|
|
23189
23448
|
//#region ../silk-effects/dist/dev/pkg/_virtual/_rolldown/runtime.js
|
|
@@ -25010,21 +25269,20 @@ function getGitHubInfo(params) {
|
|
|
25010
25269
|
/**
|
|
25011
25270
|
* GitHub service for fetching commit metadata.
|
|
25012
25271
|
*
|
|
25013
|
-
* Defines the {@link GitHubService} Effect service tag,
|
|
25014
|
-
*
|
|
25272
|
+
* Defines the {@link GitHubService} Effect service tag, its
|
|
25273
|
+
* `GitHubService.layer` production layer backed by `\@changesets/get-github-info`,
|
|
25015
25274
|
* and the {@link makeGitHubTest} helper for constructing deterministic test
|
|
25016
25275
|
* layers.
|
|
25017
25276
|
*
|
|
25018
25277
|
* @remarks
|
|
25019
25278
|
* The GitHub service is consumed by the changelog formatters to resolve
|
|
25020
25279
|
* commit hashes into pull-request numbers, author usernames, and link URLs.
|
|
25021
|
-
* In production,
|
|
25280
|
+
* In production, `GitHubService.layer` calls the GitHub REST API via the
|
|
25022
25281
|
* vendored `getGitHubInfo` wrapper. In tests, {@link makeGitHubTest}
|
|
25023
25282
|
* returns canned responses from a `Map` keyed by commit hash.
|
|
25024
25283
|
*
|
|
25025
25284
|
* @see {@link GitHubService} for the Effect service tag
|
|
25026
25285
|
* @see {@link GitHubServiceShape} for the service interface
|
|
25027
|
-
* @see {@link GitHubLive} for the production layer
|
|
25028
25286
|
* @see {@link makeGitHubTest} for constructing test layers
|
|
25029
25287
|
*/
|
|
25030
25288
|
/**
|
|
@@ -25038,13 +25296,13 @@ function getGitHubInfo(params) {
|
|
|
25038
25296
|
* This tag follows the standard Effect `Context.Service` pattern. Two layers
|
|
25039
25297
|
* are provided out of the box:
|
|
25040
25298
|
*
|
|
25041
|
-
* -
|
|
25299
|
+
* - `GitHubService.layer` — production layer backed by the GitHub REST API
|
|
25042
25300
|
* - {@link makeGitHubTest} — factory for deterministic test layers
|
|
25043
25301
|
*
|
|
25044
25302
|
* @example
|
|
25045
25303
|
* ```typescript
|
|
25046
|
-
* import { Effect
|
|
25047
|
-
* import { GitHubService
|
|
25304
|
+
* import { Effect } from "effect";
|
|
25305
|
+
* import { GitHubService } from "\@savvy-web/changesets";
|
|
25048
25306
|
*
|
|
25049
25307
|
* const program = Effect.gen(function* () {
|
|
25050
25308
|
* const github = yield* GitHubService;
|
|
@@ -25056,7 +25314,7 @@ function getGitHubInfo(params) {
|
|
|
25056
25314
|
* });
|
|
25057
25315
|
*
|
|
25058
25316
|
* // Provide the live layer and run
|
|
25059
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
25317
|
+
* Effect.runPromise(program.pipe(Effect.provide(GitHubService.layer)));
|
|
25060
25318
|
* ```
|
|
25061
25319
|
*
|
|
25062
25320
|
* @example Creating a test layer with canned responses
|
|
@@ -25080,41 +25338,41 @@ function getGitHubInfo(params) {
|
|
|
25080
25338
|
* ```
|
|
25081
25339
|
*
|
|
25082
25340
|
* @see {@link GitHubServiceShape} for the service interface
|
|
25083
|
-
* @see {@link GitHubLive} for the production layer
|
|
25084
25341
|
* @see {@link makeGitHubTest} for creating test layers
|
|
25085
25342
|
*
|
|
25086
25343
|
* @public
|
|
25087
25344
|
*/
|
|
25088
|
-
var GitHubService = class extends Context.Service()("GitHubService") {
|
|
25089
|
-
/**
|
|
25090
|
-
* Production layer for {@link GitHubService}.
|
|
25091
|
-
*
|
|
25092
|
-
* Delegates to `\@changesets/get-github-info` to fetch commit metadata
|
|
25093
|
-
* from the GitHub REST API. Requires a `GITHUB_TOKEN` environment variable
|
|
25094
|
-
* to be set for authenticated requests.
|
|
25095
|
-
*
|
|
25096
|
-
* @remarks
|
|
25097
|
-
* This layer is used by the `\@savvy-web/changesets/changelog` entry point
|
|
25098
|
-
* to resolve commit hashes into PR numbers and author attribution. It is
|
|
25099
|
-
* used by the changelog formatter's
|
|
25100
|
-
* `MainLayer`.
|
|
25101
|
-
*
|
|
25102
|
-
* @example
|
|
25103
|
-
* ```typescript
|
|
25104
|
-
* import { Effect } from "effect";
|
|
25105
|
-
* import { GitHubService
|
|
25106
|
-
*
|
|
25107
|
-
* const program = Effect.gen(function* () {
|
|
25108
|
-
* const github = yield* GitHubService;
|
|
25109
|
-
* return yield* github.getInfo({ commit: "abc1234", repo: "owner/repo" });
|
|
25110
|
-
* });
|
|
25111
|
-
*
|
|
25112
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
25113
|
-
* ```
|
|
25114
|
-
*
|
|
25115
|
-
* @public
|
|
25116
|
-
*/
|
|
25117
|
-
|
|
25345
|
+
var GitHubService = class extends Context.Service()("GitHubService") {
|
|
25346
|
+
/**
|
|
25347
|
+
* Production layer for {@link GitHubService}.
|
|
25348
|
+
*
|
|
25349
|
+
* Delegates to `\@changesets/get-github-info` to fetch commit metadata
|
|
25350
|
+
* from the GitHub REST API. Requires a `GITHUB_TOKEN` environment variable
|
|
25351
|
+
* to be set for authenticated requests.
|
|
25352
|
+
*
|
|
25353
|
+
* @remarks
|
|
25354
|
+
* This layer is used by the `\@savvy-web/changesets/changelog` entry point
|
|
25355
|
+
* to resolve commit hashes into PR numbers and author attribution. It is
|
|
25356
|
+
* used by the changelog formatter's
|
|
25357
|
+
* `MainLayer`.
|
|
25358
|
+
*
|
|
25359
|
+
* @example
|
|
25360
|
+
* ```typescript
|
|
25361
|
+
* import { Effect } from "effect";
|
|
25362
|
+
* import { GitHubService } from "\@savvy-web/changesets";
|
|
25363
|
+
*
|
|
25364
|
+
* const program = Effect.gen(function* () {
|
|
25365
|
+
* const github = yield* GitHubService;
|
|
25366
|
+
* return yield* github.getInfo({ commit: "abc1234", repo: "owner/repo" });
|
|
25367
|
+
* });
|
|
25368
|
+
*
|
|
25369
|
+
* Effect.runPromise(program.pipe(Effect.provide(GitHubService.layer)));
|
|
25370
|
+
* ```
|
|
25371
|
+
*
|
|
25372
|
+
* @public
|
|
25373
|
+
*/
|
|
25374
|
+
static layer = Layer.succeed(this, { getInfo: getGitHubInfo });
|
|
25375
|
+
};
|
|
25118
25376
|
/**
|
|
25119
25377
|
* Create a test layer for {@link GitHubService} with pre-configured responses.
|
|
25120
25378
|
*
|
|
@@ -35612,7 +35870,9 @@ function factoryLabel(effects, ok, nok, type, markerType, stringType) {
|
|
|
35612
35870
|
* @type {State}
|
|
35613
35871
|
*/
|
|
35614
35872
|
function atBreak(code) {
|
|
35615
|
-
if (size > 999 || code === null || code === 91 || code === 93 && !seen ||
|
|
35873
|
+
if (size > 999 || code === null || code === 91 || code === 93 && !seen ||
|
|
35874
|
+
/* c8 ignore next 3 */
|
|
35875
|
+
code === 94 && !size && "_hiddenFootnoteSupport" in self.parser.constructs) return nok(code);
|
|
35616
35876
|
if (code === 93) {
|
|
35617
35877
|
effects.exit(stringType);
|
|
35618
35878
|
effects.enter(markerType);
|
|
@@ -45267,9 +45527,10 @@ function serializeDependencyTable(rows) {
|
|
|
45267
45527
|
* @internal
|
|
45268
45528
|
*/
|
|
45269
45529
|
function serializeDependencyTableToMarkdown(rows) {
|
|
45530
|
+
const table = serializeDependencyTable(rows);
|
|
45270
45531
|
return stringifyMarkdown({
|
|
45271
45532
|
type: "root",
|
|
45272
|
-
children: [
|
|
45533
|
+
children: [table]
|
|
45273
45534
|
}).trim();
|
|
45274
45535
|
}
|
|
45275
45536
|
/**
|
|
@@ -45709,6 +45970,22 @@ function inferDependencyType(dep) {
|
|
|
45709
45970
|
return "dependency";
|
|
45710
45971
|
}
|
|
45711
45972
|
/**
|
|
45973
|
+
* Narrow a dependency update to one with both version endpoints present.
|
|
45974
|
+
*
|
|
45975
|
+
* `@changesets/types` only guarantees `oldVersion`/`newVersion` on the
|
|
45976
|
+
* `major`/`minor`/`patch` arms of `ComprehensiveRelease`; a `type: "none"`
|
|
45977
|
+
* entry may carry neither. The table's `From`/`To` columns are validated
|
|
45978
|
+
* version strings, so an entry missing either endpoint has no row to render.
|
|
45979
|
+
*
|
|
45980
|
+
* @param dep - The dependency update to test
|
|
45981
|
+
* @returns `true` when both `oldVersion` and `newVersion` are present
|
|
45982
|
+
*
|
|
45983
|
+
* @internal
|
|
45984
|
+
*/
|
|
45985
|
+
function isVersioned(dep) {
|
|
45986
|
+
return dep.oldVersion !== void 0 && dep.newVersion !== void 0;
|
|
45987
|
+
}
|
|
45988
|
+
/**
|
|
45712
45989
|
* Format dependency release lines as a structured markdown table.
|
|
45713
45990
|
*
|
|
45714
45991
|
* This is the core Effect program that implements the `getDependencyReleaseLine`
|
|
@@ -45719,8 +45996,9 @@ function inferDependencyType(dep) {
|
|
|
45719
45996
|
* The function maps each `ModCompWithPackage` entry to a `DependencyTableRow`,
|
|
45720
45997
|
* inferring the dependency type from the consuming package's `package.json`,
|
|
45721
45998
|
* then delegates to `serializeDependencyTableToMarkdown` for GFM table
|
|
45722
|
-
* rendering, prefixed with a `### Dependencies` heading.
|
|
45723
|
-
*
|
|
45999
|
+
* rendering, prefixed with a `### Dependencies` heading. Entries missing
|
|
46000
|
+
* either version endpoint are dropped by {@link isVersioned}; the function
|
|
46001
|
+
* returns an empty string when no rows survive.
|
|
45724
46002
|
*
|
|
45725
46003
|
* The `_changesets` and `_options` parameters are part of the Changesets API
|
|
45726
46004
|
* contract but are not used in the table format. They are retained for
|
|
@@ -45729,19 +46007,21 @@ function inferDependencyType(dep) {
|
|
|
45729
46007
|
* @param _changesets - Changesets that caused the dependency updates (unused in table format)
|
|
45730
46008
|
* @param dependenciesUpdated - The list of dependencies that were updated, including old/new versions
|
|
45731
46009
|
* @param _options - Validated configuration options (unused in table format)
|
|
45732
|
-
* @returns An `Effect` that resolves to a `### Dependencies` heading followed by a formatted markdown table string, or empty string if no dependencies were updated
|
|
46010
|
+
* @returns An `Effect` that resolves to a `### Dependencies` heading followed by a formatted markdown table string, or empty string if no dependencies with both version endpoints were updated
|
|
45733
46011
|
*/
|
|
45734
46012
|
function getDependencyReleaseLine(_changesets, dependenciesUpdated, _options) {
|
|
45735
46013
|
return Effect.gen(function* () {
|
|
45736
46014
|
if (dependenciesUpdated.length === 0) return "";
|
|
45737
46015
|
yield* GitHubService;
|
|
45738
|
-
|
|
46016
|
+
const rows = dependenciesUpdated.filter(isVersioned).map((dep) => ({
|
|
45739
46017
|
dependency: dep.name,
|
|
45740
46018
|
type: inferDependencyType(dep),
|
|
45741
46019
|
action: "updated",
|
|
45742
46020
|
from: dep.oldVersion,
|
|
45743
46021
|
to: dep.newVersion
|
|
45744
|
-
}))
|
|
46022
|
+
}));
|
|
46023
|
+
if (rows.length === 0) return "";
|
|
46024
|
+
return `### Dependencies\n\n${serializeDependencyTableToMarkdown(rows)}`;
|
|
45745
46025
|
});
|
|
45746
46026
|
}
|
|
45747
46027
|
|
|
@@ -46205,7 +46485,8 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46205
46485
|
const parsed = parseChangesetSections(changeset.summary);
|
|
46206
46486
|
const firstLine = changeset.summary.split("\n")[0];
|
|
46207
46487
|
const commitMsg = parseCommitMessage(firstLine);
|
|
46208
|
-
const
|
|
46488
|
+
const bodyText = changeset.summary.split("\n").slice(1).join("\n");
|
|
46489
|
+
const issueRefs = parseIssueReferences(bodyText);
|
|
46209
46490
|
const attribution = commitInfo ? formatPRAndUserAttribution(commitInfo.pull ?? void 0, commitInfo.user ?? void 0, commitInfo.links) : "";
|
|
46210
46491
|
if (parsed.sections.length > 0) {
|
|
46211
46492
|
const lines = [];
|
|
@@ -46231,11 +46512,13 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46231
46512
|
}
|
|
46232
46513
|
return `${lines.join("\n").trimEnd()}${attribution}`;
|
|
46233
46514
|
}
|
|
46234
|
-
|
|
46235
|
-
|
|
46515
|
+
const commitType = commitMsg.type ?? versionType;
|
|
46516
|
+
const entryInput = {
|
|
46517
|
+
type: resolveCommitType(commitType, commitMsg.scope, commitMsg.breaking).heading,
|
|
46236
46518
|
summary: changeset.summary,
|
|
46237
46519
|
issues: issueRefs
|
|
46238
|
-
}
|
|
46520
|
+
};
|
|
46521
|
+
return `- ${formatChangelogEntry(entryInput, { repo: options.repo })}${attribution}`;
|
|
46239
46522
|
});
|
|
46240
46523
|
}
|
|
46241
46524
|
|
|
@@ -46252,7 +46535,7 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46252
46535
|
* @remarks
|
|
46253
46536
|
* The module composes two Effect programs — {@link getReleaseLine} and
|
|
46254
46537
|
* {@link getDependencyReleaseLine} — and runs each through
|
|
46255
|
-
* `Effect.runPromise` with
|
|
46538
|
+
* `Effect.runPromise` with `GitHubService.layer` (for commit metadata). Options are
|
|
46256
46539
|
* validated at the boundary via `validateChangesetOptions` before being
|
|
46257
46540
|
* passed to the formatters.
|
|
46258
46541
|
*
|
|
@@ -46294,14 +46577,14 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46294
46577
|
/**
|
|
46295
46578
|
* The layer providing every service the formatters need.
|
|
46296
46579
|
*
|
|
46297
|
-
*
|
|
46580
|
+
* `GitHubService.layer` satisfies the requirements of both `getReleaseLine` and
|
|
46298
46581
|
* `getDependencyReleaseLine`, which each need only `GitHubService`. Markdown
|
|
46299
46582
|
* parsing is not a layer: the formatters call the remark pipeline's
|
|
46300
46583
|
* `parseMarkdown` / `stringifyMarkdown` functions directly.
|
|
46301
46584
|
*
|
|
46302
46585
|
* @internal
|
|
46303
46586
|
*/
|
|
46304
|
-
const MainLayer =
|
|
46587
|
+
const MainLayer = GitHubService.layer;
|
|
46305
46588
|
/**
|
|
46306
46589
|
* Changesets API `ChangelogFunctions` implementation.
|
|
46307
46590
|
*
|
|
@@ -46315,13 +46598,15 @@ const MainLayer = GitHubLive;
|
|
|
46315
46598
|
const changelogFunctions$1 = {
|
|
46316
46599
|
getReleaseLine: async (changeset, versionType, options) => {
|
|
46317
46600
|
const program = Effect.gen(function* () {
|
|
46318
|
-
|
|
46601
|
+
const opts = yield* validateChangesetOptions(options);
|
|
46602
|
+
return yield* getReleaseLine(changeset, versionType, opts);
|
|
46319
46603
|
});
|
|
46320
46604
|
return Effect.runPromise(program.pipe(Effect.provide(MainLayer)));
|
|
46321
46605
|
},
|
|
46322
46606
|
getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {
|
|
46323
46607
|
const program = Effect.gen(function* () {
|
|
46324
|
-
|
|
46608
|
+
const opts = yield* validateChangesetOptions(options);
|
|
46609
|
+
return yield* getDependencyReleaseLine(changesets, dependenciesUpdated, opts);
|
|
46325
46610
|
});
|
|
46326
46611
|
return Effect.runPromise(program.pipe(Effect.provide(MainLayer)));
|
|
46327
46612
|
}
|
|
@@ -47786,7 +48071,8 @@ var ChangelogTransformer = class ChangelogTransformer {
|
|
|
47786
48071
|
*/
|
|
47787
48072
|
static transformFile(filePath, options) {
|
|
47788
48073
|
const content = readFileSync(filePath, "utf-8");
|
|
47789
|
-
|
|
48074
|
+
const result = ChangelogTransformer.transformContent(content, options);
|
|
48075
|
+
writeFileSync(filePath, result, "utf-8");
|
|
47790
48076
|
}
|
|
47791
48077
|
};
|
|
47792
48078
|
|
|
@@ -47822,7 +48108,6 @@ var ChangelogTransformer = class ChangelogTransformer {
|
|
|
47822
48108
|
* {@link ConfigInspectorShape.classify} calls reuse it.
|
|
47823
48109
|
*
|
|
47824
48110
|
* @see {@link ConfigInspector} for the Effect service tag
|
|
47825
|
-
* @see {@link ConfigInspectorLive} for the production layer
|
|
47826
48111
|
*
|
|
47827
48112
|
*/
|
|
47828
48113
|
/** A `versionFiles` entry expanded to its absolute target paths. @public */
|
|
@@ -47876,7 +48161,7 @@ const ClassificationSchema = Schema.Struct({
|
|
|
47876
48161
|
* @example
|
|
47877
48162
|
* ```typescript
|
|
47878
48163
|
* import { Effect } from "effect";
|
|
47879
|
-
* import { ConfigInspector
|
|
48164
|
+
* import { ConfigInspector } from "@savvy-web/changesets";
|
|
47880
48165
|
*
|
|
47881
48166
|
* const program = Effect.gen(function* () {
|
|
47882
48167
|
* const inspector = yield* ConfigInspector;
|
|
@@ -47884,12 +48169,24 @@ const ClassificationSchema = Schema.Struct({
|
|
|
47884
48169
|
* return config.packages.map((p) => p.name);
|
|
47885
48170
|
* });
|
|
47886
48171
|
*
|
|
47887
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
48172
|
+
* Effect.runPromise(program.pipe(Effect.provide(ConfigInspector.layer)));
|
|
47888
48173
|
* ```
|
|
47889
48174
|
*
|
|
47890
48175
|
* @public
|
|
47891
48176
|
*/
|
|
47892
|
-
var ConfigInspector = class extends Context.Service()("ConfigInspector") {
|
|
48177
|
+
var ConfigInspector = class extends Context.Service()("ConfigInspector") {
|
|
48178
|
+
/**
|
|
48179
|
+
* Production layer for {@link ConfigInspector}.
|
|
48180
|
+
*
|
|
48181
|
+
* Requires {@link ChangesetConfigReader} and `WorkspaceDiscovery`
|
|
48182
|
+
* in the environment.
|
|
48183
|
+
*
|
|
48184
|
+
* @public
|
|
48185
|
+
*/
|
|
48186
|
+
static layer = Layer.effect(this, Effect.gen(function* () {
|
|
48187
|
+
return makeShape$3(yield* ChangesetConfigReader, yield* WorkspaceDiscovery, yield* FileSystem.FileSystem);
|
|
48188
|
+
}));
|
|
48189
|
+
};
|
|
47893
48190
|
/**
|
|
47894
48191
|
* Pull the changelog formatter ID and its options object out of the raw
|
|
47895
48192
|
* `.changeset/config.json` shape (where `changelog` may be a tuple, a string,
|
|
@@ -48283,22 +48580,11 @@ function classifyOne(inspected, path) {
|
|
|
48283
48580
|
};
|
|
48284
48581
|
}
|
|
48285
48582
|
/**
|
|
48286
|
-
* Live layer for {@link ConfigInspector}.
|
|
48287
|
-
*
|
|
48288
|
-
* Requires {@link ChangesetConfigReader} and `WorkspaceDiscovery`
|
|
48289
|
-
* in the environment.
|
|
48290
|
-
*
|
|
48291
|
-
* @public
|
|
48292
|
-
*/
|
|
48293
|
-
const ConfigInspectorLive = Layer.effect(ConfigInspector, Effect.gen(function* () {
|
|
48294
|
-
return makeShape$3(yield* ChangesetConfigReader, yield* WorkspaceDiscovery, yield* FileSystem.FileSystem);
|
|
48295
|
-
}));
|
|
48296
|
-
/**
|
|
48297
48583
|
* Test factory — build a {@link ConfigInspector} that returns a fixed
|
|
48298
48584
|
* {@link InspectedConfig} without touching the filesystem.
|
|
48299
48585
|
*
|
|
48300
48586
|
* Tests that need to exercise the inspect/classify logic against real files
|
|
48301
|
-
* should compose `
|
|
48587
|
+
* should compose `ConfigInspector.layer` with test layers for
|
|
48302
48588
|
* `ChangesetConfigReader` and `WorkspaceDiscovery` instead.
|
|
48303
48589
|
*
|
|
48304
48590
|
* @public
|
|
@@ -48345,7 +48631,7 @@ const BranchAnalysisSchema = Schema.Struct({
|
|
|
48345
48631
|
* @example
|
|
48346
48632
|
* ```typescript
|
|
48347
48633
|
* import { Effect } from "effect";
|
|
48348
|
-
* import { BranchAnalyzer,
|
|
48634
|
+
* import { BranchAnalyzer, ConfigInspector } from "@savvy-web/changesets";
|
|
48349
48635
|
*
|
|
48350
48636
|
* const program = Effect.gen(function* () {
|
|
48351
48637
|
* const analyzer = yield* BranchAnalyzer;
|
|
@@ -48355,16 +48641,30 @@ const BranchAnalysisSchema = Schema.Struct({
|
|
|
48355
48641
|
*
|
|
48356
48642
|
* Effect.runPromise(
|
|
48357
48643
|
* program.pipe(
|
|
48358
|
-
* Effect.provide(
|
|
48359
|
-
* Effect.provide(
|
|
48360
|
-
* // ... +
|
|
48644
|
+
* Effect.provide(BranchAnalyzer.layer),
|
|
48645
|
+
* Effect.provide(ConfigInspector.layer),
|
|
48646
|
+
* // ... + ChangesetConfigReader.layer + kit workspace layers + NodeServices.layer
|
|
48361
48647
|
* ),
|
|
48362
48648
|
* );
|
|
48363
48649
|
* ```
|
|
48364
48650
|
*
|
|
48365
48651
|
* @public
|
|
48366
48652
|
*/
|
|
48367
|
-
var BranchAnalyzer = class extends Context.Service()("BranchAnalyzer") {
|
|
48653
|
+
var BranchAnalyzer = class extends Context.Service()("BranchAnalyzer") {
|
|
48654
|
+
/**
|
|
48655
|
+
* Production layer for {@link BranchAnalyzer}.
|
|
48656
|
+
*
|
|
48657
|
+
* Requires {@link ConfigInspector} (which in turn requires
|
|
48658
|
+
* `ChangesetConfigReader` and `WorkspaceDiscovery`) and a
|
|
48659
|
+
* `ChildProcessSpawner` (satisfied by `NodeServices.layer`) for the
|
|
48660
|
+
* internally-composed `@effected/git` layer.
|
|
48661
|
+
*
|
|
48662
|
+
* @public
|
|
48663
|
+
*/
|
|
48664
|
+
static layer = Layer.effect(this, Effect.gen(function* () {
|
|
48665
|
+
return makeShape$2(yield* ConfigInspector, yield* Git);
|
|
48666
|
+
})).pipe(Layer.provide(Git.layer));
|
|
48667
|
+
};
|
|
48368
48668
|
/**
|
|
48369
48669
|
* Fold a `@effected/git` typed failure into this package's {@link GitError},
|
|
48370
48670
|
* preserving the public `ConfigurationError | GitError` error channel.
|
|
@@ -48448,19 +48748,6 @@ function makeShape$2(inspector, git) {
|
|
|
48448
48748
|
return { analyzeBranch };
|
|
48449
48749
|
}
|
|
48450
48750
|
/**
|
|
48451
|
-
* Live layer for {@link BranchAnalyzer}.
|
|
48452
|
-
*
|
|
48453
|
-
* Requires {@link ConfigInspector} (which in turn requires
|
|
48454
|
-
* `ChangesetConfigReader` and `WorkspaceDiscovery`) and a
|
|
48455
|
-
* `ChildProcessSpawner` (satisfied by `NodeServices.layer`) for the
|
|
48456
|
-
* internally-composed `@effected/git` layer.
|
|
48457
|
-
*
|
|
48458
|
-
* @public
|
|
48459
|
-
*/
|
|
48460
|
-
const BranchAnalyzerLive = Layer.effect(BranchAnalyzer, Effect.gen(function* () {
|
|
48461
|
-
return makeShape$2(yield* ConfigInspector, yield* Git);
|
|
48462
|
-
})).pipe(Layer.provide(Git.layer));
|
|
48463
|
-
/**
|
|
48464
48751
|
* Test factory — build a {@link BranchAnalyzer} that returns a fixed
|
|
48465
48752
|
* {@link BranchAnalysis} for any input.
|
|
48466
48753
|
*
|
|
@@ -48489,7 +48776,7 @@ function makeBranchAnalyzerTest(fixed) {
|
|
|
48489
48776
|
* ```typescript
|
|
48490
48777
|
* import { Effect } from "effect";
|
|
48491
48778
|
* import type { ChangesetOptions } from "\@savvy-web/changesets";
|
|
48492
|
-
* import { ChangelogService
|
|
48779
|
+
* import { ChangelogService } from "\@savvy-web/changesets";
|
|
48493
48780
|
*
|
|
48494
48781
|
* const program = Effect.gen(function* () {
|
|
48495
48782
|
* const changelog = yield* ChangelogService;
|
|
@@ -48686,10 +48973,10 @@ function gitListChangesetFilesAtRef(cwd, ref) {
|
|
|
48686
48973
|
*
|
|
48687
48974
|
* @remarks
|
|
48688
48975
|
* Uses the currently-active {@link SilkPublishability} — wire the
|
|
48689
|
-
*
|
|
48976
|
+
* `SilkPublishability.layer` layer to get silk semantics.
|
|
48690
48977
|
*
|
|
48691
48978
|
* The kit's `PublishabilityDetector.detect` contract no longer receives the
|
|
48692
|
-
* workspace root — the ignore/mode-aware `
|
|
48979
|
+
* workspace root — the ignore/mode-aware `SilkPublishability.layerAdaptive`
|
|
48693
48980
|
* derives the `.changeset/config.json` root per package from the package's
|
|
48694
48981
|
* own discovery coordinates (`pkg.path` ascended by `pkg.relativePath`).
|
|
48695
48982
|
* The `root` parameter is retained for signature stability
|
|
@@ -48744,7 +49031,6 @@ function listPublishablePackageNames(packages, _root) {
|
|
|
48744
49031
|
* and MCP tools are thin adapters over this service.
|
|
48745
49032
|
*
|
|
48746
49033
|
* @see {@link DepsRegen} for the service tag
|
|
48747
|
-
* @see {@link DepsRegenLive} for the production layer
|
|
48748
49034
|
*
|
|
48749
49035
|
*/
|
|
48750
49036
|
const ADJECTIVES = [
|
|
@@ -48943,7 +49229,30 @@ function renderChangesetContent(diff) {
|
|
|
48943
49229
|
*
|
|
48944
49230
|
* @public
|
|
48945
49231
|
*/
|
|
48946
|
-
var DepsRegen = class extends Context.Service()("Changesets/DepsRegen") {
|
|
49232
|
+
var DepsRegen = class extends Context.Service()("Changesets/DepsRegen") {
|
|
49233
|
+
/**
|
|
49234
|
+
* Production layer for {@link DepsRegen}.
|
|
49235
|
+
*
|
|
49236
|
+
* Requires `WorkspaceSnapshots`, `WorkspaceDiscovery`,
|
|
49237
|
+
* `PublishabilityDetector` (all from `@effected/workspaces`),
|
|
49238
|
+
* `Git` (from `@effected/git`, backing merge-base resolution),
|
|
49239
|
+
* {@link ConfigInspector}, {@link ChangesetConfig}, and
|
|
49240
|
+
* `FileSystem.FileSystem` (resolved once at construction and closed over by
|
|
49241
|
+
* the shape, keeping `plan`/`execute` themselves requirement-free).
|
|
49242
|
+
*
|
|
49243
|
+
* @public
|
|
49244
|
+
*/
|
|
49245
|
+
static layer = Layer.effect(this, Effect.gen(function* () {
|
|
49246
|
+
const snapshots = yield* WorkspaceSnapshots;
|
|
49247
|
+
const inspector = yield* ConfigInspector;
|
|
49248
|
+
const discovery = yield* WorkspaceDiscovery;
|
|
49249
|
+
const detector = yield* PublishabilityDetector;
|
|
49250
|
+
const config = yield* ChangesetConfig;
|
|
49251
|
+
const fs = yield* FileSystem.FileSystem;
|
|
49252
|
+
const git = yield* Git;
|
|
49253
|
+
return makeShape$1(snapshots, inspector, discovery, detector, config, fs, Layer.succeed(Git, git));
|
|
49254
|
+
}));
|
|
49255
|
+
};
|
|
48947
49256
|
/**
|
|
48948
49257
|
* Build a {@link DepsRegenShape} that closes over already-resolved service
|
|
48949
49258
|
* implementations, keeping the public `plan`/`execute` signatures
|
|
@@ -48963,7 +49272,9 @@ function makeShape$1(snapshots, inspector, discovery, detector, config, fs, prov
|
|
|
48963
49272
|
if (!baseBranch) baseBranch = (yield* inspector.inspect(resolvedCwd).pipe(Effect.catchTag("ConfigurationError", () => Effect.succeed({ baseBranch: "main" })))).baseBranch;
|
|
48964
49273
|
fromRef = yield* gitMergeBase(resolvedCwd, baseBranch).pipe(Effect.provide(provideGit));
|
|
48965
49274
|
}
|
|
48966
|
-
const
|
|
49275
|
+
const before = yield* snapshots.at(fromRef);
|
|
49276
|
+
const after = options.to ? yield* snapshots.at(options.to) : yield* snapshots.worktree();
|
|
49277
|
+
const rawDiffs = computeWorkspaceDependencyDiffs(before, after);
|
|
48967
49278
|
const explicitTargets = /* @__PURE__ */ new Set([...options.packages ?? [], ...options.package ? [options.package] : []]);
|
|
48968
49279
|
const excluded = new Set(options.exclude ?? []);
|
|
48969
49280
|
const livePackages = yield* discovery.listPackages();
|
|
@@ -49036,29 +49347,7 @@ function makeShape$1(snapshots, inspector, discovery, detector, config, fs, prov
|
|
|
49036
49347
|
execute
|
|
49037
49348
|
};
|
|
49038
49349
|
}
|
|
49039
|
-
|
|
49040
|
-
* Live layer for {@link DepsRegen}.
|
|
49041
|
-
*
|
|
49042
|
-
* Requires `WorkspaceSnapshots`, `WorkspaceDiscovery`,
|
|
49043
|
-
* `PublishabilityDetector` (all from `@effected/workspaces`),
|
|
49044
|
-
* `Git` (from `@effected/git`, backing merge-base resolution),
|
|
49045
|
-
* {@link ConfigInspector}, {@link ChangesetConfig}, and
|
|
49046
|
-
* `FileSystem.FileSystem` (resolved once at construction and closed over by
|
|
49047
|
-
* the shape, keeping `plan`/`execute` themselves requirement-free).
|
|
49048
|
-
*
|
|
49049
|
-
* @public
|
|
49050
|
-
*/
|
|
49051
|
-
const DepsRegenLive = Layer.effect(DepsRegen, Effect.gen(function* () {
|
|
49052
|
-
const snapshots = yield* WorkspaceSnapshots;
|
|
49053
|
-
const inspector = yield* ConfigInspector;
|
|
49054
|
-
const discovery = yield* WorkspaceDiscovery;
|
|
49055
|
-
const detector = yield* PublishabilityDetector;
|
|
49056
|
-
const config = yield* ChangesetConfig;
|
|
49057
|
-
const fs = yield* FileSystem.FileSystem;
|
|
49058
|
-
const git = yield* Git;
|
|
49059
|
-
return makeShape$1(snapshots, inspector, discovery, detector, config, fs, Layer.succeed(Git, git));
|
|
49060
|
-
}));
|
|
49061
|
-
const ConfigGraph = ChangesetConfigLive.pipe(Layer.provide(ChangesetConfigReaderLive));
|
|
49350
|
+
const ConfigGraph = ChangesetConfig.layer.pipe(Layer.provide(ChangesetConfigReader.layer));
|
|
49062
49351
|
/**
|
|
49063
49352
|
* Build the batteries-included {@link DepsRegen} layer over a
|
|
49064
49353
|
* `@effected/workspaces` kit graph bound to `options.cwd`.
|
|
@@ -49080,7 +49369,7 @@ const ConfigGraph = ChangesetConfigLive.pipe(Layer.provide(ChangesetConfigReader
|
|
|
49080
49369
|
*/
|
|
49081
49370
|
function makeDepsRegenDefault(options) {
|
|
49082
49371
|
const kitGraph = Workspaces.layerWithGit(options);
|
|
49083
|
-
return
|
|
49372
|
+
return DepsRegen.layer.pipe(Layer.provide(ConfigInspector.layer.pipe(Layer.provide(Layer.mergeAll(ChangesetConfigReader.layer, kitGraph)))), Layer.provide(SilkPublishability.layerAdaptive.pipe(Layer.provide(Layer.mergeAll(ConfigGraph, kitGraph)))), Layer.provide(ConfigGraph), Layer.provide(kitGraph));
|
|
49084
49373
|
}
|
|
49085
49374
|
/**
|
|
49086
49375
|
* Batteries-included {@link DepsRegen} layer: silk's opinionated default
|
|
@@ -49092,10 +49381,10 @@ function makeDepsRegenDefault(options) {
|
|
|
49092
49381
|
* (`NodeServices.layer`), not a bare filesystem-only layer.
|
|
49093
49382
|
*
|
|
49094
49383
|
* Gating uses silk's adaptive publishability detector
|
|
49095
|
-
* (
|
|
49384
|
+
* (`SilkPublishability.layerAdaptive`), so the default semantics
|
|
49096
49385
|
* are "versionable minus ignored" — identical to the savvy CLI and MCP
|
|
49097
49386
|
* runtimes. Consumers who need to swap any dependency (test detectors,
|
|
49098
|
-
* alternate config sources) should keep composing {@link
|
|
49387
|
+
* alternate config sources) should keep composing {@link DepsRegen.layer}
|
|
49099
49388
|
* directly; this layer is purely additive.
|
|
49100
49389
|
*
|
|
49101
49390
|
* @example
|
|
@@ -49155,6 +49444,10 @@ const MaintenanceReasonSchema = Schema.Struct({
|
|
|
49155
49444
|
* will not match here; the release then degrades gracefully to the
|
|
49156
49445
|
* `"unspecified"` fallback sentence instead of naming its triggers.
|
|
49157
49446
|
*
|
|
49447
|
+
* Co-members releasing as `type: "none"` are never triggers — they carry no
|
|
49448
|
+
* version bump (and, per `@changesets/types`, no guaranteed `newVersion`), so
|
|
49449
|
+
* naming one would print an unchanged version as the cause of the release.
|
|
49450
|
+
*
|
|
49158
49451
|
* @public
|
|
49159
49452
|
*/
|
|
49160
49453
|
function deriveMaintenanceReason(release, plan, config) {
|
|
@@ -49162,7 +49455,7 @@ function deriveMaintenanceReason(release, plan, config) {
|
|
|
49162
49455
|
const groupKinds = [["fixed", config.fixed], ["linked", config.linked]];
|
|
49163
49456
|
for (const [kind, groups] of groupKinds) for (const group of groups) {
|
|
49164
49457
|
if (!group.some((pattern) => ChangesetConfig.matches(release.name, pattern))) continue;
|
|
49165
|
-
const triggers = plan.releases.filter((r) => r.name !== release.name && r.changesets.length > 0 && group.some((pattern) => ChangesetConfig.matches(r.name, pattern))).map((r) => ({
|
|
49458
|
+
const triggers = plan.releases.filter((r) => r.name !== release.name && r.type !== "none" && r.changesets.length > 0 && group.some((pattern) => ChangesetConfig.matches(r.name, pattern))).map((r) => ({
|
|
49166
49459
|
name: r.name,
|
|
49167
49460
|
version: r.newVersion
|
|
49168
49461
|
}));
|
|
@@ -49282,14 +49575,12 @@ function walkJsonPath(obj, path) {
|
|
|
49282
49575
|
path: [...nodePath, segment.index]
|
|
49283
49576
|
});
|
|
49284
49577
|
break;
|
|
49285
|
-
case "wildcard":
|
|
49286
|
-
|
|
49287
|
-
|
|
49288
|
-
|
|
49289
|
-
path: [...nodePath, index]
|
|
49290
|
-
});
|
|
49578
|
+
case "wildcard": if (Array.isArray(node)) node.forEach((element, index) => {
|
|
49579
|
+
next.push({
|
|
49580
|
+
node: element,
|
|
49581
|
+
path: [...nodePath, index]
|
|
49291
49582
|
});
|
|
49292
|
-
|
|
49583
|
+
});
|
|
49293
49584
|
}
|
|
49294
49585
|
}
|
|
49295
49586
|
current = next;
|
|
@@ -50367,7 +50658,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
50367
50658
|
};
|
|
50368
50659
|
module.exports = {
|
|
50369
50660
|
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
50370
|
-
MAX_LENGTH:
|
|
50661
|
+
MAX_LENGTH: 65536,
|
|
50371
50662
|
POSIX_REGEX_SOURCE,
|
|
50372
50663
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
50373
50664
|
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
@@ -52449,7 +52740,7 @@ function formatPaths(paths, mapper) {
|
|
|
52449
52740
|
if (mapper) for (let i = paths.length - 1; i >= 0; i--) paths[i] = mapper(paths[i]);
|
|
52450
52741
|
return paths;
|
|
52451
52742
|
}
|
|
52452
|
-
const defaultOptions = {
|
|
52743
|
+
const defaultOptions$1 = {
|
|
52453
52744
|
caseSensitiveMatch: true,
|
|
52454
52745
|
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
52455
52746
|
expandDirectories: true,
|
|
@@ -52458,7 +52749,7 @@ const defaultOptions = {
|
|
|
52458
52749
|
};
|
|
52459
52750
|
function getOptions(options) {
|
|
52460
52751
|
const opts = Object.assign({}, options);
|
|
52461
|
-
for (const key in defaultOptions) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions[key] });
|
|
52752
|
+
for (const key in defaultOptions$1) if (opts[key] === void 0) Object.assign(opts, { [key]: defaultOptions$1[key] });
|
|
52462
52753
|
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
|
|
52463
52754
|
opts.ignore = ensureStringArray(opts.ignore);
|
|
52464
52755
|
opts.fs && (opts.fs = {
|
|
@@ -52779,7 +53070,6 @@ var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
52779
53070
|
version: "1.2"
|
|
52780
53071
|
};
|
|
52781
53072
|
this.tags = Object.assign({}, Directives.defaultTags);
|
|
52782
|
-
break;
|
|
52783
53073
|
}
|
|
52784
53074
|
return res;
|
|
52785
53075
|
}
|
|
@@ -53642,7 +53932,7 @@ var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
53642
53932
|
}
|
|
53643
53933
|
let blockEndNewlines;
|
|
53644
53934
|
try {
|
|
53645
|
-
blockEndNewlines =
|
|
53935
|
+
blockEndNewlines = new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
|
|
53646
53936
|
} catch {
|
|
53647
53937
|
blockEndNewlines = /\n+(?!\n|$)/g;
|
|
53648
53938
|
}
|
|
@@ -55003,9 +55293,7 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
55003
55293
|
case 8:
|
|
55004
55294
|
str = `0o${str}`;
|
|
55005
55295
|
break;
|
|
55006
|
-
case 16:
|
|
55007
|
-
str = `0x${str}`;
|
|
55008
|
-
break;
|
|
55296
|
+
case 16: str = `0x${str}`;
|
|
55009
55297
|
}
|
|
55010
55298
|
const n = BigInt(str);
|
|
55011
55299
|
return sign === "-" ? BigInt(-1) * n : n;
|
|
@@ -56555,9 +56843,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
56555
56843
|
badChar = `block scalar indicator ${source[0]}`;
|
|
56556
56844
|
break;
|
|
56557
56845
|
case "@":
|
|
56558
|
-
case "`":
|
|
56559
|
-
badChar = `reserved character ${source[0]}`;
|
|
56560
|
-
break;
|
|
56846
|
+
case "`": badChar = `reserved character ${source[0]}`;
|
|
56561
56847
|
}
|
|
56562
56848
|
if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
|
|
56563
56849
|
return foldLines(source);
|
|
@@ -56576,8 +56862,8 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
56576
56862
|
*/
|
|
56577
56863
|
let first, line;
|
|
56578
56864
|
try {
|
|
56579
|
-
first =
|
|
56580
|
-
line =
|
|
56865
|
+
first = new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
|
|
56866
|
+
line = new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
|
|
56581
56867
|
} catch {
|
|
56582
56868
|
first = /(.*?)[ \t]*\r?\n/sy;
|
|
56583
56869
|
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
|
|
@@ -60915,7 +61201,7 @@ function validatePackages(packages) {
|
|
|
60915
61201
|
}
|
|
60916
61202
|
|
|
60917
61203
|
//#endregion
|
|
60918
|
-
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.
|
|
61204
|
+
//#region ../../node_modules/.pnpm/@changesets+get-dependents-graph@3.0.0-next.8/node_modules/@changesets/get-dependents-graph/dist/index.mjs
|
|
60919
61205
|
var src_default = new Proxy({}, { get(target, color) {
|
|
60920
61206
|
target[color] ??= (text) => styleText(color, text);
|
|
60921
61207
|
return target[color];
|
|
@@ -61029,14 +61315,14 @@ function getDependentsGraph(packages, opts) {
|
|
|
61029
61315
|
graph.set(key, dependentsLookup[key]);
|
|
61030
61316
|
});
|
|
61031
61317
|
const simplifiedDependentsGraph = /* @__PURE__ */ new Map();
|
|
61032
|
-
graph.forEach((
|
|
61033
|
-
simplifiedDependentsGraph.set(pkgName,
|
|
61318
|
+
graph.forEach((info, pkgName) => {
|
|
61319
|
+
simplifiedDependentsGraph.set(pkgName, info.dependents);
|
|
61034
61320
|
});
|
|
61035
61321
|
return simplifiedDependentsGraph;
|
|
61036
61322
|
}
|
|
61037
61323
|
|
|
61038
61324
|
//#endregion
|
|
61039
|
-
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.
|
|
61325
|
+
//#region ../../node_modules/.pnpm/@changesets+should-skip-package@1.0.0-next.8/node_modules/@changesets/should-skip-package/dist/index.mjs
|
|
61040
61326
|
function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
61041
61327
|
if (ignore.includes(packageJson.name)) return true;
|
|
61042
61328
|
if (packageJson.private && !allowPrivatePackages) return true;
|
|
@@ -61044,7 +61330,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
|
61044
61330
|
}
|
|
61045
61331
|
|
|
61046
61332
|
//#endregion
|
|
61047
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.
|
|
61333
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.0-next.8/node_modules/@changesets/config/dist/index.mjs
|
|
61048
61334
|
const DEFAULT_CONFIG = {
|
|
61049
61335
|
lang: void 0,
|
|
61050
61336
|
message: void 0,
|
|
@@ -61956,7 +62242,7 @@ async function readConfig(cwd, packages) {
|
|
|
61956
62242
|
packages ??= await getPackages(cwd);
|
|
61957
62243
|
return validateConfig(JSON.parse(await fs$1.readFile(path$1.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
61958
62244
|
}
|
|
61959
|
-
var version = "4.0.0-next.
|
|
62245
|
+
var version = "4.0.0-next.8";
|
|
61960
62246
|
const defaultWrittenConfig = {
|
|
61961
62247
|
["$schema"]: `https://unpkg.com/@changesets/config@${version}/schema.json`,
|
|
61962
62248
|
baseBranch: "main",
|
|
@@ -62510,7 +62796,7 @@ const COMMANDS = {
|
|
|
62510
62796
|
"deno": deno,
|
|
62511
62797
|
"nub": nub
|
|
62512
62798
|
};
|
|
62513
|
-
function resolveCommand(agent, command, args) {
|
|
62799
|
+
function resolveCommand$1(agent, command, args) {
|
|
62514
62800
|
const value = COMMANDS[agent][command];
|
|
62515
62801
|
return constructCommand(value, args);
|
|
62516
62802
|
}
|
|
@@ -62622,18 +62908,16 @@ async function detect$1(options = {}) {
|
|
|
62622
62908
|
if (result) return result;
|
|
62623
62909
|
break;
|
|
62624
62910
|
}
|
|
62625
|
-
case "install-metadata":
|
|
62626
|
-
|
|
62627
|
-
|
|
62628
|
-
|
|
62629
|
-
|
|
62630
|
-
|
|
62631
|
-
|
|
62632
|
-
|
|
62633
|
-
};
|
|
62634
|
-
}
|
|
62911
|
+
case "install-metadata": for (const metadata of Object.keys(INSTALL_METADATA)) {
|
|
62912
|
+
const fileOrDir = metadata.endsWith("/") ? "dir" : "file";
|
|
62913
|
+
if (await pathExists(path$1.join(directory, metadata), fileOrDir)) {
|
|
62914
|
+
const name = INSTALL_METADATA[metadata];
|
|
62915
|
+
return {
|
|
62916
|
+
name,
|
|
62917
|
+
agent: name === "yarn" ? isMetadataYarnClassic(metadata) ? "yarn" : "yarn@berry" : name
|
|
62918
|
+
};
|
|
62635
62919
|
}
|
|
62636
|
-
|
|
62920
|
+
}
|
|
62637
62921
|
}
|
|
62638
62922
|
if (stopDir?.(directory)) break;
|
|
62639
62923
|
}
|
|
@@ -62695,201 +62979,212 @@ function isMetadataYarnClassic(metadataPath) {
|
|
|
62695
62979
|
}
|
|
62696
62980
|
|
|
62697
62981
|
//#endregion
|
|
62698
|
-
//#region ../../node_modules/.pnpm/tinyexec@1.
|
|
62699
|
-
const
|
|
62700
|
-
const
|
|
62982
|
+
//#region ../../node_modules/.pnpm/tinyexec@1.3.0/node_modules/tinyexec/dist/main.mjs
|
|
62983
|
+
const isPathLikePattern = /^path$/i;
|
|
62984
|
+
const defaultEnvPathInfo = {
|
|
62701
62985
|
key: "PATH",
|
|
62702
62986
|
value: ""
|
|
62703
62987
|
};
|
|
62704
|
-
function
|
|
62705
|
-
for (const
|
|
62706
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
62707
|
-
const
|
|
62708
|
-
if (!
|
|
62988
|
+
function getPathFromEnv(env) {
|
|
62989
|
+
for (const key in env) {
|
|
62990
|
+
if (!Object.prototype.hasOwnProperty.call(env, key) || !isPathLikePattern.test(key)) continue;
|
|
62991
|
+
const value = env[key];
|
|
62992
|
+
if (!value) return defaultEnvPathInfo;
|
|
62709
62993
|
return {
|
|
62710
|
-
key
|
|
62711
|
-
value
|
|
62994
|
+
key,
|
|
62995
|
+
value
|
|
62712
62996
|
};
|
|
62713
62997
|
}
|
|
62714
|
-
return
|
|
62998
|
+
return defaultEnvPathInfo;
|
|
62715
62999
|
}
|
|
62716
|
-
function
|
|
62717
|
-
const
|
|
62718
|
-
const
|
|
62719
|
-
let
|
|
62720
|
-
let
|
|
63000
|
+
function addNodeBinToPath(cwd, path) {
|
|
63001
|
+
const parts = path.value.split(delimiter);
|
|
63002
|
+
const nodeBinPaths = [];
|
|
63003
|
+
let currentPath = cwd;
|
|
63004
|
+
let lastPath;
|
|
62721
63005
|
do {
|
|
62722
|
-
|
|
62723
|
-
|
|
62724
|
-
|
|
62725
|
-
} while (
|
|
62726
|
-
|
|
62727
|
-
const
|
|
63006
|
+
nodeBinPaths.push(resolve(currentPath, "node_modules", ".bin"));
|
|
63007
|
+
lastPath = currentPath;
|
|
63008
|
+
currentPath = dirname(currentPath);
|
|
63009
|
+
} while (currentPath !== lastPath);
|
|
63010
|
+
nodeBinPaths.push(dirname(process.execPath));
|
|
63011
|
+
const newPath = nodeBinPaths.concat(parts).join(delimiter);
|
|
62728
63012
|
return {
|
|
62729
|
-
key:
|
|
62730
|
-
value:
|
|
63013
|
+
key: path.key,
|
|
63014
|
+
value: newPath
|
|
62731
63015
|
};
|
|
62732
63016
|
}
|
|
62733
|
-
function
|
|
62734
|
-
const
|
|
63017
|
+
function computeEnv(cwd, env, nodePath = true) {
|
|
63018
|
+
const envWithDefault = {
|
|
62735
63019
|
...process.env,
|
|
62736
|
-
...
|
|
63020
|
+
...env
|
|
62737
63021
|
};
|
|
62738
|
-
if (!
|
|
62739
|
-
const
|
|
62740
|
-
|
|
62741
|
-
return
|
|
62742
|
-
}
|
|
62743
|
-
const
|
|
62744
|
-
let
|
|
62745
|
-
const
|
|
62746
|
-
const
|
|
62747
|
-
if (--
|
|
63022
|
+
if (!nodePath) return envWithDefault;
|
|
63023
|
+
const envPathInfo = addNodeBinToPath(cwd, getPathFromEnv(envWithDefault));
|
|
63024
|
+
envWithDefault[envPathInfo.key] = envPathInfo.value;
|
|
63025
|
+
return envWithDefault;
|
|
63026
|
+
}
|
|
63027
|
+
const combineStreams = (streams) => {
|
|
63028
|
+
let streamCount = streams.length;
|
|
63029
|
+
const combined = new PassThrough();
|
|
63030
|
+
const maybeEmitEnd = () => {
|
|
63031
|
+
if (--streamCount === 0) combined.end();
|
|
62748
63032
|
};
|
|
62749
|
-
for (const
|
|
62750
|
-
return
|
|
63033
|
+
for (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);
|
|
63034
|
+
return combined;
|
|
62751
63035
|
};
|
|
62752
|
-
const
|
|
62753
|
-
const
|
|
62754
|
-
const
|
|
62755
|
-
const
|
|
62756
|
-
const
|
|
62757
|
-
const
|
|
63036
|
+
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
|
|
63037
|
+
const shebangRegExp = /^#!\s*(.+)/;
|
|
63038
|
+
const isWindowsExecutableRegExp = /\.(?:com|exe)$/i;
|
|
63039
|
+
const isNodeModulesCmdRegExp = /node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i;
|
|
63040
|
+
const isWindows = process.platform === "win32";
|
|
63041
|
+
const defaultPathExt = [
|
|
62758
63042
|
".EXE",
|
|
62759
63043
|
".CMD",
|
|
62760
63044
|
".BAT",
|
|
62761
63045
|
".COM"
|
|
62762
63046
|
];
|
|
63047
|
+
const noPathExt = [""];
|
|
62763
63048
|
/**
|
|
62764
63049
|
* Normalizes the command and arguments to work cross-platform.
|
|
62765
63050
|
* On Windows, this basically handles things like shebangs, calling
|
|
62766
63051
|
* `node_modules/.bin` commands, and escaping meta characters.
|
|
62767
63052
|
* On other platforms, it just returns the command and arguments as-is.
|
|
62768
63053
|
*/
|
|
62769
|
-
function
|
|
62770
|
-
if (
|
|
62771
|
-
command
|
|
62772
|
-
args
|
|
62773
|
-
options
|
|
63054
|
+
function normalizeSpawnCommand(command, args = [], options = {}) {
|
|
63055
|
+
if (options.shell === true || !isWindows) return {
|
|
63056
|
+
command,
|
|
63057
|
+
args,
|
|
63058
|
+
options
|
|
62774
63059
|
};
|
|
62775
|
-
let
|
|
62776
|
-
let
|
|
62777
|
-
if (
|
|
62778
|
-
const
|
|
62779
|
-
const
|
|
62780
|
-
let
|
|
63060
|
+
let file = resolveCommand(command, options);
|
|
63061
|
+
let shebang = null;
|
|
63062
|
+
if (file !== null) {
|
|
63063
|
+
const size = 150;
|
|
63064
|
+
const buffer = Buffer.alloc(size);
|
|
63065
|
+
let fd = null;
|
|
62781
63066
|
try {
|
|
62782
|
-
|
|
62783
|
-
readSync(
|
|
63067
|
+
fd = openSync(file, "r");
|
|
63068
|
+
readSync(fd, buffer, 0, size, 0);
|
|
62784
63069
|
} catch {} finally {
|
|
62785
|
-
if (
|
|
62786
|
-
}
|
|
62787
|
-
const
|
|
62788
|
-
if (
|
|
62789
|
-
const
|
|
62790
|
-
const
|
|
62791
|
-
const
|
|
62792
|
-
const
|
|
62793
|
-
const
|
|
62794
|
-
|
|
62795
|
-
}
|
|
62796
|
-
}
|
|
62797
|
-
if (
|
|
62798
|
-
|
|
62799
|
-
|
|
62800
|
-
|
|
62801
|
-
}
|
|
62802
|
-
if (
|
|
62803
|
-
const
|
|
62804
|
-
|
|
62805
|
-
|
|
62806
|
-
|
|
62807
|
-
|
|
62808
|
-
|
|
62809
|
-
|
|
62810
|
-
|
|
62811
|
-
if (
|
|
62812
|
-
return
|
|
63070
|
+
if (fd !== null) closeSync(fd);
|
|
63071
|
+
}
|
|
63072
|
+
const match = buffer.toString().match(shebangRegExp);
|
|
63073
|
+
if (match !== null) {
|
|
63074
|
+
const line = match[1].trim();
|
|
63075
|
+
const separatorIndex = line.indexOf(" ");
|
|
63076
|
+
const path = separatorIndex !== -1 ? line.slice(0, separatorIndex) : line;
|
|
63077
|
+
const argument = separatorIndex !== -1 ? line.slice(separatorIndex + 1) : "";
|
|
63078
|
+
const binary = basename(path);
|
|
63079
|
+
shebang = binary === "env" ? argument || null : binary;
|
|
63080
|
+
}
|
|
63081
|
+
}
|
|
63082
|
+
if (shebang !== null && file !== null) {
|
|
63083
|
+
args = [file, ...args];
|
|
63084
|
+
command = shebang;
|
|
63085
|
+
file = resolveCommand(command, options);
|
|
63086
|
+
}
|
|
63087
|
+
if (file === null || !isWindowsExecutableRegExp.test(file)) {
|
|
63088
|
+
const needsDoubleEscapeMetaChars = file !== null && isNodeModulesCmdRegExp.test(file);
|
|
63089
|
+
command = normalize(command);
|
|
63090
|
+
command = command.replace(metaCharsRegExp, "^$1");
|
|
63091
|
+
args = args.map((arg) => {
|
|
63092
|
+
arg = arg.replace(/(?=(\\+?)?)\1"/g, "$1$1\\\"");
|
|
63093
|
+
arg = arg.replace(/(?=(\\+?)?)\1$/, "$1$1");
|
|
63094
|
+
arg = `"${arg}"`;
|
|
63095
|
+
arg = arg.replace(metaCharsRegExp, "^$1");
|
|
63096
|
+
if (needsDoubleEscapeMetaChars) arg = arg.replace(metaCharsRegExp, "^$1");
|
|
63097
|
+
return arg;
|
|
62813
63098
|
});
|
|
62814
|
-
|
|
63099
|
+
args = [
|
|
62815
63100
|
"/d",
|
|
62816
63101
|
"/s",
|
|
62817
63102
|
"/c",
|
|
62818
|
-
`"${[
|
|
63103
|
+
`"${[command, ...args].join(" ")}"`
|
|
62819
63104
|
];
|
|
62820
|
-
|
|
62821
|
-
|
|
62822
|
-
...
|
|
63105
|
+
command = options.env?.comspec ?? "cmd.exe";
|
|
63106
|
+
options = {
|
|
63107
|
+
...options,
|
|
62823
63108
|
windowsVerbatimArguments: true
|
|
62824
63109
|
};
|
|
62825
63110
|
}
|
|
62826
63111
|
return {
|
|
62827
|
-
command
|
|
62828
|
-
args
|
|
62829
|
-
options
|
|
63112
|
+
command,
|
|
63113
|
+
args,
|
|
63114
|
+
options
|
|
62830
63115
|
};
|
|
62831
63116
|
}
|
|
62832
63117
|
/**
|
|
62833
63118
|
* Resolves the command to an absolute path if possible.
|
|
62834
63119
|
* Handles things like traversing PATH and adding extensions from PATHEXT
|
|
62835
63120
|
*/
|
|
62836
|
-
function
|
|
62837
|
-
const
|
|
62838
|
-
const
|
|
62839
|
-
const
|
|
62840
|
-
const
|
|
62841
|
-
|
|
62842
|
-
if (
|
|
62843
|
-
for (const
|
|
62844
|
-
const
|
|
62845
|
-
for (const
|
|
62846
|
-
const
|
|
63121
|
+
function resolveCommand(command, options) {
|
|
63122
|
+
const cwd$3 = (options.cwd ?? cwd()).toString();
|
|
63123
|
+
const env = options.env ?? process.env;
|
|
63124
|
+
const PATH = getPathFromEnv(env).value;
|
|
63125
|
+
const pathEnv = command.includes("/") || command.includes("\\") ? [""] : [cwd$3, ...PATH.split(delimiter)];
|
|
63126
|
+
let pathExt = env.PATHEXT ? env.PATHEXT.split(delimiter) : defaultPathExt;
|
|
63127
|
+
if (command.includes(".") && pathExt[0] !== "") pathExt = ["", ...pathExt];
|
|
63128
|
+
for (const extensions of [pathExt, noPathExt]) for (const path of pathEnv) {
|
|
63129
|
+
const dest = resolve(cwd$3, path.startsWith("\"") && path.endsWith("\"") && path.length > 1 ? path.slice(1, -1) : path, command);
|
|
63130
|
+
for (const ext of extensions) {
|
|
63131
|
+
const destWithExt = dest + ext;
|
|
62847
63132
|
try {
|
|
62848
|
-
if (statSync(
|
|
63133
|
+
if (statSync(destWithExt).isFile()) return destWithExt;
|
|
62849
63134
|
} catch {}
|
|
62850
63135
|
}
|
|
62851
63136
|
}
|
|
62852
63137
|
return null;
|
|
62853
63138
|
}
|
|
62854
|
-
var
|
|
63139
|
+
var NonZeroExitError = class extends Error {
|
|
62855
63140
|
result;
|
|
62856
63141
|
output;
|
|
62857
|
-
|
|
62858
|
-
|
|
62859
|
-
|
|
62860
|
-
|
|
62861
|
-
|
|
62862
|
-
|
|
62863
|
-
|
|
63142
|
+
exitCode;
|
|
63143
|
+
get signalCode() {
|
|
63144
|
+
return this.result.signalCode;
|
|
63145
|
+
}
|
|
63146
|
+
constructor(result, output, command, args) {
|
|
63147
|
+
let target = "The process";
|
|
63148
|
+
if (command) target = `The command \`${args?.length ? `${command} ${args.map((a) => /[ "'`()]/.test(a) ? JSON.stringify(a) : a).join(" ")}` : command}\``;
|
|
63149
|
+
const exitCode = result.exitCode ?? 1;
|
|
63150
|
+
super(result.signalCode !== null ? `${target} was killed by the signal ${result.signalCode}` : `${target} exited with a non-zero status (${exitCode})`);
|
|
63151
|
+
this.result = result;
|
|
63152
|
+
this.output = output;
|
|
63153
|
+
this.exitCode = exitCode;
|
|
63154
|
+
Object.defineProperty(this, "result", {
|
|
63155
|
+
enumerable: false,
|
|
63156
|
+
writable: false,
|
|
63157
|
+
configurable: false
|
|
63158
|
+
});
|
|
62864
63159
|
}
|
|
62865
63160
|
};
|
|
62866
|
-
const
|
|
63161
|
+
const defaultOptions = {
|
|
62867
63162
|
timeout: void 0,
|
|
62868
63163
|
persist: false
|
|
62869
63164
|
};
|
|
62870
|
-
const
|
|
62871
|
-
function
|
|
62872
|
-
const
|
|
62873
|
-
for (const
|
|
62874
|
-
if (
|
|
62875
|
-
|
|
62876
|
-
return
|
|
62877
|
-
}
|
|
62878
|
-
const
|
|
62879
|
-
|
|
63165
|
+
const defaultNodeOptions = { windowsHide: true };
|
|
63166
|
+
function combineSignals(signals) {
|
|
63167
|
+
const controller = new AbortController();
|
|
63168
|
+
for (const signal of signals) {
|
|
63169
|
+
if (signal.aborted) {
|
|
63170
|
+
controller.abort();
|
|
63171
|
+
return signal;
|
|
63172
|
+
}
|
|
63173
|
+
const onAbort = () => {
|
|
63174
|
+
controller.abort(signal.reason);
|
|
62880
63175
|
};
|
|
62881
|
-
|
|
63176
|
+
signal.addEventListener("abort", onAbort, { signal: controller.signal });
|
|
62882
63177
|
}
|
|
62883
|
-
return
|
|
63178
|
+
return controller.signal;
|
|
62884
63179
|
}
|
|
62885
|
-
async function
|
|
62886
|
-
let
|
|
63180
|
+
async function readStream(stream) {
|
|
63181
|
+
let output = "";
|
|
62887
63182
|
try {
|
|
62888
|
-
for await (const
|
|
63183
|
+
for await (const chunk of stream) output += chunk.toString();
|
|
62889
63184
|
} catch {}
|
|
62890
|
-
return
|
|
63185
|
+
return output;
|
|
62891
63186
|
}
|
|
62892
|
-
var
|
|
63187
|
+
var ExecProcess = class {
|
|
62893
63188
|
_process;
|
|
62894
63189
|
_aborted = false;
|
|
62895
63190
|
_options;
|
|
@@ -62907,19 +63202,22 @@ var I = class {
|
|
|
62907
63202
|
get exitCode() {
|
|
62908
63203
|
if (this._process && this._process.exitCode !== null) return this._process.exitCode;
|
|
62909
63204
|
}
|
|
62910
|
-
|
|
63205
|
+
get signalCode() {
|
|
63206
|
+
return this._process?.signalCode ?? null;
|
|
63207
|
+
}
|
|
63208
|
+
constructor(command, args, options) {
|
|
62911
63209
|
this._options = {
|
|
62912
|
-
...
|
|
62913
|
-
...
|
|
63210
|
+
...defaultOptions,
|
|
63211
|
+
...options
|
|
62914
63212
|
};
|
|
62915
|
-
this._command =
|
|
62916
|
-
this._args =
|
|
62917
|
-
this._processClosed = new Promise((
|
|
62918
|
-
this._resolveClose =
|
|
63213
|
+
this._command = command;
|
|
63214
|
+
this._args = args ?? [];
|
|
63215
|
+
this._processClosed = new Promise((resolve) => {
|
|
63216
|
+
this._resolveClose = resolve;
|
|
62919
63217
|
});
|
|
62920
63218
|
}
|
|
62921
|
-
kill(
|
|
62922
|
-
return this._process?.kill(
|
|
63219
|
+
kill(signal) {
|
|
63220
|
+
return this._process?.kill(signal) === true;
|
|
62923
63221
|
}
|
|
62924
63222
|
get aborted() {
|
|
62925
63223
|
return this._aborted;
|
|
@@ -62927,99 +63225,99 @@ var I = class {
|
|
|
62927
63225
|
get killed() {
|
|
62928
63226
|
return this._process?.killed === true;
|
|
62929
63227
|
}
|
|
62930
|
-
pipe(
|
|
62931
|
-
return
|
|
62932
|
-
...
|
|
63228
|
+
pipe(command, args, options) {
|
|
63229
|
+
return exec(command, args, {
|
|
63230
|
+
...options,
|
|
62933
63231
|
stdin: this
|
|
62934
63232
|
});
|
|
62935
63233
|
}
|
|
62936
63234
|
async *[Symbol.asyncIterator]() {
|
|
62937
|
-
const
|
|
62938
|
-
if (!
|
|
62939
|
-
const
|
|
62940
|
-
if (this._streamErr)
|
|
62941
|
-
if (this._streamOut)
|
|
62942
|
-
const
|
|
62943
|
-
const
|
|
62944
|
-
for await (const
|
|
63235
|
+
const proc = this._process;
|
|
63236
|
+
if (!proc) return;
|
|
63237
|
+
const streams = [];
|
|
63238
|
+
if (this._streamErr) streams.push(this._streamErr);
|
|
63239
|
+
if (this._streamOut) streams.push(this._streamOut);
|
|
63240
|
+
const streamCombined = combineStreams(streams);
|
|
63241
|
+
const rl = readline.createInterface({ input: streamCombined });
|
|
63242
|
+
for await (const chunk of rl) yield chunk.toString();
|
|
62945
63243
|
await this._processClosed;
|
|
62946
|
-
|
|
63244
|
+
proc.removeAllListeners();
|
|
62947
63245
|
if (this._thrownError) throw this._thrownError;
|
|
62948
|
-
if (this._options?.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
63246
|
+
if (this._options?.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, void 0, this._command, this._args);
|
|
62949
63247
|
}
|
|
62950
63248
|
async _waitForOutput() {
|
|
62951
|
-
const
|
|
62952
|
-
if (!
|
|
62953
|
-
const [
|
|
63249
|
+
const proc = this._process;
|
|
63250
|
+
if (!proc) throw new Error("No process was started");
|
|
63251
|
+
const [stdout, stderr] = await Promise.all([this._streamOut ? readStream(this._streamOut) : "", this._streamErr ? readStream(this._streamErr) : ""]);
|
|
62954
63252
|
await this._processClosed;
|
|
62955
|
-
const { stdin
|
|
62956
|
-
if (
|
|
62957
|
-
|
|
63253
|
+
const { stdin } = this._options;
|
|
63254
|
+
if (stdin && typeof stdin !== "string") await stdin;
|
|
63255
|
+
proc.removeAllListeners();
|
|
62958
63256
|
if (this._thrownError) throw this._thrownError;
|
|
62959
|
-
const
|
|
62960
|
-
stderr
|
|
62961
|
-
stdout
|
|
63257
|
+
const result = {
|
|
63258
|
+
stderr,
|
|
63259
|
+
stdout,
|
|
62962
63260
|
exitCode: this.exitCode
|
|
62963
63261
|
};
|
|
62964
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
62965
|
-
return
|
|
63262
|
+
if (this._options.throwOnError && (this.exitCode !== 0 && this.exitCode !== void 0 || this.signalCode !== null)) throw new NonZeroExitError(this, result, this._command, this._args);
|
|
63263
|
+
return result;
|
|
62966
63264
|
}
|
|
62967
|
-
then(
|
|
62968
|
-
return this._waitForOutput().then(
|
|
63265
|
+
then(onfulfilled, onrejected) {
|
|
63266
|
+
return this._waitForOutput().then(onfulfilled, onrejected);
|
|
62969
63267
|
}
|
|
62970
63268
|
_streamOut;
|
|
62971
63269
|
_streamErr;
|
|
62972
63270
|
spawn() {
|
|
62973
|
-
const
|
|
62974
|
-
const
|
|
62975
|
-
const
|
|
62976
|
-
...
|
|
62977
|
-
...
|
|
63271
|
+
const cwd$1 = cwd();
|
|
63272
|
+
const options = this._options;
|
|
63273
|
+
const nodeOptions = {
|
|
63274
|
+
...defaultNodeOptions,
|
|
63275
|
+
...options.nodeOptions
|
|
62978
63276
|
};
|
|
62979
|
-
const
|
|
63277
|
+
const signals = [];
|
|
62980
63278
|
this._resetState();
|
|
62981
|
-
if (
|
|
62982
|
-
if (
|
|
62983
|
-
if (
|
|
62984
|
-
if (
|
|
62985
|
-
|
|
62986
|
-
const
|
|
62987
|
-
const
|
|
62988
|
-
if (
|
|
62989
|
-
if (
|
|
62990
|
-
this._process =
|
|
62991
|
-
|
|
62992
|
-
|
|
62993
|
-
if (
|
|
62994
|
-
const { stdin
|
|
62995
|
-
if (typeof
|
|
62996
|
-
else
|
|
63279
|
+
if (options.timeout !== void 0) signals.push(AbortSignal.timeout(options.timeout));
|
|
63280
|
+
if (options.signal !== void 0) signals.push(options.signal);
|
|
63281
|
+
if (options.persist === true) nodeOptions.detached = true;
|
|
63282
|
+
if (signals.length > 0) nodeOptions.signal = combineSignals(signals);
|
|
63283
|
+
nodeOptions.env = computeEnv(cwd$1, nodeOptions.env, options.nodePath);
|
|
63284
|
+
const crossResult = normalizeSpawnCommand(this._command, this._args, nodeOptions);
|
|
63285
|
+
const handle = spawn(crossResult.command, crossResult.args, crossResult.options);
|
|
63286
|
+
if (handle.stderr) this._streamErr = handle.stderr;
|
|
63287
|
+
if (handle.stdout) this._streamOut = handle.stdout;
|
|
63288
|
+
this._process = handle;
|
|
63289
|
+
handle.once("error", this._onError);
|
|
63290
|
+
handle.once("close", this._onClose);
|
|
63291
|
+
if (handle.stdin) {
|
|
63292
|
+
const { stdin } = options;
|
|
63293
|
+
if (typeof stdin === "string") handle.stdin.end(stdin);
|
|
63294
|
+
else stdin?.process?.stdout?.pipe(handle.stdin);
|
|
62997
63295
|
}
|
|
62998
63296
|
}
|
|
62999
63297
|
_resetState() {
|
|
63000
63298
|
this._aborted = false;
|
|
63001
|
-
this._processClosed = new Promise((
|
|
63002
|
-
this._resolveClose =
|
|
63299
|
+
this._processClosed = new Promise((resolve) => {
|
|
63300
|
+
this._resolveClose = resolve;
|
|
63003
63301
|
});
|
|
63004
63302
|
this._thrownError = void 0;
|
|
63005
63303
|
}
|
|
63006
|
-
_onError = (
|
|
63007
|
-
if (
|
|
63304
|
+
_onError = (err) => {
|
|
63305
|
+
if (err.name === "AbortError" && (!(err.cause instanceof Error) || err.cause.name !== "TimeoutError")) {
|
|
63008
63306
|
this._aborted = true;
|
|
63009
63307
|
return;
|
|
63010
63308
|
}
|
|
63011
|
-
this._thrownError =
|
|
63309
|
+
this._thrownError = err;
|
|
63012
63310
|
};
|
|
63013
63311
|
_onClose = () => {
|
|
63014
63312
|
if (this._resolveClose) this._resolveClose();
|
|
63015
63313
|
};
|
|
63016
63314
|
};
|
|
63017
|
-
const
|
|
63018
|
-
const
|
|
63019
|
-
|
|
63020
|
-
return
|
|
63315
|
+
const x = (command, args, userOptions) => {
|
|
63316
|
+
const proc = new ExecProcess(command, args, userOptions);
|
|
63317
|
+
proc.spawn();
|
|
63318
|
+
return proc;
|
|
63021
63319
|
};
|
|
63022
|
-
const
|
|
63320
|
+
const exec = x;
|
|
63023
63321
|
|
|
63024
63322
|
//#endregion
|
|
63025
63323
|
//#region ../../node_modules/.pnpm/@changesets+format@0.1.1/node_modules/@changesets/format/dist/index.js
|
|
@@ -63039,14 +63337,14 @@ function traverseUpwards(startDir, stopDir, cb) {
|
|
|
63039
63337
|
}
|
|
63040
63338
|
}
|
|
63041
63339
|
async function packageManagerExecute(packageManager, args, cwd) {
|
|
63042
|
-
const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
|
|
63340
|
+
const cmd = resolveCommand$1(packageManager, "execute-local", args) ?? {
|
|
63043
63341
|
command: "npx",
|
|
63044
63342
|
args
|
|
63045
63343
|
};
|
|
63046
63344
|
return await spawnProcess(cmd.command, cmd.args, cwd);
|
|
63047
63345
|
}
|
|
63048
63346
|
async function spawnProcess(command, args, cwd) {
|
|
63049
|
-
await
|
|
63347
|
+
await exec(command, args, {
|
|
63050
63348
|
nodeOptions: { cwd },
|
|
63051
63349
|
throwOnError: true
|
|
63052
63350
|
});
|
|
@@ -63236,9 +63534,9 @@ var InternalError = class extends Error {
|
|
|
63236
63534
|
};
|
|
63237
63535
|
|
|
63238
63536
|
//#endregion
|
|
63239
|
-
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.
|
|
63537
|
+
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.8/node_modules/@changesets/git/dist/index.mjs
|
|
63240
63538
|
async function getDivergedCommit(cwd, ref) {
|
|
63241
|
-
const cmd = await
|
|
63539
|
+
const cmd = await exec("git", [
|
|
63242
63540
|
"merge-base",
|
|
63243
63541
|
ref,
|
|
63244
63542
|
"HEAD"
|
|
@@ -63257,7 +63555,7 @@ async function getCommitsThatAddFiles(gitPaths, { cwd, short = false }) {
|
|
|
63257
63555
|
let remaining = gitPaths;
|
|
63258
63556
|
do {
|
|
63259
63557
|
const commitInfos = await Promise.all(remaining.map(async (gitPath) => {
|
|
63260
|
-
const [commitSha, parentSha] = (await
|
|
63558
|
+
const [commitSha, parentSha] = (await exec("git", [
|
|
63261
63559
|
"log",
|
|
63262
63560
|
"--diff-filter=A",
|
|
63263
63561
|
"--max-count=1",
|
|
@@ -63288,9 +63586,9 @@ async function getCommitsThatAddFiles(gitPaths, { cwd, short = false }) {
|
|
|
63288
63586
|
return gitPaths.map((p) => map.get(p));
|
|
63289
63587
|
}
|
|
63290
63588
|
async function isRepoShallow({ cwd }) {
|
|
63291
|
-
const isShallowRepoOutput = (await
|
|
63589
|
+
const isShallowRepoOutput = (await exec("git", ["rev-parse", "--is-shallow-repository"], { nodeOptions: { cwd } })).stdout.toString().trim();
|
|
63292
63590
|
if (isShallowRepoOutput === "--is-shallow-repository") {
|
|
63293
|
-
const gitDir = (await
|
|
63591
|
+
const gitDir = (await exec("git", ["rev-parse", "--git-dir"], { nodeOptions: { cwd } })).stdout.toString().trim();
|
|
63294
63592
|
const fullGitDir = path$1.resolve(cwd, gitDir);
|
|
63295
63593
|
try {
|
|
63296
63594
|
await fs$1.access(path$1.join(fullGitDir, "shallow"));
|
|
@@ -63301,12 +63599,12 @@ async function isRepoShallow({ cwd }) {
|
|
|
63301
63599
|
} else return isShallowRepoOutput === "true";
|
|
63302
63600
|
}
|
|
63303
63601
|
async function deepenCloneBy({ by, cwd }) {
|
|
63304
|
-
const cmd = await
|
|
63602
|
+
const cmd = await exec("git", ["fetch", `--deepen=${by}`], { nodeOptions: { cwd } });
|
|
63305
63603
|
if (cmd.exitCode !== 0) throw new Error(cmd.stderr.toString());
|
|
63306
63604
|
}
|
|
63307
63605
|
async function getChangedChangesetFilesSinceRef({ cwd, ref }) {
|
|
63308
63606
|
try {
|
|
63309
|
-
const cmd = await
|
|
63607
|
+
const cmd = await exec("git", [
|
|
63310
63608
|
"diff",
|
|
63311
63609
|
"--name-only",
|
|
63312
63610
|
"--diff-filter=d",
|
|
@@ -65143,9 +65441,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
65143
65441
|
case 2:
|
|
65144
65442
|
handleError(12);
|
|
65145
65443
|
break;
|
|
65146
|
-
case 6:
|
|
65147
|
-
handleError(16);
|
|
65148
|
-
break;
|
|
65444
|
+
case 6: handleError(16);
|
|
65149
65445
|
}
|
|
65150
65446
|
switch (token) {
|
|
65151
65447
|
case 12:
|
|
@@ -65408,7 +65704,7 @@ function applyEdits(text, edits) {
|
|
|
65408
65704
|
}
|
|
65409
65705
|
|
|
65410
65706
|
//#endregion
|
|
65411
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.
|
|
65707
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.0.0-next.9/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
65412
65708
|
/**
|
|
65413
65709
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
65414
65710
|
* must exist in the JSON for this implementation.
|
|
@@ -65460,6 +65756,7 @@ function getBumpLevel(type) {
|
|
|
65460
65756
|
return level;
|
|
65461
65757
|
}
|
|
65462
65758
|
function shouldUpdateDependencyBasedOnConfig(cwd, release, { depVersionRange, depType }, { minReleaseType, onlyUpdatePeerDependentsWhenOutOfRange }) {
|
|
65759
|
+
if (release.newVersion == null) return false;
|
|
65463
65760
|
if (depVersionRange.startsWith("workspace:")) {
|
|
65464
65761
|
depVersionRange = depVersionRange.replace(/^workspace:/, "");
|
|
65465
65762
|
switch (depVersionRange) {
|
|
@@ -65471,7 +65768,7 @@ function shouldUpdateDependencyBasedOnConfig(cwd, release, { depVersionRange, de
|
|
|
65471
65768
|
default: if (!validRange(depVersionRange)) return path$1.posix.normalize(depVersionRange) === path$1.relative(cwd, release.dir).replace(/\\/g, "/");
|
|
65472
65769
|
}
|
|
65473
65770
|
}
|
|
65474
|
-
if (!semverSatisfies(release.
|
|
65771
|
+
if (!semverSatisfies(release.newVersion, depVersionRange)) return true;
|
|
65475
65772
|
const minLevel = getBumpLevel(minReleaseType);
|
|
65476
65773
|
let shouldUpdate = getBumpLevel(release.type) >= minLevel;
|
|
65477
65774
|
if (depType === "peerDependencies") shouldUpdate = !onlyUpdatePeerDependentsWhenOutOfRange;
|
|
@@ -65496,12 +65793,7 @@ async function getChangelogEntry(cwd, release, releases, changesets, changelogFu
|
|
|
65496
65793
|
const peerDependencyVersionRange = release.packageJson.peerDependencies?.[rel.name];
|
|
65497
65794
|
const versionRange = dependencyVersionRange || peerDependencyVersionRange;
|
|
65498
65795
|
const usesWorkspaceRange = versionRange?.startsWith("workspace:");
|
|
65499
|
-
return versionRange && (usesWorkspaceRange || validRange(versionRange) != null) && shouldUpdateDependencyBasedOnConfig(cwd, {
|
|
65500
|
-
type: rel.type,
|
|
65501
|
-
version: rel.newVersion,
|
|
65502
|
-
oldVersion: rel.oldVersion,
|
|
65503
|
-
dir: rel.dir
|
|
65504
|
-
}, {
|
|
65796
|
+
return versionRange && (usesWorkspaceRange || validRange(versionRange) != null) && shouldUpdateDependencyBasedOnConfig(cwd, rel, {
|
|
65505
65797
|
depVersionRange: versionRange,
|
|
65506
65798
|
depType: dependencyVersionRange ? "dependencies" : "peerDependencies"
|
|
65507
65799
|
}, {
|
|
@@ -65553,14 +65845,11 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
65553
65845
|
const pkgJsonEdits = [];
|
|
65554
65846
|
for (const depType of DEPENDENCY_TYPES) {
|
|
65555
65847
|
const deps = packageJson[depType];
|
|
65556
|
-
if (deps) for (const
|
|
65848
|
+
if (deps) for (const release of versionsToUpdate) {
|
|
65849
|
+
if (release.newVersion == null) continue;
|
|
65850
|
+
const { name, newVersion } = release;
|
|
65557
65851
|
let depCurrentVersion = deps[name];
|
|
65558
|
-
if (!depCurrentVersion || depCurrentVersion.startsWith("file:") || depCurrentVersion.startsWith("link:") || !shouldUpdateDependencyBasedOnConfig(cwd, {
|
|
65559
|
-
version,
|
|
65560
|
-
oldVersion,
|
|
65561
|
-
type,
|
|
65562
|
-
dir
|
|
65563
|
-
}, {
|
|
65852
|
+
if (!depCurrentVersion || depCurrentVersion.startsWith("file:") || depCurrentVersion.startsWith("link:") || !shouldUpdateDependencyBasedOnConfig(cwd, release, {
|
|
65564
65853
|
depVersionRange: depCurrentVersion,
|
|
65565
65854
|
depType
|
|
65566
65855
|
}, {
|
|
@@ -65574,8 +65863,8 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
65574
65863
|
if (workspaceDepVersion === "*" || workspaceDepVersion === "^" || workspaceDepVersion === "~" || validRange(workspaceDepVersion) == null) continue;
|
|
65575
65864
|
depCurrentVersion = workspaceDepVersion;
|
|
65576
65865
|
}
|
|
65577
|
-
if (new Range(depCurrentVersion).range !== "" || semverPrerelease(
|
|
65578
|
-
let newNewRange = snapshot ?
|
|
65866
|
+
if (new Range(depCurrentVersion).range !== "" || semverPrerelease(newVersion) != null) {
|
|
65867
|
+
let newNewRange = snapshot ? newVersion : `${getVersionRangeType(depCurrentVersion)}${newVersion}`;
|
|
65579
65868
|
if (usesWorkspaceRange) newNewRange = `workspace:${newNewRange}`;
|
|
65580
65869
|
pkgJsonEdits.push({
|
|
65581
65870
|
keys: [depType, name],
|
|
@@ -65643,12 +65932,9 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
65643
65932
|
else await fs$1.writeFile(path$1.join(cwd, ".changeset", "pre.json"), JSON.stringify(releasePlan.preState, null, 2) + "\n");
|
|
65644
65933
|
touchedFiles.push(path$1.join(cwd, ".changeset", "pre.json"));
|
|
65645
65934
|
}
|
|
65646
|
-
const versionsToUpdate = releases.map((
|
|
65647
|
-
|
|
65648
|
-
|
|
65649
|
-
oldVersion,
|
|
65650
|
-
type,
|
|
65651
|
-
dir: packagesByName.get(name).dir
|
|
65935
|
+
const versionsToUpdate = releases.map((release) => ({
|
|
65936
|
+
...release,
|
|
65937
|
+
dir: packagesByName.get(release.name).dir
|
|
65652
65938
|
}));
|
|
65653
65939
|
const dependencyUpdateOptions = {
|
|
65654
65940
|
cwd,
|
|
@@ -65660,10 +65946,12 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
65660
65946
|
const filesToFormat = [];
|
|
65661
65947
|
for (const release of releaseWithChangelogs) {
|
|
65662
65948
|
const { changelog, dir, name, newVersion, packageJson } = release;
|
|
65663
|
-
const
|
|
65949
|
+
const pkgJsonEdits = getDependencyVersionEdits(packageJson, versionsToUpdate, dependencyUpdateOptions);
|
|
65950
|
+
if (newVersion != null) pkgJsonEdits.push({
|
|
65664
65951
|
keys: ["version"],
|
|
65665
65952
|
value: newVersion
|
|
65666
|
-
}
|
|
65953
|
+
});
|
|
65954
|
+
const pkgJsonPath = await updatePackageJson(dir, pkgJsonEdits);
|
|
65667
65955
|
if (pkgJsonPath) touchedFiles.push(pkgJsonPath);
|
|
65668
65956
|
if (changelog && changelog.length > 0) {
|
|
65669
65957
|
const changelogPath = path$1.resolve(dir, "CHANGELOG.md");
|
|
@@ -65768,7 +66056,7 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
65768
66056
|
}
|
|
65769
66057
|
|
|
65770
66058
|
//#endregion
|
|
65771
|
-
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.
|
|
66059
|
+
//#region ../../node_modules/.pnpm/@changesets+assemble-release-plan@7.0.0-next.9/node_modules/@changesets/assemble-release-plan/dist/index.mjs
|
|
65772
66060
|
function getHighestReleaseType(releases) {
|
|
65773
66061
|
if (releases.length === 0) throw new Error(`Large internal Changesets error when calculating highest release type in the set of releases. Please contact the maintainers`);
|
|
65774
66062
|
let highestReleaseType = "none";
|
|
@@ -66115,7 +66403,7 @@ function getPreInfo(changesets, packagesByName, config, preState) {
|
|
|
66115
66403
|
}
|
|
66116
66404
|
|
|
66117
66405
|
//#endregion
|
|
66118
|
-
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.
|
|
66406
|
+
//#region ../../node_modules/.pnpm/@changesets+pre@3.0.0-next.8/node_modules/@changesets/pre/dist/index.mjs
|
|
66119
66407
|
async function outputFile(filePath, content) {
|
|
66120
66408
|
await fs$1.mkdir(path$1.dirname(filePath), { recursive: true });
|
|
66121
66409
|
await fs$1.writeFile(filePath, content, "utf8");
|
|
@@ -66145,7 +66433,7 @@ async function migratePreState(rootDir, preState) {
|
|
|
66145
66433
|
}
|
|
66146
66434
|
|
|
66147
66435
|
//#endregion
|
|
66148
|
-
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.
|
|
66436
|
+
//#region ../../node_modules/.pnpm/@changesets+parse@1.0.0-next.9/node_modules/@changesets/parse/dist/index.mjs
|
|
66149
66437
|
const mdRegex = /\s*---([^]*?)\r?\n\s*---(\s*(?:\n|$)[^]*)/;
|
|
66150
66438
|
const EXAMPLE_FORMAT = `---\n"package-name": patch\n---`;
|
|
66151
66439
|
const validVersionTypes = [
|
|
@@ -66199,7 +66487,7 @@ YAML error: ${e instanceof Error ? e.message : String(e)}\nFrontmatter content:\
|
|
|
66199
66487
|
}
|
|
66200
66488
|
|
|
66201
66489
|
//#endregion
|
|
66202
|
-
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.
|
|
66490
|
+
//#region ../../node_modules/.pnpm/@changesets+read@1.0.0-next.9/node_modules/@changesets/read/dist/index.mjs
|
|
66203
66491
|
const ignoredMdFiles = [
|
|
66204
66492
|
/^README\.md$/i,
|
|
66205
66493
|
"AGENTS.md",
|
|
@@ -66233,7 +66521,7 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
66233
66521
|
}
|
|
66234
66522
|
|
|
66235
66523
|
//#endregion
|
|
66236
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.
|
|
66524
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.0-next.9/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
66237
66525
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
66238
66526
|
const packages = await getPackages(cwd);
|
|
66239
66527
|
const configResult = await readConfig(packages.rootDir, packages);
|
|
@@ -66275,7 +66563,12 @@ async function loadConfig(root, packages) {
|
|
|
66275
66563
|
};
|
|
66276
66564
|
}
|
|
66277
66565
|
/** Effect service tag for the release planner. @public */
|
|
66278
|
-
var ReleasePlanner = class extends Context.Service()("ReleasePlanner") {
|
|
66566
|
+
var ReleasePlanner = class extends Context.Service()("ReleasePlanner") {
|
|
66567
|
+
/** Production layer. Requires {@link ConfigInspector} (used by `apply`) and `FileSystem`. @public */
|
|
66568
|
+
static layer = Layer.effect(this, Effect.gen(function* () {
|
|
66569
|
+
return makeShape(yield* ConfigInspector, yield* FileSystem.FileSystem);
|
|
66570
|
+
}));
|
|
66571
|
+
};
|
|
66279
66572
|
/** Build the service shape over a resolved {@link ConfigInspector} and {@link FileSystem.FileSystem}. */
|
|
66280
66573
|
function makeShape(inspector, fs) {
|
|
66281
66574
|
const plan = (root) => Effect.tryPromise({
|
|
@@ -66293,10 +66586,6 @@ function makeShape(inspector, fs) {
|
|
|
66293
66586
|
apply
|
|
66294
66587
|
};
|
|
66295
66588
|
}
|
|
66296
|
-
/** Production layer. Requires {@link ConfigInspector} (used by `apply`) and `FileSystem`. @public */
|
|
66297
|
-
const ReleasePlannerLive = Layer.effect(ReleasePlanner, Effect.gen(function* () {
|
|
66298
|
-
return makeShape(yield* ConfigInspector, yield* FileSystem.FileSystem);
|
|
66299
|
-
}));
|
|
66300
66589
|
/**
|
|
66301
66590
|
* Test factory — supply fixed results for any subset of methods. Unsupplied
|
|
66302
66591
|
* methods fail with a `ReleasePlanError`.
|
|
@@ -67426,7 +67715,6 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67426
67715
|
AppliedReleaseSchema: () => AppliedReleaseSchema,
|
|
67427
67716
|
BranchAnalysisSchema: () => BranchAnalysisSchema,
|
|
67428
67717
|
BranchAnalyzer: () => BranchAnalyzer,
|
|
67429
|
-
BranchAnalyzerLive: () => BranchAnalyzerLive,
|
|
67430
67718
|
BranchFileEntrySchema: () => BranchFileEntrySchema,
|
|
67431
67719
|
BumpTypeSchema: () => BumpTypeSchema,
|
|
67432
67720
|
Categories: () => Categories,
|
|
@@ -67444,7 +67732,6 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67444
67732
|
ClassificationSchema: () => ClassificationSchema,
|
|
67445
67733
|
CommitHashSchema: () => CommitHashSchema,
|
|
67446
67734
|
ConfigInspector: () => ConfigInspector,
|
|
67447
|
-
ConfigInspectorLive: () => ConfigInspectorLive,
|
|
67448
67735
|
ConfigurationError: () => ConfigurationError,
|
|
67449
67736
|
ContentStructureRule: () => ContentStructureRule$1,
|
|
67450
67737
|
ContributorFootnotesPlugin: () => ContributorFootnotesPlugin,
|
|
@@ -67459,12 +67746,10 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67459
67746
|
DependencyUpdateSchema: () => DependencyUpdateSchema,
|
|
67460
67747
|
DepsRegen: () => DepsRegen,
|
|
67461
67748
|
DepsRegenDefault: () => DepsRegenDefault,
|
|
67462
|
-
DepsRegenLive: () => DepsRegenLive,
|
|
67463
67749
|
FileStatusSchema: () => FileStatusSchema,
|
|
67464
67750
|
GitError: () => GitError$1,
|
|
67465
67751
|
GitHubApiError: () => GitHubApiError,
|
|
67466
67752
|
GitHubInfoSchema: () => GitHubInfoSchema,
|
|
67467
|
-
GitHubLive: () => GitHubLive,
|
|
67468
67753
|
GitHubService: () => GitHubService,
|
|
67469
67754
|
GlobSchema: () => GlobSchema,
|
|
67470
67755
|
HeadingHierarchyRule: () => HeadingHierarchyRule$1,
|
|
@@ -67493,7 +67778,6 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67493
67778
|
PreviewReleaseSchema: () => PreviewReleaseSchema,
|
|
67494
67779
|
ReleasePlanError: () => ReleasePlanError,
|
|
67495
67780
|
ReleasePlanner: () => ReleasePlanner,
|
|
67496
|
-
ReleasePlannerLive: () => ReleasePlannerLive,
|
|
67497
67781
|
ReorderSectionsPlugin: () => ReorderSectionsPlugin,
|
|
67498
67782
|
RepoSchema: () => RepoSchema,
|
|
67499
67783
|
RequiredSectionsRule: () => RequiredSectionsRule$1,
|