skuba 12.4.0 → 12.4.1-add-ci-true-20250929071745

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.
@@ -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_patchDockerfileCIVariable = require("./patchDockerfileCIVariable.js");
25
+ const patches = [
26
+ {
27
+ apply: import_patchDockerfileCIVariable.tryPatchDockerfileCIVariable,
28
+ description: "Remove Dockerfile syntax directives"
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.4.0/index.ts"],
4
+ "sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryPatchDockerfileCIVariable } from './patchDockerfileCIVariable.js';\n\nexport const patches: Patches = [\n {\n apply: tryPatchDockerfileCIVariable,\n description: 'Remove Dockerfile syntax directives',\n },\n];\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,uCAA6C;AAEtC,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;",
6
+ "names": []
7
+ }
@@ -0,0 +1,3 @@
1
+ import type { PatchFunction, PatchReturnType } from '../../index.js';
2
+ export declare const patchDockerfileCIVariable: (mode: "lint" | "format") => Promise<PatchReturnType>;
3
+ export declare const tryPatchDockerfileCIVariable: PatchFunction;
@@ -0,0 +1,101 @@
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 patchDockerfileCIVariable_exports = {};
30
+ __export(patchDockerfileCIVariable_exports, {
31
+ patchDockerfileCIVariable: () => patchDockerfileCIVariable,
32
+ tryPatchDockerfileCIVariable: () => tryPatchDockerfileCIVariable
33
+ });
34
+ module.exports = __toCommonJS(patchDockerfileCIVariable_exports);
35
+ var import_util = require("util");
36
+ var import_fast_glob = __toESM(require("fast-glob"));
37
+ var import_fs_extra = __toESM(require("fs-extra"));
38
+ var import_logging = require("../../../../../../utils/logging.js");
39
+ const pnpmInstallTestRegex = /^RUN pnpm install.*--prod/m;
40
+ const pnpmInstallReplaceRegex = /^RUN pnpm install.*--prod/gm;
41
+ const patchDockerfileCIVariable = async (mode) => {
42
+ const dockerfilePaths = await (0, import_fast_glob.default)(["**/Dockerfile*"], {
43
+ ignore: ["**/.git", "**/node_modules"]
44
+ });
45
+ if (dockerfilePaths.length === 0) {
46
+ return {
47
+ result: "skip",
48
+ reason: "no dockerfiles found"
49
+ };
50
+ }
51
+ const dockerfiles = await Promise.all(
52
+ dockerfilePaths.map(async (file) => {
53
+ const contents = await import_fs_extra.default.readFile(file, "utf8");
54
+ return {
55
+ file,
56
+ contents
57
+ };
58
+ })
59
+ );
60
+ const dockerfilesToPatch = dockerfiles.filter(
61
+ ({ contents }) => pnpmInstallTestRegex.test(contents)
62
+ );
63
+ if (dockerfilesToPatch.length === 0) {
64
+ return {
65
+ result: "skip",
66
+ reason: "no dockerfiles to patch"
67
+ };
68
+ }
69
+ if (mode === "lint") {
70
+ return {
71
+ result: "apply"
72
+ };
73
+ }
74
+ await Promise.all(
75
+ dockerfilesToPatch.map(async ({ file, contents }) => {
76
+ const updatedContents = contents.replace(
77
+ pnpmInstallReplaceRegex,
78
+ (match) => match.replace("RUN pnpm", "RUN CI=true pnpm")
79
+ );
80
+ await import_fs_extra.default.writeFile(file, updatedContents, "utf8");
81
+ })
82
+ );
83
+ return {
84
+ result: "apply"
85
+ };
86
+ };
87
+ const tryPatchDockerfileCIVariable = async ({ mode }) => {
88
+ try {
89
+ return await patchDockerfileCIVariable(mode);
90
+ } catch (err) {
91
+ import_logging.log.warn("Failed to apply Dockerfile CI variable patch.");
92
+ import_logging.log.subtle((0, import_util.inspect)(err));
93
+ return { result: "skip", reason: "due to an error" };
94
+ }
95
+ };
96
+ // Annotate the CommonJS export names for ESM import in node:
97
+ 0 && (module.exports = {
98
+ patchDockerfileCIVariable,
99
+ tryPatchDockerfileCIVariable
100
+ });
101
+ //# sourceMappingURL=patchDockerfileCIVariable.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/12.4.0/patchDockerfileCIVariable.ts"],
4
+ "sourcesContent": ["import { inspect } from 'util';\n\nimport fg from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst pnpmInstallTestRegex = /^RUN pnpm install.*--prod/m;\nconst pnpmInstallReplaceRegex = /^RUN pnpm install.*--prod/gm;\n\nexport const patchDockerfileCIVariable = async (\n mode: 'lint' | 'format',\n): Promise<PatchReturnType> => {\n const dockerfilePaths = await fg(['**/Dockerfile*'], {\n ignore: ['**/.git', '**/node_modules'],\n });\n\n if (dockerfilePaths.length === 0) {\n return {\n result: 'skip',\n reason: 'no dockerfiles found',\n };\n }\n\n const dockerfiles = await Promise.all(\n dockerfilePaths.map(async (file) => {\n const contents = await fs.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\n const dockerfilesToPatch = dockerfiles.filter(({ contents }) =>\n pnpmInstallTestRegex.test(contents),\n );\n\n if (dockerfilesToPatch.length === 0) {\n return {\n result: 'skip',\n reason: 'no dockerfiles to patch',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n dockerfilesToPatch.map(async ({ file, contents }) => {\n const updatedContents = contents.replace(\n pnpmInstallReplaceRegex,\n (match) => match.replace('RUN pnpm', 'RUN CI=true pnpm'),\n );\n await fs.writeFile(file, updatedContents, 'utf8');\n }),\n );\n\n return {\n result: 'apply',\n };\n};\n\nexport const tryPatchDockerfileCIVariable: PatchFunction = async ({ mode }) => {\n try {\n return await patchDockerfileCIVariable(mode);\n } catch (err) {\n log.warn('Failed to apply Dockerfile CI variable patch.');\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,kBAAwB;AAExB,uBAAe;AACf,sBAAe;AAEf,qBAAoB;AAGpB,MAAM,uBAAuB;AAC7B,MAAM,0BAA0B;AAEzB,MAAM,4BAA4B,OACvC,SAC6B;AAC7B,QAAM,kBAAkB,UAAM,iBAAAA,SAAG,CAAC,gBAAgB,GAAG;AAAA,IACnD,QAAQ,CAAC,WAAW,iBAAiB;AAAA,EACvC,CAAC;AAED,MAAI,gBAAgB,WAAW,GAAG;AAChC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,cAAc,MAAM,QAAQ;AAAA,IAChC,gBAAgB,IAAI,OAAO,SAAS;AAClC,YAAM,WAAW,MAAM,gBAAAC,QAAG,SAAS,MAAM,MAAM;AAE/C,aAAO;AAAA,QACL;AAAA,QACA;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH;AAEA,QAAM,qBAAqB,YAAY;AAAA,IAAO,CAAC,EAAE,SAAS,MACxD,qBAAqB,KAAK,QAAQ;AAAA,EACpC;AAEA,MAAI,mBAAmB,WAAW,GAAG;AACnC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,mBAAmB,IAAI,OAAO,EAAE,MAAM,SAAS,MAAM;AACnD,YAAM,kBAAkB,SAAS;AAAA,QAC/B;AAAA,QACA,CAAC,UAAU,MAAM,QAAQ,YAAY,kBAAkB;AAAA,MACzD;AACA,YAAM,gBAAAA,QAAG,UAAU,MAAM,iBAAiB,MAAM;AAAA,IAClD,CAAC;AAAA,EACH;AAEA,SAAO;AAAA,IACL,QAAQ;AAAA,EACV;AACF;AAEO,MAAM,+BAA8C,OAAO,EAAE,KAAK,MAAM;AAC7E,MAAI;AACF,WAAO,MAAM,0BAA0B,IAAI;AAAA,EAC7C,SAAS,KAAK;AACZ,uBAAI,KAAK,+CAA+C;AACxD,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
6
+ "names": ["fg", "fs"]
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "skuba",
3
- "version": "12.4.0",
3
+ "version": "12.4.1-add-ci-true-20250929071745",
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",
@@ -97,8 +97,8 @@
97
97
  "tsx": "^4.16.2",
98
98
  "typescript": "~5.9.0",
99
99
  "zod": "^4.0.0",
100
- "eslint-config-skuba": "7.1.2",
101
- "@skuba-lib/api": "^1.0.0"
100
+ "@skuba-lib/api": "^1.0.0",
101
+ "eslint-config-skuba": "7.1.2"
102
102
  },
103
103
  "devDependencies": {
104
104
  "@changesets/cli": "2.29.7",
@@ -17,7 +17,7 @@
17
17
  },
18
18
  "devDependencies": {
19
19
  "@types/node": "^22.13.10",
20
- "skuba": "*"
20
+ "skuba": "12.4.1-add-ci-true-20250929071745"
21
21
  },
22
22
  "packageManager": "pnpm@10.17.1",
23
23
  "engines": {
@@ -4,6 +4,8 @@ ARG BASE_IMAGE
4
4
 
5
5
  FROM ${BASE_IMAGE} AS build
6
6
 
7
+ ENV CI=true
8
+
7
9
  COPY . .
8
10
 
9
11
  RUN pnpm install --offline
@@ -35,7 +35,7 @@
35
35
  "datadog-lambda-js": "^12.0.0",
36
36
  "dd-trace": "^5.0.0",
37
37
  "pino-pretty": "^13.0.0",
38
- "skuba": "*"
38
+ "skuba": "12.4.1-add-ci-true-20250929071745"
39
39
  },
40
40
  "packageManager": "pnpm@10.17.1",
41
41
  "engines": {