skuba 14.0.0 → 14.1.0-bump-zod-20260120225741

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.
@@ -20,8 +20,4 @@ export type PatchConfig = {
20
20
  dir?: string;
21
21
  };
22
22
  export type PatchFunction = (config: PatchConfig) => Promise<PatchReturnType>;
23
- type UpgradeSkubaResult = InternalLintResult & {
24
- upgraded?: boolean;
25
- };
26
- export declare const upgradeSkuba: (mode: "lint" | "format", logger: Logger, additionalFlags?: string[]) => Promise<UpgradeSkubaResult>;
27
- export {};
23
+ export declare const upgradeSkuba: (mode: "lint" | "format", logger: Logger, additionalFlags?: string[]) => Promise<InternalLintResult>;
@@ -175,8 +175,7 @@ const upgradeSkuba = async (mode, logger, additionalFlags = []) => {
175
175
  logger.newline();
176
176
  return {
177
177
  ok: true,
178
- fixable: false,
179
- upgraded: true
178
+ fixable: false
180
179
  };
181
180
  };
182
181
  // Annotate the CommonJS export names for ESM import in node:
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/cli/lint/internalLints/upgrade/index.ts"],
4
- "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport type { ReadResult } from 'read-pkg-up';\nimport { gte, sort } from 'semver';\n\nimport { type Logger, log } from '../../../../utils/logging.js';\nimport { getConsumerManifest } from '../../../../utils/manifest.js';\nimport {\n type PackageManagerConfig,\n detectPackageManager,\n} from '../../../../utils/packageManager.js';\nimport { getSkubaVersion } from '../../../../utils/version.js';\nimport { formatPackage } from '../../../configure/processing/package.js';\nimport type { SkubaPackageJson } from '../../../init/writePackageJson.js';\nimport { getIgnores, shouldCommit } from '../../autofix.js';\nimport type { InternalLintResult } from '../../internal.js';\n\nimport { Git } from '@skuba-lib/api';\n\nexport type Patches = Patch[];\nexport type Patch = {\n apply: PatchFunction;\n description: string;\n};\nexport type PatchReturnType =\n | { result: 'apply' }\n | { result: 'skip'; reason?: string };\n\nexport type PatchConfig = {\n mode: 'format' | 'lint';\n manifest: ReadResult;\n packageManager: PackageManagerConfig;\n dir?: string;\n};\n\nexport type PatchFunction = (config: PatchConfig) => Promise<PatchReturnType>;\n\nconst getPatches = async (\n manifestVersion: string,\n): Promise<Map<string, Patches>> => {\n const patches = await fs.readdir(path.join(__dirname, 'patches'), {\n withFileTypes: true,\n });\n\n // The patches are sorted by the version they were added from.\n // Only return patches that are newer or equal to the current version.\n const patchesForVersion = sort(\n patches.flatMap((patch) =>\n // Is a directory rather than a JavaScript source file\n patch.isDirectory() &&\n // Has been added since the last patch run on the project\n gte(patch.name, manifestVersion)\n ? patch.name\n : [],\n ),\n );\n\n return new Map<string, Patches>(\n await Promise.all(\n patchesForVersion.map(async (version) => {\n const resolved = await resolvePatches(version);\n return [version, resolved] as const;\n }),\n ),\n );\n};\n\nconst fileExtensions = ['js', 'ts'];\n\n// Hack to allow our Jest environment/transform to resolve the patches\n// In normal scenarios this will resolve immediately after the .js import\nconst resolvePatches = async (version: string): Promise<Patches> => {\n for (const extension of fileExtensions) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access\n return (await import(`./patches/${version}/index.${extension}`)).patches;\n } catch {\n // Ignore\n }\n }\n throw new Error(`Could not resolve patches for ${version}`);\n};\n\ntype UpgradeSkubaResult = InternalLintResult & {\n upgraded?: boolean;\n};\n\nexport const upgradeSkuba = async (\n mode: 'lint' | 'format',\n logger: Logger,\n additionalFlags: string[] = [],\n): Promise<UpgradeSkubaResult> => {\n const [currentVersion, manifest, packageManager] = await Promise.all([\n getSkubaVersion(),\n getConsumerManifest(),\n detectPackageManager(),\n ]);\n\n if (!manifest) {\n throw new Error('Could not find a package json for this project');\n }\n\n manifest.packageJson.skuba ??= { version: '1.0.0' };\n\n const manifestVersion = additionalFlags.includes('--force-apply-all-patches')\n ? '1.0.0'\n : (manifest.packageJson.skuba as SkubaPackageJson).version;\n\n // We are up to date, skip patches\n if (gte(manifestVersion, currentVersion)) {\n return { ok: true, fixable: false };\n }\n\n const patches = await getPatches(manifestVersion);\n // No patches to apply even if version out of date. Early exit to avoid unnecessary commits.\n if (patches.size === 0) {\n return { ok: true, fixable: false };\n }\n\n if (mode === 'lint') {\n const allPatches = Array.from(patches.values()).flat();\n const results = await Promise.all(\n allPatches.map(\n async ({ apply }) =>\n await apply({\n mode,\n manifest,\n packageManager,\n }),\n ),\n );\n\n // No patches are applicable. Early exit to avoid unnecessary commits.\n if (results.every(({ result }) => result === 'skip')) {\n return { ok: true, fixable: false };\n }\n\n logger.warn(\n `skuba has patches to apply. Run ${logger.bold(\n `${packageManager.print.exec} skuba format`,\n )} to run them.`,\n );\n\n return {\n ok: false,\n fixable: true,\n annotations: [\n {\n // package.json as likely skuba version has changed\n // TODO: locate the \"skuba\": {} config in the package.json and annotate on the version property\n path: manifest.path,\n message: `skuba has patches to apply. Run ${packageManager.print.exec} skuba format to run them.`,\n },\n ],\n };\n }\n\n logger.plain('Updating skuba...');\n\n const dir = process.cwd();\n let currentBranch;\n try {\n currentBranch = await Git.currentBranch({ dir });\n } catch {}\n\n const shouldCommitChanges = await shouldCommit({ currentBranch, dir });\n\n // Run these in series in case a subsequent patch relies on a previous patch\n for (const version of patches.keys()) {\n const patchesForVersion = patches.get(version);\n if (!patchesForVersion) {\n continue;\n }\n\n for (const { apply, description } of patchesForVersion) {\n const result = await apply({\n mode,\n manifest,\n packageManager,\n });\n logger.newline();\n if (result.result === 'skip') {\n logger.plain(\n `Patch skipped: ${description}${\n result.reason ? ` - ${result.reason}` : ''\n }`,\n );\n } else {\n logger.plain(`Patch applied: ${description}`);\n }\n }\n\n if (shouldCommitChanges) {\n // Only commit changes here, each version should have a separate commit and they should all be pushed together at the end\n const ref = await Git.commitAllChanges({\n dir,\n message: `Apply skuba ${version} patches`,\n\n ignore: await getIgnores(dir),\n });\n\n if (!ref) {\n log.warn('No autofixes detected.');\n return { ok: true, fixable: false };\n }\n }\n }\n\n const updatedManifest = await getConsumerManifest();\n if (!updatedManifest) {\n throw new Error('Could not find a package json for this project');\n }\n\n (updatedManifest.packageJson.skuba as SkubaPackageJson).version =\n currentVersion;\n\n const updatedPackageJson = await formatPackage(updatedManifest.packageJson);\n\n await fs.writeFile(updatedManifest.path, updatedPackageJson);\n logger.newline();\n logger.plain('skuba update complete.');\n logger.newline();\n\n return {\n ok: true,\n fixable: false,\n upgraded: true,\n };\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,oBAA0B;AAE1B,qBAAiC;AACjC,sBAAoC;AACpC,4BAGO;AACP,qBAAgC;AAChC,qBAA8B;AAE9B,qBAAyC;AAGzC,iBAAoB;AAoBpB,MAAM,aAAa,OACjB,oBACkC;AAClC,QAAM,UAAU,MAAM,gBAAAA,QAAG,QAAQ,YAAAC,QAAK,KAAK,WAAW,SAAS,GAAG;AAAA,IAChE,eAAe;AAAA,EACjB,CAAC;AAID,QAAM,wBAAoB;AAAA,IACxB,QAAQ;AAAA,MAAQ,CAAC;AAAA;AAAA,QAEf,MAAM,YAAY;AAAA,YAElB,mBAAI,MAAM,MAAM,eAAe,IAC3B,MAAM,OACN,CAAC;AAAA;AAAA,IACP;AAAA,EACF;AAEA,SAAO,IAAI;AAAA,IACT,MAAM,QAAQ;AAAA,MACZ,kBAAkB,IAAI,OAAO,YAAY;AACvC,cAAM,WAAW,MAAM,eAAe,OAAO;AAC7C,eAAO,CAAC,SAAS,QAAQ;AAAA,MAC3B,CAAC;AAAA,IACH;AAAA,EACF;AACF;AAEA,MAAM,iBAAiB,CAAC,MAAM,IAAI;AAIlC,MAAM,iBAAiB,OAAO,YAAsC;AAClE,aAAW,aAAa,gBAAgB;AACtC,QAAI;AAEF,cAAQ,MAAM,OAAO,aAAa,OAAO,UAAU,SAAS,KAAK;AAAA,IACnE,QAAQ;AAAA,IAER;AAAA,EACF;AACA,QAAM,IAAI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AAc,gBAAgB,WAAW;AAE1E,QAAM,gBAAAD,QAAG,UAAU,gBAAgB,MAAM,kBAAkB;AAC3D,SAAO,QAAQ;AACf,SAAO,MAAM,wBAAwB;AACrC,SAAO,QAAQ;AAEf,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,UAAU;AAAA,EACZ;AACF;",
4
+ "sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport type { ReadResult } from 'read-pkg-up';\nimport { gte, sort } from 'semver';\n\nimport { type Logger, log } from '../../../../utils/logging.js';\nimport { getConsumerManifest } from '../../../../utils/manifest.js';\nimport {\n type PackageManagerConfig,\n detectPackageManager,\n} from '../../../../utils/packageManager.js';\nimport { getSkubaVersion } from '../../../../utils/version.js';\nimport { formatPackage } from '../../../configure/processing/package.js';\nimport type { SkubaPackageJson } from '../../../init/writePackageJson.js';\nimport { getIgnores, shouldCommit } from '../../autofix.js';\nimport type { InternalLintResult } from '../../internal.js';\n\nimport { Git } from '@skuba-lib/api';\n\nexport type Patches = Patch[];\nexport type Patch = {\n apply: PatchFunction;\n description: string;\n};\nexport type PatchReturnType =\n | { result: 'apply' }\n | { result: 'skip'; reason?: string };\n\nexport type PatchConfig = {\n mode: 'format' | 'lint';\n manifest: ReadResult;\n packageManager: PackageManagerConfig;\n dir?: string;\n};\n\nexport type PatchFunction = (config: PatchConfig) => Promise<PatchReturnType>;\n\nconst getPatches = async (\n manifestVersion: string,\n): Promise<Map<string, Patches>> => {\n const patches = await fs.readdir(path.join(__dirname, 'patches'), {\n withFileTypes: true,\n });\n\n // The patches are sorted by the version they were added from.\n // Only return patches that are newer or equal to the current version.\n const patchesForVersion = sort(\n patches.flatMap((patch) =>\n // Is a directory rather than a JavaScript source file\n patch.isDirectory() &&\n // Has been added since the last patch run on the project\n gte(patch.name, manifestVersion)\n ? patch.name\n : [],\n ),\n );\n\n return new Map<string, Patches>(\n await Promise.all(\n patchesForVersion.map(async (version) => {\n const resolved = await resolvePatches(version);\n return [version, resolved] as const;\n }),\n ),\n );\n};\n\nconst fileExtensions = ['js', 'ts'];\n\n// Hack to allow our Jest environment/transform to resolve the patches\n// In normal scenarios this will resolve immediately after the .js import\nconst resolvePatches = async (version: string): Promise<Patches> => {\n for (const extension of fileExtensions) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access\n return (await import(`./patches/${version}/index.${extension}`)).patches;\n } catch {\n // Ignore\n }\n }\n throw new Error(`Could not resolve patches for ${version}`);\n};\n\nexport const upgradeSkuba = async (\n mode: 'lint' | 'format',\n logger: Logger,\n additionalFlags: string[] = [],\n): Promise<InternalLintResult> => {\n const [currentVersion, manifest, packageManager] = await Promise.all([\n getSkubaVersion(),\n getConsumerManifest(),\n detectPackageManager(),\n ]);\n\n if (!manifest) {\n throw new Error('Could not find a package json for this project');\n }\n\n manifest.packageJson.skuba ??= { version: '1.0.0' };\n\n const manifestVersion = additionalFlags.includes('--force-apply-all-patches')\n ? '1.0.0'\n : (manifest.packageJson.skuba as SkubaPackageJson).version;\n\n // We are up to date, skip patches\n if (gte(manifestVersion, currentVersion)) {\n return { ok: true, fixable: false };\n }\n\n const patches = await getPatches(manifestVersion);\n // No patches to apply even if version out of date. Early exit to avoid unnecessary commits.\n if (patches.size === 0) {\n return { ok: true, fixable: false };\n }\n\n if (mode === 'lint') {\n const allPatches = Array.from(patches.values()).flat();\n const results = await Promise.all(\n allPatches.map(\n async ({ apply }) =>\n await apply({\n mode,\n manifest,\n packageManager,\n }),\n ),\n );\n\n // No patches are applicable. Early exit to avoid unnecessary commits.\n if (results.every(({ result }) => result === 'skip')) {\n return { ok: true, fixable: false };\n }\n\n logger.warn(\n `skuba has patches to apply. Run ${logger.bold(\n `${packageManager.print.exec} skuba format`,\n )} to run them.`,\n );\n\n return {\n ok: false,\n fixable: true,\n annotations: [\n {\n // package.json as likely skuba version has changed\n // TODO: locate the \"skuba\": {} config in the package.json and annotate on the version property\n path: manifest.path,\n message: `skuba has patches to apply. Run ${packageManager.print.exec} skuba format to run them.`,\n },\n ],\n };\n }\n\n logger.plain('Updating skuba...');\n\n const dir = process.cwd();\n let currentBranch;\n try {\n currentBranch = await Git.currentBranch({ dir });\n } catch {}\n\n const shouldCommitChanges = await shouldCommit({ currentBranch, dir });\n\n // Run these in series in case a subsequent patch relies on a previous patch\n for (const version of patches.keys()) {\n const patchesForVersion = patches.get(version);\n if (!patchesForVersion) {\n continue;\n }\n\n for (const { apply, description } of patchesForVersion) {\n const result = await apply({\n mode,\n manifest,\n packageManager,\n });\n logger.newline();\n if (result.result === 'skip') {\n logger.plain(\n `Patch skipped: ${description}${\n result.reason ? ` - ${result.reason}` : ''\n }`,\n );\n } else {\n logger.plain(`Patch applied: ${description}`);\n }\n }\n\n if (shouldCommitChanges) {\n // Only commit changes here, each version should have a separate commit and they should all be pushed together at the end\n const ref = await Git.commitAllChanges({\n dir,\n message: `Apply skuba ${version} patches`,\n\n ignore: await getIgnores(dir),\n });\n\n if (!ref) {\n log.warn('No autofixes detected.');\n return { ok: true, fixable: false };\n }\n }\n }\n\n const updatedManifest = await getConsumerManifest();\n if (!updatedManifest) {\n throw new Error('Could not find a package json for this project');\n }\n\n (updatedManifest.packageJson.skuba as SkubaPackageJson).version =\n currentVersion;\n\n const updatedPackageJson = await formatPackage(updatedManifest.packageJson);\n\n await fs.writeFile(updatedManifest.path, updatedPackageJson);\n logger.newline();\n logger.plain('skuba update complete.');\n logger.newline();\n\n return {\n ok: true,\n fixable: false,\n };\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,oBAA0B;AAE1B,qBAAiC;AACjC,sBAAoC;AACpC,4BAGO;AACP,qBAAgC;AAChC,qBAA8B;AAE9B,qBAAyC;AAGzC,iBAAoB;AAoBpB,MAAM,aAAa,OACjB,oBACkC;AAClC,QAAM,UAAU,MAAM,gBAAAA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D,aAAO,QAAQ;AACf,UAAI,OAAO,WAAW,QAAQ;AAC5B,eAAO;AAAA,UACL,kBAAkB,WAAW,GAC3B,OAAO,SAAS,MAAM,OAAO,MAAM,KAAK,EAC1C;AAAA,QACF;AAAA,MACF,OAAO;AACL,eAAO,MAAM,kBAAkB,WAAW,EAAE;AAAA,MAC9C;AAAA,IACF;AAEA,QAAI,qBAAqB;AAEvB,YAAM,MAAM,MAAM,eAAI,iBAAiB;AAAA,QACrC;AAAA,QACA,SAAS,eAAe,OAAO;AAAA,QAE/B,QAAQ,UAAM,2BAAW,GAAG;AAAA,MAC9B,CAAC;AAED,UAAI,CAAC,KAAK;AACR,2BAAI,KAAK,wBAAwB;AACjC,eAAO,EAAE,IAAI,MAAM,SAAS,MAAM;AAAA,MACpC;AAAA,IACF;AAAA,EACF;AAEA,QAAM,kBAAkB,UAAM,qCAAoB;AAClD,MAAI,CAAC,iBAAiB;AACpB,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,EAAC,gBAAgB,YAAY,MAA2B,UACtD;AAEF,QAAM,qBAAqB,UAAM,8BAAc,gBAAgB,WAAW;AAE1E,QAAM,gBAAAD,QAAG,UAAU,gBAAgB,MAAM,kBAAkB;AAC3D,SAAO,QAAQ;AACf,SAAO,MAAM,wBAAwB;AACrC,SAAO,QAAQ;AAEf,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,SAAS;AAAA,EACX;AACF;",
6
6
  "names": ["fs", "path"]
