File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -98,18 +98,10 @@ Invalidates commits in CHANGELOG.md that contain the considered options
9898
9999Default 'canary', 'beta' or 'alpha' argument for prerelease log command
100100
101- ##### ` cwd ` Default: ` process.cwd() `
102-
103- CWD for cli load config files
104-
105101#### ` packagePath ` Default ` ./package.json ` * /
106102
107103A custom package.json file
108104
109105#### ` lernaPath ` Default ` ./lerna.json ` * /
110106
111- A custom lerna.json file
112-
113- #### ` generiPath ` Default ` ./generi.json ` * /
114-
115- A custom generi.json file
107+ A custom lerna.json file
Original file line number Diff line number Diff line change 88 "release" : true ,
99 "publish" : true ,
1010 "exclude" : [" typo" ],
11- "prerelease" : " beta"
11+ "prerelease" : " beta" ,
12+ "cwd" : false ,
13+ "packagePath" : false ,
14+ "lernaPath" : false ,
15+ "generiPath" : false
1216}
Original file line number Diff line number Diff line change 3434 ],
3535 "scripts" : {
3636 "dev" : " pnpm build && node ." ,
37- "build" : " tsdown src/index.ts --minify --clean" ,
38- "build:watch" : " tsdown src/index.ts --minify --clean --watch" ,
37+ "build" : " tsup src/index.ts --minify --clean" ,
38+ "build:watch" : " tsup src/index.ts --minify --clean --watch" ,
3939 "test" : " vitest run --coverage" ,
4040 "test:dev" : " vitest" ,
4141 "format" : " prettier --write src/ tests/" ,
6262 "@types/node" : " ^24.9.1" ,
6363 "@vitest/coverage-v8" : " 3.2.4" ,
6464 "prettier" : " ^3.6.2" ,
65- "tsdown " : " ^0.15.9 " ,
65+ "tsup " : " ^8.5.0 " ,
6666 "typescript" : " ^5.9.3" ,
6767 "vite" : " ^7.1.11" ,
6868 "vitest" : " ^3.2.4"
Original file line number Diff line number Diff line change 88 "release" : false ,
99 "exclude" : [" typo" ],
1010 "prerelease" : " beta" ,
11- "cwd" : false ,
1211 "packagePath" : false ,
13- "lernaPath" : false ,
14- "generiPath" : false
12+ "lernaPath" : false
1513}
Original file line number Diff line number Diff line change @@ -7,14 +7,17 @@ export const getGeneri = (): GeneriOptions => {
77 return destr < GeneriOptions > ( getFile ( getConfigRoot ( ) ) ) ;
88} ;
99
10- export const getGeneriConfig = ( ) => config ;
1110const config = getGeneri ( ) ;
11+ export const getGeneriConfig = ( ) => config ;
1212
1313export const isSilent = ( ) => config . silent ;
1414export const isTag = ( ) => config . tag ;
1515export const isVersion = ( ) => config . version ;
1616export const isConventionalCommits = ( ) => config . commits === 'conventional-commits' ;
1717
18+ export const pkgConfig = config ?. packagePath || 'package.json' ;
19+ export const lernaConfig = config ?. lernaPath || 'lerna.json' ;
20+
1821export const setGeneriConfig = ( generi : GeneriOptions ) => {
1922 setFile ( getConfigRoot ( ) , generi ) ;
2023
Original file line number Diff line number Diff line change @@ -70,17 +70,11 @@ export interface GeneriOptions {
7070 /* default 'beta' or 'alpha' argument for pre(patch|minor|major) log command */
7171 prerelease ?: GitPrerelease ;
7272
73- /* default process.cwd() */
74- cwd ?: Maybe < string > ;
75-
7673 /* package.json custom path. default option.cwd + ./package.json */
7774 packagePath ?: Maybe < string > ;
7875
7976 /* lerna.json custom path. default option.cwd + ./lerna.json */
8077 lernaPath ?: Maybe < string > ;
81-
82- /* generi.json custom path. default option.cwd + ./generi.json */
83- generiPath ?: Maybe < string > ;
8478}
8579
8680export type GeneriConventionalCommits =
Original file line number Diff line number Diff line change @@ -5,16 +5,12 @@ import { error } from './console';
55import { isCleanChanges } from './git' ;
66import { GitNewTag } from './types' ;
77import { destr } from 'destr' ;
8- import { getGeneriConfig } from './generi' ;
8+ import { lernaConfig , pkgConfig } from './generi' ;
99
1010export const getRoot = ( ) : string => {
11- return getGeneriConfig ( ) . cwd || process . cwd ( ) ;
11+ return process . cwd ( ) ;
1212} ;
1313
14- const pkgConfig = getGeneriConfig ( ) . packagePath || 'package.json' ;
15- const lernaConfig = getGeneriConfig ( ) . lernaPath || 'lerna.json' ;
16- const generiConfig = getGeneriConfig ( ) . generiPath || 'generi.json' ;
17-
1814export const getPackageRoot = ( p : string = pkgConfig ) => {
1915 return path . join ( getRoot ( ) , p ) ;
2016} ;
@@ -23,7 +19,7 @@ export const getLernaRoot = (p: string = lernaConfig) => {
2319 return path . join ( getRoot ( ) , p ) ;
2420} ;
2521
26- export const getConfigRoot = ( p : string = generiConfig ) => {
22+ export const getConfigRoot = ( p : string = 'generi.json' ) => {
2723 return path . join ( getRoot ( ) , p ) ;
2824} ;
2925
You can’t perform that action at this time.
0 commit comments