skuba 12.0.0-enforce-file-extensions-20250618112549 → 12.0.0-subpath-imports-20250710010820
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/tsconfig.json +4 -3
- package/jest/transform.js +1 -15
- package/jest-preset.js +4 -7
- package/lib/cli/buildPackage/index.js +2 -2
- package/lib/cli/buildPackage/index.js.map +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js +1 -1
- package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
- package/lib/cli/configure/processing/prettier.d.ts +1 -1
- package/lib/cli/configure/processing/prettier.js +8 -6
- package/lib/cli/configure/processing/prettier.js.map +3 -3
- package/lib/cli/init/getConfig.d.ts +1 -1
- package/lib/cli/init/getConfig.js +7 -5
- package/lib/cli/init/getConfig.js.map +3 -3
- package/lib/cli/init/prompts.d.ts +5 -5
- package/lib/cli/init/prompts.js +5 -4
- package/lib/cli/init/prompts.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.js +35 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.d.ts +6 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.js +104 -0
- package/lib/cli/lint/internalLints/upgrade/patches/11.1.0/rewriteSrcImports.js.map +7 -0
- package/lib/cli/migrate/nodeVersion/index.js +18 -18
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/package.json +33 -26
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +2 -0
- package/template/base/jest.config.ts +17 -3
- package/template/base/jest.setup.ts +0 -2
- package/template/base/tsconfig.json +3 -3
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +1 -1
- package/template/express-rest-api/package.json +8 -1
- package/template/express-rest-api/src/app.ts +0 -2
- package/template/express-rest-api/src/framework/logging.ts +1 -1
- package/template/express-rest-api/src/framework/metrics.ts +2 -2
- package/template/express-rest-api/src/listen.ts +0 -2
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/Dockerfile +1 -1
- package/template/greeter/package.json +10 -3
- package/template/greeter/src/app.ts +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
- package/template/koa-rest-api/package.json +14 -7
- package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
- package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
- package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
- package/template/koa-rest-api/src/api/jobs/index.ts +2 -2
- package/template/koa-rest-api/src/api/jobs/postJob.test.ts +4 -4
- package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
- package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
- package/template/koa-rest-api/src/app.test.ts +2 -2
- package/template/koa-rest-api/src/app.ts +0 -2
- package/template/koa-rest-api/src/config.ts +1 -1
- package/template/koa-rest-api/src/framework/logging.ts +22 -13
- package/template/koa-rest-api/src/framework/metrics.ts +2 -2
- package/template/koa-rest-api/src/framework/server.test.ts +95 -64
- package/template/koa-rest-api/src/framework/server.ts +3 -3
- package/template/koa-rest-api/src/framework/validation.test.ts +36 -36
- package/template/koa-rest-api/src/framework/validation.ts +15 -22
- package/template/koa-rest-api/src/listen.ts +0 -2
- package/template/koa-rest-api/src/register.ts +0 -1
- package/template/koa-rest-api/src/storage/jobs.ts +1 -1
- package/template/koa-rest-api/src/testing/metrics.ts +1 -1
- package/template/koa-rest-api/src/testing/server.ts +1 -1
- package/template/koa-rest-api/src/testing/types.ts +2 -2
- package/template/koa-rest-api/src/types/jobs.ts +1 -1
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +6 -0
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +13 -6
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +81 -22
- package/template/lambda-sqs-worker-cdk/src/app.ts +7 -9
- package/template/lambda-sqs-worker-cdk/src/config.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +38 -18
- package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
- package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -12
- package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +9 -12
- package/template/lambda-sqs-worker-cdk/src/framework/validation.ts +3 -7
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
- package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +7 -6
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
- package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
- package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
- package/template/lambda-sqs-worker-cdk/src/testing/types.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/types/jobScorer.ts +1 -1
- package/template/lambda-sqs-worker-cdk/src/types/pipelineEvents.ts +1 -1
- package/template/lambda-sqs-worker-cdk/tsconfig.json +3 -3
- package/template/oss-npm-package/_package.json +8 -0
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/template/oss-npm-package/tsconfig.json +3 -0
- package/template/private-npm-package/_package.json +7 -0
- package/lib/cli/test/reporters/prettier/index.d.ts +0 -4
- package/lib/cli/test/reporters/prettier/index.js +0 -67
- package/lib/cli/test/reporters/prettier/index.js.map +0 -7
- package/template/express-rest-api/src/register.ts +0 -1
- package/template/koa-rest-api/src/testing/logging.ts +0 -16
- package/template/koa-rest-api/tsconfig.json +0 -18
- package/template/lambda-sqs-worker-cdk/src/testing/logging.ts +0 -19
|
@@ -45,83 +45,83 @@ const subPatches = ({
|
|
|
45
45
|
` },
|
|
46
46
|
{
|
|
47
47
|
files: "**/Dockerfile*",
|
|
48
|
-
regex: /^FROM(.*) (public.ecr.aws\/docker\/library\/)?node:([0-9]+(?:\.[0-9]+(?:\.[0-9]+)?)?)(-[a-z0-9]+)?(@sha256:[a-f0-9]{64})?( .*)?$/gm,
|
|
48
|
+
regex: () => /^FROM(.*) (public.ecr.aws\/docker\/library\/)?node:([0-9]+(?:\.[0-9]+(?:\.[0-9]+)?)?)(-[a-z0-9]+)?(@sha256:[a-f0-9]{64})?( .*)?$/gm,
|
|
49
49
|
replace: `FROM$1 $2node:${nodeVersion}$4$6`
|
|
50
50
|
},
|
|
51
51
|
{
|
|
52
52
|
files: "**/Dockerfile*",
|
|
53
|
-
regex: /^FROM(.*) gcr.io\/distroless\/nodejs\d+-debian(\d+)(@sha256:[a-f0-9]{64})?(\.[^- \n]+)?(-[^ \n]+)?( .+|)$/gm,
|
|
53
|
+
regex: () => /^FROM(.*) gcr.io\/distroless\/nodejs\d+-debian(\d+)(@sha256:[a-f0-9]{64})?(\.[^- \n]+)?(-[^ \n]+)?( .+|)$/gm,
|
|
54
54
|
replace: `FROM$1 gcr.io/distroless/nodejs${nodeVersion}-debian$2$4$5$6`
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
files: "**/serverless*.y*ml",
|
|
58
|
-
regex: /\bnodejs\d+.x\b/gm,
|
|
58
|
+
regex: () => /\bnodejs\d+.x\b/gm,
|
|
59
59
|
tests: [import_checks.isPatchableServerlessVersion],
|
|
60
60
|
replace: `nodejs${nodeVersion}.x`
|
|
61
61
|
},
|
|
62
62
|
{
|
|
63
63
|
files: "**/serverless*.y*ml",
|
|
64
|
-
regex: /\bnode\d+\b/gm,
|
|
64
|
+
regex: () => /\bnode\d+\b/gm,
|
|
65
65
|
tests: [import_checks.isPatchableServerlessVersion],
|
|
66
66
|
replace: `node${nodeVersion}`
|
|
67
67
|
},
|
|
68
68
|
{
|
|
69
69
|
files: "**/infra/**/*.ts",
|
|
70
|
-
regex: /NODEJS_\d+_X/g,
|
|
70
|
+
regex: () => /NODEJS_\d+_X/g,
|
|
71
71
|
replace: `NODEJS_${nodeVersion}_X`
|
|
72
72
|
},
|
|
73
73
|
{
|
|
74
74
|
files: "**/infra/**/*.ts",
|
|
75
|
-
regex: /(target:\s*'node)(\d+)(.+)$/gm,
|
|
75
|
+
regex: () => /(target:\s*'node)(\d+)(.+)$/gm,
|
|
76
76
|
replace: `$1${nodeVersion}$3`
|
|
77
77
|
},
|
|
78
78
|
{
|
|
79
79
|
files: "**/.buildkite/*",
|
|
80
|
-
regex: /(image: )(public.ecr.aws\/docker\/library\/)?(node:)[0-9.]+(\.[^- \n]+)?(-[^ \n]+)?$/gm,
|
|
80
|
+
regex: () => /(image: )(public.ecr.aws\/docker\/library\/)?(node:)[0-9.]+(\.[^- \n]+)?(-[^ \n]+)?$/gm,
|
|
81
81
|
replace: `$1$2$3${nodeVersion}$5`
|
|
82
82
|
},
|
|
83
83
|
{
|
|
84
84
|
files: ".node-version*",
|
|
85
|
-
regex: /(\d+(?:\.\d+)*)/g,
|
|
85
|
+
regex: () => /(\d+(?:\.\d+)*)/g,
|
|
86
86
|
replace: `${nodeVersion}`
|
|
87
87
|
},
|
|
88
88
|
{
|
|
89
89
|
files: "**/package.json",
|
|
90
|
-
regex: /(["']engines["']:\s*{[\s\S]*?["']node["']:\s*["']>=)(\d+(?:\.\d+)*)(['"]\s*})/gm,
|
|
90
|
+
regex: () => /(["']engines["']:\s*{[\s\S]*?["']node["']:\s*["']>=)(\d+(?:\.\d+)*)(['"]\s*})/gm,
|
|
91
91
|
tests: [import_checks.isPatchableServerlessVersion, import_checks.isPatchableSkubaType],
|
|
92
92
|
replace: `$1${nodeVersion}$3`
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
files: "**/tsconfig*.json",
|
|
96
|
-
regex: /("target":\s*")(ES\d+)"/gim,
|
|
96
|
+
regex: () => /("target":\s*")(ES\d+)"/gim,
|
|
97
97
|
tests: [import_checks.isPatchableServerlessVersion, import_checks.isPatchableSkubaType],
|
|
98
98
|
replace: `$1${ECMAScriptVersion}"`
|
|
99
99
|
},
|
|
100
100
|
{
|
|
101
101
|
files: "**/tsconfig*.json",
|
|
102
|
-
regex: /("lib":\s*\[)([\S\s]*?)(ES\d+)([\S\s]*?)(\])/gim,
|
|
102
|
+
regex: () => /("lib":\s*\[)([\S\s]*?)(ES\d+)([\S\s]*?)(\])/gim,
|
|
103
103
|
tests: [import_checks.isPatchableServerlessVersion, import_checks.isPatchableSkubaType],
|
|
104
104
|
replace: `$1$2${ECMAScriptVersion}$4$5`
|
|
105
105
|
},
|
|
106
106
|
{
|
|
107
107
|
files: "**/docker-compose*.y*ml",
|
|
108
|
-
regex: /(image: )(public.ecr.aws\/docker\/library\/)?(node:)[0-9.]+(\.[^- \n]+)?(-[^ \n]+)?$/gm,
|
|
108
|
+
regex: () => /(image: )(public.ecr.aws\/docker\/library\/)?(node:)[0-9.]+(\.[^- \n]+)?(-[^ \n]+)?$/gm,
|
|
109
109
|
replace: `$1$2$3${nodeVersion}$5`
|
|
110
110
|
}
|
|
111
111
|
];
|
|
112
112
|
const runSubPatch = async (dir, patch) => {
|
|
113
113
|
const readFile = (0, import_project.createDestinationFileReader)(dir);
|
|
114
|
-
const paths = patch.file ? [patch.file] : await (0, import_fast_glob.glob)(patch.files ?? [], {
|
|
114
|
+
const paths = patch.file ? [patch.file] : await (0, import_fast_glob.glob)(patch.files ?? [], {
|
|
115
|
+
cwd: dir,
|
|
116
|
+
ignore: ["**/node_modules/**"]
|
|
117
|
+
});
|
|
115
118
|
await Promise.all(
|
|
116
119
|
paths.map(async (path) => {
|
|
117
|
-
if (path.includes("node_modules")) {
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
120
|
const contents = await readFile(path);
|
|
121
121
|
if (!contents) {
|
|
122
122
|
return;
|
|
123
123
|
}
|
|
124
|
-
if (patch.regex && !patch.regex.test(contents)) {
|
|
124
|
+
if (patch.regex && !patch.regex().test(contents)) {
|
|
125
125
|
return;
|
|
126
126
|
}
|
|
127
127
|
if (patch.tests) {
|
|
@@ -148,7 +148,7 @@ const writePatchedContents = async ({
|
|
|
148
148
|
regex
|
|
149
149
|
}) => await import_fs_extra.default.promises.writeFile(
|
|
150
150
|
path,
|
|
151
|
-
regex ? contents.replaceAll(regex, templated) : templated
|
|
151
|
+
regex ? contents.replaceAll(regex(), templated) : templated
|
|
152
152
|
);
|
|
153
153
|
const upgrade = async (versions, dir) => {
|
|
154
154
|
for (const subPatch of subPatches(versions)) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/migrate/nodeVersion/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\n\nimport {\n isPatchableNodeVersion,\n isPatchableServerlessVersion,\n isPatchableSkubaType,\n} from './checks.js';\n\ntype FileSelector =\n | { files: string; file?: never }\n | { file: string; files?: never };\n\ntype SubPatch = FileSelector & {\n tests?: Array<(path: string) => Promise<boolean>>;\n regex?: RegExp;\n replace: string;\n};\n\nconst subPatches = ({\n nodeVersion,\n ECMAScriptVersion,\n}: Versions): SubPatch[] => [\n { file: '.nvmrc', replace: `${nodeVersion}\\n` },\n {\n files: '**/Dockerfile*',\n\n regex
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AAEf,qBAAoB;AACpB,qBAA4C;AAE5C,oBAIO;AAYP,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AACF,MAA4B;AAAA,EAC1B,EAAE,MAAM,UAAU,SAAS,GAAG,WAAW;AAAA,EAAK;AAAA,EAC9C;AAAA,IACE,OAAO;AAAA,IAEP,
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\n\nimport {\n isPatchableNodeVersion,\n isPatchableServerlessVersion,\n isPatchableSkubaType,\n} from './checks.js';\n\ntype FileSelector =\n | { files: string; file?: never }\n | { file: string; files?: never };\n\ntype SubPatch = FileSelector & {\n tests?: Array<(path: string) => Promise<boolean>>;\n regex?: () => RegExp;\n replace: string;\n};\n\nconst subPatches = ({\n nodeVersion,\n ECMAScriptVersion,\n}: Versions): SubPatch[] => [\n { file: '.nvmrc', replace: `${nodeVersion}\\n` },\n {\n files: '**/Dockerfile*',\n\n regex: () =>\n /^FROM(.*) (public.ecr.aws\\/docker\\/library\\/)?node:([0-9]+(?:\\.[0-9]+(?:\\.[0-9]+)?)?)(-[a-z0-9]+)?(@sha256:[a-f0-9]{64})?( .*)?$/gm,\n replace: `FROM$1 $2node:${nodeVersion}$4$6`,\n },\n {\n files: '**/Dockerfile*',\n regex: () =>\n /^FROM(.*) gcr.io\\/distroless\\/nodejs\\d+-debian(\\d+)(@sha256:[a-f0-9]{64})?(\\.[^- \\n]+)?(-[^ \\n]+)?( .+|)$/gm,\n replace: `FROM$1 gcr.io/distroless/nodejs${nodeVersion}-debian$2$4$5$6`,\n },\n\n {\n files: '**/serverless*.y*ml',\n regex: () => /\\bnodejs\\d+.x\\b/gm,\n tests: [isPatchableServerlessVersion],\n replace: `nodejs${nodeVersion}.x`,\n },\n {\n files: '**/serverless*.y*ml',\n regex: () => /\\bnode\\d+\\b/gm,\n tests: [isPatchableServerlessVersion],\n replace: `node${nodeVersion}`,\n },\n\n {\n files: '**/infra/**/*.ts',\n regex: () => /NODEJS_\\d+_X/g,\n replace: `NODEJS_${nodeVersion}_X`,\n },\n {\n files: '**/infra/**/*.ts',\n regex: () => /(target:\\s*'node)(\\d+)(.+)$/gm,\n replace: `$1${nodeVersion}$3`,\n },\n\n {\n files: '**/.buildkite/*',\n regex: () =>\n /(image: )(public.ecr.aws\\/docker\\/library\\/)?(node:)[0-9.]+(\\.[^- \\n]+)?(-[^ \\n]+)?$/gm,\n replace: `$1$2$3${nodeVersion}$5`,\n },\n {\n files: '.node-version*',\n regex: () => /(\\d+(?:\\.\\d+)*)/g,\n replace: `${nodeVersion}`,\n },\n\n {\n files: '**/package.json',\n regex: () =>\n /([\"']engines[\"']:\\s*{[\\s\\S]*?[\"']node[\"']:\\s*[\"']>=)(\\d+(?:\\.\\d+)*)(['\"]\\s*})/gm,\n tests: [isPatchableServerlessVersion, isPatchableSkubaType],\n replace: `$1${nodeVersion}$3`,\n },\n\n {\n files: '**/tsconfig*.json',\n regex: () => /(\"target\":\\s*\")(ES\\d+)\"/gim,\n tests: [isPatchableServerlessVersion, isPatchableSkubaType],\n replace: `$1${ECMAScriptVersion}\"`,\n },\n {\n files: '**/tsconfig*.json',\n regex: () => /(\"lib\":\\s*\\[)([\\S\\s]*?)(ES\\d+)([\\S\\s]*?)(\\])/gim,\n tests: [isPatchableServerlessVersion, isPatchableSkubaType],\n replace: `$1$2${ECMAScriptVersion}$4$5`,\n },\n\n {\n files: '**/docker-compose*.y*ml',\n regex: () =>\n /(image: )(public.ecr.aws\\/docker\\/library\\/)?(node:)[0-9.]+(\\.[^- \\n]+)?(-[^ \\n]+)?$/gm,\n\n replace: `$1$2$3${nodeVersion}$5`,\n },\n];\n\ntype Versions = {\n nodeVersion: number;\n ECMAScriptVersion: string;\n};\n\nconst runSubPatch = async (dir: string, patch: SubPatch) => {\n const readFile = createDestinationFileReader(dir);\n const paths = patch.file\n ? [patch.file]\n : await glob(patch.files ?? [], {\n cwd: dir,\n ignore: ['**/node_modules/**'],\n });\n\n await Promise.all(\n paths.map(async (path) => {\n const contents = await readFile(path);\n if (!contents) {\n return;\n }\n\n if (patch.regex && !patch.regex().test(contents)) {\n return;\n }\n\n if (patch.tests) {\n const results = await Promise.all(\n patch.tests.map((test) => test(path)),\n );\n if (!results.every(Boolean)) {\n return;\n }\n }\n\n await writePatchedContents({\n path,\n contents,\n templated: patch.replace,\n regex: patch.regex,\n });\n }),\n );\n};\n\nconst writePatchedContents = async ({\n path,\n contents,\n templated,\n regex,\n}: {\n path: string;\n contents: string;\n templated: string;\n regex?: () => RegExp;\n}) =>\n await fs.promises.writeFile(\n path,\n regex ? contents.replaceAll(regex(), templated) : templated,\n );\n\nconst upgrade = async (versions: Versions, dir: string) => {\n for (const subPatch of subPatches(versions)) {\n await runSubPatch(dir, subPatch);\n }\n};\n\nexport const nodeVersionMigration = async (\n {\n nodeVersion,\n ECMAScriptVersion,\n }: {\n nodeVersion: number;\n ECMAScriptVersion: string;\n },\n dir = process.cwd(),\n) => {\n log.ok(`Upgrading to Node.js ${nodeVersion}`);\n try {\n if (!(await isPatchableNodeVersion(nodeVersion, dir))) {\n throw new Error('Node.js version is not patchable');\n }\n\n await upgrade({ nodeVersion, ECMAScriptVersion }, dir);\n\n log.ok('Upgraded to Node.js', nodeVersion);\n } catch (error) {\n log.err('Failed to upgrade');\n log.subtle(inspect(error));\n process.exitCode = 1;\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AAEf,qBAAoB;AACpB,qBAA4C;AAE5C,oBAIO;AAYP,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AACF,MAA4B;AAAA,EAC1B,EAAE,MAAM,UAAU,SAAS,GAAG,WAAW;AAAA,EAAK;AAAA,EAC9C;AAAA,IACE,OAAO;AAAA,IA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GAAG,wBAAwB,WAAW,EAAE;AAC5C,MAAI;AACF,QAAI,CAAE,UAAM,sCAAuB,aAAa,GAAG,GAAI;AACrD,YAAM,IAAI,MAAM,kCAAkC;AAAA,IACpD;AAEA,UAAM,QAAQ,EAAE,aAAa,kBAAkB,GAAG,GAAG;AAErD,uBAAI,GAAG,uBAAuB,WAAW;AAAA,EAC3C,SAAS,OAAO;AACd,uBAAI,IAAI,mBAAmB;AAC3B,uBAAI,WAAO,qBAAQ,KAAK,CAAC;AACzB,YAAQ,WAAW;AAAA,EACrB;AACF;",
|
|
6
6
|
"names": ["fs"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "12.0.0-
|
|
3
|
+
"version": "12.0.0-subpath-imports-20250710010820",
|
|
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",
|
|
@@ -13,6 +13,13 @@
|
|
|
13
13
|
},
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"sideEffects": false,
|
|
16
|
+
"imports": {
|
|
17
|
+
"#src/*": {
|
|
18
|
+
"types": "./src/*",
|
|
19
|
+
"import": "./lib/*",
|
|
20
|
+
"require": "./lib/*"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
16
23
|
"main": "lib/index.js",
|
|
17
24
|
"types": "./lib/index.d.ts",
|
|
18
25
|
"bin": {
|
|
@@ -52,12 +59,12 @@
|
|
|
52
59
|
"dependencies": {
|
|
53
60
|
"@esbuild-plugins/tsconfig-paths": "^0.1.0",
|
|
54
61
|
"@eslint/migrate-config": "~1.3.8",
|
|
55
|
-
"@jest/types": "^
|
|
62
|
+
"@jest/types": "^30.0.0",
|
|
56
63
|
"@octokit/graphql": "^9.0.0",
|
|
57
64
|
"@octokit/graphql-schema": "^15.3.0",
|
|
58
|
-
"@octokit/rest": "^
|
|
65
|
+
"@octokit/rest": "^22.0.0",
|
|
59
66
|
"@octokit/types": "^14.0.0",
|
|
60
|
-
"@types/jest": "^
|
|
67
|
+
"@types/jest": "^30.0.0",
|
|
61
68
|
"@types/node": "^22.0.0",
|
|
62
69
|
"chalk": "^4.1.0",
|
|
63
70
|
"concurrently": "^9.0.0",
|
|
@@ -76,8 +83,8 @@
|
|
|
76
83
|
"ignore": "^7.0.0",
|
|
77
84
|
"is-installed-globally": "^0.4.0",
|
|
78
85
|
"isomorphic-git": "^1.11.1",
|
|
79
|
-
"jest": "^
|
|
80
|
-
"jest-watch-typeahead": "^
|
|
86
|
+
"jest": "^30.0.0",
|
|
87
|
+
"jest-watch-typeahead": "^3.0.1",
|
|
81
88
|
"lodash.mergewith": "^4.6.2",
|
|
82
89
|
"minimist": "^1.2.6",
|
|
83
90
|
"normalize-package-data": "^7.0.0",
|
|
@@ -85,53 +92,53 @@
|
|
|
85
92
|
"npm-run-path": "^4.0.1",
|
|
86
93
|
"npm-which": "^3.0.1",
|
|
87
94
|
"picomatch": "^4.0.0",
|
|
88
|
-
"prettier": "~3.
|
|
95
|
+
"prettier": "~3.6.0",
|
|
89
96
|
"prettier-plugin-packagejson": "^2.4.10",
|
|
90
97
|
"read-pkg-up": "^7.0.1",
|
|
91
98
|
"semantic-release": "^24.2.3",
|
|
92
99
|
"simple-git": "^3.5.0",
|
|
93
100
|
"ts-dedent": "^2.2.0",
|
|
94
|
-
"ts-jest": "^29.
|
|
101
|
+
"ts-jest": "^29.4.0",
|
|
95
102
|
"ts-node": "^10.9.2",
|
|
96
103
|
"tsconfig-paths": "^4.0.0",
|
|
97
104
|
"tsconfig-seek": "2.0.0",
|
|
98
105
|
"tsx": "^4.16.2",
|
|
99
106
|
"typescript": "~5.8.0",
|
|
100
|
-
"zod": "^3.
|
|
101
|
-
"eslint-config-skuba": "7.0.0-
|
|
107
|
+
"zod": "^3.25.67",
|
|
108
|
+
"eslint-config-skuba": "7.0.0-subpath-imports-20250710010820"
|
|
102
109
|
},
|
|
103
110
|
"devDependencies": {
|
|
104
|
-
"@changesets/cli": "2.29.
|
|
111
|
+
"@changesets/cli": "2.29.5",
|
|
105
112
|
"@changesets/get-github-info": "0.6.0",
|
|
106
|
-
"@jest/reporters": "
|
|
107
|
-
"@jest/test-result": "
|
|
113
|
+
"@jest/reporters": "30.0.2",
|
|
114
|
+
"@jest/test-result": "30.0.2",
|
|
108
115
|
"@types/ejs": "3.1.5",
|
|
109
|
-
"@types/express": "5.0.
|
|
116
|
+
"@types/express": "5.0.3",
|
|
110
117
|
"@types/fs-extra": "11.0.4",
|
|
111
118
|
"@types/koa": "2.15.0",
|
|
112
119
|
"@types/lodash.mergewith": "4.6.9",
|
|
113
120
|
"@types/minimist": "1.2.5",
|
|
114
121
|
"@types/module-alias": "2.0.4",
|
|
115
|
-
"@types/npm-registry-fetch": "8.0.
|
|
116
|
-
"@types/npm-which": "3.0.
|
|
122
|
+
"@types/npm-registry-fetch": "8.0.8",
|
|
123
|
+
"@types/npm-which": "3.0.4",
|
|
117
124
|
"@types/picomatch": "4.0.0",
|
|
118
125
|
"@types/semver": "7.7.0",
|
|
119
126
|
"@types/supertest": "6.0.3",
|
|
120
|
-
"enhanced-resolve": "5.18.
|
|
127
|
+
"enhanced-resolve": "5.18.2",
|
|
121
128
|
"express": "5.1.0",
|
|
122
|
-
"fastify": "5.
|
|
123
|
-
"jest-diff": "
|
|
129
|
+
"fastify": "5.4.0",
|
|
130
|
+
"jest-diff": "30.0.3",
|
|
124
131
|
"jsonfile": "6.1.0",
|
|
125
132
|
"koa": "3.0.0",
|
|
126
|
-
"memfs": "4.17.
|
|
133
|
+
"memfs": "4.17.2",
|
|
127
134
|
"remark-cli": "12.0.1",
|
|
128
135
|
"remark-preset-lint-recommended": "7.0.1",
|
|
129
|
-
"semver": "7.7.
|
|
130
|
-
"supertest": "7.1.
|
|
136
|
+
"semver": "7.7.2",
|
|
137
|
+
"supertest": "7.1.1",
|
|
131
138
|
"type-fest": "2.19.0"
|
|
132
139
|
},
|
|
133
140
|
"peerDependencies": {
|
|
134
|
-
"skuba-dive": "1
|
|
141
|
+
"skuba-dive": "2.1.0-subpath-imports-20250710010820"
|
|
135
142
|
},
|
|
136
143
|
"peerDependenciesMeta": {
|
|
137
144
|
"skuba-dive": {
|
|
@@ -149,7 +156,7 @@
|
|
|
149
156
|
"entryPoint": "src/index.ts",
|
|
150
157
|
"template": null,
|
|
151
158
|
"type": "package",
|
|
152
|
-
"version": "11.
|
|
159
|
+
"version": "11.1.0"
|
|
153
160
|
},
|
|
154
161
|
"scripts": {
|
|
155
162
|
"build": "scripts/build.sh",
|
|
@@ -158,14 +165,14 @@
|
|
|
158
165
|
"format": "pnpm --silent skuba format && pnpm format:packages",
|
|
159
166
|
"format:packages": "pnpm --filter '!./template/**' format",
|
|
160
167
|
"lint": "pnpm --silent skuba lint && pnpm --silent lint:md",
|
|
161
|
-
"lint
|
|
168
|
+
"lint-all": "pnpm lint && pnpm lint:packages",
|
|
162
169
|
"lint:md": "remark --frail --quiet .",
|
|
163
170
|
"lint:packages": "pnpm --filter '!./template/**' lint",
|
|
164
171
|
"release": "pnpm --silent build && changeset publish",
|
|
165
172
|
"skuba": "pnpm --silent build && pnpm --silent skuba:exec",
|
|
166
173
|
"skuba:exec": "node --experimental-vm-modules --no-warnings=ExperimentalWarning lib/skuba",
|
|
167
174
|
"stage": "changeset version && node ./.changeset/inject.js && pnpm format",
|
|
168
|
-
"test": "pnpm --silent skuba test --selectProjects unit
|
|
175
|
+
"test": "pnpm --silent skuba test --selectProjects unit",
|
|
169
176
|
"test:ci": "pnpm --silent skuba test --runInBand",
|
|
170
177
|
"test:int": "pnpm --silent skuba test --selectProjects integration --runInBand",
|
|
171
178
|
"test:template": "scripts/test-template.sh",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from 'skuba/config/prettier.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export { default } from 'eslint-config-skuba';
|
|
@@ -1,6 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { readFileSync } from 'fs';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const packageJson = JSON.parse(readFileSync('package.json', 'utf8')) as {
|
|
4
|
+
type?: string;
|
|
5
|
+
};
|
|
6
|
+
const isESM = packageJson.type === 'module';
|
|
7
|
+
|
|
8
|
+
export default {
|
|
9
|
+
preset: 'skuba',
|
|
10
|
+
...(isESM && {
|
|
11
|
+
extensionsToTreatAsEsm: ['.ts', '.tsx'],
|
|
12
|
+
}),
|
|
4
13
|
coveragePathIgnorePatterns: ['src/testing'],
|
|
5
14
|
coverageThreshold: {
|
|
6
15
|
global: {
|
|
@@ -10,6 +19,11 @@ export default Jest.mergePreset({
|
|
|
10
19
|
statements: 0,
|
|
11
20
|
},
|
|
12
21
|
},
|
|
22
|
+
moduleNameMapper: {
|
|
23
|
+
'^#src$': '<rootDir>/src',
|
|
24
|
+
'^#src\/(.*)\\.js$': '<rootDir>/src/$1',
|
|
25
|
+
'^#src\/(.*)$': '<rootDir>/src/$1',
|
|
26
|
+
},
|
|
13
27
|
setupFiles: ['<rootDir>/jest.setup.ts'],
|
|
14
28
|
testPathIgnorePatterns: ['/test\\.ts'],
|
|
15
|
-
}
|
|
29
|
+
};
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
"name": "@seek/<%- serviceName %>",
|
|
3
3
|
"private": true,
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
+
"imports": {
|
|
6
|
+
"#src/*": {
|
|
7
|
+
"types": "./src/*",
|
|
8
|
+
"import": "./lib/*",
|
|
9
|
+
"require": "./lib/*"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
5
12
|
"scripts": {
|
|
6
13
|
"build": "skuba build",
|
|
7
14
|
"format": "skuba format",
|
|
@@ -28,7 +35,7 @@
|
|
|
28
35
|
"skuba": "*",
|
|
29
36
|
"supertest": "^7.0.0"
|
|
30
37
|
},
|
|
31
|
-
"packageManager": "pnpm@10.12.
|
|
38
|
+
"packageManager": "pnpm@10.12.4",
|
|
32
39
|
"engines": {
|
|
33
40
|
"node": ">=22"
|
|
34
41
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { StatsD } from 'hot-shots';
|
|
2
2
|
import { createStatsDClient } from 'seek-datadog-custom-metrics';
|
|
3
3
|
|
|
4
|
-
import { config } from 'src/config.js';
|
|
5
|
-
|
|
6
4
|
import { logger } from './logging.js';
|
|
7
5
|
|
|
6
|
+
import { config } from '#src/config.js';
|
|
7
|
+
|
|
8
8
|
/* istanbul ignore next: StatsD client is not our responsibility */
|
|
9
9
|
export const metricsClient = createStatsDClient(StatsD, config, (err) =>
|
|
10
10
|
logger.error({ err }, 'StatsD error'),
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
"name": "@seek/greeter",
|
|
3
3
|
"private": true,
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
+
"imports": {
|
|
6
|
+
"#src/*": {
|
|
7
|
+
"types": "./src/*",
|
|
8
|
+
"import": "./lib/*",
|
|
9
|
+
"require": "./lib/*"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
5
12
|
"scripts": {
|
|
6
13
|
"build": "skuba build",
|
|
7
14
|
"format": "skuba format",
|
|
@@ -13,13 +20,13 @@
|
|
|
13
20
|
"test:watch": "skuba test --watch"
|
|
14
21
|
},
|
|
15
22
|
"dependencies": {
|
|
16
|
-
"skuba-dive": "
|
|
23
|
+
"skuba-dive": "2.1.0-subpath-imports-20250710010820"
|
|
17
24
|
},
|
|
18
25
|
"devDependencies": {
|
|
19
26
|
"@types/node": "^22.13.10",
|
|
20
|
-
"skuba": "12.0.0-
|
|
27
|
+
"skuba": "12.0.0-subpath-imports-20250710010820"
|
|
21
28
|
},
|
|
22
|
-
"packageManager": "pnpm@10.12.
|
|
29
|
+
"packageManager": "pnpm@10.12.4",
|
|
23
30
|
"engines": {
|
|
24
31
|
"node": ">=22"
|
|
25
32
|
}
|
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
"name": "@seek/<%- serviceName %>",
|
|
3
3
|
"private": true,
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
|
+
"imports": {
|
|
6
|
+
"#src/*": {
|
|
7
|
+
"types": "./src/*",
|
|
8
|
+
"import": "./lib/*",
|
|
9
|
+
"require": "./lib/*"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
5
12
|
"scripts": {
|
|
6
13
|
"build": "skuba build",
|
|
7
14
|
"format": "skuba format",
|
|
@@ -13,15 +20,15 @@
|
|
|
13
20
|
"test:watch": "skuba test --watch"
|
|
14
21
|
},
|
|
15
22
|
"dependencies": {
|
|
16
|
-
"@koa/bodyparser": "^
|
|
23
|
+
"@koa/bodyparser": "^6.0.0",
|
|
17
24
|
"@koa/router": "^13.0.0",
|
|
18
25
|
"@opentelemetry/api": "^1.9.0",
|
|
19
26
|
"@opentelemetry/core": "^2.0.0",
|
|
20
|
-
"@opentelemetry/exporter-trace-otlp-grpc": "^0.
|
|
21
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
22
|
-
"@opentelemetry/instrumentation-http": "^0.
|
|
27
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.202.0",
|
|
28
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.54.0",
|
|
29
|
+
"@opentelemetry/instrumentation-http": "^0.202.0",
|
|
23
30
|
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
24
|
-
"@opentelemetry/sdk-node": "^0.
|
|
31
|
+
"@opentelemetry/sdk-node": "^0.202.0",
|
|
25
32
|
"@seek/logger": "^10.0.0",
|
|
26
33
|
"hot-shots": "^10.0.0",
|
|
27
34
|
"koa": "^2.16.1",
|
|
@@ -29,7 +36,7 @@
|
|
|
29
36
|
"seek-datadog-custom-metrics": "^4.6.3",
|
|
30
37
|
"seek-koala": "^7.0.0",
|
|
31
38
|
"skuba-dive": "^2.0.0",
|
|
32
|
-
"zod": "^3.
|
|
39
|
+
"zod": "^3.25.67"
|
|
33
40
|
},
|
|
34
41
|
"devDependencies": {
|
|
35
42
|
"@types/chance": "^1.1.3",
|
|
@@ -44,7 +51,7 @@
|
|
|
44
51
|
"skuba": "*",
|
|
45
52
|
"supertest": "^7.0.0"
|
|
46
53
|
},
|
|
47
|
-
"packageManager": "pnpm@10.12.
|
|
54
|
+
"packageManager": "pnpm@10.12.4",
|
|
48
55
|
"engines": {
|
|
49
56
|
"node": ">=22"
|
|
50
57
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { logger } from 'src/framework/logging.js';
|
|
2
|
-
import { metricsClient } from 'src/framework/metrics.js';
|
|
3
|
-
import * as storage from 'src/storage/jobs.js';
|
|
4
|
-
import type { Middleware } from 'src/types/koa.js';
|
|
1
|
+
import { logger } from '#src/framework/logging.js';
|
|
2
|
+
import { metricsClient } from '#src/framework/metrics.js';
|
|
3
|
+
import * as storage from '#src/storage/jobs.js';
|
|
4
|
+
import type { Middleware } from '#src/types/koa.js';
|
|
5
5
|
|
|
6
6
|
export const getJobsHandler: Middleware = async (ctx) => {
|
|
7
7
|
const jobs = await storage.readJobs();
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import Router from '@koa/router';
|
|
2
2
|
|
|
3
|
-
import { jsonBodyParser } from 'src/framework/bodyParser.js';
|
|
4
|
-
|
|
5
3
|
import { getJobsHandler } from './getJobs.js';
|
|
6
4
|
import { postJobHandler } from './postJob.js';
|
|
7
5
|
|
|
6
|
+
import { jsonBodyParser } from '#src/framework/bodyParser.js';
|
|
7
|
+
|
|
8
8
|
export const jobRouter = new Router()
|
|
9
9
|
.get('/', getJobsHandler)
|
|
10
10
|
.post('/', jsonBodyParser, postJobHandler);
|