Skip to content

Commit 8ba80e0

Browse files
authored
add support for node 22 (#193)
1 parent 30f76f3 commit 8ba80e0

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
runs-on: ubuntu-latest
1212
strategy:
1313
matrix:
14-
node-version: [20.x]
14+
node-version: [20.x, 22.x]
1515
steps:
1616
- uses: actions/checkout@v2
1717
- name: Use Node.js ${{ matrix.node-version }}

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,9 @@ To see how your function would respond once deployed.
3131
### Testing
3232

3333
`npm test` will run all tests in the /tests folder.
34+
35+
## Deployment
36+
37+
You can run `npm run deploy` to deploy the current latest version. You should be authenticated with the gcloud CLI to do this.
38+
39+
You can also run `npm run deploy20` to deploy node version 20 if you prefer.

package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
{
22
"name": "ts-template",
3-
"version": "1.3.0",
3+
"version": "1.4.0",
44
"description": "A typescript function which is a template for building cloud functions on GCP quickly.",
55
"repository": "jgunnink/typescript-cloud-function-template",
66
"main": "dist/index.js",
77
"scripts": {
88
"start": "npx tsc-watch --onSuccess 'npx @google-cloud/functions-framework --target=helloWorld'",
9-
"deploy": "gcloud functions deploy ts-template --gen2 --runtime=nodejs20 --trigger-http --allow-unauthenticated --region australia-southeast1 --entry-point=helloWorld",
9+
"deploy": "gcloud functions deploy ts-template --gen2 --runtime=nodejs22 --trigger-http --allow-unauthenticated --region australia-southeast1 --entry-point=helloWorld",
10+
"deploy20": "gcloud functions deploy ts-template --gen2 --runtime=nodejs20 --trigger-http --allow-unauthenticated --region australia-southeast1 --entry-point=helloWorld",
1011
"build": "npx tsc",
1112
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' nyc --reporter=lcov mocha -r ts-node/register 'tests/**/*.ts'"
1213
},
1314
"engines": {
14-
"node": ">=20.0.0 <21.0.0"
15+
"node": ">=20.0.0 <23.0.0"
1516
},
1617
"author": "JK Gunnink",
1718
"license": "MIT",

0 commit comments

Comments
 (0)