skuba 12.1.0-hoist-less-20250722131939 → 13.0.0-custom-conditions-exports-20250729005607

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 (80) hide show
  1. package/config/tsconfig.json +4 -3
  2. package/jest/moduleNameMapper.js +12 -1
  3. package/lib/cli/buildPackage/index.js +2 -2
  4. package/lib/cli/buildPackage/index.js.map +1 -1
  5. package/lib/cli/configure/ensureTemplateCompletion.js +1 -1
  6. package/lib/cli/configure/ensureTemplateCompletion.js.map +2 -2
  7. package/lib/cli/init/getConfig.d.ts +1 -1
  8. package/lib/cli/init/getConfig.js +7 -5
  9. package/lib/cli/init/getConfig.js.map +3 -3
  10. package/lib/cli/init/prompts.d.ts +5 -5
  11. package/lib/cli/init/prompts.js +5 -4
  12. package/lib/cli/init/prompts.js.map +3 -3
  13. package/lib/cli/lint/internalLints/upgrade/patches/12.0.0/index.d.ts +2 -0
  14. package/lib/cli/lint/internalLints/upgrade/patches/12.0.0/index.js +35 -0
  15. package/lib/cli/lint/internalLints/upgrade/patches/12.0.0/index.js.map +7 -0
  16. package/lib/cli/lint/internalLints/upgrade/patches/12.0.0/rewriteSrcImports.d.ts +6 -0
  17. package/lib/cli/lint/internalLints/upgrade/patches/12.0.0/rewriteSrcImports.js +107 -0
  18. package/lib/cli/lint/internalLints/upgrade/patches/12.0.0/rewriteSrcImports.js.map +7 -0
  19. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/configureTsConfigForESM.d.ts +5 -0
  20. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/configureTsConfigForESM.js +182 -0
  21. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/configureTsConfigForESM.js.map +7 -0
  22. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.d.ts +2 -0
  23. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +35 -0
  24. package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +7 -0
  25. package/package.json +8 -2
  26. package/template/base/_.prettierrc.js +1 -1
  27. package/template/base/_eslint.config.js +1 -1
  28. package/template/base/_pnpm-workspace.yaml +1 -0
  29. package/template/base/tsconfig.json +2 -3
  30. package/template/express-rest-api/package.json +6 -0
  31. package/template/express-rest-api/src/app.ts +0 -2
  32. package/template/express-rest-api/src/framework/logging.ts +1 -1
  33. package/template/express-rest-api/src/framework/metrics.ts +2 -2
  34. package/template/express-rest-api/src/listen.ts +0 -2
  35. package/template/greeter/package.json +7 -1
  36. package/template/greeter/src/app.ts +2 -2
  37. package/template/koa-rest-api/package.json +6 -0
  38. package/template/koa-rest-api/src/api/healthCheck.ts +1 -1
  39. package/template/koa-rest-api/src/api/jobs/getJobs.test.ts +2 -2
  40. package/template/koa-rest-api/src/api/jobs/getJobs.ts +4 -4
  41. package/template/koa-rest-api/src/api/jobs/index.ts +2 -2
  42. package/template/koa-rest-api/src/api/jobs/postJob.test.ts +3 -3
  43. package/template/koa-rest-api/src/api/jobs/postJob.ts +6 -6
  44. package/template/koa-rest-api/src/api/smokeTest.ts +2 -2
  45. package/template/koa-rest-api/src/app.test.ts +2 -2
  46. package/template/koa-rest-api/src/app.ts +0 -2
  47. package/template/koa-rest-api/src/framework/logging.ts +1 -1
  48. package/template/koa-rest-api/src/framework/metrics.ts +2 -2
  49. package/template/koa-rest-api/src/framework/server.test.ts +5 -5
  50. package/template/koa-rest-api/src/framework/server.ts +3 -3
  51. package/template/koa-rest-api/src/framework/validation.test.ts +5 -5
  52. package/template/koa-rest-api/src/framework/validation.ts +1 -1
  53. package/template/koa-rest-api/src/listen.ts +0 -2
  54. package/template/koa-rest-api/src/storage/jobs.ts +1 -1
  55. package/template/koa-rest-api/src/testing/metrics.ts +1 -1
  56. package/template/koa-rest-api/src/testing/server.ts +1 -1
  57. package/template/koa-rest-api/src/testing/types.ts +1 -1
  58. package/template/lambda-sqs-worker-cdk/package.json +7 -1
  59. package/template/lambda-sqs-worker-cdk/src/app.test.ts +5 -5
  60. package/template/lambda-sqs-worker-cdk/src/app.ts +7 -9
  61. package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +3 -3
  62. package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +2 -2
  63. package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +1 -1
  64. package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -1
  65. package/template/lambda-sqs-worker-cdk/src/framework/validation.test.ts +3 -3
  66. package/template/lambda-sqs-worker-cdk/src/mapping/jobScorer.ts +2 -2
  67. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.test.ts +3 -3
  68. package/template/lambda-sqs-worker-cdk/src/services/jobScorer.ts +3 -3
  69. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.test.ts +3 -3
  70. package/template/lambda-sqs-worker-cdk/src/services/pipelineEventSender.ts +2 -2
  71. package/template/lambda-sqs-worker-cdk/src/testing/services.ts +2 -2
  72. package/template/lambda-sqs-worker-cdk/src/testing/types.ts +1 -1
  73. package/template/lambda-sqs-worker-cdk/tsconfig.json +4 -3
  74. package/template/oss-npm-package/_package.json +6 -0
  75. package/template/oss-npm-package/skuba.template.js +1 -1
  76. package/template/oss-npm-package/tsconfig.json +1 -0
  77. package/template/private-npm-package/_package.json +6 -0
  78. package/template/private-npm-package/tsconfig.json +1 -0
  79. package/template/express-rest-api/src/register.ts +0 -1
  80. package/template/koa-rest-api/src/register.ts +0 -1
