@savvy-web/silk 4.0.4 → 4.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/changesets-changelog.cjs +49 -34
- package/changesets-changelog.js +54 -36
- package/changesets-markdownlint.cjs +49 -34
- package/changesets-markdownlint.js +54 -36
- package/package.json +4 -4
package/changesets-changelog.cjs
CHANGED
|
@@ -67,14 +67,14 @@ let semver_ranges_valid_js = require("semver/ranges/valid.js");
|
|
|
67
67
|
semver_ranges_valid_js = __toESM(semver_ranges_valid_js, 1);
|
|
68
68
|
let semver_functions_satisfies_js = require("semver/functions/satisfies.js");
|
|
69
69
|
semver_functions_satisfies_js = __toESM(semver_functions_satisfies_js, 1);
|
|
70
|
+
let semver_functions_inc_js = require("semver/functions/inc.js");
|
|
71
|
+
semver_functions_inc_js = __toESM(semver_functions_inc_js, 1);
|
|
70
72
|
let semver_functions_prerelease_js = require("semver/functions/prerelease.js");
|
|
71
73
|
semver_functions_prerelease_js = __toESM(semver_functions_prerelease_js, 1);
|
|
72
74
|
let semver_functions_parse_js = require("semver/functions/parse.js");
|
|
73
75
|
semver_functions_parse_js = __toESM(semver_functions_parse_js, 1);
|
|
74
76
|
let semver_functions_gt_js = require("semver/functions/gt.js");
|
|
75
77
|
semver_functions_gt_js = __toESM(semver_functions_gt_js, 1);
|
|
76
|
-
let semver_functions_inc_js = require("semver/functions/inc.js");
|
|
77
|
-
semver_functions_inc_js = __toESM(semver_functions_inc_js, 1);
|
|
78
78
|
//#region ../silk-core/dist/dev/pkg/errors/ChangesetConfigError.js
|
|
79
79
|
/**
|
|
80
80
|
* Raised when the `.changeset/config.json` file cannot be read or decoded.
|
|
@@ -49314,7 +49314,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
|
49314
49314
|
return !packageJson.version;
|
|
49315
49315
|
}
|
|
49316
49316
|
//#endregion
|
|
49317
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.
|
|
49317
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.1/node_modules/@changesets/config/dist/index.mjs
|
|
49318
49318
|
const DEFAULT_CONFIG = {
|
|
49319
49319
|
lang: void 0,
|
|
49320
49320
|
message: void 0,
|
|
@@ -50109,13 +50109,11 @@ const noDuplicateFixedPackages = ({ config, errors }) => {
|
|
|
50109
50109
|
if (config.fixed.length === 0) return;
|
|
50110
50110
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50111
50111
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50112
|
-
for (const fixedGroup of config.fixed) {
|
|
50113
|
-
|
|
50114
|
-
|
|
50115
|
-
foundNames.add(name);
|
|
50116
|
-
}
|
|
50117
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50112
|
+
for (const fixedGroup of config.fixed) for (const name of fixedGroup) {
|
|
50113
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50114
|
+
foundNames.add(name);
|
|
50118
50115
|
}
|
|
50116
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50119
50117
|
};
|
|
50120
50118
|
const linkedGroupsExist = ({ config, writtenConfig, packageNames, warnings }) => {
|
|
50121
50119
|
if (config.linked.length === 0) return;
|
|
@@ -50125,13 +50123,11 @@ const noDuplicateLinkedPackages = ({ config, errors }) => {
|
|
|
50125
50123
|
if (config.linked.length === 0) return;
|
|
50126
50124
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50127
50125
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50128
|
-
for (const linkedGroup of config.linked) {
|
|
50129
|
-
|
|
50130
|
-
|
|
50131
|
-
foundNames.add(name);
|
|
50132
|
-
}
|
|
50133
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50126
|
+
for (const linkedGroup of config.linked) for (const name of linkedGroup) {
|
|
50127
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50128
|
+
foundNames.add(name);
|
|
50134
50129
|
}
|
|
50130
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50135
50131
|
};
|
|
50136
50132
|
const noFixedAndLinkedPackages = ({ config, errors }) => {
|
|
50137
50133
|
if (config.fixed.length === 0 || config.linked.length === 0) return;
|
|
@@ -50228,7 +50224,7 @@ async function readConfig(cwd, packages) {
|
|
|
50228
50224
|
packages ??= await getPackages(cwd);
|
|
50229
50225
|
return validateConfig(JSON.parse(await node_fs_promises.readFile(node_path.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
50230
50226
|
}
|
|
50231
|
-
var version = "4.0.
|
|
50227
|
+
var version = "4.0.1";
|
|
50232
50228
|
const defaultConfig = normalizeWrittenConfig({
|
|
50233
50229
|
packageNames: [],
|
|
50234
50230
|
writtenConfig: parse(WrittenConfigSchema, {
|
|
@@ -53678,7 +53674,7 @@ function applyEdits(text, edits) {
|
|
|
53678
53674
|
return text;
|
|
53679
53675
|
}
|
|
53680
53676
|
//#endregion
|
|
53681
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.
|
|
53677
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.1/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
53682
53678
|
/**
|
|
53683
53679
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
53684
53680
|
* must exist in the JSON for this implementation.
|
|
@@ -53822,8 +53818,8 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
53822
53818
|
for (const depType of DEPENDENCY_TYPES) {
|
|
53823
53819
|
const deps = packageJson[depType];
|
|
53824
53820
|
if (deps) for (const release of versionsToUpdate) {
|
|
53825
|
-
|
|
53826
|
-
|
|
53821
|
+
const { name, newVersion, type } = release;
|
|
53822
|
+
if (newVersion == null || type === "none") continue;
|
|
53827
53823
|
let depCurrentVersion = deps[name];
|
|
53828
53824
|
if (!depCurrentVersion || depCurrentVersion.startsWith("file:") || depCurrentVersion.startsWith("link:") || !shouldUpdateDependencyBasedOnConfig(cwd, release, {
|
|
53829
53825
|
depVersionRange: depCurrentVersion,
|
|
@@ -53840,7 +53836,7 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
53840
53836
|
depCurrentVersion = workspaceDepVersion;
|
|
53841
53837
|
}
|
|
53842
53838
|
if (new semver_classes_range_js.default(depCurrentVersion).range !== "" || (0, semver_functions_prerelease_js.default)(newVersion) != null) {
|
|
53843
|
-
let newNewRange = snapshot ? newVersion :
|
|
53839
|
+
let newNewRange = snapshot ? newVersion : getNewDependencyRange(depCurrentVersion, newVersion, type);
|
|
53844
53840
|
if (usesWorkspaceRange) newNewRange = `workspace:${newNewRange}`;
|
|
53845
53841
|
pkgJsonEdits.push({
|
|
53846
53842
|
keys: [depType, name],
|
|
@@ -53851,6 +53847,20 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
53851
53847
|
}
|
|
53852
53848
|
return pkgJsonEdits;
|
|
53853
53849
|
}
|
|
53850
|
+
function getNewDependencyRange(versionRange, newVersion, releaseType) {
|
|
53851
|
+
const comparatorSets = new semver_classes_range_js.default(versionRange).set;
|
|
53852
|
+
const comparators = comparatorSets.length === 1 ? comparatorSets[0] : [];
|
|
53853
|
+
if (comparators.length === 2 && versionRange.includes(">") && versionRange.includes("<")) {
|
|
53854
|
+
const lowerBound = comparators.find(({ operator }) => operator.startsWith(">"));
|
|
53855
|
+
const upperBound = comparators.find(({ operator }) => operator.startsWith("<"));
|
|
53856
|
+
if (lowerBound && upperBound) {
|
|
53857
|
+
let newUpperBound = upperBound.value;
|
|
53858
|
+
if (!(0, semver_functions_satisfies_js.default)(newVersion, newUpperBound)) newUpperBound = `<${(0, semver_functions_inc_js.default)(newVersion, releaseType)}`;
|
|
53859
|
+
return comparators[0] === lowerBound ? `>=${newVersion} ${newUpperBound}` : `${newUpperBound} >=${newVersion}`;
|
|
53860
|
+
}
|
|
53861
|
+
}
|
|
53862
|
+
return `${getVersionRangeType(versionRange)}${newVersion}`;
|
|
53863
|
+
}
|
|
53854
53864
|
function getVersionRangeType(versionRange) {
|
|
53855
53865
|
if (versionRange.charAt(0) === "^") return "^";
|
|
53856
53866
|
if (versionRange.charAt(0) === "~") return "~";
|
|
@@ -53948,16 +53958,18 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
53948
53958
|
if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
|
|
53949
53959
|
ignore: config.ignore,
|
|
53950
53960
|
allowPrivatePackages: config.privatePackages.version
|
|
53951
|
-
})))
|
|
53952
|
-
|
|
53953
|
-
|
|
53954
|
-
|
|
53955
|
-
|
|
53956
|
-
|
|
53957
|
-
|
|
53958
|
-
|
|
53959
|
-
|
|
53960
|
-
|
|
53961
|
+
}))) {
|
|
53962
|
+
if (isPreChangesets) {
|
|
53963
|
+
const newChangesetPath = node_path.resolve(cwd, ".changeset", "pre", `${changeset.id}.md`);
|
|
53964
|
+
await node_fs_promises.rename(changesetPath, newChangesetPath);
|
|
53965
|
+
touchedFiles.push(changesetPath, newChangesetPath);
|
|
53966
|
+
} else {
|
|
53967
|
+
await node_fs_promises.rm(changesetPath, {
|
|
53968
|
+
recursive: true,
|
|
53969
|
+
force: true
|
|
53970
|
+
});
|
|
53971
|
+
touchedFiles.push(changesetPath);
|
|
53972
|
+
}
|
|
53961
53973
|
}
|
|
53962
53974
|
}
|
|
53963
53975
|
}));
|
|
@@ -54022,10 +54034,13 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
54022
54034
|
await node_fs_promises.writeFile(changelogPath, completelyNewChangelog);
|
|
54023
54035
|
return;
|
|
54024
54036
|
}
|
|
54025
|
-
const
|
|
54037
|
+
const firstVersionHeaderIndex = fileData.search(/^#{1,6}\s+\d+\.\d+/m);
|
|
54026
54038
|
let newChangelog;
|
|
54027
|
-
if (
|
|
54028
|
-
|
|
54039
|
+
if (firstVersionHeaderIndex >= 0) {
|
|
54040
|
+
const prefix = fileData.slice(0, firstVersionHeaderIndex);
|
|
54041
|
+
const suffix = fileData.slice(firstVersionHeaderIndex);
|
|
54042
|
+
newChangelog = prefix + templateString.trimStart() + "\n" + suffix;
|
|
54043
|
+
} else {
|
|
54029
54044
|
const index = fileData.indexOf("\n");
|
|
54030
54045
|
newChangelog = index === -1 ? fileData + templateString : fileData.slice(0, index) + templateString + fileData.slice(index + 1);
|
|
54031
54046
|
}
|
|
@@ -54507,7 +54522,7 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
54507
54522
|
return await Promise.all(changesetContents);
|
|
54508
54523
|
}
|
|
54509
54524
|
//#endregion
|
|
54510
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.
|
|
54525
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.2/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
54511
54526
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
54512
54527
|
const packages = await getPackages(cwd);
|
|
54513
54528
|
const configResult = await readConfig(packages.rootDir, packages);
|
package/changesets-changelog.js
CHANGED
|
@@ -28,10 +28,10 @@ import * as assert from "node:assert";
|
|
|
28
28
|
import * as v8 from "node:v8";
|
|
29
29
|
import validRange from "semver/ranges/valid.js";
|
|
30
30
|
import semverSatisfies from "semver/functions/satisfies.js";
|
|
31
|
+
import semverInc from "semver/functions/inc.js";
|
|
31
32
|
import semverPrerelease from "semver/functions/prerelease.js";
|
|
32
33
|
import semverParse from "semver/functions/parse.js";
|
|
33
34
|
import semverGt from "semver/functions/gt.js";
|
|
34
|
-
import semverInc from "semver/functions/inc.js";
|
|
35
35
|
|
|
36
36
|
//#region \0rolldown/runtime.js
|
|
37
37
|
var __create = Object.create;
|
|
@@ -49830,7 +49830,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
|
49830
49830
|
}
|
|
49831
49831
|
|
|
49832
49832
|
//#endregion
|
|
49833
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.
|
|
49833
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.1/node_modules/@changesets/config/dist/index.mjs
|
|
49834
49834
|
const DEFAULT_CONFIG = {
|
|
49835
49835
|
lang: void 0,
|
|
49836
49836
|
message: void 0,
|
|
@@ -50625,13 +50625,11 @@ const noDuplicateFixedPackages = ({ config, errors }) => {
|
|
|
50625
50625
|
if (config.fixed.length === 0) return;
|
|
50626
50626
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50627
50627
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50628
|
-
for (const fixedGroup of config.fixed) {
|
|
50629
|
-
|
|
50630
|
-
|
|
50631
|
-
foundNames.add(name);
|
|
50632
|
-
}
|
|
50633
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50628
|
+
for (const fixedGroup of config.fixed) for (const name of fixedGroup) {
|
|
50629
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50630
|
+
foundNames.add(name);
|
|
50634
50631
|
}
|
|
50632
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50635
50633
|
};
|
|
50636
50634
|
const linkedGroupsExist = ({ config, writtenConfig, packageNames, warnings }) => {
|
|
50637
50635
|
if (config.linked.length === 0) return;
|
|
@@ -50641,13 +50639,11 @@ const noDuplicateLinkedPackages = ({ config, errors }) => {
|
|
|
50641
50639
|
if (config.linked.length === 0) return;
|
|
50642
50640
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50643
50641
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50644
|
-
for (const linkedGroup of config.linked) {
|
|
50645
|
-
|
|
50646
|
-
|
|
50647
|
-
foundNames.add(name);
|
|
50648
|
-
}
|
|
50649
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50642
|
+
for (const linkedGroup of config.linked) for (const name of linkedGroup) {
|
|
50643
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50644
|
+
foundNames.add(name);
|
|
50650
50645
|
}
|
|
50646
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50651
50647
|
};
|
|
50652
50648
|
const noFixedAndLinkedPackages = ({ config, errors }) => {
|
|
50653
50649
|
if (config.fixed.length === 0 || config.linked.length === 0) return;
|
|
@@ -50744,7 +50740,7 @@ async function readConfig(cwd, packages) {
|
|
|
50744
50740
|
packages ??= await getPackages(cwd);
|
|
50745
50741
|
return validateConfig(JSON.parse(await fs$1.readFile(path$1.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
50746
50742
|
}
|
|
50747
|
-
var version = "4.0.
|
|
50743
|
+
var version = "4.0.1";
|
|
50748
50744
|
const defaultWrittenConfig = {
|
|
50749
50745
|
["$schema"]: `https://unpkg.com/@changesets/config@${version}/schema.json`,
|
|
50750
50746
|
baseBranch: "main",
|
|
@@ -54227,7 +54223,7 @@ function applyEdits(text, edits) {
|
|
|
54227
54223
|
}
|
|
54228
54224
|
|
|
54229
54225
|
//#endregion
|
|
54230
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.
|
|
54226
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.1/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
54231
54227
|
/**
|
|
54232
54228
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
54233
54229
|
* must exist in the JSON for this implementation.
|
|
@@ -54244,7 +54240,7 @@ function editJson(json, operations) {
|
|
|
54244
54240
|
const error = errors[0];
|
|
54245
54241
|
throw new Error(`Failed to parse JSON at offset ${error.offset}: ${printParseErrorCode(error.error)}`);
|
|
54246
54242
|
}
|
|
54247
|
-
|
|
54243
|
+
const edits = operations.map((op) => {
|
|
54248
54244
|
const valueNode = getValueNode(parsed, op.keys);
|
|
54249
54245
|
if (!valueNode) throw new Error(`Key path "${op.keys.join(".")}" not found in JSON`);
|
|
54250
54246
|
return {
|
|
@@ -54252,7 +54248,8 @@ function editJson(json, operations) {
|
|
|
54252
54248
|
offset: valueNode.offset,
|
|
54253
54249
|
length: valueNode.length
|
|
54254
54250
|
};
|
|
54255
|
-
})
|
|
54251
|
+
});
|
|
54252
|
+
return applyEdits(json, edits);
|
|
54256
54253
|
}
|
|
54257
54254
|
function getValueNode(root, keys) {
|
|
54258
54255
|
let node = root;
|
|
@@ -54371,8 +54368,8 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
54371
54368
|
for (const depType of DEPENDENCY_TYPES) {
|
|
54372
54369
|
const deps = packageJson[depType];
|
|
54373
54370
|
if (deps) for (const release of versionsToUpdate) {
|
|
54374
|
-
|
|
54375
|
-
|
|
54371
|
+
const { name, newVersion, type } = release;
|
|
54372
|
+
if (newVersion == null || type === "none") continue;
|
|
54376
54373
|
let depCurrentVersion = deps[name];
|
|
54377
54374
|
if (!depCurrentVersion || depCurrentVersion.startsWith("file:") || depCurrentVersion.startsWith("link:") || !shouldUpdateDependencyBasedOnConfig(cwd, release, {
|
|
54378
54375
|
depVersionRange: depCurrentVersion,
|
|
@@ -54389,7 +54386,7 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
54389
54386
|
depCurrentVersion = workspaceDepVersion;
|
|
54390
54387
|
}
|
|
54391
54388
|
if (new Range(depCurrentVersion).range !== "" || semverPrerelease(newVersion) != null) {
|
|
54392
|
-
let newNewRange = snapshot ? newVersion :
|
|
54389
|
+
let newNewRange = snapshot ? newVersion : getNewDependencyRange(depCurrentVersion, newVersion, type);
|
|
54393
54390
|
if (usesWorkspaceRange) newNewRange = `workspace:${newNewRange}`;
|
|
54394
54391
|
pkgJsonEdits.push({
|
|
54395
54392
|
keys: [depType, name],
|
|
@@ -54400,6 +54397,20 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
54400
54397
|
}
|
|
54401
54398
|
return pkgJsonEdits;
|
|
54402
54399
|
}
|
|
54400
|
+
function getNewDependencyRange(versionRange, newVersion, releaseType) {
|
|
54401
|
+
const comparatorSets = new Range(versionRange).set;
|
|
54402
|
+
const comparators = comparatorSets.length === 1 ? comparatorSets[0] : [];
|
|
54403
|
+
if (comparators.length === 2 && versionRange.includes(">") && versionRange.includes("<")) {
|
|
54404
|
+
const lowerBound = comparators.find(({ operator }) => operator.startsWith(">"));
|
|
54405
|
+
const upperBound = comparators.find(({ operator }) => operator.startsWith("<"));
|
|
54406
|
+
if (lowerBound && upperBound) {
|
|
54407
|
+
let newUpperBound = upperBound.value;
|
|
54408
|
+
if (!semverSatisfies(newVersion, newUpperBound)) newUpperBound = `<${semverInc(newVersion, releaseType)}`;
|
|
54409
|
+
return comparators[0] === lowerBound ? `>=${newVersion} ${newUpperBound}` : `${newUpperBound} >=${newVersion}`;
|
|
54410
|
+
}
|
|
54411
|
+
}
|
|
54412
|
+
return `${getVersionRangeType(versionRange)}${newVersion}`;
|
|
54413
|
+
}
|
|
54403
54414
|
function getVersionRangeType(versionRange) {
|
|
54404
54415
|
if (versionRange.charAt(0) === "^") return "^";
|
|
54405
54416
|
if (versionRange.charAt(0) === "~") return "~";
|
|
@@ -54498,16 +54509,18 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
54498
54509
|
if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
|
|
54499
54510
|
ignore: config.ignore,
|
|
54500
54511
|
allowPrivatePackages: config.privatePackages.version
|
|
54501
|
-
})))
|
|
54502
|
-
|
|
54503
|
-
|
|
54504
|
-
|
|
54505
|
-
|
|
54506
|
-
|
|
54507
|
-
|
|
54508
|
-
|
|
54509
|
-
|
|
54510
|
-
|
|
54512
|
+
}))) {
|
|
54513
|
+
if (isPreChangesets) {
|
|
54514
|
+
const newChangesetPath = path$1.resolve(cwd, ".changeset", "pre", `${changeset.id}.md`);
|
|
54515
|
+
await fs$1.rename(changesetPath, newChangesetPath);
|
|
54516
|
+
touchedFiles.push(changesetPath, newChangesetPath);
|
|
54517
|
+
} else {
|
|
54518
|
+
await fs$1.rm(changesetPath, {
|
|
54519
|
+
recursive: true,
|
|
54520
|
+
force: true
|
|
54521
|
+
});
|
|
54522
|
+
touchedFiles.push(changesetPath);
|
|
54523
|
+
}
|
|
54511
54524
|
}
|
|
54512
54525
|
}
|
|
54513
54526
|
}));
|
|
@@ -54572,10 +54585,13 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
54572
54585
|
await fs$1.writeFile(changelogPath, completelyNewChangelog);
|
|
54573
54586
|
return;
|
|
54574
54587
|
}
|
|
54575
|
-
const
|
|
54588
|
+
const firstVersionHeaderIndex = fileData.search(/^#{1,6}\s+\d+\.\d+/m);
|
|
54576
54589
|
let newChangelog;
|
|
54577
|
-
if (
|
|
54578
|
-
|
|
54590
|
+
if (firstVersionHeaderIndex >= 0) {
|
|
54591
|
+
const prefix = fileData.slice(0, firstVersionHeaderIndex);
|
|
54592
|
+
const suffix = fileData.slice(firstVersionHeaderIndex);
|
|
54593
|
+
newChangelog = prefix + templateString.trimStart() + "\n" + suffix;
|
|
54594
|
+
} else {
|
|
54579
54595
|
const index = fileData.indexOf("\n");
|
|
54580
54596
|
newChangelog = index === -1 ? fileData + templateString : fileData.slice(0, index) + templateString + fileData.slice(index + 1);
|
|
54581
54597
|
}
|
|
@@ -55062,7 +55078,7 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
55062
55078
|
}
|
|
55063
55079
|
|
|
55064
55080
|
//#endregion
|
|
55065
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.
|
|
55081
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.2/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
55066
55082
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
55067
55083
|
const packages = await getPackages(cwd);
|
|
55068
55084
|
const configResult = await readConfig(packages.rootDir, packages);
|
|
@@ -55071,7 +55087,9 @@ async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
|
55071
55087
|
...configResult.config,
|
|
55072
55088
|
...passedConfig
|
|
55073
55089
|
} : configResult.config;
|
|
55074
|
-
|
|
55090
|
+
const changesets = await readChangesets(packages.rootDir, sinceRef);
|
|
55091
|
+
const preState = await readPreState(packages.rootDir);
|
|
55092
|
+
return assembleReleasePlan(changesets, packages, config, preState);
|
|
55075
55093
|
}
|
|
55076
55094
|
|
|
55077
55095
|
//#endregion
|
|
@@ -71,14 +71,14 @@ let semver_ranges_valid_js = require("semver/ranges/valid.js");
|
|
|
71
71
|
semver_ranges_valid_js = __toESM(semver_ranges_valid_js, 1);
|
|
72
72
|
let semver_functions_satisfies_js = require("semver/functions/satisfies.js");
|
|
73
73
|
semver_functions_satisfies_js = __toESM(semver_functions_satisfies_js, 1);
|
|
74
|
+
let semver_functions_inc_js = require("semver/functions/inc.js");
|
|
75
|
+
semver_functions_inc_js = __toESM(semver_functions_inc_js, 1);
|
|
74
76
|
let semver_functions_prerelease_js = require("semver/functions/prerelease.js");
|
|
75
77
|
semver_functions_prerelease_js = __toESM(semver_functions_prerelease_js, 1);
|
|
76
78
|
let semver_functions_parse_js = require("semver/functions/parse.js");
|
|
77
79
|
semver_functions_parse_js = __toESM(semver_functions_parse_js, 1);
|
|
78
80
|
let semver_functions_gt_js = require("semver/functions/gt.js");
|
|
79
81
|
semver_functions_gt_js = __toESM(semver_functions_gt_js, 1);
|
|
80
|
-
let semver_functions_inc_js = require("semver/functions/inc.js");
|
|
81
|
-
semver_functions_inc_js = __toESM(semver_functions_inc_js, 1);
|
|
82
82
|
//#region ../silk-core/dist/dev/pkg/errors/ChangesetConfigError.js
|
|
83
83
|
/**
|
|
84
84
|
* Raised when the `.changeset/config.json` file cannot be read or decoded.
|
|
@@ -49318,7 +49318,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
|
49318
49318
|
return !packageJson.version;
|
|
49319
49319
|
}
|
|
49320
49320
|
//#endregion
|
|
49321
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.
|
|
49321
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.1/node_modules/@changesets/config/dist/index.mjs
|
|
49322
49322
|
const DEFAULT_CONFIG = {
|
|
49323
49323
|
lang: void 0,
|
|
49324
49324
|
message: void 0,
|
|
@@ -50113,13 +50113,11 @@ const noDuplicateFixedPackages = ({ config, errors }) => {
|
|
|
50113
50113
|
if (config.fixed.length === 0) return;
|
|
50114
50114
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50115
50115
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50116
|
-
for (const fixedGroup of config.fixed) {
|
|
50117
|
-
|
|
50118
|
-
|
|
50119
|
-
foundNames.add(name);
|
|
50120
|
-
}
|
|
50121
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50116
|
+
for (const fixedGroup of config.fixed) for (const name of fixedGroup) {
|
|
50117
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50118
|
+
foundNames.add(name);
|
|
50122
50119
|
}
|
|
50120
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50123
50121
|
};
|
|
50124
50122
|
const linkedGroupsExist = ({ config, writtenConfig, packageNames, warnings }) => {
|
|
50125
50123
|
if (config.linked.length === 0) return;
|
|
@@ -50129,13 +50127,11 @@ const noDuplicateLinkedPackages = ({ config, errors }) => {
|
|
|
50129
50127
|
if (config.linked.length === 0) return;
|
|
50130
50128
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50131
50129
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50132
|
-
for (const linkedGroup of config.linked) {
|
|
50133
|
-
|
|
50134
|
-
|
|
50135
|
-
foundNames.add(name);
|
|
50136
|
-
}
|
|
50137
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50130
|
+
for (const linkedGroup of config.linked) for (const name of linkedGroup) {
|
|
50131
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50132
|
+
foundNames.add(name);
|
|
50138
50133
|
}
|
|
50134
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50139
50135
|
};
|
|
50140
50136
|
const noFixedAndLinkedPackages = ({ config, errors }) => {
|
|
50141
50137
|
if (config.fixed.length === 0 || config.linked.length === 0) return;
|
|
@@ -50232,7 +50228,7 @@ async function readConfig(cwd, packages) {
|
|
|
50232
50228
|
packages ??= await getPackages(cwd);
|
|
50233
50229
|
return validateConfig(JSON.parse(await node_fs_promises.readFile(node_path.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
50234
50230
|
}
|
|
50235
|
-
var version = "4.0.
|
|
50231
|
+
var version = "4.0.1";
|
|
50236
50232
|
const defaultConfig = normalizeWrittenConfig({
|
|
50237
50233
|
packageNames: [],
|
|
50238
50234
|
writtenConfig: parse(WrittenConfigSchema, {
|
|
@@ -53682,7 +53678,7 @@ function applyEdits(text, edits) {
|
|
|
53682
53678
|
return text;
|
|
53683
53679
|
}
|
|
53684
53680
|
//#endregion
|
|
53685
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.
|
|
53681
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.1/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
53686
53682
|
/**
|
|
53687
53683
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
53688
53684
|
* must exist in the JSON for this implementation.
|
|
@@ -53826,8 +53822,8 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
53826
53822
|
for (const depType of DEPENDENCY_TYPES) {
|
|
53827
53823
|
const deps = packageJson[depType];
|
|
53828
53824
|
if (deps) for (const release of versionsToUpdate) {
|
|
53829
|
-
|
|
53830
|
-
|
|
53825
|
+
const { name, newVersion, type } = release;
|
|
53826
|
+
if (newVersion == null || type === "none") continue;
|
|
53831
53827
|
let depCurrentVersion = deps[name];
|
|
53832
53828
|
if (!depCurrentVersion || depCurrentVersion.startsWith("file:") || depCurrentVersion.startsWith("link:") || !shouldUpdateDependencyBasedOnConfig(cwd, release, {
|
|
53833
53829
|
depVersionRange: depCurrentVersion,
|
|
@@ -53844,7 +53840,7 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
53844
53840
|
depCurrentVersion = workspaceDepVersion;
|
|
53845
53841
|
}
|
|
53846
53842
|
if (new semver_classes_range_js.default(depCurrentVersion).range !== "" || (0, semver_functions_prerelease_js.default)(newVersion) != null) {
|
|
53847
|
-
let newNewRange = snapshot ? newVersion :
|
|
53843
|
+
let newNewRange = snapshot ? newVersion : getNewDependencyRange(depCurrentVersion, newVersion, type);
|
|
53848
53844
|
if (usesWorkspaceRange) newNewRange = `workspace:${newNewRange}`;
|
|
53849
53845
|
pkgJsonEdits.push({
|
|
53850
53846
|
keys: [depType, name],
|
|
@@ -53855,6 +53851,20 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
53855
53851
|
}
|
|
53856
53852
|
return pkgJsonEdits;
|
|
53857
53853
|
}
|
|
53854
|
+
function getNewDependencyRange(versionRange, newVersion, releaseType) {
|
|
53855
|
+
const comparatorSets = new semver_classes_range_js.default(versionRange).set;
|
|
53856
|
+
const comparators = comparatorSets.length === 1 ? comparatorSets[0] : [];
|
|
53857
|
+
if (comparators.length === 2 && versionRange.includes(">") && versionRange.includes("<")) {
|
|
53858
|
+
const lowerBound = comparators.find(({ operator }) => operator.startsWith(">"));
|
|
53859
|
+
const upperBound = comparators.find(({ operator }) => operator.startsWith("<"));
|
|
53860
|
+
if (lowerBound && upperBound) {
|
|
53861
|
+
let newUpperBound = upperBound.value;
|
|
53862
|
+
if (!(0, semver_functions_satisfies_js.default)(newVersion, newUpperBound)) newUpperBound = `<${(0, semver_functions_inc_js.default)(newVersion, releaseType)}`;
|
|
53863
|
+
return comparators[0] === lowerBound ? `>=${newVersion} ${newUpperBound}` : `${newUpperBound} >=${newVersion}`;
|
|
53864
|
+
}
|
|
53865
|
+
}
|
|
53866
|
+
return `${getVersionRangeType(versionRange)}${newVersion}`;
|
|
53867
|
+
}
|
|
53858
53868
|
function getVersionRangeType(versionRange) {
|
|
53859
53869
|
if (versionRange.charAt(0) === "^") return "^";
|
|
53860
53870
|
if (versionRange.charAt(0) === "~") return "~";
|
|
@@ -53952,16 +53962,18 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
53952
53962
|
if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
|
|
53953
53963
|
ignore: config.ignore,
|
|
53954
53964
|
allowPrivatePackages: config.privatePackages.version
|
|
53955
|
-
})))
|
|
53956
|
-
|
|
53957
|
-
|
|
53958
|
-
|
|
53959
|
-
|
|
53960
|
-
|
|
53961
|
-
|
|
53962
|
-
|
|
53963
|
-
|
|
53964
|
-
|
|
53965
|
+
}))) {
|
|
53966
|
+
if (isPreChangesets) {
|
|
53967
|
+
const newChangesetPath = node_path.resolve(cwd, ".changeset", "pre", `${changeset.id}.md`);
|
|
53968
|
+
await node_fs_promises.rename(changesetPath, newChangesetPath);
|
|
53969
|
+
touchedFiles.push(changesetPath, newChangesetPath);
|
|
53970
|
+
} else {
|
|
53971
|
+
await node_fs_promises.rm(changesetPath, {
|
|
53972
|
+
recursive: true,
|
|
53973
|
+
force: true
|
|
53974
|
+
});
|
|
53975
|
+
touchedFiles.push(changesetPath);
|
|
53976
|
+
}
|
|
53965
53977
|
}
|
|
53966
53978
|
}
|
|
53967
53979
|
}));
|
|
@@ -54026,10 +54038,13 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
54026
54038
|
await node_fs_promises.writeFile(changelogPath, completelyNewChangelog);
|
|
54027
54039
|
return;
|
|
54028
54040
|
}
|
|
54029
|
-
const
|
|
54041
|
+
const firstVersionHeaderIndex = fileData.search(/^#{1,6}\s+\d+\.\d+/m);
|
|
54030
54042
|
let newChangelog;
|
|
54031
|
-
if (
|
|
54032
|
-
|
|
54043
|
+
if (firstVersionHeaderIndex >= 0) {
|
|
54044
|
+
const prefix = fileData.slice(0, firstVersionHeaderIndex);
|
|
54045
|
+
const suffix = fileData.slice(firstVersionHeaderIndex);
|
|
54046
|
+
newChangelog = prefix + templateString.trimStart() + "\n" + suffix;
|
|
54047
|
+
} else {
|
|
54033
54048
|
const index = fileData.indexOf("\n");
|
|
54034
54049
|
newChangelog = index === -1 ? fileData + templateString : fileData.slice(0, index) + templateString + fileData.slice(index + 1);
|
|
54035
54050
|
}
|
|
@@ -54511,7 +54526,7 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
54511
54526
|
return await Promise.all(changesetContents);
|
|
54512
54527
|
}
|
|
54513
54528
|
//#endregion
|
|
54514
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.
|
|
54529
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.2/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
54515
54530
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
54516
54531
|
const packages = await getPackages(cwd);
|
|
54517
54532
|
const configResult = await readConfig(packages.rootDir, packages);
|
|
@@ -28,10 +28,10 @@ import * as assert from "node:assert";
|
|
|
28
28
|
import * as v8 from "node:v8";
|
|
29
29
|
import validRange from "semver/ranges/valid.js";
|
|
30
30
|
import semverSatisfies from "semver/functions/satisfies.js";
|
|
31
|
+
import semverInc from "semver/functions/inc.js";
|
|
31
32
|
import semverPrerelease from "semver/functions/prerelease.js";
|
|
32
33
|
import semverParse from "semver/functions/parse.js";
|
|
33
34
|
import semverGt from "semver/functions/gt.js";
|
|
34
|
-
import semverInc from "semver/functions/inc.js";
|
|
35
35
|
|
|
36
36
|
//#region \0rolldown/runtime.js
|
|
37
37
|
var __create = Object.create;
|
|
@@ -49830,7 +49830,7 @@ function shouldSkipPackage({ packageJson }, { ignore, allowPrivatePackages }) {
|
|
|
49830
49830
|
}
|
|
49831
49831
|
|
|
49832
49832
|
//#endregion
|
|
49833
|
-
//#region ../../node_modules/.pnpm/@changesets+config@4.0.
|
|
49833
|
+
//#region ../../node_modules/.pnpm/@changesets+config@4.0.1/node_modules/@changesets/config/dist/index.mjs
|
|
49834
49834
|
const DEFAULT_CONFIG = {
|
|
49835
49835
|
lang: void 0,
|
|
49836
49836
|
message: void 0,
|
|
@@ -50625,13 +50625,11 @@ const noDuplicateFixedPackages = ({ config, errors }) => {
|
|
|
50625
50625
|
if (config.fixed.length === 0) return;
|
|
50626
50626
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50627
50627
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50628
|
-
for (const fixedGroup of config.fixed) {
|
|
50629
|
-
|
|
50630
|
-
|
|
50631
|
-
foundNames.add(name);
|
|
50632
|
-
}
|
|
50633
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50628
|
+
for (const fixedGroup of config.fixed) for (const name of fixedGroup) {
|
|
50629
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50630
|
+
foundNames.add(name);
|
|
50634
50631
|
}
|
|
50632
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `fixed: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of fixed packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50635
50633
|
};
|
|
50636
50634
|
const linkedGroupsExist = ({ config, writtenConfig, packageNames, warnings }) => {
|
|
50637
50635
|
if (config.linked.length === 0) return;
|
|
@@ -50641,13 +50639,11 @@ const noDuplicateLinkedPackages = ({ config, errors }) => {
|
|
|
50641
50639
|
if (config.linked.length === 0) return;
|
|
50642
50640
|
const foundNames = /* @__PURE__ */ new Set();
|
|
50643
50641
|
const duplicatedNames = /* @__PURE__ */ new Set();
|
|
50644
|
-
for (const linkedGroup of config.linked) {
|
|
50645
|
-
|
|
50646
|
-
|
|
50647
|
-
foundNames.add(name);
|
|
50648
|
-
}
|
|
50649
|
-
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50642
|
+
for (const linkedGroup of config.linked) for (const name of linkedGroup) {
|
|
50643
|
+
if (foundNames.has(name)) duplicatedNames.add(name);
|
|
50644
|
+
foundNames.add(name);
|
|
50650
50645
|
}
|
|
50646
|
+
errors.push(...Array.from(duplicatedNames, (pkgOrGlob) => `linked: Invalid group: The package or glob "${pkgOrGlob}" is defined in multiple groups of linked packages. Packages can only be belong to a single group. ${picomatchNote}`));
|
|
50651
50647
|
};
|
|
50652
50648
|
const noFixedAndLinkedPackages = ({ config, errors }) => {
|
|
50653
50649
|
if (config.fixed.length === 0 || config.linked.length === 0) return;
|
|
@@ -50744,7 +50740,7 @@ async function readConfig(cwd, packages) {
|
|
|
50744
50740
|
packages ??= await getPackages(cwd);
|
|
50745
50741
|
return validateConfig(JSON.parse(await fs$1.readFile(path$1.join(packages.rootDir, ".changeset", "config.json"), "utf8")), packages);
|
|
50746
50742
|
}
|
|
50747
|
-
var version = "4.0.
|
|
50743
|
+
var version = "4.0.1";
|
|
50748
50744
|
const defaultWrittenConfig = {
|
|
50749
50745
|
["$schema"]: `https://unpkg.com/@changesets/config@${version}/schema.json`,
|
|
50750
50746
|
baseBranch: "main",
|
|
@@ -54227,7 +54223,7 @@ function applyEdits(text, edits) {
|
|
|
54227
54223
|
}
|
|
54228
54224
|
|
|
54229
54225
|
//#endregion
|
|
54230
|
-
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.
|
|
54226
|
+
//#region ../../node_modules/.pnpm/@changesets+apply-release-plan@8.1.1/node_modules/@changesets/apply-release-plan/dist/index.mjs
|
|
54231
54227
|
/**
|
|
54232
54228
|
* A simple JSON editing utility that preserves formatting. They specified operation keys
|
|
54233
54229
|
* must exist in the JSON for this implementation.
|
|
@@ -54244,7 +54240,7 @@ function editJson(json, operations) {
|
|
|
54244
54240
|
const error = errors[0];
|
|
54245
54241
|
throw new Error(`Failed to parse JSON at offset ${error.offset}: ${printParseErrorCode(error.error)}`);
|
|
54246
54242
|
}
|
|
54247
|
-
|
|
54243
|
+
const edits = operations.map((op) => {
|
|
54248
54244
|
const valueNode = getValueNode(parsed, op.keys);
|
|
54249
54245
|
if (!valueNode) throw new Error(`Key path "${op.keys.join(".")}" not found in JSON`);
|
|
54250
54246
|
return {
|
|
@@ -54252,7 +54248,8 @@ function editJson(json, operations) {
|
|
|
54252
54248
|
offset: valueNode.offset,
|
|
54253
54249
|
length: valueNode.length
|
|
54254
54250
|
};
|
|
54255
|
-
})
|
|
54251
|
+
});
|
|
54252
|
+
return applyEdits(json, edits);
|
|
54256
54253
|
}
|
|
54257
54254
|
function getValueNode(root, keys) {
|
|
54258
54255
|
let node = root;
|
|
@@ -54371,8 +54368,8 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
54371
54368
|
for (const depType of DEPENDENCY_TYPES) {
|
|
54372
54369
|
const deps = packageJson[depType];
|
|
54373
54370
|
if (deps) for (const release of versionsToUpdate) {
|
|
54374
|
-
|
|
54375
|
-
|
|
54371
|
+
const { name, newVersion, type } = release;
|
|
54372
|
+
if (newVersion == null || type === "none") continue;
|
|
54376
54373
|
let depCurrentVersion = deps[name];
|
|
54377
54374
|
if (!depCurrentVersion || depCurrentVersion.startsWith("file:") || depCurrentVersion.startsWith("link:") || !shouldUpdateDependencyBasedOnConfig(cwd, release, {
|
|
54378
54375
|
depVersionRange: depCurrentVersion,
|
|
@@ -54389,7 +54386,7 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
54389
54386
|
depCurrentVersion = workspaceDepVersion;
|
|
54390
54387
|
}
|
|
54391
54388
|
if (new Range(depCurrentVersion).range !== "" || semverPrerelease(newVersion) != null) {
|
|
54392
|
-
let newNewRange = snapshot ? newVersion :
|
|
54389
|
+
let newNewRange = snapshot ? newVersion : getNewDependencyRange(depCurrentVersion, newVersion, type);
|
|
54393
54390
|
if (usesWorkspaceRange) newNewRange = `workspace:${newNewRange}`;
|
|
54394
54391
|
pkgJsonEdits.push({
|
|
54395
54392
|
keys: [depType, name],
|
|
@@ -54400,6 +54397,20 @@ function getDependencyVersionEdits(packageJson, versionsToUpdate, { cwd, updateI
|
|
|
54400
54397
|
}
|
|
54401
54398
|
return pkgJsonEdits;
|
|
54402
54399
|
}
|
|
54400
|
+
function getNewDependencyRange(versionRange, newVersion, releaseType) {
|
|
54401
|
+
const comparatorSets = new Range(versionRange).set;
|
|
54402
|
+
const comparators = comparatorSets.length === 1 ? comparatorSets[0] : [];
|
|
54403
|
+
if (comparators.length === 2 && versionRange.includes(">") && versionRange.includes("<")) {
|
|
54404
|
+
const lowerBound = comparators.find(({ operator }) => operator.startsWith(">"));
|
|
54405
|
+
const upperBound = comparators.find(({ operator }) => operator.startsWith("<"));
|
|
54406
|
+
if (lowerBound && upperBound) {
|
|
54407
|
+
let newUpperBound = upperBound.value;
|
|
54408
|
+
if (!semverSatisfies(newVersion, newUpperBound)) newUpperBound = `<${semverInc(newVersion, releaseType)}`;
|
|
54409
|
+
return comparators[0] === lowerBound ? `>=${newVersion} ${newUpperBound}` : `${newUpperBound} >=${newVersion}`;
|
|
54410
|
+
}
|
|
54411
|
+
}
|
|
54412
|
+
return `${getVersionRangeType(versionRange)}${newVersion}`;
|
|
54413
|
+
}
|
|
54403
54414
|
function getVersionRangeType(versionRange) {
|
|
54404
54415
|
if (versionRange.charAt(0) === "^") return "^";
|
|
54405
54416
|
if (versionRange.charAt(0) === "~") return "~";
|
|
@@ -54498,16 +54509,18 @@ async function applyReleasePlan(releasePlan, packages, config = defaultConfig, s
|
|
|
54498
54509
|
if (!changeset.releases.some((release) => shouldSkipPackage(packagesByName.get(release.name), {
|
|
54499
54510
|
ignore: config.ignore,
|
|
54500
54511
|
allowPrivatePackages: config.privatePackages.version
|
|
54501
|
-
})))
|
|
54502
|
-
|
|
54503
|
-
|
|
54504
|
-
|
|
54505
|
-
|
|
54506
|
-
|
|
54507
|
-
|
|
54508
|
-
|
|
54509
|
-
|
|
54510
|
-
|
|
54512
|
+
}))) {
|
|
54513
|
+
if (isPreChangesets) {
|
|
54514
|
+
const newChangesetPath = path$1.resolve(cwd, ".changeset", "pre", `${changeset.id}.md`);
|
|
54515
|
+
await fs$1.rename(changesetPath, newChangesetPath);
|
|
54516
|
+
touchedFiles.push(changesetPath, newChangesetPath);
|
|
54517
|
+
} else {
|
|
54518
|
+
await fs$1.rm(changesetPath, {
|
|
54519
|
+
recursive: true,
|
|
54520
|
+
force: true
|
|
54521
|
+
});
|
|
54522
|
+
touchedFiles.push(changesetPath);
|
|
54523
|
+
}
|
|
54511
54524
|
}
|
|
54512
54525
|
}
|
|
54513
54526
|
}));
|
|
@@ -54572,10 +54585,13 @@ async function updateChangelog(changelogPath, changelog, name) {
|
|
|
54572
54585
|
await fs$1.writeFile(changelogPath, completelyNewChangelog);
|
|
54573
54586
|
return;
|
|
54574
54587
|
}
|
|
54575
|
-
const
|
|
54588
|
+
const firstVersionHeaderIndex = fileData.search(/^#{1,6}\s+\d+\.\d+/m);
|
|
54576
54589
|
let newChangelog;
|
|
54577
|
-
if (
|
|
54578
|
-
|
|
54590
|
+
if (firstVersionHeaderIndex >= 0) {
|
|
54591
|
+
const prefix = fileData.slice(0, firstVersionHeaderIndex);
|
|
54592
|
+
const suffix = fileData.slice(firstVersionHeaderIndex);
|
|
54593
|
+
newChangelog = prefix + templateString.trimStart() + "\n" + suffix;
|
|
54594
|
+
} else {
|
|
54579
54595
|
const index = fileData.indexOf("\n");
|
|
54580
54596
|
newChangelog = index === -1 ? fileData + templateString : fileData.slice(0, index) + templateString + fileData.slice(index + 1);
|
|
54581
54597
|
}
|
|
@@ -55062,7 +55078,7 @@ async function readChangesets(rootDir, sinceRef) {
|
|
|
55062
55078
|
}
|
|
55063
55079
|
|
|
55064
55080
|
//#endregion
|
|
55065
|
-
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.
|
|
55081
|
+
//#region ../../node_modules/.pnpm/@changesets+get-release-plan@5.0.2/node_modules/@changesets/get-release-plan/dist/index.mjs
|
|
55066
55082
|
async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
55067
55083
|
const packages = await getPackages(cwd);
|
|
55068
55084
|
const configResult = await readConfig(packages.rootDir, packages);
|
|
@@ -55071,7 +55087,9 @@ async function getReleasePlan(cwd, sinceRef, passedConfig) {
|
|
|
55071
55087
|
...configResult.config,
|
|
55072
55088
|
...passedConfig
|
|
55073
55089
|
} : configResult.config;
|
|
55074
|
-
|
|
55090
|
+
const changesets = await readChangesets(packages.rootDir, sinceRef);
|
|
55091
|
+
const preState = await readPreState(packages.rootDir);
|
|
55092
|
+
return assembleReleasePlan(changesets, packages, config, preState);
|
|
55075
55093
|
}
|
|
55076
55094
|
|
|
55077
55095
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@savvy-web/silk",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.5",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The single Silk Suite dev-tooling package — changeset, commitlint, lint, and biome conventions",
|
|
6
6
|
"homepage": "https://github.com/savvy-web/systems/tree/main/packages/silk",
|
|
@@ -83,9 +83,9 @@
|
|
|
83
83
|
"@effected/templates": "^0.6.0",
|
|
84
84
|
"@effected/workspaces": "^0.22.0",
|
|
85
85
|
"@savvy-web/changelog": "0.1.3",
|
|
86
|
-
"@savvy-web/cli": "3.0.
|
|
87
|
-
"@savvy-web/mcp": "3.0.
|
|
88
|
-
"@savvy-web/silk-effects": "8.0.
|
|
86
|
+
"@savvy-web/cli": "3.0.5",
|
|
87
|
+
"@savvy-web/mcp": "3.0.5",
|
|
88
|
+
"@savvy-web/silk-effects": "8.0.5",
|
|
89
89
|
"effect": "4.0.0-rc.115",
|
|
90
90
|
"semver": "^7.8.5"
|
|
91
91
|
},
|