File tree Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Expand file tree Collapse file tree 2 files changed +23
-8
lines changed Original file line number Diff line number Diff line change @@ -194,8 +194,7 @@ ls packages/core-bridge/releases/
194
194
195
195
npx lerna version patch --force-publish=' *' # or major|minor|etc, or leave out to be prompted. either way, you get a confirmation dialog.
196
196
197
- # replace TODO with the tilde version, like: ~1.5.0
198
- sed -i ' ' ' s/file:\.\.\/.*"/TODO"/g' packages/* /package.json
197
+ node ./scripts/tilde-deps.mjs
199
198
200
199
git add packages
201
200
git commit -m ' Depend on ~1.5.0'
@@ -255,9 +254,3 @@ npm dist-tag rm @temporalio/common/lib/internal-non-workflow next
255
254
npm dist-tag rm @temporalio/create next
256
255
npm dist-tag rm temporalio next
257
256
```
258
-
259
- When we want to deprecate a package:
260
-
261
- ```
262
- npm deprecate temporalio@^1.0.0 "deprecation message that will be logged on install"
263
- ```
Original file line number Diff line number Diff line change
1
+ import fs from 'node:fs/promises' ;
2
+ import path from 'node:path' ;
3
+ import { URL , fileURLToPath } from 'node:url' ;
4
+
5
+ const rootPath = fileURLToPath ( new URL ( '..' , import . meta. url ) ) ;
6
+ const packagesPath = path . join ( rootPath , 'packages' ) ;
7
+ const lernaJsonPath = path . join ( rootPath , 'lerna.json' ) ;
8
+
9
+ const { version } = JSON . parse ( await fs . readFile ( lernaJsonPath , 'utf8' ) ) ;
10
+
11
+ const packages = await fs . readdir ( packagesPath ) ;
12
+ for ( const dir of packages ) {
13
+ const packageJsonPath = path . join ( packagesPath , dir , 'package.json' ) ;
14
+ const packageJson = JSON . parse ( await fs . readFile ( packageJsonPath , 'utf8' ) ) ;
15
+ for ( const dep of Object . keys ( packageJson . dependencies ) ) {
16
+ if ( dep . startsWith ( '@temporalio/' ) ) {
17
+ packageJson . dependencies [ dep ] = `~${ version } ` ;
18
+ }
19
+ }
20
+ const replacedContent = JSON . stringify ( packageJson , null , 2 ) ;
21
+ await fs . writeFile ( packageJsonPath , replacedContent + '\n' ) ;
22
+ }
You can’t perform that action at this time.
0 commit comments