forked from aws/aws-cdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pack.sh
executable file
·19 lines (15 loc) · 848 Bytes
/
pack.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# Runs "npm package" in all modules. This will produce a "dist/" directory in each module.
# Then, calls pack-collect.sh to merge all outputs into a root ./pack directory, which is
# later read by bundle-beta.sh.
set -e
export PATH=$PWD/node_modules/.bin:$PATH
packdir="$PWD/pack"
rm -fr ${packdir}
mkdir -p ${packdir}
scopes=$(lerna ls 2>/dev/null | grep -v "(private)" | cut -d" " -f1 | xargs -n1 -I{} echo "--scope {}" | tr "\n" " ")
# Run the "cdk-package" script in all modules. For jsii modules, this invokes jsii-pacmak which generates and builds multi-language
# outputs. For non-jsii module, it will just run "npm pack" and place the output in dist/npm (which is similar to how pacmak outputs it).
lerna run ${scopes} --sort --stream package
# Collect dist/ from all modules into the root dist/
/bin/bash ./pack-collect.sh