@savvy-web/changelog 0.1.0 → 0.1.1
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/index.cjs +1582 -172
- package/index.d.cts +7 -19504
- package/index.d.ts +7 -19504
- package/index.js +1600 -174
- package/package.json +1 -1
package/index.cjs
CHANGED
|
@@ -3564,7 +3564,7 @@ const Order$1 = number;
|
|
|
3564
3564
|
* @since 2.0.0
|
|
3565
3565
|
* @category constructors
|
|
3566
3566
|
*/
|
|
3567
|
-
const parse$
|
|
3567
|
+
const parse$4 = (s) => {
|
|
3568
3568
|
if (s === "NaN") return some$1(NaN);
|
|
3569
3569
|
if (s === "Infinity") return some$1(Infinity);
|
|
3570
3570
|
if (s === "-Infinity") return some$1(-Infinity);
|
|
@@ -12317,7 +12317,7 @@ const set = /*#__PURE__*/ dual(2, (self, value) => self.modify(() => [void 0, va
|
|
|
12317
12317
|
/** @internal */
|
|
12318
12318
|
const getAndSet$1 = /*#__PURE__*/ dual(2, (self, value) => self.modify((a) => [a, value]));
|
|
12319
12319
|
/** @internal */
|
|
12320
|
-
const modify = /*#__PURE__*/ dual(2, (self, f) => self.modify(f));
|
|
12320
|
+
const modify$1 = /*#__PURE__*/ dual(2, (self, f) => self.modify(f));
|
|
12321
12321
|
/** @internal */
|
|
12322
12322
|
const update$1 = /*#__PURE__*/ dual(2, (self, f) => self.modify((a) => [void 0, f(a)]));
|
|
12323
12323
|
//#endregion
|
|
@@ -17049,7 +17049,7 @@ var MemoMapImpl = class {
|
|
|
17049
17049
|
const resource = uninterruptibleMask$2((restore) => pipe$1(scopeMake(), flatMap$4((innerScope) => pipe$1(restore(flatMap$4(makeBuilder(layer, innerScope, true), (f) => diffFiberRefs(f(this)))), exit$3, flatMap$4((exit) => {
|
|
17050
17050
|
switch (exit._tag) {
|
|
17051
17051
|
case OP_FAILURE: return pipe$1(deferredFailCause(deferred, exit.effect_instruction_i0), zipRight$2(scopeClose(innerScope, exit)), zipRight$2(failCause$4(exit.effect_instruction_i0)));
|
|
17052
|
-
case OP_SUCCESS: return pipe$1(set(finalizerRef, (exit) => pipe$1(scopeClose(innerScope, exit), whenEffect(modify(observers, (n) => [n === 1, n - 1])), asVoid)), zipRight$2(update$1(observers, (n) => n + 1)), zipRight$2(scopeAddFinalizerExit(scope, (exit) => pipe$1(sync$3(() => map.delete(layer)), zipRight$2(get(finalizerRef)), flatMap$4((finalizer) => finalizer(exit))))), zipRight$2(deferredSucceed(deferred, exit.effect_instruction_i0)), as$1(exit.effect_instruction_i0[1]));
|
|
17052
|
+
case OP_SUCCESS: return pipe$1(set(finalizerRef, (exit) => pipe$1(scopeClose(innerScope, exit), whenEffect(modify$1(observers, (n) => [n === 1, n - 1])), asVoid)), zipRight$2(update$1(observers, (n) => n + 1)), zipRight$2(scopeAddFinalizerExit(scope, (exit) => pipe$1(sync$3(() => map.delete(layer)), zipRight$2(get(finalizerRef)), flatMap$4((finalizer) => finalizer(exit))))), zipRight$2(deferredSucceed(deferred, exit.effect_instruction_i0)), as$1(exit.effect_instruction_i0[1]));
|
|
17053
17053
|
}
|
|
17054
17054
|
})))));
|
|
17055
17055
|
const memoized = [pipe$1(deferredAwait(deferred), onExit$1(exitMatchEffect({
|
|
@@ -24093,7 +24093,7 @@ const nonNegative = (annotations) => greaterThanOrEqualTo(0, {
|
|
|
24093
24093
|
function parseNumber(self) {
|
|
24094
24094
|
return transformOrFail(self, Number$, {
|
|
24095
24095
|
strict: false,
|
|
24096
|
-
decode: (i, _, ast) => fromOption(parse$
|
|
24096
|
+
decode: (i, _, ast) => fromOption(parse$4(i), () => new Type(ast, i, `Unable to decode ${JSON.stringify(i)} into a number`)),
|
|
24097
24097
|
encode: (a) => succeed(String(a))
|
|
24098
24098
|
});
|
|
24099
24099
|
}
|
|
@@ -25319,7 +25319,7 @@ const ChangesetConfigLive = effect$1(ChangesetConfig, gen(function* () {
|
|
|
25319
25319
|
};
|
|
25320
25320
|
}));
|
|
25321
25321
|
//#endregion
|
|
25322
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25322
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/CatalogAssemblyError.js
|
|
25323
25323
|
/**
|
|
25324
25324
|
* Base constant for {@link CatalogAssemblyError}.
|
|
25325
25325
|
*
|
|
@@ -25346,7 +25346,7 @@ var CatalogAssemblyError = class extends CatalogAssemblyErrorBase {
|
|
|
25346
25346
|
}
|
|
25347
25347
|
};
|
|
25348
25348
|
//#endregion
|
|
25349
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25349
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/CatalogResolutionError.js
|
|
25350
25350
|
/**
|
|
25351
25351
|
* Base constant for {@link CatalogResolutionError}.
|
|
25352
25352
|
*
|
|
@@ -25372,7 +25372,7 @@ var CatalogResolutionError = class extends CatalogResolutionErrorBase {
|
|
|
25372
25372
|
}
|
|
25373
25373
|
};
|
|
25374
25374
|
//#endregion
|
|
25375
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25375
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/GitReadError.js
|
|
25376
25376
|
/**
|
|
25377
25377
|
* Base constant for {@link GitReadError}.
|
|
25378
25378
|
*
|
|
@@ -25397,7 +25397,7 @@ var GitReadError = class extends GitReadErrorBase {
|
|
|
25397
25397
|
}
|
|
25398
25398
|
};
|
|
25399
25399
|
//#endregion
|
|
25400
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25400
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/PackageNotFoundError.js
|
|
25401
25401
|
/**
|
|
25402
25402
|
* Base constant for {@link PackageNotFoundError}.
|
|
25403
25403
|
*
|
|
@@ -25448,7 +25448,7 @@ var PackageNotFoundError = class extends PackageNotFoundErrorBase {
|
|
|
25448
25448
|
}
|
|
25449
25449
|
};
|
|
25450
25450
|
//#endregion
|
|
25451
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25451
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/WorkspaceDiscoveryError.js
|
|
25452
25452
|
/**
|
|
25453
25453
|
* Base constant for {@link WorkspaceDiscoveryError}.
|
|
25454
25454
|
*
|
|
@@ -25499,7 +25499,7 @@ var WorkspaceDiscoveryError = class extends WorkspaceDiscoveryErrorBase {
|
|
|
25499
25499
|
}
|
|
25500
25500
|
};
|
|
25501
25501
|
//#endregion
|
|
25502
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25502
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/errors/WorkspaceRootNotFoundError.js
|
|
25503
25503
|
/**
|
|
25504
25504
|
* Base constant for {@link WorkspaceRootNotFoundError}.
|
|
25505
25505
|
*
|
|
@@ -25549,7 +25549,7 @@ var WorkspaceRootNotFoundError = class extends WorkspaceRootNotFoundErrorBase {
|
|
|
25549
25549
|
}
|
|
25550
25550
|
};
|
|
25551
25551
|
//#endregion
|
|
25552
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25552
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/WorkspaceDiscovery.js
|
|
25553
25553
|
/**
|
|
25554
25554
|
* Service for discovering workspace packages in a monorepo.
|
|
25555
25555
|
*
|
|
@@ -25599,7 +25599,7 @@ var WorkspaceRootNotFoundError = class extends WorkspaceRootNotFoundErrorBase {
|
|
|
25599
25599
|
*/
|
|
25600
25600
|
var WorkspaceDiscovery = class extends Tag("@spencerbeggs/workspaces-effect/WorkspaceDiscovery")() {};
|
|
25601
25601
|
//#endregion
|
|
25602
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
25602
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/WorkspaceRoot.js
|
|
25603
25603
|
/**
|
|
25604
25604
|
* Service for finding the workspace root directory.
|
|
25605
25605
|
*
|
|
@@ -25646,7 +25646,7 @@ var WorkspaceDiscovery = class extends Tag("@spencerbeggs/workspaces-effect/Work
|
|
|
25646
25646
|
*/
|
|
25647
25647
|
var WorkspaceRoot = class extends Tag("@spencerbeggs/workspaces-effect/WorkspaceRoot")() {};
|
|
25648
25648
|
//#endregion
|
|
25649
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
25649
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/errors/YamlComposerError.js
|
|
25650
25650
|
/**
|
|
25651
25651
|
* YAML composer error type.
|
|
25652
25652
|
*
|
|
@@ -25732,7 +25732,7 @@ var YamlErrorDetail = class extends Class("YamlErrorDetail")({
|
|
|
25732
25732
|
column: Int.pipe(nonNegative())
|
|
25733
25733
|
}) {};
|
|
25734
25734
|
//#endregion
|
|
25735
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
25735
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/schemas/CstNode.js
|
|
25736
25736
|
/**
|
|
25737
25737
|
* YAML CST node schema and node type literal union.
|
|
25738
25738
|
*
|
|
@@ -25768,7 +25768,7 @@ var CstNode = class CstNode extends Class("CstNode")({
|
|
|
25768
25768
|
children: optional$1(Array$(suspend(() => CstNode)))
|
|
25769
25769
|
}) {};
|
|
25770
25770
|
//#endregion
|
|
25771
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
25771
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/schemas/YamlShared.js
|
|
25772
25772
|
/**
|
|
25773
25773
|
* Shared YAML structural types used across the parse/stringify/format pipeline.
|
|
25774
25774
|
*
|
|
@@ -25796,7 +25796,7 @@ Class("YamlEdit")({
|
|
|
25796
25796
|
content: String$
|
|
25797
25797
|
});
|
|
25798
25798
|
//#endregion
|
|
25799
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
25799
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/schemas/YamlAstNodes.js
|
|
25800
25800
|
/**
|
|
25801
25801
|
* Internal module defining all mutually-referential YAML AST node schemas in
|
|
25802
25802
|
* one place to avoid circular import cycles between individual schema files.
|
|
@@ -26007,7 +26007,7 @@ var YamlSeq = class extends TaggedClass()("YamlSeq", {
|
|
|
26007
26007
|
length: Int.pipe(nonNegative())
|
|
26008
26008
|
}) {};
|
|
26009
26009
|
//#endregion
|
|
26010
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
26010
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/schemas/YamlDocument.js
|
|
26011
26011
|
/**
|
|
26012
26012
|
* YAML document and directive schemas.
|
|
26013
26013
|
*
|
|
@@ -26085,7 +26085,7 @@ var YamlDocument = class extends Class("YamlDocument")({
|
|
|
26085
26085
|
hasDocumentStartTab: optionalWith(Boolean$, { default: () => false })
|
|
26086
26086
|
}) {};
|
|
26087
26087
|
//#endregion
|
|
26088
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
26088
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/schemas/YamlToken.js
|
|
26089
26089
|
/**
|
|
26090
26090
|
* YAML token schema and token kind literal union.
|
|
26091
26091
|
*
|
|
@@ -26120,7 +26120,7 @@ var YamlToken = class extends Class("YamlToken")({
|
|
|
26120
26120
|
column: Int.pipe(nonNegative())
|
|
26121
26121
|
}) {};
|
|
26122
26122
|
//#endregion
|
|
26123
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
26123
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/utils/lexer.js
|
|
26124
26124
|
/**
|
|
26125
26125
|
* YAML 1.2 lexer — tokenizes raw YAML text into a stream of {@link YamlToken} values.
|
|
26126
26126
|
*
|
|
@@ -26150,7 +26150,7 @@ var YamlToken = class extends Class("YamlToken")({
|
|
|
26150
26150
|
*
|
|
26151
26151
|
* @public
|
|
26152
26152
|
*/
|
|
26153
|
-
function createScanner$
|
|
26153
|
+
function createScanner$2(text) {
|
|
26154
26154
|
let pos = 0;
|
|
26155
26155
|
let line = 0;
|
|
26156
26156
|
let col = 0;
|
|
@@ -27101,7 +27101,7 @@ function createScanner$1(text) {
|
|
|
27101
27101
|
* @public
|
|
27102
27102
|
*/
|
|
27103
27103
|
function lex(text) {
|
|
27104
|
-
return unfold(createScanner$
|
|
27104
|
+
return unfold(createScanner$2(text), (scanner) => {
|
|
27105
27105
|
const kind = scanner.scan();
|
|
27106
27106
|
if (kind === null) return none$4();
|
|
27107
27107
|
const token = new YamlToken({
|
|
@@ -27125,7 +27125,7 @@ function lexAll(text) {
|
|
|
27125
27125
|
return runCollect(lex(text)).pipe(map$5((chunk) => [...chunk]));
|
|
27126
27126
|
}
|
|
27127
27127
|
//#endregion
|
|
27128
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
27128
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/utils/parser.js
|
|
27129
27129
|
/**
|
|
27130
27130
|
* YAML 1.2 CST parser — transforms a token stream into a Concrete Syntax Tree.
|
|
27131
27131
|
*
|
|
@@ -27770,7 +27770,7 @@ function parseCSTAll(text) {
|
|
|
27770
27770
|
return lexAll(text).pipe(map$5((tokens) => parseDocuments(tokens, text)));
|
|
27771
27771
|
}
|
|
27772
27772
|
//#endregion
|
|
27773
|
-
//#region ../../node_modules/.pnpm/yaml-effect@0.7.
|
|
27773
|
+
//#region ../../node_modules/.pnpm/yaml-effect@0.7.2_effect@3.21.4/node_modules/yaml-effect/utils/composer.js
|
|
27774
27774
|
/**
|
|
27775
27775
|
* YAML 1.2 Composer — transforms CST nodes into AST nodes with typed values.
|
|
27776
27776
|
*
|
|
@@ -27779,16 +27779,29 @@ function parseCSTAll(text) {
|
|
|
27779
27779
|
*
|
|
27780
27780
|
* @packageDocumentation
|
|
27781
27781
|
*/
|
|
27782
|
+
let lineStartsText;
|
|
27783
|
+
let lineStartsCache = [];
|
|
27784
|
+
function getLineStarts(text) {
|
|
27785
|
+
if (lineStartsText === text) return lineStartsCache;
|
|
27786
|
+
const starts = [0];
|
|
27787
|
+
for (let i = 0; i < text.length; i++) if (text[i] === "\n") starts.push(i + 1);
|
|
27788
|
+
lineStartsText = text;
|
|
27789
|
+
lineStartsCache = starts;
|
|
27790
|
+
return starts;
|
|
27791
|
+
}
|
|
27782
27792
|
function lineCol(text, offset) {
|
|
27783
|
-
|
|
27784
|
-
|
|
27785
|
-
|
|
27786
|
-
|
|
27787
|
-
|
|
27788
|
-
|
|
27793
|
+
const starts = getLineStarts(text);
|
|
27794
|
+
const pos = Math.min(Math.max(offset, 0), text.length);
|
|
27795
|
+
let lo = 0;
|
|
27796
|
+
let hi = starts.length - 1;
|
|
27797
|
+
while (lo < hi) {
|
|
27798
|
+
const mid = lo + hi + 1 >> 1;
|
|
27799
|
+
if (starts[mid] <= pos) lo = mid;
|
|
27800
|
+
else hi = mid - 1;
|
|
27801
|
+
}
|
|
27789
27802
|
return {
|
|
27790
|
-
line,
|
|
27791
|
-
column
|
|
27803
|
+
line: lo,
|
|
27804
|
+
column: pos - starts[lo]
|
|
27792
27805
|
};
|
|
27793
27806
|
}
|
|
27794
27807
|
const NULL_RE = /^(?:null|Null|NULL|~)$/;
|
|
@@ -31232,7 +31245,7 @@ function parseDocument(text, options) {
|
|
|
31232
31245
|
*
|
|
31233
31246
|
* @public
|
|
31234
31247
|
*/
|
|
31235
|
-
function parse$
|
|
31248
|
+
function parse$3(text, options) {
|
|
31236
31249
|
const uniqueKeys = options?.uniqueKeys ?? true;
|
|
31237
31250
|
return parseDocument(text, options).pipe(flatMap$2((doc) => {
|
|
31238
31251
|
if (uniqueKeys) {
|
|
@@ -31247,14 +31260,14 @@ function parse$2(text, options) {
|
|
|
31247
31260
|
}));
|
|
31248
31261
|
}
|
|
31249
31262
|
//#endregion
|
|
31250
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
31263
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/workspace-manifest.js
|
|
31251
31264
|
/**
|
|
31252
31265
|
* Parse a pnpm-workspace.yaml text into its catalog/config-dependency/packages
|
|
31253
31266
|
* slice. Pure with respect to the filesystem.
|
|
31254
31267
|
*
|
|
31255
31268
|
* @public
|
|
31256
31269
|
*/
|
|
31257
|
-
const workspaceManifestFromYaml = (content) => parse$
|
|
31270
|
+
const workspaceManifestFromYaml = (content) => parse$3(content).pipe(mapError$1((e) => new CatalogAssemblyError({
|
|
31258
31271
|
source: "manifest",
|
|
31259
31272
|
reason: `invalid yaml: ${String(e)}`
|
|
31260
31273
|
})), map$5((parsed) => {
|
|
@@ -31315,7 +31328,7 @@ function checkDefaultCatalogIsDefinedOnce(manifest) {
|
|
|
31315
31328
|
if (manifest.catalog != null && manifest.catalogs?.default != null) throw new PnpmError("INVALID_CATALOGS_CONFIGURATION", "The 'default' catalog was defined multiple times. Use the 'catalog' field or 'catalogs.default', but not both.");
|
|
31316
31329
|
}
|
|
31317
31330
|
//#endregion
|
|
31318
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
31331
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/assemble.js
|
|
31319
31332
|
/** Merge catalog sources; later sources win per dependency within a catalog. */
|
|
31320
31333
|
function mergeCatalogs(...sources) {
|
|
31321
31334
|
const result = {};
|
|
@@ -31396,7 +31409,7 @@ function resolveFromCatalog(catalogs, wantedDependency) {
|
|
|
31396
31409
|
};
|
|
31397
31410
|
}
|
|
31398
31411
|
//#endregion
|
|
31399
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
31412
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/catalog/resolve.js
|
|
31400
31413
|
const DEP_FIELDS = [
|
|
31401
31414
|
"dependencies",
|
|
31402
31415
|
"devDependencies",
|
|
@@ -31466,7 +31479,7 @@ function resolveManifest(catalogs, workspaceVersions, manifest) {
|
|
|
31466
31479
|
return out;
|
|
31467
31480
|
}
|
|
31468
31481
|
//#endregion
|
|
31469
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
31482
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/CatalogSet.js
|
|
31470
31483
|
/**
|
|
31471
31484
|
* An immutable, fully-normalized catalog collection with the one
|
|
31472
31485
|
* resolution semantic shared by live and point-in-time resolution.
|
|
@@ -31556,7 +31569,7 @@ var CatalogSet = class CatalogSet extends Class("CatalogSet")({ entries: Record(
|
|
|
31556
31569
|
}
|
|
31557
31570
|
};
|
|
31558
31571
|
//#endregion
|
|
31559
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
31572
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/point-in-time/worktree-catalogs.js
|
|
31560
31573
|
/**
|
|
31561
31574
|
* The ONE code path that reads the working tree's catalog sources
|
|
31562
31575
|
* (`pnpm-workspace.yaml` + `pnpm-lock.yaml`). Consumed by
|
|
@@ -31573,7 +31586,7 @@ var CatalogSet = class CatalogSet extends Class("CatalogSet")({ entries: Record(
|
|
|
31573
31586
|
*
|
|
31574
31587
|
* @internal
|
|
31575
31588
|
*/
|
|
31576
|
-
const lockfileCatalogsFromText = (text) => parse$
|
|
31589
|
+
const lockfileCatalogsFromText = (text) => parse$3(text).pipe(map$5((parsed) => CatalogSet.fromLockfileCatalogs(parsed?.catalogs)), orElseSucceed(() => CatalogSet.empty()));
|
|
31577
31590
|
/**
|
|
31578
31591
|
* Read the working tree's catalog state at `root`.
|
|
31579
31592
|
*
|
|
@@ -33101,7 +33114,7 @@ minimatch.Minimatch = Minimatch;
|
|
|
33101
33114
|
minimatch.escape = escape;
|
|
33102
33115
|
minimatch.unescape = unescape;
|
|
33103
33116
|
//#endregion
|
|
33104
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
33117
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/core.js
|
|
33105
33118
|
/**
|
|
33106
33119
|
* Schema for supported package manager identifiers.
|
|
33107
33120
|
*
|
|
@@ -33363,7 +33376,1286 @@ Class("WorkspaceInfo")({
|
|
|
33363
33376
|
patterns: Array$(String$)
|
|
33364
33377
|
});
|
|
33365
33378
|
//#endregion
|
|
33366
|
-
//#region ../../node_modules/.pnpm/
|
|
33379
|
+
//#region ../../node_modules/.pnpm/jsonc-effect@0.3.1_effect@3.21.4/node_modules/jsonc-effect/errors.js
|
|
33380
|
+
/**
|
|
33381
|
+
* JSONC error types using Effect's Data.TaggedError pattern.
|
|
33382
|
+
*
|
|
33383
|
+
* @packageDocumentation
|
|
33384
|
+
*/
|
|
33385
|
+
/**
|
|
33386
|
+
* Error codes representing specific JSONC parse failures.
|
|
33387
|
+
*
|
|
33388
|
+
* @remarks
|
|
33389
|
+
* Each code maps to a distinct syntactic error the parser can encounter,
|
|
33390
|
+
* from invalid symbols and number formats to missing delimiters and
|
|
33391
|
+
* unexpected end-of-input conditions.
|
|
33392
|
+
*
|
|
33393
|
+
* @see {@link JsoncParseErrorDetail} — carries one of these codes alongside
|
|
33394
|
+
* position information
|
|
33395
|
+
*
|
|
33396
|
+
* @public
|
|
33397
|
+
*/
|
|
33398
|
+
const JsoncParseErrorCode = Literal("InvalidSymbol", "InvalidNumberFormat", "PropertyNameExpected", "ValueExpected", "ColonExpected", "CommaExpected", "CloseBraceExpected", "CloseBracketExpected", "EndOfFileExpected", "InvalidCommentToken", "UnexpectedEndOfComment", "UnexpectedEndOfString", "UnexpectedEndOfNumber", "InvalidUnicode", "InvalidEscapeCharacter", "InvalidCharacter");
|
|
33399
|
+
/**
|
|
33400
|
+
* Detail for a single parse error, including the error code, a human-readable
|
|
33401
|
+
* message, and the exact position within the source document.
|
|
33402
|
+
*
|
|
33403
|
+
* @remarks
|
|
33404
|
+
* - `code` — a {@link (JsoncParseErrorCode:type)} identifying the error kind.
|
|
33405
|
+
* - `message` — a descriptive message suitable for display.
|
|
33406
|
+
* - `offset` — zero-based character offset where the error occurred.
|
|
33407
|
+
* - `length` — character length of the problematic span.
|
|
33408
|
+
* - `startLine` — zero-based line number of the error.
|
|
33409
|
+
* - `startCharacter` — zero-based column within `startLine`.
|
|
33410
|
+
*
|
|
33411
|
+
* @see {@link JsoncParseError} — aggregates an array of these details
|
|
33412
|
+
*
|
|
33413
|
+
* @example
|
|
33414
|
+
* ```ts
|
|
33415
|
+
* import { JsoncParseErrorDetail } from "jsonc-effect";
|
|
33416
|
+
*
|
|
33417
|
+
* const detail = new JsoncParseErrorDetail({
|
|
33418
|
+
* code: "ValueExpected",
|
|
33419
|
+
* message: "Value expected",
|
|
33420
|
+
* offset: 5,
|
|
33421
|
+
* length: 1,
|
|
33422
|
+
* startLine: 0,
|
|
33423
|
+
* startCharacter: 5,
|
|
33424
|
+
* });
|
|
33425
|
+
*
|
|
33426
|
+
* console.log(detail.code); // "ValueExpected"
|
|
33427
|
+
* console.log(detail.offset); // 5
|
|
33428
|
+
* ```
|
|
33429
|
+
*
|
|
33430
|
+
* @public
|
|
33431
|
+
*/
|
|
33432
|
+
var JsoncParseErrorDetail = class extends Class("JsoncParseErrorDetail")({
|
|
33433
|
+
code: JsoncParseErrorCode,
|
|
33434
|
+
message: String$,
|
|
33435
|
+
offset: Number$,
|
|
33436
|
+
length: Number$,
|
|
33437
|
+
startLine: Number$,
|
|
33438
|
+
startCharacter: Number$
|
|
33439
|
+
}) {};
|
|
33440
|
+
/**
|
|
33441
|
+
* Base class for {@link JsoncParseError}; not intended to be constructed or
|
|
33442
|
+
* caught directly — use `JsoncParseError` instead.
|
|
33443
|
+
*
|
|
33444
|
+
* @privateRemarks
|
|
33445
|
+
* The `*Base` pattern is required because `Data.TaggedError` produces complex
|
|
33446
|
+
* type signatures involving intersection types and branded generics that
|
|
33447
|
+
* api-extractor cannot roll up into a single `.d.ts` bundle. Exporting the
|
|
33448
|
+
* base separately lets the public `JsoncParseError` class extend it with
|
|
33449
|
+
* concrete fields, giving api-extractor a simple class declaration to work
|
|
33450
|
+
* with. It is tagged `@public` (rather than `@internal`) because it appears
|
|
33451
|
+
* in `JsoncParseError`'s heritage clause in the public `.d.ts`, and API
|
|
33452
|
+
* Extractor requires release tags to be compatible across a signature.
|
|
33453
|
+
*
|
|
33454
|
+
* @public
|
|
33455
|
+
*/
|
|
33456
|
+
const JsoncParseErrorBase = TaggedError("JsoncParseError");
|
|
33457
|
+
/**
|
|
33458
|
+
* Error raised when JSONC parsing encounters one or more syntax errors.
|
|
33459
|
+
*
|
|
33460
|
+
* @remarks
|
|
33461
|
+
* Contains the full source `text`, the `options` used for parsing, and an
|
|
33462
|
+
* `errors` array of {@link JsoncParseErrorDetail} instances with precise
|
|
33463
|
+
* position information for each problem found.
|
|
33464
|
+
*
|
|
33465
|
+
* @see {@link parse} — may fail with this error
|
|
33466
|
+
* @see {@link parseTree} — may fail with this error
|
|
33467
|
+
*
|
|
33468
|
+
* @example Catching with `Effect.catchTag`
|
|
33469
|
+
* ```ts
|
|
33470
|
+
* import { Effect } from "effect";
|
|
33471
|
+
* import { parse } from "jsonc-effect";
|
|
33472
|
+
*
|
|
33473
|
+
* const program = parse("{ invalid }").pipe(
|
|
33474
|
+
* Effect.catchTag("JsoncParseError", (e) => {
|
|
33475
|
+
* console.error(e.errors); // Array of JsoncParseErrorDetail
|
|
33476
|
+
* return Effect.succeed({});
|
|
33477
|
+
* }),
|
|
33478
|
+
* );
|
|
33479
|
+
* ```
|
|
33480
|
+
*
|
|
33481
|
+
* @example Inspecting error details
|
|
33482
|
+
* ```ts
|
|
33483
|
+
* import { Effect } from "effect";
|
|
33484
|
+
* import { parse } from "jsonc-effect";
|
|
33485
|
+
*
|
|
33486
|
+
* const program = parse("{ invalid }").pipe(
|
|
33487
|
+
* Effect.catchTag("JsoncParseError", (e) => {
|
|
33488
|
+
* for (const detail of e.errors) {
|
|
33489
|
+
* console.error(
|
|
33490
|
+
* `[${detail.code}] ${detail.message} at line ${detail.startLine}:${detail.startCharacter}`,
|
|
33491
|
+
* );
|
|
33492
|
+
* }
|
|
33493
|
+
* return Effect.succeed({});
|
|
33494
|
+
* }),
|
|
33495
|
+
* );
|
|
33496
|
+
* ```
|
|
33497
|
+
*
|
|
33498
|
+
* @public
|
|
33499
|
+
*/
|
|
33500
|
+
var JsoncParseError = class extends JsoncParseErrorBase {
|
|
33501
|
+
get message() {
|
|
33502
|
+
const count = this.errors.length;
|
|
33503
|
+
return `JSONC parse failed with ${count} error${count !== 1 ? "s" : ""}: ${this.errors.map((e) => e.message).join("; ")}`;
|
|
33504
|
+
}
|
|
33505
|
+
};
|
|
33506
|
+
TaggedError("JsoncNodeNotFoundError");
|
|
33507
|
+
/**
|
|
33508
|
+
* Base class for {@link JsoncModificationError}; not intended to be
|
|
33509
|
+
* constructed or caught directly — use `JsoncModificationError` instead.
|
|
33510
|
+
*
|
|
33511
|
+
* @privateRemarks
|
|
33512
|
+
* Uses the same `*Base` pattern as {@link JsoncParseErrorBase} to work
|
|
33513
|
+
* around api-extractor's inability to roll up the complex type produced
|
|
33514
|
+
* by `Data.TaggedError` into a single `.d.ts` declaration. Tagged `@public`
|
|
33515
|
+
* for the same heritage-clause-compatibility reason as `JsoncParseErrorBase`.
|
|
33516
|
+
*
|
|
33517
|
+
* @public
|
|
33518
|
+
*/
|
|
33519
|
+
const JsoncModificationErrorBase = TaggedError("JsoncModificationError");
|
|
33520
|
+
/**
|
|
33521
|
+
* Error raised when {@link modify} produces invalid edits or encounters
|
|
33522
|
+
* an unsupported modification scenario.
|
|
33523
|
+
*
|
|
33524
|
+
* @remarks
|
|
33525
|
+
* Contains the `path` where modification was attempted and a `reason`
|
|
33526
|
+
* string explaining why it failed.
|
|
33527
|
+
*
|
|
33528
|
+
* @see {@link modify} — may fail with this error
|
|
33529
|
+
*
|
|
33530
|
+
* @example
|
|
33531
|
+
* ```ts
|
|
33532
|
+
* import { Effect } from "effect";
|
|
33533
|
+
* import { modify } from "jsonc-effect";
|
|
33534
|
+
*
|
|
33535
|
+
* const program = modify("{}", ["deep", "path"], 42).pipe(
|
|
33536
|
+
* Effect.catchTag("JsoncModificationError", (e) => {
|
|
33537
|
+
* console.error(`Failed at [${e.path.join(", ")}]: ${e.reason}`);
|
|
33538
|
+
* return Effect.succeed([]);
|
|
33539
|
+
* }),
|
|
33540
|
+
* );
|
|
33541
|
+
* ```
|
|
33542
|
+
*
|
|
33543
|
+
* @public
|
|
33544
|
+
*/
|
|
33545
|
+
var JsoncModificationError = class extends JsoncModificationErrorBase {
|
|
33546
|
+
get message() {
|
|
33547
|
+
return `Modification failed at path [${this.path.join(", ")}]: ${this.reason}`;
|
|
33548
|
+
}
|
|
33549
|
+
};
|
|
33550
|
+
//#endregion
|
|
33551
|
+
//#region ../../node_modules/.pnpm/jsonc-effect@0.3.1_effect@3.21.4/node_modules/jsonc-effect/scanner.js
|
|
33552
|
+
const isWhitespace = (ch) => ch === 32 || ch === 9 || ch === 11 || ch === 12 || ch === 160 || ch === 65279;
|
|
33553
|
+
const isLineBreak$1 = (ch) => ch === 10 || ch === 13 || ch === 8232 || ch === 8233;
|
|
33554
|
+
const isDigit$1 = (ch) => ch >= 48 && ch <= 57;
|
|
33555
|
+
/**
|
|
33556
|
+
* Create a stateful {@link JsoncScanner} for the given JSONC string.
|
|
33557
|
+
*
|
|
33558
|
+
* @param text - JSONC string to tokenize
|
|
33559
|
+
* @param ignoreTrivia - If `true`, the scanner automatically skips whitespace,
|
|
33560
|
+
* line-break, and comment tokens so that only structural tokens are returned
|
|
33561
|
+
* (default: `false`).
|
|
33562
|
+
* @returns A stateful {@link JsoncScanner} positioned before the first token.
|
|
33563
|
+
*
|
|
33564
|
+
* @remarks
|
|
33565
|
+
* When `ignoreTrivia` is `true` the scanner is suitable for building parsers
|
|
33566
|
+
* that only care about structural tokens (`OpenBrace`, `String`, `Number`,
|
|
33567
|
+
* etc.). Set it to `false` (the default) when you need to preserve comments
|
|
33568
|
+
* or whitespace — for example in a formatter or a comment-stripping pass.
|
|
33569
|
+
*
|
|
33570
|
+
* @see {@link JsoncScanner} — the interface returned by this factory
|
|
33571
|
+
* @see {@link parse} — higher-level API that uses a scanner internally
|
|
33572
|
+
*
|
|
33573
|
+
* @example
|
|
33574
|
+
* Tokenizing a JSONC string and printing each token:
|
|
33575
|
+
* ```ts
|
|
33576
|
+
* import type { JsoncSyntaxKind } from "jsonc-effect";
|
|
33577
|
+
* import { createScanner } from "jsonc-effect";
|
|
33578
|
+
*
|
|
33579
|
+
* const scanner = createScanner('{ "name": "jsonc" }', true);
|
|
33580
|
+
* let kind: JsoncSyntaxKind;
|
|
33581
|
+
* do {
|
|
33582
|
+
* kind = scanner.scan();
|
|
33583
|
+
* console.log(kind, scanner.getTokenValue());
|
|
33584
|
+
* } while (kind !== "EOF");
|
|
33585
|
+
* ```
|
|
33586
|
+
*
|
|
33587
|
+
* @privateRemarks
|
|
33588
|
+
* Ported from Microsoft's jsonc-parser (MIT), adapted to use string literal
|
|
33589
|
+
* token types instead of numeric enums.
|
|
33590
|
+
*
|
|
33591
|
+
* @public
|
|
33592
|
+
*/
|
|
33593
|
+
const createScanner$1 = (text, ignoreTrivia = false) => {
|
|
33594
|
+
const len = text.length;
|
|
33595
|
+
let pos = 0;
|
|
33596
|
+
let tokenOffset = 0;
|
|
33597
|
+
let token = "Unknown";
|
|
33598
|
+
let tokenValue = "";
|
|
33599
|
+
let tokenError = "None";
|
|
33600
|
+
let lineNumber = 0;
|
|
33601
|
+
let lineStartOffset = 0;
|
|
33602
|
+
let tokenStartLine = 0;
|
|
33603
|
+
let tokenStartCharacter = 0;
|
|
33604
|
+
const scanHexDigits = (count) => {
|
|
33605
|
+
let value = 0;
|
|
33606
|
+
for (let i = 0; i < count; i++) {
|
|
33607
|
+
if (pos >= len) return -1;
|
|
33608
|
+
const ch = text.charCodeAt(pos);
|
|
33609
|
+
if (ch >= 48 && ch <= 57) value = value * 16 + (ch - 48);
|
|
33610
|
+
else if (ch >= 65 && ch <= 70) value = value * 16 + (ch - 65 + 10);
|
|
33611
|
+
else if (ch >= 97 && ch <= 102) value = value * 16 + (ch - 97 + 10);
|
|
33612
|
+
else return -1;
|
|
33613
|
+
pos++;
|
|
33614
|
+
}
|
|
33615
|
+
return value;
|
|
33616
|
+
};
|
|
33617
|
+
const scanString = () => {
|
|
33618
|
+
let result = "";
|
|
33619
|
+
pos++;
|
|
33620
|
+
let start = pos;
|
|
33621
|
+
while (pos < len) {
|
|
33622
|
+
const ch = text.charCodeAt(pos);
|
|
33623
|
+
if (ch === 34) {
|
|
33624
|
+
result += text.substring(start, pos);
|
|
33625
|
+
pos++;
|
|
33626
|
+
return result;
|
|
33627
|
+
}
|
|
33628
|
+
if (ch === 92) {
|
|
33629
|
+
result += text.substring(start, pos);
|
|
33630
|
+
pos++;
|
|
33631
|
+
if (pos >= len) {
|
|
33632
|
+
tokenError = "UnexpectedEndOfString";
|
|
33633
|
+
return result;
|
|
33634
|
+
}
|
|
33635
|
+
const escaped = text.charCodeAt(pos);
|
|
33636
|
+
pos++;
|
|
33637
|
+
switch (escaped) {
|
|
33638
|
+
case 34:
|
|
33639
|
+
result += "\"";
|
|
33640
|
+
break;
|
|
33641
|
+
case 92:
|
|
33642
|
+
result += "\\";
|
|
33643
|
+
break;
|
|
33644
|
+
case 47:
|
|
33645
|
+
result += "/";
|
|
33646
|
+
break;
|
|
33647
|
+
case 98:
|
|
33648
|
+
result += "\b";
|
|
33649
|
+
break;
|
|
33650
|
+
case 102:
|
|
33651
|
+
result += "\f";
|
|
33652
|
+
break;
|
|
33653
|
+
case 110:
|
|
33654
|
+
result += "\n";
|
|
33655
|
+
break;
|
|
33656
|
+
case 114:
|
|
33657
|
+
result += "\r";
|
|
33658
|
+
break;
|
|
33659
|
+
case 116:
|
|
33660
|
+
result += " ";
|
|
33661
|
+
break;
|
|
33662
|
+
case 117: {
|
|
33663
|
+
const value = scanHexDigits(4);
|
|
33664
|
+
if (value >= 0) result += String.fromCharCode(value);
|
|
33665
|
+
else tokenError = "InvalidUnicode";
|
|
33666
|
+
break;
|
|
33667
|
+
}
|
|
33668
|
+
default:
|
|
33669
|
+
tokenError = "InvalidEscapeCharacter";
|
|
33670
|
+
break;
|
|
33671
|
+
}
|
|
33672
|
+
start = pos;
|
|
33673
|
+
} else if (isLineBreak$1(ch)) {
|
|
33674
|
+
tokenError = "UnexpectedEndOfString";
|
|
33675
|
+
return result + text.substring(start, pos);
|
|
33676
|
+
} else pos++;
|
|
33677
|
+
}
|
|
33678
|
+
tokenError = "UnexpectedEndOfString";
|
|
33679
|
+
return result + text.substring(start, pos);
|
|
33680
|
+
};
|
|
33681
|
+
const scanNumber = () => {
|
|
33682
|
+
const start = pos;
|
|
33683
|
+
if (text.charCodeAt(pos) === 45) pos++;
|
|
33684
|
+
if (text.charCodeAt(pos) === 48) pos++;
|
|
33685
|
+
else {
|
|
33686
|
+
if (!isDigit$1(text.charCodeAt(pos))) {
|
|
33687
|
+
tokenError = "UnexpectedEndOfNumber";
|
|
33688
|
+
return text.substring(start, pos);
|
|
33689
|
+
}
|
|
33690
|
+
pos++;
|
|
33691
|
+
while (pos < len && isDigit$1(text.charCodeAt(pos))) pos++;
|
|
33692
|
+
}
|
|
33693
|
+
if (pos < len && text.charCodeAt(pos) === 46) {
|
|
33694
|
+
pos++;
|
|
33695
|
+
if (!isDigit$1(text.charCodeAt(pos))) {
|
|
33696
|
+
tokenError = "UnexpectedEndOfNumber";
|
|
33697
|
+
return text.substring(start, pos);
|
|
33698
|
+
}
|
|
33699
|
+
pos++;
|
|
33700
|
+
while (pos < len && isDigit$1(text.charCodeAt(pos))) pos++;
|
|
33701
|
+
}
|
|
33702
|
+
if (pos < len && (text.charCodeAt(pos) === 69 || text.charCodeAt(pos) === 101)) {
|
|
33703
|
+
pos++;
|
|
33704
|
+
if (pos < len && (text.charCodeAt(pos) === 43 || text.charCodeAt(pos) === 45)) pos++;
|
|
33705
|
+
if (!isDigit$1(text.charCodeAt(pos))) {
|
|
33706
|
+
tokenError = "UnexpectedEndOfNumber";
|
|
33707
|
+
return text.substring(start, pos);
|
|
33708
|
+
}
|
|
33709
|
+
pos++;
|
|
33710
|
+
while (pos < len && isDigit$1(text.charCodeAt(pos))) pos++;
|
|
33711
|
+
}
|
|
33712
|
+
return text.substring(start, pos);
|
|
33713
|
+
};
|
|
33714
|
+
const scan = () => {
|
|
33715
|
+
tokenValue = "";
|
|
33716
|
+
tokenError = "None";
|
|
33717
|
+
if (pos >= len) {
|
|
33718
|
+
tokenOffset = len;
|
|
33719
|
+
tokenStartLine = lineNumber;
|
|
33720
|
+
tokenStartCharacter = pos - lineStartOffset;
|
|
33721
|
+
token = "EOF";
|
|
33722
|
+
return token;
|
|
33723
|
+
}
|
|
33724
|
+
let ch = text.charCodeAt(pos);
|
|
33725
|
+
if (isWhitespace(ch)) {
|
|
33726
|
+
tokenOffset = pos;
|
|
33727
|
+
tokenStartLine = lineNumber;
|
|
33728
|
+
tokenStartCharacter = pos - lineStartOffset;
|
|
33729
|
+
do {
|
|
33730
|
+
pos++;
|
|
33731
|
+
ch = pos < len ? text.charCodeAt(pos) : 0;
|
|
33732
|
+
} while (isWhitespace(ch));
|
|
33733
|
+
tokenValue = text.substring(tokenOffset, pos);
|
|
33734
|
+
if (ignoreTrivia) return scan();
|
|
33735
|
+
token = "Trivia";
|
|
33736
|
+
return token;
|
|
33737
|
+
}
|
|
33738
|
+
if (isLineBreak$1(ch)) {
|
|
33739
|
+
tokenOffset = pos;
|
|
33740
|
+
tokenStartLine = lineNumber;
|
|
33741
|
+
tokenStartCharacter = pos - lineStartOffset;
|
|
33742
|
+
pos++;
|
|
33743
|
+
if (ch === 13 && pos < len && text.charCodeAt(pos) === 10) pos++;
|
|
33744
|
+
lineNumber++;
|
|
33745
|
+
lineStartOffset = pos;
|
|
33746
|
+
tokenValue = text.substring(tokenOffset, pos);
|
|
33747
|
+
if (ignoreTrivia) return scan();
|
|
33748
|
+
token = "LineBreak";
|
|
33749
|
+
return token;
|
|
33750
|
+
}
|
|
33751
|
+
tokenOffset = pos;
|
|
33752
|
+
tokenStartLine = lineNumber;
|
|
33753
|
+
tokenStartCharacter = pos - lineStartOffset;
|
|
33754
|
+
switch (ch) {
|
|
33755
|
+
case 123:
|
|
33756
|
+
pos++;
|
|
33757
|
+
tokenValue = "{";
|
|
33758
|
+
token = "OpenBrace";
|
|
33759
|
+
return token;
|
|
33760
|
+
case 125:
|
|
33761
|
+
pos++;
|
|
33762
|
+
tokenValue = "}";
|
|
33763
|
+
token = "CloseBrace";
|
|
33764
|
+
return token;
|
|
33765
|
+
case 91:
|
|
33766
|
+
pos++;
|
|
33767
|
+
tokenValue = "[";
|
|
33768
|
+
token = "OpenBracket";
|
|
33769
|
+
return token;
|
|
33770
|
+
case 93:
|
|
33771
|
+
pos++;
|
|
33772
|
+
tokenValue = "]";
|
|
33773
|
+
token = "CloseBracket";
|
|
33774
|
+
return token;
|
|
33775
|
+
case 58:
|
|
33776
|
+
pos++;
|
|
33777
|
+
tokenValue = ":";
|
|
33778
|
+
token = "Colon";
|
|
33779
|
+
return token;
|
|
33780
|
+
case 44:
|
|
33781
|
+
pos++;
|
|
33782
|
+
tokenValue = ",";
|
|
33783
|
+
token = "Comma";
|
|
33784
|
+
return token;
|
|
33785
|
+
case 34:
|
|
33786
|
+
tokenValue = scanString();
|
|
33787
|
+
token = "String";
|
|
33788
|
+
return token;
|
|
33789
|
+
case 47: {
|
|
33790
|
+
const nextCh = pos + 1 < len ? text.charCodeAt(pos + 1) : 0;
|
|
33791
|
+
if (nextCh === 47) {
|
|
33792
|
+
pos += 2;
|
|
33793
|
+
while (pos < len && !isLineBreak$1(text.charCodeAt(pos))) pos++;
|
|
33794
|
+
tokenValue = text.substring(tokenOffset, pos);
|
|
33795
|
+
if (ignoreTrivia) return scan();
|
|
33796
|
+
token = "LineComment";
|
|
33797
|
+
return token;
|
|
33798
|
+
}
|
|
33799
|
+
if (nextCh === 42) {
|
|
33800
|
+
pos += 2;
|
|
33801
|
+
const safeLen = len - 1;
|
|
33802
|
+
let commentClosed = false;
|
|
33803
|
+
while (pos < safeLen) {
|
|
33804
|
+
const cch = text.charCodeAt(pos);
|
|
33805
|
+
if (isLineBreak$1(cch)) {
|
|
33806
|
+
if (cch === 13 && pos + 1 < len && text.charCodeAt(pos + 1) === 10) pos++;
|
|
33807
|
+
pos++;
|
|
33808
|
+
lineNumber++;
|
|
33809
|
+
lineStartOffset = pos;
|
|
33810
|
+
} else if (cch === 42 && text.charCodeAt(pos + 1) === 47) {
|
|
33811
|
+
pos += 2;
|
|
33812
|
+
commentClosed = true;
|
|
33813
|
+
break;
|
|
33814
|
+
} else pos++;
|
|
33815
|
+
}
|
|
33816
|
+
if (!commentClosed) {
|
|
33817
|
+
pos = len;
|
|
33818
|
+
tokenError = "UnexpectedEndOfComment";
|
|
33819
|
+
}
|
|
33820
|
+
tokenValue = text.substring(tokenOffset, pos);
|
|
33821
|
+
if (ignoreTrivia) return scan();
|
|
33822
|
+
token = "BlockComment";
|
|
33823
|
+
return token;
|
|
33824
|
+
}
|
|
33825
|
+
pos++;
|
|
33826
|
+
tokenValue = text.substring(tokenOffset, pos);
|
|
33827
|
+
token = "Unknown";
|
|
33828
|
+
tokenError = "InvalidCharacter";
|
|
33829
|
+
return token;
|
|
33830
|
+
}
|
|
33831
|
+
case 45:
|
|
33832
|
+
if (pos + 1 < len && isDigit$1(text.charCodeAt(pos + 1))) {
|
|
33833
|
+
tokenValue = scanNumber();
|
|
33834
|
+
token = "Number";
|
|
33835
|
+
return token;
|
|
33836
|
+
}
|
|
33837
|
+
pos++;
|
|
33838
|
+
tokenValue = "-";
|
|
33839
|
+
token = "Unknown";
|
|
33840
|
+
tokenError = "InvalidSymbol";
|
|
33841
|
+
return token;
|
|
33842
|
+
default:
|
|
33843
|
+
if (isDigit$1(ch)) {
|
|
33844
|
+
tokenValue = scanNumber();
|
|
33845
|
+
token = "Number";
|
|
33846
|
+
return token;
|
|
33847
|
+
}
|
|
33848
|
+
if (ch >= 97 && ch <= 122) {
|
|
33849
|
+
const start = pos;
|
|
33850
|
+
pos++;
|
|
33851
|
+
while (pos < len) {
|
|
33852
|
+
const kch = text.charCodeAt(pos);
|
|
33853
|
+
if (kch >= 97 && kch <= 122) pos++;
|
|
33854
|
+
else break;
|
|
33855
|
+
}
|
|
33856
|
+
tokenValue = text.substring(start, pos);
|
|
33857
|
+
switch (tokenValue) {
|
|
33858
|
+
case "true":
|
|
33859
|
+
token = "True";
|
|
33860
|
+
return token;
|
|
33861
|
+
case "false":
|
|
33862
|
+
token = "False";
|
|
33863
|
+
return token;
|
|
33864
|
+
case "null":
|
|
33865
|
+
token = "Null";
|
|
33866
|
+
return token;
|
|
33867
|
+
default:
|
|
33868
|
+
token = "Unknown";
|
|
33869
|
+
tokenError = "InvalidSymbol";
|
|
33870
|
+
return token;
|
|
33871
|
+
}
|
|
33872
|
+
}
|
|
33873
|
+
pos++;
|
|
33874
|
+
tokenValue = text.substring(tokenOffset, pos);
|
|
33875
|
+
token = "Unknown";
|
|
33876
|
+
tokenError = "InvalidCharacter";
|
|
33877
|
+
return token;
|
|
33878
|
+
}
|
|
33879
|
+
};
|
|
33880
|
+
return {
|
|
33881
|
+
scan,
|
|
33882
|
+
getToken: () => token,
|
|
33883
|
+
getTokenValue: () => tokenValue,
|
|
33884
|
+
getTokenOffset: () => tokenOffset,
|
|
33885
|
+
getTokenLength: () => pos - tokenOffset,
|
|
33886
|
+
getTokenStartLine: () => tokenStartLine,
|
|
33887
|
+
getTokenStartCharacter: () => tokenStartCharacter,
|
|
33888
|
+
getTokenError: () => tokenError,
|
|
33889
|
+
getPosition: () => pos,
|
|
33890
|
+
setPosition: (newPos) => {
|
|
33891
|
+
pos = newPos;
|
|
33892
|
+
tokenValue = "";
|
|
33893
|
+
token = "Unknown";
|
|
33894
|
+
tokenError = "None";
|
|
33895
|
+
}
|
|
33896
|
+
};
|
|
33897
|
+
};
|
|
33898
|
+
//#endregion
|
|
33899
|
+
//#region ../../node_modules/.pnpm/jsonc-effect@0.3.1_effect@3.21.4/node_modules/jsonc-effect/parse.js
|
|
33900
|
+
/**
|
|
33901
|
+
* JSONC Parser — converts token stream into JavaScript values or AST nodes.
|
|
33902
|
+
*
|
|
33903
|
+
* Pure Effect implementation using recursive descent parsing.
|
|
33904
|
+
* Reference: Microsoft's jsonc-parser parser design (MIT).
|
|
33905
|
+
*
|
|
33906
|
+
* @packageDocumentation
|
|
33907
|
+
*/
|
|
33908
|
+
/**
|
|
33909
|
+
* Parse a JSONC string into a JavaScript value.
|
|
33910
|
+
*
|
|
33911
|
+
* @param text - JSONC string to parse
|
|
33912
|
+
* @param options - Optional {@link JsoncParseOptions} controlling comment and
|
|
33913
|
+
* trailing-comma handling.
|
|
33914
|
+
* @returns `Effect<unknown, JsoncParseError>` — succeeds with the parsed value
|
|
33915
|
+
* or fails with a {@link JsoncParseError} containing every error encountered.
|
|
33916
|
+
*
|
|
33917
|
+
* @remarks
|
|
33918
|
+
* The return type is `unknown` (not `any`) so consumers are forced to narrow
|
|
33919
|
+
* the result, which is safer in Effect pipelines. By default
|
|
33920
|
+
* `allowTrailingComma` is `true`, matching common JSONC conventions used in
|
|
33921
|
+
* VS Code settings and `tsconfig.json`.
|
|
33922
|
+
*
|
|
33923
|
+
* @see {@link parseTree} — parse into an AST instead of a plain value
|
|
33924
|
+
* @see {@link JsoncParseOptions} — available parse options
|
|
33925
|
+
* @see {@link JsoncParseError} — the tagged error type on the failure channel
|
|
33926
|
+
*
|
|
33927
|
+
* @example
|
|
33928
|
+
* Basic parsing:
|
|
33929
|
+
* ```ts
|
|
33930
|
+
* import { Effect } from "effect";
|
|
33931
|
+
* import { parse } from "jsonc-effect";
|
|
33932
|
+
*
|
|
33933
|
+
* const value = Effect.runSync(parse('{ "key": 42 }'));
|
|
33934
|
+
* console.log(value); // { key: 42 }
|
|
33935
|
+
* ```
|
|
33936
|
+
*
|
|
33937
|
+
* @example
|
|
33938
|
+
* Parsing with options:
|
|
33939
|
+
* ```ts
|
|
33940
|
+
* import { Effect } from "effect";
|
|
33941
|
+
* import { parse } from "jsonc-effect";
|
|
33942
|
+
*
|
|
33943
|
+
* const value = Effect.runSync(
|
|
33944
|
+
* parse('{ "key": 42 }', { disallowComments: true }),
|
|
33945
|
+
* );
|
|
33946
|
+
* ```
|
|
33947
|
+
*
|
|
33948
|
+
* @example
|
|
33949
|
+
* Error handling with `catchTag`:
|
|
33950
|
+
* ```ts
|
|
33951
|
+
* import { Effect } from "effect";
|
|
33952
|
+
* import { parse } from "jsonc-effect";
|
|
33953
|
+
*
|
|
33954
|
+
* const program = parse("{ bad }").pipe(
|
|
33955
|
+
* Effect.catchTag("JsoncParseError", (err) =>
|
|
33956
|
+
* Effect.succeed({ fallback: true, errors: err.errors }),
|
|
33957
|
+
* ),
|
|
33958
|
+
* );
|
|
33959
|
+
*
|
|
33960
|
+
* const result = Effect.runSync(program);
|
|
33961
|
+
* console.log(result);
|
|
33962
|
+
* ```
|
|
33963
|
+
*
|
|
33964
|
+
* @example
|
|
33965
|
+
* Using `Effect.gen`:
|
|
33966
|
+
* ```ts
|
|
33967
|
+
* import { Effect } from "effect";
|
|
33968
|
+
* import { parse } from "jsonc-effect";
|
|
33969
|
+
*
|
|
33970
|
+
* const program = Effect.gen(function* () {
|
|
33971
|
+
* const config = yield* parse('{ "port": 3000 }');
|
|
33972
|
+
* return config;
|
|
33973
|
+
* });
|
|
33974
|
+
*
|
|
33975
|
+
* const result = Effect.runSync(program);
|
|
33976
|
+
* console.log(result); // { port: 3000 }
|
|
33977
|
+
* ```
|
|
33978
|
+
*
|
|
33979
|
+
* @privateRemarks
|
|
33980
|
+
* Uses {@link createScanner} internally with a recursive descent parser.
|
|
33981
|
+
* The scanner is created with `ignoreTrivia = false` so the parser can
|
|
33982
|
+
* report comment-related errors when `disallowComments` is set.
|
|
33983
|
+
*
|
|
33984
|
+
* @public
|
|
33985
|
+
*/
|
|
33986
|
+
const parse$2 = (text, options) => sync$2(() => parseInternal(text, options ?? {}, false)).pipe(flatMap$2(({ value, errors }) => {
|
|
33987
|
+
if (errors.length > 0) return fail$2(new JsoncParseError({
|
|
33988
|
+
errors,
|
|
33989
|
+
text,
|
|
33990
|
+
...options !== void 0 ? { options } : {}
|
|
33991
|
+
}));
|
|
33992
|
+
return succeed$3(value);
|
|
33993
|
+
}));
|
|
33994
|
+
function parseInternal(text, options, buildTree) {
|
|
33995
|
+
const scanner = createScanner$1(text, false);
|
|
33996
|
+
const errors = [];
|
|
33997
|
+
const disallowComments = options.disallowComments ?? false;
|
|
33998
|
+
const allowTrailingComma = options.allowTrailingComma ?? true;
|
|
33999
|
+
const allowEmptyContent = options.allowEmptyContent ?? false;
|
|
34000
|
+
let currentToken = "Unknown";
|
|
34001
|
+
function token() {
|
|
34002
|
+
return currentToken;
|
|
34003
|
+
}
|
|
34004
|
+
function scanNext() {
|
|
34005
|
+
for (;;) {
|
|
34006
|
+
currentToken = scanner.scan();
|
|
34007
|
+
switch (scanner.getTokenError()) {
|
|
34008
|
+
case "InvalidUnicode":
|
|
34009
|
+
handleError("InvalidUnicode");
|
|
34010
|
+
break;
|
|
34011
|
+
case "InvalidEscapeCharacter":
|
|
34012
|
+
handleError("InvalidEscapeCharacter");
|
|
34013
|
+
break;
|
|
34014
|
+
case "UnexpectedEndOfNumber":
|
|
34015
|
+
handleError("InvalidNumberFormat");
|
|
34016
|
+
break;
|
|
34017
|
+
case "UnexpectedEndOfComment":
|
|
34018
|
+
handleError("UnexpectedEndOfComment");
|
|
34019
|
+
break;
|
|
34020
|
+
case "UnexpectedEndOfString":
|
|
34021
|
+
handleError("UnexpectedEndOfString");
|
|
34022
|
+
break;
|
|
34023
|
+
case "InvalidCharacter":
|
|
34024
|
+
handleError("InvalidCharacter");
|
|
34025
|
+
break;
|
|
34026
|
+
}
|
|
34027
|
+
switch (currentToken) {
|
|
34028
|
+
case "LineComment":
|
|
34029
|
+
case "BlockComment":
|
|
34030
|
+
if (disallowComments) handleError("InvalidCommentToken");
|
|
34031
|
+
break;
|
|
34032
|
+
case "Trivia":
|
|
34033
|
+
case "LineBreak": break;
|
|
34034
|
+
default: return currentToken;
|
|
34035
|
+
}
|
|
34036
|
+
}
|
|
34037
|
+
}
|
|
34038
|
+
function tokenEnd() {
|
|
34039
|
+
return scanner.getTokenOffset() + scanner.getTokenLength();
|
|
34040
|
+
}
|
|
34041
|
+
function handleError(code, skipUntilAfter = [], skipUntil = []) {
|
|
34042
|
+
errors.push(new JsoncParseErrorDetail({
|
|
34043
|
+
code,
|
|
34044
|
+
message: formatError(code, scanner.getTokenOffset()),
|
|
34045
|
+
offset: scanner.getTokenOffset(),
|
|
34046
|
+
length: scanner.getTokenLength(),
|
|
34047
|
+
startLine: scanner.getTokenStartLine(),
|
|
34048
|
+
startCharacter: scanner.getTokenStartCharacter()
|
|
34049
|
+
}));
|
|
34050
|
+
if (skipUntilAfter.length > 0 || skipUntil.length > 0) {
|
|
34051
|
+
let t = token();
|
|
34052
|
+
while (t !== "EOF") {
|
|
34053
|
+
if (skipUntilAfter.includes(t)) {
|
|
34054
|
+
scanNext();
|
|
34055
|
+
break;
|
|
34056
|
+
}
|
|
34057
|
+
if (skipUntil.includes(t)) break;
|
|
34058
|
+
t = scanNext();
|
|
34059
|
+
}
|
|
34060
|
+
}
|
|
34061
|
+
}
|
|
34062
|
+
function parseValue() {
|
|
34063
|
+
switch (token()) {
|
|
34064
|
+
case "OpenBracket": return parseArray();
|
|
34065
|
+
case "OpenBrace": return parseObject();
|
|
34066
|
+
case "String": return parseString();
|
|
34067
|
+
case "Number": return parseNumber();
|
|
34068
|
+
case "True":
|
|
34069
|
+
scanNext();
|
|
34070
|
+
return true;
|
|
34071
|
+
case "False":
|
|
34072
|
+
scanNext();
|
|
34073
|
+
return false;
|
|
34074
|
+
case "Null":
|
|
34075
|
+
scanNext();
|
|
34076
|
+
return null;
|
|
34077
|
+
default: return;
|
|
34078
|
+
}
|
|
34079
|
+
}
|
|
34080
|
+
function parseString() {
|
|
34081
|
+
const value = scanner.getTokenValue();
|
|
34082
|
+
scanNext();
|
|
34083
|
+
return value;
|
|
34084
|
+
}
|
|
34085
|
+
function parseNumber() {
|
|
34086
|
+
const value = Number.parseFloat(scanner.getTokenValue());
|
|
34087
|
+
scanNext();
|
|
34088
|
+
return value;
|
|
34089
|
+
}
|
|
34090
|
+
function parseArray() {
|
|
34091
|
+
scanNext();
|
|
34092
|
+
const arr = [];
|
|
34093
|
+
let needsComma = false;
|
|
34094
|
+
while (token() !== "CloseBracket" && token() !== "EOF") {
|
|
34095
|
+
if (token() === "Comma") {
|
|
34096
|
+
if (!needsComma) handleError("ValueExpected");
|
|
34097
|
+
scanNext();
|
|
34098
|
+
if (token() === "CloseBracket" && allowTrailingComma) break;
|
|
34099
|
+
} else if (needsComma) handleError("CommaExpected");
|
|
34100
|
+
const value = parseValue();
|
|
34101
|
+
if (value === void 0) handleError("ValueExpected", [], ["CloseBracket", "Comma"]);
|
|
34102
|
+
else arr.push(value);
|
|
34103
|
+
needsComma = true;
|
|
34104
|
+
}
|
|
34105
|
+
if (token() !== "CloseBracket") handleError("CloseBracketExpected");
|
|
34106
|
+
else scanNext();
|
|
34107
|
+
return arr;
|
|
34108
|
+
}
|
|
34109
|
+
function parseObject() {
|
|
34110
|
+
scanNext();
|
|
34111
|
+
const obj = {};
|
|
34112
|
+
let needsComma = false;
|
|
34113
|
+
while (token() !== "CloseBrace" && token() !== "EOF") {
|
|
34114
|
+
if (token() === "Comma") {
|
|
34115
|
+
if (!needsComma) handleError("PropertyNameExpected");
|
|
34116
|
+
scanNext();
|
|
34117
|
+
if (token() === "CloseBrace" && allowTrailingComma) break;
|
|
34118
|
+
} else if (needsComma) handleError("CommaExpected");
|
|
34119
|
+
if (token() !== "String") {
|
|
34120
|
+
handleError("PropertyNameExpected", [], ["CloseBrace", "Comma"]);
|
|
34121
|
+
continue;
|
|
34122
|
+
}
|
|
34123
|
+
const key = scanner.getTokenValue();
|
|
34124
|
+
scanNext();
|
|
34125
|
+
if (token() !== "Colon") {
|
|
34126
|
+
handleError("ColonExpected", [], ["CloseBrace", "Comma"]);
|
|
34127
|
+
continue;
|
|
34128
|
+
}
|
|
34129
|
+
scanNext();
|
|
34130
|
+
const value = parseValue();
|
|
34131
|
+
if (value === void 0) handleError("ValueExpected", [], ["CloseBrace", "Comma"]);
|
|
34132
|
+
else obj[key] = value;
|
|
34133
|
+
needsComma = true;
|
|
34134
|
+
}
|
|
34135
|
+
if (token() !== "CloseBrace") handleError("CloseBraceExpected");
|
|
34136
|
+
else scanNext();
|
|
34137
|
+
return obj;
|
|
34138
|
+
}
|
|
34139
|
+
function parseValueTree() {
|
|
34140
|
+
switch (token()) {
|
|
34141
|
+
case "OpenBracket": return parseArrayTree();
|
|
34142
|
+
case "OpenBrace": return parseObjectTree();
|
|
34143
|
+
case "String": {
|
|
34144
|
+
const node = {
|
|
34145
|
+
type: "string",
|
|
34146
|
+
offset: scanner.getTokenOffset(),
|
|
34147
|
+
length: 0,
|
|
34148
|
+
value: scanner.getTokenValue()
|
|
34149
|
+
};
|
|
34150
|
+
const end = tokenEnd();
|
|
34151
|
+
scanNext();
|
|
34152
|
+
node.length = end - node.offset;
|
|
34153
|
+
return node;
|
|
34154
|
+
}
|
|
34155
|
+
case "Number": {
|
|
34156
|
+
const node = {
|
|
34157
|
+
type: "number",
|
|
34158
|
+
offset: scanner.getTokenOffset(),
|
|
34159
|
+
length: 0,
|
|
34160
|
+
value: Number.parseFloat(scanner.getTokenValue())
|
|
34161
|
+
};
|
|
34162
|
+
const end = tokenEnd();
|
|
34163
|
+
scanNext();
|
|
34164
|
+
node.length = end - node.offset;
|
|
34165
|
+
return node;
|
|
34166
|
+
}
|
|
34167
|
+
case "True": {
|
|
34168
|
+
const node = {
|
|
34169
|
+
type: "boolean",
|
|
34170
|
+
offset: scanner.getTokenOffset(),
|
|
34171
|
+
length: 0,
|
|
34172
|
+
value: true
|
|
34173
|
+
};
|
|
34174
|
+
const end = tokenEnd();
|
|
34175
|
+
scanNext();
|
|
34176
|
+
node.length = end - node.offset;
|
|
34177
|
+
return node;
|
|
34178
|
+
}
|
|
34179
|
+
case "False": {
|
|
34180
|
+
const node = {
|
|
34181
|
+
type: "boolean",
|
|
34182
|
+
offset: scanner.getTokenOffset(),
|
|
34183
|
+
length: 0,
|
|
34184
|
+
value: false
|
|
34185
|
+
};
|
|
34186
|
+
const end = tokenEnd();
|
|
34187
|
+
scanNext();
|
|
34188
|
+
node.length = end - node.offset;
|
|
34189
|
+
return node;
|
|
34190
|
+
}
|
|
34191
|
+
case "Null": {
|
|
34192
|
+
const node = {
|
|
34193
|
+
type: "null",
|
|
34194
|
+
offset: scanner.getTokenOffset(),
|
|
34195
|
+
length: 0,
|
|
34196
|
+
value: null
|
|
34197
|
+
};
|
|
34198
|
+
const end = tokenEnd();
|
|
34199
|
+
scanNext();
|
|
34200
|
+
node.length = end - node.offset;
|
|
34201
|
+
return node;
|
|
34202
|
+
}
|
|
34203
|
+
default: return;
|
|
34204
|
+
}
|
|
34205
|
+
}
|
|
34206
|
+
function parseArrayTree() {
|
|
34207
|
+
const node = {
|
|
34208
|
+
type: "array",
|
|
34209
|
+
offset: scanner.getTokenOffset(),
|
|
34210
|
+
length: 0,
|
|
34211
|
+
children: []
|
|
34212
|
+
};
|
|
34213
|
+
scanNext();
|
|
34214
|
+
let needsComma = false;
|
|
34215
|
+
while (token() !== "CloseBracket" && token() !== "EOF") {
|
|
34216
|
+
if (token() === "Comma") {
|
|
34217
|
+
if (!needsComma) handleError("ValueExpected");
|
|
34218
|
+
scanNext();
|
|
34219
|
+
if (token() === "CloseBracket" && allowTrailingComma) break;
|
|
34220
|
+
} else if (needsComma) handleError("CommaExpected");
|
|
34221
|
+
const child = parseValueTree();
|
|
34222
|
+
if (child) node.children.push(child);
|
|
34223
|
+
else handleError("ValueExpected", [], ["CloseBracket", "Comma"]);
|
|
34224
|
+
needsComma = true;
|
|
34225
|
+
}
|
|
34226
|
+
let end;
|
|
34227
|
+
if (token() !== "CloseBracket") {
|
|
34228
|
+
handleError("CloseBracketExpected");
|
|
34229
|
+
end = scanner.getTokenOffset();
|
|
34230
|
+
} else {
|
|
34231
|
+
end = tokenEnd();
|
|
34232
|
+
scanNext();
|
|
34233
|
+
}
|
|
34234
|
+
node.length = end - node.offset;
|
|
34235
|
+
return node;
|
|
34236
|
+
}
|
|
34237
|
+
function parseObjectTree() {
|
|
34238
|
+
const node = {
|
|
34239
|
+
type: "object",
|
|
34240
|
+
offset: scanner.getTokenOffset(),
|
|
34241
|
+
length: 0,
|
|
34242
|
+
children: []
|
|
34243
|
+
};
|
|
34244
|
+
scanNext();
|
|
34245
|
+
let needsComma = false;
|
|
34246
|
+
while (token() !== "CloseBrace" && token() !== "EOF") {
|
|
34247
|
+
if (token() === "Comma") {
|
|
34248
|
+
if (!needsComma) handleError("PropertyNameExpected");
|
|
34249
|
+
scanNext();
|
|
34250
|
+
if (token() === "CloseBrace" && allowTrailingComma) break;
|
|
34251
|
+
} else if (needsComma) handleError("CommaExpected");
|
|
34252
|
+
if (token() !== "String") {
|
|
34253
|
+
handleError("PropertyNameExpected", [], ["CloseBrace", "Comma"]);
|
|
34254
|
+
continue;
|
|
34255
|
+
}
|
|
34256
|
+
const property = {
|
|
34257
|
+
type: "property",
|
|
34258
|
+
offset: scanner.getTokenOffset(),
|
|
34259
|
+
length: 0,
|
|
34260
|
+
children: []
|
|
34261
|
+
};
|
|
34262
|
+
const keyNode = {
|
|
34263
|
+
type: "string",
|
|
34264
|
+
offset: scanner.getTokenOffset(),
|
|
34265
|
+
length: 0,
|
|
34266
|
+
value: scanner.getTokenValue()
|
|
34267
|
+
};
|
|
34268
|
+
const keyEnd = tokenEnd();
|
|
34269
|
+
scanNext();
|
|
34270
|
+
keyNode.length = keyEnd - keyNode.offset;
|
|
34271
|
+
property.children.push(keyNode);
|
|
34272
|
+
if (token() !== "Colon") {
|
|
34273
|
+
handleError("ColonExpected", [], ["CloseBrace", "Comma"]);
|
|
34274
|
+
property.length = scanner.getTokenOffset() - property.offset;
|
|
34275
|
+
node.children.push(property);
|
|
34276
|
+
continue;
|
|
34277
|
+
}
|
|
34278
|
+
property.colonOffset = scanner.getTokenOffset();
|
|
34279
|
+
scanNext();
|
|
34280
|
+
const valueNode = parseValueTree();
|
|
34281
|
+
if (valueNode) {
|
|
34282
|
+
property.children.push(valueNode);
|
|
34283
|
+
property.length = valueNode.offset + valueNode.length - property.offset;
|
|
34284
|
+
} else {
|
|
34285
|
+
handleError("ValueExpected", [], ["CloseBrace", "Comma"]);
|
|
34286
|
+
property.length = scanner.getTokenOffset() - property.offset;
|
|
34287
|
+
}
|
|
34288
|
+
node.children.push(property);
|
|
34289
|
+
needsComma = true;
|
|
34290
|
+
}
|
|
34291
|
+
let end;
|
|
34292
|
+
if (token() !== "CloseBrace") {
|
|
34293
|
+
handleError("CloseBraceExpected");
|
|
34294
|
+
end = scanner.getTokenOffset();
|
|
34295
|
+
} else {
|
|
34296
|
+
end = tokenEnd();
|
|
34297
|
+
scanNext();
|
|
34298
|
+
}
|
|
34299
|
+
node.length = end - node.offset;
|
|
34300
|
+
return node;
|
|
34301
|
+
}
|
|
34302
|
+
scanNext();
|
|
34303
|
+
if (buildTree) {
|
|
34304
|
+
const root = parseValueTree();
|
|
34305
|
+
if (token() !== "EOF") handleError("EndOfFileExpected");
|
|
34306
|
+
if (!root && !allowEmptyContent) handleError("ValueExpected");
|
|
34307
|
+
return {
|
|
34308
|
+
value: void 0,
|
|
34309
|
+
root,
|
|
34310
|
+
errors
|
|
34311
|
+
};
|
|
34312
|
+
}
|
|
34313
|
+
const value = parseValue();
|
|
34314
|
+
if (token() !== "EOF") handleError("EndOfFileExpected");
|
|
34315
|
+
if (value === void 0 && !allowEmptyContent) handleError("ValueExpected");
|
|
34316
|
+
return {
|
|
34317
|
+
value,
|
|
34318
|
+
root: void 0,
|
|
34319
|
+
errors
|
|
34320
|
+
};
|
|
34321
|
+
}
|
|
34322
|
+
function formatError(code, offset) {
|
|
34323
|
+
switch (code) {
|
|
34324
|
+
case "InvalidSymbol": return `Invalid symbol at offset ${offset}`;
|
|
34325
|
+
case "InvalidNumberFormat": return `Invalid number format at offset ${offset}`;
|
|
34326
|
+
case "PropertyNameExpected": return `Property name expected at offset ${offset}`;
|
|
34327
|
+
case "ValueExpected": return `Value expected at offset ${offset}`;
|
|
34328
|
+
case "ColonExpected": return `Colon expected at offset ${offset}`;
|
|
34329
|
+
case "CommaExpected": return `Comma expected at offset ${offset}`;
|
|
34330
|
+
case "CloseBraceExpected": return `Close brace expected at offset ${offset}`;
|
|
34331
|
+
case "CloseBracketExpected": return `Close bracket expected at offset ${offset}`;
|
|
34332
|
+
case "EndOfFileExpected": return `End of file expected at offset ${offset}`;
|
|
34333
|
+
case "InvalidCommentToken": return `Comments not allowed at offset ${offset}`;
|
|
34334
|
+
case "UnexpectedEndOfComment": return `Unexpected end of comment at offset ${offset}`;
|
|
34335
|
+
case "UnexpectedEndOfString": return `Unexpected end of string at offset ${offset}`;
|
|
34336
|
+
case "UnexpectedEndOfNumber": return `Unexpected end of number at offset ${offset}`;
|
|
34337
|
+
case "InvalidUnicode": return `Invalid unicode escape at offset ${offset}`;
|
|
34338
|
+
case "InvalidEscapeCharacter": return `Invalid escape character at offset ${offset}`;
|
|
34339
|
+
case "InvalidCharacter": return `Invalid character at offset ${offset}`;
|
|
34340
|
+
default: return `Parse error at offset ${offset}`;
|
|
34341
|
+
}
|
|
34342
|
+
}
|
|
34343
|
+
//#endregion
|
|
34344
|
+
//#region ../../node_modules/.pnpm/jsonc-effect@0.3.1_effect@3.21.4/node_modules/jsonc-effect/format.js
|
|
34345
|
+
/**
|
|
34346
|
+
* Apply an array of text edits to JSONC source text.
|
|
34347
|
+
*
|
|
34348
|
+
* This is a {@link https://effect.website/docs/function-dual | Function.dual}
|
|
34349
|
+
* that supports both data-first and data-last (pipeline) usage.
|
|
34350
|
+
*
|
|
34351
|
+
* @param text - The original JSONC source text.
|
|
34352
|
+
* @param edits - A read-only array of {@link JsoncEdit} objects, typically
|
|
34353
|
+
* produced by {@link format} or {@link modify}.
|
|
34354
|
+
* @returns An `Effect` that succeeds with the edited string.
|
|
34355
|
+
*
|
|
34356
|
+
* @remarks
|
|
34357
|
+
* Edits are sorted in reverse offset order before application so that
|
|
34358
|
+
* earlier edits do not shift the offsets of later ones. The original `edits`
|
|
34359
|
+
* array is not mutated.
|
|
34360
|
+
*
|
|
34361
|
+
* @see {@link format} to compute formatting edits.
|
|
34362
|
+
* @see {@link modify} to compute structural edits (insert, replace, remove).
|
|
34363
|
+
*
|
|
34364
|
+
* @example Data-first usage
|
|
34365
|
+
* ```ts
|
|
34366
|
+
* import { Effect } from "effect";
|
|
34367
|
+
* import { format, applyEdits } from "jsonc-effect";
|
|
34368
|
+
*
|
|
34369
|
+
* const input = '{"a":1}';
|
|
34370
|
+
* const edits = Effect.runSync(format(input));
|
|
34371
|
+
* const result: string = Effect.runSync(applyEdits(input, edits));
|
|
34372
|
+
* ```
|
|
34373
|
+
*
|
|
34374
|
+
* @example Pipeline with modify
|
|
34375
|
+
* ```ts
|
|
34376
|
+
* import { Effect, pipe } from "effect";
|
|
34377
|
+
* import { modify, applyEdits } from "jsonc-effect";
|
|
34378
|
+
*
|
|
34379
|
+
* const input = '{ "a": 1 }';
|
|
34380
|
+
* const result = pipe(
|
|
34381
|
+
* input,
|
|
34382
|
+
* modify(["a"], 42),
|
|
34383
|
+
* Effect.flatMap((edits) => applyEdits(input, edits)),
|
|
34384
|
+
* Effect.runSync,
|
|
34385
|
+
* );
|
|
34386
|
+
* ```
|
|
34387
|
+
*
|
|
34388
|
+
* @public
|
|
34389
|
+
*/
|
|
34390
|
+
const applyEdits$1 = dual(2, (text, edits) => sync$2(() => {
|
|
34391
|
+
const sorted = [...edits].sort((a, b) => b.offset - a.offset);
|
|
34392
|
+
let result = text;
|
|
34393
|
+
for (const edit of sorted) result = result.substring(0, edit.offset) + edit.content + result.substring(edit.offset + edit.length);
|
|
34394
|
+
return result;
|
|
34395
|
+
}));
|
|
34396
|
+
/**
|
|
34397
|
+
* Compute edits to insert, replace, or remove a value at a JSON path.
|
|
34398
|
+
*
|
|
34399
|
+
* This is a {@link https://effect.website/docs/function-dual | Function.dual}
|
|
34400
|
+
* that supports both data-first and data-last (pipeline) usage.
|
|
34401
|
+
*
|
|
34402
|
+
* @param text - The JSONC source text to modify.
|
|
34403
|
+
* @param path - A {@link (JsoncPath:type)} (array of string keys and numeric indices)
|
|
34404
|
+
* identifying the target location in the JSON structure.
|
|
34405
|
+
* @param value - The value to set. Pass `undefined` to remove the
|
|
34406
|
+
* property or array element at the given path.
|
|
34407
|
+
* @param options - Optional object with `formattingOptions` controlling
|
|
34408
|
+
* indent size, tabs vs. spaces, and EOL style for generated text.
|
|
34409
|
+
* @returns An `Effect` that succeeds with a read-only array of
|
|
34410
|
+
* {@link JsoncEdit} objects, or fails with a
|
|
34411
|
+
* {@link JsoncModificationError} if the path cannot be navigated.
|
|
34412
|
+
*
|
|
34413
|
+
* @remarks
|
|
34414
|
+
* Setting `value` to `undefined` removes the targeted property or element,
|
|
34415
|
+
* including its surrounding comma. When inserting a new property into an
|
|
34416
|
+
* object, it is appended after the last existing property.
|
|
34417
|
+
*
|
|
34418
|
+
* @see {@link applyEdits} to apply the returned edits to the source text.
|
|
34419
|
+
* @see {@link JsoncModificationError} for the error type on navigation failure.
|
|
34420
|
+
*
|
|
34421
|
+
* @example Update an existing property
|
|
34422
|
+
* ```ts
|
|
34423
|
+
* import { Effect } from "effect";
|
|
34424
|
+
* import { modify, applyEdits } from "jsonc-effect";
|
|
34425
|
+
*
|
|
34426
|
+
* const input = '{ "a": 1 }';
|
|
34427
|
+
* const edits = Effect.runSync(modify(input, ["a"], 2));
|
|
34428
|
+
* const result: string = Effect.runSync(applyEdits(input, edits));
|
|
34429
|
+
* ```
|
|
34430
|
+
*
|
|
34431
|
+
* @example Insert a new property
|
|
34432
|
+
* ```ts
|
|
34433
|
+
* import { Effect } from "effect";
|
|
34434
|
+
* import { modify, applyEdits } from "jsonc-effect";
|
|
34435
|
+
*
|
|
34436
|
+
* const input = '{ "a": 1 }';
|
|
34437
|
+
* const edits = Effect.runSync(modify(input, ["b"], "hello"));
|
|
34438
|
+
* const result: string = Effect.runSync(applyEdits(input, edits));
|
|
34439
|
+
* ```
|
|
34440
|
+
*
|
|
34441
|
+
* @example Remove a property
|
|
34442
|
+
* ```ts
|
|
34443
|
+
* import { Effect } from "effect";
|
|
34444
|
+
* import { modify, applyEdits } from "jsonc-effect";
|
|
34445
|
+
*
|
|
34446
|
+
* const input = '{ "a": 1, "b": 2 }';
|
|
34447
|
+
* const edits = Effect.runSync(modify(input, ["a"], undefined));
|
|
34448
|
+
* const result: string = Effect.runSync(applyEdits(input, edits));
|
|
34449
|
+
* ```
|
|
34450
|
+
*
|
|
34451
|
+
* @example Pipeline (data-last) usage
|
|
34452
|
+
* ```ts
|
|
34453
|
+
* import { Effect, pipe } from "effect";
|
|
34454
|
+
* import { modify, applyEdits } from "jsonc-effect";
|
|
34455
|
+
*
|
|
34456
|
+
* const input = '{ "a": 1 }';
|
|
34457
|
+
* const result = pipe(
|
|
34458
|
+
* input,
|
|
34459
|
+
* modify(["a"], 42),
|
|
34460
|
+
* Effect.flatMap((edits) => applyEdits(input, edits)),
|
|
34461
|
+
* Effect.runSync,
|
|
34462
|
+
* );
|
|
34463
|
+
* ```
|
|
34464
|
+
*
|
|
34465
|
+
* @privateRemarks
|
|
34466
|
+
* Uses its own scanner-based navigation to locate the target path rather
|
|
34467
|
+
* than building a full AST via `parseTree`. This keeps the implementation
|
|
34468
|
+
* lightweight and avoids an intermediate allocation.
|
|
34469
|
+
*
|
|
34470
|
+
* @public
|
|
34471
|
+
*/
|
|
34472
|
+
const modify = dual((args) => typeof args[0] === "string" && Array.isArray(args[1]), (text, path, value, options) => try_({
|
|
34473
|
+
try: () => modifyImpl(text, path, value, options?.formattingOptions),
|
|
34474
|
+
catch: (e) => new JsoncModificationError({
|
|
34475
|
+
path,
|
|
34476
|
+
reason: String(e)
|
|
34477
|
+
})
|
|
34478
|
+
}));
|
|
34479
|
+
function modifyImpl(text, path, value, formattingOptions) {
|
|
34480
|
+
const opts = {
|
|
34481
|
+
tabSize: formattingOptions?.tabSize ?? 2,
|
|
34482
|
+
insertSpaces: formattingOptions?.insertSpaces ?? true,
|
|
34483
|
+
eol: formattingOptions?.eol ?? "\n"
|
|
34484
|
+
};
|
|
34485
|
+
const indentUnit = opts.insertSpaces ? " ".repeat(opts.tabSize) : " ";
|
|
34486
|
+
if (path.length === 0) {
|
|
34487
|
+
const content = value === void 0 ? "" : JSON.stringify(value, null, opts.tabSize);
|
|
34488
|
+
return [{
|
|
34489
|
+
offset: 0,
|
|
34490
|
+
length: text.length,
|
|
34491
|
+
content
|
|
34492
|
+
}];
|
|
34493
|
+
}
|
|
34494
|
+
const scanner = createScanner$1(text, true);
|
|
34495
|
+
let currentToken = scanner.scan();
|
|
34496
|
+
function tokenEnd() {
|
|
34497
|
+
return scanner.getTokenOffset() + scanner.getTokenLength();
|
|
34498
|
+
}
|
|
34499
|
+
function skipValue() {
|
|
34500
|
+
switch (currentToken) {
|
|
34501
|
+
case "OpenBrace": {
|
|
34502
|
+
let end = tokenEnd();
|
|
34503
|
+
currentToken = scanner.scan();
|
|
34504
|
+
let first = true;
|
|
34505
|
+
while (currentToken !== "CloseBrace" && currentToken !== "EOF") {
|
|
34506
|
+
if (!first && currentToken === "Comma") currentToken = scanner.scan();
|
|
34507
|
+
if (currentToken === "String") {
|
|
34508
|
+
currentToken = scanner.scan();
|
|
34509
|
+
if (currentToken === "Colon") {
|
|
34510
|
+
currentToken = scanner.scan();
|
|
34511
|
+
end = skipValue();
|
|
34512
|
+
}
|
|
34513
|
+
} else {
|
|
34514
|
+
end = tokenEnd();
|
|
34515
|
+
currentToken = scanner.scan();
|
|
34516
|
+
}
|
|
34517
|
+
first = false;
|
|
34518
|
+
}
|
|
34519
|
+
if (currentToken === "CloseBrace") {
|
|
34520
|
+
end = tokenEnd();
|
|
34521
|
+
currentToken = scanner.scan();
|
|
34522
|
+
}
|
|
34523
|
+
return end;
|
|
34524
|
+
}
|
|
34525
|
+
case "OpenBracket": {
|
|
34526
|
+
let end = tokenEnd();
|
|
34527
|
+
currentToken = scanner.scan();
|
|
34528
|
+
let first = true;
|
|
34529
|
+
while (currentToken !== "CloseBracket" && currentToken !== "EOF") {
|
|
34530
|
+
if (!first && currentToken === "Comma") currentToken = scanner.scan();
|
|
34531
|
+
end = skipValue();
|
|
34532
|
+
first = false;
|
|
34533
|
+
}
|
|
34534
|
+
if (currentToken === "CloseBracket") {
|
|
34535
|
+
end = tokenEnd();
|
|
34536
|
+
currentToken = scanner.scan();
|
|
34537
|
+
}
|
|
34538
|
+
return end;
|
|
34539
|
+
}
|
|
34540
|
+
default: {
|
|
34541
|
+
const end = tokenEnd();
|
|
34542
|
+
currentToken = scanner.scan();
|
|
34543
|
+
return end;
|
|
34544
|
+
}
|
|
34545
|
+
}
|
|
34546
|
+
}
|
|
34547
|
+
let depth = 0;
|
|
34548
|
+
for (const segment of path) {
|
|
34549
|
+
depth++;
|
|
34550
|
+
if (typeof segment === "string") {
|
|
34551
|
+
if (currentToken !== "OpenBrace") throw new Error(`Expected object at depth ${depth}`);
|
|
34552
|
+
currentToken = scanner.scan();
|
|
34553
|
+
let found = false;
|
|
34554
|
+
let lastValueEnd = scanner.getTokenOffset();
|
|
34555
|
+
let isFirst = true;
|
|
34556
|
+
while (currentToken !== "CloseBrace" && currentToken !== "EOF") {
|
|
34557
|
+
if (!isFirst && currentToken === "Comma") currentToken = scanner.scan();
|
|
34558
|
+
if (currentToken === "String") {
|
|
34559
|
+
const key = scanner.getTokenValue();
|
|
34560
|
+
currentToken = scanner.scan();
|
|
34561
|
+
if (currentToken === "Colon") currentToken = scanner.scan();
|
|
34562
|
+
if (key === segment) {
|
|
34563
|
+
found = true;
|
|
34564
|
+
if (depth === path.length) {
|
|
34565
|
+
const valueStart = scanner.getTokenOffset();
|
|
34566
|
+
const prevEnd = valueStart;
|
|
34567
|
+
const valueEnd = skipValue();
|
|
34568
|
+
if (value === void 0) {
|
|
34569
|
+
let removeStart = valueStart;
|
|
34570
|
+
let removeEnd = valueEnd;
|
|
34571
|
+
const keyStart = text.substring(0, valueStart).lastIndexOf(`"${segment}"`);
|
|
34572
|
+
if (keyStart >= 0) removeStart = keyStart;
|
|
34573
|
+
const commaPosBefore = text.substring(0, removeStart).trimEnd().lastIndexOf(",");
|
|
34574
|
+
if (commaPosBefore >= 0) removeStart = commaPosBefore;
|
|
34575
|
+
else {
|
|
34576
|
+
const trimmedAfter = text.substring(removeEnd).match(/^(\s*,)/);
|
|
34577
|
+
if (trimmedAfter) removeEnd += trimmedAfter[1].length;
|
|
34578
|
+
}
|
|
34579
|
+
return [{
|
|
34580
|
+
offset: removeStart,
|
|
34581
|
+
length: removeEnd - removeStart,
|
|
34582
|
+
content: ""
|
|
34583
|
+
}];
|
|
34584
|
+
}
|
|
34585
|
+
const serialized = JSON.stringify(value, null, opts.tabSize);
|
|
34586
|
+
return [{
|
|
34587
|
+
offset: prevEnd,
|
|
34588
|
+
length: valueEnd - prevEnd,
|
|
34589
|
+
content: serialized
|
|
34590
|
+
}];
|
|
34591
|
+
}
|
|
34592
|
+
break;
|
|
34593
|
+
}
|
|
34594
|
+
lastValueEnd = skipValue();
|
|
34595
|
+
} else {
|
|
34596
|
+
currentToken = scanner.scan();
|
|
34597
|
+
lastValueEnd = scanner.getTokenOffset();
|
|
34598
|
+
}
|
|
34599
|
+
isFirst = false;
|
|
34600
|
+
}
|
|
34601
|
+
if (!found && depth === path.length && value !== void 0) {
|
|
34602
|
+
const indent = indentUnit.repeat(depth);
|
|
34603
|
+
const serialized = JSON.stringify(value, null, opts.tabSize);
|
|
34604
|
+
const insertText = isFirst ? `${opts.eol}${indent}"${segment}": ${serialized}${opts.eol}${indentUnit.repeat(depth - 1)}` : `,${opts.eol}${indent}"${segment}": ${serialized}`;
|
|
34605
|
+
return [{
|
|
34606
|
+
offset: lastValueEnd,
|
|
34607
|
+
length: 0,
|
|
34608
|
+
content: insertText
|
|
34609
|
+
}];
|
|
34610
|
+
}
|
|
34611
|
+
} else {
|
|
34612
|
+
if (currentToken !== "OpenBracket") throw new Error(`Expected array at depth ${depth}`);
|
|
34613
|
+
currentToken = scanner.scan();
|
|
34614
|
+
let idx = 0;
|
|
34615
|
+
let lastEnd = scanner.getTokenOffset();
|
|
34616
|
+
while (currentToken !== "CloseBracket" && currentToken !== "EOF") {
|
|
34617
|
+
if (idx > 0 && currentToken === "Comma") currentToken = scanner.scan();
|
|
34618
|
+
if (idx === segment) {
|
|
34619
|
+
if (depth === path.length) {
|
|
34620
|
+
const valueStart = scanner.getTokenOffset();
|
|
34621
|
+
const valueEnd = skipValue();
|
|
34622
|
+
if (value === void 0) {
|
|
34623
|
+
let removeEnd = valueEnd;
|
|
34624
|
+
if (text.substring(removeEnd).trimStart().startsWith(",")) removeEnd = text.indexOf(",", removeEnd) + 1;
|
|
34625
|
+
return [{
|
|
34626
|
+
offset: valueStart,
|
|
34627
|
+
length: removeEnd - valueStart,
|
|
34628
|
+
content: ""
|
|
34629
|
+
}];
|
|
34630
|
+
}
|
|
34631
|
+
const serialized = JSON.stringify(value, null, opts.tabSize);
|
|
34632
|
+
return [{
|
|
34633
|
+
offset: valueStart,
|
|
34634
|
+
length: valueEnd - valueStart,
|
|
34635
|
+
content: serialized
|
|
34636
|
+
}];
|
|
34637
|
+
}
|
|
34638
|
+
break;
|
|
34639
|
+
}
|
|
34640
|
+
lastEnd = skipValue();
|
|
34641
|
+
idx++;
|
|
34642
|
+
}
|
|
34643
|
+
if (idx <= segment && depth === path.length && value !== void 0) {
|
|
34644
|
+
const indent = indentUnit.repeat(depth);
|
|
34645
|
+
const serialized = JSON.stringify(value, null, opts.tabSize);
|
|
34646
|
+
const insertText = idx === 0 ? `${opts.eol}${indent}${serialized}${opts.eol}${indentUnit.repeat(depth - 1)}` : `,${opts.eol}${indent}${serialized}`;
|
|
34647
|
+
return [{
|
|
34648
|
+
offset: lastEnd,
|
|
34649
|
+
length: 0,
|
|
34650
|
+
content: insertText
|
|
34651
|
+
}];
|
|
34652
|
+
}
|
|
34653
|
+
}
|
|
34654
|
+
}
|
|
34655
|
+
return [];
|
|
34656
|
+
}
|
|
34657
|
+
//#endregion
|
|
34658
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/WorkspaceStateSnapshot.js
|
|
33367
34659
|
const DepRecord = optionalWith(Record({
|
|
33368
34660
|
key: String$,
|
|
33369
34661
|
value: String$
|
|
@@ -33432,7 +34724,7 @@ var WorkspaceStateSnapshot = class extends Class("WorkspaceStateSnapshot")({
|
|
|
33432
34724
|
}
|
|
33433
34725
|
};
|
|
33434
34726
|
//#endregion
|
|
33435
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
34727
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PointInTimeWorkspace.js
|
|
33436
34728
|
/**
|
|
33437
34729
|
* Service for reading a monorepo's workspace state at a specific moment: any
|
|
33438
34730
|
* git ref (via `git show`/`git ls-tree`, without checking the ref out) or the
|
|
@@ -33459,7 +34751,7 @@ var WorkspaceStateSnapshot = class extends Class("WorkspaceStateSnapshot")({
|
|
|
33459
34751
|
*/
|
|
33460
34752
|
var PointInTimeWorkspace = class extends Tag("@spencerbeggs/workspaces-effect/PointInTimeWorkspace")() {};
|
|
33461
34753
|
//#endregion
|
|
33462
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
34754
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/discovery/glob-core.js
|
|
33463
34755
|
const normalize$1 = (pattern) => pattern.replace(/\/\*\*$/, "/*");
|
|
33464
34756
|
const toRegex = (glob) => new RegExp(`^${glob.replace(/[.+^${}()|[\]\\]/g, "\\$&").replace(/\*/g, "[^/]*").replace(/\?/g, "[^/]")}$`);
|
|
33465
34757
|
/**
|
|
@@ -33502,7 +34794,7 @@ const compileWorkspaceGlobs = (patterns) => {
|
|
|
33502
34794
|
};
|
|
33503
34795
|
};
|
|
33504
34796
|
//#endregion
|
|
33505
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
34797
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/point-in-time/git.js
|
|
33506
34798
|
/**
|
|
33507
34799
|
* Stderr shapes that mean "the path is not present at this ref" rather than
|
|
33508
34800
|
* "the git command failed."
|
|
@@ -33594,7 +34886,7 @@ const makeGitReader = (executor, options) => {
|
|
|
33594
34886
|
};
|
|
33595
34887
|
};
|
|
33596
34888
|
//#endregion
|
|
33597
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
34889
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/PointInTimeWorkspaceLive.js
|
|
33598
34890
|
/**
|
|
33599
34891
|
* Live layer for the {@link PointInTimeWorkspace} service.
|
|
33600
34892
|
*
|
|
@@ -33649,7 +34941,7 @@ const packageSnapshotFromJson = (text, relativePath) => {
|
|
|
33649
34941
|
*
|
|
33650
34942
|
* @internal
|
|
33651
34943
|
*/
|
|
33652
|
-
const lockfileCatalogsAtRef = (text) => isNone(text) ? succeed$3(CatalogSet.empty()) : parse$
|
|
34944
|
+
const lockfileCatalogsAtRef = (text) => isNone(text) ? succeed$3(CatalogSet.empty()) : parse$3(text.value).pipe(map$5((parsed) => CatalogSet.fromLockfileCatalogs(parsed?.catalogs)), orElseSucceed(() => CatalogSet.empty()));
|
|
33653
34945
|
/**
|
|
33654
34946
|
* Live layer for the {@link PointInTimeWorkspace} service.
|
|
33655
34947
|
*
|
|
@@ -33735,7 +35027,7 @@ const PointInTimeWorkspaceLive = effect$1(PointInTimeWorkspace, gen(function* ()
|
|
|
33735
35027
|
});
|
|
33736
35028
|
}));
|
|
33737
35029
|
//#endregion
|
|
33738
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
35030
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/schemas/publish.js
|
|
33739
35031
|
/**
|
|
33740
35032
|
* Schema for package publish targets.
|
|
33741
35033
|
*
|
|
@@ -33778,7 +35070,7 @@ var PublishTarget = class extends Class("PublishTarget")({
|
|
|
33778
35070
|
provenance: optionalWith(Boolean$, { default: () => false })
|
|
33779
35071
|
}) {};
|
|
33780
35072
|
//#endregion
|
|
33781
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
35073
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/services/PublishabilityDetector.js
|
|
33782
35074
|
/**
|
|
33783
35075
|
* Service for detecting whether a workspace package is publishable and
|
|
33784
35076
|
* identifying its publish targets (npm, GitHub Packages, etc.).
|
|
@@ -33840,7 +35132,7 @@ var PublishTarget = class extends Class("PublishTarget")({
|
|
|
33840
35132
|
*/
|
|
33841
35133
|
var PublishabilityDetector = class extends Tag("@spencerbeggs/workspaces-effect/PublishabilityDetector")() {};
|
|
33842
35134
|
//#endregion
|
|
33843
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
35135
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/PublishabilityDetectorLive.js
|
|
33844
35136
|
/**
|
|
33845
35137
|
* Default live implementation of the {@link PublishabilityDetector} service.
|
|
33846
35138
|
*
|
|
@@ -33912,7 +35204,7 @@ const PublishabilityDetectorLive = succeed$2(PublishabilityDetector, { detect: (
|
|
|
33912
35204
|
return targets;
|
|
33913
35205
|
}).pipe(withSpan("PublishabilityDetector.detect", { attributes: { "workspace.package": pkg.name } })) });
|
|
33914
35206
|
//#endregion
|
|
33915
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
35207
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/WorkspaceDiscoveryLive.js
|
|
33916
35208
|
/**
|
|
33917
35209
|
* Live implementation of the {@link WorkspaceDiscovery} service.
|
|
33918
35210
|
*
|
|
@@ -34199,7 +35491,7 @@ const WorkspaceDiscoveryLive = effect$1(WorkspaceDiscovery, gen(function* () {
|
|
|
34199
35491
|
};
|
|
34200
35492
|
}));
|
|
34201
35493
|
//#endregion
|
|
34202
|
-
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.
|
|
35494
|
+
//#region ../../node_modules/.pnpm/workspaces-effect@2.0.2_@effect+platform@0.96.2_effect@3.21.4__effect@3.21.4/node_modules/workspaces-effect/layers/WorkspaceRootLive.js
|
|
34203
35495
|
/**
|
|
34204
35496
|
* Live implementation of the {@link WorkspaceRoot} service.
|
|
34205
35497
|
*
|
|
@@ -58988,7 +60280,7 @@ var ChangelogTransformer = class ChangelogTransformer {
|
|
|
58988
60280
|
}
|
|
58989
60281
|
};
|
|
58990
60282
|
//#endregion
|
|
58991
|
-
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.
|
|
60283
|
+
//#region ../../node_modules/.pnpm/fdir@6.5.0_picomatch@4.0.5/node_modules/fdir/dist/index.mjs
|
|
58992
60284
|
var __require = /* @__PURE__ */ (0, module$1.createRequire)(require("url").pathToFileURL(__filename).href);
|
|
58993
60285
|
function cleanPath(path$11) {
|
|
58994
60286
|
let normalized = (0, path.normalize)(path$11);
|
|
@@ -59496,7 +60788,7 @@ var Builder = class {
|
|
|
59496
60788
|
}
|
|
59497
60789
|
};
|
|
59498
60790
|
//#endregion
|
|
59499
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
60791
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/constants.js
|
|
59500
60792
|
var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
59501
60793
|
const WIN_SLASH = "\\\\/";
|
|
59502
60794
|
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
@@ -59665,7 +60957,7 @@ var require_constants = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
59665
60957
|
};
|
|
59666
60958
|
}));
|
|
59667
60959
|
//#endregion
|
|
59668
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
60960
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/utils.js
|
|
59669
60961
|
var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
59670
60962
|
const { REGEX_BACKSLASH, REGEX_REMOVE_BACKSLASH, REGEX_SPECIAL_CHARS, REGEX_SPECIAL_CHARS_GLOBAL } = require_constants();
|
|
59671
60963
|
exports.isObject = (val) => val !== null && typeof val === "object" && !Array.isArray(val);
|
|
@@ -59713,7 +61005,7 @@ var require_utils = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
|
59713
61005
|
};
|
|
59714
61006
|
}));
|
|
59715
61007
|
//#endregion
|
|
59716
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
61008
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/scan.js
|
|
59717
61009
|
var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
59718
61010
|
const utils = require_utils();
|
|
59719
61011
|
const { CHAR_ASTERISK, CHAR_AT, CHAR_BACKWARD_SLASH, CHAR_COMMA, CHAR_DOT, CHAR_EXCLAMATION_MARK, CHAR_FORWARD_SLASH, CHAR_LEFT_CURLY_BRACE, CHAR_LEFT_PARENTHESES, CHAR_LEFT_SQUARE_BRACKET, CHAR_PLUS, CHAR_QUESTION_MARK, CHAR_RIGHT_CURLY_BRACE, CHAR_RIGHT_PARENTHESES, CHAR_RIGHT_SQUARE_BRACKET } = require_constants();
|
|
@@ -60000,7 +61292,7 @@ var require_scan = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60000
61292
|
module.exports = scan;
|
|
60001
61293
|
}));
|
|
60002
61294
|
//#endregion
|
|
60003
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
61295
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/parse.js
|
|
60004
61296
|
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
60005
61297
|
const constants = require_constants();
|
|
60006
61298
|
const utils = require_utils();
|
|
@@ -60155,7 +61447,10 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60155
61447
|
}
|
|
60156
61448
|
}
|
|
60157
61449
|
};
|
|
60158
|
-
const
|
|
61450
|
+
const buildCharClassStar = (chars) => {
|
|
61451
|
+
return `${chars.length === 1 ? utils.escapeRegex(chars[0]) : `[${chars.map((ch) => utils.escapeRegex(ch)).join("")}]`}*`;
|
|
61452
|
+
};
|
|
61453
|
+
const getStarExtglobSequenceChars = (pattern) => {
|
|
60159
61454
|
let index = 0;
|
|
60160
61455
|
const chars = [];
|
|
60161
61456
|
while (index < pattern.length) {
|
|
@@ -60169,7 +61464,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60169
61464
|
index += match.end + 1;
|
|
60170
61465
|
}
|
|
60171
61466
|
if (chars.length < 1) return;
|
|
60172
|
-
return
|
|
61467
|
+
return chars;
|
|
60173
61468
|
};
|
|
60174
61469
|
const repeatedExtglobRecursion = (pattern) => {
|
|
60175
61470
|
let depth = 0;
|
|
@@ -60189,14 +61484,28 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
60189
61484
|
if (branches.length > 1) {
|
|
60190
61485
|
if (branches.some((branch) => branch === "") || branches.some((branch) => /^[*?]+$/.test(branch)) || hasRepeatedCharPrefixOverlap(branches)) return { risky: true };
|
|
60191
61486
|
}
|
|
61487
|
+
const safeChars = [];
|
|
61488
|
+
let sawStarSequence = false;
|
|
61489
|
+
let combinable = true;
|
|
60192
61490
|
for (const branch of branches) {
|
|
60193
|
-
const
|
|
60194
|
-
if (
|
|
60195
|
-
|
|
60196
|
-
|
|
60197
|
-
|
|
61491
|
+
const chars = getStarExtglobSequenceChars(branch);
|
|
61492
|
+
if (chars) {
|
|
61493
|
+
sawStarSequence = true;
|
|
61494
|
+
safeChars.push(...chars);
|
|
61495
|
+
continue;
|
|
61496
|
+
}
|
|
61497
|
+
const literal = normalizeSimpleBranch(branch);
|
|
61498
|
+
if (literal && literal.length === 1) {
|
|
61499
|
+
safeChars.push(literal);
|
|
61500
|
+
continue;
|
|
61501
|
+
}
|
|
61502
|
+
combinable = false;
|
|
60198
61503
|
if (repeatedExtglobRecursion(branch) > max) return { risky: true };
|
|
60199
61504
|
}
|
|
61505
|
+
if (sawStarSequence) return combinable ? {
|
|
61506
|
+
risky: true,
|
|
61507
|
+
safeOutput: buildCharClassStar([...new Set(safeChars)])
|
|
61508
|
+
} : { risky: true };
|
|
60200
61509
|
return { risky: false };
|
|
60201
61510
|
};
|
|
60202
61511
|
/**
|
|
@@ -61057,7 +62366,7 @@ var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61057
62366
|
module.exports = parse;
|
|
61058
62367
|
}));
|
|
61059
62368
|
//#endregion
|
|
61060
|
-
//#region ../../node_modules/.pnpm/picomatch@4.0.
|
|
62369
|
+
//#region ../../node_modules/.pnpm/picomatch@4.0.5/node_modules/picomatch/lib/picomatch.js
|
|
61061
62370
|
var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
61062
62371
|
const scan = require_scan();
|
|
61063
62372
|
const parse = require_parse();
|
|
@@ -61078,6 +62387,18 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61078
62387
|
* const isMatch = picomatch('*.!(*a)');
|
|
61079
62388
|
* console.log(isMatch('a.a')); //=> false
|
|
61080
62389
|
* console.log(isMatch('a.b')); //=> true
|
|
62390
|
+
*
|
|
62391
|
+
* // For environments without `node.js`, `picomatch/posix` provides you a dependency-free matcher, without automatic OS detection.
|
|
62392
|
+
* const picomatch = require('picomatch/posix');
|
|
62393
|
+
* // the same API, defaulting to posix paths
|
|
62394
|
+
* const isMatch = picomatch('a/*');
|
|
62395
|
+
* console.log(isMatch('a\\b')); //=> false
|
|
62396
|
+
* console.log(isMatch('a/b')); //=> true
|
|
62397
|
+
*
|
|
62398
|
+
* // you can still configure the matcher function to accept windows paths
|
|
62399
|
+
* const isMatch = picomatch('a/*', { options: windows });
|
|
62400
|
+
* console.log(isMatch('a\\b')); //=> true
|
|
62401
|
+
* console.log(isMatch('a/b')); //=> true
|
|
61081
62402
|
* ```
|
|
61082
62403
|
* @name picomatch
|
|
61083
62404
|
* @param {String|Array} `globs` One or more glob patterns.
|
|
@@ -61196,8 +62517,8 @@ var require_picomatch$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
61196
62517
|
* @return {Boolean}
|
|
61197
62518
|
* @api public
|
|
61198
62519
|
*/
|
|
61199
|
-
picomatch.matchBase = (input, glob, options) => {
|
|
61200
|
-
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input));
|
|
62520
|
+
picomatch.matchBase = (input, glob, options, posix = options && options.windows) => {
|
|
62521
|
+
return (glob instanceof RegExp ? glob : picomatch.makeRe(glob, options)).test(utils.basename(input, { windows: posix }));
|
|
61201
62522
|
};
|
|
61202
62523
|
/**
|
|
61203
62524
|
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
@@ -62353,15 +63674,16 @@ function makeShape$2(inspector) {
|
|
|
62353
63674
|
path,
|
|
62354
63675
|
status: "added"
|
|
62355
63676
|
}));
|
|
63677
|
+
const isOwnChangeset = (path) => path.startsWith(".changeset/") && path.endsWith(".md");
|
|
62356
63678
|
const seen = /* @__PURE__ */ new Set();
|
|
62357
63679
|
const rawEntries = [];
|
|
62358
63680
|
for (const e of diffEntries) {
|
|
62359
|
-
if (seen.has(e.path)) continue;
|
|
63681
|
+
if (seen.has(e.path) || isOwnChangeset(e.path)) continue;
|
|
62360
63682
|
seen.add(e.path);
|
|
62361
63683
|
rawEntries.push(e);
|
|
62362
63684
|
}
|
|
62363
63685
|
for (const e of untrackedEntries) {
|
|
62364
|
-
if (seen.has(e.path)) continue;
|
|
63686
|
+
if (seen.has(e.path) || isOwnChangeset(e.path)) continue;
|
|
62365
63687
|
seen.add(e.path);
|
|
62366
63688
|
rawEntries.push(e);
|
|
62367
63689
|
}
|
|
@@ -62494,6 +63816,32 @@ const DEP_TYPE_MAP = [
|
|
|
62494
63816
|
*/
|
|
62495
63817
|
const resolveOrRaw = (snapshot, dep, spec) => getOrElse(snapshot.resolve(dep, spec), () => spec);
|
|
62496
63818
|
/**
|
|
63819
|
+
* Drop no-net-change field moves: the same dependency removed from one field
|
|
63820
|
+
* and added to another with an equal resolved version (e.g. a dep promoted
|
|
63821
|
+
* from `devDependencies` to `dependencies`). A field reclassification is a
|
|
63822
|
+
* contract change worth release-note prose, not a version movement, so it
|
|
63823
|
+
* must not surface as an unrelated removed row plus an added row. Moves that
|
|
63824
|
+
* also change the resolved version keep both rows (the movement is real).
|
|
63825
|
+
*/
|
|
63826
|
+
const collapseFieldMoves = (rows) => {
|
|
63827
|
+
const dropped = /* @__PURE__ */ new Set();
|
|
63828
|
+
const byName = /* @__PURE__ */ new Map();
|
|
63829
|
+
for (const row of rows) {
|
|
63830
|
+
const group = byName.get(row.dependency);
|
|
63831
|
+
if (group) group.push(row);
|
|
63832
|
+
else byName.set(row.dependency, [row]);
|
|
63833
|
+
}
|
|
63834
|
+
for (const group of byName.values()) for (const removed of group) {
|
|
63835
|
+
if (removed.action !== "removed" || dropped.has(removed)) continue;
|
|
63836
|
+
const added = group.find((r) => r.action === "added" && !dropped.has(r) && r.type !== removed.type && r.to === removed.from);
|
|
63837
|
+
if (added) {
|
|
63838
|
+
dropped.add(removed);
|
|
63839
|
+
dropped.add(added);
|
|
63840
|
+
}
|
|
63841
|
+
}
|
|
63842
|
+
return rows.filter((r) => !dropped.has(r));
|
|
63843
|
+
};
|
|
63844
|
+
/**
|
|
62497
63845
|
* Diff two workspace snapshots and return per-package dependency-table rows,
|
|
62498
63846
|
* comparing already-resolved specifier values per side.
|
|
62499
63847
|
*
|
|
@@ -62549,10 +63897,11 @@ function computeWorkspaceDependencyDiffs(before, after) {
|
|
|
62549
63897
|
});
|
|
62550
63898
|
}
|
|
62551
63899
|
}
|
|
62552
|
-
|
|
63900
|
+
const collapsed = collapseFieldMoves(rows);
|
|
63901
|
+
if (collapsed.length > 0) result.push({
|
|
62553
63902
|
package: afterPkg.name,
|
|
62554
63903
|
relativePath: afterPkg.relativePath,
|
|
62555
|
-
rows: sortDependencyRows(
|
|
63904
|
+
rows: sortDependencyRows(collapsed)
|
|
62556
63905
|
});
|
|
62557
63906
|
}
|
|
62558
63907
|
return result;
|
|
@@ -62892,7 +64241,8 @@ function makeShape$1(pit, inspector, discovery, detector, config, fs) {
|
|
|
62892
64241
|
fromRef = yield* gitMergeBase(resolvedCwd, baseBranch);
|
|
62893
64242
|
}
|
|
62894
64243
|
const rawDiffs = computeWorkspaceDependencyDiffs(yield* pit.at(fromRef, { cwd: resolvedCwd }), options.to ? yield* pit.at(options.to, { cwd: resolvedCwd }) : yield* pit.worktree({ cwd: resolvedCwd }));
|
|
62895
|
-
const
|
|
64244
|
+
const explicitTargets = /* @__PURE__ */ new Set([...options.packages ?? [], ...options.package ? [options.package] : []]);
|
|
64245
|
+
const excluded = new Set(options.exclude ?? []);
|
|
62896
64246
|
const livePackages = yield* discovery.listPackages(resolvedCwd);
|
|
62897
64247
|
const publishable = yield* listPublishablePackageNames(livePackages, resolvedCwd).pipe(provide$1(provideDetector));
|
|
62898
64248
|
const versionPrivate = yield* config.versionPrivate(resolvedCwd);
|
|
@@ -62901,9 +64251,15 @@ function makeShape$1(pit, inspector, discovery, detector, config, fs) {
|
|
|
62901
64251
|
if (yield* config.isIgnored(pkg.name, resolvedCwd)) continue;
|
|
62902
64252
|
if (publishable.has(pkg.name) || versionPrivate) inScope.add(pkg.name);
|
|
62903
64253
|
}
|
|
62904
|
-
const
|
|
64254
|
+
const activeTargets = /* @__PURE__ */ new Set();
|
|
64255
|
+
for (const name of explicitTargets) {
|
|
64256
|
+
if (excluded.has(name)) continue;
|
|
64257
|
+
if (yield* config.isIgnored(name, resolvedCwd)) continue;
|
|
64258
|
+
activeTargets.add(name);
|
|
64259
|
+
}
|
|
64260
|
+
const inScopeFor = (name) => explicitTargets.size > 0 ? activeTargets.has(name) : inScope.has(name) && !excluded.has(name);
|
|
62905
64261
|
const keepDevDeps = options.includeDevDeps === true;
|
|
62906
|
-
const scoped =
|
|
64262
|
+
const scoped = rawDiffs.filter((d) => inScopeFor(d.package));
|
|
62907
64263
|
const resolved = [];
|
|
62908
64264
|
for (const diff of scoped) {
|
|
62909
64265
|
const rows = keepDevDeps ? [...diff.rows] : diff.rows.filter((r) => r.type !== "devDependency");
|
|
@@ -62914,7 +64270,7 @@ function makeShape$1(pit, inspector, discovery, detector, config, fs) {
|
|
|
62914
64270
|
}
|
|
62915
64271
|
const existingPure = yield* findPureDependencyChangesets(fs, changesetDir);
|
|
62916
64272
|
const skippedMixed = yield* findMixedDependencyChangesets(fs, changesetDir);
|
|
62917
|
-
const toDelete =
|
|
64273
|
+
const toDelete = existingPure.filter((p) => inScopeFor(p.package));
|
|
62918
64274
|
const chosenFilenames = /* @__PURE__ */ new Set();
|
|
62919
64275
|
const toWrite = [];
|
|
62920
64276
|
for (const diff of resolved) {
|
|
@@ -63130,23 +64486,46 @@ function parseJsonPath(path) {
|
|
|
63130
64486
|
* @internal
|
|
63131
64487
|
*/
|
|
63132
64488
|
function jsonPathGet(obj, path) {
|
|
64489
|
+
return walkJsonPath(obj, path).map((entry) => entry.node);
|
|
64490
|
+
}
|
|
64491
|
+
/**
|
|
64492
|
+
* Shared breadth-first traversal behind {@link jsonPathGet} and
|
|
64493
|
+
* {@link jsonPathResolve}: each segment fans out the current set of matched
|
|
64494
|
+
* entries, carrying both the node and the concrete path taken to reach it.
|
|
64495
|
+
* The two public functions differ only in which half of the entry they keep.
|
|
64496
|
+
*/
|
|
64497
|
+
function walkJsonPath(obj, path) {
|
|
63133
64498
|
const segments = parseJsonPath(path);
|
|
63134
|
-
let current = [
|
|
64499
|
+
let current = [{
|
|
64500
|
+
node: obj,
|
|
64501
|
+
path: []
|
|
64502
|
+
}];
|
|
63135
64503
|
for (const segment of segments) {
|
|
63136
64504
|
const next = [];
|
|
63137
|
-
for (const node of current) {
|
|
64505
|
+
for (const { node, path: nodePath } of current) {
|
|
63138
64506
|
if (node === null || node === void 0 || typeof node !== "object") continue;
|
|
63139
64507
|
switch (segment.type) {
|
|
63140
64508
|
case "property": {
|
|
63141
64509
|
const value = node[segment.key];
|
|
63142
|
-
if (value !== void 0) next.push(
|
|
64510
|
+
if (value !== void 0) next.push({
|
|
64511
|
+
node: value,
|
|
64512
|
+
path: [...nodePath, segment.key]
|
|
64513
|
+
});
|
|
63143
64514
|
break;
|
|
63144
64515
|
}
|
|
63145
64516
|
case "index":
|
|
63146
|
-
if (Array.isArray(node) && segment.index < node.length) next.push(
|
|
64517
|
+
if (Array.isArray(node) && segment.index < node.length) next.push({
|
|
64518
|
+
node: node[segment.index],
|
|
64519
|
+
path: [...nodePath, segment.index]
|
|
64520
|
+
});
|
|
63147
64521
|
break;
|
|
63148
64522
|
case "wildcard":
|
|
63149
|
-
if (Array.isArray(node))
|
|
64523
|
+
if (Array.isArray(node)) node.forEach((element, index) => {
|
|
64524
|
+
next.push({
|
|
64525
|
+
node: element,
|
|
64526
|
+
path: [...nodePath, index]
|
|
64527
|
+
});
|
|
64528
|
+
});
|
|
63150
64529
|
break;
|
|
63151
64530
|
}
|
|
63152
64531
|
}
|
|
@@ -63155,81 +64534,37 @@ function jsonPathGet(obj, path) {
|
|
|
63155
64534
|
return current;
|
|
63156
64535
|
}
|
|
63157
64536
|
/**
|
|
63158
|
-
*
|
|
64537
|
+
* Resolve a JSONPath expression to the concrete paths of every existing match.
|
|
63159
64538
|
*
|
|
63160
64539
|
* @remarks
|
|
63161
|
-
*
|
|
63162
|
-
*
|
|
63163
|
-
*
|
|
63164
|
-
*
|
|
64540
|
+
* Uses the same breadth-first expansion as {@link jsonPathGet}, but instead of
|
|
64541
|
+
* collecting the matched *values* it records the concrete `(string | number)[]`
|
|
64542
|
+
* path taken to reach each one. Wildcards and indices are materialized into the
|
|
64543
|
+
* numeric array index actually traversed, so the returned paths are directly
|
|
64544
|
+
* consumable by structural editors such as `jsonc-effect`'s `modify`, which
|
|
64545
|
+
* require a fully concrete path (no wildcards).
|
|
64546
|
+
*
|
|
64547
|
+
* Only existing locations are returned; nothing is created. A path with no
|
|
64548
|
+
* matches yields an empty array, and the empty path (`"$."`) yields a single
|
|
64549
|
+
* empty concrete path (the document root).
|
|
63165
64550
|
*
|
|
63166
|
-
* @param obj - The object to
|
|
64551
|
+
* @param obj - The object to query
|
|
63167
64552
|
* @param path - JSONPath string (e.g., `"$.packages[*].version"`)
|
|
63168
|
-
* @
|
|
63169
|
-
* @returns The number of locations updated (0 if no matches or empty path)
|
|
64553
|
+
* @returns Array of concrete paths, each an array of string keys / numeric indices
|
|
63170
64554
|
*
|
|
63171
64555
|
* @example
|
|
63172
64556
|
* ```typescript
|
|
63173
|
-
* import {
|
|
64557
|
+
* import { jsonPathResolve } from "../utils/jsonpath.js";
|
|
63174
64558
|
*
|
|
63175
|
-
* const obj = { version: "1.0.0" };
|
|
63176
|
-
* const
|
|
63177
|
-
* //
|
|
64559
|
+
* const obj = { packages: [{ version: "1.0.0" }, { version: "2.0.0" }] };
|
|
64560
|
+
* const paths = jsonPathResolve(obj, "$.packages[*].version");
|
|
64561
|
+
* // [["packages", 0, "version"], ["packages", 1, "version"]]
|
|
63178
64562
|
* ```
|
|
63179
64563
|
*
|
|
63180
64564
|
* @internal
|
|
63181
64565
|
*/
|
|
63182
|
-
function
|
|
63183
|
-
|
|
63184
|
-
if (segments.length === 0) return 0;
|
|
63185
|
-
const lastSegment = segments[segments.length - 1];
|
|
63186
|
-
const parentSegments = segments.slice(0, -1);
|
|
63187
|
-
let parents = [obj];
|
|
63188
|
-
for (const segment of parentSegments) {
|
|
63189
|
-
const next = [];
|
|
63190
|
-
for (const node of parents) {
|
|
63191
|
-
if (node === null || node === void 0 || typeof node !== "object") continue;
|
|
63192
|
-
switch (segment.type) {
|
|
63193
|
-
case "property": {
|
|
63194
|
-
const child = node[segment.key];
|
|
63195
|
-
if (child !== void 0) next.push(child);
|
|
63196
|
-
break;
|
|
63197
|
-
}
|
|
63198
|
-
case "index":
|
|
63199
|
-
if (Array.isArray(node) && segment.index < node.length) next.push(node[segment.index]);
|
|
63200
|
-
break;
|
|
63201
|
-
case "wildcard":
|
|
63202
|
-
if (Array.isArray(node)) next.push(...node);
|
|
63203
|
-
break;
|
|
63204
|
-
}
|
|
63205
|
-
}
|
|
63206
|
-
parents = next;
|
|
63207
|
-
}
|
|
63208
|
-
let count = 0;
|
|
63209
|
-
for (const parent of parents) {
|
|
63210
|
-
if (parent === null || parent === void 0 || typeof parent !== "object") continue;
|
|
63211
|
-
switch (lastSegment.type) {
|
|
63212
|
-
case "property":
|
|
63213
|
-
if (lastSegment.key in parent) {
|
|
63214
|
-
parent[lastSegment.key] = value;
|
|
63215
|
-
count++;
|
|
63216
|
-
}
|
|
63217
|
-
break;
|
|
63218
|
-
case "index":
|
|
63219
|
-
if (Array.isArray(parent) && lastSegment.index < parent.length) {
|
|
63220
|
-
parent[lastSegment.index] = value;
|
|
63221
|
-
count++;
|
|
63222
|
-
}
|
|
63223
|
-
break;
|
|
63224
|
-
case "wildcard":
|
|
63225
|
-
if (Array.isArray(parent)) for (let i = 0; i < parent.length; i++) {
|
|
63226
|
-
parent[i] = value;
|
|
63227
|
-
count++;
|
|
63228
|
-
}
|
|
63229
|
-
break;
|
|
63230
|
-
}
|
|
63231
|
-
}
|
|
63232
|
-
return count;
|
|
64566
|
+
function jsonPathResolve(obj, path) {
|
|
64567
|
+
return walkJsonPath(obj, path).map((entry) => entry.path);
|
|
63233
64568
|
}
|
|
63234
64569
|
//#endregion
|
|
63235
64570
|
//#region ../silk-effects/dist/dev/pkg/changesets/utils/version-files.js
|
|
@@ -63420,31 +64755,39 @@ var VersionFiles = class VersionFiles {
|
|
|
63420
64755
|
return content.match(/^(\s+)"/m)?.[1] ?? " ";
|
|
63421
64756
|
}
|
|
63422
64757
|
/**
|
|
63423
|
-
* Update JSON file at specified JSONPath locations
|
|
64758
|
+
* Update a JSON (or JSONC) file at specified JSONPath locations,
|
|
64759
|
+
* preserving the original formatting byte-for-byte.
|
|
63424
64760
|
*
|
|
63425
64761
|
* @remarks
|
|
63426
|
-
*
|
|
63427
|
-
*
|
|
63428
|
-
*
|
|
63429
|
-
*
|
|
64762
|
+
* The write is performed with `jsonc-effect`'s format-preserving
|
|
64763
|
+
* `modify`/`applyEdits` rather than a `JSON.parse`/`JSON.stringify`
|
|
64764
|
+
* round-trip (which always explodes inline arrays one-element-per-line and
|
|
64765
|
+
* drops comments). Each JSONPath expression is resolved to concrete
|
|
64766
|
+
* `(string | number)[]` paths against the parsed document, and each
|
|
64767
|
+
* concrete path becomes a minimal text edit that touches only the target
|
|
64768
|
+
* value's span — so inline arrays, comments,
|
|
64769
|
+
* indentation, and the trailing-newline preference all survive; a one-line
|
|
64770
|
+
* version bump produces a one-line diff.
|
|
64771
|
+
*
|
|
64772
|
+
* Insertion semantics: a concrete, wildcard-free JSONPath whose leaf
|
|
64773
|
+
* property does not exist yet is inserted after the last sibling using the
|
|
64774
|
+
* document's detected indent (the one case where indent detection still
|
|
64775
|
+
* matters). Wildcard expressions only ever update existing matches. Returns
|
|
64776
|
+
* `undefined` (no write) when nothing was updated or inserted.
|
|
63430
64777
|
*
|
|
63431
64778
|
* @param filePath - Absolute path to the JSON file
|
|
63432
64779
|
* @param jsonPaths - JSONPath expressions to update
|
|
63433
64780
|
* @param version - New version string
|
|
63434
64781
|
* @returns Update result, or `undefined` if no changes were made
|
|
64782
|
+
*
|
|
64783
|
+
* @see {@link jsonPathResolve} for concrete-path enumeration
|
|
64784
|
+
* @see {@link VersionFiles.applyVersionEdit} for the per-path edit
|
|
63435
64785
|
*/
|
|
63436
64786
|
static updateFile(filePath, jsonPaths, version) {
|
|
63437
|
-
const
|
|
63438
|
-
const
|
|
63439
|
-
|
|
63440
|
-
|
|
63441
|
-
const previousValues = jsonPaths.flatMap((jp) => jsonPathGet(obj, jp));
|
|
63442
|
-
let totalUpdated = 0;
|
|
63443
|
-
for (const jp of jsonPaths) totalUpdated += jsonPathSet(obj, jp, version);
|
|
63444
|
-
if (totalUpdated === 0) return;
|
|
63445
|
-
let output = JSON.stringify(obj, null, indent);
|
|
63446
|
-
if (trailingNewline) output += "\n";
|
|
63447
|
-
(0, node_fs.writeFileSync)(filePath, output, "utf-8");
|
|
64787
|
+
const original = (0, node_fs.readFileSync)(filePath, "utf-8");
|
|
64788
|
+
const { content, previousValues, totalChanged } = VersionFiles.computeUpdate(original, jsonPaths, version);
|
|
64789
|
+
if (totalChanged === 0) return;
|
|
64790
|
+
(0, node_fs.writeFileSync)(filePath, content, "utf-8");
|
|
63448
64791
|
return {
|
|
63449
64792
|
filePath,
|
|
63450
64793
|
jsonPaths,
|
|
@@ -63453,6 +64796,83 @@ var VersionFiles = class VersionFiles {
|
|
|
63453
64796
|
};
|
|
63454
64797
|
}
|
|
63455
64798
|
/**
|
|
64799
|
+
* Compute the full update for a document without touching the filesystem:
|
|
64800
|
+
* the edited content, the previous values at every matched path, and how
|
|
64801
|
+
* many locations actually changed.
|
|
64802
|
+
*
|
|
64803
|
+
* @remarks
|
|
64804
|
+
* This is the single decision path shared by {@link VersionFiles.updateFile}
|
|
64805
|
+
* and the dry-run branches of the two process methods, so a preview reports
|
|
64806
|
+
* exactly the files a real run would write — including pending inserts of a
|
|
64807
|
+
* not-yet-existing wildcard-free leaf, and excluding same-value no-ops.
|
|
64808
|
+
*
|
|
64809
|
+
* @param original - Document text as read from disk
|
|
64810
|
+
* @param jsonPaths - JSONPath expressions to update
|
|
64811
|
+
* @param version - New version string
|
|
64812
|
+
* @returns The updated content, previous values, and changed-location count
|
|
64813
|
+
*/
|
|
64814
|
+
static computeUpdate(original, jsonPaths, version) {
|
|
64815
|
+
let content = original;
|
|
64816
|
+
const obj = runSync(parse$2(content));
|
|
64817
|
+
const previousValues = jsonPaths.flatMap((jp) => jsonPathGet(obj, jp));
|
|
64818
|
+
const indent = VersionFiles.detectIndent(content);
|
|
64819
|
+
const eol = content.includes("\r\n") ? "\r\n" : "\n";
|
|
64820
|
+
let totalChanged = 0;
|
|
64821
|
+
for (const jp of jsonPaths) {
|
|
64822
|
+
const segments = parseJsonPath(jp);
|
|
64823
|
+
if (segments.length === 0) continue;
|
|
64824
|
+
const hasWildcard = segments.some((segment) => segment.type === "wildcard");
|
|
64825
|
+
let concretePaths;
|
|
64826
|
+
if (hasWildcard) concretePaths = jsonPathResolve(obj, jp);
|
|
64827
|
+
else {
|
|
64828
|
+
const direct = segments.map((segment) => segment.type === "property" ? segment.key : segment.index);
|
|
64829
|
+
concretePaths = jsonPathResolve(obj, jp).length > 0 || typeof direct[direct.length - 1] === "string" ? [direct] : [];
|
|
64830
|
+
}
|
|
64831
|
+
for (const concretePath of concretePaths) {
|
|
64832
|
+
const updated = VersionFiles.applyVersionEdit(content, concretePath, version, indent, eol);
|
|
64833
|
+
if (updated !== void 0) {
|
|
64834
|
+
content = updated;
|
|
64835
|
+
totalChanged += 1;
|
|
64836
|
+
}
|
|
64837
|
+
}
|
|
64838
|
+
}
|
|
64839
|
+
return {
|
|
64840
|
+
content,
|
|
64841
|
+
previousValues,
|
|
64842
|
+
totalChanged
|
|
64843
|
+
};
|
|
64844
|
+
}
|
|
64845
|
+
/**
|
|
64846
|
+
* Compute the format-preserving edit for a single concrete path, returning
|
|
64847
|
+
* the updated document, or `undefined` when nothing changed.
|
|
64848
|
+
*
|
|
64849
|
+
* @remarks
|
|
64850
|
+
* Delegates to `jsonc-effect`'s {@link modify} + {@link applyEdits}
|
|
64851
|
+
* (requires `jsonc-effect >= 0.3.1`, whose edit spans touch only the target
|
|
64852
|
+
* value), so every other byte of the document is preserved. When the leaf
|
|
64853
|
+
* of a wildcard-free path does not exist, `modify` inserts the property
|
|
64854
|
+
* after the last sibling using the supplied formatting options — the only
|
|
64855
|
+
* case where the detected indent matters. A path whose parent is missing or
|
|
64856
|
+
* not an object cannot be navigated; the resulting modification error is
|
|
64857
|
+
* caught and reported as "no change" so the file is left alone.
|
|
64858
|
+
*
|
|
64859
|
+
* @param content - Current document text
|
|
64860
|
+
* @param concretePath - A wildcard-free `(string | number)[]` path
|
|
64861
|
+
* @param version - New version string
|
|
64862
|
+
* @param indentUnit - One indentation level, for inserted text
|
|
64863
|
+
* @param eol - End-of-line sequence, for inserted text
|
|
64864
|
+
* @returns The updated document, or `undefined` if the path was unchanged
|
|
64865
|
+
*/
|
|
64866
|
+
static applyVersionEdit(content, concretePath, version, indentUnit, eol) {
|
|
64867
|
+
const insertSpaces = !indentUnit.includes(" ");
|
|
64868
|
+
const program = modify(content, [...concretePath], version, { formattingOptions: {
|
|
64869
|
+
insertSpaces,
|
|
64870
|
+
tabSize: insertSpaces ? indentUnit.length : 1,
|
|
64871
|
+
eol
|
|
64872
|
+
} }).pipe(flatMap$2((edits) => applyEdits$1(content, edits)), map$5((updated) => updated === content ? void 0 : updated), catchTag("JsoncModificationError", () => succeed$3(void 0)));
|
|
64873
|
+
return runSync(program);
|
|
64874
|
+
}
|
|
64875
|
+
/**
|
|
63456
64876
|
* Orchestrate the full version file update flow.
|
|
63457
64877
|
*
|
|
63458
64878
|
* @remarks
|
|
@@ -63478,9 +64898,8 @@ var VersionFiles = class VersionFiles {
|
|
|
63478
64898
|
try {
|
|
63479
64899
|
if (dryRun) {
|
|
63480
64900
|
const content = (0, node_fs.readFileSync)(filePath, "utf-8");
|
|
63481
|
-
const
|
|
63482
|
-
|
|
63483
|
-
if (previousValues.length > 0) updates.push({
|
|
64901
|
+
const { previousValues, totalChanged } = VersionFiles.computeUpdate(content, jsonPaths, version);
|
|
64902
|
+
if (totalChanged > 0) updates.push({
|
|
63484
64903
|
filePath,
|
|
63485
64904
|
jsonPaths,
|
|
63486
64905
|
version,
|
|
@@ -63524,9 +64943,8 @@ var VersionFiles = class VersionFiles {
|
|
|
63524
64943
|
for (const filePath of vf.matchedFiles) try {
|
|
63525
64944
|
if (dryRun) {
|
|
63526
64945
|
const content = (0, node_fs.readFileSync)(filePath, "utf-8");
|
|
63527
|
-
const
|
|
63528
|
-
|
|
63529
|
-
if (previousValues.length > 0) updates.push({
|
|
64946
|
+
const { previousValues, totalChanged } = VersionFiles.computeUpdate(content, jsonPaths, scope.version);
|
|
64947
|
+
if (totalChanged > 0) updates.push({
|
|
63530
64948
|
filePath,
|
|
63531
64949
|
jsonPaths,
|
|
63532
64950
|
version: scope.version,
|
|
@@ -77235,14 +78653,6 @@ const SilkChangesetsRules = [
|
|
|
77235
78653
|
];
|
|
77236
78654
|
//#endregion
|
|
77237
78655
|
//#region src/index.ts
|
|
77238
|
-
/**
|
|
77239
|
-
* The silk changelog generator as a standalone installable package — the
|
|
77240
|
-
* canonical `changelog` id for `.changeset/config.json`. Thin re-export of
|
|
77241
|
-
* `@savvy-web/silk-effects`' changelog functions; silk-effects remains the
|
|
77242
|
-
* single source of truth.
|
|
77243
|
-
*
|
|
77244
|
-
* @packageDocumentation
|
|
77245
|
-
*/
|
|
77246
78656
|
const changelogFunctions = (/* @__PURE__ */ __exportAll({
|
|
77247
78657
|
AggregateDependencyTablesPlugin: () => AggregateDependencyTablesPlugin,
|
|
77248
78658
|
AppliedReleaseEntrySchema: () => AppliedReleaseEntrySchema,
|