Skip to content

Commit ea392ae

Browse files
chore(ci): drop lerna for nx (#3769)
Replacing Lerna by NX - allow to cache parts of the build (local runs) --------- Co-authored-by: Nadav Sinai <[email protected]>
1 parent 3549bc1 commit ea392ae

File tree

14 files changed

+1587
-2540
lines changed

14 files changed

+1587
-2540
lines changed

.vscode/gh-runners.code-workspace

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,8 @@
55
"path": ".."
66
},
77
{
8-
"name": "🚀 @lambda/functions/ami-housekeeper",
9-
"path": "../lambdas/functions/ami-housekeeper"
10-
},
11-
{
12-
"name": "🚀 @lambda/functions/control-plane",
13-
"path": "../lambdas/functions/control-plane"
14-
},
15-
{
16-
"name": "🚀 @lambda/functions/gh-agent-syncer",
17-
"path": "../lambdas/functions/gh-agent-syncer"
18-
},
19-
{
20-
"name": "🚀 @lambda/functions/webhook",
21-
"path": "../lambdas/functions/webhook"
22-
},
23-
{
24-
"name": "📦 @lambda/libs/aws-ssm-util",
25-
"path": "../lambdas/libs/aws-ssm-util"
26-
},
27-
{
28-
"name": "📦 @lambdas/libs/aws-powertools-util",
29-
"path": "../lambdas/libs/aws-powertools-util"
8+
"name": "🚀 lambdas",
9+
"path": "../lambdas"
3010
}
3111
],
3212
"settings": {

lambdas/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ dist/
66
# Ignore all yarn.lock files except the one in the root
77
**/yarn.lock
88
!/yarn.lock
9+
10+
11+
.nx/cache

lambdas/.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v18
1+
v20

lambdas/.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
/dist
3+
/coverage
4+
/.nx/cache

lambdas/functions/ami-housekeeper/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"license": "MIT",
66
"scripts": {
77
"start": "ts-node-dev src/local.ts",
8-
"test": "NODE_ENV=test jest",
9-
"test:watch": "NODE_ENV=test jest --watch",
8+
"test": "NODE_ENV=test nx test",
9+
"test:watch": "NODE_ENV=test nx test --watch",
1010
"lint": "yarn eslint src",
1111
"watch": "ts-node-dev --respawn --exit-child src/local.ts",
1212
"build": "ncc build src/lambda.ts -o dist",
@@ -44,5 +44,8 @@
4444
"@terraform-aws-github-runner/aws-ssm-util": "*",
4545
"cron-parser": "^4.8.1",
4646
"typescript": "^5.3.3"
47+
},
48+
"nx": {
49+
"includedScripts": ["build","dist","format","format-check","start","watch","all"]
4750
}
4851
}

lambdas/functions/control-plane/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"license": "MIT",
66
"scripts": {
77
"start": "ts-node-dev src/local.ts",
8-
"test": "NODE_ENV=test jest",
9-
"test:watch": "NODE_ENV=test jest --watch",
8+
"test": "NODE_ENV=test nx test",
9+
"test:watch": "NODE_ENV=test nx test --watch",
1010
"lint": "yarn eslint src",
1111
"watch": "ts-node-dev --respawn --exit-child src/local-ssm-housekeeper.ts",
1212
"build": "ncc build src/lambda.ts -o dist",
@@ -49,5 +49,8 @@
4949
"axios": "^1.6.2",
5050
"cron-parser": "^4.8.1",
5151
"typescript": "^5.3.3"
52+
},
53+
"nx": {
54+
"includedScripts": ["build","dist","format","format-check","start","watch","all"]
5255
}
5356
}

lambdas/functions/gh-agent-syncer/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"license": "MIT",
66
"scripts": {
77
"start": "ts-node-dev src/local.ts",
8-
"test": "NODE_ENV=test jest",
9-
"test:watch": "NODE_ENV=test jest --watch",
8+
"test": "NODE_ENV=test nx test",
9+
"test:watch": "NODE_ENV=test nx test --watch",
1010
"lint": "yarn eslint src",
1111
"watch": "ts-node-dev --respawn --exit-child src/local.ts",
1212
"build": "ncc build src/lambda.ts -o dist",
@@ -43,5 +43,8 @@
4343
"@middy/core": "^4.7.0",
4444
"@terraform-aws-github-runner/aws-powertools-util": "*",
4545
"axios": "^1.6.2"
46+
},
47+
"nx": {
48+
"includedScripts": ["build","dist","format","format-check","start","watch","all"]
4649
}
4750
}

lambdas/functions/webhook/package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
{
2-
"name": "@terraform-aws-github-runner/function-webhook",
2+
"name": "@terraform-aws-github-runner/webhook",
33
"version": "1.0.0",
44
"main": "lambda.ts",
55
"license": "MIT",
66
"scripts": {
77
"start": "ts-node-dev src/local.ts",
8-
"test": "NODE_ENV=test jest",
9-
"test:watch": "NODE_ENV=test jest --watch",
8+
"test": "NODE_ENV=test nx test",
9+
"test:watch": "NODE_ENV=test nx test --watch",
1010
"lint": "yarn eslint src",
1111
"watch": "ts-node-dev --respawn --exit-child src/local.ts",
1212
"build": "ncc build src/lambda.ts -o dist",
@@ -46,5 +46,8 @@
4646
"@terraform-aws-github-runner/aws-powertools-util": "*",
4747
"@terraform-aws-github-runner/aws-ssm-util": "*",
4848
"aws-lambda": "^1.0.7"
49+
},
50+
"nx": {
51+
"includedScripts": ["build","dist","format","format-check","start","watch","all"]
4952
}
5053
}

lambdas/lerna.json

Lines changed: 0 additions & 4 deletions
This file was deleted.

lambdas/libs/aws-powertools-util/package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"license": "MIT",
66
"scripts": {
77
"start": "ts-node-dev src/local.ts",
8-
"test": "NODE_ENV=test jest",
9-
"test:watch": "NODE_ENV=test jest --watch",
8+
"test": "NODE_ENV=test nx test",
9+
"test:watch": "NODE_ENV=test nx test --watch",
1010
"lint": "yarn eslint src",
1111
"watch": "ts-node-dev --respawn --exit-child src/local.ts",
1212
"format": "prettier --write \"**/*.ts\"",
@@ -39,5 +39,8 @@
3939
"@aws-lambda-powertools/logger": "^1.17.0",
4040
"@aws-lambda-powertools/tracer": "^1.14.0",
4141
"aws-lambda": "^1.0.7"
42+
},
43+
"nx": {
44+
"includedScripts": ["build","dist","format","format-check","start","watch","all"]
4245
}
4346
}

0 commit comments

Comments
 (0)