-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7f3b53e
commit 3c93842
Showing
10 changed files
with
3,902 additions
and
1,239 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash | ||
|
||
set -euf -o pipefail | ||
|
||
rm -rf ./build/workspace/node_modules | ||
|
||
# Space separated list of external NPM packages | ||
EXTERNAL_PACKAGES=( "import-in-the-middle" ) | ||
|
||
for EXTERNAL_PACKAGE in "${EXTERNAL_PACKAGES[@]}" | ||
do | ||
echo "Installing external package $EXTERNAL_PACKAGE ..." | ||
|
||
PACKAGE_VERSION=$(npm query "#$EXTERNAL_PACKAGE" \ | ||
| grep version \ | ||
| head -1 \ | ||
| awk -F: '{ print $2 }' \ | ||
| sed 's/[",]//g') | ||
|
||
echo "Resolved version of the external package $EXTERNAL_PACKAGE: $PACKAGE_VERSION" | ||
|
||
npm install "$EXTERNAL_PACKAGE@$PACKAGE_VERSION" --prefix ./build/workspace --production --ignore-scripts | ||
|
||
echo "Installed external package $EXTERNAL_PACKAGE" | ||
done |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
const WRAPPER_INIT_START_TIME = Date.now(); | ||
await import('./wrapper.js'); | ||
console.log('OpenTelemetry wrapper init completed in', Date.now() - WRAPPER_INIT_START_TIME, 'ms'); | ||
|
||
const LOADER_INIT_START_TIME = Date.now(); | ||
await import('./loader.mjs'); | ||
console.log('OpenTelemetry loader init completed in', Date.now() - LOADER_INIT_START_TIME, 'ms'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../../tsconfig.esm", | ||
"compilerOptions": { | ||
"rootDir": ".", | ||
"outDir": "build" | ||
}, | ||
"include": [ | ||
"src/**/*.ts", | ||
"test/**/*.ts" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
entry: './src/wrapper.ts', | ||
target: 'node', | ||
mode: 'production', | ||
externalsPresets: { node: true }, // in order to ignore built-in modules like path, fs, etc. | ||
externals: [ | ||
'import-in-the-middle', | ||
'@aws-sdk', | ||
], | ||
output: { | ||
path: path.resolve('./build/src'), | ||
filename: 'wrapper.js', | ||
library: { | ||
type: 'commonjs2', | ||
} | ||
}, | ||
resolve: { | ||
extensions: ['.ts', '.js', '.mjs'], | ||
modules: [ | ||
path.resolve('./src'), | ||
'node_modules', | ||
], | ||
}, | ||
module: { | ||
rules: [ | ||
{ | ||
test: /\.ts$/, | ||
use: [ | ||
{ | ||
loader: 'ts-loader', | ||
options: { | ||
configFile: "tsconfig.webpack.json" | ||
} | ||
} | ||
], | ||
exclude: /node_modules/, | ||
} | ||
], | ||
}, | ||
optimization: { | ||
minimize: true, | ||
providedExports: true, | ||
usedExports: true, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"compilerOptions": { | ||
"moduleResolution": "node", | ||
"module": "es2020", | ||
"target": "es2020", | ||
"allowUnreachableCode": false, | ||
"allowUnusedLabels": false, | ||
"declaration": true, | ||
"declarationMap": true, | ||
"esModuleInterop": true, | ||
"forceConsistentCasingInFileNames": true, | ||
"noEmitOnError": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"noUnusedLocals": true, | ||
"pretty": true, | ||
"sourceMap": true, | ||
"strict": true, | ||
"strictNullChecks": true, | ||
"incremental": true, | ||
"newLine": "LF" | ||
}, | ||
"exclude": [ | ||
"node_modules" | ||
] | ||
} |