skuba 9.0.0-renovate-eslint-9.x-20240811060718 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/api/buildkite/annotate.d.ts +2 -0
- package/lib/api/buildkite/annotate.js +14 -1
- package/lib/api/buildkite/annotate.js.map +2 -2
- package/lib/api/github/issueComment.js.map +2 -2
- package/lib/cli/adapter/eslint.js +16 -10
- package/lib/cli/adapter/eslint.js.map +2 -2
- package/lib/cli/build/index.js +1 -0
- package/lib/cli/build/index.js.map +1 -1
- package/lib/cli/configure/analyseDependencies.js +0 -2
- package/lib/cli/configure/analyseDependencies.js.map +2 -2
- package/lib/cli/configure/analysis/package.d.ts +1 -2
- package/lib/cli/configure/analysis/package.js +0 -27
- package/lib/cli/configure/analysis/package.js.map +2 -2
- package/lib/cli/configure/dependencies/skubaDeps.js +4 -3
- package/lib/cli/configure/dependencies/skubaDeps.js.map +2 -2
- package/lib/cli/lint/autofix.js +0 -15
- package/lib/cli/lint/autofix.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js +16 -10
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/collapseDuplicateMergeKeys.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js +15 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js +82 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js +97 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js +141 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +24 -18
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
- package/lib/cli/node.d.ts +2 -1
- package/lib/cli/node.js +23 -18
- package/lib/cli/node.js.map +3 -3
- package/lib/cli/start.js +3 -3
- package/lib/cli/start.js.map +2 -2
- package/lib/utils/template.d.ts +4 -4
- package/lib/wrapper/requestListener.js.map +2 -2
- package/package.json +17 -16
- package/template/express-rest-api/.buildkite/pipeline.yml +3 -3
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +2 -2
- package/template/express-rest-api/package.json +3 -3
- package/template/greeter/.buildkite/pipeline.yml +3 -3
- package/template/greeter/Dockerfile +2 -2
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +3 -3
- package/template/koa-rest-api/Dockerfile +1 -1
- package/template/koa-rest-api/Dockerfile.dev-deps +2 -2
- package/template/koa-rest-api/package.json +10 -10
- package/template/koa-rest-api/src/framework/bodyParser.ts +1 -1
- package/template/koa-rest-api/src/framework/server.test.ts +0 -1
- package/template/koa-rest-api/src/framework/server.ts +3 -5
- package/template/lambda-sqs-worker/.buildkite/pipeline.yml +4 -4
- package/template/lambda-sqs-worker/Dockerfile +2 -2
- package/template/lambda-sqs-worker/package.json +4 -4
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +4 -4
- package/template/lambda-sqs-worker-cdk/Dockerfile +2 -2
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +447 -891
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +4 -1
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +5 -84
- package/template/lambda-sqs-worker-cdk/infra/config.ts +1 -1
- package/template/lambda-sqs-worker-cdk/infra/index.ts +20 -3
- package/template/lambda-sqs-worker-cdk/package.json +5 -4
- package/template/oss-npm-package/.github/workflows/release.yml +1 -1
- package/template/oss-npm-package/_package.json +1 -1
- package/template/private-npm-package/_package.json +1 -1
- package/template/lambda-sqs-worker-cdk/src/postHook.ts +0 -154
- package/template/lambda-sqs-worker-cdk/src/preHook.ts +0 -95
|
@@ -0,0 +1,82 @@
|
|
|
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 moveNpmrcMounts_exports = {};
|
|
20
|
+
__export(moveNpmrcMounts_exports, {
|
|
21
|
+
tryMoveNpmrcMounts: () => tryMoveNpmrcMounts
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(moveNpmrcMounts_exports);
|
|
24
|
+
var import_util = require("util");
|
|
25
|
+
var import_fast_glob = require("fast-glob");
|
|
26
|
+
var import_fs_extra = require("fs-extra");
|
|
27
|
+
var import_logging = require("../../../../../../utils/logging");
|
|
28
|
+
const moveNpmrcMounts = async ({
|
|
29
|
+
mode
|
|
30
|
+
}) => {
|
|
31
|
+
const buildkiteFiles = await (0, import_fast_glob.glob)(
|
|
32
|
+
["{apps/*/,packages/*/,./}.buildkite/**/*.y*ml"],
|
|
33
|
+
{ onlyFiles: true }
|
|
34
|
+
);
|
|
35
|
+
if (buildkiteFiles.length === 0) {
|
|
36
|
+
return { result: "skip", reason: "no Buildkite files found" };
|
|
37
|
+
}
|
|
38
|
+
const input = await Promise.all(
|
|
39
|
+
buildkiteFiles.map((name) => import_fs_extra.promises.readFile(name, "utf-8"))
|
|
40
|
+
);
|
|
41
|
+
const replaced = input.map(moveNpmrcMountsInFile);
|
|
42
|
+
if (replaced.every((r, i) => r === input[i])) {
|
|
43
|
+
return {
|
|
44
|
+
result: "skip",
|
|
45
|
+
reason: "no .npmrc mounts found need to be updated"
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
if (mode === "lint") {
|
|
49
|
+
return { result: "apply" };
|
|
50
|
+
}
|
|
51
|
+
await Promise.all(
|
|
52
|
+
buildkiteFiles.flatMap(
|
|
53
|
+
(name, i) => (
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
55
|
+
replaced[i] !== input[i] ? [import_fs_extra.promises.writeFile(name, replaced[i])] : []
|
|
56
|
+
)
|
|
57
|
+
)
|
|
58
|
+
);
|
|
59
|
+
return { result: "apply" };
|
|
60
|
+
};
|
|
61
|
+
const secret = /^(\s*)secrets: id=npm,src=tmp\/\.npmrc(\s*#?.*)$/gm;
|
|
62
|
+
const outputPath = /^(\s*)output-path: tmp\/(\s*#?.*)$/gm;
|
|
63
|
+
const moveNpmrcMountsInFile = (input) => {
|
|
64
|
+
if (!secret.test(input) || !outputPath.test(input)) {
|
|
65
|
+
return input;
|
|
66
|
+
}
|
|
67
|
+
return input.replaceAll(secret, "$1secrets: id=npm,src=/tmp/.npmrc$2").replaceAll(outputPath, "$1output-path: /tmp/$2");
|
|
68
|
+
};
|
|
69
|
+
const tryMoveNpmrcMounts = async (config) => {
|
|
70
|
+
try {
|
|
71
|
+
return await moveNpmrcMounts(config);
|
|
72
|
+
} catch (err) {
|
|
73
|
+
import_logging.log.warn("Failed to move .npmrc mounts");
|
|
74
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
75
|
+
return { result: "skip", reason: "due to an error" };
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
79
|
+
0 && (module.exports = {
|
|
80
|
+
tryMoveNpmrcMounts
|
|
81
|
+
});
|
|
82
|
+
//# sourceMappingURL=moveNpmrcMounts.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.2.1/moveNpmrcMounts.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport { promises as fs } from 'fs-extra';\n\nimport type { PatchFunction, PatchReturnType } from '../..';\nimport { log } from '../../../../../../utils/logging';\n\nconst moveNpmrcMounts: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const buildkiteFiles = await glob(\n ['{apps/*/,packages/*/,./}.buildkite/**/*.y*ml'],\n { onlyFiles: true },\n );\n\n if (buildkiteFiles.length === 0) {\n return { result: 'skip', reason: 'no Buildkite files found' };\n }\n\n const input = await Promise.all(\n buildkiteFiles.map((name) => fs.readFile(name, 'utf-8')),\n );\n\n const replaced = input.map(moveNpmrcMountsInFile);\n\n if (replaced.every((r, i) => r === input[i])) {\n return {\n result: 'skip',\n reason: 'no .npmrc mounts found need to be updated',\n };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n await Promise.all(\n buildkiteFiles.flatMap((name, i) =>\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n replaced[i] !== input[i] ? [fs.writeFile(name, replaced[i]!)] : [],\n ),\n );\n\n return { result: 'apply' };\n};\n\nconst secret = /^(\\s*)secrets: id=npm,src=tmp\\/\\.npmrc(\\s*#?.*)$/gm;\nconst outputPath = /^(\\s*)output-path: tmp\\/(\\s*#?.*)$/gm;\n\nconst moveNpmrcMountsInFile = (input: string) => {\n if (!secret.test(input) || !outputPath.test(input)) {\n return input;\n }\n\n return input\n .replaceAll(secret, '$1secrets: id=npm,src=/tmp/.npmrc$2')\n .replaceAll(outputPath, '$1output-path: /tmp/$2');\n};\n\nexport const tryMoveNpmrcMounts: PatchFunction = async (config) => {\n try {\n return await moveNpmrcMounts(config);\n } catch (err) {\n log.warn('Failed to move .npmrc mounts');\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,kBAAwB;AAExB,uBAAqB;AACrB,sBAA+B;AAG/B,qBAAoB;AAEpB,MAAM,kBAAiC,OAAO;AAAA,EAC5C;AACF,MAAgC;AAC9B,QAAM,iBAAiB,UAAM;AAAA,IAC3B,CAAC,8CAA8C;AAAA,IAC/C,EAAE,WAAW,KAAK;AAAA,EACpB;AAEA,MAAI,eAAe,WAAW,GAAG;AAC/B,WAAO,EAAE,QAAQ,QAAQ,QAAQ,2BAA2B;AAAA,EAC9D;AAEA,QAAM,QAAQ,MAAM,QAAQ;AAAA,IAC1B,eAAe,IAAI,CAAC,SAAS,gBAAAA,SAAG,SAAS,MAAM,OAAO,CAAC;AAAA,EACzD;AAEA,QAAM,WAAW,MAAM,IAAI,qBAAqB;AAEhD,MAAI,SAAS,MAAM,CAAC,GAAG,MAAM,MAAM,MAAM,CAAC,CAAC,GAAG;AAC5C,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,QAAM,QAAQ;AAAA,IACZ,eAAe;AAAA,MAAQ,CAAC,MAAM;AAAA;AAAA,QAE5B,SAAS,CAAC,MAAM,MAAM,CAAC,IAAI,CAAC,gBAAAA,SAAG,UAAU,MAAM,SAAS,CAAC,CAAE,CAAC,IAAI,CAAC;AAAA;AAAA,IACnE;AAAA,EACF;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEA,MAAM,SAAS;AACf,MAAM,aAAa;AAEnB,MAAM,wBAAwB,CAAC,UAAkB;AAC/C,MAAI,CAAC,OAAO,KAAK,KAAK,KAAK,CAAC,WAAW,KAAK,KAAK,GAAG;AAClD,WAAO;AAAA,EACT;AAEA,SAAO,MACJ,WAAW,QAAQ,qCAAqC,EACxD,WAAW,YAAY,wBAAwB;AACpD;AAEO,MAAM,qBAAoC,OAAO,WAAW;AACjE,MAAI;AACF,WAAO,MAAM,gBAAgB,MAAM;AAAA,EACrC,SAAS,KAAK;AACZ,uBAAI,KAAK,8BAA8B;AACvC,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": ["fs"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
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 patchDockerCompose_exports = {};
|
|
30
|
+
__export(patchDockerCompose_exports, {
|
|
31
|
+
tryPatchDockerComposeFiles: () => tryPatchDockerComposeFiles
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(patchDockerCompose_exports);
|
|
34
|
+
var import_util = require("util");
|
|
35
|
+
var import_fast_glob = __toESM(require("fast-glob"));
|
|
36
|
+
var import_fs_extra = require("fs-extra");
|
|
37
|
+
var import_logging = require("../../../../../../utils/logging");
|
|
38
|
+
const DOCKER_COMPOSE_VERSION_REGEX = /^version: ['"]?\d+(\.\d+)*['"]?\n*/m;
|
|
39
|
+
const fetchFiles = async (files) => Promise.all(
|
|
40
|
+
files.map(async (file) => {
|
|
41
|
+
const contents = await (0, import_fs_extra.readFile)(file, "utf8");
|
|
42
|
+
return {
|
|
43
|
+
file,
|
|
44
|
+
contents
|
|
45
|
+
};
|
|
46
|
+
})
|
|
47
|
+
);
|
|
48
|
+
const patchDockerComposeFiles = async ({
|
|
49
|
+
mode
|
|
50
|
+
}) => {
|
|
51
|
+
const maybeDockerComposeFiles = await (0, import_fast_glob.default)(["docker-compose*.yml"]);
|
|
52
|
+
if (!maybeDockerComposeFiles.length) {
|
|
53
|
+
return {
|
|
54
|
+
result: "skip",
|
|
55
|
+
reason: "no docker-compose files found"
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
const dockerComposeFiles = await fetchFiles(maybeDockerComposeFiles);
|
|
59
|
+
const dockerComposeFilesToPatch = dockerComposeFiles.filter(
|
|
60
|
+
({ contents }) => DOCKER_COMPOSE_VERSION_REGEX.exec(contents)
|
|
61
|
+
);
|
|
62
|
+
if (!dockerComposeFilesToPatch.length) {
|
|
63
|
+
return {
|
|
64
|
+
result: "skip",
|
|
65
|
+
reason: "no docker-compose files to patch"
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (mode === "lint") {
|
|
69
|
+
return {
|
|
70
|
+
result: "apply"
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
await Promise.all(
|
|
74
|
+
dockerComposeFilesToPatch.map(async ({ file, contents }) => {
|
|
75
|
+
const patchedContents = contents.replace(
|
|
76
|
+
DOCKER_COMPOSE_VERSION_REGEX,
|
|
77
|
+
""
|
|
78
|
+
);
|
|
79
|
+
await (0, import_fs_extra.writeFile)(file, patchedContents);
|
|
80
|
+
})
|
|
81
|
+
);
|
|
82
|
+
return { result: "apply" };
|
|
83
|
+
};
|
|
84
|
+
const tryPatchDockerComposeFiles = async (config) => {
|
|
85
|
+
try {
|
|
86
|
+
return await patchDockerComposeFiles(config);
|
|
87
|
+
} catch (err) {
|
|
88
|
+
import_logging.log.warn("Failed to patch pnpm packageManager CI configuration.");
|
|
89
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
90
|
+
return { result: "skip", reason: "due to an error" };
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
94
|
+
0 && (module.exports = {
|
|
95
|
+
tryPatchDockerComposeFiles
|
|
96
|
+
});
|
|
97
|
+
//# sourceMappingURL=patchDockerCompose.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerCompose.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport fg from 'fast-glob';\nimport { readFile, writeFile } from 'fs-extra';\n\nimport type { PatchFunction, PatchReturnType } from '../..';\nimport { log } from '../../../../../../utils/logging';\n\nconst DOCKER_COMPOSE_VERSION_REGEX = /^version: ['\"]?\\d+(\\.\\d+)*['\"]?\\n*/m;\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nconst patchDockerComposeFiles: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const maybeDockerComposeFiles = await fg(['docker-compose*.yml']);\n\n if (!maybeDockerComposeFiles.length) {\n return {\n result: 'skip',\n reason: 'no docker-compose files found',\n };\n }\n\n const dockerComposeFiles = await fetchFiles(maybeDockerComposeFiles);\n\n const dockerComposeFilesToPatch = dockerComposeFiles.filter(({ contents }) =>\n DOCKER_COMPOSE_VERSION_REGEX.exec(contents),\n );\n\n if (!dockerComposeFilesToPatch.length) {\n return {\n result: 'skip',\n reason: 'no docker-compose files to patch',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n dockerComposeFilesToPatch.map(async ({ file, contents }) => {\n const patchedContents = contents.replace(\n DOCKER_COMPOSE_VERSION_REGEX,\n '',\n );\n await writeFile(file, patchedContents);\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const tryPatchDockerComposeFiles: PatchFunction = async (config) => {\n try {\n return await patchDockerComposeFiles(config);\n } catch (err) {\n log.warn('Failed to patch pnpm packageManager CI configuration.');\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,kBAAwB;AAExB,uBAAe;AACf,sBAAoC;AAGpC,qBAAoB;AAEpB,MAAM,+BAA+B;AAErC,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,UAAM,0BAAS,MAAM,MAAM;AAE5C,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEF,MAAM,0BAAyC,OAAO;AAAA,EACpD;AACF,MAAgC;AAC9B,QAAM,0BAA0B,UAAM,iBAAAA,SAAG,CAAC,qBAAqB,CAAC;AAEhE,MAAI,CAAC,wBAAwB,QAAQ;AACnC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,qBAAqB,MAAM,WAAW,uBAAuB;AAEnE,QAAM,4BAA4B,mBAAmB;AAAA,IAAO,CAAC,EAAE,SAAS,MACtE,6BAA6B,KAAK,QAAQ;AAAA,EAC5C;AAEA,MAAI,CAAC,0BAA0B,QAAQ;AACrC,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,0BAA0B,IAAI,OAAO,EAAE,MAAM,SAAS,MAAM;AAC1D,YAAM,kBAAkB,SAAS;AAAA,QAC/B;AAAA,QACA;AAAA,MACF;AACA,gBAAM,2BAAU,MAAM,eAAe;AAAA,IACvC,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,6BAA4C,OAAO,WAAW;AACzE,MAAI;AACF,WAAO,MAAM,wBAAwB,MAAM;AAAA,EAC7C,SAAS,KAAK;AACZ,uBAAI,KAAK,uDAAuD;AAChE,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": ["fg"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
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 patchDockerImages_exports = {};
|
|
30
|
+
__export(patchDockerImages_exports, {
|
|
31
|
+
tryPatchDockerImages: () => tryPatchDockerImages
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(patchDockerImages_exports);
|
|
34
|
+
var import_util = require("util");
|
|
35
|
+
var import_fast_glob = __toESM(require("fast-glob"));
|
|
36
|
+
var import_fs_extra = require("fs-extra");
|
|
37
|
+
var import_logging = require("../../../../../../utils/logging");
|
|
38
|
+
const DOCKER_IMAGE_REGEX = /^(FROM\s?.*)(\s)(node|python)(:.*)/gm;
|
|
39
|
+
const DOCKER_IMAGE_PLATFORM_REGEX = /^(FROM\s?.*)(--platform=[^\s]+) /gm;
|
|
40
|
+
const DOCKER_COMPOSE_IMAGE_REGEX = /^(\s+image:\s)(node|python)(:.*)/gm;
|
|
41
|
+
const PUBLIC_ECR = "public.ecr.aws/docker/library/";
|
|
42
|
+
const fetchFiles = async (files) => Promise.all(
|
|
43
|
+
files.map(async (file) => {
|
|
44
|
+
const contents = await (0, import_fs_extra.readFile)(file, "utf8");
|
|
45
|
+
return {
|
|
46
|
+
file,
|
|
47
|
+
contents
|
|
48
|
+
};
|
|
49
|
+
})
|
|
50
|
+
);
|
|
51
|
+
const isInvalidPlatformFlagUsage = (contents) => {
|
|
52
|
+
const matches = [...contents.matchAll(DOCKER_IMAGE_PLATFORM_REGEX)];
|
|
53
|
+
if (!matches.length) {
|
|
54
|
+
return false;
|
|
55
|
+
}
|
|
56
|
+
const uniquePlatforms = [
|
|
57
|
+
...new Set(matches.map(([, , platform]) => platform))
|
|
58
|
+
];
|
|
59
|
+
if (uniquePlatforms.length > 1) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
if (uniquePlatforms[0]?.startsWith("--platform=$")) {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
65
|
+
return true;
|
|
66
|
+
};
|
|
67
|
+
const patchDockerImages = async ({
|
|
68
|
+
mode
|
|
69
|
+
}) => {
|
|
70
|
+
const [maybeDockerFilesPaths, maybeDockerComposePaths] = await Promise.all([
|
|
71
|
+
(0, import_fast_glob.default)(["Dockerfile*"]),
|
|
72
|
+
(0, import_fast_glob.default)(["docker-compose*.y*ml"])
|
|
73
|
+
]);
|
|
74
|
+
if (!maybeDockerFilesPaths.length && !maybeDockerComposePaths.length) {
|
|
75
|
+
return {
|
|
76
|
+
result: "skip",
|
|
77
|
+
reason: "no Dockerfile or docker-compose files found"
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
const [dockerFiles, dockerComposeFiles] = await Promise.all([
|
|
81
|
+
fetchFiles(maybeDockerFilesPaths),
|
|
82
|
+
fetchFiles(maybeDockerComposePaths)
|
|
83
|
+
]);
|
|
84
|
+
const dockerFilesToPatch = dockerFiles.filter(
|
|
85
|
+
({ contents }) => DOCKER_IMAGE_REGEX.exec(contents) ?? isInvalidPlatformFlagUsage(contents)
|
|
86
|
+
);
|
|
87
|
+
const dockerComposeFilesToPatch = dockerComposeFiles.filter(
|
|
88
|
+
({ contents }) => DOCKER_COMPOSE_IMAGE_REGEX.exec(contents)
|
|
89
|
+
);
|
|
90
|
+
if (!dockerFilesToPatch.length && !dockerComposeFilesToPatch.length) {
|
|
91
|
+
return {
|
|
92
|
+
result: "skip",
|
|
93
|
+
reason: "no Dockerfile or docker-compose files to patch"
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
if (mode === "lint") {
|
|
97
|
+
return {
|
|
98
|
+
result: "apply"
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
const dockerFilePatches = dockerFilesToPatch.map(
|
|
102
|
+
async ({ file, contents }) => {
|
|
103
|
+
let patchedContents = contents.replace(
|
|
104
|
+
DOCKER_IMAGE_REGEX,
|
|
105
|
+
`$1$2${PUBLIC_ECR}$3$4`
|
|
106
|
+
);
|
|
107
|
+
if (isInvalidPlatformFlagUsage(contents)) {
|
|
108
|
+
patchedContents = patchedContents.replace(
|
|
109
|
+
DOCKER_IMAGE_PLATFORM_REGEX,
|
|
110
|
+
"$1"
|
|
111
|
+
);
|
|
112
|
+
}
|
|
113
|
+
await (0, import_fs_extra.writeFile)(file, patchedContents);
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
const dockerComposeFilePatches = dockerComposeFilesToPatch.map(
|
|
117
|
+
async ({ file, contents }) => {
|
|
118
|
+
const patchedContents = contents.replace(
|
|
119
|
+
DOCKER_COMPOSE_IMAGE_REGEX,
|
|
120
|
+
`$1${PUBLIC_ECR}$2$3`
|
|
121
|
+
);
|
|
122
|
+
await (0, import_fs_extra.writeFile)(file, patchedContents);
|
|
123
|
+
}
|
|
124
|
+
);
|
|
125
|
+
await Promise.all([...dockerFilePatches, ...dockerComposeFilePatches]);
|
|
126
|
+
return { result: "apply" };
|
|
127
|
+
};
|
|
128
|
+
const tryPatchDockerImages = async (config) => {
|
|
129
|
+
try {
|
|
130
|
+
return await patchDockerImages(config);
|
|
131
|
+
} catch (err) {
|
|
132
|
+
import_logging.log.warn("Failed to patch Docker images");
|
|
133
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
134
|
+
return { result: "skip", reason: "due to an error" };
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
138
|
+
0 && (module.exports = {
|
|
139
|
+
tryPatchDockerImages
|
|
140
|
+
});
|
|
141
|
+
//# sourceMappingURL=patchDockerImages.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.2.1/patchDockerImages.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport fg from 'fast-glob';\nimport { readFile, writeFile } from 'fs-extra';\n\nimport type { PatchFunction, PatchReturnType } from '../..';\nimport { log } from '../../../../../../utils/logging';\n\nconst DOCKER_IMAGE_REGEX = /^(FROM\\s?.*)(\\s)(node|python)(:.*)/gm;\nconst DOCKER_IMAGE_PLATFORM_REGEX = /^(FROM\\s?.*)(--platform=[^\\s]+) /gm;\nconst DOCKER_COMPOSE_IMAGE_REGEX = /^(\\s+image:\\s)(node|python)(:.*)/gm;\nconst PUBLIC_ECR = 'public.ecr.aws/docker/library/';\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nconst isInvalidPlatformFlagUsage = (contents: string) => {\n const matches = [...contents.matchAll(DOCKER_IMAGE_PLATFORM_REGEX)];\n\n if (!matches.length) {\n return false;\n }\n\n const uniquePlatforms = [\n ...new Set(matches.map(([, , platform]) => platform as string)),\n ];\n\n // Multiple --platform flags are used which may indicate a multi arch build\n if (uniquePlatforms.length > 1) {\n return false;\n }\n\n // Avoid patching as they may be using args to set the platform\n if (uniquePlatforms[0]?.startsWith('--platform=$')) {\n return false;\n }\n\n return true;\n};\n\nconst patchDockerImages: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const [maybeDockerFilesPaths, maybeDockerComposePaths] = await Promise.all([\n fg(['Dockerfile*']),\n fg(['docker-compose*.y*ml']),\n ]);\n\n if (!maybeDockerFilesPaths.length && !maybeDockerComposePaths.length) {\n return {\n result: 'skip',\n reason: 'no Dockerfile or docker-compose files found',\n };\n }\n\n const [dockerFiles, dockerComposeFiles] = await Promise.all([\n fetchFiles(maybeDockerFilesPaths),\n fetchFiles(maybeDockerComposePaths),\n ]);\n\n const dockerFilesToPatch = dockerFiles.filter(\n ({ contents }) =>\n DOCKER_IMAGE_REGEX.exec(contents) ?? isInvalidPlatformFlagUsage(contents),\n );\n\n const dockerComposeFilesToPatch = dockerComposeFiles.filter(({ contents }) =>\n DOCKER_COMPOSE_IMAGE_REGEX.exec(contents),\n );\n\n if (!dockerFilesToPatch.length && !dockerComposeFilesToPatch.length) {\n return {\n result: 'skip',\n reason: 'no Dockerfile or docker-compose files to patch',\n };\n }\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n const dockerFilePatches = dockerFilesToPatch.map(\n async ({ file, contents }) => {\n let patchedContents = contents.replace(\n DOCKER_IMAGE_REGEX,\n `$1$2${PUBLIC_ECR}$3$4`,\n );\n\n if (isInvalidPlatformFlagUsage(contents)) {\n patchedContents = patchedContents.replace(\n DOCKER_IMAGE_PLATFORM_REGEX,\n '$1',\n );\n }\n\n await writeFile(file, patchedContents);\n },\n );\n\n const dockerComposeFilePatches = dockerComposeFilesToPatch.map(\n async ({ file, contents }) => {\n const patchedContents = contents.replace(\n DOCKER_COMPOSE_IMAGE_REGEX,\n `$1${PUBLIC_ECR}$2$3`,\n );\n await writeFile(file, patchedContents);\n },\n );\n\n await Promise.all([...dockerFilePatches, ...dockerComposeFilePatches]);\n\n return { result: 'apply' };\n};\n\nexport const tryPatchDockerImages: PatchFunction = async (config) => {\n try {\n return await patchDockerImages(config);\n } catch (err) {\n log.warn('Failed to patch Docker images');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["fg"]
|
|
7
|
+
}
|
|
@@ -40,52 +40,56 @@ var import_logging = require("../../../../../../utils/logging");
|
|
|
40
40
|
var import_project = require("../../../../../configure/analysis/project");
|
|
41
41
|
var import_configFile = require("../../../../../configure/processing/configFile");
|
|
42
42
|
var import_prettier = require("../../../../../configure/processing/prettier");
|
|
43
|
+
const IGNORE_FILE = ".eslintignore";
|
|
44
|
+
const OLD_CONFIG_FILE = ".eslintrc.js";
|
|
45
|
+
const NEW_CONFIG_FILE_CJS = "eslint.config.cjs";
|
|
46
|
+
const NEW_CONFIG_FILE_JS = "eslint.config.js";
|
|
43
47
|
const upgradeESLint = async ({
|
|
44
48
|
mode,
|
|
45
49
|
dir: cwd = process.cwd()
|
|
46
50
|
}) => {
|
|
47
51
|
const readFile = (0, import_project.createDestinationFileReader)(cwd);
|
|
48
|
-
const [
|
|
49
|
-
readFile(
|
|
50
|
-
readFile(
|
|
52
|
+
const [ignoreFileContents, oldConfig] = await Promise.all([
|
|
53
|
+
readFile(IGNORE_FILE),
|
|
54
|
+
readFile(OLD_CONFIG_FILE)
|
|
51
55
|
]);
|
|
52
|
-
if (
|
|
56
|
+
if (oldConfig === void 0) {
|
|
53
57
|
return {
|
|
54
58
|
result: "skip",
|
|
55
|
-
reason:
|
|
59
|
+
reason: `no ${OLD_CONFIG_FILE} - have you already migrated?`
|
|
56
60
|
};
|
|
57
61
|
}
|
|
58
62
|
if (mode === "lint") {
|
|
59
63
|
return { result: "apply" };
|
|
60
64
|
}
|
|
61
|
-
const
|
|
65
|
+
const ignoreContentsWithoutSkubaManaged = (0, import_configFile.mergeWithConfigFile)(
|
|
62
66
|
"",
|
|
63
67
|
"ignore"
|
|
64
|
-
)(
|
|
68
|
+
)(ignoreFileContents);
|
|
65
69
|
const exec = (0, import_exec.createExec)({
|
|
66
70
|
cwd: process.cwd(),
|
|
67
71
|
stdio: "ignore"
|
|
68
72
|
});
|
|
69
73
|
const dir = await writeTemporaryFiles({
|
|
70
|
-
|
|
71
|
-
...
|
|
74
|
+
[OLD_CONFIG_FILE]: oldConfig,
|
|
75
|
+
...ignoreContentsWithoutSkubaManaged.trim().length > 0 ? { [IGNORE_FILE]: ignoreContentsWithoutSkubaManaged } : {}
|
|
72
76
|
});
|
|
73
77
|
try {
|
|
74
78
|
await exec(
|
|
75
79
|
"eslint-migrate-config",
|
|
76
|
-
import_path.default.join(dir,
|
|
80
|
+
import_path.default.join(dir, OLD_CONFIG_FILE),
|
|
77
81
|
"--commonjs"
|
|
78
82
|
);
|
|
79
83
|
const output = fiddleWithOutput(
|
|
80
|
-
await fsp.readFile(import_path.default.join(dir,
|
|
84
|
+
await fsp.readFile(import_path.default.join(dir, NEW_CONFIG_FILE_CJS), "utf-8")
|
|
81
85
|
);
|
|
82
86
|
await import_fs_extra.promises.writeFile(
|
|
83
|
-
|
|
84
|
-
await (0, import_prettier.formatPrettier)(output, { filepath:
|
|
87
|
+
NEW_CONFIG_FILE_JS,
|
|
88
|
+
await (0, import_prettier.formatPrettier)(output, { filepath: NEW_CONFIG_FILE_JS })
|
|
85
89
|
);
|
|
86
90
|
await Promise.all([
|
|
87
|
-
|
|
88
|
-
import_fs_extra.promises.rm(
|
|
91
|
+
ignoreFileContents === void 0 ? Promise.resolve() : import_fs_extra.promises.rm(IGNORE_FILE),
|
|
92
|
+
import_fs_extra.promises.rm(OLD_CONFIG_FILE)
|
|
89
93
|
]);
|
|
90
94
|
return { result: "apply" };
|
|
91
95
|
} finally {
|
|
@@ -94,9 +98,11 @@ const upgradeESLint = async ({
|
|
|
94
98
|
};
|
|
95
99
|
const writeTemporaryFiles = async (contents) => {
|
|
96
100
|
const dir = await fsp.mkdtemp("eslint-migrate-config");
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
101
|
+
await Promise.all(
|
|
102
|
+
Object.entries(contents).map(
|
|
103
|
+
([file, content]) => fsp.writeFile(import_path.default.join(dir, file), content)
|
|
104
|
+
)
|
|
105
|
+
);
|
|
100
106
|
return dir;
|
|
101
107
|
};
|
|
102
108
|
const fiddleWithOutput = (input) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.ts"],
|
|
4
|
-
"sourcesContent": ["// eslint-disable-next-line no-restricted-imports -- fs-extra is mocked\nimport * as fsp from 'fs/promises';\nimport path from 'path';\nimport { inspect } from 'util';\n\nimport { promises as fsExtra } from 'fs-extra';\n\nimport type { PatchFunction, PatchReturnType } from '../..';\nimport { createExec } from '../../../../../../utils/exec';\nimport { log } from '../../../../../../utils/logging';\nimport { createDestinationFileReader } from '../../../../../configure/analysis/project';\nimport { mergeWithConfigFile } from '../../../../../configure/processing/configFile';\nimport { formatPrettier } from '../../../../../configure/processing/prettier';\n\nconst upgradeESLint: PatchFunction = async ({\n mode,\n dir: cwd = process.cwd(),\n}): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(cwd);\n const [
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,UAAqB;AACrB,kBAAiB;AACjB,kBAAwB;AAExB,sBAAoC;AAGpC,kBAA2B;AAC3B,qBAAoB;AACpB,qBAA4C;AAC5C,wBAAoC;AACpC,sBAA+B;AAE/B,MAAM,gBAA+B,OAAO;AAAA,EAC1C;AAAA,EACA,KAAK,MAAM,QAAQ,IAAI;AACzB,MAAgC;AAC9B,QAAM,eAAW,4CAA4B,GAAG;AAChD,QAAM,CAAC,
|
|
4
|
+
"sourcesContent": ["// eslint-disable-next-line no-restricted-imports -- fs-extra is mocked\nimport * as fsp from 'fs/promises';\nimport path from 'path';\nimport { inspect } from 'util';\n\nimport { promises as fsExtra } from 'fs-extra';\n\nimport type { PatchFunction, PatchReturnType } from '../..';\nimport { createExec } from '../../../../../../utils/exec';\nimport { log } from '../../../../../../utils/logging';\nimport { createDestinationFileReader } from '../../../../../configure/analysis/project';\nimport { mergeWithConfigFile } from '../../../../../configure/processing/configFile';\nimport { formatPrettier } from '../../../../../configure/processing/prettier';\n\nconst IGNORE_FILE = '.eslintignore';\nconst OLD_CONFIG_FILE = '.eslintrc.js';\nconst NEW_CONFIG_FILE_CJS = 'eslint.config.cjs';\nconst NEW_CONFIG_FILE_JS = 'eslint.config.js';\n\nconst upgradeESLint: PatchFunction = async ({\n mode,\n dir: cwd = process.cwd(),\n}): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(cwd);\n const [ignoreFileContents, oldConfig] = await Promise.all([\n readFile(IGNORE_FILE),\n readFile(OLD_CONFIG_FILE),\n ]);\n\n if (oldConfig === undefined) {\n return {\n result: 'skip',\n reason: `no ${OLD_CONFIG_FILE} - have you already migrated?`,\n };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n const ignoreContentsWithoutSkubaManaged = mergeWithConfigFile(\n '',\n 'ignore',\n )(ignoreFileContents);\n\n const exec = createExec({\n cwd: process.cwd(),\n stdio: 'ignore',\n });\n\n // eslint-migrate-config require()s the file, so for testability, put it in a temporary location\n const dir = await writeTemporaryFiles({\n [OLD_CONFIG_FILE]: oldConfig,\n ...(ignoreContentsWithoutSkubaManaged.trim().length > 0\n ? { [IGNORE_FILE]: ignoreContentsWithoutSkubaManaged }\n : {}),\n });\n try {\n await exec(\n 'eslint-migrate-config',\n path.join(dir, OLD_CONFIG_FILE),\n '--commonjs',\n );\n\n const output = fiddleWithOutput(\n await fsp.readFile(path.join(dir, NEW_CONFIG_FILE_CJS), 'utf-8'),\n );\n await fsExtra.writeFile(\n NEW_CONFIG_FILE_JS,\n await formatPrettier(output, { filepath: NEW_CONFIG_FILE_JS }),\n );\n\n await Promise.all([\n ignoreFileContents === undefined\n ? Promise.resolve()\n : fsExtra.rm(IGNORE_FILE),\n fsExtra.rm(OLD_CONFIG_FILE),\n ]);\n\n return { result: 'apply' };\n } finally {\n await fsp.rm(dir, { recursive: true });\n }\n};\n\nconst writeTemporaryFiles = async (contents: Record<string, string>) => {\n const dir = await fsp.mkdtemp('eslint-migrate-config');\n\n await Promise.all(\n Object.entries(contents).map(([file, content]) =>\n fsp.writeFile(path.join(dir, file), content),\n ),\n );\n\n return dir;\n};\n\nconst fiddleWithOutput = (input: string) => {\n let output = input.replace(/compat.extends\\([\"']skuba[\"']\\)/, 'skuba');\n\n if (!output.includes('eslint-config-skuba')) {\n output = `const skuba = require('eslint-config-skuba');\\n\\n${output}`;\n }\n\n if (!output.includes('compat.')) {\n output = output.replace(/const compat = new FlatCompat\\(\\{[^}]+\\}\\);/m, '');\n output = output.replace(\n /const \\{\\s*FlatCompat,?\\s*\\}\\s*=\\s*require\\([\"']@eslint\\/eslintrc[\"']\\);/m,\n '',\n );\n }\n\n if (!output.includes('js.')) {\n output = output.replace(/const js = require\\(['\"]@eslint\\/js['\"]\\);/, '');\n }\n\n output = output.replace(\n /^const skuba = require\\('eslint-config-skuba'\\);\\s*module.exports = \\[...skuba\\];$/m,\n \"module.exports = require('eslint-config-skuba');\",\n );\n\n return output;\n};\n\nexport const tryUpgradeESLint: PatchFunction = async (config) => {\n try {\n return await upgradeESLint(config);\n } catch (err) {\n log.warn('Failed to upgrade ESLint to flat config.');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
6
|
"names": ["path", "fsExtra"]
|
|
7
7
|
}
|
package/lib/cli/node.d.ts
CHANGED
package/lib/cli/node.js
CHANGED
|
@@ -33,8 +33,8 @@ __export(node_exports, {
|
|
|
33
33
|
});
|
|
34
34
|
module.exports = __toCommonJS(node_exports);
|
|
35
35
|
var import_path = __toESM(require("path"));
|
|
36
|
+
var import_execa = __toESM(require("execa"));
|
|
36
37
|
var import_get_port = __toESM(require("get-port"));
|
|
37
|
-
var tsNode = __toESM(require("ts-node"));
|
|
38
38
|
var import_args = require("../utils/args");
|
|
39
39
|
var import_exec = require("../utils/exec");
|
|
40
40
|
var import_validation = require("../utils/validation");
|
|
@@ -42,6 +42,13 @@ const longRunning = true;
|
|
|
42
42
|
const node = async () => {
|
|
43
43
|
const args = (0, import_args.parseRunArgs)(process.argv.slice(2));
|
|
44
44
|
const availablePort = await (0, import_get_port.default)();
|
|
45
|
+
const commonArgs = [
|
|
46
|
+
...args.node,
|
|
47
|
+
"--require",
|
|
48
|
+
require.resolve("dotenv/config"),
|
|
49
|
+
"--require",
|
|
50
|
+
require.resolve("tsconfig-paths/register")
|
|
51
|
+
];
|
|
45
52
|
if (args.entryPoint) {
|
|
46
53
|
const exec = (0, import_exec.createExec)({
|
|
47
54
|
env: {
|
|
@@ -50,27 +57,25 @@ const node = async () => {
|
|
|
50
57
|
}
|
|
51
58
|
});
|
|
52
59
|
return exec(
|
|
53
|
-
"
|
|
54
|
-
...
|
|
55
|
-
"--require",
|
|
56
|
-
"dotenv/config",
|
|
57
|
-
"--require",
|
|
58
|
-
"tsconfig-paths/register",
|
|
59
|
-
"--require",
|
|
60
|
-
"ts-node/register/transpile-only",
|
|
61
|
-
// Override dangerously warn-only default on Node.js <15 so that we
|
|
62
|
-
// predictably return a non-zero exit code on an unhandled rejection.
|
|
63
|
-
"--unhandled-rejections=throw",
|
|
60
|
+
"tsx",
|
|
61
|
+
...commonArgs,
|
|
64
62
|
import_path.default.join(__dirname, "..", "wrapper"),
|
|
65
63
|
...args.script
|
|
66
64
|
);
|
|
67
65
|
}
|
|
68
|
-
return
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
66
|
+
return (0, import_execa.default)(
|
|
67
|
+
require.resolve("tsx/cli"),
|
|
68
|
+
[
|
|
69
|
+
...commonArgs,
|
|
70
|
+
"--require",
|
|
71
|
+
// Unsure if bug or feature that this is needed, but tsx appears to not do anything typescript in the REPL without this!
|
|
72
|
+
// Doesn't occur when just running the tsx binary directly 🧐
|
|
73
|
+
require.resolve("tsx/patch-repl")
|
|
74
|
+
],
|
|
75
|
+
{
|
|
76
|
+
stdio: "inherit"
|
|
77
|
+
}
|
|
78
|
+
);
|
|
74
79
|
};
|
|
75
80
|
// Annotate the CommonJS export names for ESM import in node:
|
|
76
81
|
0 && (module.exports = {
|
package/lib/cli/node.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cli/node.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,
|
|
6
|
-
"names": ["getPort", "path"]
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport execa from 'execa';\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../utils/args';\nimport { createExec } from '../utils/exec';\nimport { isIpPort } from '../utils/validation';\n\nexport const longRunning = true;\n\nexport const node = async () => {\n const args = parseRunArgs(process.argv.slice(2));\n\n const availablePort = await getPort();\n\n const commonArgs = [\n ...args.node,\n '--require',\n require.resolve('dotenv/config'),\n '--require',\n require.resolve('tsconfig-paths/register'),\n ];\n\n if (args.entryPoint) {\n const exec = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return exec(\n 'tsx',\n ...commonArgs,\n path.join(__dirname, '..', 'wrapper'),\n ...args.script,\n );\n }\n\n return execa(\n require.resolve('tsx/cli'),\n [\n ...commonArgs,\n '--require',\n // Unsure if bug or feature that this is needed, but tsx appears to not do anything typescript in the REPL without this!\n // Doesn't occur when just running the tsx binary directly \uD83E\uDDD0\n require.resolve('tsx/patch-repl'),\n ],\n {\n stdio: 'inherit',\n },\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAClB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,wBAAyB;AAElB,MAAM,cAAc;AAEpB,MAAM,OAAO,YAAY;AAC9B,QAAM,WAAO,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAE/C,QAAM,gBAAgB,UAAM,gBAAAA,SAAQ;AAEpC,QAAM,aAAa;AAAA,IACjB,GAAG,KAAK;AAAA,IACR;AAAA,IACA,gBAAgB,eAAe;AAAA,IAC/B;AAAA,IACA,gBAAgB,yBAAyB;AAAA,EAC3C;AAEA,MAAI,KAAK,YAAY;AACnB,UAAM,WAAO,wBAAW;AAAA,MACtB,KAAK;AAAA,QACH,qBAAqB,KAAK;AAAA,QAC1B,cAAc,WAAO,4BAAS,KAAK,IAAI,IAAI,KAAK,OAAO,aAAa;AAAA,MACtE;AAAA,IACF,CAAC;AAED,WAAO;AAAA,MACL;AAAA,MACA,GAAG;AAAA,MACH,YAAAC,QAAK,KAAK,WAAW,MAAM,SAAS;AAAA,MACpC,GAAG,KAAK;AAAA,IACV;AAAA,EACF;AAEA,aAAO,aAAAC;AAAA,IACL,gBAAgB,SAAS;AAAA,IACzB;AAAA,MACE,GAAG;AAAA,MACH;AAAA;AAAA;AAAA,MAGA,gBAAgB,gBAAgB;AAAA,IAClC;AAAA,IACA;AAAA,MACE,OAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
|
+
"names": ["getPort", "path", "execa"]
|
|
7
7
|
}
|
package/lib/cli/start.js
CHANGED
|
@@ -50,14 +50,14 @@ const start = async () => {
|
|
|
50
50
|
}
|
|
51
51
|
});
|
|
52
52
|
return execProcess(
|
|
53
|
-
"
|
|
53
|
+
"tsx",
|
|
54
|
+
"watch",
|
|
55
|
+
"--clear-screen=false",
|
|
54
56
|
...args.node,
|
|
55
57
|
"--require",
|
|
56
58
|
"dotenv/config",
|
|
57
59
|
"--require",
|
|
58
60
|
"tsconfig-paths/register",
|
|
59
|
-
"--respawn",
|
|
60
|
-
"--transpile-only",
|
|
61
61
|
import_path.default.join(__dirname, "..", "wrapper"),
|
|
62
62
|
...args.script
|
|
63
63
|
);
|
package/lib/cli/start.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/cli/start.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../utils/args';\nimport { createExec } from '../utils/exec';\nimport { getEntryPointFromManifest } from '../utils/manifest';\nimport { isIpPort } from '../utils/validation';\n\nexport const start = async () => {\n const [args, availablePort] = await Promise.all([\n parseRunArgs(process.argv.slice(2)),\n getPort(),\n ]);\n\n args.entryPoint ??= await getEntryPointFromManifest();\n\n const execProcess = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return execProcess(\n '
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,sBAA0C;AAC1C,wBAAyB;AAElB,MAAM,QAAQ,YAAY;AAC/B,QAAM,CAAC,MAAM,aAAa,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC9C,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAAA,QAClC,gBAAAA,SAAQ;AAAA,EACV,CAAC;AAED,OAAK,eAAe,UAAM,2CAA0B;AAEpD,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,qBAAqB,KAAK;AAAA,MAC1B,cAAc,WAAO,4BAAS,KAAK,IAAI,IAAI,KAAK,OAAO,aAAa;AAAA,IACtE;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../utils/args';\nimport { createExec } from '../utils/exec';\nimport { getEntryPointFromManifest } from '../utils/manifest';\nimport { isIpPort } from '../utils/validation';\n\nexport const start = async () => {\n const [args, availablePort] = await Promise.all([\n parseRunArgs(process.argv.slice(2)),\n getPort(),\n ]);\n\n args.entryPoint ??= await getEntryPointFromManifest();\n\n const execProcess = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return execProcess(\n 'tsx',\n 'watch',\n '--clear-screen=false',\n ...args.node,\n '--require',\n 'dotenv/config',\n '--require',\n 'tsconfig-paths/register',\n path.join(__dirname, '..', 'wrapper'),\n ...args.script,\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,sBAA0C;AAC1C,wBAAyB;AAElB,MAAM,QAAQ,YAAY;AAC/B,QAAM,CAAC,MAAM,aAAa,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC9C,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAAA,QAClC,gBAAAA,SAAQ;AAAA,EACV,CAAC;AAED,OAAK,eAAe,UAAM,2CAA0B;AAEpD,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,qBAAqB,KAAK;AAAA,MAC1B,cAAc,WAAO,4BAAS,KAAK,IAAI,IAAI,KAAK,OAAO,aAAa;AAAA,IACtE;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,KAAK;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAAC,QAAK,KAAK,WAAW,MAAM,SAAS;AAAA,IACpC,GAAG,KAAK;AAAA,EACV;AACF;",
|
|
6
6
|
"names": ["getPort", "path"]
|
|
7
7
|
}
|