Skip to content

Commit 959c172

Browse files
authored
feat: support node 22 (#981)
1 parent de6cf03 commit 959c172

9 files changed

Lines changed: 31 additions & 38 deletions

File tree

.github/workflows/azuresdkdrop.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
strategy:
1515
matrix:
1616
os: [macos-14, windows-latest, ubuntu-latest]
17-
node-version: [18.x, 20.x]
17+
node-version: [18.x, 20.x, 22.x]
1818

1919
steps:
2020
- uses: actions/checkout@v4
@@ -35,10 +35,10 @@ jobs:
3535
- uses: actions/checkout@v4
3636
with:
3737
ref: main
38-
- name: Use Node.js 18.x
38+
- name: Use Node.js 22.x
3939
uses: actions/setup-node@v4
4040
with:
41-
node-version: 18.x
41+
node-version: 22.x
4242

4343
- run: npm ci
4444
- run: npm run build

.github/workflows/ci.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
- uses: actions/checkout@v4
1818
- uses: actions/setup-node@v4
1919
with:
20-
node-version: 18.x
20+
node-version: 22.x
2121

2222
- run: npm ci
2323
- run: npm run format
@@ -28,7 +28,7 @@ jobs:
2828
strategy:
2929
matrix:
3030
os: [macos-14]
31-
node-version: [18.x, 20.x]
31+
node-version: [18.x, 20.x, 22.x]
3232

3333
name: "test: use node ${{ matrix.node-version }}"
3434
steps:
@@ -59,7 +59,7 @@ jobs:
5959
strategy:
6060
matrix:
6161
os: [macos-14]
62-
node-version: [18.x, 20.x]
62+
node-version: [18.x, 20.x, 22.x]
6363

6464
name: "deploy: use node ${{ matrix.node-version }}"
6565
steps:
@@ -92,7 +92,7 @@ jobs:
9292
strategy:
9393
matrix:
9494
os: [windows-latest]
95-
node-version: [18.x, 20.x]
95+
node-version: [18.x, 20.x, 22.x]
9696

9797
name: "test: use node ${{ matrix.node-version }}"
9898
steps:
@@ -123,7 +123,7 @@ jobs:
123123
strategy:
124124
matrix:
125125
os: [windows-latest]
126-
node-version: [18.x, 20.x]
126+
node-version: [18.x, 20.x, 22.x]
127127

128128
name: "deploy: use node ${{ matrix.node-version }}"
129129
steps:
@@ -156,7 +156,7 @@ jobs:
156156
strategy:
157157
matrix:
158158
os: [ubuntu-22.04]
159-
node-version: [18.x, 20.x]
159+
node-version: [18.x, 20.x, 22.x]
160160

161161
name: "test: use node ${{ matrix.node-version }}"
162162
steps:
@@ -187,7 +187,7 @@ jobs:
187187
strategy:
188188
matrix:
189189
os: [ubuntu-22.04]
190-
node-version: [18.x, 20.x]
190+
node-version: [18.x, 20.x, 22.x]
191191

192192
name: "deploy: use node ${{ matrix.node-version }}"
193193
steps:
@@ -222,7 +222,7 @@ jobs:
222222
- uses: actions/checkout@v4
223223
- uses: actions/setup-node@v4
224224
with:
225-
node-version: 18.x
225+
node-version: 22.x
226226

227227
- run: npm ci
228228
- run: npm version prerelease --preid=ci-$GITHUB_RUN_ID --no-git-tag-version

.github/workflows/deploy-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ jobs:
1212
- run: git config --global user.email "github@wassim.dev"
1313
- run: git config --global user.name "Wassim Chegham"
1414
- name: Setup Node.js environment
15-
uses: actions/setup-node@v3.2.0
15+
uses: actions/setup-node@v4
1616
with:
17-
node-version: '18.x'
17+
node-version: '22.x'
1818
- name: "deploy docs"
1919
run: |
2020
cd docs/www/

.github/workflows/detection-e2e-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
- uses: actions/checkout@v4
1111
- uses: actions/setup-node@v4
1212
with:
13-
node-version: 18.x
13+
node-version: 22.x
1414
- name: Test framework detection
1515
run: |
1616
npm ci

.github/workflows/e2e.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ jobs:
1515
# https://github.com/cypress-io/github-action/issues/48
1616
fail-fast: false
1717
matrix:
18-
os: [macos-12, windows-latest, ubuntu-22.04]
19-
node-version: [18.x, 20.x]
18+
os: [macos-14, windows-latest, ubuntu-22.04]
19+
node-version: [18.x, 20.x, 22.x]
2020

2121
steps:
2222
- name: Checkout

schema/staticwebapp.config.json

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -585,19 +585,12 @@
585585
"apiRuntime": {
586586
"type": "string",
587587
"enum": [
588-
"dotnet:3.1",
589-
"dotnet:6.0",
590588
"dotnet:8.0",
591-
"dotnet-isolated:6.0",
592-
"dotnet-isolated:7.0",
593589
"dotnet-isolated:8.0",
594590
"dotnet-isolated:9.0",
595-
"node:12",
596-
"node:14",
597-
"node:16",
598591
"node:18",
599592
"node:20",
600-
"python:3.8",
593+
"node:22",
601594
"python:3.9",
602595
"python:3.10",
603596
"python:3.11"

src/core/constants.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -298,17 +298,17 @@ export const SWA_CONFIG_SCHEME_FALLBACK_PATH = path.join(__dirname, "../../schem
298298

299299
// Constants related to Api runtime
300300
export const DEFAULT_VERSION = {
301-
Node: "16",
302-
Dotnet: "6.0",
303-
DotnetIsolated: "6.0",
304-
Python: "3.8",
301+
Node: "22",
302+
Dotnet: "8.0",
303+
DotnetIsolated: "8.0",
304+
Python: "3.11",
305305
};
306306

307307
export const SUPPORTED_VERSIONS = {
308-
Node: ["12", "14", "16", "18", "20"],
309-
Dotnet: ["3.1", "6.0", "8.0"],
310-
DotnetIsolated: ["6.0", "7.0", "8.0", "9.0"],
311-
Python: ["3.8", "3.9", "3.10", "3.11"],
308+
Node: ["18", "20", "22"],
309+
Dotnet: ["8.0"],
310+
DotnetIsolated: ["8.0", "9.0"],
311+
Python: ["3.9", "3.10", "3.11"],
312312
};
313313

314314
export const DEFAULT_RUNTIME_LANGUAGE = "node";

src/core/frameworks/detect.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ describe("framework detection", () => {
3131
appLocation: "e2e/fixtures/astro-node/astro preact",
3232
appDevserverCommand: "npm run dev",
3333
apiLanguage: "node",
34-
apiVersion: "16",
34+
apiVersion: "22",
3535
appDevserverUrl: "http://localhost:8080",
3636
name: "Astro, with API: Node.js",
3737
outputLocation: "_site",
@@ -47,7 +47,7 @@ describe("framework detection", () => {
4747
appLocation: "e2e/fixtures/static-node-ts",
4848
name: "Static HTML, with API: Node.js, TypeScript",
4949
apiLanguage: "node",
50-
apiVersion: "16",
50+
apiVersion: "22",
5151
outputLocation: ".",
5252
});
5353
});

src/core/frameworks/frameworks.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const apiFrameworks: FrameworkDefinition[] = [
66
config: {
77
apiBuildCommand: "npm run build --if-present",
88
apiLanguage: "node",
9-
apiVersion: "16",
9+
apiVersion: "22",
1010
},
1111
},
1212
{
@@ -27,7 +27,7 @@ export const apiFrameworks: FrameworkDefinition[] = [
2727
config: {
2828
apiBuildCommand: "dotnet publish -c Release",
2929
apiLanguage: "dotnet",
30-
apiVersion: "6.0",
30+
apiVersion: "8.0",
3131
},
3232
},
3333
{
@@ -36,7 +36,7 @@ export const apiFrameworks: FrameworkDefinition[] = [
3636
files: ["*.?(csproj|fsproj)", "host.json"],
3737
config: {
3838
apiLanguage: "dotnetisolated",
39-
apiVersion: "6.0",
39+
apiVersion: "8.0",
4040
},
4141
},
4242
{
@@ -46,7 +46,7 @@ export const apiFrameworks: FrameworkDefinition[] = [
4646
config: {
4747
// Nothing to setup, but we need to know the apiLocation (rootPath)
4848
apiLanguage: "python",
49-
apiVersion: "3.8",
49+
apiVersion: "3.11",
5050
},
5151
},
5252
];

0 commit comments

Comments
 (0)