@chronus/chronus
Advanced tools
Comparing version 0.12.0 to 0.12.1
@@ -8,3 +8,3 @@ import z from "zod"; | ||
import { validateYamlFile } from "../yaml/schema-validator.js"; | ||
const mdRegex = /\s*---([^]*?)\n\s*---(\s*(?:\n|$)[^]*)/; | ||
const mdRegex = /^\s*---([^]*?)\n---\n([^]*)/; | ||
const changeFrontMatterSchema = z.object({ | ||
@@ -11,0 +11,0 @@ changeKind: z.string(), |
@@ -56,3 +56,3 @@ import semverSatisfies from "semver/functions/satisfies.js"; | ||
else if ((!actions.has(dependent) || actions.get(dependent).type === "none") && | ||
!semverSatisfies(incrementVersion(nextRelease), versionRange)) { | ||
!willRangeBeValid(nextRelease, versionRange)) { | ||
switch (depType) { | ||
@@ -118,2 +118,17 @@ case "dependencies": | ||
} | ||
/** | ||
* Check the given version range will be valid with the new version after this release action. | ||
*/ | ||
function willRangeBeValid(release, versionRange) { | ||
switch (versionRange) { | ||
case "*": | ||
return true; | ||
case "^": | ||
return release.type === "minor" || release.type === "patch"; | ||
case "~": | ||
return release.type === "patch"; | ||
default: | ||
return semverSatisfies(incrementVersion(release), versionRange); | ||
} | ||
} | ||
/* | ||
@@ -120,0 +135,0 @@ Returns an array of objects in the shape { depType: DependencyType, versionRange: string } |
@@ -27,11 +27,19 @@ export function isDefined(arg) { | ||
export function getLastJsonObject(str) { | ||
str = str.replace(/[^}]*$/, ""); | ||
while (str) { | ||
str = str.replace(/[^{]*/, ""); | ||
try { | ||
return JSON.parse(str); | ||
let start = 0; | ||
let end = str.length - 1; | ||
for (let i = str.length - 1; i >= 0; i--) { | ||
if (str[i] === "}") { | ||
end = i; | ||
break; | ||
} | ||
catch (err) { | ||
// move past the potentially leading `{` so the regexp in the loop can try to match for the next `{` | ||
str = str.slice(1); | ||
} | ||
for (let i = end; i >= 0; i--) { | ||
if (str[i] === "{") { | ||
start = i; | ||
try { | ||
return JSON.parse(str.slice(start, end + 1)); | ||
} | ||
catch (err) { | ||
// ignore keep trying to look for previous { to parse | ||
} | ||
} | ||
@@ -38,0 +46,0 @@ } |
{ | ||
"name": "@chronus/chronus", | ||
"version": "0.12.0", | ||
"version": "0.12.1", | ||
"type": "module", | ||
@@ -34,6 +34,6 @@ "description": "chronus", | ||
"globby": "^14.0.2", | ||
"is-unicode-supported": "^2.0.0", | ||
"micromatch": "^4.0.7", | ||
"is-unicode-supported": "^2.1.0", | ||
"micromatch": "^4.0.8", | ||
"pacote": "^18.0.6", | ||
"picocolors": "^1.0.1", | ||
"picocolors": "^1.1.0", | ||
"pluralize": "^8.0.0", | ||
@@ -51,3 +51,3 @@ "prompts": "^2.4.2", | ||
"@types/micromatch": "^4.0.9", | ||
"@types/node": "^22.1.0", | ||
"@types/node": "^22.5.4", | ||
"@types/node-fetch": "^2.6.11", | ||
@@ -59,6 +59,6 @@ "@types/pacote": "^11.1.8", | ||
"@types/xml2js": "^0.4.14", | ||
"@types/yargs": "^17.0.32", | ||
"@types/yargs": "^17.0.33", | ||
"prettier": "^3.3.3", | ||
"rimraf": "^6.0.1", | ||
"typescript": "^5.5.4", | ||
"typescript": "^5.6.2", | ||
"vitest": "^2.0.5", | ||
@@ -65,0 +65,0 @@ "@chronus/registry-mock": "0.0.1" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
377270
4582
Updatedis-unicode-supported@^2.1.0
Updatedmicromatch@^4.0.8
Updatedpicocolors@^1.1.0