skuba 8.1.0-configure-stdin-20240509055640 → 8.1.0-main-20240625003658

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 (87) hide show
  1. package/lib/api/git/pull.js.map +2 -2
  2. package/lib/api/git/push.d.ts +10 -1
  3. package/lib/api/git/push.js.map +2 -2
  4. package/lib/api/github/environment.d.ts +0 -1
  5. package/lib/api/github/push.d.ts +7 -1
  6. package/lib/api/github/push.js.map +2 -2
  7. package/lib/api/jest/index.d.ts +1 -1
  8. package/lib/cli/adapter/eslint.d.ts +1 -1
  9. package/lib/cli/adapter/prettier.d.ts +2 -2
  10. package/lib/cli/configure/ensureTemplateCompletion.js +2 -2
  11. package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
  12. package/lib/cli/configure/index.js +6 -3
  13. package/lib/cli/configure/index.js.map +2 -2
  14. package/lib/cli/configure/processing/configFile.d.ts +1 -1
  15. package/lib/cli/configure/processing/package.d.ts +56 -58
  16. package/lib/cli/init/getConfig.d.ts +1 -1
  17. package/lib/cli/init/index.js +15 -1
  18. package/lib/cli/init/index.js.map +2 -2
  19. package/lib/cli/init/prompts.d.ts +0 -1
  20. package/lib/cli/init/types.d.ts +22 -5
  21. package/lib/cli/lint/external.d.ts +0 -2
  22. package/lib/cli/lint/index.d.ts +0 -1
  23. package/lib/cli/lint/internal.d.ts +1 -1
  24. package/lib/cli/lint/internalLints/noSkubaTemplateJs.d.ts +1 -1
  25. package/lib/cli/lint/internalLints/patchRenovateConfig.d.ts +1 -1
  26. package/lib/cli/lint/internalLints/patchRenovateConfig.js +4 -1
  27. package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +2 -2
  28. package/lib/cli/lint/internalLints/refreshConfigFiles.d.ts +2 -2
  29. package/lib/cli/lint/internalLints/upgrade/index.d.ts +10 -2
  30. package/lib/cli/lint/internalLints/upgrade/index.js +15 -5
  31. package/lib/cli/lint/internalLints/upgrade/index.js.map +2 -2
  32. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js +1 -1
  33. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/addEmptyExports.js.map +2 -2
  34. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.d.ts +1 -1
  35. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js +1 -1
  36. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/moveNpmrcOutOfIgnoreManagedSection.js.map +2 -2
  37. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js +4 -1
  38. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchDockerfile.js.map +2 -2
  39. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js +4 -1
  40. package/lib/cli/lint/internalLints/upgrade/patches/7.3.1/patchServerListener.js.map +2 -2
  41. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.d.ts +2 -0
  42. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js +35 -0
  43. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/index.js.map +7 -0
  44. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.d.ts +2 -0
  45. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js +147 -0
  46. package/lib/cli/lint/internalLints/upgrade/patches/8.0.0/patchPnpmPackageManager.js.map +7 -0
  47. package/lib/cli/lint/types.d.ts +0 -1
  48. package/lib/utils/args.d.ts +0 -1
  49. package/lib/utils/copy.d.ts +1 -1
  50. package/lib/utils/env.d.ts +0 -1
  51. package/lib/utils/error.d.ts +0 -1
  52. package/lib/utils/exec.d.ts +0 -1
  53. package/lib/utils/template.d.ts +3 -3
  54. package/lib/wrapper/http.d.ts +0 -1
  55. package/package.json +15 -15
  56. package/template/express-rest-api/.gantry/dev.yml +0 -2
  57. package/template/express-rest-api/.gantry/prod.yml +0 -2
  58. package/template/express-rest-api/Dockerfile.dev-deps +1 -1
  59. package/template/express-rest-api/docker-compose.yml +0 -2
  60. package/template/express-rest-api/gantry.apply.yml +0 -7
  61. package/template/express-rest-api/package.json +5 -2
  62. package/template/express-rest-api/src/config.ts +14 -6
  63. package/template/express-rest-api/src/framework/logging.ts +1 -1
  64. package/template/express-rest-api/src/framework/metrics.ts +11 -0
  65. package/template/express-rest-api/src/listen.ts +2 -2
  66. package/template/greeter/Dockerfile +1 -1
  67. package/template/greeter/docker-compose.yml +0 -2
  68. package/template/greeter/package.json +3 -2
  69. package/template/koa-rest-api/.gantry/dev.yml +0 -2
  70. package/template/koa-rest-api/.gantry/prod.yml +0 -2
  71. package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
  72. package/template/koa-rest-api/docker-compose.yml +0 -2
  73. package/template/koa-rest-api/gantry.apply.yml +0 -7
  74. package/template/koa-rest-api/package.json +12 -12
  75. package/template/koa-rest-api/src/config.ts +14 -4
  76. package/template/lambda-sqs-worker/Dockerfile +1 -1
  77. package/template/lambda-sqs-worker/docker-compose.yml +0 -2
  78. package/template/lambda-sqs-worker/package.json +3 -2
  79. package/template/lambda-sqs-worker/src/config.ts +9 -4
  80. package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
  81. package/template/lambda-sqs-worker-cdk/docker-compose.yml +0 -2
  82. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +12 -0
  83. package/template/lambda-sqs-worker-cdk/infra/config.ts +14 -6
  84. package/template/lambda-sqs-worker-cdk/package.json +5 -2
  85. package/template/lambda-sqs-worker-cdk/src/app.ts +14 -2
  86. package/template/lambda-sqs-worker-cdk/src/config.ts +47 -0
  87. package/template/oss-npm-package/.github/workflows/validate.yml +1 -0
