Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat (build): Add package size check in PR workflow #878

Merged
merged 93 commits into from
Jun 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
93 commits
Select commit Hold shift + click to select a range
3a1538b
Add package size check to pr workflow
May 16, 2022
674054e
test unique report
flochaz May 25, 2022
386c0ad
fix build-command
flochaz May 25, 2022
643e132
test lerna-package
flochaz May 25, 2022
8865850
move to 1.2.5
flochaz May 25, 2022
ece0208
use bash
flochaz May 25, 2022
9fe306f
move to 1.2.6
flochaz May 25, 2022
56a878b
move to 1.2.7
flochaz May 25, 2022
69b7457
pipe commands
flochaz May 25, 2022
79e4fd4
move to 1.2.8
flochaz May 25, 2022
d65be27
1.2.9
flochaz May 25, 2022
8aff6af
ls
flochaz May 25, 2022
ff609d0
metrics only
flochaz May 25, 2022
0a98a21
metrics only
flochaz May 25, 2022
5ff3863
fix mv
flochaz May 25, 2022
5be5468
wtf
flochaz May 25, 2022
ee8b689
remove dot
flochaz May 25, 2022
19817a7
fix dist dir
flochaz May 25, 2022
d4a2ebf
move to all at once
flochaz May 25, 2022
bc5aa84
try for loop
flochaz May 25, 2022
754c0f0
bash -c
flochaz May 25, 2022
21685fb
only metrics again ?
flochaz May 25, 2022
f64d98f
back to 1.2.12
flochaz May 25, 2022
4e85a4d
test bash -c inline
flochaz May 25, 2022
712ffa6
back to all
flochaz May 25, 2022
aa15807
draft uber-package-builder
May 30, 2022
bc47809
Merge branch 'flochaz-patch-1' of github.com:awslabs/aws-lambda-power…
May 30, 2022
8c42b7b
Add lerna command for uber zip
May 30, 2022
acbc0f6
rename uber to bundle
Jun 1, 2022
94977ba
Merge remote-tracking branch 'origin/main' into flochaz-patch-1
Jun 1, 2022
4c131f6
Trigger Build
dreamorosi Jun 2, 2022
c73ced7
test unique report
flochaz May 25, 2022
1a840c4
fix build-command
flochaz May 25, 2022
bba5730
test lerna-package
flochaz May 25, 2022
b9e5361
move to 1.2.5
flochaz May 25, 2022
9a638f3
use bash
flochaz May 25, 2022
d520e99
move to 1.2.6
flochaz May 25, 2022
3f218df
move to 1.2.7
flochaz May 25, 2022
d231b4a
pipe commands
flochaz May 25, 2022
3b1ef1b
move to 1.2.8
flochaz May 25, 2022
385dbf7
1.2.9
flochaz May 25, 2022
195adcd
ls
flochaz May 25, 2022
30821b9
metrics only
flochaz May 25, 2022
96b86df
metrics only
flochaz May 25, 2022
5fbabc5
fix mv
flochaz May 25, 2022
c879953
wtf
flochaz May 25, 2022
97788e3
remove dot
flochaz May 25, 2022
e8a71dd
fix dist dir
flochaz May 25, 2022
6af2274
move to all at once
flochaz May 25, 2022
4b14b87
try for loop
flochaz May 25, 2022
9a9c3ac
bash -c
flochaz May 25, 2022
30422e7
only metrics again ?
flochaz May 25, 2022
dfc72ef
back to 1.2.12
flochaz May 25, 2022
66b17c3
test bash -c inline
flochaz May 25, 2022
1b3bb38
back to all
flochaz May 25, 2022
b441615
Add lerna command for uber zip
May 30, 2022
d78f739
rename uber to bundle
Jun 1, 2022
943a125
build(deps): bump mkdocs-material from 8.2.14 to 8.2.15 in /docs (#898)
dependabot[bot] May 20, 2022
32c0a6e
build(deps): bump aws-xray-sdk-core from 3.3.4 to 3.3.5 (#887)
dependabot[bot] May 20, 2022
de562b9
build(deps-dev): bump @types/lodash.clonedeep from 4.5.6 to 4.5.7 (#885)
dependabot[bot] May 20, 2022
050b64c
build(deps-dev): bump @types/node from 17.0.33 to 17.0.35 (#888)
dependabot[bot] May 20, 2022
cdc89dd
build(deps-dev): bump @commitlint/cli from 16.2.4 to 17.0.0 (#886)
dependabot[bot] May 20, 2022
852714b
build(deps): bump @aws-sdk/client-sts from 3.87.0 to 3.95.0 (#889)
dependabot[bot] May 20, 2022
13ad3da
build(deps-dev): bump axios from 0.27.1 to 0.27.2 (#897)
dependabot[bot] May 23, 2022
fe41bd1
build(deps-dev): bump @types/lodash.merge from 4.6.6 to 4.6.7 (#896)
dependabot[bot] May 23, 2022
9aa5b3f
build(deps): bump constructs from 10.1.7 to 10.1.12 (#895)
dependabot[bot] May 23, 2022
41355f3
build(deps-dev): bump @typescript-eslint/eslint-plugin (#894)
dependabot[bot] May 23, 2022
40c3fee
build(deps-dev): bump @typescript-eslint/parser from 5.23.0 to 5.25.0…
dependabot[bot] May 23, 2022
11ada13
build(deps-dev): bump @types/lodash.pickby from 4.6.6 to 4.6.7 (#892)
dependabot[bot] May 23, 2022
d7c3fc3
build(deps-dev): bump @aws-sdk/client-dynamodb from 3.58.0 to 3.95.0 …
dependabot[bot] May 23, 2022
3a48b64
build(deps): bump aws-sdk from 2.1134.0 to 2.1140.0 (#900)
dependabot[bot] May 23, 2022
337e3a0
fix(logger): enable logging of arbitrary objects (#883)
May 24, 2022
eff13cb
chore(release): v0.9.1 [skip ci]
github-actions[bot] May 24, 2022
5d4d7b7
feat(all): nodejs16x support (#877)
dreamorosi May 24, 2022
d28cbd8
chore(examples): updated contributing & docs with SAM (#876)
dreamorosi May 25, 2022
4715678
fix(commons): rename tests subfolder to samples to avoid being delete…
flochaz May 25, 2022
d801b2b
build(deps-dev): bump axios from 0.27.1 to 0.27.2 (#923)
dependabot[bot] May 27, 2022
2211da2
build(deps-dev): bump @typescript-eslint/eslint-plugin (#922)
dependabot[bot] May 27, 2022
72078b1
build(deps-dev): bump @commitlint/cli from 17.0.0 to 17.0.1 (#919)
dependabot[bot] May 27, 2022
6a4445f
build(deps-dev): bump @typescript-eslint/parser from 5.25.0 to 5.26.0…
dependabot[bot] May 27, 2022
05214ae
build(deps-dev): bump eslint from 8.15.0 to 8.16.0 (#910)
dependabot[bot] May 27, 2022
1881791
build(deps-dev): bump ts-node from 10.7.0 to 10.8.0 (#908)
dependabot[bot] May 27, 2022
98e74bd
build(deps-dev): bump esbuild from 0.14.39 to 0.14.40 (#905)
dependabot[bot] May 27, 2022
e5cf1aa
build(deps-dev): bump @types/lodash.clonedeep from 4.5.6 to 4.5.7 (#906)
dependabot[bot] May 27, 2022
c64bc54
build(deps-dev): bump @types/lodash.pickby from 4.6.6 to 4.6.7 (#914)
dependabot[bot] May 27, 2022
83bd183
build(deps): bump aws-cdk-lib from 2.24.1 to 2.25.0 (#904)
dependabot[bot] May 27, 2022
b5796d5
build(deps-dev): bump cdk-assets from 2.24.1 to 2.25.0 (#907)
dependabot[bot] May 27, 2022
80cdb0e
build(deps-dev): bump @aws-cdk/cloudformation-diff from 2.24.1 to 2.2…
dependabot[bot] May 27, 2022
d6f259a
build(deps-dev): bump @aws-cdk/cx-api from 2.24.1 to 2.25.0 (#913)
dependabot[bot] May 27, 2022
d497555
build(deps): bump constructs from 10.1.12 to 10.1.19 (#920)
dependabot[bot] May 27, 2022
3d9725d
feat(logger): add removeKeys functionality (#901)
saragerion May 30, 2022
fc5ed31
Trigger Build
dreamorosi Jun 2, 2022
16ad4ba
Merge branch 'flochaz-patch-1' of github.com:awslabs/aws-lambda-power…
Jun 3, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/pr_lint_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@ jobs:
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info
- name: Packages size report
uses: flochaz/pkg-size-action@v1.2.12
with:
build-command: mkdir dist && npm run lerna-package && npm run lerna-package-bundle && bash -c "mv ./packages/*/dist/* dist/" && ls dist
dist-directory: /dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions examples/cdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"watch": "tsc -w",
"test": "npm run test:unit",
"package": "echo 'Not applicable'",
"package-bundle": "echo 'Not applicable'",
"test:unit": "npm run build && jest",
"test:e2e": "echo 'To be implemented ...'",
"version": "npm install @aws-lambda-powertools/logger@0.7.0 @aws-lambda-powertools/tracer@0.7.0 @aws-lambda-powertools/metrics@0.7.0 && git add package.json",
Expand Down
1 change: 1 addition & 0 deletions examples/sam/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
"build": "sam build --beta-features",
"test": "npm run test:unit",
"package": "echo 'Not applicable'",
"package-bundle": "echo 'Not applicable'",
"test:unit": "npm run build && jest",
"test:e2e": "echo 'To be implemented ...'",
"version": "npm install @aws-lambda-powertools/logger@0.7.0 @aws-lambda-powertools/tracer@0.7.0 @aws-lambda-powertools/metrics@0.7.0 && git add package.json"
Expand Down
44 changes: 44 additions & 0 deletions package-bundler.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -e


usage() {
echo "Uber package Builder"
echo "------------------------"
echo "./package-bundler.sh NAME LOCAL_NPM_PACKAGE_LOCATION"
echo ""
}


if [[ "$#" -lt 2 ]]; then
usage
exit 1
fi

name=$(basename ${1})
dist_folder="${2}"

echo "Will bundle $(ls ${dist_folder}) into ${dist_folder}/${name}.tgz"

output_folder="$(mktemp -d)"

docker_image="public.ecr.aws/sam/build-nodejs14.x:latest"
volume_params="-v $output_folder:/bundle"

package_folder="nodejs/"
mkdir -p "$output_folder/$package_folder"

cp -r "${2}" "$output_folder/$package_folder/"

install_command="pushd $package_folder; npm install --save ./*.tgz; popd"
volume_params="$volume_params -v $HOME/.npmrc:/root/.npmrc"

zip_command="zip -r bundle.zip * && rm -rf $package_folder"

docker run --rm $volume_params -w "/bundle" "$docker_image" /bin/bash -c "$install_command && $zip_command"

mv "$output_folder/bundle.zip" "$dist_folder/$name.zip"

rm -rf $output_folder

echo "All done"
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"lerna-test:unit": "lerna exec -- npm run test:unit",
"lerna-test:e2e": "lerna exec -- npm run test:e2e",
"lerna-package": "lerna exec -- npm run package",
"lerna-package-bundle": "lerna exec -- npm run package-bundle",
"lerna-build": "lerna exec -- tsc",
"lerna-lint": "lerna exec -- eslint \"./{src,tests}/**/*.ts ./src/*.ts\"",
"lerna-format": "lerna exec -- eslint --fix \"./{src,tests}/**/*.ts ./src/*.ts\"",
Expand Down
1 change: 1 addition & 0 deletions packages/commons/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
"lint": "eslint --ext .ts --fix --no-error-on-unmatched-pattern src tests",
"format": "eslint --fix --ext .ts --fix --no-error-on-unmatched-pattern src tests",
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
Expand Down
1 change: 1 addition & 0 deletions packages/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint": "eslint --ext .ts --fix --no-error-on-unmatched-pattern src tests",
"format": "eslint --fix --ext .ts --fix --no-error-on-unmatched-pattern src tests",
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
Expand Down
1 change: 1 addition & 0 deletions packages/metrics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"lint": "eslint --ext .ts --fix --no-error-on-unmatched-pattern src tests",
"format": "eslint --fix --ext .ts --fix --no-error-on-unmatched-pattern src tests",
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/",
"prepare": "npm run build",
"prepublishOnly": "npm test && npm run lint",
"preversion": "npm run lint",
Expand Down
3 changes: 2 additions & 1 deletion packages/tracer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postversion": "git push && git push --tags",
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/"
"package": "mkdir -p dist/ && npm pack && mv *.tgz dist/",
"package-bundle": "../../package-bundler.sh ${LERNA_PACKAGE_NAME}-bundle ./dist/"
},
"homepage": "https://github.com/awslabs/aws-lambda-powertools-typescript/tree/master/packages/tracer#readme",
"license": "MIT-0",
Expand Down