relion 0.47.1 → 0.47.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -8
- package/dist/cli.js +1 -1
- package/package.json +5 -4
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<img alt="logo" src="https://raw.githubusercontent.com/kh4f/relion/refs/heads/assets/logo-light.png">
|
|
5
5
|
</picture>
|
|
6
6
|
<br>
|
|
7
|
-
|
|
7
|
+
A zero‑config <b>release automation</b> tool<br>version bumping, committing, tagging, and AI changelog generation
|
|
8
8
|
<br><br>
|
|
9
9
|
<p>
|
|
10
10
|
<a href="https://www.npmjs.com/package/relion"><img src="https://img.shields.io/npm/v/relion?label=npm&logo=npm&style=flat-square&color=C9CCCF&labelColor=2D3352" alt="npm version"/></a>
|
|
@@ -26,24 +26,24 @@ $ bunx relion -h
|
|
|
26
26
|
|
|
27
27
|
Usage: relion [steps] [options]
|
|
28
28
|
|
|
29
|
-
Steps (
|
|
29
|
+
Steps (omit to run all):
|
|
30
30
|
c Generate release context
|
|
31
31
|
b Bump version in files
|
|
32
32
|
m Create commit
|
|
33
33
|
t Create tag
|
|
34
34
|
|
|
35
35
|
Options (with defaults):
|
|
36
|
-
-v <version> Release version
|
|
37
|
-
-b <files> Files to bump the version in
|
|
38
|
-
-t <prefix> Tag prefix
|
|
39
|
-
-d Dry run
|
|
40
|
-
-y Skip prompts
|
|
36
|
+
-v <version> Release version (calculated from commits)
|
|
37
|
+
-b <files> Files to bump the version in (package.json)
|
|
38
|
+
-t <prefix> Tag prefix (v)
|
|
39
|
+
-d Dry run (false)
|
|
40
|
+
-y Skip prompts (false)
|
|
41
41
|
|
|
42
42
|
Examples:
|
|
43
43
|
bunx relion bm -v 1.2.3 Bump and commit with custom version
|
|
44
44
|
bunx relion ct -t relion@ Generate context and create tag with custom prefix
|
|
45
45
|
bunx relion -b src/manifest.json Bump version in custom file
|
|
46
|
-
bunx relion -d
|
|
46
|
+
bunx relion -d Dry run of all steps
|
|
47
47
|
```
|
|
48
48
|
|
|
49
49
|
- `package.json` is **always included** in the bump list if exists
|
package/dist/cli.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import{execSync as e,spawnSync as t}from"node:child_process";import{existsSync as n,readFileSync as r,writeFileSync as i}from"node:fs";import{createInterface as a}from"node:readline";import o from"semver";const s=()=>{let t=e(`git config --get remote.origin.url`,{encoding:`utf8`}).trim(),n=/(github\.com.*?)(\.git)?$/.exec(t)?.[1]??``,r=n.split(`/`).at(-1)??``;return{url:`https://${n}`,name:r}},c=t=>e(`git log ${t?`${t}..`:``} --format="%h %B---" .`,{encoding:`utf8`}).trim().split(`---`).filter(Boolean).map(e=>/^(.+?) (.+)/s.exec(e.trim())).map(e=>({hash:e?.[1]??``,message:e?.[2].trim()??``})),l=(e,t)=>{let n=e.some(e=>e.message.includes(`BREAKING CHANGE`))?t.startsWith(`0.`)?`minor`:`major`:e.some(e=>/feat(\(.*?\))?:/.test(e.message))?`minor`:`patch`;return o.inc(t,n)??(()=>{throw Error(`Failed to increment version '${t}' with release type '${n}'`)})()},u=async(e,t=!1)=>{if(t)return!0;let n=a({input:process.stdin,output:process.stdout});return await new Promise(t=>{n.question(e,e=>{n.close(),t(e.trim()!==`s`)})})},d={steps:[`context`,`bump`,`commit`,`tag`],bump:[`package.json`],newVersion:``,tagPrefix:`v`,commitsExclude:[/^(ci|build|test)\(/,/^chore\(deps\)(?!!)/],dryRun:!1,yes:!1},f=[{filePattern:/\.rc$/,bump:(e,t)=>e.replace(/(\b(FileVersion|ProductVersion)\b.*?)\d[\w.+-]*/g,`$1${t}`).replace(/(\b(FILEVERSION|PRODUCTVERSION)\b.*?)\d[\w,+-]*/g,`$1${(/^\d+\.\d+\.\d+/.exec(t)?.[0]??``).replace(/\./g,`,`)+`,0`}`)},{filePattern:/.*/,bump:(e,t)=>e.replace(/(\bversion\b.*?)\d[\w.+-]*/,`$1${t}`)}],p=async(e,t,n,r,a)=>{if(e.yes||!await u(`About to write context to 'RELEASE.md'`,e.yes)||e.dryRun)return;let o=``,s=`---\ntag: ${r}\nprevTag: ${n}\ndate: ${new Date().toLocaleString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}\nrepoURL: ${a}
|
|
3
3
|
---
|
|
4
4
|
`;o+=s+`
|
|
5
|
-
`;let c=t.map(e=>`[${e.hash}] ${e.message}`).join(`\n${`-`.repeat(30)}\n`);o+=`## Commit
|
|
5
|
+
`;let c=t.map(e=>`[${e.hash}] ${e.message}`).join(`\n${`-`.repeat(30)}\n`);o+=`## Commit log\n\n${c}`,i(`RELEASE.md`,o,`utf8`)},m=async e=>{let t=e.bump.filter(n);await u(`About to bump version in files: ${t.join(`, `)}`,e.yes)&&t.forEach(t=>{let n=f.find(e=>e.filePattern.test(t));if(!n)return console.warn(`No matching bumper found for file '${t}', skipping...`);let a=r(t,`utf8`),o=n.bump(a,e.newVersion);e.dryRun||i(t,o,`utf8`)})},h=async(t,n)=>{let r=`${t.yes?`git add -A && `:``}git commit -m "${n}"`;await u(`About to commit changes: '${r}'`,t.yes)&&(t.dryRun||e(r,{stdio:`inherit`}))},g=async(t,n,r)=>{let i=`git tag ${n} -m "${r}"`;await u(`About to create a tag: '${i}'`,t.yes)&&(t.dryRun||e(i,{stdio:`inherit`}))},_=async e=>{let n=s();console.log(`Project: ${n.name}`),console.log(`Repo: ${n.url}`);let r={...d,...e,bump:[...d.bump,...e.bump??[]]},i=t(`git`,[`describe`,`--match`,`${r.tagPrefix}[0-9]*.[0-9]*.[0-9]*`,`--abbrev=0`],{encoding:`utf8`}).stdout.trim();console.log(`Current tag: ${i}`);let a=/\d+\.\d+\.\d+.*/.exec(i)?.[0]??`0.0.0`;console.log(`Current version: ${a}`);let o=c(i),u=o.filter(e=>!r.commitsExclude.some(t=>t.test(e.message)));console.log(`Parsed commits: ${u.length}`),r.newVersion||=l(o,a),console.log(`New version: ${r.newVersion}`);let f=`${r.tagPrefix}${r.newVersion}`;console.log(`New tag: ${f}`);let _=`chore(release): ${f}`;console.log(`Commit message: '${_}'`),console.log(`Steps: ${r.steps.join(`, `)}`),console.log(`-`.repeat(30)),r.steps.includes(`context`)&&await p(r,u,i,f,n.url),r.steps.includes(`bump`)&&await m(r),r.steps.includes(`commit`)&&await h(r,_),r.steps.includes(`tag`)&&await g(r,f,_)},v=[`context`,`bump`,`commit`,`tag`],y={context:`c`,bump:`b`,commit:`m`,tag:`t`},b=process.argv.slice(2),x=b[0]&&!b[0].startsWith(`-`)?b.shift():``;b.includes(`-h`)&&(console.log(`Usage: relion [steps] [options]
|
|
6
6
|
|
|
7
7
|
Steps (e.g. 'bm' = bump + commit; omit to run all):
|
|
8
8
|
c Generate release context
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relion",
|
|
3
|
-
"version": "0.47.
|
|
3
|
+
"version": "0.47.2",
|
|
4
4
|
"description": "🏷️ Release Workflow Helper",
|
|
5
5
|
"author": "kh4f",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
"keywords": ["relion", "release", "release-automation", "release-workflow", "release-helper"],
|
|
11
11
|
"files": ["dist"],
|
|
12
12
|
"type": "module",
|
|
13
|
+
"main": "dist/cli.js",
|
|
13
14
|
"bin": "dist/cli.js",
|
|
14
15
|
"scripts": {
|
|
15
16
|
"dev": "tsdown",
|
|
16
17
|
"watch": "tsdown -w",
|
|
17
|
-
"
|
|
18
|
+
"prod": "bun -b tsdown -p",
|
|
18
19
|
"typecheck": "tsc",
|
|
19
20
|
"lint": "eslint",
|
|
20
21
|
"test": "bun test",
|
|
@@ -30,8 +31,8 @@
|
|
|
30
31
|
"@types/semver": "^7.7.1",
|
|
31
32
|
"eslint": "^10.4.0",
|
|
32
33
|
"jiti": "^2.7.0",
|
|
33
|
-
"tsdown": "^0.22.
|
|
34
|
+
"tsdown": "^0.22.1",
|
|
34
35
|
"typescript": "^6.0.3",
|
|
35
|
-
"typescript-eslint": "^8.
|
|
36
|
+
"typescript-eslint": "^8.60.0"
|
|
36
37
|
}
|
|
37
38
|
}
|