Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
steps:
# For some unknown reason, execution of TSC may sometime introduce a CRLF/LF mismatch on some
# pure JS files that are preserved in the repo, which would later cause a failure when trying
# to publish packages to Verdaccio, as Lerna requires that the Git repo be clean.
# to publish packages to Verdaccio, as `pnpm publish` requires that the Git repo be clean.
- name: Set git config
run: git config --global core.autocrlf false

Expand Down Expand Up @@ -178,7 +178,7 @@ jobs:
working-directory: ${{ runner.temp }}

- name: Compile code
run: pnpm run build --ignore @temporalio/core-bridge
run: pnpm --recursive --stream --filter '!@temporalio/core-bridge' run build

- name: Publish to Verdaccio
run: pnpm tsx scripts/publish-to-verdaccio.ts --registry-dir ${{ steps.tmp-dir.outputs.dir }}/npm-registry
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/conventions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

# eslint-import-resolver-typescript requires packages to be built
- name: Compile all non-rust code
run: pnpm run build --ignore @temporalio/core-bridge
run: pnpm --recursive --stream --filter '!@temporalio/core-bridge' run build

- run: pnpm run lint.check
- run: pnpm run lint.prune
- run: pnpm run lint:check
- run: pnpm run lint:prune
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
node-version: '22'
platform: 'linux-x64'

- run: pnpm run build --ignore @temporalio/core-bridge
- run: pnpm --recursive --stream --filter '!@temporalio/core-bridge' run build

- name: Build docs
run: pnpm run docs
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ jobs:
save-cache: ${{ env.IS_MAIN_OR_RELEASE }}

- name: Compile code
run: pnpm run build --ignore @temporalio/core-bridge
run: pnpm --recursive --stream --filter '!@temporalio/core-bridge' run build

