relion 0.41.1 → 0.42.1

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.
Files changed (3) hide show
  1. package/README.md +14 -14
  2. package/dist/index.js +2 -3
  3. package/package.json +5 -5
package/README.md CHANGED
@@ -21,16 +21,17 @@
21
21
  <br>
22
22
  </div>
23
23
 
24
- ## đŸ“Ĩ Installation
24
+ ## âš™ī¸ Setup
25
25
 
26
26
  ```bash
27
- pnpm add -D relion
27
+ bun add -D relion # install as dev dependency
28
+ bunx relion # or run directly
28
29
  ```
29
30
 
30
31
  ## đŸ•šī¸ CLI Usage
31
32
 
32
33
  ```bash
33
- $ pnpm relion -h
34
+ $ bun relion -h
34
35
 
35
36
  Usage: relion [options]
36
37
 
@@ -45,23 +46,23 @@ Options:
45
46
  -h Show the help message
46
47
 
47
48
  Examples:
48
- - `pnpm relion -bct` — bump version, create release commit and tag
49
- - `pnpm relion -f` — generate release context file
50
- - `pnpm relion -m Cargo.toml` — use Cargo.toml as manifest
51
- - `pnpm relion` — run all release steps
49
+ - `bun relion -bct` — bump version, create release commit and tag
50
+ - `bun relion -f` — generate release context file
51
+ - `bun relion -m Cargo.toml` — use Cargo.toml as manifest
52
+ - `bun relion` — run all release steps
52
53
  ```
53
54
 
54
- <details><summary>Example output of running <code>pnpm relion</code>:</summary>
55
+ <details><summary>Example output of running <code>bun relion</code>:</summary>
55
56
 
56
57
  ```txt
57
- ------------------------------
58
- Current version: 0.36.1
58
+ Project: relion
59
+ Repo: github.com/kh4f/relion
59
60
  Current tag: v0.36.1
61
+ Current version: 0.36.1
60
62
  Parsed commits: 16
61
63
  New version: 0.37.0
62
64
  New tag: v0.37.0
63
65
  Commit message: 'chore(release): v0.37.0'
64
- Repo URL: https://github.com/kh4f/relion
65
66
  ------------------------------
66
67
 
67
68
  About to write context to 'RELEASE.md'
@@ -151,10 +152,9 @@ Relion can also be configured via `relion` field in `package.json`:
151
152
 
152
153
  ```md
153
154
  ---
154
- version: 0.33.0
155
155
  tag: v0.33.0
156
- date: Jan 10, 2026
157
156
  prevTag: v0.32.1
157
+ date: Jan 10, 2026
158
158
  repoURL: https://github.com/kh4f/relion
159
159
  ---
160
160
 
@@ -181,7 +181,7 @@ Recommended workflow:
181
181
  1. Set up GitHub Copilot instruction and prompt:
182
182
  - [.github/instructions/changelog-format.instructions.md](.github/instructions/changelog-format.instructions.md)
183
183
  - [.github/prompts/generate-changelog.prompt.md](.github/prompts/generate-changelog.prompt.md)
184
- 2. Run the context step to generate RELEASE.md: `pnpm relion -f`
184
+ 2. Run the context step to generate RELEASE.md: `bun relion -f`
185
185
  3. Review the release context, adjust as needed
186
186
  4. Run the prompt in VSCode Copilot chat: `/generate-changelog`
187
187
  5. Copilot produces a polished changelog entry based on the release context
