skuba 8.1.0-test-20240430085832 → 8.2.0
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/lib/api/git/index.d.ts +1 -0
- package/lib/api/git/index.js +3 -0
- package/lib/api/git/index.js.map +2 -2
- package/lib/api/git/isFileGitIgnored.d.ts +4 -0
- package/lib/api/git/isFileGitIgnored.js +49 -0
- package/lib/api/git/isFileGitIgnored.js.map +7 -0
- package/lib/api/git/pull.js.map +2 -2
- package/lib/api/git/push.d.ts +10 -1
- package/lib/api/git/push.js.map +2 -2
- package/lib/api/github/checkRun.js +2 -2
- package/lib/api/github/checkRun.js.map +2 -2
- package/lib/api/github/environment.d.ts +0 -1
- package/lib/api/github/issueComment.js +2 -2
- package/lib/api/github/issueComment.js.map +2 -2
- package/lib/api/github/octokit.d.ts +4 -0
- package/lib/api/github/octokit.js +3 -0
- package/lib/api/github/octokit.js.map +2 -2
- package/lib/api/github/pullRequest.d.ts +1 -1
- package/lib/api/github/pullRequest.js +2 -2
- package/lib/api/github/pullRequest.js.map +2 -2
- package/lib/api/github/push.d.ts +7 -1
- package/lib/api/github/push.js.map +2 -2
- package/lib/api/jest/index.d.ts +1 -1
- package/lib/cli/adapter/eslint.d.ts +1 -1
- package/lib/cli/adapter/prettier.d.ts +2 -2
- package/lib/cli/configure/ensureTemplateCompletion.js +18 -2
- package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
- package/lib/cli/configure/index.js +6 -3
- package/lib/cli/configure/index.js.map +2 -2
- package/lib/cli/configure/processing/configFile.d.ts +1 -1
- package/lib/cli/configure/processing/package.d.ts +56 -58
- package/lib/cli/init/getConfig.d.ts +2 -1
- package/lib/cli/init/getConfig.js +7 -1
- package/lib/cli/init/getConfig.js.map +2 -2
- package/lib/cli/init/index.js +15 -1
- package/lib/cli/init/index.js.map +2 -2
- package/lib/cli/init/prompts.d.ts +0 -1
- package/lib/cli/init/types.d.ts +22 -5
- package/lib/cli/lint/external.d.ts +0 -2
- package/lib/cli/lint/index.d.ts +0 -1
- package/lib/cli/lint/internal.d.ts +1 -1
- package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +1 -1
- package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +1 -1
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +4 -1
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +2 -2
- package/lib/cli/lint/internalLints/refreshConfigFiles.js +14 -3
- package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +10 -2
- package/lib/cli/lint/internalLints/upgrade/index.js +15 -5
- package/lib/cli/lint/internalLints/upgrade/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.d.ts +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +4 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +4 -1
- package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +35 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +147 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +7 -0
- package/lib/cli/lint/types.d.ts +0 -1
- package/lib/utils/args.d.ts +0 -1
- package/lib/utils/copy.d.ts +1 -1
- package/lib/utils/env.d.ts +0 -1
- package/lib/utils/error.d.ts +0 -1
- package/lib/utils/exec.d.ts +0 -1
- package/lib/utils/template.d.ts +3 -3
- package/lib/wrapper/http.d.ts +0 -1
- package/package.json +22 -21
- package/template/base/.vscode/extensions.json +3 -0
- package/template/base/_.gitignore +2 -0
- package/template/base/_.npmrc +1 -0
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -0
- package/template/express-rest-api/.gantry/dev.yml +0 -2
- package/template/express-rest-api/.gantry/prod.yml +0 -2
- package/template/express-rest-api/Dockerfile.dev-deps +1 -1
- package/template/express-rest-api/README.md +3 -3
- package/template/express-rest-api/docker-compose.yml +0 -2
- package/template/express-rest-api/gantry.apply.yml +0 -7
- package/template/express-rest-api/package.json +5 -2
- package/template/express-rest-api/src/config.ts +14 -6
- package/template/express-rest-api/src/framework/logging.ts +1 -1
- package/template/express-rest-api/src/framework/metrics.ts +11 -0
- package/template/express-rest-api/src/listen.ts +2 -2
- package/template/greeter/.buildkite/pipeline.yml +1 -0
- package/template/greeter/Dockerfile +1 -1
- package/template/greeter/README.md +3 -3
- package/template/greeter/docker-compose.yml +0 -2
- package/template/greeter/package.json +2 -1
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -0
- package/template/koa-rest-api/.gantry/dev.yml +0 -2
- package/template/koa-rest-api/.gantry/prod.yml +0 -2
- package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
- package/template/koa-rest-api/README.md +3 -3
- package/template/koa-rest-api/docker-compose.yml +0 -2
- package/template/koa-rest-api/gantry.apply.yml +0 -7
- package/template/koa-rest-api/package.json +12 -12
- package/template/koa-rest-api/src/api/jobs/index.ts +1 -1
- package/template/koa-rest-api/src/app.test.ts +5 -10
- package/template/koa-rest-api/src/config.ts +14 -4
- package/template/koa-rest-api/src/framework/validation.test.ts +1 -1
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +1 -0
- package/template/lambda-sqs-worker/Dockerfile +1 -1
- package/template/lambda-sqs-worker/README.md +3 -3
- package/template/lambda-sqs-worker/_.npmrc +1 -0
- package/template/lambda-sqs-worker/docker-compose.yml +0 -2
- package/template/lambda-sqs-worker/package.json +3 -2
- package/template/lambda-sqs-worker/src/config.ts +9 -4
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +1 -0
- package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
- package/template/lambda-sqs-worker-cdk/docker-compose.yml +0 -2
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +42 -0
- package/template/lambda-sqs-worker-cdk/infra/config.ts +14 -6
- package/template/lambda-sqs-worker-cdk/package.json +4 -1
- package/template/lambda-sqs-worker-cdk/src/app.ts +14 -2
- package/template/lambda-sqs-worker-cdk/src/config.ts +47 -0
- package/template/oss-npm-package/.github/workflows/validate.yml +1 -0
- package/template/oss-npm-package/README.md +3 -3
- package/template/private-npm-package/.buildkite/pipeline.yml +1 -0
- package/template/private-npm-package/README.md +1 -1
- /package/template/koa-rest-api/src/framework/{middleware.ts → bodyParser.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.2.0",
|
|
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",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@jest/types": "^29.0.0",
|
|
55
55
|
"@octokit/graphql": "^8.0.0",
|
|
56
56
|
"@octokit/graphql-schema": "^15.3.0",
|
|
57
|
-
"@octokit/rest": "^
|
|
57
|
+
"@octokit/rest": "^21.0.0",
|
|
58
58
|
"@octokit/types": "^13.0.0",
|
|
59
59
|
"@types/jest": "^29.0.0",
|
|
60
60
|
"@types/node": ">=18.12",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"dotenv": "^16.0.0",
|
|
64
64
|
"ejs": "^3.1.6",
|
|
65
65
|
"enquirer": "^2.3.6",
|
|
66
|
-
"esbuild": "~0.
|
|
66
|
+
"esbuild": "~0.21.0",
|
|
67
67
|
"eslint": "^8.56.0",
|
|
68
68
|
"execa": "^5.0.0",
|
|
69
69
|
"fast-glob": "^3.3.2",
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"npm-run-path": "^4.0.1",
|
|
85
85
|
"npm-which": "^3.0.1",
|
|
86
86
|
"picomatch": "^4.0.0",
|
|
87
|
-
"prettier": "~3.
|
|
87
|
+
"prettier": "~3.3.0",
|
|
88
88
|
"prettier-plugin-packagejson": "^2.4.10",
|
|
89
89
|
"read-pkg-up": "^7.0.1",
|
|
90
90
|
"semantic-release": "^22.0.12",
|
|
@@ -97,42 +97,43 @@
|
|
|
97
97
|
"ts-node-dev": "^2.0.0",
|
|
98
98
|
"tsconfig-paths": "^4.0.0",
|
|
99
99
|
"tsconfig-seek": "2.0.0",
|
|
100
|
-
"typescript": "~5.
|
|
100
|
+
"typescript": "~5.5.0",
|
|
101
101
|
"validate-npm-package-name": "^5.0.0",
|
|
102
102
|
"zod": "^3.22.4",
|
|
103
|
-
"eslint-config-skuba": "4.
|
|
103
|
+
"eslint-config-skuba": "4.1.0"
|
|
104
104
|
},
|
|
105
105
|
"devDependencies": {
|
|
106
|
-
"@changesets/cli": "2.27.
|
|
106
|
+
"@changesets/cli": "2.27.6",
|
|
107
107
|
"@changesets/get-github-info": "0.6.0",
|
|
108
108
|
"@jest/reporters": "29.7.0",
|
|
109
109
|
"@jest/test-result": "29.7.0",
|
|
110
110
|
"@types/ejs": "3.1.5",
|
|
111
111
|
"@types/express": "4.17.21",
|
|
112
112
|
"@types/fs-extra": "11.0.4",
|
|
113
|
-
"@types/koa": "2.
|
|
113
|
+
"@types/koa": "2.15.0",
|
|
114
114
|
"@types/libnpmsearch": "2.0.7",
|
|
115
115
|
"@types/lodash.mergewith": "4.6.9",
|
|
116
|
+
"@types/minimist": "1.2.5",
|
|
116
117
|
"@types/module-alias": "2.0.4",
|
|
117
118
|
"@types/npm-which": "3.0.3",
|
|
118
119
|
"@types/picomatch": "2.3.3",
|
|
119
120
|
"@types/supertest": "6.0.2",
|
|
120
121
|
"@types/validate-npm-package-name": "4.0.2",
|
|
121
|
-
"enhanced-resolve": "5.
|
|
122
|
+
"enhanced-resolve": "5.17.0",
|
|
122
123
|
"express": "4.19.2",
|
|
123
|
-
"fastify": "4.
|
|
124
|
+
"fastify": "4.28.0",
|
|
124
125
|
"jest-diff": "29.7.0",
|
|
125
126
|
"jsonfile": "6.1.0",
|
|
126
|
-
"koa": "2.15.
|
|
127
|
-
"memfs": "4.
|
|
128
|
-
"remark-cli": "12.0.
|
|
129
|
-
"remark-preset-lint-recommended": "
|
|
130
|
-
"semver": "7.6.
|
|
131
|
-
"supertest": "
|
|
127
|
+
"koa": "2.15.3",
|
|
128
|
+
"memfs": "4.9.3",
|
|
129
|
+
"remark-cli": "12.0.1",
|
|
130
|
+
"remark-preset-lint-recommended": "7.0.0",
|
|
131
|
+
"semver": "7.6.2",
|
|
132
|
+
"supertest": "7.0.0",
|
|
132
133
|
"type-fest": "2.19.0"
|
|
133
134
|
},
|
|
134
135
|
"peerDependencies": {
|
|
135
|
-
"skuba-dive": "2
|
|
136
|
+
"skuba-dive": "1 || 2"
|
|
136
137
|
},
|
|
137
138
|
"peerDependenciesMeta": {
|
|
138
139
|
"skuba-dive": {
|
|
@@ -150,7 +151,7 @@
|
|
|
150
151
|
"entryPoint": "src/index.ts",
|
|
151
152
|
"template": null,
|
|
152
153
|
"type": "package",
|
|
153
|
-
"version": "
|
|
154
|
+
"version": "8.1.0"
|
|
154
155
|
},
|
|
155
156
|
"scripts": {
|
|
156
157
|
"build": "scripts/build.sh",
|
|
@@ -161,11 +162,11 @@
|
|
|
161
162
|
"lint:md": "remark --frail --quiet .",
|
|
162
163
|
"release": "pnpm --silent build && changeset publish",
|
|
163
164
|
"skuba": "pnpm --silent build && pnpm --silent skuba:exec",
|
|
164
|
-
"skuba:exec": "node --
|
|
165
|
+
"skuba:exec": "node --experimental-vm-modules lib/skuba",
|
|
165
166
|
"stage": "changeset version && node ./.changeset/inject.js && pnpm format",
|
|
166
|
-
"test": "pnpm --silent skuba test --selectProjects unit",
|
|
167
|
+
"test": "pnpm --silent skuba test --selectProjects unit --",
|
|
167
168
|
"test:ci": "pnpm --silent skuba test --runInBand",
|
|
168
|
-
"test:int": "pnpm --silent skuba test --
|
|
169
|
+
"test:int": "pnpm --silent skuba test --selectProjects integration --runInBand",
|
|
169
170
|
"test:template": "scripts/test-template.sh",
|
|
170
171
|
"test:watch": "pnpm --silent skuba test --runInBand --watch"
|
|
171
172
|
}
|
package/template/base/_.npmrc
CHANGED
|
@@ -12,15 +12,15 @@ Next steps:
|
|
|
12
12
|
|
|
13
13
|
2. [ ] Create a new repository in the appropriate GitHub organisation.
|
|
14
14
|
3. [ ] Add the repository to BuildAgency;
|
|
15
|
-
see [
|
|
15
|
+
see our internal [Buildkite Docs] for more information.
|
|
16
16
|
4. [ ] Add Datadog configuration and data classification tags to [.gantry/common.yml](.gantry/common.yml);
|
|
17
17
|
see the [Gantry] documentation for more information.
|
|
18
18
|
5. [ ] Push local commits to the upstream GitHub branch.
|
|
19
19
|
6. [ ] Configure [GitHub repository settings].
|
|
20
20
|
7. [ ] Delete this checklist 😌.
|
|
21
21
|
|
|
22
|
-
[
|
|
23
|
-
[
|
|
22
|
+
[Buildkite Docs]: https://backstage.myseek.xyz/docs/default/component/buildkite-docs
|
|
23
|
+
[GitHub repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
24
24
|
|
|
25
25
|
## Design
|
|
26
26
|
|
|
@@ -9,16 +9,9 @@ owner: '{{values "owner"}}'
|
|
|
9
9
|
image: '{{values "image"}}'
|
|
10
10
|
|
|
11
11
|
env:
|
|
12
|
-
# https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
|
|
13
|
-
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'
|
|
14
|
-
|
|
15
12
|
ENVIRONMENT: '{{values "environment"}}'
|
|
16
13
|
SERVICE: '{{values "service"}}'
|
|
17
14
|
|
|
18
|
-
{{range $key, $value := .Values.env}}
|
|
19
|
-
{{$key}}: {{$value}}
|
|
20
|
-
{{end}}
|
|
21
|
-
|
|
22
15
|
{{if .Values.cloudwatchDashboardDisabled}}
|
|
23
16
|
cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
|
|
24
17
|
{{end}}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@seek/<%- serviceName %>",
|
|
2
3
|
"private": true,
|
|
3
4
|
"license": "UNLICENSED",
|
|
4
5
|
"scripts": {
|
|
@@ -14,6 +15,8 @@
|
|
|
14
15
|
"dependencies": {
|
|
15
16
|
"@seek/logger": "^6.0.0",
|
|
16
17
|
"express": "^4.17.1",
|
|
18
|
+
"hot-shots": "^10.0.0",
|
|
19
|
+
"seek-datadog-custom-metrics": "^4.6.3",
|
|
17
20
|
"skuba-dive": "^2.0.0"
|
|
18
21
|
},
|
|
19
22
|
"devDependencies": {
|
|
@@ -23,9 +26,9 @@
|
|
|
23
26
|
"mime": "^4.0.1",
|
|
24
27
|
"pino-pretty": "^11.0.0",
|
|
25
28
|
"skuba": "*",
|
|
26
|
-
"supertest": "^
|
|
29
|
+
"supertest": "^7.0.0"
|
|
27
30
|
},
|
|
28
|
-
"packageManager": "pnpm@9.0
|
|
31
|
+
"packageManager": "pnpm@9.4.0",
|
|
29
32
|
"engines": {
|
|
30
33
|
"node": ">=20"
|
|
31
34
|
}
|
|
@@ -7,8 +7,8 @@ interface Config {
|
|
|
7
7
|
name: string;
|
|
8
8
|
version: string;
|
|
9
9
|
|
|
10
|
-
metricsServer
|
|
11
|
-
port
|
|
10
|
+
metricsServer: string | null;
|
|
11
|
+
port: number | null;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
type Environment = (typeof environments)[number];
|
|
@@ -26,19 +26,27 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
|
|
|
26
26
|
logLevel: 'debug',
|
|
27
27
|
name: '<%- serviceName %>',
|
|
28
28
|
version: 'local',
|
|
29
|
+
|
|
30
|
+
metricsServer: null,
|
|
31
|
+
port: null,
|
|
29
32
|
}),
|
|
30
33
|
|
|
31
34
|
test: () => ({
|
|
32
|
-
...configs.local(),
|
|
33
|
-
|
|
34
35
|
logLevel: Env.string('LOG_LEVEL', { default: 'silent' }),
|
|
36
|
+
name: '<%- serviceName %>',
|
|
35
37
|
version: 'test',
|
|
38
|
+
|
|
39
|
+
metricsServer: null,
|
|
40
|
+
port: null,
|
|
36
41
|
}),
|
|
37
42
|
|
|
38
43
|
[dev]: () => ({
|
|
39
|
-
...configs[prod](),
|
|
40
|
-
|
|
41
44
|
logLevel: 'debug',
|
|
45
|
+
name: Env.string('SERVICE'),
|
|
46
|
+
version: Env.string('VERSION'),
|
|
47
|
+
|
|
48
|
+
metricsServer: 'localhost',
|
|
49
|
+
port: Env.nonNegativeInteger('PORT'),
|
|
42
50
|
}),
|
|
43
51
|
|
|
44
52
|
[prod]: () => ({
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { StatsD } from 'hot-shots';
|
|
2
|
+
import { createStatsDClient } from 'seek-datadog-custom-metrics';
|
|
3
|
+
|
|
4
|
+
import { config } from 'src/config';
|
|
5
|
+
|
|
6
|
+
import { logger } from './logging';
|
|
7
|
+
|
|
8
|
+
/* istanbul ignore next: StatsD client is not our responsibility */
|
|
9
|
+
export const metricsClient = createStatsDClient(StatsD, config, (err) =>
|
|
10
|
+
logger.error({ err }, 'StatsD error'),
|
|
11
|
+
);
|
|
@@ -2,7 +2,7 @@ import './register';
|
|
|
2
2
|
|
|
3
3
|
import app from './app';
|
|
4
4
|
import { config } from './config';
|
|
5
|
-
import {
|
|
5
|
+
import { logger } from './framework/logging';
|
|
6
6
|
|
|
7
7
|
// If your application is deployed with more than 1 vCPU you can delete this
|
|
8
8
|
// file and use a clustering utility to run `lib/app`.
|
|
@@ -11,7 +11,7 @@ const listener = app.listen(config.port, () => {
|
|
|
11
11
|
const address = listener.address();
|
|
12
12
|
|
|
13
13
|
if (typeof address === 'object' && address) {
|
|
14
|
-
|
|
14
|
+
logger.debug(`listening on port ${address.port}`);
|
|
15
15
|
}
|
|
16
16
|
});
|
|
17
17
|
|
|
@@ -12,13 +12,13 @@ Next steps:
|
|
|
12
12
|
|
|
13
13
|
2. [ ] Create a new repository in the appropriate GitHub organisation.
|
|
14
14
|
3. [ ] Add the repository to BuildAgency;
|
|
15
|
-
see [
|
|
15
|
+
see our internal [Buildkite Docs] for more information.
|
|
16
16
|
4. [ ] Push local commits to the upstream GitHub branch.
|
|
17
17
|
5. [ ] Configure [GitHub repository settings].
|
|
18
18
|
6. [ ] Delete this checklist 😌.
|
|
19
19
|
|
|
20
|
-
[
|
|
21
|
-
[
|
|
20
|
+
[Buildkite Docs]: https://backstage.myseek.xyz/docs/default/component/buildkite-docs
|
|
21
|
+
[GitHub repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
22
22
|
|
|
23
23
|
## Design
|
|
24
24
|
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@seek/greeter",
|
|
2
3
|
"private": true,
|
|
3
4
|
"license": "UNLICENSED",
|
|
4
5
|
"scripts": {
|
|
@@ -18,7 +19,7 @@
|
|
|
18
19
|
"@types/node": "^20.9.0",
|
|
19
20
|
"skuba": "*"
|
|
20
21
|
},
|
|
21
|
-
"packageManager": "pnpm@9.0
|
|
22
|
+
"packageManager": "pnpm@9.4.0",
|
|
22
23
|
"engines": {
|
|
23
24
|
"node": ">=20"
|
|
24
25
|
}
|
|
@@ -12,15 +12,15 @@ Next steps:
|
|
|
12
12
|
|
|
13
13
|
2. [ ] Create a new repository in the appropriate GitHub organisation.
|
|
14
14
|
3. [ ] Add the repository to BuildAgency;
|
|
15
|
-
see [
|
|
15
|
+
see our internal [Buildkite Docs] for more information.
|
|
16
16
|
4. [ ] Add Datadog configuration and data classification tags to [.gantry/common.yml](.gantry/common.yml);
|
|
17
17
|
see the [Gantry] documentation for more information.
|
|
18
18
|
5. [ ] Push local commits to the upstream GitHub branch.
|
|
19
19
|
6. [ ] Configure [GitHub repository settings].
|
|
20
20
|
7. [ ] Delete this checklist 😌.
|
|
21
21
|
|
|
22
|
-
[
|
|
23
|
-
[
|
|
22
|
+
[Buildkite Docs]: https://backstage.myseek.xyz/docs/default/component/buildkite-docs
|
|
23
|
+
[GitHub repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
24
24
|
|
|
25
25
|
## Design
|
|
26
26
|
|
|
@@ -9,17 +9,10 @@ owner: '{{values "owner"}}'
|
|
|
9
9
|
image: '{{values "image"}}'
|
|
10
10
|
|
|
11
11
|
env:
|
|
12
|
-
# https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/node-reusing-connections.html
|
|
13
|
-
AWS_NODEJS_CONNECTION_REUSE_ENABLED: '1'
|
|
14
|
-
|
|
15
12
|
ENVIRONMENT: '{{values "environment"}}'
|
|
16
13
|
OPENTELEMETRY_ENABLED: '{{.Values.openTelemetry.enabled | default false}}'
|
|
17
14
|
SERVICE: '{{values "service"}}'
|
|
18
15
|
|
|
19
|
-
{{range $key, $value := .Values.env}}
|
|
20
|
-
{{$key}}: {{$value}}
|
|
21
|
-
{{end}}
|
|
22
|
-
|
|
23
16
|
{{if .Values.cloudwatchDashboardDisabled}}
|
|
24
17
|
cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
|
|
25
18
|
{{end}}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
+
"name": "@seek/<%- serviceName %>",
|
|
2
3
|
"private": true,
|
|
3
4
|
"license": "UNLICENSED",
|
|
4
5
|
"scripts": {
|
|
@@ -13,20 +14,19 @@
|
|
|
13
14
|
},
|
|
14
15
|
"dependencies": {
|
|
15
16
|
"@koa/router": "^12.0.0",
|
|
16
|
-
"@opentelemetry/api": "^1.
|
|
17
|
-
"@opentelemetry/core": "^1.
|
|
18
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
19
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
20
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
21
|
-
"@opentelemetry/propagator-b3": "^1.
|
|
22
|
-
"@opentelemetry/sdk-node": "^0.
|
|
17
|
+
"@opentelemetry/api": "^1.9.0",
|
|
18
|
+
"@opentelemetry/core": "^1.25.0",
|
|
19
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.52.0",
|
|
20
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.42.0",
|
|
21
|
+
"@opentelemetry/instrumentation-http": "^0.52.0",
|
|
22
|
+
"@opentelemetry/propagator-b3": "^1.25.0",
|
|
23
|
+
"@opentelemetry/sdk-node": "^0.52.0",
|
|
23
24
|
"@seek/logger": "^6.0.0",
|
|
24
|
-
"aws-sdk": "^2.1039.0",
|
|
25
25
|
"hot-shots": "^10.0.0",
|
|
26
26
|
"koa": "^2.13.4",
|
|
27
27
|
"koa-bodyparser": "^4.3.0",
|
|
28
|
-
"koa-compose": "^4.
|
|
29
|
-
"seek-datadog-custom-metrics": "^4.
|
|
28
|
+
"koa-compose": "^4.1.0",
|
|
29
|
+
"seek-datadog-custom-metrics": "^4.6.3",
|
|
30
30
|
"seek-koala": "^7.0.0",
|
|
31
31
|
"skuba-dive": "^2.0.0",
|
|
32
32
|
"zod": "^3.19.1"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"mime": "^4.0.1",
|
|
43
43
|
"pino-pretty": "^11.0.0",
|
|
44
44
|
"skuba": "*",
|
|
45
|
-
"supertest": "^
|
|
45
|
+
"supertest": "^7.0.0"
|
|
46
46
|
},
|
|
47
|
-
"packageManager": "pnpm@9.0
|
|
47
|
+
"packageManager": "pnpm@9.4.0",
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=20"
|
|
50
50
|
}
|
|
@@ -10,16 +10,11 @@ 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
|
-
|
|
15
|
-
expect(response.status).not.toBe(404);
|
|
16
|
-
});
|
|
13
|
+
it('has a reachable smoke test', () =>
|
|
14
|
+
agent.options('/smoke').expect(200, '').expect('Allow', 'HEAD, GET'));
|
|
17
15
|
|
|
18
|
-
it('has a reachable nested route',
|
|
19
|
-
|
|
20
|
-
expect(response.status).not.toBe(404);
|
|
21
|
-
});
|
|
16
|
+
it('has a reachable nested route', () =>
|
|
17
|
+
agent.options('/jobs').expect(200, '').expect('Allow', /POST/));
|
|
22
18
|
|
|
23
|
-
it('
|
|
24
|
-
agent.options('/jobs').expect(200).expect('allow', /HEAD/));
|
|
19
|
+
it('handles an unknown route', () => agent.options('/admin.php').expect(404));
|
|
25
20
|
});
|
|
@@ -7,8 +7,8 @@ interface Config {
|
|
|
7
7
|
name: string;
|
|
8
8
|
version: string;
|
|
9
9
|
|
|
10
|
-
metricsServer
|
|
11
|
-
port
|
|
10
|
+
metricsServer: string | null;
|
|
11
|
+
port: number | null;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
type Environment = (typeof environments)[number];
|
|
@@ -26,19 +26,29 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
|
|
|
26
26
|
logLevel: 'debug',
|
|
27
27
|
name: '<%- serviceName %>',
|
|
28
28
|
version: 'local',
|
|
29
|
+
|
|
30
|
+
metricsServer: null,
|
|
31
|
+
port: null,
|
|
29
32
|
}),
|
|
30
33
|
|
|
31
34
|
test: () => ({
|
|
32
|
-
...configs.local(),
|
|
33
|
-
|
|
34
35
|
logLevel: Env.string('LOG_LEVEL', { default: 'silent' }),
|
|
36
|
+
name: '<%- serviceName %>',
|
|
35
37
|
version: 'test',
|
|
38
|
+
|
|
39
|
+
metricsServer: null,
|
|
40
|
+
port: null,
|
|
36
41
|
}),
|
|
37
42
|
|
|
38
43
|
[dev]: () => ({
|
|
39
44
|
...configs[prod](),
|
|
40
45
|
|
|
41
46
|
logLevel: 'debug',
|
|
47
|
+
name: Env.string('SERVICE'),
|
|
48
|
+
version: Env.string('VERSION'),
|
|
49
|
+
|
|
50
|
+
metricsServer: 'localhost',
|
|
51
|
+
port: Env.nonNegativeInteger('PORT'),
|
|
42
52
|
}),
|
|
43
53
|
|
|
44
54
|
[prod]: () => ({
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
mockIdDescription,
|
|
6
6
|
} from 'src/testing/types';
|
|
7
7
|
|
|
8
|
-
import { jsonBodyParser } from './
|
|
8
|
+
import { jsonBodyParser } from './bodyParser';
|
|
9
9
|
import { validate } from './validation';
|
|
10
10
|
|
|
11
11
|
const agent = agentFromMiddleware(jsonBodyParser, (ctx) => {
|
|
@@ -12,14 +12,14 @@ Next steps:
|
|
|
12
12
|
|
|
13
13
|
2. [ ] Create a new repository in the appropriate GitHub organisation.
|
|
14
14
|
3. [ ] Add the repository to BuildAgency;
|
|
15
|
-
see [
|
|
15
|
+
see our internal [Buildkite Docs] for more information.
|
|
16
16
|
4. [ ] Add Datadog extension, deployment bucket configuration and data classification tags to [serverless.yml](serverless.yml).
|
|
17
17
|
5. [ ] Push local commits to the upstream GitHub branch.
|
|
18
18
|
6. [ ] Configure [GitHub repository settings].
|
|
19
19
|
7. [ ] Delete this checklist 😌.
|
|
20
20
|
|
|
21
|
-
[
|
|
22
|
-
[
|
|
21
|
+
[Buildkite Docs]: https://backstage.myseek.xyz/docs/default/component/buildkite-docs
|
|
22
|
+
[GitHub repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
|
|
23
23
|
|
|
24
24
|
## Design
|
|
25
25
|
|