7
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_patchBuildTsconfig = require("./patchBuildTsconfig.js");
25
+ const patches = [
26
+ {
27
+ apply: import_patchBuildTsconfig.tryPatchBuildTsConfig,
28
+ description: "Add 'rootDir' to tsconfig.build.json compilerOptions"
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/14.0.1/index.ts"],
4
+ "sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryPatchBuildTsConfig } from './patchBuildTsconfig.js';\n\nexport const patches: Patches = [\n {\n apply: tryPatchBuildTsConfig,\n description: \"Add 'rootDir' to tsconfig.build.json compilerOptions\",\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,gCAAsC;AAE/B,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { PatchFunction } from '../../index.js';
2
+ export declare const patchBuildConfig: PatchFunction;
3
+ export declare const tryPatchBuildTsConfig: PatchFunction;
@@ -0,0 +1,153 @@
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 patchBuildTsconfig_exports = {};
30
+ __export(patchBuildTsconfig_exports, {
31
+ patchBuildConfig: () => patchBuildConfig,
32
+ tryPatchBuildTsConfig: () => tryPatchBuildTsConfig
33
+ });
34
+ module.exports = __toCommonJS(patchBuildTsconfig_exports);
35
+ var import_util = require("util");
36
+ var import_lang_json = __toESM(require("@ast-grep/lang-json"));
37
+ var import_napi = require("@ast-grep/napi");
38
+ var import_fast_glob = require("fast-glob");
39
+ var import_fs_extra = __toESM(require("fs-extra"));
40
+ var import_logging = require("../../../../../../utils/logging.js");
41
+ const fetchFiles = async (files) => Promise.all(
42
+ files.map(async (file) => {
43
+ const contents = await import_fs_extra.default.promises.readFile(file, "utf8");
44
+ return {
45
+ file,
46
+ contents
47
+ };
48
+ })
49
+ );
50
+ const patchBuildConfig = async ({
51
+ mode
52
+ }) => {
53
+ const tsconfigBuildPaths = await (0, import_fast_glob.glob)(["**/tsconfig.build.json"], {
54
+ ignore: ["**/.git", "**/node_modules"]
55
+ });
56
+ if (tsconfigBuildPaths.length === 0) {
57
+ return {
58
+ result: "skip",
59
+ reason: "no tsconfig.build.json files found"
60
+ };
61
+ }
62
+ (0, import_napi.registerDynamicLanguage)({ json: import_lang_json.default });
63
+ const tsconfigFiles = await fetchFiles(tsconfigBuildPaths);
64
+ const parsedFiles = await Promise.all(
65
+ tsconfigFiles.map(async ({ file, contents }) => {
66
+ const parsed = await (0, import_napi.parseAsync)("json", contents);
67
+ return {
68
+ file,
69
+ ast: parsed.root()
70
+ };
71
+ })
72
+ );
73
+ const updatedFiles = parsedFiles.map(({ ast, file }) => {
74
+ const compilerOptionsObj = ast.find({
75
+ rule: {
76
+ pattern: {
77
+ context: '{"compilerOptions":}',
78
+ selector: "pair"
79
+ }
80
+ }
81
+ });
82
+ if (!compilerOptionsObj) {
83
+ const startingBracket = ast.find({ rule: { pattern: "{" } });
84
+ if (!startingBracket) {
85
+ return void 0;
86
+ }
87
+ const edit2 = startingBracket.replace(
88
+ `{
89
+ "compilerOptions": {
90
+ "rootDir": "./src"
91
+ },`
92
+ );
93
+ const newSource2 = ast.commitEdits([edit2]);
94
+ return {
95
+ updated: newSource2,
96
+ file
97
+ };
98
+ }
99
+ const rootDirOption = compilerOptionsObj.find({
100
+ rule: { pattern: '"rootDir"' }
101
+ });
102
+ if (rootDirOption) {
103
+ return void 0;
104
+ }
105
+ const compilerOptionsStart = compilerOptionsObj.find({
106
+ rule: { pattern: "{" }
107
+ });
108
+ if (!compilerOptionsStart) {
109
+ return void 0;
110
+ }
111
+ const edit = compilerOptionsStart.replace(`{
112
+ "rootDir": "./src",`);
113
+ const newSource = ast.commitEdits([edit]);
114
+ return {
115
+ updated: newSource,
116
+ file
117
+ };
118
+ }).filter((file) => file !== void 0);
119
+ if (updatedFiles.length === 0) {
120
+ return {
121
+ result: "skip",
122
+ reason: "no tsconfig.build.json files to patch"
123
+ };
124
+ }
125
+ if (mode === "lint") {
126
+ return {
127
+ result: "apply"
128
+ };
129
+ }
130
+ await Promise.all(
131
+ updatedFiles.map(
132
+ ({ file, updated }) => import_fs_extra.default.promises.writeFile(file, updated, "utf8")
133
+ )
134
+ );
135
+ return {
136
+ result: "apply"
137
+ };
138
+ };
139
+ const tryPatchBuildTsConfig = async (config) => {
140
+ try {
141
+ return await patchBuildConfig(config);
142
+ } catch (err) {
143
+ import_logging.log.warn("Failed to patch `tsconfig.build.json`");
144
+ import_logging.log.subtle((0, import_util.inspect)(err));
145
+ return { result: "skip", reason: "due to an error" };
146
+ }
147
+ };
148
+ // Annotate the CommonJS export names for ESM import in node:
149
+ 0 && (module.exports = {
150
+ patchBuildConfig,
151
+ tryPatchBuildTsConfig
152
+ });
153
+ //# sourceMappingURL=patchBuildTsconfig.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/14.0.1/patchBuildTsconfig.ts"],
4
+ "sourcesContent": ["import { inspect } from 'util';\n\nimport json from '@ast-grep/lang-json';\nimport { parseAsync, registerDynamicLanguage } from '@ast-grep/napi';\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\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 patchBuildConfig: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const tsconfigBuildPaths = await glob(['**/tsconfig.build.json'], {\n ignore: ['**/.git', '**/node_modules'],\n });\n\n if (tsconfigBuildPaths.length === 0) {\n return {\n result: 'skip',\n reason: 'no tsconfig.build.json files found',\n };\n }\n registerDynamicLanguage({ json });\n\n const tsconfigFiles = await fetchFiles(tsconfigBuildPaths);\n\n const parsedFiles = await Promise.all(\n tsconfigFiles.map(async ({ file, contents }) => {\n const parsed = await parseAsync('json', contents);\n return {\n file,\n ast: parsed.root(),\n };\n }),\n );\n\n const updatedFiles = parsedFiles\n .map(({ ast, file }) => {\n const compilerOptionsObj = ast.find({\n rule: {\n pattern: {\n context: '{\"compilerOptions\":}',\n selector: 'pair',\n },\n },\n });\n\n if (!compilerOptionsObj) {\n const startingBracket = ast.find({ rule: { pattern: '{' } });\n\n if (!startingBracket) {\n return undefined;\n }\n\n const edit = startingBracket.replace(\n `{\n \"compilerOptions\": {\n \"rootDir\": \"./src\"\n },`,\n );\n\n const newSource = ast.commitEdits([edit]);\n\n return {\n updated: newSource,\n file,\n };\n }\n\n const rootDirOption = compilerOptionsObj.find({\n rule: { pattern: '\"rootDir\"' },\n });\n\n if (rootDirOption) {\n return undefined;\n }\n\n const compilerOptionsStart = compilerOptionsObj.find({\n rule: { pattern: '{' },\n });\n\n if (!compilerOptionsStart) {\n return undefined;\n }\n\n const edit = compilerOptionsStart.replace(`{\n \"rootDir\": \"./src\",`);\n\n const newSource = ast.commitEdits([edit]);\n\n return {\n updated: newSource,\n file,\n };\n })\n .filter((file) => file !== undefined);\n\n if (updatedFiles.length === 0) {\n return {\n result: 'skip',\n reason: 'no tsconfig.build.json files to patch',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n updatedFiles.map(({ file, updated }) =>\n fs.promises.writeFile(file, updated, 'utf8'),\n ),\n );\n\n return {\n result: 'apply',\n };\n};\n\nexport const tryPatchBuildTsConfig: PatchFunction = async (config) => {\n try {\n return await patchBuildConfig(config);\n } catch (err) {\n log.warn('Failed to patch `tsconfig.build.json`');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;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QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
6
+ "names": ["fs", "json", "edit", "newSource"]
7
+ }
@@ -31,31 +31,10 @@ __export(test_exports, {
31
31
  test: () => test
32
32
  });
33
33
  module.exports = __toCommonJS(test_exports);
34
- var import_util = require("util");
35
- var import_args = require("../../utils/args.js");
36
- var import_env = require("../../utils/env.js");
37
34
  var import_exec = require("../../utils/exec.js");
38
- var import_logging = require("../../utils/logging.js");
39
- var import_lint = require("../lint/index.js");
40
- var import_upgrade = require("../lint/internalLints/upgrade/index.js");
41
35
  const test = async () => {
42
36
  const argv = process.argv.slice(2);
43
37
  const nodeOptions = process.env.NODE_OPTIONS ?? "";
44
- if ((0, import_env.isCiEnv)()) {
45
- const logger = (0, import_logging.createLogger)({ debug: (0, import_args.hasDebugFlag)(argv) });
46
- try {
47
- const result = await (0, import_upgrade.upgradeSkuba)(
48
- "format",
49
- (0, import_logging.childLogger)(logger, { suffixes: [(0, import_util.styleText)("dim", "upgrade-skuba")] })
50
- );
51
- if (result.upgraded) {
52
- await (0, import_lint.lint)(argv);
53
- }
54
- } catch (error) {
55
- logger.warn("Failed to upgrade skuba before tests.");
56
- logger.subtle((0, import_util.inspect)(error));
57
- }
58
- }
59
38
  const execWithEnv = (0, import_exec.createExec)({
60
39
  env: {
61
40
  NODE_OPTIONS: !nodeOptions.includes("--experimental-vm-modules") ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning` : nodeOptions
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/cli/test/index.ts"],
4
- "sourcesContent": ["import { inspect, styleText } from 'util';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { isCiEnv } from '../../utils/env.js';\nimport { createExec } from '../../utils/exec.js';\nimport { childLogger, createLogger } from '../../utils/logging.js';\nimport { lint } from '../lint/index.js';\nimport { upgradeSkuba } from '../lint/internalLints/upgrade/index.js';\n\nexport const test = async () => {\n const argv = process.argv.slice(2);\n\n const nodeOptions = process.env.NODE_OPTIONS ?? '';\n\n if (isCiEnv()) {\n const logger = createLogger({ debug: hasDebugFlag(argv) });\n\n try {\n const result = await upgradeSkuba(\n 'format',\n childLogger(logger, { suffixes: [styleText('dim', 'upgrade-skuba')] }),\n );\n\n if (result.upgraded) {\n await lint(argv);\n }\n } catch (error) {\n logger.warn('Failed to upgrade skuba before tests.');\n logger.subtle(inspect(error));\n }\n }\n\n const execWithEnv = createExec({\n env: {\n NODE_OPTIONS: !nodeOptions.includes('--experimental-vm-modules')\n ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning`\n : nodeOptions,\n },\n });\n\n // Run Jest in a child process with proper environment\n return execWithEnv(require.resolve('jest/bin/jest'), ...argv);\n};\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAmC;AAEnC,kBAA6B;AAC7B,iBAAwB;AACxB,kBAA2B;AAC3B,qBAA0C;AAC1C,kBAAqB;AACrB,qBAA6B;AAEtB,MAAM,OAAO,YAAY;AAC9B,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,QAAM,cAAc,QAAQ,IAAI,gBAAgB;AAEhD,UAAI,oBAAQ,GAAG;AACb,UAAM,aAAS,6BAAa,EAAE,WAAO,0BAAa,IAAI,EAAE,CAAC;AAEzD,QAAI;AACF,YAAM,SAAS,UAAM;AAAA,QACnB;AAAA,YACA,4BAAY,QAAQ,EAAE,UAAU,KAAC,uBAAU,OAAO,eAAe,CAAC,EAAE,CAAC;AAAA,MACvE;AAEA,UAAI,OAAO,UAAU;AACnB,kBAAM,kBAAK,IAAI;AAAA,MACjB;AAAA,IACF,SAAS,OAAO;AACd,aAAO,KAAK,uCAAuC;AACnD,aAAO,WAAO,qBAAQ,KAAK,CAAC;AAAA,IAC9B;AAAA,EACF;AAEA,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,cAAc,CAAC,YAAY,SAAS,2BAA2B,IAC3D,GAAG,WAAW,iEACd;AAAA,IACN;AAAA,EACF,CAAC;AAGD,SAAO,YAAY,gBAAgB,eAAe,GAAG,GAAG,IAAI;AAC9D;",
4
+ "sourcesContent": ["import { createExec } from '../../utils/exec.js';\n\nexport const test = async () => {\n const argv = process.argv.slice(2);\n\n const nodeOptions = process.env.NODE_OPTIONS ?? '';\n\n const execWithEnv = createExec({\n env: {\n NODE_OPTIONS: !nodeOptions.includes('--experimental-vm-modules')\n ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning`\n : nodeOptions,\n },\n });\n\n // Run Jest in a child process with proper environment\n return execWithEnv(require.resolve('jest/bin/jest'), ...argv);\n};\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAEpB,MAAM,OAAO,YAAY;AAC9B,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,QAAM,cAAc,QAAQ,IAAI,gBAAgB;AAEhD,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,cAAc,CAAC,YAAY,SAAS,2BAA2B,IAC3D,GAAG,WAAW,iEACd;AAAA,IACN;AAAA,EACF,CAAC;AAGD,SAAO,YAAY,gBAAgB,eAAe,GAAG,GAAG,IAAI;AAC9D;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skuba",
3
- "version": "14.0.0",
3
+ "version": "14.1.0-bump-zod-20260120225741",
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",
@@ -67,7 +67,7 @@
67
67
  "@types/jest": "^30.0.0",
68
68
  "@types/node": "^24.10.2",
69
69
  "concurrently": "^9.0.0",
70
- "ejs": "^3.1.6",
70
+ "ejs": "^4.0.0",
71
71
  "esbuild": "~0.27.0",
72
72
  "eslint": "^9.39.1",
73
73
  "execa": "^5.0.0",
@@ -89,7 +89,7 @@
89
89
  "npm-run-path": "^4.0.1",
90
90
  "npm-which": "^3.0.1",
91
91
  "picomatch": "^4.0.0",
92
- "prettier": "~3.7.0",
92
+ "prettier": "~3.8.0",
93
93
  "prettier-plugin-packagejson": "^2.4.10",
94
94
  "read-pkg-up": "^7.0.1",
95
95
  "semantic-release": "^25.0.2",
@@ -101,8 +101,8 @@
101
101
  "tsconfig-seek": "2.0.0",
102
102
  "tsx": "^4.21.0",
103
103
  "typescript": "~5.9.0",
104
- "zod": "^4.0.0",
105
- "@skuba-lib/api": "^2.0.0",
104
+ "zod": "^4.3.5",
105
+ "@skuba-lib/api": "^2.0.1-bump-zod-20260120225741",
106
106
  "eslint-config-skuba": "8.0.0"
107
107
  },
108
108
  "devDependencies": {
@@ -20,17 +20,17 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@opentelemetry/api": "^1.9.0",
23
- "@opentelemetry/core": "~2.2.0",
24
- "@opentelemetry/exporter-trace-otlp-grpc": "~0.208.0",
25
- "@opentelemetry/instrumentation-aws-sdk": "^0.64.0",
26
- "@opentelemetry/instrumentation-http": "~0.208.0",
23
+ "@opentelemetry/core": "~2.4.0",
24
+ "@opentelemetry/exporter-trace-otlp-grpc": "~0.210.0",
25
+ "@opentelemetry/instrumentation-aws-sdk": "^0.65.0",
26
+ "@opentelemetry/instrumentation-http": "~0.210.0",
27
27
  "@opentelemetry/propagator-b3": "^2.0.0",
28
- "@opentelemetry/sdk-node": "~0.208.0",
28
+ "@opentelemetry/sdk-node": "~0.210.0",
29
29
  "@seek/logger": "^11.1.0",
30
30
  "express": "^5.0.0",
31
31
  "hot-shots": "^12.0.0",
32
32
  "seek-datadog-custom-metrics": "^6.0.0",
33
- "skuba-dive": "^3.0.0"
33
+ "skuba-dive": "^4.0.1"
34
34
  },
35
35
  "devDependencies": {
36
36
  "@types/express": "^5.0.0",
@@ -19,11 +19,11 @@
19
19
  "test:watch": "skuba test --watch"
20
20
  },
21
21
  "dependencies": {
22
- "skuba-dive": "^4.0.0"
22
+ "skuba-dive": "^4.0.1"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^22.13.10",
26
- "skuba": "*"
26
+ "skuba": "14.1.0-bump-zod-20260120225741"
27
27
  },
28
28
  "packageManager": "pnpm@10.28.0",
29
29
  "engines": {
@@ -22,20 +22,20 @@
22
22
  "@koa/bodyparser": "^6.0.0",
23
23
  "@koa/router": "15.2.0",
24
24
  "@opentelemetry/api": "^1.9.0",
25
- "@opentelemetry/core": "~2.2.0",
26
- "@opentelemetry/exporter-trace-otlp-grpc": "~0.208.0",
27
- "@opentelemetry/instrumentation-aws-sdk": "^0.64.0",
28
- "@opentelemetry/instrumentation-http": "~0.208.0",
25
+ "@opentelemetry/core": "~2.4.0",
26
+ "@opentelemetry/exporter-trace-otlp-grpc": "~0.210.0",
27
+ "@opentelemetry/instrumentation-aws-sdk": "^0.65.0",
28
+ "@opentelemetry/instrumentation-http": "~0.210.0",
29
29
  "@opentelemetry/propagator-b3": "^2.0.0",
30
- "@opentelemetry/sdk-node": "~0.208.0",
30
+ "@opentelemetry/sdk-node": "~0.210.0",
31
31
  "@seek/logger": "^11.1.0",
32
32
  "hot-shots": "^12.0.0",
33
33
  "koa": "^3.0.1",
34
34
  "koa-compose": "^4.1.0",
35
35
  "seek-datadog-custom-metrics": "^6.0.0",
36
36
  "seek-koala": "^7.1.0",
37
- "skuba-dive": "^3.0.0",
38
- "zod": "^4.0.0"
37
+ "skuba-dive": "^4.0.1",
38
+ "zod": "^4.3.5"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/chance": "^1.1.3",
@@ -19,7 +19,7 @@ import { DatadogLambda } from 'datadog-cdk-constructs-v2';
19
19
  import { config } from './config.js';
20
20
 
21
21
  // Updated by https://github.com/seek-oss/rynovate
22
- const DATADOG_EXTENSION_LAYER_VERSION = 91;
22
+ const DATADOG_EXTENSION_LAYER_VERSION = 92;
23
23
 
24
24
  // Updated by https://github.com/seek-oss/rynovate
25
25
  const DATADOG_NODE_LAYER_VERSION = 126;
@@ -24,8 +24,8 @@
24
24
  "@aws-sdk/client-sns": "^3.363.0",
25
25
  "@seek/aws-codedeploy-hooks": "^2.0.0",
26
26
  "@seek/logger": "^11.1.0",
27
- "skuba-dive": "^4.0.0",
28
- "zod": "^4.0.0"
27
+ "skuba-dive": "^4.0.1",
28
+ "zod": "^4.3.5"
29
29
  },
30
30
  "devDependencies": {
31
31
  "@seek/aws-codedeploy-infra": "^3.0.0",
@@ -42,7 +42,7 @@
42
42
  "datadog-lambda-js": "^12.0.0",
43
43
  "dd-trace": "^5.0.0",
44
44
  "pino-pretty": "^13.0.0",
45
- "skuba": "*"
45
+ "skuba": "14.1.0-bump-zod-20260120225741"
46
46
  },
47
47
  "packageManager": "pnpm@10.28.0",
48
48
  "engines": {