diff --git a/.github/workflows/ts-tests.yml b/.github/workflows/ts-tests.yml index 79d2e895d3..5e110e9253 100644 --- a/.github/workflows/ts-tests.yml +++ b/.github/workflows/ts-tests.yml @@ -24,9 +24,9 @@ jobs: - name: Prepare build environment uses: ./.github/actions/prepare-build-env - name: Setup Node.js environment - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - name: Install pnpm run: npm i -g pnpm - name: Install coreutils (macOS) diff --git a/core/src/main/java/org/lflang/util/ImportUtil.java b/core/src/main/java/org/lflang/util/ImportUtil.java index b7de0a16d4..432f70574b 100644 --- a/core/src/main/java/org/lflang/util/ImportUtil.java +++ b/core/src/main/java/org/lflang/util/ImportUtil.java @@ -25,8 +25,8 @@ public class ImportUtil { * names. */ public static String buildPackageURI(String uriStr, Resource resource) { - Path rootPath = Paths.get(resource.getURI().toString()).toAbsolutePath(); + Path rootPath = FileUtil.toPath(resource); Path uriPath = Paths.get(uriStr.trim()); if (uriPath.getNameCount() < 2) { diff --git a/core/src/main/resources/lib/ts/package.json b/core/src/main/resources/lib/ts/package.json index fc063d791e..eec471ab6d 100644 --- a/core/src/main/resources/lib/ts/package.json +++ b/core/src/main/resources/lib/ts/package.json @@ -2,7 +2,7 @@ "name": "LinguaFrancaDefault", "type": "commonjs", "dependencies": { - "@lf-lang/reactor-ts": "git://github.com/lf-lang/reactor-ts.git#master", + "@lf-lang/reactor-ts": "^0.6.1", "command-line-args": "^5.1.1", "command-line-usage": "^6.1.3" }, @@ -11,13 +11,12 @@ "@types/command-line-usage": "^5.0.2", "@types/google-protobuf": "^3.7.4", "@types/microtime": "^2.1.0", - "@types/node": "^18.14.2", - "@typescript-eslint/eslint-plugin": "5.33.0", - "@typescript-eslint/parser": "^5.8.1", - "eslint": "^8.5.0", - "typescript": "~4.8.2", + "@types/node": "^22.5.0", + "eslint-config-prettier": "^9.0.0", + "eslint-config-standard-with-typescript": "^43.0.1", + "typescript": "^5.1.6", "ts-protoc-gen": "^0.15.0", - "rimraf": "^3.0.2" + "rimraf": "^6.0.1" }, "scripts": { "build": "npx rimraf dist && npx tsc --outDir dist" diff --git a/core/src/main/resources/lib/ts/tsconfig.json b/core/src/main/resources/lib/ts/tsconfig.json index ae7bb7804a..bd1f323b67 100644 --- a/core/src/main/resources/lib/ts/tsconfig.json +++ b/core/src/main/resources/lib/ts/tsconfig.json @@ -4,7 +4,6 @@ "target": "esnext", "module": "CommonJS", "types": ["node", "@lf-lang/reactor-ts", "microtime", "command-line-args", "command-line-usage"], - "typeRoots": ["./node_modules/@types/", "./node_modules/@lf-lang/reactor-ts/src/core/@types/"], "esModuleInterop": true, "isolatedModules": true, "lib": ["esnext", "dom"], diff --git a/test/C/src/Mutable.lf b/test/C/src/Mutable.lf index 575473986f..220ff1afbd 100644 --- a/test/C/src/Mutable.lf +++ b/test/C/src/Mutable.lf @@ -11,7 +11,9 @@ reactor S(width: int = 4) { } reactor R(width: int = 4) { - mutable input[width] in: int + // Pathetically, the Windows C compiler doesn't support arrays on the stack with a variable size. + // So we have to give a constant here instead of the parameter width. + mutable input[2] in: int output[width] out: int reaction(in) -> out {= diff --git a/test/C/src/token/MutableToken.lf b/test/C/src/token/MutableToken.lf index 724b8a6579..33d86be4b0 100644 --- a/test/C/src/token/MutableToken.lf +++ b/test/C/src/token/MutableToken.lf @@ -10,7 +10,9 @@ preamble {= =} reactor R(width: int = 4) { - mutable input[width] in: int_array_t* + // Pathetically, the Windows C compiler doesn't support arrays on the stack with a variable size. + // So we have to give a constant here instead of the parameter width. + mutable input[2] in: int_array_t* output[width] out: int_array_t* reaction(in) -> out {= diff --git a/test/Python/src/LingoFederatedImport.lf b/test/Python/src/federated/LingoFederatedImport.lf similarity index 89% rename from test/Python/src/LingoFederatedImport.lf rename to test/Python/src/federated/LingoFederatedImport.lf index 5b3a4fadd6..6c642bae6f 100644 --- a/test/Python/src/LingoFederatedImport.lf +++ b/test/Python/src/federated/LingoFederatedImport.lf @@ -1,5 +1,4 @@ # Test the new import statement for Lingo downloaded packages with the import path enclosed in angle brackets -# Version 1: The LF file is located in "src". target Python { timeout: 2 sec } diff --git a/test/Python/src/lingo_imports/FederatedTestImportPackages.lf b/test/Python/src/lingo_imports/FederatedTestImportPackages.lf deleted file mode 100644 index 4081aa29ba..0000000000 --- a/test/Python/src/lingo_imports/FederatedTestImportPackages.lf +++ /dev/null @@ -1,21 +0,0 @@ -# Test the new import statement for Lingo downloaded packages with the import path enclosed in angle brackets -# Version 2: The LF file is now located in a subdirectory under "src". -target Python { - timeout: 2 sec -} - -import Count from - -reactor Actuator { - input results - - reaction(results) {= - print(f"Count: {results.value}") - =} -} - -federated reactor { - count = new Count() - act = new Actuator() - count.out -> act.results -}