Skip to content

Commit 66e85cb

Browse files
authored
chore: Minor fixes to contrib guide (#952)
1 parent c116163 commit 66e85cb

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ ls packages/core-bridge/releases/
194194

195195
npx lerna version patch --force-publish='*' # or major|minor|etc, or leave out to be prompted. either way, you get a confirmation dialog.
196196

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
199198

200199
git add packages
201200
git commit -m 'Depend on ~1.5.0'
@@ -255,9 +254,3 @@ npm dist-tag rm @temporalio/common/lib/internal-non-workflow next
255254
npm dist-tag rm @temporalio/create next
256255
npm dist-tag rm temporalio next
257256
```
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-
```

scripts/tilde-deps.mjs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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+
}

0 commit comments

Comments
 (0)