@changesets/apply-release-plan
Advanced tools
+10
-0
| # @changesets/apply-release-plan | ||
| ## 8.0.0-next.5 | ||
| ### Patch Changes | ||
| - Updated dependencies [[`6a05002`](https://github.com/changesets/changesets/commit/6a05002228a06807b1a95da841d1809ae07441bf), [`88f2abb`](https://github.com/changesets/changesets/commit/88f2abb5e14748b08e3441fd871df60dd1c4737f), [`6a05002`](https://github.com/changesets/changesets/commit/6a05002228a06807b1a95da841d1809ae07441bf)]: | ||
| - @changesets/config@4.0.0-next.5 | ||
| - @changesets/types@7.0.0-next.5 | ||
| - @changesets/git@4.0.0-next.5 | ||
| - @changesets/should-skip-package@1.0.0-next.5 | ||
| ## 8.0.0-next.4 | ||
@@ -4,0 +14,0 @@ |
+8
-8
| { | ||
| "name": "@changesets/apply-release-plan", | ||
| "version": "8.0.0-next.4", | ||
| "version": "8.0.0-next.5", | ||
| "description": "Takes a release plan and applies it to packages", | ||
@@ -20,12 +20,12 @@ "license": "MIT", | ||
| "import-meta-resolve": "^4.2.0", | ||
| "semver": "^7.5.3", | ||
| "@changesets/config": "^4.0.0-next.4", | ||
| "@changesets/git": "^4.0.0-next.4", | ||
| "@changesets/should-skip-package": "^1.0.0-next.4", | ||
| "@changesets/types": "^7.0.0-next.4" | ||
| "semver": "^7.8.0", | ||
| "@changesets/config": "^4.0.0-next.5", | ||
| "@changesets/git": "^4.0.0-next.5", | ||
| "@changesets/should-skip-package": "^1.0.0-next.5", | ||
| "@changesets/types": "^7.0.0-next.5" | ||
| }, | ||
| "devDependencies": { | ||
| "@manypkg/get-packages": "^3.0.0", | ||
| "@manypkg/get-packages": "^3.1.0", | ||
| "outdent": "^0.8.0", | ||
| "tinyexec": "^1.0.2", | ||
| "tinyexec": "^1.1.2", | ||
| "@changesets/test-utils": "0.0.9-next.3" | ||
@@ -32,0 +32,0 @@ }, |
@@ -33,3 +33,3 @@ import type { | ||
| changelogFuncs: ChangelogFunctions, | ||
| changelogOpts: any, | ||
| changelogOpts: null | Record<string, unknown>, | ||
| { | ||
@@ -36,0 +36,0 @@ updateInternalDependencies, |
| import { getCommitsThatAddFiles } from "@changesets/git"; | ||
| import type { ComprehensiveRelease, NewChangeset } from "@changesets/types"; | ||
| import type { RelevantChangesets } from "../types.ts"; | ||
| import { capitalize } from "../utils.ts"; | ||
| async function getReleaseLine(changeset: NewChangeset, cwd: string) { | ||
| const [firstLine, ...futureLines] = changeset.summary | ||
| .split("\n") | ||
| .map((l) => l.trimEnd()); | ||
| const [commitThatAddsFile] = await getCommitsThatAddFiles( | ||
| [`.changeset/${changeset.id}.md`], | ||
| { cwd }, | ||
| ); | ||
| return `- [${commitThatAddsFile}] ${firstLine}\n${futureLines | ||
| .map((l) => ` ${l}`) | ||
| .join("\n")}`; | ||
| } | ||
| async function getReleaseLines( | ||
| obj: RelevantChangesets, | ||
| type: keyof RelevantChangesets, | ||
| cwd: string, | ||
| ) { | ||
| const releaseLines = obj[type].map((changeset) => | ||
| getReleaseLine(changeset, cwd), | ||
| ); | ||
| if (!releaseLines.length) return ""; | ||
| const resolvedLines = await Promise.all(releaseLines); | ||
| return `### ${capitalize(type)} Changes\n\n${resolvedLines.join("")}`; | ||
| } | ||
| // plugin, needs default export | ||
| // eslint-disable-next-line import-lite/no-default-export | ||
| export default async function defaultChangelogGetter( | ||
| release: ComprehensiveRelease, | ||
| relevantChangesets: RelevantChangesets, | ||
| options: { cwd: string }, | ||
| ) { | ||
| const { cwd } = options; | ||
| // First, we construct the release lines, summaries of changesets that caused us to be released | ||
| const majorReleaseLines = await getReleaseLines( | ||
| relevantChangesets, | ||
| "major", | ||
| cwd, | ||
| ); | ||
| const minorReleaseLines = await getReleaseLines( | ||
| relevantChangesets, | ||
| "minor", | ||
| cwd, | ||
| ); | ||
| const patchReleaseLines = await getReleaseLines( | ||
| relevantChangesets, | ||
| "patch", | ||
| cwd, | ||
| ); | ||
| return [ | ||
| `## ${release.newVersion}`, | ||
| majorReleaseLines, | ||
| minorReleaseLines, | ||
| patchReleaseLines, | ||
| ] | ||
| .filter((line) => line) | ||
| .join("\n"); | ||
| } |
| import type { NewChangeset } from "@changesets/types"; | ||
| export type RelevantChangesets = { | ||
| major: NewChangeset[]; | ||
| minor: NewChangeset[]; | ||
| patch: NewChangeset[]; | ||
| }; |
Sorry, the diff of this file is too big to display
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Found 1 instance in 1 package
179041
-0.82%13
-18.75%4063
-1.62%