@@ -1,8 +1,20 @@
1
1
  import createLogger from '@seek/logger';
2
2
  import type { SQSEvent, SQSHandler } from 'aws-lambda';
3
3
 
4
- const logger = createLogger({
5
- name: '<%- serviceName %>',
4
+ import { config } from './config';
5
+
6
+ export const logger = createLogger({
7
+ base: {
8
+ environment: config.environment,
9
+ version: config.version,
10
+ },
11
+
12
+ level: config.logLevel,
13
+
14
+ name: config.name,
15
+
16
+ transport:
17
+ config.environment === 'local' ? { target: 'pino-pretty' } : undefined,
6
18
  });
7
19
 
8
20
  /**
@@ -0,0 +1,47 @@
1
+ import { Env } from 'skuba-dive';
2
+
3
+ interface Config {
4
+ environment: Environment;
5
+
6
+ logLevel: string;
7
+ name: string;
8
+ version: string;
9
+ }
10
+
11
+ type Environment = (typeof environments)[number];
12
+
13
+ const environments = ['local', 'test', 'dev', 'prod'] as const;
14
+
15
+ const environment = Env.oneOf(environments)('ENVIRONMENT');
16
+
17
+ /* istanbul ignore next: config verification makes more sense in a smoke test */
18
+ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
19
+ local: () => ({
20
+ logLevel: 'debug',
21
+ name: '<%- serviceName %>',
22
+ version: 'local',
23
+ }),
24
+
25
+ test: () => ({
26
+ logLevel: Env.string('LOG_LEVEL', { default: 'silent' }),
27
+ name: '<%- serviceName %>',
28
+ version: 'test',
29
+ }),
30
+
31
+ dev: () => ({
32
+ logLevel: 'debug',
33
+ name: Env.string('SERVICE'),
34
+ version: Env.string('VERSION'),
35
+ }),
36
+
37
+ prod: () => ({
38
+ logLevel: 'info',
39
+ name: Env.string('SERVICE'),
40
+ version: Env.string('VERSION'),
41
+ }),
42
+ };
43
+
44
+ export const config: Config = {
45
+ ...configs[environment](),
46
+ environment,
47
+ };
@@ -9,6 +9,7 @@ permissions: {}
9
9
  jobs:
10
10
  validate:
11
11
  name: Lint & Test
12
+ if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.fork
12
13
  permissions:
13
14
  checks: write
14
15
  runs-on: ubuntu-latest