-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathupdate_node_examples.sh
executable file
·52 lines (35 loc) · 1.89 KB
/
update_node_examples.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
set -eufx -o pipefail
NEW_VERSION=$1
SELF_PATH=${BASH_SOURCE[0]:-"$(command -v -- "$0")"}
PROJECT_ROOT="$(dirname "$SELF_PATH")/.."
function bump_ts_sdk() {
npm --prefix $1 install @restatedev/restate-sdk@^$NEW_VERSION
}
bump_ts_sdk $PROJECT_ROOT/typescript/basics
bump_ts_sdk $PROJECT_ROOT/typescript/templates/node
bump_ts_sdk $PROJECT_ROOT/typescript/templates/typescript-testing
bump_ts_sdk $PROJECT_ROOT/typescript/integrations/deployment-lambda-cdk
bump_ts_sdk $PROJECT_ROOT/typescript/templates/bun
bump_ts_sdk $PROJECT_ROOT/typescript/templates/nextjs
# Cloudflare workers has a different module
npm --prefix $PROJECT_ROOT/typescript/templates/cloudflare-worker install @restatedev/restate-sdk-cloudflare-workers@^$NEW_VERSION
# deno bump - it doesn't use a package.json, only import strings
# -i works differently in gnu sed and mac (bsd) sed - best avoided
tmp=$(mktemp)
sed "s#\"npm:@restatedev/restate-sdk@^.*/fetch\"#\"npm:@restatedev/restate-sdk@^${NEW_VERSION}/fetch\"#g" $PROJECT_ROOT/typescript/templates/deno/main.ts > $tmp
mv $tmp $PROJECT_ROOT/typescript/templates/deno/main.ts
bump_ts_sdk $PROJECT_ROOT/typescript/tutorials/tour-of-restate-typescript
bump_ts_sdk $PROJECT_ROOT/typescript/patterns-use-cases
bump_ts_sdk $PROJECT_ROOT/typescript/end-to-end-applications/ai-image-workflows
bump_ts_sdk $PROJECT_ROOT/typescript/end-to-end-applications/food-ordering/app
bump_ts_sdk $PROJECT_ROOT/typescript/end-to-end-applications/chat-bot
function bump_ts_sdk_clients() {
npm --prefix $1 install @restatedev/restate-sdk-clients@^$NEW_VERSION
}
bump_ts_sdk_clients $PROJECT_ROOT/typescript/basics
bump_ts_sdk_clients $PROJECT_ROOT/typescript/end-to-end-applications/food-ordering/webui
function bump_ts_sdk_testing() {
npm --prefix $1 install @restatedev/restate-sdk-testcontainers@^$NEW_VERSION
}
bump_ts_sdk_testing $PROJECT_ROOT/typescript/templates/typescript-testing