Skip to content

Commit 83386ea

Browse files
author
David Buzinski
committed
update module type, update tests, and update node version
1 parent db1c56a commit 83386ea

10 files changed

Lines changed: 698 additions & 598 deletions

File tree

.github/workflows/bat.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ jobs:
88
name: Build and Test
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v5
12-
- uses: actions/setup-node@v5
11+
- uses: actions/checkout@v6
12+
- uses: actions/setup-node@v6
1313
with:
14-
node-version: "20"
14+
node-version: 24
1515
- name: Perform npm tasks
1616
run: npm run ci
17-
- uses: actions/upload-artifact@v4
17+
- uses: actions/upload-artifact@v5
1818
with:
1919
name: built-action
2020
path: |

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,14 @@ jobs:
1212
outputs:
1313
tag: ${{ steps.update-package-version.outputs.version }}
1414
steps:
15-
- uses: actions/checkout@v5
15+
- uses: actions/checkout@v6
1616
- name: Configure git
1717
run: |
1818
git config user.name 'Release Action'
1919
git config user.email '<>'
20-
- uses: actions/setup-node@v5
20+
- uses: actions/setup-node@v6
2121
with:
22-
node-version: 20
22+
node-version: 24
2323

2424
# Call `npm version`. It increments the version and commits the changes.
2525
# We'll save the output (new version string) for use in the following

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ inputs:
2020
required: false
2121
default: ""
2222
runs:
23-
using: node20
23+
using: node24
2424
main: dist/index.js

jest.config.js

Lines changed: 0 additions & 6 deletions
This file was deleted.

jest.config.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
export default {
2+
clearMocks: true,
3+
testEnvironment: "node",
4+
collectCoverage: true,
5+
testMatch: ["**/*.test.ts"],
6+
transform: {
7+
"^.+\\.[jt]s$": [
8+
"ts-jest",
9+
{
10+
useESM: true,
11+
diagnostics: {
12+
ignoreCodes: [151002],
13+
},
14+
},
15+
],
16+
},
17+
extensionsToTreatAsEsm: ['.ts'],
18+
transformIgnorePatterns: ["node_modules/(?!(@actions)/)"],
19+
moduleNameMapper: {
20+
"^(\\.{1,2}/.*)\\.js$": "$1",
21+
},
22+
};

package-lock.json

Lines changed: 657 additions & 575 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"author": "The MathWorks, Inc.",
44
"version": "2.6.1",
55
"description": "",
6+
"type": "module",
67
"main": "lib/index.js",
78
"scripts": {
89
"clean": "rm -rf dist lib",
@@ -11,27 +12,27 @@
1112
"build": "tsc",
1213
"deps": "bash ./scripts/setupdeps.sh",
1314
"package": "ncc build --minify",
14-
"test": "jest",
15+
"test": "NODE_OPTIONS='--experimental-vm-modules' jest",
1516
"all": "npm test && npm run build && npm run package",
1617
"ci": "npm run clean && npm ci && npm run deps && npm run all"
1718
},
1819
"files": [
1920
"lib/"
2021
],
2122
"dependencies": {
22-
"@actions/core": "^1.11.1",
23-
"@actions/exec": "^1.1.1",
24-
"common-utils": "github:matlab-actions/common-utils#v1.0.1"
23+
"@actions/core": "^3.0.0",
24+
"@actions/exec": "^3.0.0",
25+
"common-utils": "github:matlab-actions/common-utils#v2.0.1"
2526
},
2627
"devDependencies": {
2728
"@types/jest": "^30.0.0",
2829
"@types/node": "^24.3.0",
29-
"@types/uuid": "^10.0.0",
3030
"@vercel/ncc": "^0.38.3",
3131
"jest": "^30.0.5",
3232
"jest-circus": "^30.0.5",
3333
"prettier": "3.6.2",
3434
"ts-jest": "^29.4.1",
35+
"ts-node": "^10.9.2",
3536
"typescript": "^5.9.2"
3637
}
3738
}

src/buildtool.unit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Copyright 2022-2025 The MathWorks, Inc.
22

3-
import * as buildtool from "./buildtool";
3+
import * as buildtool from "./buildtool.js";
44

55
describe("command generation", () => {
66
it("buildtool invocation with unspecified tasks and build options", () => {

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import * as core from "@actions/core";
44
import * as exec from "@actions/exec";
5-
import * as buildtool from "./buildtool";
5+
import * as buildtool from "./buildtool.js";
66
import { matlab, testResultsSummary, buildSummary } from "common-utils";
77

88
/**

tsconfig.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
{
22
"compilerOptions": {
33
"target": "ES2022",
4-
"module": "CommonJS",
4+
"module": "NodeNext",
5+
"moduleResolution": "NodeNext",
56
"declaration": true,
67
"sourceMap": true,
78
"rootDir": "src",
@@ -12,5 +13,5 @@
1213
"esModuleInterop": true
1314
},
1415

15-
"exclude": ["node_modules", "lib", "**/*.test.ts"]
16+
"exclude": ["node_modules", "lib", "**/*.test.ts", "jest.config.ts"]
1617
}

0 commit comments

Comments
 (0)