relion 0.37.0 → 0.38.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/dist/index.d.ts +0 -9
- package/dist/index.js +1 -1
- package/package.json +5 -5
package/dist/index.d.ts
CHANGED
|
@@ -5,13 +5,11 @@ interface Config {
|
|
|
5
5
|
* @default []
|
|
6
6
|
*/
|
|
7
7
|
flow?: Step[];
|
|
8
|
-
|
|
9
8
|
/**
|
|
10
9
|
* Explicitly set the version for the upcoming release. If not provided, the version will be determined automatically based on conventional commit messages.
|
|
11
10
|
* @default ''
|
|
12
11
|
*/
|
|
13
12
|
newVersion?: string;
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* Files or bumpers for version update. Each item is either:
|
|
17
15
|
* - a Bumper object specifying `file`, `pattern`, and `replacement`
|
|
@@ -20,31 +18,26 @@ interface Config {
|
|
|
20
18
|
* @default ['package.json']
|
|
21
19
|
*/
|
|
22
20
|
bumpFiles?: (Bumper | string)[];
|
|
23
|
-
|
|
24
21
|
/**
|
|
25
22
|
* Path to the release context output file
|
|
26
23
|
* @default 'RELEASE.md'
|
|
27
24
|
*/
|
|
28
25
|
contextFile?: string;
|
|
29
|
-
|
|
30
26
|
/**
|
|
31
27
|
* Release commit message template
|
|
32
28
|
* @default 'chore(release): {{tag}}'
|
|
33
29
|
*/
|
|
34
30
|
commitMessage?: string;
|
|
35
|
-
|
|
36
31
|
/**
|
|
37
32
|
* Release tag prefix
|
|
38
33
|
* @default 'v'
|
|
39
34
|
*/
|
|
40
35
|
tagPrefix?: string;
|
|
41
|
-
|
|
42
36
|
/**
|
|
43
37
|
* Commit log filters (substrings or regexes)
|
|
44
38
|
* @default [/^feat|^fix|^perf|^style|^docs/, 'BREAKING CHANGE']
|
|
45
39
|
*/
|
|
46
40
|
commitFilters?: (string | RegExp)[];
|
|
47
|
-
|
|
48
41
|
/**
|
|
49
42
|
* Run in dry mode without making any changes
|
|
50
43
|
* @default false
|
|
@@ -55,10 +48,8 @@ type Step = 'bump' | 'context' | 'commit' | 'tag';
|
|
|
55
48
|
interface Bumper {
|
|
56
49
|
/** Path or array of paths to the file(s) to bump version in */
|
|
57
50
|
file: string | string[];
|
|
58
|
-
|
|
59
51
|
/** Pattern to locate the version string (RegExp or a stringified RegExp) */
|
|
60
52
|
pattern: RegExp | string;
|
|
61
|
-
|
|
62
53
|
/** Replacement string for the version (use `{{newVersion}}` as a placeholder) */
|
|
63
54
|
replacement: string;
|
|
64
55
|
}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{readFileSync as e,writeFileSync as t}from"node:fs";import{execSync as n,spawnSync as r}from"node:child_process";import{createInterface as i}from"node:readline";import a from"semver";const o=e=>n(`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()??``})),s=(e,t=[])=>e.filter(e=>t.some(t=>t instanceof RegExp?t.test(e.message):u(t).test(e.message))),c=(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 a.inc(t,n)??(()=>{throw Error(`Failed to increment version '${t}' with release type '${n}'`)})()},l=async()=>{let e=i({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`)})})},u=e=>{let t=/^\/(.+)\/(\w*)$/.exec(e);return t?new RegExp(t[1],t[2]):new RegExp(e)},d=[`context`,`bump`,`commit`,`tag`],f={file:`package.json`,pattern:/(
|
|
1
|
+
import{readFileSync as e,writeFileSync as t}from"node:fs";import{execSync as n,spawnSync as r}from"node:child_process";import{createInterface as i}from"node:readline";import a from"semver";const o=e=>n(`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()??``})),s=(e,t=[])=>e.filter(e=>t.some(t=>t instanceof RegExp?t.test(e.message):u(t).test(e.message))),c=(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 a.inc(t,n)??(()=>{throw Error(`Failed to increment version '${t}' with release type '${n}'`)})()},l=async()=>{let e=i({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`)})})},u=e=>{let t=/^\/(.+)\/(\w*)$/.exec(e);return t?new RegExp(t[1],t[2]):new RegExp(e)},d=[`context`,`bump`,`commit`,`tag`],f={file:`package.json`,pattern:/(version.*?)\d[\w.+-]*/,replacement:`$1{{newVersion}}`},p={flow:[],newVersion:``,bumpFiles:[`package.json`],contextFile:`RELEASE.md`,commitMessage:`chore(release): {{tag}}`,tagPrefix:`v`,commitFilters:[/^feat|^fix|^perf|^style|^docs/,`BREAKING CHANGE`],dryRun:!1},m=async(e,n,r,i,a)=>{if(console.log(`\nAbout to write context to '${e.contextFile}'`),!await l()||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}
|
|
2
2
|
---
|
|
3
3
|
`;o+=s+`
|
|
4
4
|
`;let c=n.map(e=>`[${e.hash}] ${e.message}`).join(`\n${`-`.repeat(30)}\n`);o+=`## Commit Log\n\n\`\`\`\n${c}\n\`\`\``,t(e.contextFile,o,`utf8`)},h=async n=>{let r=n.bumpFiles.map(e=>typeof e==`string`?{...f,file:e}:e);console.log(`\nAbout to bump versions in files: ${r.map(e=>[e.file].flat()).flat().join(`, `)}`),await l()&&r.forEach(r=>{typeof r.pattern==`string`&&(r.pattern=u(r.pattern)),[r.file].flat().forEach(i=>{let a=e(i,`utf8`).replace(r.pattern,r.replacement.replace(`{{newVersion}}`,n.newVersion));n.dryRun||t(i,a,`utf8`)})})},g=async e=>{let t=`git commit -m "${e.commitMessage}"`;console.log(`\nAbout to commit changes: '${t}'`),await l()&&(e.dryRun||n(t,{stdio:`inherit`}))},_=async(e,t,r)=>{let i=`git tag ${r} -m "${e.commitMessage}"`,a=RegExp(`^${e.commitMessage.replace(r,t).replace(/[()]/g,`\\$&`)}$`),o=n(`git log -1 --format=%s`,{encoding:`utf8`}).trim(),s=``;a.test(o)&&(s+=`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "relion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.38.0",
|
|
4
4
|
"description": "🔖 Modern Release Workflow Helper",
|
|
5
5
|
"author": "kh4f <kh4f.dev@gmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,15 +27,15 @@
|
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@eslint/js": "^9.39.2",
|
|
30
|
-
"@stylistic/eslint-plugin": "^5.7.
|
|
31
|
-
"@types/node": "^25.0
|
|
30
|
+
"@stylistic/eslint-plugin": "^5.7.1",
|
|
31
|
+
"@types/node": "^25.1.0",
|
|
32
32
|
"@types/semver": "^7.7.1",
|
|
33
33
|
"eslint": "^9.39.2",
|
|
34
34
|
"jiti": "^2.6.1",
|
|
35
|
-
"tsdown": "^0.
|
|
35
|
+
"tsdown": "^0.20.1",
|
|
36
36
|
"tsx": "^4.21.0",
|
|
37
37
|
"typescript": "^5.9.3",
|
|
38
|
-
"typescript-eslint": "^8.
|
|
38
|
+
"typescript-eslint": "^8.54.0"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "tsdown",
|