skuba 0.0.0-master-20231001235226 → 0.0.0-master-20231121000709
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config/prettier.js +1 -1
- package/lib/api/jest/index.d.ts +2 -2
- package/lib/api/jest/index.js +19 -1
- package/lib/api/jest/index.js.map +2 -2
- package/lib/api/net/compose.js +2 -1
- package/lib/api/net/compose.js.map +2 -2
- package/lib/cli/configure/getProjectType.d.ts +1 -1
- package/lib/cli/configure/getProjectType.js +5 -2
- package/lib/cli/configure/getProjectType.js.map +2 -2
- package/lib/cli/configure/index.js +0 -4
- package/lib/cli/configure/index.js.map +2 -2
- package/lib/cli/configure/patchRenovateConfig.js +13 -11
- package/lib/cli/configure/patchRenovateConfig.js.map +2 -2
- package/lib/cli/init/getConfig.d.ts +3 -3
- package/lib/cli/init/getConfig.js +8 -8
- package/lib/cli/init/getConfig.js.map +2 -2
- package/lib/cli/init/index.js +0 -1
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/types.d.ts +99 -27
- package/lib/cli/init/types.js +26 -35
- package/lib/cli/init/types.js.map +2 -2
- package/lib/utils/error.d.ts +30 -10
- package/lib/utils/error.js +10 -20
- package/lib/utils/error.js.map +2 -2
- package/lib/utils/exec.js +2 -2
- package/lib/utils/exec.js.map +2 -2
- package/lib/utils/manifest.d.ts +3 -3
- package/lib/utils/manifest.js +9 -9
- package/lib/utils/manifest.js.map +2 -2
- package/lib/utils/template.d.ts +43 -13
- package/lib/utils/template.js +15 -15
- package/lib/utils/template.js.map +2 -2
- package/package.json +21 -21
- package/template/express-rest-api/.buildkite/pipeline.yml +3 -2
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +3 -3
- package/template/express-rest-api/README.md +6 -6
- package/template/express-rest-api/package.json +2 -2
- package/template/greeter/.buildkite/pipeline.yml +3 -2
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/Dockerfile +3 -3
- package/template/greeter/README.md +3 -3
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +3 -2
- package/template/koa-rest-api/Dockerfile +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +3 -3
- package/template/koa-rest-api/README.md +6 -6
- package/template/koa-rest-api/package.json +5 -5
- package/template/koa-rest-api/src/app.test.ts +8 -4
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +4 -3
- package/template/lambda-sqs-worker/.nvmrc +1 -1
- package/template/lambda-sqs-worker/Dockerfile +3 -3
- package/template/lambda-sqs-worker/README.md +6 -6
- package/template/lambda-sqs-worker/package.json +3 -3
- package/template/lambda-sqs-worker/serverless.yml +1 -1
- package/template/lambda-sqs-worker/src/framework/validation.test.ts +1 -1
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +4 -3
- package/template/lambda-sqs-worker-cdk/Dockerfile +3 -3
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +2 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +4 -4
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/oss-npm-package/README.md +1 -1
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/README.md +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/template.ts"],
|
|
4
|
-
"sourcesContent": ["
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport { z } from 'zod';\n\nimport { projectTypeSchema } from './manifest';\n\nexport const TEMPLATE_NAMES = [\n 'express-rest-api',\n 'greeter',\n 'koa-rest-api',\n 'lambda-sqs-worker',\n 'lambda-sqs-worker-cdk',\n 'oss-npm-package',\n 'private-npm-package',\n] as const;\n\nexport type TemplateName = (typeof TEMPLATE_NAMES)[number];\n\nexport const TEMPLATE_NAMES_WITH_BYO = [...TEMPLATE_NAMES, 'github \u2192'] as const;\n\ninterface TemplateDocumentationConfig {\n /**\n * The semantic version in which the template was first added.\n *\n * This is used to filter out historical changelogs.\n */\n added: string;\n\n /**\n * The Markdown file for the template in our `/docs`.\n *\n * This is used to compile per-template changelogs for our documentation site.\n */\n filename: string;\n}\n\nexport const TEMPLATE_DOCUMENTATION_CONFIG: Record<\n TemplateName,\n TemplateDocumentationConfig\n> = {\n 'express-rest-api': {\n added: '3.8.0',\n filename: 'api.md',\n },\n greeter: {\n added: '3.4.1',\n filename: 'barebones.md',\n },\n 'koa-rest-api': {\n added: '3.4.1',\n filename: 'api.md',\n },\n 'lambda-sqs-worker': {\n added: '3.4.1',\n filename: 'worker.md',\n },\n 'lambda-sqs-worker-cdk': {\n added: '3.13.0',\n filename: 'worker.md',\n },\n 'oss-npm-package': {\n added: '3.7.0',\n filename: 'package.md',\n },\n 'private-npm-package': {\n added: '3.6.0',\n filename: 'package.md',\n },\n};\n\nexport type TemplateConfig = z.infer<typeof templateConfigSchema>;\n\nexport const templateConfigSchema = z.object({\n fields: z.array(\n z.object({\n name: z.string(),\n message: z.string(),\n initial: z.string(),\n validate: z\n .function()\n .args(z.string())\n .returns(z.union([z.boolean(), z.string()]))\n .optional(),\n }),\n ),\n entryPoint: z.string().optional(),\n noSkip: z.boolean().optional(),\n type: projectTypeSchema.optional(),\n});\n\nexport const TEMPLATE_CONFIG_FILENAME = 'skuba.template.js';\n\nexport const TEMPLATE_DIR = path.join(__dirname, '..', '..', 'template');\n\nexport const BASE_TEMPLATE_DIR = path.join(TEMPLATE_DIR, 'base');\n\nexport const ensureTemplateConfigDeletion = (dir: string): Promise<void> =>\n fs.promises.rm(path.join(dir, TEMPLATE_CONFIG_FILENAME));\n\nexport const readBaseTemplateFile = (src: string): Promise<string> =>\n fs.promises.readFile(path.join(BASE_TEMPLATE_DIR, src), 'utf8');\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AACf,iBAAkB;AAElB,sBAAkC;AAE3B,MAAM,iBAAiB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,MAAM,0BAA0B,CAAC,GAAG,gBAAgB,eAAU;AAkB9D,MAAM,gCAGT;AAAA,EACF,oBAAoB;AAAA,IAClB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,IACP,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,gBAAgB;AAAA,IACd,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,qBAAqB;AAAA,IACnB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,yBAAyB;AAAA,IACvB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,mBAAmB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AAAA,EACA,uBAAuB;AAAA,IACrB,OAAO;AAAA,IACP,UAAU;AAAA,EACZ;AACF;AAIO,MAAM,uBAAuB,aAAE,OAAO;AAAA,EAC3C,QAAQ,aAAE;AAAA,IACR,aAAE,OAAO;AAAA,MACP,MAAM,aAAE,OAAO;AAAA,MACf,SAAS,aAAE,OAAO;AAAA,MAClB,SAAS,aAAE,OAAO;AAAA,MAClB,UAAU,aACP,SAAS,EACT,KAAK,aAAE,OAAO,CAAC,EACf,QAAQ,aAAE,MAAM,CAAC,aAAE,QAAQ,GAAG,aAAE,OAAO,CAAC,CAAC,CAAC,EAC1C,SAAS;AAAA,IACd,CAAC;AAAA,EACH;AAAA,EACA,YAAY,aAAE,OAAO,EAAE,SAAS;AAAA,EAChC,QAAQ,aAAE,QAAQ,EAAE,SAAS;AAAA,EAC7B,MAAM,kCAAkB,SAAS;AACnC,CAAC;AAEM,MAAM,2BAA2B;AAEjC,MAAM,eAAe,YAAAA,QAAK,KAAK,WAAW,MAAM,MAAM,UAAU;AAEhE,MAAM,oBAAoB,YAAAA,QAAK,KAAK,cAAc,MAAM;AAExD,MAAM,+BAA+B,CAAC,QAC3C,gBAAAC,QAAG,SAAS,GAAG,YAAAD,QAAK,KAAK,KAAK,wBAAwB,CAAC;AAElD,MAAM,uBAAuB,CAAC,QACnC,gBAAAC,QAAG,SAAS,SAAS,YAAAD,QAAK,KAAK,mBAAmB,GAAG,GAAG,MAAM;",
|
|
6
6
|
"names": ["path", "fs"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "0.0.0-master-
|
|
3
|
+
"version": "0.0.0-master-20231121000709",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
6
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"release": "yarn build && changeset publish",
|
|
37
37
|
"skuba": "yarn build && node lib/skuba",
|
|
38
38
|
"stage": "changeset version && yarn format",
|
|
39
|
-
"test": "yarn skuba test",
|
|
40
|
-
"test:ci": "yarn skuba test --
|
|
41
|
-
"test:int": "yarn skuba test --
|
|
39
|
+
"test": "yarn skuba test --selectProjects unit",
|
|
40
|
+
"test:ci": "yarn skuba test --runInBand",
|
|
41
|
+
"test:int": "yarn skuba test --selectProjects integration --runInBand",
|
|
42
42
|
"test:template": "scripts/test-template.sh",
|
|
43
|
-
"test:watch": "yarn skuba test --
|
|
43
|
+
"test:watch": "yarn skuba test --runInBand --watch"
|
|
44
44
|
},
|
|
45
45
|
"remarkConfig": {
|
|
46
46
|
"plugins": [
|
|
@@ -102,10 +102,9 @@
|
|
|
102
102
|
"npm-run-path": "^4.0.1",
|
|
103
103
|
"npm-which": "^3.0.1",
|
|
104
104
|
"picomatch": "^2.2.2",
|
|
105
|
-
"prettier": "~3.0
|
|
105
|
+
"prettier": "~3.1.0",
|
|
106
106
|
"prettier-plugin-packagejson": "^2.4.6",
|
|
107
107
|
"read-pkg-up": "^7.0.1",
|
|
108
|
-
"runtypes": "^6.0.0",
|
|
109
108
|
"semantic-release": "^21.0.0",
|
|
110
109
|
"serialize-error": "^8.0.1",
|
|
111
110
|
"simple-git": "^3.5.0",
|
|
@@ -117,29 +116,30 @@
|
|
|
117
116
|
"tsconfig-paths": "^4.0.0",
|
|
118
117
|
"tsconfig-seek": "2.0.0",
|
|
119
118
|
"typescript": "~5.2.0",
|
|
120
|
-
"validate-npm-package-name": "^5.0.0"
|
|
119
|
+
"validate-npm-package-name": "^5.0.0",
|
|
120
|
+
"zod": "^3.22.4"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@changesets/cli": "2.26.2",
|
|
124
124
|
"@changesets/get-github-info": "0.5.2",
|
|
125
125
|
"@jest/reporters": "29.7.0",
|
|
126
|
-
"@types/ejs": "3.1.
|
|
127
|
-
"@types/express": "4.17.
|
|
128
|
-
"@types/fs-extra": "11.0.
|
|
129
|
-
"@types/koa": "2.13.
|
|
130
|
-
"@types/libnpmsearch": "2.0.
|
|
131
|
-
"@types/lodash.mergewith": "4.6.
|
|
132
|
-
"@types/module-alias": "2.0.
|
|
133
|
-
"@types/npm-which": "3.0.
|
|
134
|
-
"@types/picomatch": "2.3.
|
|
135
|
-
"@types/supertest": "2.0.
|
|
136
|
-
"@types/validate-npm-package-name": "4.0.
|
|
126
|
+
"@types/ejs": "3.1.5",
|
|
127
|
+
"@types/express": "4.17.21",
|
|
128
|
+
"@types/fs-extra": "11.0.4",
|
|
129
|
+
"@types/koa": "2.13.11",
|
|
130
|
+
"@types/libnpmsearch": "2.0.6",
|
|
131
|
+
"@types/lodash.mergewith": "4.6.9",
|
|
132
|
+
"@types/module-alias": "2.0.4",
|
|
133
|
+
"@types/npm-which": "3.0.3",
|
|
134
|
+
"@types/picomatch": "2.3.3",
|
|
135
|
+
"@types/supertest": "2.0.16",
|
|
136
|
+
"@types/validate-npm-package-name": "4.0.2",
|
|
137
137
|
"enhanced-resolve": "5.15.0",
|
|
138
138
|
"express": "4.18.2",
|
|
139
|
-
"fastify": "4.
|
|
139
|
+
"fastify": "4.24.3",
|
|
140
140
|
"jsonfile": "6.1.0",
|
|
141
141
|
"koa": "2.14.2",
|
|
142
|
-
"memfs": "4.
|
|
142
|
+
"memfs": "4.6.0",
|
|
143
143
|
"remark-cli": "12.0.0",
|
|
144
144
|
"remark-preset-lint-recommended": "6.1.3",
|
|
145
145
|
"semver": "7.5.4",
|
|
@@ -14,11 +14,12 @@ configs:
|
|
|
14
14
|
- package.json
|
|
15
15
|
- yarn.lock
|
|
16
16
|
dockerfile: Dockerfile.dev-deps
|
|
17
|
-
secrets: id=npm,src
|
|
17
|
+
secrets: id=npm,src=tmp/.npmrc
|
|
18
18
|
|
|
19
19
|
- &private-npm
|
|
20
20
|
seek-oss/private-npm#v1.2.0:
|
|
21
21
|
env: NPM_READ_TOKEN
|
|
22
|
+
output-path: tmp/
|
|
22
23
|
|
|
23
24
|
base-steps:
|
|
24
25
|
- &deploy
|
|
@@ -53,7 +54,7 @@ steps:
|
|
|
53
54
|
- *aws-sm
|
|
54
55
|
- *private-npm
|
|
55
56
|
- *docker-ecr-cache
|
|
56
|
-
- docker-compose#v4.
|
|
57
|
+
- docker-compose#v4.16.0:
|
|
57
58
|
run: app
|
|
58
59
|
timeout_in_minutes: 10
|
|
59
60
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
20
|
|
@@ -17,7 +17,7 @@ RUN yarn build
|
|
|
17
17
|
|
|
18
18
|
###
|
|
19
19
|
|
|
20
|
-
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} gcr.io/distroless/
|
|
20
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} gcr.io/distroless/nodejs20-debian11 AS runtime
|
|
21
21
|
|
|
22
22
|
WORKDIR /workdir
|
|
23
23
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# syntax=docker/dockerfile:1.
|
|
1
|
+
# syntax=docker/dockerfile:1.6
|
|
2
2
|
|
|
3
|
-
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:20-alpine AS dev-deps
|
|
4
4
|
|
|
5
5
|
WORKDIR /workdir
|
|
6
6
|
|
|
7
7
|
COPY package.json yarn.lock ./
|
|
8
8
|
|
|
9
9
|
RUN \
|
|
10
|
-
--mount=type=secret,id=npm,dst=/
|
|
10
|
+
--mount=type=secret,id=npm,dst=/root/.npmrc \
|
|
11
11
|
yarn install --frozen-lockfile --ignore-optional --non-interactive
|
|
@@ -19,12 +19,12 @@ Next steps:
|
|
|
19
19
|
6. [ ] Configure [GitHub repository settings].
|
|
20
20
|
7. [ ] Delete this checklist 😌.
|
|
21
21
|
|
|
22
|
-
[builds at seek]: https://builds-
|
|
22
|
+
[builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
|
|
23
23
|
[github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
24
24
|
|
|
25
25
|
## Design
|
|
26
26
|
|
|
27
|
-
<%-repoName %> is a Node.js HTTP server built in line with our [
|
|
27
|
+
<%-repoName %> is a Node.js HTTP server built in line with our [Technical Guidelines].
|
|
28
28
|
It uses the [Express] middleware framework and common SEEK packages.
|
|
29
29
|
Resource APIs enable synchronous interactions and serve as the backbone of SEEK's general service architecture.
|
|
30
30
|
|
|
@@ -100,7 +100,7 @@ TODO: add support links for the prod environment.
|
|
|
100
100
|
- Splunk logs
|
|
101
101
|
-->
|
|
102
102
|
|
|
103
|
-
[
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
[
|
|
103
|
+
[CodeDeploy]: https://docs.aws.amazon.com/codedeploy
|
|
104
|
+
[Express]: https://expressjs.com
|
|
105
|
+
[Gantry]: https://backstage.myseek.xyz/docs/default/component/gantry/
|
|
106
|
+
[Technical Guidelines]: https://myseek.atlassian.net/wiki/spaces/AA/pages/2358346017/
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
},
|
|
19
19
|
"devDependencies": {
|
|
20
20
|
"@types/express": "^4.17.13",
|
|
21
|
-
"@types/node": "^
|
|
21
|
+
"@types/node": "^20.9.0",
|
|
22
22
|
"@types/supertest": "^2.0.11",
|
|
23
23
|
"pino-pretty": "^10.0.0",
|
|
24
24
|
"skuba": "*",
|
|
25
25
|
"supertest": "^6.1.6"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">=20"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -13,11 +13,12 @@ configs:
|
|
|
13
13
|
cache-on:
|
|
14
14
|
- package.json
|
|
15
15
|
- yarn.lock
|
|
16
|
-
secrets: id=npm,src
|
|
16
|
+
secrets: id=npm,src=tmp/.npmrc
|
|
17
17
|
|
|
18
18
|
- &private-npm
|
|
19
19
|
seek-oss/private-npm#v1.2.0:
|
|
20
20
|
env: NPM_READ_TOKEN
|
|
21
|
+
output-path: tmp/
|
|
21
22
|
|
|
22
23
|
steps:
|
|
23
24
|
- label: 🧪 Test & Lint
|
|
@@ -32,6 +33,6 @@ steps:
|
|
|
32
33
|
- *aws-sm
|
|
33
34
|
- *private-npm
|
|
34
35
|
- *docker-ecr-cache
|
|
35
|
-
- docker-compose#v4.
|
|
36
|
+
- docker-compose#v4.16.0:
|
|
36
37
|
run: app
|
|
37
38
|
timeout_in_minutes: 10
|
package/template/greeter/.nvmrc
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
20
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# syntax=docker/dockerfile:1.
|
|
1
|
+
# syntax=docker/dockerfile:1.6
|
|
2
2
|
|
|
3
|
-
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:20-alpine AS dev-deps
|
|
4
4
|
|
|
5
5
|
WORKDIR /workdir
|
|
6
6
|
|
|
7
7
|
COPY package.json yarn.lock ./
|
|
8
8
|
|
|
9
9
|
RUN \
|
|
10
|
-
--mount=type=secret,id=npm,dst=/
|
|
10
|
+
--mount=type=secret,id=npm,dst=/root/.npmrc \
|
|
11
11
|
yarn install --frozen-lockfile --ignore-optional --non-interactive
|
|
@@ -17,13 +17,13 @@ Next steps:
|
|
|
17
17
|
5. [ ] Configure [GitHub repository settings].
|
|
18
18
|
6. [ ] Delete this checklist 😌.
|
|
19
19
|
|
|
20
|
-
[builds at seek]: https://builds-
|
|
20
|
+
[builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
|
|
21
21
|
[github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
22
22
|
|
|
23
23
|
## Design
|
|
24
24
|
|
|
25
25
|
The `greeter` template is the prototypical _hello world_ project.
|
|
26
|
-
It can function as a playground for the TypeScript tooling prescribed by our [
|
|
26
|
+
It can function as a playground for the TypeScript tooling prescribed by our [Technical Guidelines],
|
|
27
27
|
or serve as a starting point for a backend project if the other built-in templates are not a good fit.
|
|
28
28
|
|
|
29
29
|
It's a barebones Node.js application that comprises:
|
|
@@ -93,4 +93,4 @@ TODO: add support links for the prod environment.
|
|
|
93
93
|
- Splunk logs
|
|
94
94
|
-->
|
|
95
95
|
|
|
96
|
-
[
|
|
96
|
+
[Technical Guidelines]: https://myseek.atlassian.net/wiki/spaces/AA/pages/2358346017/
|
|
@@ -14,11 +14,12 @@ configs:
|
|
|
14
14
|
- package.json
|
|
15
15
|
- yarn.lock
|
|
16
16
|
dockerfile: Dockerfile.dev-deps
|
|
17
|
-
secrets: id=npm,src
|
|
17
|
+
secrets: id=npm,src=tmp/.npmrc
|
|
18
18
|
|
|
19
19
|
- &private-npm
|
|
20
20
|
seek-oss/private-npm#v1.2.0:
|
|
21
21
|
env: NPM_READ_TOKEN
|
|
22
|
+
output-path: tmp/
|
|
22
23
|
|
|
23
24
|
base-steps:
|
|
24
25
|
- &deploy
|
|
@@ -53,7 +54,7 @@ steps:
|
|
|
53
54
|
- *aws-sm
|
|
54
55
|
- *private-npm
|
|
55
56
|
- *docker-ecr-cache
|
|
56
|
-
- docker-compose#v4.
|
|
57
|
+
- docker-compose#v4.16.0:
|
|
57
58
|
run: app
|
|
58
59
|
timeout_in_minutes: 10
|
|
59
60
|
|
|
@@ -17,7 +17,7 @@ RUN yarn build
|
|
|
17
17
|
|
|
18
18
|
###
|
|
19
19
|
|
|
20
|
-
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} gcr.io/distroless/
|
|
20
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} gcr.io/distroless/nodejs20-debian11 AS runtime
|
|
21
21
|
|
|
22
22
|
WORKDIR /workdir
|
|
23
23
|
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# syntax=docker/dockerfile:1.
|
|
1
|
+
# syntax=docker/dockerfile:1.6
|
|
2
2
|
|
|
3
|
-
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:20-alpine AS dev-deps
|
|
4
4
|
|
|
5
5
|
WORKDIR /workdir
|
|
6
6
|
|
|
7
7
|
COPY package.json yarn.lock ./
|
|
8
8
|
|
|
9
9
|
RUN \
|
|
10
|
-
--mount=type=secret,id=npm,dst=/
|
|
10
|
+
--mount=type=secret,id=npm,dst=/root/.npmrc \
|
|
11
11
|
yarn install --frozen-lockfile --ignore-optional --non-interactive
|
|
@@ -19,12 +19,12 @@ Next steps:
|
|
|
19
19
|
6. [ ] Configure [GitHub repository settings].
|
|
20
20
|
7. [ ] Delete this checklist 😌.
|
|
21
21
|
|
|
22
|
-
[builds at seek]: https://builds-
|
|
22
|
+
[builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
|
|
23
23
|
[github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
24
24
|
|
|
25
25
|
## Design
|
|
26
26
|
|
|
27
|
-
<%-repoName %> is a Node.js HTTP server built in line with our [
|
|
27
|
+
<%-repoName %> is a Node.js HTTP server built in line with our [Technical Guidelines].
|
|
28
28
|
It uses the [Koa] middleware framework and common SEEK packages.
|
|
29
29
|
Resource APIs enable synchronous interactions and serve as the backbone of SEEK's general service architecture.
|
|
30
30
|
|
|
@@ -105,7 +105,7 @@ TODO: add support links for the prod environment.
|
|
|
105
105
|
- Splunk logs
|
|
106
106
|
-->
|
|
107
107
|
|
|
108
|
-
[
|
|
109
|
-
[
|
|
110
|
-
[
|
|
111
|
-
[
|
|
108
|
+
[CodeDeploy]: https://docs.aws.amazon.com/codedeploy
|
|
109
|
+
[Gantry]: https://backstage.myseek.xyz/docs/default/component/gantry/
|
|
110
|
+
[Koa]: https://koajs.com
|
|
111
|
+
[Technical Guidelines]: https://myseek.atlassian.net/wiki/spaces/AA/pages/2358346017/
|
|
@@ -14,10 +14,10 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@koa/router": "^12.0.0",
|
|
16
16
|
"@opentelemetry/api": "^1.1.0",
|
|
17
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
17
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.45.0",
|
|
18
18
|
"@opentelemetry/instrumentation-aws-sdk": "^0.36.0",
|
|
19
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
20
|
-
"@opentelemetry/sdk-node": "^0.
|
|
19
|
+
"@opentelemetry/instrumentation-http": "^0.45.0",
|
|
20
|
+
"@opentelemetry/sdk-node": "^0.45.0",
|
|
21
21
|
"@seek/logger": "^6.0.0",
|
|
22
22
|
"aws-sdk": "^2.1039.0",
|
|
23
23
|
"hot-shots": "^10.0.0",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"@types/koa": "^2.13.4",
|
|
35
35
|
"@types/koa-bodyparser": "^5.0.2",
|
|
36
36
|
"@types/koa__router": "^12.0.0",
|
|
37
|
-
"@types/node": "^
|
|
37
|
+
"@types/node": "^20.9.0",
|
|
38
38
|
"@types/supertest": "^2.0.11",
|
|
39
39
|
"chance": "^1.1.8",
|
|
40
40
|
"pino-pretty": "^10.0.0",
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
"supertest": "^6.1.6"
|
|
43
43
|
},
|
|
44
44
|
"engines": {
|
|
45
|
-
"node": ">=
|
|
45
|
+
"node": ">=20"
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -10,11 +10,15 @@ describe('app', () => {
|
|
|
10
10
|
|
|
11
11
|
it('has a happy health check', () => agent.get('/health').expect(200, ''));
|
|
12
12
|
|
|
13
|
-
it('has a reachable smoke test', () =>
|
|
14
|
-
agent.get('/smoke')
|
|
13
|
+
it('has a reachable smoke test', async () => {
|
|
14
|
+
const response = await agent.get('/smoke');
|
|
15
|
+
expect(response.status).not.toBe(404);
|
|
16
|
+
});
|
|
15
17
|
|
|
16
|
-
it('has a reachable nested route', () =>
|
|
17
|
-
agent.get('/jobs')
|
|
18
|
+
it('has a reachable nested route', async () => {
|
|
19
|
+
const response = await agent.get('/jobs');
|
|
20
|
+
expect(response.status).not.toBe(404);
|
|
21
|
+
});
|
|
18
22
|
|
|
19
23
|
it('has OPTIONS for a nested route', () =>
|
|
20
24
|
agent.options('/jobs').expect(200).expect('allow', /HEAD/));
|
|
@@ -13,11 +13,12 @@ configs:
|
|
|
13
13
|
cache-on:
|
|
14
14
|
- package.json
|
|
15
15
|
- yarn.lock
|
|
16
|
-
secrets: id=npm,src
|
|
16
|
+
secrets: id=npm,src=tmp/.npmrc
|
|
17
17
|
|
|
18
18
|
- &private-npm
|
|
19
19
|
seek-oss/private-npm#v1.2.0:
|
|
20
20
|
env: NPM_READ_TOKEN
|
|
21
|
+
output-path: tmp/
|
|
21
22
|
|
|
22
23
|
base-steps:
|
|
23
24
|
- &deploy
|
|
@@ -32,7 +33,7 @@ configs:
|
|
|
32
33
|
- *aws-sm
|
|
33
34
|
- *private-npm
|
|
34
35
|
- *docker-ecr-cache
|
|
35
|
-
- docker-compose#v4.
|
|
36
|
+
- docker-compose#v4.16.0:
|
|
36
37
|
dependencies: false
|
|
37
38
|
run: app
|
|
38
39
|
retry:
|
|
@@ -60,7 +61,7 @@ steps:
|
|
|
60
61
|
- *aws-sm
|
|
61
62
|
- *private-npm
|
|
62
63
|
- *docker-ecr-cache
|
|
63
|
-
- docker-compose#v4.
|
|
64
|
+
- docker-compose#v4.16.0:
|
|
64
65
|
run: app
|
|
65
66
|
timeout_in_minutes: 10
|
|
66
67
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
20
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
# syntax=docker/dockerfile:1.
|
|
1
|
+
# syntax=docker/dockerfile:1.6
|
|
2
2
|
|
|
3
|
-
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:20-alpine AS dev-deps
|
|
4
4
|
|
|
5
5
|
WORKDIR /workdir
|
|
6
6
|
|
|
7
7
|
COPY package.json yarn.lock ./
|
|
8
8
|
|
|
9
9
|
RUN \
|
|
10
|
-
--mount=type=secret,id=npm,dst=/
|
|
10
|
+
--mount=type=secret,id=npm,dst=/root/.npmrc \
|
|
11
11
|
yarn install --frozen-lockfile --ignore-optional --non-interactive && \
|
|
12
12
|
yarn cache clean
|
|
@@ -18,12 +18,12 @@ Next steps:
|
|
|
18
18
|
6. [ ] Configure [GitHub repository settings].
|
|
19
19
|
7. [ ] Delete this checklist 😌.
|
|
20
20
|
|
|
21
|
-
[builds at seek]: https://builds-
|
|
21
|
+
[builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
|
|
22
22
|
[github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
23
23
|
|
|
24
24
|
## Design
|
|
25
25
|
|
|
26
|
-
<%-repoName %> is a Node.js [Lambda] application built in line with our [
|
|
26
|
+
<%-repoName %> is a Node.js [Lambda] application built in line with our [Technical Guidelines].
|
|
27
27
|
It is backed by a typical SQS message + dead letter queue configuration and uses common SEEK packages.
|
|
28
28
|
Workers enable fault-tolerant asynchronous processing of events.
|
|
29
29
|
|
|
@@ -126,7 +126,7 @@ TODO: add support links for the prod environment.
|
|
|
126
126
|
- Splunk logs
|
|
127
127
|
-->
|
|
128
128
|
|
|
129
|
-
[
|
|
130
|
-
[
|
|
131
|
-
[
|
|
132
|
-
[
|
|
129
|
+
[CodeDeploy]: https://docs.aws.amazon.com/codedeploy
|
|
130
|
+
[Lambda]: https://docs.aws.amazon.com/lambda
|
|
131
|
+
[Serverless]: https://www.serverless.com/
|
|
132
|
+
[Technical Guidelines]: https://myseek.atlassian.net/wiki/spaces/AA/pages/2358346017/
|
|
@@ -27,18 +27,18 @@
|
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/aws-lambda": "^8.10.84",
|
|
29
29
|
"@types/chance": "^1.1.3",
|
|
30
|
-
"@types/node": "^
|
|
30
|
+
"@types/node": "^20.9.0",
|
|
31
31
|
"aws-sdk-client-mock": "^3.0.0",
|
|
32
32
|
"aws-sdk-client-mock-jest": "^3.0.0",
|
|
33
33
|
"chance": "^1.1.8",
|
|
34
34
|
"pino-pretty": "^10.0.0",
|
|
35
|
-
"serverless": "^3.
|
|
35
|
+
"serverless": "^3.37.0",
|
|
36
36
|
"serverless-plugin-canary-deployments": "^0.8.0",
|
|
37
37
|
"serverless-plugin-datadog": "^5.12.0",
|
|
38
38
|
"serverless-prune-plugin": "^2.0.0",
|
|
39
39
|
"skuba": "*"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
|
-
"node": ">=
|
|
42
|
+
"node": ">=20"
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -13,11 +13,12 @@ configs:
|
|
|
13
13
|
cache-on:
|
|
14
14
|
- package.json
|
|
15
15
|
- yarn.lock
|
|
16
|
-
secrets: id=npm,src
|
|
16
|
+
secrets: id=npm,src=tmp/.npmrc
|
|
17
17
|
|
|
18
18
|
- &private-npm
|
|
19
19
|
seek-oss/private-npm#v1.2.0:
|
|
20
20
|
env: NPM_READ_TOKEN
|
|
21
|
+
output-path: tmp/
|
|
21
22
|
|
|
22
23
|
base-steps:
|
|
23
24
|
- &deploy
|
|
@@ -32,7 +33,7 @@ configs:
|
|
|
32
33
|
- *aws-sm
|
|
33
34
|
- *private-npm
|
|
34
35
|
- *docker-ecr-cache
|
|
35
|
-
- docker-compose#v4.
|
|
36
|
+
- docker-compose#v4.16.0:
|
|
36
37
|
dependencies: false
|
|
37
38
|
run: app
|
|
38
39
|
retry:
|
|
@@ -57,7 +58,7 @@ steps:
|
|
|
57
58
|
- *aws-sm
|
|
58
59
|
- *private-npm
|
|
59
60
|
- *docker-ecr-cache
|
|
60
|
-
- docker-compose#v4.
|
|
61
|
+
- docker-compose#v4.16.0:
|
|
61
62
|
run: app
|
|
62
63
|
timeout_in_minutes: 10
|
|
63
64
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
# syntax=docker/dockerfile:1.
|
|
1
|
+
# syntax=docker/dockerfile:1.6
|
|
2
2
|
|
|
3
|
-
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:
|
|
3
|
+
FROM --platform=${BUILDPLATFORM:-<%- platformName %>} node:20-alpine AS dev-deps
|
|
4
4
|
|
|
5
5
|
WORKDIR /workdir
|
|
6
6
|
|
|
7
7
|
COPY package.json yarn.lock ./
|
|
8
8
|
|
|
9
9
|
RUN \
|
|
10
|
-
--mount=type=secret,id=npm,dst=/
|
|
10
|
+
--mount=type=secret,id=npm,dst=/root/.npmrc \
|
|
11
11
|
yarn install --frozen-lockfile --ignore-optional --non-interactive && \
|
|
12
12
|
yarn package && \
|
|
13
13
|
yarn cache clean
|
|
@@ -176,7 +176,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
176
176
|
"Arn",
|
|
177
177
|
],
|
|
178
178
|
},
|
|
179
|
-
"Runtime": "
|
|
179
|
+
"Runtime": "nodejs20.x",
|
|
180
180
|
},
|
|
181
181
|
"Type": "AWS::Lambda::Function",
|
|
182
182
|
},
|
|
@@ -537,7 +537,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
537
537
|
"Arn",
|
|
538
538
|
],
|
|
539
539
|
},
|
|
540
|
-
"Runtime": "
|
|
540
|
+
"Runtime": "nodejs20.x",
|
|
541
541
|
},
|
|
542
542
|
"Type": "AWS::Lambda::Function",
|
|
543
543
|
},
|
|
@@ -55,7 +55,7 @@ export class AppStack extends Stack {
|
|
|
55
55
|
const worker = new aws_lambda.Function(this, 'worker', {
|
|
56
56
|
architecture: aws_lambda.Architecture[architecture],
|
|
57
57
|
code: new aws_lambda.AssetCode('./lib'),
|
|
58
|
-
runtime: aws_lambda.Runtime.
|
|
58
|
+
runtime: aws_lambda.Runtime.NODEJS_20_X,
|
|
59
59
|
handler: 'app.handler',
|
|
60
60
|
functionName: '<%- serviceName %>',
|
|
61
61
|
environmentEncryption: kmsKey,
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@aws-cdk/assert": "^2.24.0",
|
|
20
20
|
"@types/aws-lambda": "^8.10.82",
|
|
21
|
-
"@types/node": "^
|
|
22
|
-
"aws-cdk": "^2.
|
|
23
|
-
"aws-cdk-lib": "^2.
|
|
21
|
+
"@types/node": "^20.9.0",
|
|
22
|
+
"aws-cdk": "^2.109.0",
|
|
23
|
+
"aws-cdk-lib": "^2.109.0",
|
|
24
24
|
"constructs": "^10.0.17",
|
|
25
25
|
"skuba": "*"
|
|
26
26
|
},
|
|
27
27
|
"engines": {
|
|
28
|
-
"node": ">=
|
|
28
|
+
"node": ">=20"
|
|
29
29
|
}
|
|
30
30
|
}
|