Skip to content

Commit a261054

Browse files
authored
docs: Deprecate temporalio meta package (#747)
- Fixes #727
1 parent 31f7885 commit a261054

File tree

19 files changed

+240
-125
lines changed

19 files changed

+240
-125
lines changed

CONTRIBUTING.md

Lines changed: 41 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,44 @@
11
# How to Contribute
22

3+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
4+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
5+
6+
**Table of Contents**
7+
8+
- [Maintenance](#maintenance)
9+
- [Getting started](#getting-started)
10+
- [Contributor License Agreement (CLA)](#contributor-license-agreement-cla)
11+
- [SDK Structure](#sdk-structure)
12+
- [Environment setup](#environment-setup)
13+
- [Development](#development)
14+
- [Testing](#testing)
15+
- [Testing local changes to core](#testing-local-changes-to-core)
16+
- [Integration tests](#integration-tests)
17+
- [test-npm-init](#test-npm-init)
18+
- [Style Guide](#style-guide)
19+
- [Publishing](#publishing)
20+
- [Updating the Java test server proto files](#updating-the-java-test-server-proto-files)
21+
22+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
23+
324
The TypeScript SDK (as well as the rest of the Temporal codebase) is open sourced under the MIT license.
425

5-
We welcome contributions from the community. To contribute please start by opening an [issue](https://github.com/temporalio/sdk-typescript/issues) and discussing the proposed change. Once a change has been agreed upon, development may start and be submitted via a [pull request](https://github.com/temporalio/sdk-typescript/pulls).
26+
We welcome contributions from the community. To contribute, please start by opening an [issue](https://github.com/temporalio/sdk-typescript/issues) and discussing the proposed change. Once a change has been agreed upon, development may start and be submitted via a [pull request](https://github.com/temporalio/sdk-typescript/pulls).
27+
28+
## Maintenance
29+
30+
The current maintainers are:
31+
32+
- [Loren `lorensr`](https://github.com/lorensr)
33+
- [Roey `bergundy`](https://github.com/bergundy)
34+
35+
If you'd like to join us, [email Loren](mailto:loren@temporal.io). We'd be happy to have help with any of these things:
36+
37+
- Triaging issues
38+
- Reviewing PRs
39+
- Submitting PRs to close issues
40+
41+
## Getting started
642

743
### Contributor License Agreement (CLA)
844

@@ -14,7 +50,7 @@ See [sdk-structure.md](./docs/sdk-structure.md)
1450

1551
### Environment setup
1652

17-
- Install the system dependencies listed in [Getting started > Step 0: Prerequisites](https://docs.temporal.io/node/getting-started/#step-0-prerequisites)
53+
- Install Node 16 and [Temporal Server](https://github.com/temporalio/docker-compose#temporal-server-docker-compose-files)
1854
- Install the [Rust toolchain](https://rustup.rs/)
1955
- Clone the [sdk-typescript](https://github.com/temporalio/sdk-typescript) repo:
2056
```sh
@@ -48,7 +84,7 @@ To update to the latest version of the Core SDK, run `git submodule update` foll
4884

4985
> For cross compilation on MacOS follow [these instructions](https://github.com/temporalio/sdk-typescript/blob/main/docs/building.md) (only required for publishing packages).
5086
51-
### Development Workflow
87+
## Development
5288

5389
After your environment is set up, you can run these commands:
5490

@@ -106,7 +142,7 @@ chore(samples): upgrade commander module
106142

107143
The `scope` options are listed in [commitlint.config.js](https://github.com/temporalio/sdk-typescript/blob/main/commitlint.config.js).
108144

109-
### Publishing
145+
## Publishing
110146

111147
First, follow the instructions in [docs/building.md](docs/building.md).
112148

@@ -165,7 +201,7 @@ npx lerna publish from-git # add `--dist-tag next` for pre-release versions
165201
rm $HOME/Downloads/packages-*
166202
```
167203

168-
### Updating the Java test server proto files
204+
## Updating the Java test server proto files
169205

170206
[These files](https://github.com/temporalio/sdk-java/tree/master/temporal-test-server/src/main/proto) are taken from the `sdk-java` repo.
171207

README.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Temporal TypeScript SDK
2+
3+
<p align="center">
4+
<a href="https://www.npmjs.com/package/temporalio">
5+
<img src="https://img.shields.io/npm/v/temporalio.svg?style=for-the-badge" alt="NPM" />
6+
</a>
7+
<img src="https://img.shields.io/npm/l/temporalio?style=for-the-badge" alt="LICENSE" />
8+
</div>
9+
10+
[Temporal](https://temporal.io) is a microservice orchestration platform that enables developers to build scalable applications without sacrificing productivity or reliability. Temporal Server executes units of application logic—Workflows—in a resilient manner that automatically handles intermittent failures and retries failed operations.
11+
12+
Temporal is a mature technology—it's a fork of Uber's Cadence. Temporal is being developed by Temporal Technologies, a startup by the creators of Cadence.
13+
14+
## Documentation
15+
16+
The documentation is divided into several sections:
17+
18+
- [TypeScript SDK docs](https://docs.temporal.io/typescript/introduction)
19+
- [TypeScript SDK API reference](https://typescript.temporal.io/)
20+
- [General Temporal docs](https://docs.temporal.io)
21+
22+
We welcome help improving the docs. You can submit issues for things that aren't clear or send pull requests to this repository (for the API reference) or to the [`docs.temporal.io` repository](https://github.com/temporalio/documentation) (for everything else).
23+
24+
## Contributors
25+
26+
[/sdk-typescript/graphs/contributors](https://github.com/temporalio/sdk-typescript/graphs/contributors)
27+
28+
Thank you to everyone who has contributed 😃🙌
29+
30+
## Contributing
31+
32+
We welcome issues and PRs! Read our [contributing guide](CONTRIBUTING.md) to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to the SDK.

package.json

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,56 @@
11
{
2+
"name": "typescript-sdk",
23
"private": true,
4+
"keywords": [
5+
"temporal",
6+
"workflow",
7+
"isolate"
8+
],
9+
"homepage": "https://github.com/temporalio/sdk-typescript#readme",
10+
"bugs": {
11+
"url": "https://github.com/temporalio/sdk-typescript/issues"
12+
},
13+
"repository": {
14+
"type": "git",
15+
"url": "git+https://github.com/temporalio/sdk-typescript.git"
16+
},
17+
"license": "MIT",
18+
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
319
"directories": {
420
"doc": "docs"
521
},
22+
"files": [],
23+
"scripts": {
24+
"rebuild": "npm run clean && npm run build",
25+
"build": "lerna run --stream build",
26+
"build.watch": "lerna run --stream build.watch",
27+
"test": "lerna run --stream test",
28+
"test.watch": "lerna run --stream test.watch",
29+
"ci-build-no-rust": "lerna run --ignore @temporalio/core-bridge --stream build",
30+
"ci-stress": "node ./packages/test/lib/load/run-all-stress-ci-scenarios.js",
31+
"ci-nightly": "node ./packages/test/lib/load/run-all-nightly-scenarios.js",
32+
"wait-namespace": "node ./scripts/wait-on-temporal.mjs",
33+
"lint": "eslint packages/*/src --ext .ts --no-error-on-unmatched-pattern && prettier --end-of-line auto --check .",
34+
"lint.prune": "ts-prune -p tsconfig.prune.json --ignore \"used in module\" --skip \".d.ts\"",
35+
"commitlint": "commitlint --from origin/main",
36+
"format": "prettier --write .",
37+
"clean": "node ./scripts/clean.mjs",
38+
"docs": "lerna run --stream maybe-install-deps-and-build-docs"
39+
},
40+
"dependencies": {
41+
"@temporalio/client": "file:packages/client",
42+
"@temporalio/common": "file:packages/common",
43+
"@temporalio/create": "file:packages/create-project",
44+
"@temporalio/interceptors-opentelemetry": "file:packages/interceptors-opentelemetry",
45+
"@temporalio/internal-non-workflow-common": "file:packages/internal-non-workflow-common",
46+
"@temporalio/internal-workflow-common": "file:packages/internal-workflow-common",
47+
"@temporalio/proto": "file:packages/proto",
48+
"@temporalio/test": "file:packages/test",
49+
"@temporalio/testing": "file:packages/testing",
50+
"@temporalio/worker": "file:packages/worker",
51+
"@temporalio/workflow": "file:packages/workflow",
52+
"temporalio": "file:packages/meta"
53+
},
654
"devDependencies": {
755
"@commitlint/cli": "^17.0.2",
856
"@commitlint/config-conventional": "^17.0.2",
@@ -46,54 +94,6 @@
4694
"typescript": "^4.7.4",
4795
"uuid": "^8.3.2"
4896
},
49-
"scripts": {
50-
"rebuild": "npm run clean && npm run build",
51-
"build": "lerna run --stream build",
52-
"build.watch": "lerna run --stream build.watch",
53-
"test": "lerna run --stream test",
54-
"test.watch": "lerna run --stream test.watch",
55-
"ci-build-no-rust": "lerna run --ignore @temporalio/core-bridge --stream build",
56-
"ci-stress": "node ./packages/test/lib/load/run-all-stress-ci-scenarios.js",
57-
"ci-nightly": "node ./packages/test/lib/load/run-all-nightly-scenarios.js",
58-
"wait-namespace": "node ./scripts/wait-on-temporal.mjs",
59-
"lint": "eslint packages/*/src --ext .ts --no-error-on-unmatched-pattern && prettier --end-of-line auto --check .",
60-
"lint.prune": "ts-prune -p tsconfig.prune.json --ignore \"used in module\" --skip \".d.ts\"",
61-
"commitlint": "commitlint --from origin/main",
62-
"format": "prettier --write .",
63-
"clean": "node ./scripts/clean.mjs",
64-
"docs": "lerna run --stream maybe-install-deps-and-build-docs"
65-
},
66-
"repository": {
67-
"type": "git",
68-
"url": "git+https://github.com/temporalio/sdk-typescript.git"
69-
},
70-
"keywords": [
71-
"temporal",
72-
"workflow",
73-
"isolate"
74-
],
75-
"author": "Temporal Technologies Inc. <sdk@temporal.io>",
76-
"license": "MIT",
77-
"bugs": {
78-
"url": "https://github.com/temporalio/sdk-typescript/issues"
79-
},
80-
"homepage": "https://github.com/temporalio/sdk-typescript#readme",
81-
"files": [],
82-
"name": "typescript-sdk",
83-
"dependencies": {
84-
"@temporalio/client": "file:packages/client",
85-
"@temporalio/common": "file:packages/common",
86-
"@temporalio/create": "file:packages/create-project",
87-
"@temporalio/interceptors-opentelemetry": "file:packages/interceptors-opentelemetry",
88-
"@temporalio/internal-non-workflow-common": "file:packages/internal-non-workflow-common",
89-
"@temporalio/internal-workflow-common": "file:packages/internal-workflow-common",
90-
"@temporalio/proto": "file:packages/proto",
91-
"@temporalio/test": "file:packages/test",
92-
"@temporalio/testing": "file:packages/testing",
93-
"@temporalio/worker": "file:packages/worker",
94-
"@temporalio/workflow": "file:packages/workflow",
95-
"temporalio": "file:packages/meta"
96-
},
9797
"engines": {
9898
"node": ">= 14.0.0",
9999
"npm": ">= 6.0.0",

packages/create-project/.npmignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.test.ts
2+
*.test.js
3+
test/

packages/create-project/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"type": "module",
88
"scripts": {
99
"build": "tsc --build",
10-
"build.watch": "tsc --build --watch"
10+
"build.watch": "tsc --build --watch",
11+
"test": "ava ./lib/**/*.test.js",
12+
"test.watch": "ava --watch ./lib/**/*.test.js"
1113
},
1214
"keywords": [
1315
"temporal",

packages/create-project/src/create-project.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from './helpers/samples.js';
1717
import { makeDir } from './helpers/make-dir.js';
1818
import { tryGitInit } from './helpers/git.js';
19-
import { install, updateNodeVersion, replaceTemporalVersion } from './helpers/install.js';
19+
import { install, updateNodeVersion, replaceSdkVersion } from './helpers/install.js';
2020
import { testIfThisComputerIsOnline } from './helpers/is-online.js';
2121
import { isWriteable } from './helpers/is-writeable.js';
2222
import { getErrorCode } from './helpers/get-error-code.js';
@@ -29,14 +29,14 @@ export async function createApp({
2929
appPath,
3030
useYarn,
3131
gitInit,
32-
temporalioVersion,
32+
sdkVersion,
3333
sample,
3434
samplePath,
3535
}: {
3636
appPath: string;
3737
useYarn: boolean;
3838
gitInit?: boolean;
39-
temporalioVersion?: string;
39+
sdkVersion?: string;
4040
sample: string;
4141
samplePath?: string;
4242
}): Promise<void> {
@@ -178,8 +178,8 @@ export async function createApp({
178178
console.log();
179179

180180
await updateNodeVersion({ root });
181-
if (temporalioVersion) {
182-
await replaceTemporalVersion({ root, useYarn, temporalioVersion });
181+
if (sdkVersion) {
182+
await replaceSdkVersion({ root, useYarn, sdkVersion });
183183
}
184184

185185
await install({ root, useYarn });
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import test from 'ava';
2+
import dedent from 'dedent';
3+
import { readFile, rm, writeFile } from 'fs/promises';
4+
import os from 'os';
5+
import path from 'path';
6+
import { v4 as uuid } from 'uuid';
7+
import { replaceSdkVersion } from './install.js';
8+
import { makeDir } from './make-dir.js';
9+
10+
test('replaceSdkVersion according to configured level', async (t) => {
11+
console.log('debug windows');
12+
// console.log('import.meta.url', import.meta.url);
13+
// console.log('URL', new URL('../../test', import.meta.url));
14+
const tempDir = path.join(os.tmpdir(), uuid());
15+
console.log('tempDir:', tempDir);
16+
await makeDir(tempDir);
17+
18+
// const { pathname: tempDir } = new URL('../../test', import.meta.url);
19+
const packageJson = path.join(tempDir, 'package.json');
20+
console.log('packageJson', packageJson);
21+
await writeFile(
22+
packageJson,
23+
dedent`
24+
{
25+
"name": "test-create-project",
26+
"version": "0.1.0",
27+
"private": true,
28+
"dependencies": {
29+
"@temporalio/activity": "^1.0.0",
30+
"@temporalio/client": "^1.0.0",
31+
"@temporalio/worker": "^1.0.0",
32+
"@temporalio/workflow": "^1.0.0",
33+
"nanoid": "3.x"
34+
}
35+
}
36+
`
37+
);
38+
39+
await replaceSdkVersion({ root: tempDir, sdkVersion: 'foo' });
40+
const replaced = JSON.parse(await readFile(packageJson, 'utf8'));
41+
t.is(replaced.dependencies['@temporalio/activity'], 'foo');
42+
t.is(replaced.dependencies['@temporalio/client'], 'foo');
43+
t.is(replaced.dependencies.nanoid, '3.x');
44+
45+
await rm(tempDir, { recursive: true });
46+
});

packages/create-project/src/helpers/install.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface InstallArgs {
1111
* Indicate whether to install packages using Yarn.
1212
*/
1313
useYarn?: boolean;
14-
temporalioVersion?: string;
14+
sdkVersion?: string;
1515
}
1616

1717
/**
@@ -53,10 +53,14 @@ export async function updateNodeVersion({ root }: InstallArgs): Promise<void> {
5353
}
5454
}
5555

56-
export async function replaceTemporalVersion({ root, temporalioVersion }: InstallArgs): Promise<void> {
56+
export async function replaceSdkVersion({ root, sdkVersion }: InstallArgs): Promise<void> {
5757
const fileName = `${root}/package.json`;
5858

5959
const packageJson = JSON.parse(await readFile(fileName, 'utf8'));
60-
packageJson.dependencies.temporalio = temporalioVersion;
60+
for (const packageName in packageJson.dependencies) {
61+
if (packageName.startsWith('@temporalio/')) {
62+
packageJson.dependencies[packageName] = sdkVersion;
63+
}
64+
}
6165
await writeFile(fileName, JSON.stringify(packageJson));
6266
}

packages/create-project/src/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ const program = new Command(packageJson.name)
5858
`
5959
)
6060
.option(
61-
'--temporalio-version <version>',
61+
'--sdk-version <version>',
6262
dedent`
63-
Specify which version of the temporalio npm package to use
63+
Specify which version of the @temporalio/* npm packages to use
6464
`
6565
)
6666
.allowUnknownOption()
@@ -72,7 +72,7 @@ interface Options {
7272
listSamples?: boolean;
7373
sample?: string;
7474
samplePath?: string;
75-
temporalioVersion?: string;
75+
sdkVersion?: string;
7676
}
7777

7878
let opts: Options;
@@ -170,7 +170,7 @@ async function start(): Promise<void> {
170170
appPath: resolvedProjectPath,
171171
useYarn: !!opts.useYarn,
172172
gitInit: opts.gitInit,
173-
temporalioVersion: opts.temporalioVersion,
173+
sdkVersion: opts.sdkVersion,
174174
sample: sample.trim(),
175175
samplePath: typeof opts.samplePath === 'string' ? opts.samplePath.trim() : undefined,
176176
});

packages/create-project/tsconfig.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
"outDir": "./lib",
55
"rootDir": "./src",
66
"resolveJsonModule": true,
7-
"lib": ["dom"],
87
"module": "esnext"
98
},
109
"include": ["./src/**/*.ts"]

0 commit comments

Comments
 (0)