-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(package.json): move astro from dependencies to peerDependencies (#…
…668) * fix(package.json): move astro from dependencies to peerDependencies * chore(knip.config.ts): enable astro plugin manually * test(tests/e2e/fixtures/package.json): add astro to dependencies * test(tests/e2e/fixtures/bun.lockb): update lockfile * chore(knip.config.ts): remove ignoreBinaries in test fixtures workspace * fix(package.json): add carets to dependency versions * fix(package.json): loose peerDependencies version constraint and add astro to devDependencies * chore(renovate.json5): disable version pinning for dependencies and peerDependencies * ci(.github/workflows/e2e.yml): handle multiple versions of astro * ci(.github/workflows/lint.yml): add job to conclude the result * ci(.github/workflows/lint.yml): run actions-timeline after lint-status * ci(.github/workflows/lint.yml): handle skipped and cancelled status for conclusion job * ci(.github/workflows/lint.yml): fix if statement in bash script * ci(.github/workflows/lint.yml): fix check status bash script * ci(.github/workflows/lint.yml): split actions-timeline job * ci(.github/workflows/e2e.yml): test several astro versions in the fixture * fix(package.json): narrow astro peerDependencies range
- Loading branch information
Showing
9 changed files
with
156 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { $ } from "bun"; | ||
import { compare, parse, satisfies } from "semver"; | ||
import packageJson from "../../../package.json" with { type: "json" }; | ||
|
||
$.throws(true); | ||
|
||
const peerRange = packageJson.peerDependencies.astro as string; | ||
|
||
const versions = (await $`npm view astro versions --json`.json()) as string[]; | ||
|
||
const versionsInRange = versions | ||
.filter((version) => satisfies(version, peerRange)) | ||
.sort(compare); | ||
|
||
const groupedVersions = Object.groupBy(versionsInRange, (version) => { | ||
const semver = parse(version); | ||
if (!semver) { | ||
throw new Error(`Invalid version: ${version}`); | ||
} | ||
return `${semver.major}.${semver.minor}`; | ||
}); | ||
|
||
const versionsToTest = [ | ||
...new Set([ | ||
// oldest 3 versions | ||
...versionsInRange.slice(0, 3), | ||
// oldest version of each major version | ||
...Object.entries(groupedVersions) | ||
.filter(([key]) => key.endsWith(".0")) | ||
.map(([, versions]) => versions?.at(0)), | ||
// latest version of each minor version | ||
...Object.values(groupedVersions).map((versions) => versions?.at(-1)), | ||
// latest 5 versions | ||
...versionsInRange.slice(-5), | ||
]), | ||
]; | ||
|
||
console.write(JSON.stringify(versionsToTest)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters