File tree 5 files changed +18
-5
lines changed
5 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ This script will use `lerna version` to check which packages need to be updated
8
8
9
9
The command will guide you through the version changes that are detected and will:
10
10
- Bump the package versions.
11
+ - Run the ` version ` hook updating the version info files.
11
12
- Create new tags and a "release" commit.
12
13
- Push the commit and tags to the origin.
13
14
Original file line number Diff line number Diff line change 30
30
"scripts" : {
31
31
"lint-fix" : " eslint . --ext .ts" ,
32
32
"bump" : " lerna version --conventional-commits" ,
33
+ "prerelease" : " lerna run build" ,
33
34
"release" : " lerna publish from-git" ,
34
35
"build" : " lerna run build" ,
35
36
"test" : " lerna run test" ,
36
- "prepare" : " husky install"
37
+ "prepare" : " husky install" ,
38
+ "version" : " ./scripts/version-info.sh"
37
39
},
38
40
"engines" : {
39
41
"node" : " >=16.8.0" ,
Original file line number Diff line number Diff line change 1
1
const packageJson = require ( '../package.json' ) ;
2
2
const fs = require ( 'fs' ) ;
3
3
const path = require ( 'path' ) ;
4
- const executablePath = process . cwd ( ) ;
5
4
6
5
fs . writeFileSync (
7
- path . resolve ( executablePath + ' /src/info.ts') ,
6
+ path . resolve ( __dirname , '.. /src/info.ts') ,
8
7
`
9
8
/** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */
10
9
export const LIB_VERSION="${ packageJson . version } ";
Original file line number Diff line number Diff line change 1
1
const packageJson = require ( '../package.json' ) ;
2
2
const fs = require ( 'fs' ) ;
3
3
const path = require ( 'path' ) ;
4
- const executablePath = process . cwd ( ) ;
5
4
6
5
fs . writeFileSync (
7
- path . resolve ( executablePath + ' /src/info.ts') ,
6
+ path . resolve ( __dirname , '.. /src/info.ts') ,
8
7
`
9
8
/** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */
10
9
export const LIB_VERSION="${ packageJson . version } ";
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # For TS packages required to pull package version info.
4
+ # Runs on Lerna `version` hook, which is after versions have been bumped accordingly.
5
+
6
+ # Move to the project root
7
+ SCRIPT_DIR=" $( cd " $( dirname " ${BASH_SOURCE[0]} " ) " && pwd ) "
8
+ cd $SCRIPT_DIR /..
9
+
10
+ # Run required version scripts (TODO: centralize)
11
+ node ./packages/sdk-node/scripts/info.js && git add ./packages/sdk-node/src/info.ts
12
+ node ./packages/edge/scripts/info.cjs && git add ./packages/edge/src/info.ts
You can’t perform that action at this time.
0 commit comments