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.
Files changed (127) hide show
  1. package/lib/api/git/index.d.ts +1 -0
  2. package/lib/api/git/index.js +3 -0
  3. package/lib/api/git/index.js.map +2 -2
  4. package/lib/api/git/isFileGitIgnored.d.ts +4 -0
  5. package/lib/api/git/isFileGitIgnored.js +49 -0
  6. package/lib/api/git/isFileGitIgnored.js.map +7 -0
  7. package/lib/api/git/pull.js.map +2 -2
  8. package/lib/api/git/push.d.ts +10 -1
  9. package/lib/api/git/push.js.map +2 -2
  10. package/lib/api/github/checkRun.js +2 -2
  11. package/lib/api/github/checkRun.js.map +2 -2
  12. package/lib/api/github/environment.d.ts +0 -1
  13. package/lib/api/github/issueComment.js +2 -2
  14. package/lib/api/github/issueComment.js.map +2 -2
  15. package/lib/api/github/octokit.d.ts +4 -0
  16. package/lib/api/github/octokit.js +3 -0
  17. package/lib/api/github/octokit.js.map +2 -2
  18. package/lib/api/github/pullRequest.d.ts +1 -1
  19. package/lib/api/github/pullRequest.js +2 -2
  20. package/lib/api/github/pullRequest.js.map +2 -2
  21. package/lib/api/github/push.d.ts +7 -1
  22. package/lib/api/github/push.js.map +2 -2
  23. package/lib/api/jest/index.d.ts +1 -1
  24. package/lib/cli/adapter/eslint.d.ts +1 -1
  25. package/lib/cli/adapter/prettier.d.ts +2 -2
  26. package/lib/cli/configure/ensureTemplateCompletion.js +18 -2
  27. package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
  28. package/lib/cli/configure/index.js +6 -3
  29. package/lib/cli/configure/index.js.map +2 -2
  30. package/lib/cli/configure/processing/configFile.d.ts +1 -1
  31. package/lib/cli/configure/processing/package.d.ts +56 -58
  32. package/lib/cli/init/getConfig.d.ts +2 -1
  33. package/lib/cli/init/getConfig.js +7 -1
  34. package/lib/cli/init/getConfig.js.map +2 -2
  35. package/lib/cli/init/index.js +15 -1
  36. package/lib/cli/init/index.js.map +2 -2
  37. package/lib/cli/init/prompts.d.ts +0 -1
  38. package/lib/cli/init/types.d.ts +22 -5
  39. package/lib/cli/lint/external.d.ts +0 -2
  40. package/lib/cli/lint/index.d.ts +0 -1
  41. package/lib/cli/lint/internal.d.ts +1 -1
  42. package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +1 -1
  43. package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +1 -1
  44. package/lib/cli/lint/internalLints/patchRenovateConfig.js +4 -1
  45. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  46. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +2 -2
  47. package/lib/cli/lint/internalLints/refreshConfigFiles.js +14 -3
  48. package/lib/cli/lint/internalLints/refreshConfigFiles.js.map +2 -2
  49. package/lib/cli/lint/internalLints/upgrade/index.d.ts +10 -2
  50. package/lib/cli/lint/internalLints/upgrade/index.js +15 -5
  51. package/lib/cli/lint/internalLints/upgrade/index.js.map +2 -2
  52. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +1 -1
  53. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  54. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.d.ts +1 -1
  55. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js +1 -1
  56. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js.map +2 -2
  57. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +4 -1
  58. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  59. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +4 -1
  60. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  61. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +2 -0
  62. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +35 -0
  63. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +7 -0
  64. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +2 -0
  65. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +147 -0
  66. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +7 -0
  67. package/lib/cli/lint/types.d.ts +0 -1
  68. package/lib/utils/args.d.ts +0 -1
  69. package/lib/utils/copy.d.ts +1 -1
  70. package/lib/utils/env.d.ts +0 -1
  71. package/lib/utils/error.d.ts +0 -1
  72. package/lib/utils/exec.d.ts +0 -1
  73. package/lib/utils/template.d.ts +3 -3
  74. package/lib/wrapper/http.d.ts +0 -1
  75. package/package.json +22 -21
  76. package/template/base/.vscode/extensions.json +3 -0
  77. package/template/base/_.gitignore +2 -0
  78. package/template/base/_.npmrc +1 -0
  79. package/template/express-rest-api/.buildkite/pipeline.yml +1 -0
  80. package/template/express-rest-api/.gantry/dev.yml +0 -2
  81. package/template/express-rest-api/.gantry/prod.yml +0 -2
  82. package/template/express-rest-api/Dockerfile.dev-deps +1 -1
  83. package/template/express-rest-api/README.md +3 -3
  84. package/template/express-rest-api/docker-compose.yml +0 -2
  85. package/template/express-rest-api/gantry.apply.yml +0 -7
  86. package/template/express-rest-api/package.json +5 -2
  87. package/template/express-rest-api/src/config.ts +14 -6
  88. package/template/express-rest-api/src/framework/logging.ts +1 -1
  89. package/template/express-rest-api/src/framework/metrics.ts +11 -0
  90. package/template/express-rest-api/src/listen.ts +2 -2
  91. package/template/greeter/.buildkite/pipeline.yml +1 -0
  92. package/template/greeter/Dockerfile +1 -1
  93. package/template/greeter/README.md +3 -3
  94. package/template/greeter/docker-compose.yml +0 -2
  95. package/template/greeter/package.json +2 -1
  96. package/template/koa-rest-api/.buildkite/pipeline.yml +1 -0
  97. package/template/koa-rest-api/.gantry/dev.yml +0 -2
  98. package/template/koa-rest-api/.gantry/prod.yml +0 -2
  99. package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
  100. package/template/koa-rest-api/README.md +3 -3
  101. package/template/koa-rest-api/docker-compose.yml +0 -2
  102. package/template/koa-rest-api/gantry.apply.yml +0 -7
  103. package/template/koa-rest-api/package.json +12 -12
  104. package/template/koa-rest-api/src/api/jobs/index.ts +1 -1
  105. package/template/koa-rest-api/src/app.test.ts +5 -10
  106. package/template/koa-rest-api/src/config.ts +14 -4
  107. package/template/koa-rest-api/src/framework/validation.test.ts +1 -1
  108. package/template/lambda-sqs-worker/.buildkite/pipeline.yml +1 -0
  109. package/template/lambda-sqs-worker/Dockerfile +1 -1
  110. package/template/lambda-sqs-worker/README.md +3 -3
  111. package/template/lambda-sqs-worker/_.npmrc +1 -0
  112. package/template/lambda-sqs-worker/docker-compose.yml +0 -2
  113. package/template/lambda-sqs-worker/package.json +3 -2
  114. package/template/lambda-sqs-worker/src/config.ts +9 -4
  115. package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +1 -0
  116. package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
  117. package/template/lambda-sqs-worker-cdk/docker-compose.yml +0 -2
  118. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +42 -0
  119. package/template/lambda-sqs-worker-cdk/infra/config.ts +14 -6
  120. package/template/lambda-sqs-worker-cdk/package.json +4 -1
  121. package/template/lambda-sqs-worker-cdk/src/app.ts +14 -2
  122. package/template/lambda-sqs-worker-cdk/src/config.ts +47 -0
  123. package/template/oss-npm-package/.github/workflows/validate.yml +1 -0
  124. package/template/oss-npm-package/README.md +3 -3
  125. package/template/private-npm-package/.buildkite/pipeline.yml +1 -0
  126. package/template/private-npm-package/README.md +1 -1
  127. /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.1.0-test-20240430085832",
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": "^20.0.0",
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.20.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.2.5",
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.4.0",
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.0.0"
103
+ "eslint-config-skuba": "4.1.0"
104
104
  },