@@ -0,0 +1,182 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var configureTsConfigForESM_exports = {};
30
+ __export(configureTsConfigForESM_exports, {
31
+ configureTsConfigForESM: () => configureTsConfigForESM,
32
+ replacePackageJson: () => replacePackageJson,
33
+ replaceTsconfig: () => replaceTsconfig,
34
+ tryConfigureTsConfigForESM: () => tryConfigureTsConfigForESM
35
+ });
36
+ module.exports = __toCommonJS(configureTsConfigForESM_exports);
37
+ var import_util = require("util");
38
+ var import_fast_glob = require("fast-glob");
39
+ var import_fs_extra = __toESM(require("fs-extra"));
40
+ var import_zod = require("zod");
41
+ var import__ = require("../../../../../../index.js");
42
+ var import_logging = require("../../../../../../utils/logging.js");
43
+ const packageJsonSchema = import_zod.z.object({
44
+ imports: import_zod.z.record(import_zod.z.record(import_zod.z.string())).optional()
45
+ }).passthrough();
46
+ const tsConfigSchema = import_zod.z.object({
47
+ compilerOptions: import_zod.z.object({
48
+ customConditions: import_zod.z.array(import_zod.z.string()).optional(),
49
+ rootDir: import_zod.z.string().optional(),
50
+ paths: import_zod.z.record(import_zod.z.unknown()).optional()
51
+ }).passthrough().optional()
52
+ }).passthrough();
53
+ const getRepoName = async () => {
54
+ try {
55
+ const dir = process.cwd();
56
+ const { repo } = await import__.Git.getOwnerAndRepo({ dir });
57
+ return repo;
58
+ } catch (error) {
59
+ import_logging.log.warn(`Error getting repository information: ${String(error)}`);
60
+ throw error;
61
+ }
62
+ };
63
+ const fetchFiles = async (files) => Promise.all(
64
+ files.map(async (file) => {
65
+ const contents = await import_fs_extra.default.promises.readFile(file, "utf8");
66
+ return {
67
+ file,
68
+ contents
69
+ };
70
+ })
71
+ );
72
+ const replacePackageJson = (contents, repoName) => {
73
+ try {
74
+ const parseResult = packageJsonSchema.safeParse(JSON.parse(contents));
75
+ if (!parseResult.success) {
76
+ import_logging.log.warn(`Failed to parse package.json: ${parseResult.error.message}`);
77
+ return contents;
78
+ }
79
+ const packageJson = parseResult.data;
80
+ packageJson.imports = {
81
+ "#src/*": {
82
+ [`@seek/${repoName}/source`]: "./src/*",
83
+ default: "./lib/*"
84
+ }
85
+ };
86
+ return JSON.stringify(packageJson, null, 2);
87
+ } catch (error) {
88
+ import_logging.log.warn(`Failed to parse package.json as JSON: ${String(error)}`);
89
+ return contents;
90
+ }
91
+ };
92
+ const replaceTsconfig = (contents, repoName) => {
93
+ try {
94
+ const parseResult = tsConfigSchema.safeParse(JSON.parse(contents));
95
+ if (!parseResult.success) {
96
+ import_logging.log.warn(`Failed to parse tsconfig.json: ${parseResult.error.message}`);
97
+ return contents;
98
+ }
99
+ const tsconfigJson = parseResult.data;
100
+ if (!tsconfigJson.compilerOptions || typeof tsconfigJson.compilerOptions !== "object") {
101
+ tsconfigJson.compilerOptions = {};
102
+ }
103
+ const compilerOptions = tsconfigJson.compilerOptions;
104
+ if (compilerOptions.paths !== void 0) {
105
+ delete compilerOptions.paths;
106
+ }
107
+ compilerOptions.customConditions ??= [];
108
+ if (compilerOptions.customConditions.includes(`@seek/${repoName}/source`)) {
109
+ import_logging.log.subtle(
110
+ "Custom condition mapping already exists in tsconfig.json, skipping"
111
+ );
112
+ return contents;
113
+ }
114
+ compilerOptions.customConditions = [`@seek/${repoName}/source`];
115
+ compilerOptions.rootDir ??= ".";
116
+ return JSON.stringify(tsconfigJson, null, 2);
117
+ } catch (error) {
118
+ import_logging.log.warn(`Failed to parse tsconfig.json as JSON: ${String(error)}`);
119
+ return contents;
120
+ }
121
+ };
122
+ const tryConfigureTsConfigForESM = async ({
123
+ mode
124
+ }) => {
125
+ const packageJsonPatterns = ["**/package.json", "**/package.*.json"];
126
+ const tsconfigJsonPatterns = ["**/tsconfig.json", "**/tsconfig.*.json"];
127
+ const globOptions = {
128
+ ignore: ["**/node_modules/**", "**/tsconfig.build.json"]
129
+ };
130
+ const [packageJsonFiles, tsconfigJsonFiles] = await Promise.all([
131
+ fetchFiles(await (0, import_fast_glob.glob)(packageJsonPatterns, globOptions)),
132
+ fetchFiles(await (0, import_fast_glob.glob)(tsconfigJsonPatterns, globOptions))
133
+ ]);
134
+ const repoName = await getRepoName();
135
+ if (!repoName) {
136
+ return { result: "skip", reason: "no repository name found" };
137
+ }
138
+ const replacedPackageJsonFiles = packageJsonFiles.map(
139
+ ({ file, contents }) => ({
140
+ file,
141
+ before: contents,
142
+ after: replacePackageJson(contents, repoName)
143
+ })
144
+ );
145
+ const replacedTsconfigJsonFiles = tsconfigJsonFiles.map(
146
+ ({ file, contents }) => ({
147
+ file,
148
+ before: contents,
149
+ after: replaceTsconfig(contents, repoName)
150
+ })
151
+ );
152
+ if (mode === "lint") {
153
+ return {
154
+ result: "apply"
155
+ };
156
+ }
157
+ await Promise.all(
158
+ [...replacedPackageJsonFiles, ...replacedTsconfigJsonFiles].map(
159
+ async ({ file, after }) => {
160
+ await import_fs_extra.default.promises.writeFile(file, after);
161
+ }
162
+ )
163
+ );
164
+ return { result: "apply" };
165
+ };
166
+ const configureTsConfigForESM = async (config) => {
167
+ try {
168
+ return await tryConfigureTsConfigForESM(config);
169
+ } catch (err) {
170
+ import_logging.log.warn("Failed to write configure `tsconfig.json` and `package.json`");
171
+ import_logging.log.subtle((0, import_util.inspect)(err));
172
+ return { result: "skip", reason: "due to an error" };
173
+ }
174
+ };
175
+ // Annotate the CommonJS export names for ESM import in node:
176
+ 0 && (module.exports = {
177
+ configureTsConfigForESM,
178
+ replacePackageJson,
179
+ replaceTsconfig,
180
+ tryConfigureTsConfigForESM
181
+ });
182
+ //# sourceMappingURL=configureTsConfigForESM.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.0.2/configureTsConfigForESM.ts"],
4
+ "sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\nimport { z } from 'zod';\n\nimport { Git } from '../../../../../../index.js';\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst packageJsonSchema = z\n .object({\n imports: z.record(z.record(z.string())).optional(),\n })\n .passthrough();\n\nconst tsConfigSchema = z\n .object({\n compilerOptions: z\n .object({\n customConditions: z.array(z.string()).optional(),\n rootDir: z.string().optional(),\n paths: z.record(z.unknown()).optional(),\n })\n .passthrough()\n .optional(),\n })\n .passthrough();\n\nconst getRepoName = async (): Promise<string | undefined> => {\n try {\n const dir = process.cwd();\n const { repo } = await Git.getOwnerAndRepo({ dir });\n\n return repo;\n } catch (error) {\n log.warn(`Error getting repository information: ${String(error)}`);\n throw error;\n }\n};\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nexport const replacePackageJson = (contents: string, repoName: string) => {\n try {\n const parseResult = packageJsonSchema.safeParse(JSON.parse(contents));\n\n if (!parseResult.success) {\n log.warn(`Failed to parse package.json: ${parseResult.error.message}`);\n return contents;\n }\n\n const packageJson = parseResult.data;\n\n packageJson.imports = {\n '#src/*': {\n [`@seek/${repoName}/source`]: './src/*',\n default: './lib/*',\n },\n };\n\n return JSON.stringify(packageJson, null, 2);\n } catch (error) {\n log.warn(`Failed to parse package.json as JSON: ${String(error)}`);\n return contents;\n }\n};\n\nexport const replaceTsconfig = (contents: string, repoName: string) => {\n try {\n const parseResult = tsConfigSchema.safeParse(JSON.parse(contents));\n\n if (!parseResult.success) {\n log.warn(`Failed to parse tsconfig.json: ${parseResult.error.message}`);\n return contents;\n }\n\n const tsconfigJson = parseResult.data;\n\n if (\n !tsconfigJson.compilerOptions ||\n typeof tsconfigJson.compilerOptions !== 'object'\n ) {\n tsconfigJson.compilerOptions = {};\n }\n\n const compilerOptions = tsconfigJson.compilerOptions;\n\n if (compilerOptions.paths !== undefined) {\n delete compilerOptions.paths;\n }\n\n compilerOptions.customConditions ??= [];\n\n if (compilerOptions.customConditions.includes(`@seek/${repoName}/source`)) {\n log.subtle(\n 'Custom condition mapping already exists in tsconfig.json, skipping',\n );\n return contents;\n }\n\n compilerOptions.customConditions = [`@seek/${repoName}/source`];\n\n compilerOptions.rootDir ??= '.';\n\n return JSON.stringify(tsconfigJson, null, 2);\n } catch (error) {\n log.warn(`Failed to parse tsconfig.json as JSON: ${String(error)}`);\n return contents;\n }\n};\n\nexport const tryConfigureTsConfigForESM: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const packageJsonPatterns = ['**/package.json', '**/package.*.json'];\n const tsconfigJsonPatterns = ['**/tsconfig.json', '**/tsconfig.*.json'];\n\n const globOptions = {\n ignore: ['**/node_modules/**', '**/tsconfig.build.json'],\n };\n\n const [packageJsonFiles, tsconfigJsonFiles] = await Promise.all([\n fetchFiles(await glob(packageJsonPatterns, globOptions)),\n fetchFiles(await glob(tsconfigJsonPatterns, globOptions)),\n ]);\n\n const repoName = await getRepoName();\n if (!repoName) {\n return { result: 'skip', reason: 'no repository name found' };\n }\n\n const replacedPackageJsonFiles = packageJsonFiles.map(\n ({ file, contents }) => ({\n file,\n before: contents,\n after: replacePackageJson(contents, repoName),\n }),\n );\n\n const replacedTsconfigJsonFiles = tsconfigJsonFiles.map(\n ({ file, contents }) => ({\n file,\n before: contents,\n after: replaceTsconfig(contents, repoName),\n }),\n );\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n [...replacedPackageJsonFiles, ...replacedTsconfigJsonFiles].map(\n async ({ file, after }) => {\n await fs.promises.writeFile(file, after);\n },\n ),\n );\n\n return { result: 'apply' };\n};\n\nexport const configureTsConfigForESM: PatchFunction = async (config) => {\n try {\n return await tryConfigureTsConfigForESM(config);\n } catch (err) {\n log.warn('Failed to write configure `tsconfig.json` and `package.json`');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AACf,iBAAkB;AAElB,eAAoB;AACpB,qBAAoB;AAGpB,MAAM,oBAAoB,aACvB,OAAO;AAAA,EACN,SAAS,aAAE,OAAO,aAAE,OAAO,aAAE,OAAO,CAAC,CAAC,EAAE,SAAS;AACnD,CAAC,EACA,YAAY;AAEf,MAAM,iBAAiB,aACpB,OAAO;AAAA,EACN,iBAAiB,aACd,OAAO;AAAA,IACN,kBAAkB,aAAE,MAAM,aAAE,OAAO,CAAC,EAAE,SAAS;AAAA,IAC/C,SAAS,aAAE,OAAO,EAAE,SAAS;AAAA,IAC7B,OAAO,aAAE,OAAO,aAAE,QAAQ,CAAC,EAAE,SAAS;AAAA,EACxC,CAAC,EACA,YAAY,EACZ,SAAS;AACd,CAAC,EACA,YAAY;AAEf,MAAM,cAAc,YAAyC;AAC3D,MAAI;AACF,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,EAAE,KAAK,IAAI,MAAM,aAAI,gBAAgB,EAAE,IAAI,CAAC;AAElD,WAAO;AAAA,EACT,SAAS,OAAO;AACd,uBAAI,KAAK,yCAAyC,OAAO,KAAK,CAAC,EAAE;AACjE,UAAM;AAAA,EACR;AACF;AAEA,MAAM,aAAa,OAAO,U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C1D,OAAO,EAAE,MAAM,MAAM,MAAM;AACzB,cAAM,gBAAAA,QAAG,SAAS,UAAU,MAAM,KAAK;AAAA,MACzC;AAAA,IACF;AAAA,EACF;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,0BAAyC,OAAO,WAAW;AACtE,MAAI;AACF,WAAO,MAAM,2BAA2B,MAAM;AAAA,EAChD,SAAS,KAAK;AACZ,uBAAI,KAAK,8DAA8D;AACvE,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
6
+ "names": ["fs"]
7
+ }
@@ -0,0 +1,2 @@
1
+ import type { Patches } from '../../index.js';
2
+ export declare const patches: Patches;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var __exports = {};
20
+ __export(__exports, {
21
+ patches: () => patches
22
+ });
23
+ module.exports = __toCommonJS(__exports);
24
+ var import_configureTsConfigForESM = require("./configureTsConfigForESM.js");
25
+ const patches = [
26
+ {
27
+ apply: import_configureTsConfigForESM.configureTsConfigForESM,
28
+ description: "Configure `tsconfig.json` and `package.json` for ESM"
29
+ }
30
+ ];
31
+ // Annotate the CommonJS export names for ESM import in node:
32
+ 0 && (module.exports = {
33
+ patches
34
+ });
35
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.0.2/index.ts"],
4
+ "sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { configureTsConfigForESM } from './configureTsConfigForESM.js';\n\nexport const patches: Patches = [\n {\n apply: configureTsConfigForESM,\n description: 'Configure `tsconfig.json` and `package.json` for ESM',\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qCAAwC;AAEjC,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;",
6
+ "names": []
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skuba",
3
- "version": "12.1.0-hoist-less-20250722131939",
3
+ "version": "13.0.0-custom-conditions-exports-20250729005607",
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,12 @@
13
13
  },
