From 6a3a13046e0591ea1666ed3232108b7e0ce1dce4 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 22:09:00 +1100 Subject: [PATCH 01/13] Try not packaging fully --- packages/case-definition-dsl/package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/case-definition-dsl/package.json b/packages/case-definition-dsl/package.json index 8afbfcba2..6d32dad69 100644 --- a/packages/case-definition-dsl/package.json +++ b/packages/case-definition-dsl/package.json @@ -22,7 +22,6 @@ "postbuild": "npm run package", "watch": "jsii -w", "prepackage": "rimraf dist", - "prepack": "bash -c './script/link-bundled-deps.sh'", "package": "jsii-pacmak --verbose=3", "postpackage": "bash -c './script/local-maven-install.sh'", "publish:maven": "publib-maven", From b012eb9bbfe99a063ca9ac7f411c946953387421 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 22:22:27 +1100 Subject: [PATCH 02/13] chore: Make test:local run the java tests too --- packages/dsl-java/package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/dsl-java/package.json b/packages/dsl-java/package.json index 920412625..63e8cc361 100644 --- a/packages/dsl-java/package.json +++ b/packages/dsl-java/package.json @@ -17,7 +17,8 @@ "scripts": { "build": "rimraf build && bash install-connector.sh && bash -c './gradlew build testClasses -x test'", "compile": "bash -c './gradlew build testClasses -x test'", - "test": "bash -c './gradlew test'" + "test": "bash -c './gradlew test'", + "test:local": "bash -c './gradlew test'" }, "funding": { "type": "individual", From 77029c3bf08fce0f7b5c22a633ec99c65acfbbd6 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 22:32:54 +1100 Subject: [PATCH 03/13] Revert "Try not packaging fully" This reverts commit 6a3a13046e0591ea1666ed3232108b7e0ce1dce4. --- packages/case-definition-dsl/package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/case-definition-dsl/package.json b/packages/case-definition-dsl/package.json index 6d32dad69..8afbfcba2 100644 --- a/packages/case-definition-dsl/package.json +++ b/packages/case-definition-dsl/package.json @@ -22,6 +22,7 @@ "postbuild": "npm run package", "watch": "jsii -w", "prepackage": "rimraf dist", + "prepack": "bash -c './script/link-bundled-deps.sh'", "package": "jsii-pacmak --verbose=3", "postpackage": "bash -c './script/local-maven-install.sh'", "publish:maven": "publib-maven", From e00c04ebddca0910bc40c905cb470e5399f6d41a Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 22:33:06 +1100 Subject: [PATCH 04/13] Add more logs --- packages/case-definition-dsl/script/link-bundled-deps.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packages/case-definition-dsl/script/link-bundled-deps.sh b/packages/case-definition-dsl/script/link-bundled-deps.sh index c5ca399ac..78b7cb8e0 100755 --- a/packages/case-definition-dsl/script/link-bundled-deps.sh +++ b/packages/case-definition-dsl/script/link-bundled-deps.sh @@ -5,4 +5,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the BASE=$(realpath "$SCRIPT_DIR"/../../../node_modules/@contract-case) +echo "Finding in $BASE" + find "$BASE"/* -exec bash -c 'echo $0; mkdir -p '"$SCRIPT_DIR"/..'/node_modules/@contract-case/$(basename $0); cp -R "$0/"* '"$SCRIPT_DIR"'/../node_modules/@contract-case/$(basename "$0") 2>/dev/null; echo done' '{}' \; From 953bff6c32b2a89d03ca4485feb195552b1b8c70 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 22:34:20 +1100 Subject: [PATCH 05/13] Drop other runs from the matrix for ease of debugging --- .github/workflows/builld-and-test-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builld-and-test-pr.yml b/.github/workflows/builld-and-test-pr.yml index 46403b3e4..dea21c511 100644 --- a/.github/workflows/builld-and-test-pr.yml +++ b/.github/workflows/builld-and-test-pr.yml @@ -12,8 +12,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [18.x, 20.x, 22.x] - os: [macos-latest, ubuntu-latest, windows-latest] + node-version: [20.x] + os: [windows-latest] steps: - name: Harden Runner if: matrix.os == 'ubuntu-latest' From 0b4b77e73625c811e520c94b090bc6d01b3c5537 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 22:47:09 +1100 Subject: [PATCH 06/13] Try pack first to see if it's pack or jsii --- ci/build-and-test-pr.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/build-and-test-pr.sh b/ci/build-and-test-pr.sh index 08bdedb00..b0b0aed41 100755 --- a/ci/build-and-test-pr.sh +++ b/ci/build-and-test-pr.sh @@ -6,6 +6,10 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the npm install # We can't do npm ci because lerna has optional dependencies :( +cd packages/case-definition-dsl +npm pack +cd - + npx lerna --ci run format:check npx lerna --ci run build npx lerna --ci run lint From da31189fef4904dce129b77166cac2a1fa155a55 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 23:08:04 +1100 Subject: [PATCH 07/13] Run pacmak without parallel --- packages/case-definition-dsl/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/case-definition-dsl/package.json b/packages/case-definition-dsl/package.json index 8afbfcba2..912b65eb2 100644 --- a/packages/case-definition-dsl/package.json +++ b/packages/case-definition-dsl/package.json @@ -23,7 +23,7 @@ "watch": "jsii -w", "prepackage": "rimraf dist", "prepack": "bash -c './script/link-bundled-deps.sh'", - "package": "jsii-pacmak --verbose=3", + "package": "jsii-pacmak --parallel=false --verbose=3", "postpackage": "bash -c './script/local-maven-install.sh'", "publish:maven": "publib-maven", "test": "jest", From 9e365cecd5f5c39abdbbc83900635751960769e4 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sat, 15 Mar 2025 23:26:11 +1100 Subject: [PATCH 08/13] Remove output from script --- packages/case-definition-dsl/script/link-bundled-deps.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/case-definition-dsl/script/link-bundled-deps.sh b/packages/case-definition-dsl/script/link-bundled-deps.sh index 78b7cb8e0..9cb2c56fb 100755 --- a/packages/case-definition-dsl/script/link-bundled-deps.sh +++ b/packages/case-definition-dsl/script/link-bundled-deps.sh @@ -5,6 +5,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the BASE=$(realpath "$SCRIPT_DIR"/../../../node_modules/@contract-case) -echo "Finding in $BASE" +# echo "Finding in $BASE" -find "$BASE"/* -exec bash -c 'echo $0; mkdir -p '"$SCRIPT_DIR"/..'/node_modules/@contract-case/$(basename $0); cp -R "$0/"* '"$SCRIPT_DIR"'/../node_modules/@contract-case/$(basename "$0") 2>/dev/null; echo done' '{}' \; +find "$BASE"/* -exec bash -c 'mkdir -p '"$SCRIPT_DIR"/..'/node_modules/@contract-case/$(basename $0); cp -R "$0/"* '"$SCRIPT_DIR"'/../node_modules/@contract-case/$(basename "$0") 2>/dev/null;' '{}' \; From f903a09ace95fb9274f597d6d5fe28a32533c916 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sun, 16 Mar 2025 00:33:05 +1100 Subject: [PATCH 09/13] test: Use modifed version of pacmak --- packages/case-definition-dsl/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/case-definition-dsl/package.json b/packages/case-definition-dsl/package.json index 912b65eb2..a0154d365 100644 --- a/packages/case-definition-dsl/package.json +++ b/packages/case-definition-dsl/package.json @@ -75,7 +75,7 @@ "@types/jest": "^29.5.12", "jsii": "^5.7.4", "jsii-docgen": "^10.6.1", - "jsii-pacmak": "^1.108.0", + "@contract-case/jsii-pacmak": "^0.0.0", "mkdirp": "^3.0.1", "prettier": "3.4.2", "publib": "^0.2.955", From 75c1aa90b147a26b8de59b6851e068a9f47dfe26 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sun, 16 Mar 2025 00:45:51 +1100 Subject: [PATCH 10/13] test: Bump trial pacmak version --- packages/case-definition-dsl/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/case-definition-dsl/package.json b/packages/case-definition-dsl/package.json index a0154d365..27622407d 100644 --- a/packages/case-definition-dsl/package.json +++ b/packages/case-definition-dsl/package.json @@ -75,7 +75,7 @@ "@types/jest": "^29.5.12", "jsii": "^5.7.4", "jsii-docgen": "^10.6.1", - "@contract-case/jsii-pacmak": "^0.0.0", + "@contract-case/jsii-pacmak": "^0.0.1", "mkdirp": "^3.0.1", "prettier": "3.4.2", "publib": "^0.2.955", From f21371818b135e72f8ad511c1db06dc23638bcd7 Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sun, 16 Mar 2025 00:46:49 +1100 Subject: [PATCH 11/13] Revert "Drop other runs from the matrix for ease of debugging" This reverts commit 953bff6c32b2a89d03ca4485feb195552b1b8c70. --- .github/workflows/builld-and-test-pr.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/builld-and-test-pr.yml b/.github/workflows/builld-and-test-pr.yml index dea21c511..46403b3e4 100644 --- a/.github/workflows/builld-and-test-pr.yml +++ b/.github/workflows/builld-and-test-pr.yml @@ -12,8 +12,8 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - node-version: [20.x] - os: [windows-latest] + node-version: [18.x, 20.x, 22.x] + os: [macos-latest, ubuntu-latest, windows-latest] steps: - name: Harden Runner if: matrix.os == 'ubuntu-latest' From 837b18e178b05d02fd20e96eb864a3a64a727bff Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sun, 16 Mar 2025 00:59:24 +1100 Subject: [PATCH 12/13] Revert "Try pack first to see if it's pack or jsii" This reverts commit 0b4b77e73625c811e520c94b090bc6d01b3c5537. --- ci/build-and-test-pr.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/ci/build-and-test-pr.sh b/ci/build-and-test-pr.sh index b0b0aed41..08bdedb00 100755 --- a/ci/build-and-test-pr.sh +++ b/ci/build-and-test-pr.sh @@ -6,10 +6,6 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the npm install # We can't do npm ci because lerna has optional dependencies :( -cd packages/case-definition-dsl -npm pack -cd - - npx lerna --ci run format:check npx lerna --ci run build npx lerna --ci run lint From 7d0e19c398ff3cc40e0921366ed3fb566a3416ba Mon Sep 17 00:00:00 2001 From: Timothy Jones Date: Sun, 16 Mar 2025 01:10:30 +1100 Subject: [PATCH 13/13] chore: Include the jsii java package in java-only ci --- ci/build-java-only.sh | 3 ++ nx.json | 64 ++++++++++--------------------------------- 2 files changed, 17 insertions(+), 50 deletions(-) diff --git a/ci/build-java-only.sh b/ci/build-java-only.sh index 4646b4c2a..ac4cf7891 100755 --- a/ci/build-java-only.sh +++ b/ci/build-java-only.sh @@ -8,5 +8,8 @@ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the npm install # We can't do npm ci because lerna has optional dependencies :( +# First we have to build the definition-dsl, because it needs to be installed +# for java to build when there are breaking changes +npx lerna run build --scope @contract-case/case-definition-dsl cd packages/dsl-java npm run compile diff --git a/nx.json b/nx.json index c05eb9ca6..519fdf537 100644 --- a/nx.json +++ b/nx.json @@ -1,64 +1,33 @@ { "targetDefaults": { "prebuild": { - "dependsOn": [ - "^prebuild" - ] + "dependsOn": ["^prebuild"] }, "test": { - "dependsOn": [ - "downloadContracts", - "build" - ], + "dependsOn": ["downloadContracts", "build"], "cache": true }, "build": { - "dependsOn": [ - "^build" - ], - "outputs": [ - "{projectRoot}/dist" - ], + "dependsOn": ["^build"], + "outputs": ["{projectRoot}/dist"], "cache": true }, "build:docs": { - "dependsOn": [ - "^build", - "^build:docs", - "build" - ], - "outputs": [ - "{projectRoot}/dist" - ] + "dependsOn": ["^build", "^build:docs", "build"], + "outputs": ["{projectRoot}/dist"] }, "build:docs:local": { - "dependsOn": [ - "^build", - "^build:docs:local", - "build" - ], - "outputs": [ - "{projectRoot}/docs" - ] + "dependsOn": ["^build", "^build:docs:local", "build"], + "outputs": ["{projectRoot}/docs"] }, "package": { - "dependsOn": [ - "build", - "^package" - ], - "outputs": [ - "{projectRoot}/dist" - ], + "dependsOn": ["build", "^package"], + "outputs": ["{projectRoot}/dist"], "cache": true }, "publish:maven": { - "dependsOn": [ - "package", - "^publish:maven" - ], - "outputs": [ - "{projectRoot}/dist" - ] + "dependsOn": ["package", "^build", "^publish:maven"], + "outputs": ["{projectRoot}/dist"] }, "lint": { "cache": true @@ -69,13 +38,8 @@ }, "$schema": "./node_modules/nx/schemas/nx-schema.json", "namedInputs": { - "default": [ - "{projectRoot}/**/*", - "sharedGlobals" - ], + "default": ["{projectRoot}/**/*", "sharedGlobals"], "sharedGlobals": [], - "production": [ - "default" - ] + "production": ["default"] } }