Skip to content

Commit

Permalink
Merge pull request #497 from adopted-ember-addons/pre-release
Browse files Browse the repository at this point in the history
have release-plan do a prerelease from main
  • Loading branch information
mansona authored Nov 13, 2024
2 parents 274ad7a + 7c6ab4b commit 51b4456
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 6 deletions.
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": {
"[email protected]": "patches/[email protected]"
}
}
}
35 changes: 35 additions & 0 deletions patches/[email protected]
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.

0 comments on commit 51b4456

Please sign in to comment.