14
14
  "license": "MIT",
15
15
  "sideEffects": false,
16
+ "imports": {
17
+ "#src/*": {
18
+ "@seek/<%- serviceName %>/source": "./src/*",
19
+ "default": "./lib/*"
20
+ }
21
+ },
16
22
  "main": "lib/index.js",
17
23
  "types": "./lib/index.d.ts",
18
24
  "bin": {
@@ -149,7 +155,7 @@
149
155
  "entryPoint": "src/index.ts",
150
156
  "template": null,
151
157
  "type": "package",
152
- "version": "11.1.0"
158
+ "version": "12.0.2"
153
159
  },
154
160
  "scripts": {
155
161
  "build": "scripts/build.sh",
@@ -1 +1 @@
1
- module.exports = require('skuba/config/prettier');
1
+ export { default } from 'skuba/config/prettier.js';
@@ -1 +1 @@
1
- module.exports = require('eslint-config-skuba');
1
+ export { default } from 'eslint-config-skuba';
@@ -1,4 +1,5 @@
1
1
  # managed by skuba
2
+ nodeOptions: '${NODE_OPTIONS:- } --experimental-vm-modules'
2
3
  packageManagerStrictVersion: true
3
4
  publicHoistPattern:
4
5
  - '@types*'
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "compilerOptions": {
3
3
  "baseUrl": ".",
4
+ "customConditions": ["@seek/<%- serviceName %>/source"],
4
5
  "lib": ["ES2024"],
5
6
  "outDir": "lib",
6
- "paths": {
7
- "src": ["src"]
8
- },
7
+ "rootDir": ".",
9
8
  "target": "ES2024"
10
9
  },
11
10
  "exclude": ["lib*/**/*"],
@@ -2,6 +2,12 @@
2
2
  "name": "@seek/<%- serviceName %>",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "imports": {
6
+ "#src/*": {
7
+ "@seek/<%- serviceName %>/source": "./src/*",
8
+ "default": "./lib/*"
9
+ }
10
+ },
5
11
  "scripts": {
6
12
  "build": "skuba build",
7
13
  "format": "skuba format",
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import express from 'express';
4
2
 
5
3
  import { healthCheckHandler } from './api/healthCheck.js';
@@ -1,6 +1,6 @@
1
1
  import createLogger from '@seek/logger';
2
2
 
3
- import { config } from 'src/config.js';
3
+ import { config } from '#src/config.js';
4
4
 
5
5
  export const logger = createLogger({
6
6
  base: {
@@ -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'),
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import app from './app.js';
4
2
  import { config } from './config.js';
5
3
  import { logger } from './framework/logging.js';
@@ -2,6 +2,12 @@
2
2
  "name": "@seek/greeter",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "imports": {
6
+ "#src/*": {
7
+ "@seek/<%- serviceName %>/source": "./src/*",
8
+ "default": "./lib/*"
9
+ }
10
+ },
5
11
  "scripts": {
6
12
  "build": "skuba build",
7
13
  "format": "skuba format",
@@ -17,7 +23,7 @@
17
23
  },
18
24
  "devDependencies": {
19
25
  "@types/node": "^22.13.10",
20
- "skuba": "12.1.0-hoist-less-20250722131939"
26
+ "skuba": "13.0.0-custom-conditions-exports-20250729005607"
21
27
  },
22
28
  "packageManager": "pnpm@10.12.4",
23
29
  "engines": {
@@ -1,4 +1,4 @@
1
- import 'skuba-dive/register';
2
-
3
1
  /* eslint-disable-next-line no-console */
4
2
  console.log('Hello world');
3
+
4
+ export {};
@@ -2,6 +2,12 @@
2
2
  "name": "@seek/<%- serviceName %>",
3
3
  "private": true,
4
4
  "license": "UNLICENSED",
5
+ "imports": {
6
+ "#src/*": {
7
+ "@seek/<%- serviceName %>/source": "./src/*",
8
+ "default": "./lib/*"
9
+ }
10
+ },
5
11
  "scripts": {
6
12
  "build": "skuba build",
7
13
  "format": "skuba format",
@@ -1,4 +1,4 @@
1
- import type { Middleware } from 'src/types/koa.js';
1
+ import type { Middleware } from '#src/types/koa.js';
2
2
 
3
3
  /**
4
4
  * Signifies that the API is available to serve requests.
@@ -1,7 +1,7 @@
1
- import { agentFromRouter } from 'src/testing/server.js';
2
-
3
1
  import { jobRouter } from './index.js';
4
2
 
3
+ import { agentFromRouter } from '#src/testing/server.js';
4
+
5
5
  const agent = agentFromRouter(jobRouter);
6
6
 
7
7
  describe('getJobsHandler', () => {
@@ -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);
@@ -1,8 +1,8 @@
1
- import { agentFromRouter } from 'src/testing/server.js';
2
- import { mockJobInput } from 'src/testing/types.js';
3
-
4
1
  import { jobRouter } from './index.js';
5
2
 
3
+ import { agentFromRouter } from '#src/testing/server.js';
4
+ import { mockJobInput } from '#src/testing/types.js';
5
+
6
6
  const agent = agentFromRouter(jobRouter);
7
7
 
8
8
  describe('postJobHandler', () => {
@@ -1,9 +1,9 @@
1
- import { logger } from 'src/framework/logging.js';
2
- import { metricsClient } from 'src/framework/metrics.js';
3
- import { validateRequestBody } from 'src/framework/validation.js';
4
- import * as storage from 'src/storage/jobs.js';
5
- import { JobInputSchema } from 'src/types/jobs.js';
6
- 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 { validateRequestBody } from '#src/framework/validation.js';
4
+ import * as storage from '#src/storage/jobs.js';
5
+ import { JobInputSchema } from '#src/types/jobs.js';
6
+ import type { Middleware } from '#src/types/koa.js';
7
7
 
8
8
  export const postJobHandler: Middleware = async (ctx) => {
9
9
  const jobInput = validateRequestBody(ctx, JobInputSchema);
@@ -1,5 +1,5 @@
1
- import { smokeTestJobStorage } from 'src/storage/jobs.js';
2
- import type { Middleware } from 'src/types/koa.js';
1
+ import { smokeTestJobStorage } from '#src/storage/jobs.js';
2
+ import type { Middleware } from '#src/types/koa.js';
3
3
 
4
4
  /**
5
5
  * Tests connectivity to ensure appropriate access and network configuration.
@@ -1,7 +1,7 @@
1
- import { agentFromApp } from 'src/testing/server.js';
2
-
3
1
  import app from './app.js';
4
2
 
3
+ import { agentFromApp } from '#src/testing/server.js';
4
+
5
5
  const agent = agentFromApp(app);
6
6
 
7
7
  describe('app', () => {
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import { router } from './api/index.js';
4
2
  import { createApp } from './framework/server.js';
5
3
 
@@ -1,7 +1,7 @@
1
1
  import createLogger, { createDestination } from '@seek/logger';
2
2
  import { RequestLogging } from 'seek-koala';
3
3
 
4
- import { config } from 'src/config.js';
4
+ import { config } from '#src/config.js';
5
5
 
6
6
  const { createContextMiddleware, mixin } =
7
7
  RequestLogging.createContextStorage();
@@ -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'),
@@ -1,12 +1,12 @@
1
1
  import Router from '@koa/router';
2
2
 
3
- import { metricsClient } from 'src/testing/metrics.js';
4
- import { agentFromRouter } from 'src/testing/server.js';
5
- import { chance } from 'src/testing/types.js';
6
- import type { Middleware } from 'src/types/koa.js';
7
-
8
3
  import { stdoutMock } from './logging.js';
9
4
 
5
+ import { metricsClient } from '#src/testing/metrics.js';
6
+ import { agentFromRouter } from '#src/testing/server.js';
7
+ import { chance } from '#src/testing/types.js';
8
+ import type { Middleware } from '#src/types/koa.js';
9
+
10
10
  const middleware = jest.fn<void, Parameters<Middleware>>();
11
11
 
12
12
  const router = new Router()
@@ -8,9 +8,9 @@ import {
8
8
  VersionMiddleware,
9
9
  } from 'seek-koala';
10
10
 
11
- import { config } from 'src/config.js';
12
- import { contextMiddleware, logger } from 'src/framework/logging.js';
13
- import { metricsClient } from 'src/framework/metrics.js';
11
+ import { config } from '#src/config.js';
12
+ import { contextMiddleware, logger } from '#src/framework/logging.js';
13
+ import { metricsClient } from '#src/framework/metrics.js';
14
14
 
15
15
  const metrics = MetricsMiddleware.create(
16
16
  metricsClient,
@@ -1,12 +1,12 @@
1
- import { agentFromMiddleware } from 'src/testing/server.js';
1
+ import { jsonBodyParser } from './bodyParser.js';
2
+ import { validate } from './validation.js';
3
+
4
+ import { agentFromMiddleware } from '#src/testing/server.js';
2
5
  import {
3
6
  IdDescriptionSchema,
4
7
  chance,
5
8
  mockIdDescription,
6
- } from 'src/testing/types.js';
7
-
8
- import { jsonBodyParser } from './bodyParser.js';
9
- import { validate } from './validation.js';
9
+ } from '#src/testing/types.js';
10
10
 
11
11
  const agent = agentFromMiddleware(jsonBodyParser, (ctx) => {
12
12
  const result = validate({
@@ -2,7 +2,7 @@ import { ErrorMiddleware } from 'seek-koala';
2
2
  import type * as z from 'zod/v4';
3
3
  import type * as core from 'zod/v4/core';
4
4
 
5
- import type { Context } from 'src/types/koa.js';
5
+ import type { Context } from '#src/types/koa.js';
6
6
 
7
7
  type InvalidFields = Record<string, string>;
8
8
 
@@ -1,5 +1,3 @@
1
- import './register.js';
2
-
3
1
  import app from './app.js';
4
2
  import { config } from './config.js';
5
3
  import { logger } from './framework/logging.js';
@@ -1,6 +1,6 @@
1
1
  import { randomUUID } from 'crypto';
2
2
 
3
- import type { Job, JobInput } from 'src/types/jobs.js';
3
+ import type { Job, JobInput } from '#src/types/jobs.js';
4
4
 
5
5
  const jobStore: Record<string, Job> = {};
6
6
 
@@ -1,4 +1,4 @@
1
- import * as metrics from 'src/framework/metrics.js';
1
+ import * as metrics from '#src/framework/metrics.js';
2
2
 
3
3
  function assertDefined<T>(value: T | undefined): asserts value is T {
4
4
  expect(value).toBeDefined();
@@ -2,7 +2,7 @@ import type Router from '@koa/router';
2
2
  import type Koa from 'koa';
3
3
  import request from 'supertest';
4
4
 
5
- import { createApp } from 'src/framework/server.js';
5
+ import { createApp } from '#src/framework/server.js';
6
6
 
7
7
  /**
8
8
  * Create a new SuperTest agent from a Koa application.
@@ -1,7 +1,7 @@
1
1
  import { Chance } from 'chance';
2
2
  import * as z from 'zod/v4';
3
3
 
4
- import type { JobInput } from 'src/types/jobs.js';
4
+ import type { JobInput } from '#src/types/jobs.js';
5
5
 
6
6
  export type IdDescription = z.infer<typeof IdDescriptionSchema>;
7
7