- name: Publish to Verdaccio
run: pnpm tsx scripts/publish-to-verdaccio.ts --registry-dir ./tmp/registry
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ node_modules/
lib/
*.tsbuildinfo
build/
lerna*.log
packages/test/protos/json-module.js
packages/test/protos/root.d.ts
packages/testing/test-server*
Expand Down
1 change: 0 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ lib
packages/*/CHANGELOG.md
packages/docs/docs/api
typedoc-sidebar.js
lerna.json
pnpm-lock.yaml
packages/proto/protos/root.d.ts
packages/proto/protos/json-module.js
Expand Down
132 changes: 7 additions & 125 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ pnpm run build
If building fails, resetting your environment may help:

```
pnpm dlx lerna clean -y && pnpm install --frozen-lockfile
pnpm run clean -y
pnpm install --frozen-lockfile
```

If `pnpm install` fails in `@temporalio/core-bridge` on the command `pnpm tsx ./scripts/build.ts`, you may
Expand All @@ -104,9 +105,9 @@ After your environment is set up, you can run these commands:

- `pnpm run build` compiles protobuf definitions, Rust bridge, C++ isolate extension, and Typescript.
- `pnpm run rebuild` deletes all generated files in the project and reruns build.
- `pnpm run build.watch` watches filesystem for changes and incrementally compiles Typescript on change.
- `pnpm run build:watch` watches filesystem for changes and incrementally compiles Typescript on change.
- `pnpm run test` runs the test suite.
- `pnpm run test.watch` runs the test suite on each change to Typescript files.
- `pnpm run test:watch` runs the test suite on each change to Typescript files.
- `pnpm run format` formats code with prettier.
- `pnpm run lint` verifies code style with prettier and ES lint.
- `pnpm run commitlint` validates [commit messages](#style-guide).
Expand Down Expand Up @@ -138,11 +139,10 @@ pnpm run rebuild
TMP_DIR=$( mktemp -d )

pnpm tsx scripts/publish-to-verdaccio.ts --registry-dir "$TMP_DIR"
pnpm tsx scripts/init-from-verdaccio.ts --registry-dir "$TMP_DIR" --sample hello-world
pnpm tsx scripts/init-from-verdaccio.ts --registry-dir "$TMP_DIR" --target-dir "./example" --sample hello-world
pnpm tsx scripts/test-example.ts --work-dir "./example"

cd "$TMP_DIR/example"
pnpm run build
pnpm tsx scripts/test-example.ts --work-dir "$TMP_DIR/example"
rm -rf ./example "$TMP_DIR"
```

### Style Guide
Expand Down Expand Up @@ -192,121 +192,3 @@ done
```

To install both tools: `npm i -g npm-check npm-check-updates`.

## Publishing

First, download the latest native artifacts from GitHub Actions.

Then run the following commands:

```sh
cargo install git-cliff
```

```sh
# git-cliff --tag <new version> <current version>..HEAD | pbcopy
git-cliff --tag 1.0.1 v1.0.0..HEAD | pbcopy
```

- Paste into [CHANGELOG.md](CHANGELOG.md)
- Clean up formatting
- Add any important missing details
- If core has been updated, include a note in the release about from which commit to which commit, and you should review the commits to see if there were any breaking changes that must be called out.
- Replace PR numbers with links:

```
#(\d{3})
[#$1](https://github.com/temporalio/sdk-typescript/pull/$1)
```

- If PRs came from external contributors, thank them & link their github handles: `([#484](link), thanks to [`@user`](https://github.com/user) 🙏)`
- Open PR with CHANGELOG change
- If using a custom [features](https://github.com/temporalio/features) branch for PR integration tests, make
sure the branch is fully up-to-date with `features` `main` before merging the CHANGELOG PR
- Merge PR
- Checkout latest `main`

We're [working on automating](https://github.com/temporalio/sdk-typescript/pull/395) the rest of the process:

- Log in to npm as `temporal-sdk-team` (`npm whoami` and `npm login`)
- Download the 5 `packages-*` artifacts from the PR's [GitHub Action](https://github.com/temporalio/sdk-typescript/actions)
- Publish:

```sh
#!/bin/bash
set -euo pipefail

git clean -fdx
pnpm install --frozen-lockfile
pnpm run build

mkdir -p packages/core-bridge/releases

# in the next command, replace ~/gh/release-sdk-typescript with your dir
for f in ~/Downloads/packages-*.zip; do mkdir "$HOME/Downloads/$(basename -s .zip $f)"; (cd "$HOME/Downloads/$(basename -s .zip $f)" && unzip $f && tar -xvzf @temporalio/core-bridge/core-bridge-*.tgz package/releases/ && cp -r package/releases/* ~/gh/release-sdk-typescript/packages/core-bridge/releases/); done

# we should now have all 5 build targets
ls packages/core-bridge/releases/

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

git checkout -B fix-deps
pnpm tsx scripts/prepublish.ts
git commit -am 'Fix dependencies'
pnpm exec lerna publish from-package # add `--dist-tag next` for pre-release versions
git checkout -
```

Finally:

```
npm deprecate temporalio@^1.0.0 "Instead of installing temporalio, we recommend directly installing our packages: npm remove temporalio; npm install @temporalio/client @temporalio/worker @temporalio/workflow @temporalio/activity"
```

- Cleanup after publishing:

```sh
rm -rf $HOME/Downloads/packages-*
rm -rf packages/core-bridge/releases/*
```

- If using a custom [features](https://github.com/temporalio/features/) branch for PR integration tests, merge
that branch into features `main` and update the SDK workflow definition to trigger `features` `main`

- If any APIs have changed, open a PR to update [`samples-typescript`](https://github.com/temporalio/samples-typescript/). Once merged, update the `next` branch:

```sh
git checkout next
git rebase origin/main
git push
```

- While our tests should capture most things, if you want to verify the release works in the samples, do:

```sh
cd /path/to/samples-typescript
lerna exec -- npm update
npm run build
npm test
```

### Updating published packages

`npm` commands we may need to use:

If we publish a version like `1.1.0-rc.1` with tag `next`, we untag it after `1.1.0` is released:

```
npm dist-tag rm @temporalio/client next
npm dist-tag rm @temporalio/worker next
npm dist-tag rm @temporalio/workflow next
npm dist-tag rm @temporalio/activity next
npm dist-tag rm @temporalio/testing next
npm dist-tag rm @temporalio/common next
npm dist-tag rm @temporalio/proto next
npm dist-tag rm @temporalio/interceptors-opentelemetry next
npm dist-tag rm @temporalio/common/lib/internal-workflow next
npm dist-tag rm @temporalio/common/lib/internal-non-workflow next
npm dist-tag rm @temporalio/create next
npm dist-tag rm temporalio next
```
14 changes: 0 additions & 14 deletions lerna.json

This file was deleted.

17 changes: 8 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,17 @@
"files": [],
"scripts": {
"rebuild": "pnpm run clean && pnpm run build",
"build": "lerna run --stream build",
"build.watch": "pnpm run build:protos && tsc --build --watch packages/*/tsconfig.json",
"build": "pnpm --recursive --stream run build",
"build:watch": "pnpm run build:protos && tsc --build --watch packages/*/tsconfig.json",
"build:protos": "tsx ./packages/proto/scripts/compile-proto.ts",
"test": "lerna run --stream test",
"test.watch": "lerna run --stream test.watch",
"test": "pnpm --recursive --stream run test",
"test:watch": "pnpm --recursive --stream run test:watch",
"ci-stress": "node ./packages/test/lib/load/run-all-stress-ci-scenarios.js",
"ci-nightly": "node ./packages/test/lib/load/run-all-nightly-scenarios.js",
"lint": "eslint packages/*/src --ext .ts --no-error-on-unmatched-pattern --fix && prettier --write . && lerna run --no-bail --stream lint",
"lint.check": "eslint packages/*/src --ext .ts --no-error-on-unmatched-pattern && prettier --end-of-line auto --check . && lerna run --no-bail --stream lint.check",
"lint.prune": "ts-prune --error -p tsconfig.prune.json --ignore \"used in module\" --skip \".d.ts\"",
"format": "prettier --write . && lerna run --no-bail --stream format",
"lint": "eslint packages/*/src --ext .ts --no-error-on-unmatched-pattern --fix && prettier --write . && pnpm --recursive --stream run lint",
"lint:check": "eslint packages/*/src --ext .ts --no-error-on-unmatched-pattern && prettier --end-of-line auto --check . && pnpm --recursive --stream run lint:check",
"lint:prune": "ts-prune --error -p tsconfig.prune.json --ignore \"used in module\" --skip \".d.ts\"",
"format": "prettier --write . && pnpm --recursive --stream run format",
"clean": "tsx ./scripts/clean.ts",
"docs": "cd packages/docs && pnpm run maybe-install-deps-and-build-docs",
"ava": "pnpm -C packages/test exec ava"
Expand Down Expand Up @@ -77,7 +77,6 @@
"eslint-plugin-tsdoc": "^0.2.17",
"fs-extra": "^11.2.0",
"json5": "^2.2.3",
"lerna": "^8.2.4",
"prettier": "^3.1.1",
"ts-prune": "^0.10.3",
"tsx": "^4.20.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/core-bridge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"build-rust-release": "pnpm run build-rust --release",
"format": "cargo fmt",
"lint": "cargo clippy --fix --allow-staged",
"lint.check": "cargo clippy"
"lint:check": "cargo clippy"
},
"keywords": [
"temporal",
Expand Down
4 changes: 2 additions & 2 deletions packages/create-project/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"type": "module",
"scripts": {
"build": "tsc --build",
"build.watch": "tsc --build --watch",
"build:watch": "tsc --build --watch",
"test": "ava ./lib/**/*.test.js",
"test.watch": "ava --watch ./lib/**/*.test.js"
"test:watch": "ava --watch ./lib/**/*.test.js"
},
"keywords": [
"temporal",
Expand Down
2 changes: 1 addition & 1 deletion packages/test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"build:ts": "tsc --build",
"build:protos": "tsx ./scripts/compile-proto.ts",
"test": "ava ./lib/test-*.js",
"test.watch": "ava --watch ./lib/test-*.js"
"test:watch": "ava --watch ./lib/test-*.js"
},
"ava": {
"timeout": "60s",
Expand Down
Loading
Loading