Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

have release-plan do a prerelease from main #497

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
- uses: pnpm/action-setup@v4
- run: pnpm install --frozen-lockfile
- name: npm publish
run: pnpm release-plan publish
run: pnpm release-plan publish --tag=alpha
env:
GITHUB_AUTH: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
14 changes: 13 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"prettier": "^2.3.2",
"qunit": "^2.16.0",
"qunit-dom": "^1.6.0",
"release-plan": "^0.9.0"
"release-plan": "^0.10.0"
},
"peerDependencies": {
"active-model-adapter": "*",
Expand Down Expand Up @@ -119,5 +119,17 @@
},
"ember-addon": {
"configPath": "tests/dummy/config"
},
"release-plan": {
"semverIncrementAs": {
"major": "prerelease",
"minor": "prerelease",
"patch": "prerelease"
}
},
"pnpm": {
"patchedDependencies": {
"release-plan@0.10.0": "patches/release-plan@0.10.0.patch"
}
}
}
35 changes: 35 additions & 0 deletions patches/release-plan@0.10.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
diff --git a/dist/plan.js b/dist/plan.js
index 3e1641cb2cca0ec94e310b5b25bb98b78001c3cf..0e6de599b02eb66f7102d1d58802c298a9c9008a 100644
--- a/dist/plan.js
+++ b/dist/plan.js
@@ -39,7 +39,10 @@ class Plan {
solution.set(pkgName, { impact: undefined, oldVersion: entry.version });
}
else {
- const newVersion = inc(entry.version, impact);
+ const newVersion = inc(
+ entry.version,
+ this.#configureImpact(pkgName, impact),
+ );
solution.set(pkgName, {
impact,
oldVersion: entry.version,
@@ -51,6 +54,18 @@ class Plan {
}
return solution;
}
+
+ #configureImpact(pkgName, impact) {
+ const packageJson = this.#pkgs.get(pkgName)?.pkg;
+ if (packageJson && packageJson['release-plan']?.semverIncrementAs) {
+ const semverOverrides = packageJson['release-plan'].semverIncrementAs;
+ if (semverOverrides[impact]) {
+ return semverOverrides[impact];
+ }
+ }
+ return impact;
+ }
+
#expandWorkspaceRange(range, availableVersion) {
// this implements PNPM's rules for how workspace: protocol dependencies get
// expanded into proper semver ranges.
14 changes: 10 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading