File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree 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
88
99The command will guide you through the version changes that are detected and will:
1010- Bump the package versions.
11+ - Run the ` version ` hook updating the version info files.
1112- Create new tags and a "release" commit.
1213- Push the commit and tags to the origin.
1314
Original file line number Diff line number Diff line change 3030 "scripts" : {
3131 "lint-fix" : " eslint . --ext .ts" ,
3232 "bump" : " lerna version --conventional-commits" ,
33+ "prerelease" : " lerna run build" ,
3334 "release" : " lerna publish from-git" ,
3435 "build" : " lerna run build" ,
3536 "test" : " lerna run test" ,
36- "prepare" : " husky install"
37+ "prepare" : " husky install" ,
38+ "version" : " ./scripts/version-info.sh"
3739 },
3840 "engines" : {
3941 "node" : " >=16.8.0" ,
Original file line number Diff line number Diff line change 11const packageJson = require ( '../package.json' ) ;
22const fs = require ( 'fs' ) ;
33const path = require ( 'path' ) ;
4- const executablePath = process . cwd ( ) ;
54
65fs . writeFileSync (
7- path . resolve ( executablePath + ' /src/info.ts') ,
6+ path . resolve ( __dirname , '.. /src/info.ts') ,
87 `
98/** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */
109export const LIB_VERSION="${ packageJson . version } ";
Original file line number Diff line number Diff line change 11const packageJson = require ( '../package.json' ) ;
22const fs = require ( 'fs' ) ;
33const path = require ( 'path' ) ;
4- const executablePath = process . cwd ( ) ;
54
65fs . writeFileSync (
7- path . resolve ( executablePath + ' /src/info.ts') ,
6+ path . resolve ( __dirname , '.. /src/info.ts') ,
87 `
98/** DO NOT EDIT: This file is automatically generated by ../scripts/info.js */
109export 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