File tree Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Expand file tree Collapse file tree 3 files changed +28
-1
lines changed Original file line number Diff line number Diff line change 33
33
- name : Install Dependencies And Build
34
34
run : pnpm i
35
35
36
+ - name : Package Alias Copy
37
+ run : pnpm pkg:alias
38
+
36
39
- name : Publish to NPM
37
40
run : pnpm -r publish --access public --no-git-checks
38
41
env :
Original file line number Diff line number Diff line change 14
14
"play" : " npm -C playground run dev" ,
15
15
"lint" : " eslint --cache ." ,
16
16
"lint:fix" : " pnpm lint --fix" ,
17
+ "pkg:alias" : " esno ./scripts/cli-pkg-alias.ts" ,
17
18
"postinstall" : " pnpm build" ,
18
19
"release" : " bumpp -r" ,
19
20
"stub" : " pnpm -r --filter=./packages/* --parallel run stub" ,
75
76
" eslint --cache --fix"
76
77
]
77
78
}
78
- }
79
+ }
Original file line number Diff line number Diff line change
1
+ import path from 'node:path'
2
+ import { fileURLToPath } from 'node:url'
3
+ import fs from 'fs-extra'
4
+
5
+ const dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
6
+ const root = path . join ( dirname , '..' )
7
+ const gptRunnerCliPkgPath = path . join ( root , './packages/gpt-runner-cli' )
8
+ const gptrPkgPath = path . join ( root , './packages/gptr' )
9
+
10
+ async function cloneToGptrAliasPkg ( ) {
11
+ const pkgJsonPath = path . join ( gptRunnerCliPkgPath , 'package.json' )
12
+ const gptrPkgJsonPath = path . join ( gptrPkgPath , 'package.json' )
13
+ const rawJSON = await fs . readFile ( pkgJsonPath , 'utf-8' )
14
+ const pkg = JSON . parse ( rawJSON )
15
+ pkg . name = 'gptr'
16
+
17
+ await fs . ensureDir ( gptrPkgPath )
18
+ await fs . copy ( gptRunnerCliPkgPath , gptrPkgPath )
19
+
20
+ await fs . writeJSON ( gptrPkgJsonPath , pkg , { spaces : 2 } )
21
+ }
22
+
23
+ cloneToGptrAliasPkg ( )
You can’t perform that action at this time.
0 commit comments