From 365ac0488c666d4f462029aad6cf33eb75213e0c Mon Sep 17 00:00:00 2001 From: Ivan Santos <301291+pragmaticivan@users.noreply.github.com> Date: Thu, 22 Aug 2024 10:58:07 -0500 Subject: [PATCH 1/4] build: fix release layer nodejs --- nodejs/package.json | 3 +-- nodejs/packages/layer/package.json | 2 +- nodejs/sample-apps/aws-sdk/package.json | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/nodejs/package.json b/nodejs/package.json index 36e4a3c4e7..d5e38cc1fc 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -10,8 +10,7 @@ "main": "build/src/index.js", "types": "build/src/index.d.ts", "scripts": { - "precompile": "tsc --version", - "compile": "lerna run compile", + "build": "lerna run build", "test": "lerna run test", "lint": "lerna run lint", "lint:fix": "lerna run lint:fix" diff --git a/nodejs/packages/layer/package.json b/nodejs/packages/layer/package.json index f2aa3de049..66ff749f1b 100644 --- a/nodejs/packages/layer/package.json +++ b/nodejs/packages/layer/package.json @@ -8,7 +8,7 @@ "clean": "rimraf build/*", "lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts", "lint:fix": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts --fix", - "prepare": "npm run compile", + "build": "npm run clean && npm run compile && npm run postcompile", "compile": "tsc -p .", "postcompile": "copyfiles 'node_modules/**' build/workspace/nodejs && copyfiles -f 'scripts/*' build/workspace && copyfiles -f 'build/src/*' build/workspace && cd build/workspace && bestzip ../layer.zip *", "test": "mocha" diff --git a/nodejs/sample-apps/aws-sdk/package.json b/nodejs/sample-apps/aws-sdk/package.json index d216788d20..091a0cbcbd 100644 --- a/nodejs/sample-apps/aws-sdk/package.json +++ b/nodejs/sample-apps/aws-sdk/package.json @@ -10,8 +10,7 @@ "clean": "rimraf build/*", "lint": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts", "lint:fix": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts --fix", - "precompile": "tsc --version", - "prepare": "npm run compile", + "build": "npm run clean && npm run compile && npm run postcompile", "compile": "tsc -p .", "postcompile": "copyfiles 'package*.json' build/src/ && npm install --production --ignore-scripts --prefix build/src/ && cd build/src && bestzip ../function.zip *" }, From 230895b37f1bc38882d531f21eb22997b76acc43 Mon Sep 17 00:00:00 2001 From: Ivan Santos <301291+pragmaticivan@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:00:02 -0500 Subject: [PATCH 2/4] build: rename build step --- .github/workflows/release-layer-nodejs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-layer-nodejs.yml b/.github/workflows/release-layer-nodejs.yml index a220dad93e..764511f5eb 100644 --- a/.github/workflows/release-layer-nodejs.yml +++ b/.github/workflows/release-layer-nodejs.yml @@ -25,7 +25,7 @@ jobs: - name: Build run: | npm install - npm run compile + npm run build working-directory: nodejs - name: Save Node SDK Version From f28cd32ca4e74b1f52adea4eb7456c618eb3049d Mon Sep 17 00:00:00 2001 From: Ivan Santos <301291+pragmaticivan@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:37:07 -0500 Subject: [PATCH 3/4] build: fix with prod only install --- nodejs/packages/layer/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/packages/layer/package.json b/nodejs/packages/layer/package.json index 66ff749f1b..dcc94a57c8 100644 --- a/nodejs/packages/layer/package.json +++ b/nodejs/packages/layer/package.json @@ -10,7 +10,7 @@ "lint:fix": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts --fix", "build": "npm run clean && npm run compile && npm run postcompile", "compile": "tsc -p .", - "postcompile": "copyfiles 'node_modules/**' build/workspace/nodejs && copyfiles -f 'scripts/*' build/workspace && copyfiles -f 'build/src/*' build/workspace && cd build/workspace && bestzip ../layer.zip *", + "postcompile": "copyfiles 'package*.json' build/workspace/nodejs && npm install --production --ignore-scripts --prefix build/workspace/nodejs && copyfiles -f 'scripts/*' build/workspace && copyfiles -f 'build/src/*' build/workspace && cd build/workspace && bestzip ../layer.zip *", "test": "mocha" }, "keywords": [ From cb18a1874a55d6060523c7099b4f8c70e30d7cf4 Mon Sep 17 00:00:00 2001 From: Ivan Santos <301291+pragmaticivan@users.noreply.github.com> Date: Thu, 22 Aug 2024 11:41:58 -0500 Subject: [PATCH 4/4] build: reduce layer by removing package json files --- nodejs/packages/layer/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nodejs/packages/layer/package.json b/nodejs/packages/layer/package.json index dcc94a57c8..8d2e7cae47 100644 --- a/nodejs/packages/layer/package.json +++ b/nodejs/packages/layer/package.json @@ -10,7 +10,7 @@ "lint:fix": "ESLINT_USE_FLAT_CONFIG=false eslint . --ext .ts --fix", "build": "npm run clean && npm run compile && npm run postcompile", "compile": "tsc -p .", - "postcompile": "copyfiles 'package*.json' build/workspace/nodejs && npm install --production --ignore-scripts --prefix build/workspace/nodejs && copyfiles -f 'scripts/*' build/workspace && copyfiles -f 'build/src/*' build/workspace && cd build/workspace && bestzip ../layer.zip *", + "postcompile": "copyfiles 'package*.json' build/workspace/nodejs && npm install --production --ignore-scripts --prefix build/workspace/nodejs && rm build/workspace/nodejs/package.json build/workspace/nodejs/package-lock.json && copyfiles -f 'scripts/*' build/workspace && copyfiles -f 'build/src/*' build/workspace && cd build/workspace && bestzip ../layer.zip *", "test": "mocha" }, "keywords": [