diff --git a/packages/case-definition-dsl/package.json b/packages/case-definition-dsl/package.json index 39f7cda9..1fe6d4b7 100644 --- a/packages/case-definition-dsl/package.json +++ b/packages/case-definition-dsl/package.json @@ -21,7 +21,7 @@ "build:docs:local": "api-extractor run --local --verbose && api-documenter markdown --input-folder api-extractor --output-folder docs && npm run format:fix", "watch": "jsii -w", "prepackage": "rimraf dist", - "prepack": "mkdirp node_modules/@contract-case && ln -sf ${PWD}/../case-entities node_modules/@contract-case/case-entities-internal && ln -sf ${PWD}/../case-core-plugin-http-dsl node_modules/@contract-case/case-core-plugin-http-dsl && ln -sf ${PWD}/../case-plugin-base node_modules/@contract-case/case-plugin-base && ln -sf ${PWD}/../case-core-function-dsl node_modules/@contract-case/case-core-function-dsl", + "prepack": "bash -c './script/link-bundled-deps.sh'", "package": "jsii-pacmak", "publish:maven": "publib-maven", "test": "jest", diff --git a/packages/case-definition-dsl/script/link-bundled-deps.sh b/packages/case-definition-dsl/script/link-bundled-deps.sh new file mode 100755 index 00000000..9994c088 --- /dev/null +++ b/packages/case-definition-dsl/script/link-bundled-deps.sh @@ -0,0 +1,8 @@ +#!/bin/bash -eu +set -eu # We do this twice so that windows github runners will properly read them +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)" # Figure out where the script is running + + +BASE=$(realpath "$SCRIPT_DIR"/../../../node_modules/@contract-case/) + +find "$BASE"* -exec bash -c 'echo $0; mkdir -p .'"$SCRIPT_DIR"/..'/node_modules/@contract-case/$(basename $0); cp -R "$0/"* ./node_modules/@contract-case/$(basename $0) 2>/dev/null; echo done' '{}' \;