package/dist/index.js CHANGED
@@ -1,5 +1,4 @@
1
- import{existsSync as e,readFileSync as t,writeFileSync as n}from"node:fs";import{execSync as r,spawnSync as i}from"node:child_process";import{createInterface as a}from"node:readline";import o from"semver";const s=e=>{let n=t(e,`utf8`),r=/name.*"(.*?)"/.exec(n)?.[1];if(!r)throw Error(`Manifest is missing 'name' field`);let i=/version.*"(.*?)"/.exec(n)?.[1];if(!i)throw Error(`Manifest is missing 'version' field`);let a=/repository.*"(.*?)"/.exec(n)?.[1];if(!a)throw Error(`Manifest is missing 'repository' field`);let o=e.endsWith(`.json`)?/relion.*({.*?})/s.exec(n)?.[1]:void 0;return{name:r,version:i,repository:a,relion:o?JSON.parse(o):void 0}},c=e=>r(`git log ${e?`${e}..`:``} --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()=>{let e=a({input:process.stdin,output:process.stdout});return await new Promise(t=>{e.question(`Press Enter to continue ('s' to skip): `,n=>{e.close(),t(n.trim()!==`s`)})})},d=e=>{let t=/^\/(.+)\/(\w*)$/.exec(e);return t?new RegExp(t[1],t[2]):new RegExp(e)},f=[`context`,`bump`,`commit`,`tag`],p={file:[`package.json`,`Cargo.toml`],pattern:/(\bversion\b.*?)\d[\w.+-]*/,replacement:`$1{{newVersion}}`},m=[`package.json`,`Cargo.toml`],h={flow:f,newVersion:``,bump:m,contextFile:`RELEASE.md`,commitMessage:`chore(release): {{tag}}`,tagPrefix:`v`,dryRun:!1},g=async(e,t,r,i,a)=>{if(console.log(`\nAbout to write context to '${e.contextFile}'`),!await u()||e.dryRun)return;let o=``,s=`---\nversion: ${e.newVersion}\ntag: ${i}\ndate: ${new Date().toLocaleString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}\nprevTag: ${r}\nrepoURL: ${a}
1
+ import{existsSync as e,readFileSync as t,writeFileSync as n}from"node:fs";import{execSync as r,spawnSync as i}from"node:child_process";import{createInterface as a}from"node:readline";import o from"semver";const s=()=>{let e=r(`git config --get remote.origin.url`,{encoding:`utf8`}).trim(),t=/(github\.com.*?)(\.git)?$/.exec(e)?.[1]??``;return{url:t,name:t.split(`/`).at(-1)??``}},c=e=>{let n=t(e,`utf8`),r=/name.*"(.*?)"/.exec(n)?.[1];if(!r)throw Error(`Manifest is missing 'name' field`);let i=/repository.*"(.*?)"/.exec(n)?.[1];if(!i)throw Error(`Manifest is missing 'repository' field`);let a=e.endsWith(`.json`)?/relion.*({.*?})/s.exec(n)?.[1]:void 0;return{name:r,url:i,relion:a?JSON.parse(a):void 0}},l=e=>r(`git log ${e?`${e}..`:``} --format="%h %B---" .`,{encoding:`utf8`}).trim().split(`---`).filter(Boolean).map(e=>/^(.+?) (.+)/s.exec(e.trim())).map(e=>({hash:e?.[1]??``,message:e?.[2].trim()??``})),u=(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}'`)})()},d=async()=>{let e=a({input:process.stdin,output:process.stdout});return await new Promise(t=>{e.question(`Press Enter to continue ('s' to skip): `,n=>{e.close(),t(n.trim()!==`s`)})})},f=e=>{let t=/^\/(.+)\/(\w*)$/.exec(e);return t?new RegExp(t[1],t[2]):new RegExp(e)},p=[`context`,`bump`,`commit`,`tag`],m={file:[`package.json`,`Cargo.toml`],pattern:/(\bversion\b.*?)\d[\w.+-]*/,replacement:`$1{{newVersion}}`},h=[`package.json`,`Cargo.toml`],g={flow:p,newVersion:``,bump:h,contextFile:`RELEASE.md`,commitMessage:`chore(release): {{tag}}`,tagPrefix:`v`,dryRun:!1},_=async(e,t,r,i,a)=>{if(console.log(`\nAbout to write context to '${e.contextFile}'`),!await d()||e.dryRun)return;let o=``,s=`---\ntag: ${i}\nprevTag: ${r}\ndate: ${new Date().toLocaleString(`en-US`,{month:`short`,day:`numeric`,year:`numeric`})}\nrepoURL: ${a}
2
2
  ---
3
3
  `;o+=s+`
4
- `;let c=t.map(e=>`[${e.hash}] ${e.message}`).join(`\n${`-`.repeat(30)}\n`);o+=`## Commit Log\n\n\`\`\`\n${c}\n\`\`\``,n(e.contextFile,o,`utf8`)},_=async r=>{let i=r.bump.map(e=>typeof e==`string`?{...p,file:e}:e).filter(t=>[t.file].flat().every(t=>e(t)));console.log(`\nAbout to bump versions in files: ${i.map(e=>[e.file].flat()).flat().join(`, `)}`),await u()&&i.forEach(e=>{typeof e.pattern==`string`&&(e.pattern=d(e.pattern)),[e.file].flat().forEach(i=>{let a=t(i,`utf8`).replace(e.pattern,e.replacement.replace(`{{newVersion}}`,r.newVersion));r.dryRun||n(i,a,`utf8`)})})},v=async e=>{let t=`git commit -m "${e.commitMessage}"`;console.log(`\nAbout to commit changes: '${t}'`),await u()&&(e.dryRun||r(t,{stdio:`inherit`}))},y=async(e,t,n)=>{let i=`git tag ${n} -m "${e.commitMessage}"`,a=RegExp(`^${e.commitMessage.replace(n,t).replace(/[()]/g,`\\$&`)}$`),o=r(`git log -1 --format=%s`,{encoding:`utf8`}).trim(),s=``;a.test(o)&&(s+=`
5
- Latest commit is a release commit. Reusing the latest tag.`,i=`git tag ${t} -m "${o}" -f`),s+=`\nAbout to create a tag: '${i}'`,console.log(s),await u()&&(e.dryRun||r(i,{stdio:`inherit`}))};async function b(t){if(t?.manifest&&!e(t.manifest))throw Error(`Specified manifest file '${t.manifest}' does not exist`);let n=t?.manifest??m.find(e);if(!n)throw Error(`No manifest file found, please specify one`);console.log(`-`.repeat(30)),console.log(`Manifest file: ${n}`);let r=s(n);t={...r.relion,...t};let a={...h,...t};!t.tagPrefix&&r.name.startsWith(`@`)&&(a.tagPrefix=`${r.name}@`);let o=r.version;console.log(`Current version: ${o}`);let u=i(`git`,[`describe`,`--match`,`${a.tagPrefix}[0-9]*.[0-9]*.[0-9]*`,`--abbrev=0`],{encoding:`utf8`}).stdout.trim();console.log(`Current tag: ${u}`);let d=c(u);console.log(`Parsed commits: ${d.length}`),a.newVersion||=l(d,o),console.log(`New version: ${a.newVersion}`);let p=`${a.tagPrefix}${a.newVersion}`;console.log(`New tag: ${p}`),a.commitMessage=a.commitMessage.replace(`{{tag}}`,p),console.log(`Commit message: '${a.commitMessage}'`);let b=r.repository;console.log(`Repo URL: ${b}`),console.log(`-`.repeat(30));for(let e of f.filter(e=>a.flow.includes(e)))await{context:()=>g(a,d,u,p,b),bump:()=>_(a),commit:()=>v(a),tag:()=>y(a,u,p)}[e]()}const x=e=>e;export{b as default,x as defineConfig};
4
+ `;let c=t.map(e=>`[${e.hash}] ${e.message}`).join(`\n${`-`.repeat(30)}\n`);o+=`## Commit Log\n\n\`\`\`\n${c}\n\`\`\``,n(e.contextFile,o,`utf8`)},v=async r=>{let i=r.bump.map(e=>typeof e==`string`?{...m,file:e}:e).filter(t=>[t.file].flat().every(t=>e(t)));console.log(`\nAbout to bump versions in files: ${i.map(e=>[e.file].flat()).flat().join(`, `)}`),await d()&&i.forEach(e=>{typeof e.pattern==`string`&&(e.pattern=f(e.pattern)),[e.file].flat().forEach(i=>{let a=t(i,`utf8`).replace(e.pattern,e.replacement.replace(`{{newVersion}}`,r.newVersion));r.dryRun||n(i,a,`utf8`)})})},y=async e=>{let t=`git commit -m "${e.commitMessage}"`;console.log(`\nAbout to commit changes: '${t}'`),await d()&&(e.dryRun||r(t,{stdio:`inherit`}))},b=async(e,t,n)=>{let i=`git tag ${n} -m "${e.commitMessage}"`;console.log(`\nAbout to create a tag: '${i}'`),await d()&&(e.dryRun||r(i,{stdio:`inherit`}))};async function x(t){let n;if(t?.manifest&&!e(t.manifest))throw Error(`Specified manifest file '${t.manifest}' does not exist`);let r=t?.manifest??h.find(e);r?(console.log(`Manifest file: ${r}`),n=c(r)):(console.log(`No manifest file found, using repository info`),n=s()),console.log(`Project: ${n.name}`),console.log(`Repo: ${n.url}`),t={...n.relion,...t};let a={...g,...t};!t.tagPrefix&&n.name.startsWith(`@`)&&(a.tagPrefix=`${n.name}@`);let o=i(`git`,[`describe`,`--match`,`${a.tagPrefix}[0-9]*.[0-9]*.[0-9]*`,`--abbrev=0`],{encoding:`utf8`}).stdout.trim();console.log(`Current tag: ${o}`);let d=/\d+\.\d+\.\d+.*/.exec(o)?.[0]??`0.0.0`;console.log(`Current version: ${d}`);let f=l(o);console.log(`Parsed commits: ${f.length}`),a.newVersion||=u(f,d),console.log(`New version: ${a.newVersion}`);let m=`${a.tagPrefix}${a.newVersion}`;console.log(`New tag: ${m}`),a.commitMessage=a.commitMessage.replace(`{{tag}}`,m),console.log(`Commit message: '${a.commitMessage}'`),console.log(`-`.repeat(30));for(let e of p.filter(e=>a.flow.includes(e)))await{context:()=>_(a,f,o,m,n.url),bump:()=>v(a),commit:()=>y(a),tag:()=>b(a,o,m)}[e]()}const S=e=>e;export{x as default,S as defineConfig};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "relion",
3
- "version": "0.41.1",
3
+ "version": "0.42.1",
4
4
  "description": "đŸˇī¸ Modern Release Workflow Helper",
5
5
  "author": "kh4f <kh4f.dev@gmail.com>",
6
6
  "license": "MIT",
@@ -23,12 +23,12 @@
23
23
  "dependencies": { "semver": "^7.7.4" },
24
24
  "devDependencies": {
25
25
  "@eslint/js": "^10.0.1",
26
- "@stylistic/eslint-plugin": "^5.9.0",
27
- "@types/node": "^25.3.3",
26
+ "@stylistic/eslint-plugin": "^5.10.0",
27
+ "@types/node": "^25.3.5",
28
28
  "@types/semver": "^7.7.1",
29
- "eslint": "^10.0.2",
29
+ "eslint": "^10.0.3",
30
30
  "jiti": "^2.6.1",
31
- "tsdown": "^0.20.3",
31
+ "tsdown": "^0.21.0",
32
32
  "typescript": "^5.9.3",
33
33
  "typescript-eslint": "^8.56.1"
34
34
  }