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.
- 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/environment.d.ts +0 -1
- 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 +2 -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 +1 -1
- 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/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 +15 -15
- 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/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/Dockerfile +1 -1
- package/template/greeter/docker-compose.yml +0 -2
- package/template/greeter/package.json +3 -2
- 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/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/config.ts +14 -4
- package/template/lambda-sqs-worker/Dockerfile +1 -1
- 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/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 +12 -0
- package/template/lambda-sqs-worker-cdk/infra/config.ts +14 -6
- package/template/lambda-sqs-worker-cdk/package.json +5 -2
- 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
|
@@ -1,8 +1,20 @@
|
|
|
1
1
|
import createLogger from '@seek/logger';
|
|
2
2
|
import type { SQSEvent, SQSHandler } from 'aws-lambda';
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
};
|