105
105
  "devDependencies": {
106
- "@changesets/cli": "2.27.1",
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.14.0",
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.15.0",
122
+ "enhanced-resolve": "5.17.0",
122
123
  "express": "4.19.2",
123
- "fastify": "4.26.1",
124
+ "fastify": "4.28.0",
124
125
  "jest-diff": "29.7.0",
125
126
  "jsonfile": "6.1.0",
126
- "koa": "2.15.0",
127
- "memfs": "4.6.0",
128
- "remark-cli": "12.0.0",
129
- "remark-preset-lint-recommended": "6.1.3",
130
- "semver": "7.6.0",
131
- "supertest": "6.3.4",
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.0.1-test-20240430085832"
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": "7.4.0"
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 --env-file=.env lib/skuba",
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 --runInBand --selectProjects integration",
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
  }
@@ -0,0 +1,3 @@
1
+ {
2
+ "recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
3
+ }
@@ -1,10 +1,12 @@
1
1
  # managed by skuba
2
2
  .idea/*
3
3
  .vscode/*
4
+ !.vscode/extensions.json
4
5
 
5
6
  .cdk.staging/
6
7
  .serverless/
7
8
  cdk.out/
9
+ cdk.context.json
8
10
  node_modules*/
9
11
 
10
12
  /coverage*/
@@ -1,4 +1,5 @@
1
1
  # managed by skuba
2
+ package-manager-strict-version=true
2
3
  public-hoist-pattern[]="@types*"
3
4
  public-hoist-pattern[]="*eslint*"
4
5
  public-hoist-pattern[]="*prettier*"
@@ -1,3 +1,4 @@
1
+ $schema: https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
1
2
  agents:
2
3
  queue: <%- prodBuildkiteQueueName %>
3
4
 
@@ -1,6 +1,4 @@
1
1
  environment: dev
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: dev-value
4
2
 
5
3
  maxInstanceCount: 1
6
4
  minInstanceCount: 1
@@ -1,6 +1,4 @@
1
1
  environment: prod
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: prod-value
4
2
 
5
3
  maxInstanceCount: 10
