relion 0.41.0 → 0.42.0
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 +2 -3
- package/dist/cli.js +1 -1
- package/dist/index.js +2 -3
- package/package.json +13 -15
package/README.md
CHANGED
|
@@ -55,8 +55,8 @@ Examples:
|
|
|
55
55
|
|
|
56
56
|
```txt
|
|
57
57
|
------------------------------
|
|
58
|
-
Current version: 0.36.1
|
|
59
58
|
Current tag: v0.36.1
|
|
59
|
+
Current version: 0.36.1
|
|
60
60
|
Parsed commits: 16
|
|
61
61
|
New version: 0.37.0
|
|
62
62
|
New tag: v0.37.0
|
|
@@ -151,10 +151,9 @@ Relion can also be configured via `relion` field in `package.json`:
|
|
|
151
151
|
|
|
152
152
|
```md
|
|
153
153
|
---
|
|
154
|
-
version: 0.33.0
|
|
155
154
|
tag: v0.33.0
|
|
156
|
-
date: Jan 10, 2026
|
|
157
155
|
prevTag: v0.32.1
|
|
156
|
+
date: Jan 10, 2026
|
|
158
157
|
repoURL: https://github.com/kh4f/relion
|
|
159
158
|
---
|
|
160
159
|
|
package/dist/cli.js
CHANGED
|
@@ -16,4 +16,4 @@ Examples:
|
|
|
16
16
|
- \`pnpm relion -f\` — generate release context file
|
|
17
17
|
- \`pnpm relion -m Cargo.toml\` — use Cargo.toml as manifest
|
|
18
18
|
- \`pnpm relion\` — run all release steps
|
|
19
|
-
`),process.exit(0));let n=[/-\w*f/.test(t)&&`context`,/-\w*b/.test(t)&&`bump`,/-\w*c/.test(t)&&`commit`,/-\w*t/.test(t)&&`tag`].filter(Boolean);n.length||(n=[`context`,`bump`,`commit`,`tag`]);const r=/-v (\S+)/.exec(t)?.[1],i=/-m (\S+)/.exec(t)?.[1],a=/-\w*d/.test(t);e({flow:n,...r&&{newVersion:r},...i&&{manifest:i},...a&&{dryRun:a}});export{};
|
|
19
|
+
`),process.exit(0));let n=[/-\w*f/.test(t)&&`context`,/-\w*b/.test(t)&&`bump`,/-\w*c/.test(t)&&`commit`,/-\w*t/.test(t)&&`tag`].filter(Boolean);n.length||(n=[`context`,`bump`,`commit`,`tag`]);const r=/-v (\S+)/.exec(t)?.[1],i=/-m (\S+)/.exec(t)?.[1],a=/-\w*d/.test(t);e({flow:n,...r&&{newVersion:r},...i&&{manifest:i},...a&&{dryRun:a}}).catch(e=>{console.error(e),process.exit(1)});export{};
|
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=
|
|
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`)},
|
|
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.
|
|
3
|
+
"version": "0.42.0",
|
|
4
4
|
"description": "🏷️ Modern Release Workflow Helper",
|
|
5
5
|
"author": "kh4f <kh4f.dev@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -20,18 +20,16 @@
|
|
|
20
20
|
"lint": "eslint",
|
|
21
21
|
"release": "bun src/cli"
|
|
22
22
|
},
|
|
23
|
-
"dependencies": {
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"typescript-eslint": "^8.56.1"
|
|
36
|
-
}
|
|
23
|
+
"dependencies": { "semver": "^7.7.4" },
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@eslint/js": "^10.0.1",
|
|
26
|
+
"@stylistic/eslint-plugin": "^5.10.0",
|
|
27
|
+
"@types/node": "^25.3.5",
|
|
28
|
+
"@types/semver": "^7.7.1",
|
|
29
|
+
"eslint": "^10.0.3",
|
|
30
|
+
"jiti": "^2.6.1",
|
|
31
|
+
"tsdown": "^0.21.0",
|
|
32
|
+
"typescript": "^5.9.3",
|
|
33
|
+
"typescript-eslint": "^8.56.1"
|
|
34
|
+
}
|
|
37
35
|
}
|