@savvy-web/silk 3.2.11 → 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 +833 -634
- package/changesets-changelog.d.cts +258 -98
- package/changesets-changelog.d.ts +258 -98
- package/changesets-changelog.js +849 -650
- package/changesets-markdownlint.cjs +833 -634
- package/changesets-markdownlint.d.cts +258 -98
- package/changesets-markdownlint.d.ts +258 -98
- package/changesets-markdownlint.js +849 -650
- package/lint.d.ts +2 -2
- package/lint.js +2 -2
- package/package.json +4 -4
- package/tsconfig/node/dist/tsconfig.tsbuildinfo +1 -1
|
@@ -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,6 +4374,58 @@ 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
4431
|
//#region ../../node_modules/.pnpm/@effected+commands@0.2.0_effect@4.0.0-beta.101/node_modules/@effected/commands/LocalExec.js
|
|
@@ -4507,7 +4637,7 @@ var LocalExec = class LocalExec extends Context.Service()("@effected/commands/Lo
|
|
|
4507
4637
|
};
|
|
4508
4638
|
|
|
4509
4639
|
//#endregion
|
|
4510
|
-
//#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
|
|
4511
4641
|
const MS_PER_MINUTE = 6e4;
|
|
4512
4642
|
/**
|
|
4513
4643
|
* A source's partial contribution to a {@link ReleaseAgeGate}: the effective
|
|
@@ -4678,7 +4808,7 @@ var ReleaseAgeGate = class ReleaseAgeGate extends Schema.Class("ReleaseAgeGate")
|
|
|
4678
4808
|
};
|
|
4679
4809
|
|
|
4680
4810
|
//#endregion
|
|
4681
|
-
//#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
|
|
4682
4812
|
/**
|
|
4683
4813
|
* One declared dependency of one workspace importer, as the lockfile records it.
|
|
4684
4814
|
*
|
|
@@ -4717,7 +4847,7 @@ var ImporterDependency = class extends Schema.Class("ImporterDependency")({
|
|
|
4717
4847
|
}) {};
|
|
4718
4848
|
|
|
4719
4849
|
//#endregion
|
|
4720
|
-
//#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
|
|
4721
4851
|
/**
|
|
4722
4852
|
* One workspace importer's declared dependencies, as the lockfile records them.
|
|
4723
4853
|
*
|
|
@@ -4742,7 +4872,7 @@ var LockfileImporter = class extends Schema.Class("LockfileImporter")({
|
|
|
4742
4872
|
}) {};
|
|
4743
4873
|
|
|
4744
4874
|
//#endregion
|
|
4745
|
-
//#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
|
|
4746
4876
|
const EMPTY_DEPENDENCIES = {};
|
|
4747
4877
|
/**
|
|
4748
4878
|
* A package resolved from a lockfile.
|
|
@@ -4778,7 +4908,7 @@ var ResolvedPackage = class extends Schema.Class("ResolvedPackage")({
|
|
|
4778
4908
|
}) {};
|
|
4779
4909
|
|
|
4780
4910
|
//#endregion
|
|
4781
|
-
//#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
|
|
4782
4912
|
/**
|
|
4783
4913
|
* A directed dependency edge between two workspace packages as recorded in
|
|
4784
4914
|
* the lockfile.
|
|
@@ -4801,7 +4931,7 @@ var WorkspaceDependency = class extends Schema.Class("WorkspaceDependency")({
|
|
|
4801
4931
|
}) {};
|
|
4802
4932
|
|
|
4803
4933
|
//#endregion
|
|
4804
|
-
//#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
|
|
4805
4935
|
/**
|
|
4806
4936
|
* Extension data specific to pnpm lockfiles, attached to `Lockfile.extension`
|
|
4807
4937
|
* when the format is `"pnpm"`.
|
|
@@ -4827,7 +4957,7 @@ var PnpmExtension = class extends Schema.Class("PnpmExtension")({
|
|
|
4827
4957
|
}) {};
|
|
4828
4958
|
|
|
4829
4959
|
//#endregion
|
|
4830
|
-
//#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
|
|
4831
4961
|
/**
|
|
4832
4962
|
* The lockfile formats this package parses: bun's `bun.lock` (JSONC), npm's
|
|
4833
4963
|
* `package-lock.json` (v2/v3 JSON), pnpm's `pnpm-lock.yaml` and yarn Berry's
|
|
@@ -4848,21 +4978,25 @@ const LockfileFormat = Schema.Literals([
|
|
|
4848
4978
|
"yarn"
|
|
4849
4979
|
]);
|
|
4850
4980
|
const FILENAMES = {
|
|
4851
|
-
bun: "bun.lock",
|
|
4852
|
-
npm: "package-lock.json",
|
|
4853
|
-
pnpm: "pnpm-lock.yaml",
|
|
4854
|
-
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"]
|
|
4855
4985
|
};
|
|
4856
4986
|
/**
|
|
4857
4987
|
* The conventional lockfile filename for a format: `"bun.lock"`,
|
|
4858
4988
|
* `"package-lock.json"`, `"pnpm-lock.yaml"` or `"yarn.lock"`.
|
|
4859
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
|
+
*
|
|
4860
4994
|
* @public
|
|
4861
4995
|
*/
|
|
4862
|
-
const filenameFor = (format) => FILENAMES[format];
|
|
4996
|
+
const filenameFor = (format) => FILENAMES[format][0];
|
|
4863
4997
|
|
|
4864
4998
|
//#endregion
|
|
4865
|
-
//#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
|
|
4866
5000
|
/**
|
|
4867
5001
|
* The four dependency sections of a manifest, in a stable order — the shared
|
|
4868
5002
|
* dependency-sections table (v3's `DEP_SECTIONS`). Each entry is both the
|
|
@@ -5279,9 +5413,7 @@ const createScanner$2 = (text, ignoreTrivia = false) => {
|
|
|
5279
5413
|
else tokenError = "InvalidUnicode";
|
|
5280
5414
|
break;
|
|
5281
5415
|
}
|
|
5282
|
-
default:
|
|
5283
|
-
tokenError = "InvalidEscapeCharacter";
|
|
5284
|
-
break;
|
|
5416
|
+
default: tokenError = "InvalidEscapeCharacter";
|
|
5285
5417
|
}
|
|
5286
5418
|
start = pos;
|
|
5287
5419
|
} else if (isLineBreak$1(ch)) {
|
|
@@ -6836,7 +6968,7 @@ var JsoncModifier = class {
|
|
|
6836
6968
|
};
|
|
6837
6969
|
|
|
6838
6970
|
//#endregion
|
|
6839
|
-
//#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
|
|
6840
6972
|
const DepRecord$2 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6841
6973
|
const BunWorkspaceEntry = Schema.Struct({
|
|
6842
6974
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -6930,7 +7062,7 @@ const toFields$3 = (raw) => Effect.gen(function* () {
|
|
|
6930
7062
|
});
|
|
6931
7063
|
|
|
6932
7064
|
//#endregion
|
|
6933
|
-
//#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
|
|
6934
7066
|
const DepRecord$1 = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
6935
7067
|
const NpmPackageEntry = Schema.Struct({
|
|
6936
7068
|
name: Schema.optionalKey(Schema.String),
|
|
@@ -13941,7 +14073,7 @@ function deepEqualValues(a, b) {
|
|
|
13941
14073
|
}
|
|
13942
14074
|
|
|
13943
14075
|
//#endregion
|
|
13944
|
-
//#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
|
|
13945
14077
|
/**
|
|
13946
14078
|
* An empty YAML document composes to `null` (`Yaml.parseAll("")` is `[null]`,
|
|
13947
14079
|
* and the trailing document of an env-only `pnpm-lock.yaml` is `null` too).
|
|
@@ -14012,7 +14144,7 @@ const selectSoleDocument = (content) => Effect.gen(function* () {
|
|
|
14012
14144
|
});
|
|
14013
14145
|
|
|
14014
14146
|
//#endregion
|
|
14015
|
-
//#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
|
|
14016
14148
|
const PnpmImporterDeps = Schema.optionalKey(Schema.Record(Schema.String, Schema.Struct({
|
|
14017
14149
|
specifier: Schema.String,
|
|
14018
14150
|
version: Schema.String
|
|
@@ -14138,7 +14270,7 @@ const toFields$1 = (raw) => Effect.gen(function* () {
|
|
|
14138
14270
|
});
|
|
14139
14271
|
|
|
14140
14272
|
//#endregion
|
|
14141
|
-
//#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
|
|
14142
14274
|
const YarnLockfileRaw = Schema.Record(Schema.String, Schema.Unknown);
|
|
14143
14275
|
const DepRecord = Schema.optionalKey(Schema.Record(Schema.String, Schema.String));
|
|
14144
14276
|
const YarnEntry = Schema.Struct({
|
|
@@ -14262,7 +14394,7 @@ const cleanYarnDeps = (deps) => {
|
|
|
14262
14394
|
};
|
|
14263
14395
|
|
|
14264
14396
|
//#endregion
|
|
14265
|
-
//#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
|
|
14266
14398
|
const EMPTY_IMPORTERS = [];
|
|
14267
14399
|
/**
|
|
14268
14400
|
* Failure of `Lockfile.parse`: the given content is not a valid lockfile of
|
|
@@ -14507,7 +14639,7 @@ var Lockfile = class Lockfile extends Schema.Class("Lockfile")({
|
|
|
14507
14639
|
};
|
|
14508
14640
|
|
|
14509
14641
|
//#endregion
|
|
14510
|
-
//#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
|
|
14511
14643
|
/**
|
|
14512
14644
|
* The minimal manifest shape {@link LockfileIntegrity.compare} checks a
|
|
14513
14645
|
* lockfile against: a package name plus the four optional dependency maps.
|
|
@@ -14624,7 +14756,7 @@ var LockfileIntegrity = class LockfileIntegrity extends Schema.Class("LockfileIn
|
|
|
14624
14756
|
};
|
|
14625
14757
|
|
|
14626
14758
|
//#endregion
|
|
14627
|
-
//#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
|
|
14628
14760
|
/**
|
|
14629
14761
|
* A resolved dependency entry pairing a package name with its version
|
|
14630
14762
|
* specifier and the `kind` of map it came from (`@effected/npm`'s
|
|
@@ -14689,7 +14821,7 @@ var Dependency = class extends Schema.Class("Dependency")({
|
|
|
14689
14821
|
};
|
|
14690
14822
|
|
|
14691
14823
|
//#endregion
|
|
14692
|
-
//#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
|
|
14693
14825
|
/**
|
|
14694
14826
|
* A single `devEngines` constraint with a name and optional `version` / `onFail`.
|
|
14695
14827
|
*
|
|
@@ -16287,7 +16419,7 @@ const SpdxExpression = {
|
|
|
16287
16419
|
};
|
|
16288
16420
|
|
|
16289
16421
|
//#endregion
|
|
16290
|
-
//#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
|
|
16291
16423
|
/**
|
|
16292
16424
|
* Indicates that a string is not a valid SPDX license identifier or expression.
|
|
16293
16425
|
*
|
|
@@ -16323,50 +16455,103 @@ const isValidSpdx = (value) => {
|
|
|
16323
16455
|
const SpdxLicense = Schema.String.pipe(Schema.check(Schema.makeFilter((value) => isValidSpdx(value) ? void 0 : "Expected a valid SPDX license expression")), Schema.brand("SpdxLicense"));
|
|
16324
16456
|
|
|
16325
16457
|
//#endregion
|
|
16326
|
-
//#region ../../node_modules/.pnpm/@effected+package-json@0.
|
|
16327
|
-
const
|
|
16328
|
-
|
|
16329
|
-
* The `packageManager` field only ever carries corepack's `<algo>.<hex>`
|
|
16330
|
-
* integrity form (the `name@version+sha512.<hex>` tail). Restrict the
|
|
16331
|
-
* `@effected/npm` `IntegrityHash` brand — which also admits the SRI and yarn
|
|
16332
|
-
* forms — to just the corepack shape, so an SRI or yarn integrity here fails
|
|
16333
|
-
* typed rather than being accepted into a field that can never legitimately
|
|
16334
|
-
* hold it.
|
|
16335
|
-
*/
|
|
16336
|
-
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 }));
|
|
16337
16461
|
/**
|
|
16338
16462
|
* A structured `packageManager` value with `name`, `version` and an optional
|
|
16339
16463
|
* `integrity` hash.
|
|
16340
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
|
+
*
|
|
16341
16498
|
* @public
|
|
16342
16499
|
*/
|
|
16343
16500
|
var PackageManager = class PackageManager extends Schema.Class("PackageManager")({
|
|
16344
|
-
/** The package-manager name (e.g. `pnpm`). */
|
|
16501
|
+
/** The package-manager name (e.g. `pnpm`). Any lowercase name — see the class remarks. */
|
|
16345
16502
|
name: Schema.String,
|
|
16346
|
-
/**
|
|
16347
|
-
version:
|
|
16348
|
-
|
|
16349
|
-
|
|
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)
|
|
16350
16520
|
}) {
|
|
16351
16521
|
/**
|
|
16352
16522
|
* Schema transformation between the `"name@version+integrity"` string and a
|
|
16353
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.
|
|
16354
16533
|
*/
|
|
16355
16534
|
static FromString = Schema.String.pipe(Schema.decodeTo(Schema.instanceOf(PackageManager), SchemaTransformation.transformOrFail({
|
|
16356
16535
|
decode: (input) => {
|
|
16357
|
-
const
|
|
16358
|
-
if (
|
|
16359
|
-
const
|
|
16360
|
-
if (
|
|
16361
|
-
|
|
16362
|
-
|
|
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,
|
|
16363
16547
|
integrity: Option.none()
|
|
16364
16548
|
}));
|
|
16365
|
-
const
|
|
16366
|
-
|
|
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}"`);
|
|
16367
16552
|
return Effect.succeed(PackageManager.make({
|
|
16368
|
-
name
|
|
16369
|
-
version
|
|
16553
|
+
name,
|
|
16554
|
+
version,
|
|
16370
16555
|
integrity: Option.some(decoded.value)
|
|
16371
16556
|
}));
|
|
16372
16557
|
},
|
|
@@ -16382,7 +16567,7 @@ var PackageManager = class PackageManager extends Schema.Class("PackageManager")
|
|
|
16382
16567
|
};
|
|
16383
16568
|
|
|
16384
16569
|
//#endregion
|
|
16385
|
-
//#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
|
|
16386
16571
|
/**
|
|
16387
16572
|
* Indicates that a string could not be used as a valid npm package name.
|
|
16388
16573
|
*
|
|
@@ -16441,7 +16626,7 @@ const PackageName = Object.assign(Schema.Union([ScopedPackageName, UnscopedPacka
|
|
|
16441
16626
|
});
|
|
16442
16627
|
|
|
16443
16628
|
//#endregion
|
|
16444
|
-
//#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
|
|
16445
16630
|
const parsePersonString = (input) => {
|
|
16446
16631
|
const emailMatch = input.match(/<([^>]+)>/);
|
|
16447
16632
|
const urlMatch = input.match(/\(([^)]+)\)/);
|
|
@@ -16588,7 +16773,7 @@ var Person = class Person extends Schema.Class("Person")({
|
|
|
16588
16773
|
};
|
|
16589
16774
|
|
|
16590
16775
|
//#endregion
|
|
16591
|
-
//#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
|
|
16592
16777
|
/** The shorthand hosts npm resolves without a scheme. */
|
|
16593
16778
|
const SHORTHAND_HOSTS = /* @__PURE__ */ new Map([
|
|
16594
16779
|
["github", "https://github.com"],
|
|
@@ -16764,7 +16949,7 @@ var Bugs = class Bugs extends Schema.Class("Bugs")({
|
|
|
16764
16949
|
};
|
|
16765
16950
|
|
|
16766
16951
|
//#endregion
|
|
16767
|
-
//#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
|
|
16768
16953
|
const KEY_INDEX = new Map([
|
|
16769
16954
|
"$schema",
|
|
16770
16955
|
"name",
|
|
@@ -16988,7 +17173,7 @@ const renderJson = (raw, options) => {
|
|
|
16988
17173
|
};
|
|
16989
17174
|
|
|
16990
17175
|
//#endregion
|
|
16991
|
-
//#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
|
|
16992
17177
|
const toHashMap = SchemaTransformation.transform({
|
|
16993
17178
|
decode: (record) => HashMap.fromIterable(Object.entries(record)),
|
|
16994
17179
|
encode: (map) => Object.fromEntries(HashMap.toEntries(map))
|
|
@@ -17309,12 +17494,13 @@ var Package = class Package extends Schema.Class("Package")({
|
|
|
17309
17494
|
* sorting and empty-map stripping unless the options opt out. Pure.
|
|
17310
17495
|
*/
|
|
17311
17496
|
toJsonString(options) {
|
|
17312
|
-
|
|
17497
|
+
const raw = Schema.encodeUnknownSync(Package.schema)(this);
|
|
17498
|
+
return renderJson(raw, resolveFormatOptions(options));
|
|
17313
17499
|
}
|
|
17314
17500
|
};
|
|
17315
17501
|
|
|
17316
17502
|
//#endregion
|
|
17317
|
-
//#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
|
|
17318
17504
|
const EMPTY$1 = Object.freeze(Object.create(null));
|
|
17319
17505
|
const EMPTY_MANIFEST = Object.freeze(Object.create(null));
|
|
17320
17506
|
/**
|
|
@@ -17916,7 +18102,7 @@ var Walker$1 = class {
|
|
|
17916
18102
|
};
|
|
17917
18103
|
|
|
17918
18104
|
//#endregion
|
|
17919
|
-
//#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
|
|
17920
18106
|
/**
|
|
17921
18107
|
* The marker filenames {@link WorkspaceRoot} probes for, in priority order.
|
|
17922
18108
|
*
|
|
@@ -18104,7 +18290,7 @@ var WorkspaceRoot = class WorkspaceRoot extends Context.Service()("@effected/wor
|
|
|
18104
18290
|
};
|
|
18105
18291
|
|
|
18106
18292
|
//#endregion
|
|
18107
|
-
//#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
|
|
18108
18294
|
/**
|
|
18109
18295
|
* Hard ceiling on directories the enumerator will visit for one pattern set.
|
|
18110
18296
|
* Guards the pathological case a depth cap alone does not: a wide, shallow
|
|
@@ -18123,7 +18309,7 @@ const MAX_ENUMERATION_ENTRIES = 1e5;
|
|
|
18123
18309
|
const PRUNED_DIRECTORIES = /* @__PURE__ */ new Set([".git", "node_modules"]);
|
|
18124
18310
|
|
|
18125
18311
|
//#endregion
|
|
18126
|
-
//#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
|
|
18127
18313
|
/** Directory names never descended into. */
|
|
18128
18314
|
const isPruned = (entry) => PRUNED_DIRECTORIES.has(entry);
|
|
18129
18315
|
/** Join root-relative POSIX segments; `""` is the root itself. */
|
|
@@ -18214,7 +18400,7 @@ var Traversal = class {
|
|
|
18214
18400
|
};
|
|
18215
18401
|
|
|
18216
18402
|
//#endregion
|
|
18217
|
-
//#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
|
|
18218
18404
|
/** Strip a trailing slash from `GlobPattern.enumerationPrefix` to get a relative directory. */
|
|
18219
18405
|
const baseOf = (pattern) => pattern.enumerationPrefix.replace(/\/$/, "");
|
|
18220
18406
|
/**
|
|
@@ -18285,7 +18471,7 @@ const enumerate = (root, globs, options) => Effect.gen(function* () {
|
|
|
18285
18471
|
});
|
|
18286
18472
|
|
|
18287
18473
|
//#endregion
|
|
18288
|
-
//#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
|
|
18289
18475
|
const stringsOf = (value) => Array.isArray(value) ? value.filter((entry) => typeof entry === "string") : void 0;
|
|
18290
18476
|
/** The `packages:` list of a `pnpm-workspace.yaml` document. Total on a parsed document. */
|
|
18291
18477
|
const pnpmPatternsOf = (document) => {
|
|
@@ -18343,7 +18529,7 @@ const readPatterns = (root) => Effect.gen(function* () {
|
|
|
18343
18529
|
});
|
|
18344
18530
|
|
|
18345
18531
|
//#endregion
|
|
18346
|
-
//#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
|
|
18347
18533
|
/**
|
|
18348
18534
|
* Raised when a workspace member's `package.json` cannot be read, parsed, or
|
|
18349
18535
|
* used — it is missing, malformed, or lacks a `name` or `version`.
|
|
@@ -18544,12 +18730,13 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18544
18730
|
kind: failure.kind,
|
|
18545
18731
|
cause: failure.cause
|
|
18546
18732
|
})));
|
|
18547
|
-
const
|
|
18733
|
+
const globs = yield* GlobSet.compile(patterns).pipe(Effect.mapError((error) => new WorkspacePatternError({
|
|
18548
18734
|
root,
|
|
18549
18735
|
pattern: error.pattern,
|
|
18550
18736
|
kind: "uncompilable",
|
|
18551
18737
|
detail: error.message
|
|
18552
|
-
})))
|
|
18738
|
+
})));
|
|
18739
|
+
const directories = yield* enumerate(root, globs, { maxDepth: options?.maxDepth ?? 32 }).pipe(Effect.mapError((failure) => new WorkspacePatternError({
|
|
18553
18740
|
root,
|
|
18554
18741
|
pattern: failure.pattern,
|
|
18555
18742
|
kind: patternKindOf(failure.kind),
|
|
@@ -18781,7 +18968,7 @@ var WorkspaceDiscovery = class WorkspaceDiscovery extends Context.Service()("@ef
|
|
|
18781
18968
|
const isStringRecord$2 = (value) => value !== null && typeof value === "object" && !Array.isArray(value) && Object.values(value).every((entry) => typeof entry === "string");
|
|
18782
18969
|
|
|
18783
18970
|
//#endregion
|
|
18784
|
-
//#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
|
|
18785
18972
|
/**
|
|
18786
18973
|
* Raised when the workspace dependency graph cannot be topologically ordered
|
|
18787
18974
|
* because it contains a cycle.
|
|
@@ -18926,10 +19113,9 @@ packages: Schema.Array(WorkspacePackage) }) {
|
|
|
18926
19113
|
const { reverse } = this.#index();
|
|
18927
19114
|
const affected = /* @__PURE__ */ new Set();
|
|
18928
19115
|
const queue = [...names];
|
|
18929
|
-
|
|
18930
|
-
const current = queue
|
|
18931
|
-
|
|
18932
|
-
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;
|
|
18933
19119
|
if (affected.has(current)) continue;
|
|
18934
19120
|
affected.add(current);
|
|
18935
19121
|
for (const dependent of reverse.get(current) ?? []) if (!affected.has(dependent)) queue.push(dependent);
|
|
@@ -18960,10 +19146,9 @@ packages: Schema.Array(WorkspacePackage) }) {
|
|
|
18960
19146
|
}));
|
|
18961
19147
|
const needed = /* @__PURE__ */ new Set();
|
|
18962
19148
|
const queue = [...names];
|
|
18963
|
-
|
|
18964
|
-
const current = queue
|
|
18965
|
-
|
|
18966
|
-
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;
|
|
18967
19152
|
if (needed.has(current)) continue;
|
|
18968
19153
|
needed.add(current);
|
|
18969
19154
|
for (const dependency of forward.get(current) ?? []) if (!needed.has(dependency)) queue.push(dependency);
|
|
@@ -20429,7 +20614,7 @@ var Git = class Git extends Context.Service()("@effected/git/Git") {
|
|
|
20429
20614
|
};
|
|
20430
20615
|
|
|
20431
20616
|
//#endregion
|
|
20432
|
-
//#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
|
|
20433
20618
|
/**
|
|
20434
20619
|
* Which git refs to compare, and whether to fold in the working tree.
|
|
20435
20620
|
*
|
|
@@ -20711,7 +20896,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
20711
20896
|
}
|
|
20712
20897
|
|
|
20713
20898
|
//#endregion
|
|
20714
|
-
//#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
|
|
20715
20900
|
/** Project a pnpm-workspace manifest's `catalog` / `catalogs` fields into a `Catalogs` map. */
|
|
20716
20901
|
const inlineCatalogs = (manifest) => {
|
|
20717
20902
|
if (manifest.catalog === void 0 && manifest.catalogs === void 0) return {};
|
|
@@ -20762,10 +20947,11 @@ const define = (target, key, value) => {
|
|
|
20762
20947
|
*/
|
|
20763
20948
|
const rangeOf = (catalogs, dependency, specifier) => {
|
|
20764
20949
|
if (catalogNameOf(specifier) === null) return void 0;
|
|
20765
|
-
|
|
20950
|
+
const result = resolveFromCatalog(catalogs, {
|
|
20766
20951
|
alias: dependency,
|
|
20767
20952
|
bareSpecifier: specifier
|
|
20768
|
-
})
|
|
20953
|
+
});
|
|
20954
|
+
return matchCatalogResolveResult(result, {
|
|
20769
20955
|
found: (hit) => hit.resolution.specifier,
|
|
20770
20956
|
misconfiguration: (bad) => ({
|
|
20771
20957
|
catalogName: bad.catalogName,
|
|
@@ -20776,7 +20962,7 @@ const rangeOf = (catalogs, dependency, specifier) => {
|
|
|
20776
20962
|
};
|
|
20777
20963
|
|
|
20778
20964
|
//#endregion
|
|
20779
|
-
//#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
|
|
20780
20966
|
/** Whether `value` is a non-null, non-array object. */
|
|
20781
20967
|
const isObject$2 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
20782
20968
|
/**
|
|
@@ -20925,7 +21111,8 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
20925
21111
|
let loaded;
|
|
20926
21112
|
let found = false;
|
|
20927
21113
|
for (const filename of ["pnpmfile.mjs", "pnpmfile.cjs"]) {
|
|
20928
|
-
const
|
|
21114
|
+
const candidatePath = join(root, "node_modules", ".pnpm-config", name, filename);
|
|
21115
|
+
const candidateUrl = pathToFileURL(candidatePath).href;
|
|
20929
21116
|
const result = yield* Effect.result(Effect.tryPromise({
|
|
20930
21117
|
try: () => import(candidateUrl),
|
|
20931
21118
|
catch: (cause) => cause
|
|
@@ -20963,7 +21150,7 @@ var ConfigDependencyHooks = class ConfigDependencyHooks extends Context.Service(
|
|
|
20963
21150
|
};
|
|
20964
21151
|
|
|
20965
21152
|
//#endregion
|
|
20966
|
-
//#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
|
|
20967
21154
|
/**
|
|
20968
21155
|
* The four package managers this package understands.
|
|
20969
21156
|
*
|
|
@@ -21292,7 +21479,7 @@ var PackageManagerDetector = class PackageManagerDetector extends Context.Servic
|
|
|
21292
21479
|
};
|
|
21293
21480
|
|
|
21294
21481
|
//#endregion
|
|
21295
|
-
//#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
|
|
21296
21483
|
/**
|
|
21297
21484
|
* Raised when the workspace's lockfile cannot be read off disk.
|
|
21298
21485
|
*
|
|
@@ -21473,7 +21660,7 @@ var LockfileReader = class LockfileReader extends Context.Service()("@effected/w
|
|
|
21473
21660
|
};
|
|
21474
21661
|
|
|
21475
21662
|
//#endregion
|
|
21476
|
-
//#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
|
|
21477
21664
|
/** The public npm registry, used when `publishConfig.registry` says nothing. */
|
|
21478
21665
|
const DEFAULT_REGISTRY = "https://registry.npmjs.org/";
|
|
21479
21666
|
/**
|
|
@@ -21633,7 +21820,7 @@ var PublishabilityDetector = class extends Context.Service()("@effected/workspac
|
|
|
21633
21820
|
};
|
|
21634
21821
|
|
|
21635
21822
|
//#endregion
|
|
21636
|
-
//#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
|
|
21637
21824
|
/**
|
|
21638
21825
|
* Strip pnpm's peer-disambiguation suffix from a recorded importer version.
|
|
21639
21826
|
*
|
|
@@ -21720,7 +21907,7 @@ const unanimousVersionOf = (index, dependency) => {
|
|
|
21720
21907
|
};
|
|
21721
21908
|
|
|
21722
21909
|
//#endregion
|
|
21723
|
-
//#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
|
|
21724
21911
|
/**
|
|
21725
21912
|
* An immutable, fully-normalized catalog collection — the one catalog
|
|
21726
21913
|
* resolution semantic in the package.
|
|
@@ -22230,7 +22417,7 @@ var WorkspaceCatalogs = class WorkspaceCatalogs extends Context.Service()("@effe
|
|
|
22230
22417
|
};
|
|
22231
22418
|
|
|
22232
22419
|
//#endregion
|
|
22233
|
-
//#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
|
|
22234
22421
|
const EMPTY = Object.freeze(Object.create(null));
|
|
22235
22422
|
const DependencyMap = Schema.Record(Schema.String, Schema.String).pipe(Schema.withDecodingDefaultKey(Effect.succeed(EMPTY)), Schema.withConstructorDefault(Effect.succeed(EMPTY)));
|
|
22236
22423
|
/**
|
|
@@ -22454,7 +22641,7 @@ var WorkspaceStateSnapshot = class extends Schema.Class("WorkspaceStateSnapshot"
|
|
|
22454
22641
|
};
|
|
22455
22642
|
|
|
22456
22643
|
//#endregion
|
|
22457
|
-
//#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
|
|
22458
22645
|
/** Whether `value` is a non-null, non-array object. */
|
|
22459
22646
|
const isObject = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22460
22647
|
/** Whether every value in a record is a string — a usable dependency map. */
|
|
@@ -22570,11 +22757,12 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
22570
22757
|
let inline;
|
|
22571
22758
|
let recorded;
|
|
22572
22759
|
if (Option.isSome(pnpmWorkspaceText)) {
|
|
22573
|
-
const
|
|
22760
|
+
const document = yield* Yaml.parse(pnpmWorkspaceText.value).pipe(Effect.mapError((cause) => new CatalogAssemblyError({
|
|
22574
22761
|
source: "manifest",
|
|
22575
22762
|
path: "pnpm-workspace.yaml",
|
|
22576
22763
|
cause
|
|
22577
|
-
})))
|
|
22764
|
+
})));
|
|
22765
|
+
const pnpmPatterns = pnpmPatternsOf(document);
|
|
22578
22766
|
patterns = pnpmPatterns.length > 0 ? pnpmPatterns : manifestPatternsOf(rootManifest);
|
|
22579
22767
|
inline = yield* CatalogSet.fromWorkspaceYaml(pnpmWorkspaceText.value);
|
|
22580
22768
|
recorded = yield* lockfileRecord(root, ref, "pnpm");
|
|
@@ -22731,7 +22919,7 @@ var WorkspaceSnapshots = class WorkspaceSnapshots extends Context.Service()("@ef
|
|
|
22731
22919
|
};
|
|
22732
22920
|
|
|
22733
22921
|
//#endregion
|
|
22734
|
-
//#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
|
|
22735
22923
|
const compose = (options, catalogsFactory) => {
|
|
22736
22924
|
const roots = WorkspaceRoot.layer;
|
|
22737
22925
|
const detector = PackageManagerDetector.layer;
|
|
@@ -23026,7 +23214,7 @@ const provenanceForRegistry = (registry) => {
|
|
|
23026
23214
|
* @since 0.4.0
|
|
23027
23215
|
* @public
|
|
23028
23216
|
*/
|
|
23029
|
-
var SilkPublishability = class {
|
|
23217
|
+
var SilkPublishability = class SilkPublishability {
|
|
23030
23218
|
/**
|
|
23031
23219
|
* Apply silk publishability rules to a raw `package.json` and the bundler's resolved
|
|
23032
23220
|
* target binding. Targets-first precedence:
|
|
@@ -23158,6 +23346,56 @@ var SilkPublishability = class {
|
|
|
23158
23346
|
return out;
|
|
23159
23347
|
});
|
|
23160
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
|
+
}));
|
|
23161
23399
|
};
|
|
23162
23400
|
/**
|
|
23163
23401
|
* Reduce a directory to a comparable package-relative POSIX path: backslashes to
|
|
@@ -23174,7 +23412,8 @@ var SilkPublishability = class {
|
|
|
23174
23412
|
*/
|
|
23175
23413
|
const normalizeDir = (dir) => {
|
|
23176
23414
|
const slashed = dir.replaceAll("\\", "/");
|
|
23177
|
-
const
|
|
23415
|
+
const withoutPrefix = slashed.startsWith("./") ? slashed.slice(2) : slashed;
|
|
23416
|
+
const normalized = trimTrailingSlashes(withoutPrefix);
|
|
23178
23417
|
return normalized === "" ? "." : normalized;
|
|
23179
23418
|
};
|
|
23180
23419
|
/** True when a built target directory's package.json is `private: true`. Missing/unreadable/malformed → false. */
|
|
@@ -23204,56 +23443,6 @@ const readTargetsBinding = (fs, pkgPath) => fs.readFileString(join(pkgPath, "dis
|
|
|
23204
23443
|
try: () => JSON.parse(content),
|
|
23205
23444
|
catch: () => /* @__PURE__ */ new Error("invalid targets.json")
|
|
23206
23445
|
})), Effect.orElseSucceed(() => null));
|
|
23207
|
-
/**
|
|
23208
|
-
* Override of `@effected/workspaces`' `PublishabilityDetector` Tag with pure silk rules.
|
|
23209
|
-
*
|
|
23210
|
-
* @remarks Requires `FileSystem` (captured at layer build); `detect` reads the raw
|
|
23211
|
-
* `package.json` from `pkg.packageJsonPath` and applies `SilkPublishability.detect`.
|
|
23212
|
-
*
|
|
23213
|
-
* @since 0.4.0
|
|
23214
|
-
* @public
|
|
23215
|
-
*/
|
|
23216
|
-
const SilkPublishabilityDetectorLive = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
23217
|
-
const fs = yield* FileSystem.FileSystem;
|
|
23218
|
-
return { detect: (pkg) => Effect.gen(function* () {
|
|
23219
|
-
const raw = yield* readRaw(fs, pkg.packageJsonPath);
|
|
23220
|
-
if (!raw) return [];
|
|
23221
|
-
const binding = yield* readTargetsBinding(fs, pkg.path);
|
|
23222
|
-
return SilkPublishability.detect(pkg.name, raw, binding);
|
|
23223
|
-
}) };
|
|
23224
|
-
}));
|
|
23225
|
-
/**
|
|
23226
|
-
* Ignore-aware override of `PublishabilityDetector`. `detect` short-circuits to `[]`
|
|
23227
|
-
* for changeset-ignored packages, then dispatches on `ChangesetConfig.mode`:
|
|
23228
|
-
* `none` → `[]`; `silk` → `SilkPublishability.detect`; `vanilla` → the library default.
|
|
23229
|
-
*
|
|
23230
|
-
* @remarks Requires `FileSystem` and {@link ChangesetConfig} at build.
|
|
23231
|
-
* The kit's `detect` contract no longer receives the workspace root, so the changeset
|
|
23232
|
-
* lookups read it from `pkg.workspaceRoot` — the discovery root the package was found
|
|
23233
|
-
* against, never a filesystem marker walk, which could escape an unmarked root and read
|
|
23234
|
-
* the wrong `.changeset/config.json`.
|
|
23235
|
-
*
|
|
23236
|
-
* @since 0.4.0
|
|
23237
|
-
* @public
|
|
23238
|
-
*/
|
|
23239
|
-
const PublishabilityDetectorAdaptiveLive = Layer.effect(PublishabilityDetector, Effect.gen(function* () {
|
|
23240
|
-
const fs = yield* FileSystem.FileSystem;
|
|
23241
|
-
const config = yield* ChangesetConfig;
|
|
23242
|
-
const vanilla = PublishabilityDetector.npm;
|
|
23243
|
-
return { detect: (pkg) => Effect.gen(function* () {
|
|
23244
|
-
const root = pkg.workspaceRoot;
|
|
23245
|
-
if (yield* config.isIgnored(pkg.name, root)) return [];
|
|
23246
|
-
const mode = yield* config.mode(root);
|
|
23247
|
-
if (mode === "none") return [];
|
|
23248
|
-
if (mode === "silk") {
|
|
23249
|
-
const raw = yield* readRaw(fs, pkg.packageJsonPath);
|
|
23250
|
-
if (!raw) return [];
|
|
23251
|
-
const binding = yield* readTargetsBinding(fs, pkg.path);
|
|
23252
|
-
return SilkPublishability.detect(pkg.name, raw, binding);
|
|
23253
|
-
}
|
|
23254
|
-
return yield* vanilla.detect(pkg);
|
|
23255
|
-
}) };
|
|
23256
|
-
}));
|
|
23257
23446
|
|
|
23258
23447
|
//#endregion
|
|
23259
23448
|
//#region ../silk-effects/dist/dev/pkg/_virtual/_rolldown/runtime.js
|
|
@@ -25080,21 +25269,20 @@ function getGitHubInfo(params) {
|
|
|
25080
25269
|
/**
|
|
25081
25270
|
* GitHub service for fetching commit metadata.
|
|
25082
25271
|
*
|
|
25083
|
-
* Defines the {@link GitHubService} Effect service tag,
|
|
25084
|
-
*
|
|
25272
|
+
* Defines the {@link GitHubService} Effect service tag, its
|
|
25273
|
+
* `GitHubService.layer` production layer backed by `\@changesets/get-github-info`,
|
|
25085
25274
|
* and the {@link makeGitHubTest} helper for constructing deterministic test
|
|
25086
25275
|
* layers.
|
|
25087
25276
|
*
|
|
25088
25277
|
* @remarks
|
|
25089
25278
|
* The GitHub service is consumed by the changelog formatters to resolve
|
|
25090
25279
|
* commit hashes into pull-request numbers, author usernames, and link URLs.
|
|
25091
|
-
* In production,
|
|
25280
|
+
* In production, `GitHubService.layer` calls the GitHub REST API via the
|
|
25092
25281
|
* vendored `getGitHubInfo` wrapper. In tests, {@link makeGitHubTest}
|
|
25093
25282
|
* returns canned responses from a `Map` keyed by commit hash.
|
|
25094
25283
|
*
|
|
25095
25284
|
* @see {@link GitHubService} for the Effect service tag
|
|
25096
25285
|
* @see {@link GitHubServiceShape} for the service interface
|
|
25097
|
-
* @see {@link GitHubLive} for the production layer
|
|
25098
25286
|
* @see {@link makeGitHubTest} for constructing test layers
|
|
25099
25287
|
*/
|
|
25100
25288
|
/**
|
|
@@ -25108,13 +25296,13 @@ function getGitHubInfo(params) {
|
|
|
25108
25296
|
* This tag follows the standard Effect `Context.Service` pattern. Two layers
|
|
25109
25297
|
* are provided out of the box:
|
|
25110
25298
|
*
|
|
25111
|
-
* -
|
|
25299
|
+
* - `GitHubService.layer` — production layer backed by the GitHub REST API
|
|
25112
25300
|
* - {@link makeGitHubTest} — factory for deterministic test layers
|
|
25113
25301
|
*
|
|
25114
25302
|
* @example
|
|
25115
25303
|
* ```typescript
|
|
25116
|
-
* import { Effect
|
|
25117
|
-
* import { GitHubService
|
|
25304
|
+
* import { Effect } from "effect";
|
|
25305
|
+
* import { GitHubService } from "\@savvy-web/changesets";
|
|
25118
25306
|
*
|
|
25119
25307
|
* const program = Effect.gen(function* () {
|
|
25120
25308
|
* const github = yield* GitHubService;
|
|
@@ -25126,7 +25314,7 @@ function getGitHubInfo(params) {
|
|
|
25126
25314
|
* });
|
|
25127
25315
|
*
|
|
25128
25316
|
* // Provide the live layer and run
|
|
25129
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
25317
|
+
* Effect.runPromise(program.pipe(Effect.provide(GitHubService.layer)));
|
|
25130
25318
|
* ```
|
|
25131
25319
|
*
|
|
25132
25320
|
* @example Creating a test layer with canned responses
|
|
@@ -25150,41 +25338,41 @@ function getGitHubInfo(params) {
|
|
|
25150
25338
|
* ```
|
|
25151
25339
|
*
|
|
25152
25340
|
* @see {@link GitHubServiceShape} for the service interface
|
|
25153
|
-
* @see {@link GitHubLive} for the production layer
|
|
25154
25341
|
* @see {@link makeGitHubTest} for creating test layers
|
|
25155
25342
|
*
|
|
25156
25343
|
* @public
|
|
25157
25344
|
*/
|
|
25158
|
-
var GitHubService = class extends Context.Service()("GitHubService") {
|
|
25159
|
-
/**
|
|
25160
|
-
* Production layer for {@link GitHubService}.
|
|
25161
|
-
*
|
|
25162
|
-
* Delegates to `\@changesets/get-github-info` to fetch commit metadata
|
|
25163
|
-
* from the GitHub REST API. Requires a `GITHUB_TOKEN` environment variable
|
|
25164
|
-
* to be set for authenticated requests.
|
|
25165
|
-
*
|
|
25166
|
-
* @remarks
|
|
25167
|
-
* This layer is used by the `\@savvy-web/changesets/changelog` entry point
|
|
25168
|
-
* to resolve commit hashes into PR numbers and author attribution. It is
|
|
25169
|
-
* used by the changelog formatter's
|
|
25170
|
-
* `MainLayer`.
|
|
25171
|
-
*
|
|
25172
|
-
* @example
|
|
25173
|
-
* ```typescript
|
|
25174
|
-
* import { Effect } from "effect";
|
|
25175
|
-
* import { GitHubService
|
|
25176
|
-
*
|
|
25177
|
-
* const program = Effect.gen(function* () {
|
|
25178
|
-
* const github = yield* GitHubService;
|
|
25179
|
-
* return yield* github.getInfo({ commit: "abc1234", repo: "owner/repo" });
|
|
25180
|
-
* });
|
|
25181
|
-
*
|
|
25182
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
25183
|
-
* ```
|
|
25184
|
-
*
|
|
25185
|
-
* @public
|
|
25186
|
-
*/
|
|
25187
|
-
|
|
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
|
+
};
|
|
25188
25376
|
/**
|
|
25189
25377
|
* Create a test layer for {@link GitHubService} with pre-configured responses.
|
|
25190
25378
|
*
|
|
@@ -35682,7 +35870,9 @@ function factoryLabel(effects, ok, nok, type, markerType, stringType) {
|
|
|
35682
35870
|
* @type {State}
|
|
35683
35871
|
*/
|
|
35684
35872
|
function atBreak(code) {
|
|
35685
|
-
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);
|
|
35686
35876
|
if (code === 93) {
|
|
35687
35877
|
effects.exit(stringType);
|
|
35688
35878
|
effects.enter(markerType);
|
|
@@ -45337,9 +45527,10 @@ function serializeDependencyTable(rows) {
|
|
|
45337
45527
|
* @internal
|
|
45338
45528
|
*/
|
|
45339
45529
|
function serializeDependencyTableToMarkdown(rows) {
|
|
45530
|
+
const table = serializeDependencyTable(rows);
|
|
45340
45531
|
return stringifyMarkdown({
|
|
45341
45532
|
type: "root",
|
|
45342
|
-
children: [
|
|
45533
|
+
children: [table]
|
|
45343
45534
|
}).trim();
|
|
45344
45535
|
}
|
|
45345
45536
|
/**
|
|
@@ -46294,7 +46485,8 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46294
46485
|
const parsed = parseChangesetSections(changeset.summary);
|
|
46295
46486
|
const firstLine = changeset.summary.split("\n")[0];
|
|
46296
46487
|
const commitMsg = parseCommitMessage(firstLine);
|
|
46297
|
-
const
|
|
46488
|
+
const bodyText = changeset.summary.split("\n").slice(1).join("\n");
|
|
46489
|
+
const issueRefs = parseIssueReferences(bodyText);
|
|
46298
46490
|
const attribution = commitInfo ? formatPRAndUserAttribution(commitInfo.pull ?? void 0, commitInfo.user ?? void 0, commitInfo.links) : "";
|
|
46299
46491
|
if (parsed.sections.length > 0) {
|
|
46300
46492
|
const lines = [];
|
|
@@ -46320,11 +46512,13 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46320
46512
|
}
|
|
46321
46513
|
return `${lines.join("\n").trimEnd()}${attribution}`;
|
|
46322
46514
|
}
|
|
46323
|
-
|
|
46324
|
-
|
|
46515
|
+
const commitType = commitMsg.type ?? versionType;
|
|
46516
|
+
const entryInput = {
|
|
46517
|
+
type: resolveCommitType(commitType, commitMsg.scope, commitMsg.breaking).heading,
|
|
46325
46518
|
summary: changeset.summary,
|
|
46326
46519
|
issues: issueRefs
|
|
46327
|
-
}
|
|
46520
|
+
};
|
|
46521
|
+
return `- ${formatChangelogEntry(entryInput, { repo: options.repo })}${attribution}`;
|
|
46328
46522
|
});
|
|
46329
46523
|
}
|
|
46330
46524
|
|
|
@@ -46341,7 +46535,7 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46341
46535
|
* @remarks
|
|
46342
46536
|
* The module composes two Effect programs — {@link getReleaseLine} and
|
|
46343
46537
|
* {@link getDependencyReleaseLine} — and runs each through
|
|
46344
|
-
* `Effect.runPromise` with
|
|
46538
|
+
* `Effect.runPromise` with `GitHubService.layer` (for commit metadata). Options are
|
|
46345
46539
|
* validated at the boundary via `validateChangesetOptions` before being
|
|
46346
46540
|
* passed to the formatters.
|
|
46347
46541
|
*
|
|
@@ -46383,14 +46577,14 @@ function getReleaseLine(changeset, versionType, options) {
|
|
|
46383
46577
|
/**
|
|
46384
46578
|
* The layer providing every service the formatters need.
|
|
46385
46579
|
*
|
|
46386
|
-
*
|
|
46580
|
+
* `GitHubService.layer` satisfies the requirements of both `getReleaseLine` and
|
|
46387
46581
|
* `getDependencyReleaseLine`, which each need only `GitHubService`. Markdown
|
|
46388
46582
|
* parsing is not a layer: the formatters call the remark pipeline's
|
|
46389
46583
|
* `parseMarkdown` / `stringifyMarkdown` functions directly.
|
|
46390
46584
|
*
|
|
46391
46585
|
* @internal
|
|
46392
46586
|
*/
|
|
46393
|
-
const MainLayer =
|
|
46587
|
+
const MainLayer = GitHubService.layer;
|
|
46394
46588
|
/**
|
|
46395
46589
|
* Changesets API `ChangelogFunctions` implementation.
|
|
46396
46590
|
*
|
|
@@ -46404,13 +46598,15 @@ const MainLayer = GitHubLive;
|
|
|
46404
46598
|
const changelogFunctions = {
|
|
46405
46599
|
getReleaseLine: async (changeset, versionType, options) => {
|
|
46406
46600
|
const program = Effect.gen(function* () {
|
|
46407
|
-
|
|
46601
|
+
const opts = yield* validateChangesetOptions(options);
|
|
46602
|
+
return yield* getReleaseLine(changeset, versionType, opts);
|
|
46408
46603
|
});
|
|
46409
46604
|
return Effect.runPromise(program.pipe(Effect.provide(MainLayer)));
|
|
46410
46605
|
},
|
|
46411
46606
|
getDependencyReleaseLine: async (changesets, dependenciesUpdated, options) => {
|
|
46412
46607
|
const program = Effect.gen(function* () {
|
|
46413
|
-
|
|
46608
|
+
const opts = yield* validateChangesetOptions(options);
|
|
46609
|
+
return yield* getDependencyReleaseLine(changesets, dependenciesUpdated, opts);
|
|
46414
46610
|
});
|
|
46415
46611
|
return Effect.runPromise(program.pipe(Effect.provide(MainLayer)));
|
|
46416
46612
|
}
|
|
@@ -47875,7 +48071,8 @@ var ChangelogTransformer = class ChangelogTransformer {
|
|
|
47875
48071
|
*/
|
|
47876
48072
|
static transformFile(filePath, options) {
|
|
47877
48073
|
const content = readFileSync(filePath, "utf-8");
|
|
47878
|
-
|
|
48074
|
+
const result = ChangelogTransformer.transformContent(content, options);
|
|
48075
|
+
writeFileSync(filePath, result, "utf-8");
|
|
47879
48076
|
}
|
|
47880
48077
|
};
|
|
47881
48078
|
|
|
@@ -47911,7 +48108,6 @@ var ChangelogTransformer = class ChangelogTransformer {
|
|
|
47911
48108
|
* {@link ConfigInspectorShape.classify} calls reuse it.
|
|
47912
48109
|
*
|
|
47913
48110
|
* @see {@link ConfigInspector} for the Effect service tag
|
|
47914
|
-
* @see {@link ConfigInspectorLive} for the production layer
|
|
47915
48111
|
*
|
|
47916
48112
|
*/
|
|
47917
48113
|
/** A `versionFiles` entry expanded to its absolute target paths. @public */
|
|
@@ -47965,7 +48161,7 @@ const ClassificationSchema = Schema.Struct({
|
|
|
47965
48161
|
* @example
|
|
47966
48162
|
* ```typescript
|
|
47967
48163
|
* import { Effect } from "effect";
|
|
47968
|
-
* import { ConfigInspector
|
|
48164
|
+
* import { ConfigInspector } from "@savvy-web/changesets";
|
|
47969
48165
|
*
|
|
47970
48166
|
* const program = Effect.gen(function* () {
|
|
47971
48167
|
* const inspector = yield* ConfigInspector;
|
|
@@ -47973,12 +48169,24 @@ const ClassificationSchema = Schema.Struct({
|
|
|
47973
48169
|
* return config.packages.map((p) => p.name);
|
|
47974
48170
|
* });
|
|
47975
48171
|
*
|
|
47976
|
-
* Effect.runPromise(program.pipe(Effect.provide(
|
|
48172
|
+
* Effect.runPromise(program.pipe(Effect.provide(ConfigInspector.layer)));
|
|
47977
48173
|
* ```
|
|
47978
48174
|
*
|
|
47979
48175
|
* @public
|
|
47980
48176
|
*/
|
|
47981
|
-
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
|
+
};
|
|
47982
48190
|
/**
|
|
47983
48191
|
* Pull the changelog formatter ID and its options object out of the raw
|
|
47984
48192
|
* `.changeset/config.json` shape (where `changelog` may be a tuple, a string,
|
|
@@ -48372,22 +48580,11 @@ function classifyOne(inspected, path) {
|
|
|
48372
48580
|
};
|
|
48373
48581
|
}
|
|
48374
48582
|
/**
|
|
48375
|
-
* Live layer for {@link ConfigInspector}.
|
|
48376
|
-
*
|
|
48377
|
-
* Requires {@link ChangesetConfigReader} and `WorkspaceDiscovery`
|
|
48378
|
-
* in the environment.
|
|
48379
|
-
*
|
|
48380
|
-
* @public
|
|
48381
|
-
*/
|
|
48382
|
-
const ConfigInspectorLive = Layer.effect(ConfigInspector, Effect.gen(function* () {
|
|
48383
|
-
return makeShape$3(yield* ChangesetConfigReader, yield* WorkspaceDiscovery, yield* FileSystem.FileSystem);
|
|
48384
|
-
}));
|
|
48385
|
-
/**
|
|
48386
48583
|
* Test factory — build a {@link ConfigInspector} that returns a fixed
|
|
48387
48584
|
* {@link InspectedConfig} without touching the filesystem.
|
|
48388
48585
|
*
|
|
48389
48586
|
* Tests that need to exercise the inspect/classify logic against real files
|
|
48390
|
-
* should compose `
|
|
48587
|
+
* should compose `ConfigInspector.layer` with test layers for
|
|
48391
48588
|
* `ChangesetConfigReader` and `WorkspaceDiscovery` instead.
|
|
48392
48589
|
*
|
|
48393
48590
|
* @public
|
|
@@ -48434,7 +48631,7 @@ const BranchAnalysisSchema = Schema.Struct({
|
|
|
48434
48631
|
* @example
|
|
48435
48632
|
* ```typescript
|
|
48436
48633
|
* import { Effect } from "effect";
|
|
48437
|
-
* import { BranchAnalyzer,
|
|
48634
|
+
* import { BranchAnalyzer, ConfigInspector } from "@savvy-web/changesets";
|
|
48438
48635
|
*
|
|
48439
48636
|
* const program = Effect.gen(function* () {
|
|
48440
48637
|
* const analyzer = yield* BranchAnalyzer;
|
|
@@ -48444,16 +48641,30 @@ const BranchAnalysisSchema = Schema.Struct({
|
|
|
48444
48641
|
*
|
|
48445
48642
|
* Effect.runPromise(
|
|
48446
48643
|
* program.pipe(
|
|
48447
|
-
* Effect.provide(
|
|
48448
|
-
* Effect.provide(
|
|
48449
|
-
* // ... +
|
|
48644
|
+
* Effect.provide(BranchAnalyzer.layer),
|
|
48645
|
+
* Effect.provide(ConfigInspector.layer),
|
|
48646
|
+
* // ... + ChangesetConfigReader.layer + kit workspace layers + NodeServices.layer
|
|
48450
48647
|
* ),
|
|
48451
48648
|
* );
|
|
48452
48649
|
* ```
|
|
48453
48650
|
*
|
|
48454
48651
|
* @public
|
|
48455
48652
|
*/
|
|
48456
|
-
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
|
+
};
|
|
48457
48668
|
/**
|
|
48458
48669
|
* Fold a `@effected/git` typed failure into this package's {@link GitError},
|
|
48459
48670
|
* preserving the public `ConfigurationError | GitError` error channel.
|
|
@@ -48537,19 +48748,6 @@ function makeShape$2(inspector, git) {
|
|
|
48537
48748
|
return { analyzeBranch };
|
|
48538
48749
|
}
|
|
48539
48750
|
/**
|
|
48540
|
-
* Live layer for {@link BranchAnalyzer}.
|
|
48541
|
-
*
|
|
48542
|
-
* Requires {@link ConfigInspector} (which in turn requires
|
|
48543
|
-
* `ChangesetConfigReader` and `WorkspaceDiscovery`) and a
|
|
48544
|
-
* `ChildProcessSpawner` (satisfied by `NodeServices.layer`) for the
|
|
48545
|
-
* internally-composed `@effected/git` layer.
|
|
48546
|
-
*
|
|
48547
|
-
* @public
|
|
48548
|
-
*/
|
|
48549
|
-
const BranchAnalyzerLive = Layer.effect(BranchAnalyzer, Effect.gen(function* () {
|
|
48550
|
-
return makeShape$2(yield* ConfigInspector, yield* Git);
|
|
48551
|
-
})).pipe(Layer.provide(Git.layer));
|
|
48552
|
-
/**
|
|
48553
48751
|
* Test factory — build a {@link BranchAnalyzer} that returns a fixed
|
|
48554
48752
|
* {@link BranchAnalysis} for any input.
|
|
48555
48753
|
*
|
|
@@ -48578,7 +48776,7 @@ function makeBranchAnalyzerTest(fixed) {
|
|
|
48578
48776
|
* ```typescript
|
|
48579
48777
|
* import { Effect } from "effect";
|
|
48580
48778
|
* import type { ChangesetOptions } from "\@savvy-web/changesets";
|
|
48581
|
-
* import { ChangelogService
|
|
48779
|
+
* import { ChangelogService } from "\@savvy-web/changesets";
|
|
48582
48780
|
*
|
|
48583
48781
|
* const program = Effect.gen(function* () {
|
|
48584
48782
|
* const changelog = yield* ChangelogService;
|
|
@@ -48775,10 +48973,10 @@ function gitListChangesetFilesAtRef(cwd, ref) {
|
|
|
48775
48973
|
*
|
|
48776
48974
|
* @remarks
|
|
48777
48975
|
* Uses the currently-active {@link SilkPublishability} — wire the
|
|
48778
|
-
*
|
|
48976
|
+
* `SilkPublishability.layer` layer to get silk semantics.
|
|
48779
48977
|
*
|
|
48780
48978
|
* The kit's `PublishabilityDetector.detect` contract no longer receives the
|
|
48781
|
-
* workspace root — the ignore/mode-aware `
|
|
48979
|
+
* workspace root — the ignore/mode-aware `SilkPublishability.layerAdaptive`
|
|
48782
48980
|
* derives the `.changeset/config.json` root per package from the package's
|
|
48783
48981
|
* own discovery coordinates (`pkg.path` ascended by `pkg.relativePath`).
|
|
48784
48982
|
* The `root` parameter is retained for signature stability
|
|
@@ -48833,7 +49031,6 @@ function listPublishablePackageNames(packages, _root) {
|
|
|
48833
49031
|
* and MCP tools are thin adapters over this service.
|
|
48834
49032
|
*
|
|
48835
49033
|
* @see {@link DepsRegen} for the service tag
|
|
48836
|
-
* @see {@link DepsRegenLive} for the production layer
|
|
48837
49034
|
*
|
|
48838
49035
|
*/
|
|
48839
49036
|
const ADJECTIVES = [
|
|
@@ -49032,7 +49229,30 @@ function renderChangesetContent(diff) {
|
|
|
49032
49229
|
*
|
|
49033
49230
|
* @public
|
|
49034
49231
|
*/
|
|
49035
|
-
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
|
+
};
|
|
49036
49256
|
/**
|
|
49037
49257
|
* Build a {@link DepsRegenShape} that closes over already-resolved service
|
|
49038
49258
|
* implementations, keeping the public `plan`/`execute` signatures
|
|
@@ -49052,7 +49272,9 @@ function makeShape$1(snapshots, inspector, discovery, detector, config, fs, prov
|
|
|
49052
49272
|
if (!baseBranch) baseBranch = (yield* inspector.inspect(resolvedCwd).pipe(Effect.catchTag("ConfigurationError", () => Effect.succeed({ baseBranch: "main" })))).baseBranch;
|
|
49053
49273
|
fromRef = yield* gitMergeBase(resolvedCwd, baseBranch).pipe(Effect.provide(provideGit));
|
|
49054
49274
|
}
|
|
49055
|
-
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);
|
|
49056
49278
|
const explicitTargets = /* @__PURE__ */ new Set([...options.packages ?? [], ...options.package ? [options.package] : []]);
|
|
49057
49279
|
const excluded = new Set(options.exclude ?? []);
|
|
49058
49280
|
const livePackages = yield* discovery.listPackages();
|
|
@@ -49125,29 +49347,7 @@ function makeShape$1(snapshots, inspector, discovery, detector, config, fs, prov
|
|
|
49125
49347
|
execute
|
|
49126
49348
|
};
|
|
49127
49349
|
}
|
|
49128
|
-
|
|
49129
|
-
* Live layer for {@link DepsRegen}.
|
|
49130
|
-
*
|
|
49131
|
-
* Requires `WorkspaceSnapshots`, `WorkspaceDiscovery`,
|
|
49132
|
-
* `PublishabilityDetector` (all from `@effected/workspaces`),
|
|
49133
|
-
* `Git` (from `@effected/git`, backing merge-base resolution),
|
|
49134
|
-
* {@link ConfigInspector}, {@link ChangesetConfig}, and
|
|
49135
|
-
* `FileSystem.FileSystem` (resolved once at construction and closed over by
|
|
49136
|
-
* the shape, keeping `plan`/`execute` themselves requirement-free).
|
|
49137
|
-
*
|
|
49138
|
-
* @public
|
|
49139
|
-
*/
|
|
49140
|
-
const DepsRegenLive = Layer.effect(DepsRegen, Effect.gen(function* () {
|
|
49141
|
-
const snapshots = yield* WorkspaceSnapshots;
|
|
49142
|
-
const inspector = yield* ConfigInspector;
|
|
49143
|
-
const discovery = yield* WorkspaceDiscovery;
|
|
49144
|
-
const detector = yield* PublishabilityDetector;
|
|
49145
|
-
const config = yield* ChangesetConfig;
|
|
49146
|
-
const fs = yield* FileSystem.FileSystem;
|
|
49147
|
-
const git = yield* Git;
|
|
49148
|
-
return makeShape$1(snapshots, inspector, discovery, detector, config, fs, Layer.succeed(Git, git));
|
|
49149
|
-
}));
|
|
49150
|
-
const ConfigGraph = ChangesetConfigLive.pipe(Layer.provide(ChangesetConfigReaderLive));
|
|
49350
|
+
const ConfigGraph = ChangesetConfig.layer.pipe(Layer.provide(ChangesetConfigReader.layer));
|
|
49151
49351
|
/**
|
|
49152
49352
|
* Build the batteries-included {@link DepsRegen} layer over a
|
|
49153
49353
|
* `@effected/workspaces` kit graph bound to `options.cwd`.
|
|
@@ -49169,7 +49369,7 @@ const ConfigGraph = ChangesetConfigLive.pipe(Layer.provide(ChangesetConfigReader
|
|
|
49169
49369
|
*/
|
|
49170
49370
|
function makeDepsRegenDefault(options) {
|
|
49171
49371
|
const kitGraph = Workspaces.layerWithGit(options);
|
|
49172
|
-
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));
|
|
49173
49373
|
}
|
|
49174
49374
|
/**
|
|
49175
49375
|
* Batteries-included {@link DepsRegen} layer: silk's opinionated default
|
|
@@ -49181,10 +49381,10 @@ function makeDepsRegenDefault(options) {
|
|
|
49181
49381
|
* (`NodeServices.layer`), not a bare filesystem-only layer.
|
|
49182
49382
|
*
|
|
49183
49383
|
* Gating uses silk's adaptive publishability detector
|
|
49184
|
-
* (
|
|
49384
|
+
* (`SilkPublishability.layerAdaptive`), so the default semantics
|
|
49185
49385
|
* are "versionable minus ignored" — identical to the savvy CLI and MCP
|
|
49186
49386
|
* runtimes. Consumers who need to swap any dependency (test detectors,
|
|
49187
|
-
* alternate config sources) should keep composing {@link
|
|
49387
|
+
* alternate config sources) should keep composing {@link DepsRegen.layer}
|
|
49188
49388
|
* directly; this layer is purely additive.
|
|
49189
49389
|
*
|
|
49190
49390
|
* @example
|
|
@@ -49375,14 +49575,12 @@ function walkJsonPath(obj, path) {
|
|
|
49375
49575
|
path: [...nodePath, segment.index]
|
|
49376
49576
|
});
|
|
49377
49577
|
break;
|
|
49378
|
-
case "wildcard":
|
|
49379
|
-
|
|
49380
|
-
|
|
49381
|
-
|
|
49382
|
-
path: [...nodePath, index]
|
|
49383
|
-
});
|
|
49578
|
+
case "wildcard": if (Array.isArray(node)) node.forEach((element, index) => {
|
|
49579
|
+
next.push({
|
|
49580
|
+
node: element,
|
|
49581
|
+
path: [...nodePath, index]
|
|
49384
49582
|
});
|
|
49385
|
-
|
|
49583
|
+
});
|
|
49386
49584
|
}
|
|
49387
49585
|
}
|
|
49388
49586
|
current = next;
|
|
@@ -50460,7 +50658,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
50460
50658
|
};
|
|
50461
50659
|
module.exports = {
|
|
50462
50660
|
DEFAULT_MAX_EXTGLOB_RECURSION,
|
|
50463
|
-
MAX_LENGTH:
|
|
50661
|
+
MAX_LENGTH: 65536,
|
|
50464
50662
|
POSIX_REGEX_SOURCE,
|
|
50465
50663
|
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
50466
50664
|
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
@@ -52542,7 +52740,7 @@ function formatPaths(paths, mapper) {
|
|
|
52542
52740
|
if (mapper) for (let i = paths.length - 1; i >= 0; i--) paths[i] = mapper(paths[i]);
|
|
52543
52741
|
return paths;
|
|
52544
52742
|
}
|
|
52545
|
-
const defaultOptions = {
|
|
52743
|
+
const defaultOptions$1 = {
|
|
52546
52744
|
caseSensitiveMatch: true,
|
|
52547
52745
|
debug: !!process.env.TINYGLOBBY_DEBUG,
|
|
52548
52746
|
expandDirectories: true,
|
|
@@ -52551,7 +52749,7 @@ const defaultOptions = {
|
|
|
52551
52749
|
};
|
|
52552
52750
|
function getOptions(options) {
|
|
52553
52751
|
const opts = Object.assign({}, options);
|
|
52554
|
-
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] });
|
|
52555
52753
|
opts.cwd = (opts.cwd instanceof URL ? fileURLToPath$1(opts.cwd) : resolve$1(opts.cwd || process.cwd())).replace(BACKSLASHES, "/");
|
|
52556
52754
|
opts.ignore = ensureStringArray(opts.ignore);
|
|
52557
52755
|
opts.fs && (opts.fs = {
|
|
@@ -52872,7 +53070,6 @@ var require_directives = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
52872
53070
|
version: "1.2"
|
|
52873
53071
|
};
|
|
52874
53072
|
this.tags = Object.assign({}, Directives.defaultTags);
|
|
52875
|
-
break;
|
|
52876
53073
|
}
|
|
52877
53074
|
return res;
|
|
52878
53075
|
}
|
|
@@ -53735,7 +53932,7 @@ var require_stringifyString = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
53735
53932
|
}
|
|
53736
53933
|
let blockEndNewlines;
|
|
53737
53934
|
try {
|
|
53738
|
-
blockEndNewlines =
|
|
53935
|
+
blockEndNewlines = new RegExp("(^|(?<!\n))\n+(?!\n|$)", "g");
|
|
53739
53936
|
} catch {
|
|
53740
53937
|
blockEndNewlines = /\n+(?!\n|$)/g;
|
|
53741
53938
|
}
|
|
@@ -55096,9 +55293,7 @@ var require_int = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
55096
55293
|
case 8:
|
|
55097
55294
|
str = `0o${str}`;
|
|
55098
55295
|
break;
|
|
55099
|
-
case 16:
|
|
55100
|
-
str = `0x${str}`;
|
|
55101
|
-
break;
|
|
55296
|
+
case 16: str = `0x${str}`;
|
|
55102
55297
|
}
|
|
55103
55298
|
const n = BigInt(str);
|
|
55104
55299
|
return sign === "-" ? BigInt(-1) * n : n;
|
|
@@ -56648,9 +56843,7 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
56648
56843
|
badChar = `block scalar indicator ${source[0]}`;
|
|
56649
56844
|
break;
|
|
56650
56845
|
case "@":
|
|
56651
|
-
case "`":
|
|
56652
|
-
badChar = `reserved character ${source[0]}`;
|
|
56653
|
-
break;
|
|
56846
|
+
case "`": badChar = `reserved character ${source[0]}`;
|
|
56654
56847
|
}
|
|
56655
56848
|
if (badChar) onError(0, "BAD_SCALAR_START", `Plain value cannot start with ${badChar}`);
|
|
56656
56849
|
return foldLines(source);
|
|
@@ -56669,8 +56862,8 @@ var require_resolve_flow_scalar = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
56669
56862
|
*/
|
|
56670
56863
|
let first, line;
|
|
56671
56864
|
try {
|
|
56672
|
-
first =
|
|
56673
|
-
line =
|
|
56865
|
+
first = new RegExp("(.*?)(?<![ ])[ ]*\r?\n", "sy");
|
|
56866
|
+
line = new RegExp("[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?\n", "sy");
|
|
56674
56867
|
} catch {
|
|
56675
56868
|
first = /(.*?)[ \t]*\r?\n/sy;
|
|
56676
56869
|
line = /[ \t]*(.*?)[ \t]*\r?\n/sy;
|
|
@@ -62603,7 +62796,7 @@ const COMMANDS = {
|
|
|
62603
62796
|
"deno": deno,
|
|
62604
62797
|
"nub": nub
|
|
62605
62798
|
};
|
|
62606
|
-
function resolveCommand(agent, command, args) {
|
|
62799
|
+
function resolveCommand$1(agent, command, args) {
|
|
62607
62800
|
const value = COMMANDS[agent][command];
|
|
62608
62801
|
return constructCommand(value, args);
|
|
62609
62802
|
}
|
|
@@ -62715,18 +62908,16 @@ async function detect$1(options = {}) {
|
|
|
62715
62908
|
if (result) return result;
|
|
62716
62909
|
break;
|
|
62717
62910
|
}
|
|
62718
|
-
case "install-metadata":
|
|
62719
|
-
|
|
62720
|
-
|
|
62721
|
-
|
|
62722
|
-
|
|
62723
|
-
|
|
62724
|
-
|
|
62725
|
-
|
|
62726
|
-
};
|
|
62727
|
-
}
|
|
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
|
+
};
|
|
62728
62919
|
}
|
|
62729
|
-
|
|
62920
|
+
}
|
|
62730
62921
|
}
|
|
62731
62922
|
if (stopDir?.(directory)) break;
|
|
62732
62923
|
}
|
|
@@ -62788,201 +62979,212 @@ function isMetadataYarnClassic(metadataPath) {
|
|
|
62788
62979
|
}
|
|
62789
62980
|
|
|
62790
62981
|
//#endregion
|
|
62791
|
-
//#region ../../node_modules/.pnpm/tinyexec@1.
|
|
62792
|
-
const
|
|
62793
|
-
const
|
|
62982
|
+
//#region ../../node_modules/.pnpm/tinyexec@1.3.0/node_modules/tinyexec/dist/main.mjs
|
|
62983
|
+
const isPathLikePattern = /^path$/i;
|
|
62984
|
+
const defaultEnvPathInfo = {
|
|
62794
62985
|
key: "PATH",
|
|
62795
62986
|
value: ""
|
|
62796
62987
|
};
|
|
62797
|
-
function
|
|
62798
|
-
for (const
|
|
62799
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
62800
|
-
const
|
|
62801
|
-
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;
|
|
62802
62993
|
return {
|
|
62803
|
-
key
|
|
62804
|
-
value
|
|
62994
|
+
key,
|
|
62995
|
+
value
|
|
62805
62996
|
};
|
|
62806
62997
|
}
|
|
62807
|
-
return
|
|
62998
|
+
return defaultEnvPathInfo;
|
|
62808
62999
|
}
|
|
62809
|
-
function
|
|
62810
|
-
const
|
|
62811
|
-
const
|
|
62812
|
-
let
|
|
62813
|
-
let
|
|
63000
|
+
function addNodeBinToPath(cwd, path) {
|
|
63001
|
+
const parts = path.value.split(delimiter);
|
|
63002
|
+
const nodeBinPaths = [];
|
|
63003
|
+
let currentPath = cwd;
|
|
63004
|
+
let lastPath;
|
|
62814
63005
|
do {
|
|
62815
|
-
|
|
62816
|
-
|
|
62817
|
-
|
|
62818
|
-
} while (
|
|
62819
|
-
|
|
62820
|
-
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);
|
|
62821
63012
|
return {
|
|
62822
|
-
key:
|
|
62823
|
-
value:
|
|
63013
|
+
key: path.key,
|
|
63014
|
+
value: newPath
|
|
62824
63015
|
};
|
|
62825
63016
|
}
|
|
62826
|
-
function
|
|
62827
|
-
const
|
|
63017
|
+
function computeEnv(cwd, env, nodePath = true) {
|
|
63018
|
+
const envWithDefault = {
|
|
62828
63019
|
...process.env,
|
|
62829
|
-
...
|
|
63020
|
+
...env
|
|
62830
63021
|
};
|
|
62831
|
-
if (!
|
|
62832
|
-
const
|
|
62833
|
-
|
|
62834
|
-
return
|
|
62835
|
-
}
|
|
62836
|
-
const
|
|
62837
|
-
let
|
|
62838
|
-
const
|
|
62839
|
-
const
|
|
62840
|
-
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();
|
|
62841
63032
|
};
|
|
62842
|
-
for (const
|
|
62843
|
-
return
|
|
63033
|
+
for (const stream of streams) pipeline(stream, combined, { end: false }).then(maybeEmitEnd).catch(maybeEmitEnd);
|
|
63034
|
+
return combined;
|
|
62844
63035
|
};
|
|
62845
|
-
const
|
|
62846
|
-
const
|
|
62847
|
-
const
|
|
62848
|
-
const
|
|
62849
|
-
const
|
|
62850
|
-
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 = [
|
|
62851
63042
|
".EXE",
|
|
62852
63043
|
".CMD",
|
|
62853
63044
|
".BAT",
|
|
62854
63045
|
".COM"
|
|
62855
63046
|
];
|
|
63047
|
+
const noPathExt = [""];
|
|
62856
63048
|
/**
|
|
62857
63049
|
* Normalizes the command and arguments to work cross-platform.
|
|
62858
63050
|
* On Windows, this basically handles things like shebangs, calling
|
|
62859
63051
|
* `node_modules/.bin` commands, and escaping meta characters.
|
|
62860
63052
|
* On other platforms, it just returns the command and arguments as-is.
|
|
62861
63053
|
*/
|
|
62862
|
-
function
|
|
62863
|
-
if (
|
|
62864
|
-
command
|
|
62865
|
-
args
|
|
62866
|
-
options
|
|
63054
|
+
function normalizeSpawnCommand(command, args = [], options = {}) {
|
|
63055
|
+
if (options.shell === true || !isWindows) return {
|
|
63056
|
+
command,
|
|
63057
|
+
args,
|
|
63058
|
+
options
|
|
62867
63059
|
};
|
|
62868
|
-
let
|
|
62869
|
-
let
|
|
62870
|
-
if (
|
|
62871
|
-
const
|
|
62872
|
-
const
|
|
62873
|
-
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;
|
|
62874
63066
|
try {
|
|
62875
|
-
|
|
62876
|
-
readSync(
|
|
63067
|
+
fd = openSync(file, "r");
|
|
63068
|
+
readSync(fd, buffer, 0, size, 0);
|
|
62877
63069
|
} catch {} finally {
|
|
62878
|
-
if (
|
|
62879
|
-
}
|
|
62880
|
-
const
|
|
62881
|
-
if (
|
|
62882
|
-
const
|
|
62883
|
-
const
|
|
62884
|
-
const
|
|
62885
|
-
const
|
|
62886
|
-
const
|
|
62887
|
-
|
|
62888
|
-
}
|
|
62889
|
-
}
|
|
62890
|
-
if (
|
|
62891
|
-
|
|
62892
|
-
|
|
62893
|
-
|
|
62894
|
-
}
|
|
62895
|
-
if (
|
|
62896
|
-
const
|
|
62897
|
-
|
|
62898
|
-
|
|
62899
|
-
|
|
62900
|
-
|
|
62901
|
-
|
|
62902
|
-
|
|
62903
|
-
|
|
62904
|
-
if (
|
|
62905
|
-
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;
|
|
62906
63098
|
});
|
|
62907
|
-
|
|
63099
|
+
args = [
|
|
62908
63100
|
"/d",
|
|
62909
63101
|
"/s",
|
|
62910
63102
|
"/c",
|
|
62911
|
-
`"${[
|
|
63103
|
+
`"${[command, ...args].join(" ")}"`
|
|
62912
63104
|
];
|
|
62913
|
-
|
|
62914
|
-
|
|
62915
|
-
...
|
|
63105
|
+
command = options.env?.comspec ?? "cmd.exe";
|
|
63106
|
+
options = {
|
|
63107
|
+
...options,
|
|
62916
63108
|
windowsVerbatimArguments: true
|
|
62917
63109
|
};
|
|
62918
63110
|
}
|
|
62919
63111
|
return {
|
|
62920
|
-
command
|
|
62921
|
-
args
|
|
62922
|
-
options
|
|
63112
|
+
command,
|
|
63113
|
+
args,
|
|
63114
|
+
options
|
|
62923
63115
|
};
|
|
62924
63116
|
}
|
|
62925
63117
|
/**
|
|
62926
63118
|
* Resolves the command to an absolute path if possible.
|
|
62927
63119
|
* Handles things like traversing PATH and adding extensions from PATHEXT
|
|
62928
63120
|
*/
|
|
62929
|
-
function
|
|
62930
|
-
const
|
|
62931
|
-
const
|
|
62932
|
-
const
|
|
62933
|
-
const
|
|
62934
|
-
|
|
62935
|
-
if (
|
|
62936
|
-
for (const
|
|
62937
|
-
const
|
|
62938
|
-
for (const
|
|
62939
|
-
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;
|
|
62940
63132
|
try {
|
|
62941
|
-
if (statSync(
|
|
63133
|
+
if (statSync(destWithExt).isFile()) return destWithExt;
|
|
62942
63134
|
} catch {}
|
|
62943
63135
|
}
|
|
62944
63136
|
}
|
|
62945
63137
|
return null;
|
|
62946
63138
|
}
|
|
62947
|
-
var
|
|
63139
|
+
var NonZeroExitError = class extends Error {
|
|
62948
63140
|
result;
|
|
62949
63141
|
output;
|
|
62950
|
-
|
|
62951
|
-
|
|
62952
|
-
|
|
62953
|
-
|
|
62954
|
-
|
|
62955
|
-
|
|
62956
|
-
|
|
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
|
+
});
|
|
62957
63159
|
}
|
|
62958
63160
|
};
|
|
62959
|
-
const
|
|
63161
|
+
const defaultOptions = {
|
|
62960
63162
|
timeout: void 0,
|
|
62961
63163
|
persist: false
|
|
62962
63164
|
};
|
|
62963
|
-
const
|
|
62964
|
-
function
|
|
62965
|
-
const
|
|
62966
|
-
for (const
|
|
62967
|
-
if (
|
|
62968
|
-
|
|
62969
|
-
return
|
|
62970
|
-
}
|
|
62971
|
-
const
|
|
62972
|
-
|
|
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);
|
|
62973
63175
|
};
|
|
62974
|
-
|
|
63176
|
+
signal.addEventListener("abort", onAbort, { signal: controller.signal });
|
|
62975
63177
|
}
|
|
62976
|
-
return
|
|
63178
|
+
return controller.signal;
|
|
62977
63179
|
}
|
|
62978
|
-
async function
|
|
62979
|
-
let
|
|
63180
|
+
async function readStream(stream) {
|
|
63181
|
+
let output = "";
|
|
62980
63182
|
try {
|
|
62981
|
-
for await (const
|
|
63183
|
+
for await (const chunk of stream) output += chunk.toString();
|
|
62982
63184
|
} catch {}
|
|
62983
|
-
return
|
|
63185
|
+
return output;
|
|
62984
63186
|
}
|
|
62985
|
-
var
|
|
63187
|
+
var ExecProcess = class {
|
|
62986
63188
|
_process;
|
|
62987
63189
|
_aborted = false;
|
|
62988
63190
|
_options;
|
|
@@ -63000,19 +63202,22 @@ var I = class {
|
|
|
63000
63202
|
get exitCode() {
|
|
63001
63203
|
if (this._process && this._process.exitCode !== null) return this._process.exitCode;
|
|
63002
63204
|
}
|
|
63003
|
-
|
|
63205
|
+
get signalCode() {
|
|
63206
|
+
return this._process?.signalCode ?? null;
|
|
63207
|
+
}
|
|
63208
|
+
constructor(command, args, options) {
|
|
63004
63209
|
this._options = {
|
|
63005
|
-
...
|
|
63006
|
-
...
|
|
63210
|
+
...defaultOptions,
|
|
63211
|
+
...options
|
|
63007
63212
|
};
|
|
63008
|
-
this._command =
|
|
63009
|
-
this._args =
|
|
63010
|
-
this._processClosed = new Promise((
|
|
63011
|
-
this._resolveClose =
|
|
63213
|
+
this._command = command;
|
|
63214
|
+
this._args = args ?? [];
|
|
63215
|
+
this._processClosed = new Promise((resolve) => {
|
|
63216
|
+
this._resolveClose = resolve;
|
|
63012
63217
|
});
|
|
63013
63218
|
}
|
|
63014
|
-
kill(
|
|
63015
|
-
return this._process?.kill(
|
|
63219
|
+
kill(signal) {
|
|
63220
|
+
return this._process?.kill(signal) === true;
|
|
63016
63221
|
}
|
|
63017
63222
|
get aborted() {
|
|
63018
63223
|
return this._aborted;
|
|
@@ -63020,99 +63225,99 @@ var I = class {
|
|
|
63020
63225
|
get killed() {
|
|
63021
63226
|
return this._process?.killed === true;
|
|
63022
63227
|
}
|
|
63023
|
-
pipe(
|
|
63024
|
-
return
|
|
63025
|
-
...
|
|
63228
|
+
pipe(command, args, options) {
|
|
63229
|
+
return exec(command, args, {
|
|
63230
|
+
...options,
|
|
63026
63231
|
stdin: this
|
|
63027
63232
|
});
|
|
63028
63233
|
}
|
|
63029
63234
|
async *[Symbol.asyncIterator]() {
|
|
63030
|
-
const
|
|
63031
|
-
if (!
|
|
63032
|
-
const
|
|
63033
|
-
if (this._streamErr)
|
|
63034
|
-
if (this._streamOut)
|
|
63035
|
-
const
|
|
63036
|
-
const
|
|
63037
|
-
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();
|
|
63038
63243
|
await this._processClosed;
|
|
63039
|
-
|
|
63244
|
+
proc.removeAllListeners();
|
|
63040
63245
|
if (this._thrownError) throw this._thrownError;
|
|
63041
|
-
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);
|
|
63042
63247
|
}
|
|
63043
63248
|
async _waitForOutput() {
|
|
63044
|
-
const
|
|
63045
|
-
if (!
|
|
63046
|
-
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) : ""]);
|
|
63047
63252
|
await this._processClosed;
|
|
63048
|
-
const { stdin
|
|
63049
|
-
if (
|
|
63050
|
-
|
|
63253
|
+
const { stdin } = this._options;
|
|
63254
|
+
if (stdin && typeof stdin !== "string") await stdin;
|
|
63255
|
+
proc.removeAllListeners();
|
|
63051
63256
|
if (this._thrownError) throw this._thrownError;
|
|
63052
|
-
const
|
|
63053
|
-
stderr
|
|
63054
|
-
stdout
|
|
63257
|
+
const result = {
|
|
63258
|
+
stderr,
|
|
63259
|
+
stdout,
|
|
63055
63260
|
exitCode: this.exitCode
|
|
63056
63261
|
};
|
|
63057
|
-
if (this._options.throwOnError && this.exitCode !== 0 && this.exitCode !== void 0) throw new
|
|
63058
|
-
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;
|
|
63059
63264
|
}
|
|
63060
|
-
then(
|
|
63061
|
-
return this._waitForOutput().then(
|
|
63265
|
+
then(onfulfilled, onrejected) {
|
|
63266
|
+
return this._waitForOutput().then(onfulfilled, onrejected);
|
|
63062
63267
|
}
|
|
63063
63268
|
_streamOut;
|
|
63064
63269
|
_streamErr;
|
|
63065
63270
|
spawn() {
|
|
63066
|
-
const
|
|
63067
|
-
const
|
|
63068
|
-
const
|
|
63069
|
-
...
|
|
63070
|
-
...
|
|
63271
|
+
const cwd$1 = cwd();
|
|
63272
|
+
const options = this._options;
|
|
63273
|
+
const nodeOptions = {
|
|
63274
|
+
...defaultNodeOptions,
|
|
63275
|
+
...options.nodeOptions
|
|
63071
63276
|
};
|
|
63072
|
-
const
|
|
63277
|
+
const signals = [];
|
|
63073
63278
|
this._resetState();
|
|
63074
|
-
if (
|
|
63075
|
-
if (
|
|
63076
|
-
if (
|
|
63077
|
-
if (
|
|
63078
|
-
|
|
63079
|
-
const
|
|
63080
|
-
const
|
|
63081
|
-
if (
|
|
63082
|
-
if (
|
|
63083
|
-
this._process =
|
|
63084
|
-
|
|
63085
|
-
|
|
63086
|
-
if (
|
|
63087
|
-
const { stdin
|
|
63088
|
-
if (typeof
|
|
63089
|
-
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);
|
|
63090
63295
|
}
|
|
63091
63296
|
}
|
|
63092
63297
|
_resetState() {
|
|
63093
63298
|
this._aborted = false;
|
|
63094
|
-
this._processClosed = new Promise((
|
|
63095
|
-
this._resolveClose =
|
|
63299
|
+
this._processClosed = new Promise((resolve) => {
|
|
63300
|
+
this._resolveClose = resolve;
|
|
63096
63301
|
});
|
|
63097
63302
|
this._thrownError = void 0;
|
|
63098
63303
|
}
|
|
63099
|
-
_onError = (
|
|
63100
|
-
if (
|
|
63304
|
+
_onError = (err) => {
|
|
63305
|
+
if (err.name === "AbortError" && (!(err.cause instanceof Error) || err.cause.name !== "TimeoutError")) {
|
|
63101
63306
|
this._aborted = true;
|
|
63102
63307
|
return;
|
|
63103
63308
|
}
|
|
63104
|
-
this._thrownError =
|
|
63309
|
+
this._thrownError = err;
|
|
63105
63310
|
};
|
|
63106
63311
|
_onClose = () => {
|
|
63107
63312
|
if (this._resolveClose) this._resolveClose();
|
|
63108
63313
|
};
|
|
63109
63314
|
};
|
|
63110
|
-
const
|
|
63111
|
-
const
|
|
63112
|
-
|
|
63113
|
-
return
|
|
63315
|
+
const x = (command, args, userOptions) => {
|
|
63316
|
+
const proc = new ExecProcess(command, args, userOptions);
|
|
63317
|
+
proc.spawn();
|
|
63318
|
+
return proc;
|
|
63114
63319
|
};
|
|
63115
|
-
const
|
|
63320
|
+
const exec = x;
|
|
63116
63321
|
|
|
63117
63322
|
//#endregion
|
|
63118
63323
|
//#region ../../node_modules/.pnpm/@changesets+format@0.1.1/node_modules/@changesets/format/dist/index.js
|
|
@@ -63132,14 +63337,14 @@ function traverseUpwards(startDir, stopDir, cb) {
|
|
|
63132
63337
|
}
|
|
63133
63338
|
}
|
|
63134
63339
|
async function packageManagerExecute(packageManager, args, cwd) {
|
|
63135
|
-
const cmd = resolveCommand(packageManager, "execute-local", args) ?? {
|
|
63340
|
+
const cmd = resolveCommand$1(packageManager, "execute-local", args) ?? {
|
|
63136
63341
|
command: "npx",
|
|
63137
63342
|
args
|
|
63138
63343
|
};
|
|
63139
63344
|
return await spawnProcess(cmd.command, cmd.args, cwd);
|
|
63140
63345
|
}
|
|
63141
63346
|
async function spawnProcess(command, args, cwd) {
|
|
63142
|
-
await
|
|
63347
|
+
await exec(command, args, {
|
|
63143
63348
|
nodeOptions: { cwd },
|
|
63144
63349
|
throwOnError: true
|
|
63145
63350
|
});
|
|
@@ -63331,7 +63536,7 @@ var InternalError = class extends Error {
|
|
|
63331
63536
|
//#endregion
|
|
63332
63537
|
//#region ../../node_modules/.pnpm/@changesets+git@4.0.0-next.8/node_modules/@changesets/git/dist/index.mjs
|
|
63333
63538
|
async function getDivergedCommit(cwd, ref) {
|
|
63334
|
-
const cmd = await
|
|
63539
|
+
const cmd = await exec("git", [
|
|
63335
63540
|
"merge-base",
|
|
63336
63541
|
ref,
|
|
63337
63542
|
"HEAD"
|
|
@@ -63350,7 +63555,7 @@ async function getCommitsThatAddFiles(gitPaths, { cwd, short = false }) {
|
|
|
63350
63555
|
let remaining = gitPaths;
|
|
63351
63556
|
do {
|
|
63352
63557
|
const commitInfos = await Promise.all(remaining.map(async (gitPath) => {
|
|
63353
|
-
const [commitSha, parentSha] = (await
|
|
63558
|
+
const [commitSha, parentSha] = (await exec("git", [
|
|
63354
63559
|
"log",
|
|
63355
63560
|
"--diff-filter=A",
|
|
63356
63561
|
"--max-count=1",
|
|
@@ -63381,9 +63586,9 @@ async function getCommitsThatAddFiles(gitPaths, { cwd, short = false }) {
|
|
|
63381
63586
|
return gitPaths.map((p) => map.get(p));
|
|
63382
63587
|
}
|
|
63383
63588
|
async function isRepoShallow({ cwd }) {
|
|
63384
|
-
const isShallowRepoOutput = (await
|
|
63589
|
+
const isShallowRepoOutput = (await exec("git", ["rev-parse", "--is-shallow-repository"], { nodeOptions: { cwd } })).stdout.toString().trim();
|
|
63385
63590
|
if (isShallowRepoOutput === "--is-shallow-repository") {
|
|
63386
|
-
const gitDir = (await
|
|
63591
|
+
const gitDir = (await exec("git", ["rev-parse", "--git-dir"], { nodeOptions: { cwd } })).stdout.toString().trim();
|
|
63387
63592
|
const fullGitDir = path$1.resolve(cwd, gitDir);
|
|
63388
63593
|
try {
|
|
63389
63594
|
await fs$1.access(path$1.join(fullGitDir, "shallow"));
|
|
@@ -63394,12 +63599,12 @@ async function isRepoShallow({ cwd }) {
|
|
|
63394
63599
|
} else return isShallowRepoOutput === "true";
|
|
63395
63600
|
}
|
|
63396
63601
|
async function deepenCloneBy({ by, cwd }) {
|
|
63397
|
-
const cmd = await
|
|
63602
|
+
const cmd = await exec("git", ["fetch", `--deepen=${by}`], { nodeOptions: { cwd } });
|
|
63398
63603
|
if (cmd.exitCode !== 0) throw new Error(cmd.stderr.toString());
|
|
63399
63604
|
}
|
|
63400
63605
|
async function getChangedChangesetFilesSinceRef({ cwd, ref }) {
|
|
63401
63606
|
try {
|
|
63402
|
-
const cmd = await
|
|
63607
|
+
const cmd = await exec("git", [
|
|
63403
63608
|
"diff",
|
|
63404
63609
|
"--name-only",
|
|
63405
63610
|
"--diff-filter=d",
|
|
@@ -65236,9 +65441,7 @@ function visit(text, visitor, options = ParseOptions.DEFAULT) {
|
|
|
65236
65441
|
case 2:
|
|
65237
65442
|
handleError(12);
|
|
65238
65443
|
break;
|
|
65239
|
-
case 6:
|
|
65240
|
-
handleError(16);
|
|
65241
|
-
break;
|
|
65444
|
+
case 6: handleError(16);
|
|
65242
65445
|
}
|
|
65243
65446
|
switch (token) {
|
|
65244
65447
|
case 12:
|
|
@@ -66360,7 +66563,12 @@ async function loadConfig(root, packages) {
|
|
|
66360
66563
|
};
|
|
66361
66564
|
}
|
|
66362
66565
|
/** Effect service tag for the release planner. @public */
|
|
66363
|
-
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
|
+
};
|
|
66364
66572
|
/** Build the service shape over a resolved {@link ConfigInspector} and {@link FileSystem.FileSystem}. */
|
|
66365
66573
|
function makeShape(inspector, fs) {
|
|
66366
66574
|
const plan = (root) => Effect.tryPromise({
|
|
@@ -66378,10 +66586,6 @@ function makeShape(inspector, fs) {
|
|
|
66378
66586
|
apply
|
|
66379
66587
|
};
|
|
66380
66588
|
}
|
|
66381
|
-
/** Production layer. Requires {@link ConfigInspector} (used by `apply`) and `FileSystem`. @public */
|
|
66382
|
-
const ReleasePlannerLive = Layer.effect(ReleasePlanner, Effect.gen(function* () {
|
|
66383
|
-
return makeShape(yield* ConfigInspector, yield* FileSystem.FileSystem);
|
|
66384
|
-
}));
|
|
66385
66589
|
/**
|
|
66386
66590
|
* Test factory — supply fixed results for any subset of methods. Unsupplied
|
|
66387
66591
|
* methods fail with a `ReleasePlanError`.
|
|
@@ -67511,7 +67715,6 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67511
67715
|
AppliedReleaseSchema: () => AppliedReleaseSchema,
|
|
67512
67716
|
BranchAnalysisSchema: () => BranchAnalysisSchema,
|
|
67513
67717
|
BranchAnalyzer: () => BranchAnalyzer,
|
|
67514
|
-
BranchAnalyzerLive: () => BranchAnalyzerLive,
|
|
67515
67718
|
BranchFileEntrySchema: () => BranchFileEntrySchema,
|
|
67516
67719
|
BumpTypeSchema: () => BumpTypeSchema,
|
|
67517
67720
|
Categories: () => Categories,
|
|
@@ -67529,7 +67732,6 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67529
67732
|
ClassificationSchema: () => ClassificationSchema,
|
|
67530
67733
|
CommitHashSchema: () => CommitHashSchema,
|
|
67531
67734
|
ConfigInspector: () => ConfigInspector,
|
|
67532
|
-
ConfigInspectorLive: () => ConfigInspectorLive,
|
|
67533
67735
|
ConfigurationError: () => ConfigurationError,
|
|
67534
67736
|
ContentStructureRule: () => ContentStructureRule$2,
|
|
67535
67737
|
ContributorFootnotesPlugin: () => ContributorFootnotesPlugin,
|
|
@@ -67544,12 +67746,10 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67544
67746
|
DependencyUpdateSchema: () => DependencyUpdateSchema,
|
|
67545
67747
|
DepsRegen: () => DepsRegen,
|
|
67546
67748
|
DepsRegenDefault: () => DepsRegenDefault,
|
|
67547
|
-
DepsRegenLive: () => DepsRegenLive,
|
|
67548
67749
|
FileStatusSchema: () => FileStatusSchema,
|
|
67549
67750
|
GitError: () => GitError$1,
|
|
67550
67751
|
GitHubApiError: () => GitHubApiError,
|
|
67551
67752
|
GitHubInfoSchema: () => GitHubInfoSchema,
|
|
67552
|
-
GitHubLive: () => GitHubLive,
|
|
67553
67753
|
GitHubService: () => GitHubService,
|
|
67554
67754
|
GlobSchema: () => GlobSchema,
|
|
67555
67755
|
HeadingHierarchyRule: () => HeadingHierarchyRule$2,
|
|
@@ -67578,7 +67778,6 @@ var changesets_exports = /* @__PURE__ */ __exportAll({
|
|
|
67578
67778
|
PreviewReleaseSchema: () => PreviewReleaseSchema,
|
|
67579
67779
|
ReleasePlanError: () => ReleasePlanError,
|
|
67580
67780
|
ReleasePlanner: () => ReleasePlanner,
|
|
67581
|
-
ReleasePlannerLive: () => ReleasePlannerLive,
|
|
67582
67781
|
ReorderSectionsPlugin: () => ReorderSectionsPlugin,
|
|
67583
67782
|
RepoSchema: () => RepoSchema,
|
|
67584
67783
|
RequiredSectionsRule: () => RequiredSectionsRule$2,
|