6
4
  minInstanceCount: 3
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -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 [Builds at SEEK] for more information.
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
- [builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
23
- [github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
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
 
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -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": "^6.1.6"
29
+ "supertest": "^7.0.0"
27
30
  },
28
- "packageManager": "pnpm@9.0.2",
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?: string;
11
- port?: number;
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]: () => ({
@@ -2,7 +2,7 @@ import createLogger from '@seek/logger';
2
2
 
3
3
  import { config } from 'src/config';
4
4
 
5
- export const rootLogger = createLogger({
5
+ export const logger = createLogger({
6
6
  base: {
7
7
  environment: config.environment,
8
8
  version: config.version,
@@ -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 { rootLogger } from './framework/logging';
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
- rootLogger.debug(`listening on port ${address.port}`);
14
+ logger.debug(`listening on port ${address.port}`);
15
15
  }
16
16
  });
17
17
 
@@ -1,3 +1,4 @@
1
+ $schema: https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
1
2
  agents:
2
3
  queue: <%- prodBuildkiteQueueName %>
3
4
 
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -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 [Builds at SEEK] for more information.
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
- [builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
21
- [github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
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,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -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.2",
22
+ "packageManager": "pnpm@9.4.0",
22
23
  "engines": {
23
24
  "node": ">=20"
24
25
  }
@@ -1,3 +1,4 @@
1
+ $schema: https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
1
2
  agents:
2
3
  queue: <%- prodBuildkiteQueueName %>
3
4
 
@@ -1,6 +1,4 @@
1
1
  environment: dev
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: dev-value
4
2
 
5
3
  maxInstanceCount: 1
6
4
  minInstanceCount: 1
@@ -1,6 +1,4 @@
1
1
  environment: prod
2
- env:
3
- SOME_ENVIRONMENT_VARIABLE: prod-value
4
2
 
5
3
  maxInstanceCount: 10
6
4
  minInstanceCount: 3
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -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 [Builds at SEEK] for more information.
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
- [builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
23
- [github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
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
 
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}
@@ -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.1.0",
17
- "@opentelemetry/core": "^1.18.1",
18
- "@opentelemetry/exporter-trace-otlp-grpc": "^0.50.0",
19
- "@opentelemetry/instrumentation-aws-sdk": "^0.40.0",
20
- "@opentelemetry/instrumentation-http": "^0.50.0",
21
- "@opentelemetry/propagator-b3": "^1.18.1",
22
- "@opentelemetry/sdk-node": "^0.50.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.2.0",
29
- "seek-datadog-custom-metrics": "^4.2.1",
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": "^6.1.6"
45
+ "supertest": "^7.0.0"
46
46
  },
47
- "packageManager": "pnpm@9.0.2",
47
+ "packageManager": "pnpm@9.4.0",
48
48
  "engines": {
49
49
  "node": ">=20"
50
50
  }
@@ -1,6 +1,6 @@
1
1
  import Router from '@koa/router';
2
2
 
3
- import { jsonBodyParser } from 'src/framework/middleware';
3
+ import { jsonBodyParser } from 'src/framework/bodyParser';
4
4
 
5
5
  import { getJobsHandler } from './getJobs';
6
6
  import { postJobHandler } from './postJob';
@@ -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', async () => {
14
- const response = await agent.get('/smoke');
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', async () => {
19
- const response = await agent.get('/jobs');
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('has OPTIONS for a nested route', () =>
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?: string;
11
- port?: number;
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 './middleware';
8
+ import { jsonBodyParser } from './bodyParser';
9
9
  import { validate } from './validation';
10
10
 
11
11
  const agent = agentFromMiddleware(jsonBodyParser, (ctx) => {
@@ -1,3 +1,4 @@
1
+ $schema: https://raw.githubusercontent.com/buildkite/pipeline-schema/main/schema.json
1
2
  agents:
2
3
  queue: <%- prodBuildkiteQueueName %>
3
4
 
@@ -1,4 +1,4 @@
1
- # syntax=docker/dockerfile:1.7
1
+ # syntax=docker/dockerfile:1.8
2
2
 
3
3
  FROM --platform=<%- platformName %> node:20-alpine AS dev-deps
4
4
 
@@ -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 [Builds at SEEK] for more information.
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
- [builds at seek]: https://backstage.myseek.xyz/docs/default/component/builds-cicd-seek/
22
- [github repository settings]: https://github.com/<%-orgName%>/<%-repoName%>/settings
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
 
@@ -1,4 +1,5 @@
1
1
  # managed by skuba
2
+ package-manager-strict-version=true
2
3
  public-hoist-pattern[]="@types*"
3
4
  public-hoist-pattern[]="*eslint*"
4
5
  public-hoist-pattern[]="*prettier*"
@@ -1,5 +1,3 @@
1
- version: '3.7'
2
-
3
1
  services:
4
2
  app:
5
3
  image: ${BUILDKITE_PLUGIN_DOCKER_IMAGE:-''}