Skip to content

Commit 7e43382

Browse files
committed
add import-in-the-middle as external dependency
1 parent 30497e0 commit 7e43382

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/bash
2+
3+
set -euf -o pipefail
4+
5+
rm -rf ./build/workspace/node_modules
6+
7+
# Space separated list of external NPM packages
8+
EXTERNAL_PACKAGES=( "import-in-the-middle" )
9+
10+
for EXTERNAL_PACKAGE in "${EXTERNAL_PACKAGES[@]}"
11+
do
12+
echo "Installing external package $EXTERNAL_PACKAGE ..."
13+
14+
PACKAGE_VERSION=$(npm query "#$EXTERNAL_PACKAGE" \
15+
| grep version \
16+
| head -1 \
17+
| awk -F: '{ print $2 }' \
18+
| sed 's/[",]//g')
19+
20+
echo "Resolved version of the external package $EXTERNAL_PACKAGE: $PACKAGE_VERSION"
21+
22+
npm install "$EXTERNAL_PACKAGE@$PACKAGE_VERSION" --prefix ./build/workspace --production --ignore-scripts
23+
24+
echo "Installed external package $EXTERNAL_PACKAGE"
25+
done

aws-distro-opentelemetry-node-autoinstrumentation/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@
2424
"clean": "rimraf build/*",
2525
"compile:tsc": "tsc -p .",
2626
"compile:webpack": "webpack",
27-
"compile": "npm run compile:webpack",
27+
"compile": "npm run compile:webpack && npm run install-externals",
28+
"install-externals": "./install-externals.sh",
2829
"lint": "eslint . --ext .ts",
2930
"lint:fix": "eslint . --ext .ts --fix",
3031
"create-version": "node -p \"'export const LIB_VERSION = ' + JSON.stringify(require('./package.json').version) + ';'\" > src/version.ts",

0 commit comments

Comments
 (0)