skuba 13.1.1 → 14.0.0-esbuild-bundle-support-20260101041935
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/cli/build/esbuild.d.ts +6 -1
- package/lib/cli/build/esbuild.js +14 -2
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +9 -1
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.js +6 -1
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +133 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.js +2 -5
- package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
- package/lib/cli/migrate/index.d.ts +5 -0
- package/lib/cli/migrate/index.js +46 -6
- package/lib/cli/migrate/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
- package/lib/cli/migrate/nodeVersion/checks.js +27 -133
- package/lib/cli/migrate/nodeVersion/checks.js.map +3 -3
- package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
- package/lib/cli/migrate/nodeVersion/index.js +193 -49
- package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
- package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
- package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
- package/package.json +13 -11
- package/template/express-rest-api/.nvmrc +1 -1
- package/template/express-rest-api/package.json +4 -4
- package/template/greeter/.nvmrc +1 -1
- package/template/greeter/package.json +4 -4
- package/template/koa-rest-api/.nvmrc +1 -1
- package/template/koa-rest-api/package.json +5 -6
- package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +4 -4
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
- package/template/lambda-sqs-worker-cdk/package.json +6 -6
- package/template/oss-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/.nvmrc +1 -1
- package/template/private-npm-package/_package.json +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
- /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.d.ts +0 -0
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,157 +15,53 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
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
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
var checks_exports = {};
|
|
30
20
|
__export(checks_exports, {
|
|
31
|
-
|
|
32
|
-
isPatchableNodeVersion: () => isPatchableNodeVersion,
|
|
33
|
-
isPatchableServerlessVersion: () => isPatchableServerlessVersion,
|
|
34
|
-
isPatchableSkubaType: () => isPatchableSkubaType
|
|
21
|
+
isLikelyPackage: () => isLikelyPackage
|
|
35
22
|
});
|
|
36
23
|
module.exports = __toCommonJS(checks_exports);
|
|
37
|
-
var import_find_up = __toESM(require("find-up"));
|
|
38
|
-
var import_fs_extra = __toESM(require("fs-extra"));
|
|
39
|
-
var import_semver = require("semver");
|
|
40
|
-
var z = __toESM(require("zod/v4"));
|
|
41
24
|
var import_logging = require("../../../utils/logging.js");
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
fileContent: await import_fs_extra.default.readFile(path, "utf-8"),
|
|
49
|
-
path
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
const extractFromParentPackageJson = async (schema, currentPath) => {
|
|
53
|
-
const file = await getParentFile("package.json", currentPath);
|
|
54
|
-
if (!file) {
|
|
55
|
-
return { packageJson: void 0, packageJsonRelativePath: void 0 };
|
|
56
|
-
}
|
|
57
|
-
const { fileContent: packageJson, path } = file;
|
|
58
|
-
let rawJSON;
|
|
59
|
-
try {
|
|
60
|
-
rawJSON = JSON.parse(packageJson);
|
|
61
|
-
} catch {
|
|
62
|
-
throw new Error(`${path} is not valid JSON`);
|
|
63
|
-
}
|
|
64
|
-
const result = schema.safeParse(rawJSON);
|
|
65
|
-
if (!result.success) {
|
|
66
|
-
return { packageJson: void 0, packageJsonRelativePath: path };
|
|
25
|
+
var import_manifest = require("../../../utils/manifest.js");
|
|
26
|
+
const isLikelyPackage = async (currentPath) => {
|
|
27
|
+
const nearestPackageJsonResult = await (0, import_manifest.getConsumerManifest)(currentPath);
|
|
28
|
+
if (!nearestPackageJsonResult) {
|
|
29
|
+
import_logging.log.warn("package.json not found");
|
|
30
|
+
return false;
|
|
67
31
|
}
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
const { packageJson, packageJsonRelativePath } = await extractFromParentPackageJson(
|
|
72
|
-
z.object({
|
|
73
|
-
devDependencies: z.object({
|
|
74
|
-
serverless: z.string().optional()
|
|
75
|
-
})
|
|
76
|
-
}),
|
|
77
|
-
currentPath
|
|
78
|
-
);
|
|
79
|
-
if (!packageJson) {
|
|
80
|
-
import_logging.log.warn("package.json not found, ensure it is in the correct location");
|
|
32
|
+
const { packageJson } = nearestPackageJsonResult;
|
|
33
|
+
const type = packageJson.skuba?.type;
|
|
34
|
+
if (type === "application") {
|
|
81
35
|
return false;
|
|
82
36
|
}
|
|
83
|
-
|
|
84
|
-
if (!serverlessVersion) {
|
|
85
|
-
import_logging.log.subtle(
|
|
86
|
-
`Serverless version not found in ${packageJsonRelativePath}, assuming it is not a dependency`
|
|
87
|
-
);
|
|
37
|
+
if (type === "package") {
|
|
88
38
|
return true;
|
|
89
39
|
}
|
|
90
|
-
if (
|
|
91
|
-
|
|
92
|
-
`Serverless version ${serverlessVersion} cannot be migrated; use Serverless 4.x to automatically migrate Serverless files`
|
|
93
|
-
);
|
|
94
|
-
return false;
|
|
40
|
+
if (typeof packageJson.sideEffects === "boolean") {
|
|
41
|
+
return true;
|
|
95
42
|
}
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
);
|
|
99
|
-
return true;
|
|
100
|
-
};
|
|
101
|
-
const isPatchableSkubaType = async (currentPath) => {
|
|
102
|
-
const { packageJson, packageJsonRelativePath } = await extractFromParentPackageJson(
|
|
103
|
-
z.object({
|
|
104
|
-
skuba: z.object({
|
|
105
|
-
type: z.string().optional()
|
|
106
|
-
}).optional(),
|
|
107
|
-
files: z.string().array().optional()
|
|
108
|
-
}),
|
|
109
|
-
currentPath
|
|
110
|
-
);
|
|
111
|
-
if (!packageJson) {
|
|
112
|
-
import_logging.log.warn("package.json not found, ensure it is in the correct location");
|
|
113
|
-
return false;
|
|
43
|
+
if (typeof packageJson.types === "string" && typeof packageJson.module === "string" && typeof packageJson.main === "string") {
|
|
44
|
+
return true;
|
|
114
45
|
}
|
|
115
|
-
if (packageJson.
|
|
116
|
-
|
|
117
|
-
"Migrations are not supported for packages; update manually to ensure major runtime deprecations are intended"
|
|
118
|
-
);
|
|
119
|
-
return false;
|
|
46
|
+
if (typeof packageJson.exports === "object") {
|
|
47
|
+
return true;
|
|
120
48
|
}
|
|
121
|
-
|
|
122
|
-
if (!type) {
|
|
123
|
-
import_logging.log.warn(
|
|
124
|
-
`skuba project type not found in ${packageJsonRelativePath}; add a package.json#/skuba/type to ensure the correct migration can be applied`
|
|
125
|
-
);
|
|
49
|
+
if (packageJson.private === true) {
|
|
126
50
|
return false;
|
|
127
51
|
}
|
|
128
|
-
if (
|
|
129
|
-
|
|
130
|
-
"Migrations are not supported for packages; update manually to ensure major runtime deprecations are intended"
|
|
131
|
-
);
|
|
132
|
-
return false;
|
|
52
|
+
if (packageJson.publishConfig) {
|
|
53
|
+
return true;
|
|
133
54
|
}
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
const nodeVersionFile = await getParentFile(".node-version");
|
|
140
|
-
const { packageJson } = await extractFromParentPackageJson(
|
|
141
|
-
z.object({
|
|
142
|
-
engines: z.object({
|
|
143
|
-
node: z.string()
|
|
144
|
-
})
|
|
145
|
-
}),
|
|
146
|
-
currentPath
|
|
147
|
-
);
|
|
148
|
-
const nvmrcNodeVersion = nvmrcFile?.fileContent;
|
|
149
|
-
const nodeVersion = nodeVersionFile?.fileContent;
|
|
150
|
-
const engineVersion = packageJson?.engines.node;
|
|
151
|
-
const currentNodeVersion = nvmrcNodeVersion || nodeVersion || engineVersion;
|
|
152
|
-
const coercedTargetVersion = (0, import_semver.coerce)(targetNodeVersion.toString())?.version;
|
|
153
|
-
const coercedCurrentVersion = (0, import_semver.coerce)(currentNodeVersion)?.version;
|
|
154
|
-
const isNodeVersionValid = coercedTargetVersion && coercedCurrentVersion && (0, import_semver.lte)(coercedCurrentVersion, coercedTargetVersion);
|
|
155
|
-
if (!isNodeVersionValid) {
|
|
156
|
-
import_logging.log.warn(
|
|
157
|
-
`Node.js version ${coercedCurrentVersion ?? "unknown"} cannot be migrated to ${coercedTargetVersion}`
|
|
158
|
-
);
|
|
159
|
-
return false;
|
|
55
|
+
if (typeof packageJson.types === "string") {
|
|
56
|
+
return true;
|
|
57
|
+
}
|
|
58
|
+
if (typeof packageJson.module === "string") {
|
|
59
|
+
return true;
|
|
160
60
|
}
|
|
161
|
-
|
|
162
|
-
`Proceeding with migration from Node.js ${coercedCurrentVersion} to ${coercedTargetVersion}`
|
|
163
|
-
);
|
|
164
|
-
return true;
|
|
61
|
+
return false;
|
|
165
62
|
};
|
|
166
63
|
// Annotate the CommonJS export names for ESM import in node:
|
|
167
64
|
0 && (module.exports = {
|
|
168
|
-
|
|
169
|
-
isPatchableNodeVersion,
|
|
170
|
-
isPatchableServerlessVersion,
|
|
171
|
-
isPatchableSkubaType
|
|
65
|
+
isLikelyPackage
|
|
172
66
|
});
|
|
173
67
|
//# sourceMappingURL=checks.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/migrate/nodeVersion/checks.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": [
|
|
4
|
+
"sourcesContent": ["import { log } from '../../../utils/logging.js';\nimport { getConsumerManifest } from '../../../utils/manifest.js';\nimport type { SkubaPackageJson } from '../../init/writePackageJson.js';\n\nexport const isLikelyPackage = async (\n currentPath: string,\n): Promise<boolean> => {\n const nearestPackageJsonResult = await getConsumerManifest(currentPath);\n if (!nearestPackageJsonResult) {\n log.warn('package.json not found');\n return false;\n }\n\n const { packageJson } = nearestPackageJsonResult;\n\n const type = (packageJson.skuba as SkubaPackageJson)?.type;\n\n if (type === 'application') {\n return false;\n }\n\n if (type === 'package') {\n return true;\n }\n\n if (typeof packageJson.sideEffects === 'boolean') {\n return true;\n }\n\n if (\n typeof packageJson.types === 'string' &&\n typeof packageJson.module === 'string' &&\n typeof packageJson.main === 'string'\n ) {\n return true;\n }\n\n if (typeof packageJson.exports === 'object') {\n return true;\n }\n\n // private true would imply this is either an internal package or application\n if (packageJson.private === true) {\n return false;\n }\n\n if (packageJson.publishConfig) {\n return true;\n }\n\n if (typeof packageJson.types === 'string') {\n return true;\n }\n\n if (typeof packageJson.module === 'string') {\n return true;\n }\n\n return false;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AACpB,sBAAoC;AAG7B,MAAM,kBAAkB,OAC7B,gBACqB;AACrB,QAAM,2BAA2B,UAAM,qCAAoB,WAAW;AACtE,MAAI,CAAC,0BAA0B;AAC7B,uBAAI,KAAK,wBAAwB;AACjC,WAAO;AAAA,EACT;AAEA,QAAM,EAAE,YAAY,IAAI;AAExB,QAAM,OAAQ,YAAY,OAA4B;AAEtD,MAAI,SAAS,eAAe;AAC1B,WAAO;AAAA,EACT;AAEA,MAAI,SAAS,WAAW;AACtB,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,YAAY,gBAAgB,WAAW;AAChD,WAAO;AAAA,EACT;AAEA,MACE,OAAO,YAAY,UAAU,YAC7B,OAAO,YAAY,WAAW,YAC9B,OAAO,YAAY,SAAS,UAC5B;AACA,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,YAAY,YAAY,UAAU;AAC3C,WAAO;AAAA,EACT;AAGA,MAAI,YAAY,YAAY,MAAM;AAChC,WAAO;AAAA,EACT;AAEA,MAAI,YAAY,eAAe;AAC7B,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,YAAY,UAAU,UAAU;AACzC,WAAO;AAAA,EACT;AAEA,MAAI,OAAO,YAAY,WAAW,UAAU;AAC1C,WAAO;AAAA,EACT;AAEA,SAAO;AACT;",
|
|
6
|
+
"names": []
|
|
7
7
|
}
|
|
@@ -1,4 +1,10 @@
|
|
|
1
|
-
export declare const nodeVersionMigration: ({ nodeVersion, ECMAScriptVersion, }: {
|
|
2
|
-
nodeVersion:
|
|
1
|
+
export declare const nodeVersionMigration: ({ nodeVersion, ECMAScriptVersion, packageNodeVersion, packageECMAScriptVersion, infraPackages, }: {
|
|
2
|
+
nodeVersion: string;
|
|
3
3
|
ECMAScriptVersion: string;
|
|
4
|
+
packageNodeVersion: string;
|
|
5
|
+
packageECMAScriptVersion: string;
|
|
6
|
+
infraPackages: Array<{
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
}>;
|
|
4
10
|
}, dir?: string) => Promise<void>;
|
|
@@ -34,81 +34,199 @@ module.exports = __toCommonJS(nodeVersion_exports);
|
|
|
34
34
|
var import_util = require("util");
|
|
35
35
|
var import_fast_glob = require("fast-glob");
|
|
36
36
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
37
|
+
var import_semver = require("semver");
|
|
37
38
|
var import_logging = require("../../../utils/logging.js");
|
|
38
39
|
var import_project = require("../../configure/analysis/project.js");
|
|
39
40
|
var import_checks = require("./checks.js");
|
|
41
|
+
var import_upgrade = require("./upgrade.js");
|
|
40
42
|
const subPatches = ({
|
|
41
43
|
nodeVersion,
|
|
42
|
-
ECMAScriptVersion
|
|
44
|
+
ECMAScriptVersion,
|
|
45
|
+
packageECMAScriptVersion,
|
|
46
|
+
packageNodeVersion
|
|
43
47
|
}) => [
|
|
44
|
-
{ file: ".nvmrc", replace: `${nodeVersion}
|
|
45
|
-
` },
|
|
46
48
|
{
|
|
49
|
+
type: "nodejs",
|
|
50
|
+
file: ".nvmrc",
|
|
51
|
+
regex: () => /.*([0-9.]+).*/gm,
|
|
52
|
+
replace: {
|
|
53
|
+
default: {
|
|
54
|
+
captureGroup: 1,
|
|
55
|
+
string: nodeVersion,
|
|
56
|
+
version: nodeVersion
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
type: "nodejs",
|
|
47
62
|
files: "**/Dockerfile*",
|
|
48
63
|
regex: () => /^FROM(.*) (public.ecr.aws\/docker\/library\/)?node:([0-9]+(?:\.[0-9]+(?:\.[0-9]+)?)?)(-[a-z0-9]+)?(@sha256:[a-f0-9]{64})?( .*)?$/gm,
|
|
49
|
-
replace:
|
|
64
|
+
replace: {
|
|
65
|
+
default: {
|
|
66
|
+
captureGroup: 3,
|
|
67
|
+
string: `FROM$1 $2node:${nodeVersion}$4$6`,
|
|
68
|
+
version: nodeVersion
|
|
69
|
+
}
|
|
70
|
+
}
|
|
50
71
|
},
|
|
51
72
|
{
|
|
73
|
+
type: "nodejs",
|
|
52
74
|
files: "**/Dockerfile*",
|
|
53
|
-
regex: () => /^FROM(.*) gcr.io\/distroless\/nodejs\d
|
|
54
|
-
replace:
|
|
75
|
+
regex: () => /^FROM(.*) gcr.io\/distroless\/nodejs(\d+)-debian(\d+)(@sha256:[a-f0-9]{64})?(\.[^- \n]+)?(-[^ \n]+)?( .+|)$/gm,
|
|
76
|
+
replace: {
|
|
77
|
+
default: {
|
|
78
|
+
captureGroup: 2,
|
|
79
|
+
string: `FROM$1 gcr.io/distroless/nodejs${nodeVersion}-debian$3$6$7`,
|
|
80
|
+
version: nodeVersion
|
|
81
|
+
}
|
|
82
|
+
}
|
|
55
83
|
},
|
|
56
84
|
{
|
|
85
|
+
type: "nodejs",
|
|
57
86
|
files: "**/serverless*.y*ml",
|
|
58
|
-
regex: () => /\bnodejs\d
|
|
59
|
-
|
|
60
|
-
|
|
87
|
+
regex: () => /\bnodejs(\d+).x\b/gm,
|
|
88
|
+
replace: {
|
|
89
|
+
default: {
|
|
90
|
+
captureGroup: 1,
|
|
91
|
+
string: `nodejs${nodeVersion}.x`,
|
|
92
|
+
version: nodeVersion
|
|
93
|
+
}
|
|
94
|
+
}
|
|
61
95
|
},
|
|
62
96
|
{
|
|
97
|
+
type: "nodejs",
|
|
63
98
|
files: "**/serverless*.y*ml",
|
|
64
|
-
regex: () => /\bnode\d
|
|
65
|
-
|
|
66
|
-
|
|
99
|
+
regex: () => /\bnode(\d+)\b/gm,
|
|
100
|
+
replace: {
|
|
101
|
+
default: {
|
|
102
|
+
captureGroup: 1,
|
|
103
|
+
string: `node${nodeVersion}`,
|
|
104
|
+
version: nodeVersion
|
|
105
|
+
}
|
|
106
|
+
}
|
|
67
107
|
},
|
|
68
108
|
{
|
|
109
|
+
type: "nodejs",
|
|
69
110
|
files: "**/infra/**/*.ts",
|
|
70
|
-
regex: () => /NODEJS_\d+_X/g,
|
|
71
|
-
replace:
|
|
111
|
+
regex: () => /NODEJS_(\d+)_X/g,
|
|
112
|
+
replace: {
|
|
113
|
+
default: {
|
|
114
|
+
captureGroup: 1,
|
|
115
|
+
string: `NODEJS_${nodeVersion}_X`,
|
|
116
|
+
version: nodeVersion
|
|
117
|
+
}
|
|
118
|
+
}
|
|
72
119
|
},
|
|
73
120
|
{
|
|
121
|
+
type: "nodejs",
|
|
74
122
|
files: "**/infra/**/*.ts",
|
|
75
123
|
regex: () => /(target:\s*'node)(\d+)(.+)$/gm,
|
|
76
|
-
replace:
|
|
124
|
+
replace: {
|
|
125
|
+
default: {
|
|
126
|
+
captureGroup: 2,
|
|
127
|
+
string: `$1${nodeVersion}$3`,
|
|
128
|
+
version: nodeVersion
|
|
129
|
+
}
|
|
130
|
+
}
|
|
77
131
|
},
|
|
78
132
|
{
|
|
133
|
+
type: "nodejs",
|
|
79
134
|
files: "**/.buildkite/*",
|
|
80
|
-
regex: () => /(image: )(public.ecr.aws\/docker\/library\/)?(node:)[0-9.]+(\.[^- \n]+)?(-[^ \n]+)?$/gm,
|
|
81
|
-
replace:
|
|
135
|
+
regex: () => /(image: )(public.ecr.aws\/docker\/library\/)?(node:)([0-9.]+)(\.[^- \n]+)?(-[^ \n]+)?$/gm,
|
|
136
|
+
replace: {
|
|
137
|
+
default: {
|
|
138
|
+
captureGroup: 4,
|
|
139
|
+
string: `$1$2$3${nodeVersion}$5$6`,
|
|
140
|
+
version: nodeVersion
|
|
141
|
+
}
|
|
142
|
+
}
|
|
82
143
|
},
|
|
83
144
|
{
|
|
145
|
+
type: "nodejs",
|
|
84
146
|
files: ".node-version*",
|
|
85
147
|
regex: () => /(\d+(?:\.\d+)*)/g,
|
|
86
|
-
replace:
|
|
148
|
+
replace: {
|
|
149
|
+
default: {
|
|
150
|
+
captureGroup: 1,
|
|
151
|
+
string: `${nodeVersion}`,
|
|
152
|
+
version: nodeVersion
|
|
153
|
+
}
|
|
154
|
+
}
|
|
87
155
|
},
|
|
88
156
|
{
|
|
157
|
+
type: "nodejs",
|
|
89
158
|
files: "**/package.json",
|
|
90
159
|
regex: () => /(["']engines["']:\s*{[\s\S]*?["']node["']:\s*["']>=)(\d+(?:\.\d+)*)(['"]\s*})/gm,
|
|
91
|
-
|
|
92
|
-
|
|
160
|
+
replace: {
|
|
161
|
+
package: {
|
|
162
|
+
string: `$1${packageNodeVersion}$3`,
|
|
163
|
+
version: packageNodeVersion,
|
|
164
|
+
captureGroup: 2
|
|
165
|
+
},
|
|
166
|
+
default: {
|
|
167
|
+
string: `$1${nodeVersion}$3`,
|
|
168
|
+
version: nodeVersion,
|
|
169
|
+
captureGroup: 2
|
|
170
|
+
}
|
|
171
|
+
}
|
|
93
172
|
},
|
|
94
173
|
{
|
|
174
|
+
type: "nodejs",
|
|
175
|
+
files: "**/docker-compose*.y*ml",
|
|
176
|
+
regex: () => /(image: )(public.ecr.aws\/docker\/library\/)?(node:)([0-9.]+)(\.[^- \n]+)?(-[^ \n]+)?$/gm,
|
|
177
|
+
replace: {
|
|
178
|
+
default: {
|
|
179
|
+
captureGroup: 4,
|
|
180
|
+
string: `$1$2$3${nodeVersion}$5$6`,
|
|
181
|
+
version: nodeVersion
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
type: "ecmascript",
|
|
95
187
|
files: "**/tsconfig*.json",
|
|
96
188
|
regex: () => /("target":\s*")(ES\d+)"/gim,
|
|
97
|
-
|
|
98
|
-
|
|
189
|
+
replace: {
|
|
190
|
+
package: {
|
|
191
|
+
string: `$1${packageECMAScriptVersion}"`,
|
|
192
|
+
version: packageECMAScriptVersion,
|
|
193
|
+
captureGroup: 2
|
|
194
|
+
},
|
|
195
|
+
default: {
|
|
196
|
+
string: `$1${ECMAScriptVersion}"`,
|
|
197
|
+
version: ECMAScriptVersion,
|
|
198
|
+
captureGroup: 2
|
|
199
|
+
}
|
|
200
|
+
}
|
|
99
201
|
},
|
|
100
202
|
{
|
|
203
|
+
type: "ecmascript",
|
|
101
204
|
files: "**/tsconfig*.json",
|
|
102
205
|
regex: () => /("lib":\s*\[)([\S\s]*?)(ES\d+)([\S\s]*?)(\])/gim,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
206
|
+
replace: {
|
|
207
|
+
package: {
|
|
208
|
+
string: `$1$2${packageECMAScriptVersion}$4$5`,
|
|
209
|
+
version: packageECMAScriptVersion,
|
|
210
|
+
captureGroup: 3
|
|
211
|
+
},
|
|
212
|
+
default: {
|
|
213
|
+
string: `$1$2${ECMAScriptVersion}$4$5`,
|
|
214
|
+
version: ECMAScriptVersion,
|
|
215
|
+
captureGroup: 3
|
|
216
|
+
}
|
|
217
|
+
}
|
|
110
218
|
}
|
|
111
219
|
];
|
|
220
|
+
const getTemplatedReplace = async (path, replace) => {
|
|
221
|
+
if (!replace.package) {
|
|
222
|
+
return replace.default;
|
|
223
|
+
}
|
|
224
|
+
const isPackage = await (0, import_checks.isLikelyPackage)(path);
|
|
225
|
+
if (isPackage) {
|
|
226
|
+
return replace.package;
|
|
227
|
+
}
|
|
228
|
+
return replace.default;
|
|
229
|
+
};
|
|
112
230
|
const runSubPatch = async (dir, patch) => {
|
|
113
231
|
const readFile = (0, import_project.createDestinationFileReader)(dir);
|
|
114
232
|
const paths = patch.file ? [patch.file] : await (0, import_fast_glob.glob)(patch.files ?? [], {
|
|
@@ -121,35 +239,48 @@ const runSubPatch = async (dir, patch) => {
|
|
|
121
239
|
if (!contents) {
|
|
122
240
|
return;
|
|
123
241
|
}
|
|
124
|
-
|
|
242
|
+
const regexResult = patch.regex().exec(contents);
|
|
243
|
+
if (!regexResult) {
|
|
125
244
|
return;
|
|
126
245
|
}
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
}
|
|
246
|
+
const templateReplace = await getTemplatedReplace(path, patch.replace);
|
|
247
|
+
if (!lessThan(
|
|
248
|
+
regexResult[templateReplace.captureGroup],
|
|
249
|
+
templateReplace.version
|
|
250
|
+
)) {
|
|
251
|
+
return;
|
|
134
252
|
}
|
|
135
253
|
await writePatchedContents({
|
|
136
254
|
path,
|
|
137
255
|
contents,
|
|
138
|
-
templated:
|
|
256
|
+
templated: templateReplace.string,
|
|
139
257
|
regex: patch.regex
|
|
140
258
|
});
|
|
141
259
|
})
|
|
142
260
|
);
|
|
143
261
|
};
|
|
262
|
+
const lessThan = (versionA, versionB) => {
|
|
263
|
+
if (versionA.toLowerCase().startsWith("es")) {
|
|
264
|
+
return Number(versionA.slice(2)) < Number(versionB.slice(2));
|
|
265
|
+
}
|
|
266
|
+
const coersedA = (0, import_semver.coerce)(versionA);
|
|
267
|
+
const coersedB = (0, import_semver.coerce)(versionB);
|
|
268
|
+
if (!coersedA || !coersedB) {
|
|
269
|
+
throw new Error(
|
|
270
|
+
`Unable to coerce versions for comparison: "${versionA}" and "${versionB}"`
|
|
271
|
+
);
|
|
272
|
+
}
|
|
273
|
+
return (0, import_semver.lt)(coersedA, coersedB);
|
|
274
|
+
};
|
|
144
275
|
const writePatchedContents = async ({
|
|
145
276
|
path,
|
|
146
277
|
contents,
|
|
147
278
|
templated,
|
|
148
279
|
regex
|
|
149
|
-
}) =>
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
280
|
+
}) => {
|
|
281
|
+
const modified = contents.replaceAll(regex(), templated);
|
|
282
|
+
await import_fs_extra.default.promises.writeFile(path, modified);
|
|
283
|
+
};
|
|
153
284
|
const upgrade = async (versions, dir) => {
|
|
154
285
|
for (const subPatch of subPatches(versions)) {
|
|
155
286
|
await runSubPatch(dir, subPatch);
|
|
@@ -157,15 +288,28 @@ const upgrade = async (versions, dir) => {
|
|
|
157
288
|
};
|
|
158
289
|
const nodeVersionMigration = async ({
|
|
159
290
|
nodeVersion,
|
|
160
|
-
ECMAScriptVersion
|
|
291
|
+
ECMAScriptVersion,
|
|
292
|
+
packageNodeVersion,
|
|
293
|
+
packageECMAScriptVersion,
|
|
294
|
+
infraPackages
|
|
161
295
|
}, dir = process.cwd()) => {
|
|
162
|
-
import_logging.log.ok(
|
|
296
|
+
import_logging.log.ok(
|
|
297
|
+
`Upgrading project to Node.js ${nodeVersion} and package targets to Node.js ${packageNodeVersion}`
|
|
298
|
+
);
|
|
163
299
|
try {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
300
|
+
await (0, import_upgrade.tryUpgradeInfraPackages)("format", infraPackages);
|
|
301
|
+
await upgrade(
|
|
302
|
+
{
|
|
303
|
+
nodeVersion,
|
|
304
|
+
ECMAScriptVersion,
|
|
305
|
+
packageNodeVersion,
|
|
306
|
+
packageECMAScriptVersion
|
|
307
|
+
},
|
|
308
|
+
dir
|
|
309
|
+
);
|
|
310
|
+
import_logging.log.ok(
|
|
311
|
+
`Upgraded project to Node.js ${nodeVersion} and package targets to Node.js ${packageNodeVersion}`
|
|
312
|
+
);
|
|
169
313
|
} catch (error) {
|
|
170
314
|
import_logging.log.err("Failed to upgrade");
|
|
171
315
|
import_logging.log.subtle((0, import_util.inspect)(error));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/migrate/nodeVersion/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\n\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\nimport { coerce, lt } from 'semver';\n\nimport { log } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\n\nimport { isLikelyPackage } from './checks.js';\nimport { tryUpgradeInfraPackages } from './upgrade.js';\n\ntype FileSelector =\n | { files: string; file?: never }\n | { file: string; files?: never };\n\ntype ReplaceOptions = {\n version: string;\n string: string;\n captureGroup: number;\n};\n\ntype SubPatch = FileSelector & {\n type: 'nodejs' | 'ecmascript';\n regex: () => RegExp;\n replace: {\n package?: ReplaceOptions;\n default: ReplaceOptions;\n };\n};\n\nconst subPatches = ({\n nodeVersion,\n ECMAScriptVersion,\n packageECMAScriptVersion,\n packageNodeVersion,\n}: Versions): SubPatch[] => [\n {\n type: 'nodejs',\n file: '.nvmrc',\n regex: () => /.*([0-9.]+).*/gm,\n replace: {\n default: {\n captureGroup: 1,\n string: nodeVersion,\n version: nodeVersion,\n },\n },\n },\n {\n type: 'nodejs',\n files: '**/Dockerfile*',\n\n regex: () =>\n /^FROM(.*) (public.ecr.aws\\/docker\\/library\\/)?node:([0-9]+(?:\\.[0-9]+(?:\\.[0-9]+)?)?)(-[a-z0-9]+)?(@sha256:[a-f0-9]{64})?( .*)?$/gm,\n replace: {\n default: {\n captureGroup: 3,\n string: `FROM$1 $2node:${nodeVersion}$4$6`,\n version: nodeVersion,\n },\n },\n },\n {\n type: 'nodejs',\n files: '**/Dockerfile*',\n regex: () =>\n /^FROM(.*) gcr.io\\/distroless\\/nodejs(\\d+)-debian(\\d+)(@sha256:[a-f0-9]{64})?(\\.[^- \\n]+)?(-[^ \\n]+)?( .+|)$/gm,\n replace: {\n default: {\n captureGroup: 2,\n string: `FROM$1 gcr.io/distroless/nodejs${nodeVersion}-debian$3$6$7`,\n version: nodeVersion,\n },\n },\n },\n\n {\n type: 'nodejs',\n files: '**/serverless*.y*ml',\n regex: () => /\\bnodejs(\\d+).x\\b/gm,\n replace: {\n default: {\n captureGroup: 1,\n string: `nodejs${nodeVersion}.x`,\n version: nodeVersion,\n },\n },\n },\n {\n type: 'nodejs',\n files: '**/serverless*.y*ml',\n regex: () => /\\bnode(\\d+)\\b/gm,\n replace: {\n default: {\n captureGroup: 1,\n string: `node${nodeVersion}`,\n version: nodeVersion,\n },\n },\n },\n\n {\n type: 'nodejs',\n files: '**/infra/**/*.ts',\n regex: () => /NODEJS_(\\d+)_X/g,\n replace: {\n default: {\n captureGroup: 1,\n string: `NODEJS_${nodeVersion}_X`,\n version: nodeVersion,\n },\n },\n },\n {\n type: 'nodejs',\n files: '**/infra/**/*.ts',\n regex: () => /(target:\\s*'node)(\\d+)(.+)$/gm,\n replace: {\n default: {\n captureGroup: 2,\n string: `$1${nodeVersion}$3`,\n version: nodeVersion,\n },\n },\n },\n\n {\n type: 'nodejs',\n files: '**/.buildkite/*',\n regex: () =>\n /(image: )(public.ecr.aws\\/docker\\/library\\/)?(node:)([0-9.]+)(\\.[^- \\n]+)?(-[^ \\n]+)?$/gm,\n replace: {\n default: {\n captureGroup: 4,\n string: `$1$2$3${nodeVersion}$5$6`,\n version: nodeVersion,\n },\n },\n },\n {\n type: 'nodejs',\n files: '.node-version*',\n regex: () => /(\\d+(?:\\.\\d+)*)/g,\n replace: {\n default: {\n captureGroup: 1,\n string: `${nodeVersion}`,\n version: nodeVersion,\n },\n },\n },\n\n {\n type: 'nodejs',\n files: '**/package.json',\n regex: () =>\n /([\"']engines[\"']:\\s*{[\\s\\S]*?[\"']node[\"']:\\s*[\"']>=)(\\d+(?:\\.\\d+)*)(['\"]\\s*})/gm,\n replace: {\n package: {\n string: `$1${packageNodeVersion}$3`,\n version: packageNodeVersion,\n captureGroup: 2,\n },\n default: {\n string: `$1${nodeVersion}$3`,\n version: nodeVersion,\n captureGroup: 2,\n },\n },\n },\n {\n type: 'nodejs',\n files: '**/docker-compose*.y*ml',\n regex: () =>\n /(image: )(public.ecr.aws\\/docker\\/library\\/)?(node:)([0-9.]+)(\\.[^- \\n]+)?(-[^ \\n]+)?$/gm,\n\n replace: {\n default: {\n captureGroup: 4,\n string: `$1$2$3${nodeVersion}$5$6`,\n version: nodeVersion,\n },\n },\n },\n {\n type: 'ecmascript',\n files: '**/tsconfig*.json',\n regex: () => /(\"target\":\\s*\")(ES\\d+)\"/gim,\n replace: {\n package: {\n string: `$1${packageECMAScriptVersion}\"`,\n version: packageECMAScriptVersion,\n captureGroup: 2,\n },\n default: {\n string: `$1${ECMAScriptVersion}\"`,\n version: ECMAScriptVersion,\n captureGroup: 2,\n },\n },\n },\n {\n type: 'ecmascript',\n files: '**/tsconfig*.json',\n regex: () => /(\"lib\":\\s*\\[)([\\S\\s]*?)(ES\\d+)([\\S\\s]*?)(\\])/gim,\n replace: {\n package: {\n string: `$1$2${packageECMAScriptVersion}$4$5`,\n version: packageECMAScriptVersion,\n captureGroup: 3,\n },\n default: {\n string: `$1$2${ECMAScriptVersion}$4$5`,\n version: ECMAScriptVersion,\n captureGroup: 3,\n },\n },\n },\n];\n\ntype Versions = {\n nodeVersion: string;\n ECMAScriptVersion: string;\n packageNodeVersion: string;\n packageECMAScriptVersion: string;\n};\n\nconst getTemplatedReplace = async (\n path: string,\n replace: SubPatch['replace'],\n): Promise<ReplaceOptions> => {\n if (!replace.package) {\n return replace.default;\n }\n\n const isPackage = await isLikelyPackage(path);\n\n if (isPackage) {\n return replace.package;\n }\n\n return replace.default;\n};\n\nconst runSubPatch = async (dir: string, patch: SubPatch) => {\n const readFile = createDestinationFileReader(dir);\n const paths = patch.file\n ? [patch.file]\n : await glob(patch.files ?? [], {\n cwd: dir,\n ignore: ['**/node_modules/**'],\n });\n\n await Promise.all(\n paths.map(async (path) => {\n const contents = await readFile(path);\n if (!contents) {\n return;\n }\n\n const regexResult = patch.regex().exec(contents);\n\n if (!regexResult) {\n return;\n }\n\n const templateReplace = await getTemplatedReplace(path, patch.replace);\n\n if (\n !lessThan(\n regexResult[templateReplace.captureGroup] as string,\n templateReplace.version,\n )\n ) {\n return;\n }\n\n await writePatchedContents({\n path,\n contents,\n templated: templateReplace.string,\n regex: patch.regex,\n });\n }),\n );\n};\n\nconst lessThan = (versionA: string, versionB: string) => {\n if (versionA.toLowerCase().startsWith('es')) {\n return Number(versionA.slice(2)) < Number(versionB.slice(2));\n }\n\n const coersedA = coerce(versionA);\n const coersedB = coerce(versionB);\n\n if (!coersedA || !coersedB) {\n throw new Error(\n `Unable to coerce versions for comparison: \"${versionA}\" and \"${versionB}\"`,\n );\n }\n\n return lt(coersedA, coersedB);\n};\n\nconst writePatchedContents = async ({\n path,\n contents,\n templated,\n regex,\n}: {\n path: string;\n contents: string;\n templated: string;\n regex: () => RegExp;\n}) => {\n const modified = contents.replaceAll(regex(), templated);\n await fs.promises.writeFile(path, modified);\n};\n\nconst upgrade = async (versions: Versions, dir: string) => {\n for (const subPatch of subPatches(versions)) {\n await runSubPatch(dir, subPatch);\n }\n};\n\nexport const nodeVersionMigration = async (\n {\n nodeVersion,\n ECMAScriptVersion,\n packageNodeVersion,\n packageECMAScriptVersion,\n infraPackages,\n }: {\n nodeVersion: string;\n ECMAScriptVersion: string;\n packageNodeVersion: string;\n packageECMAScriptVersion: string;\n infraPackages: Array<{ name: string; version: string }>;\n },\n dir = process.cwd(),\n) => {\n log.ok(\n `Upgrading project to Node.js ${nodeVersion} and package targets to Node.js ${packageNodeVersion}`,\n );\n\n try {\n await tryUpgradeInfraPackages('format', infraPackages);\n await upgrade(\n {\n nodeVersion,\n ECMAScriptVersion,\n packageNodeVersion,\n packageECMAScriptVersion,\n },\n dir,\n );\n\n log.ok(\n `Upgraded project to Node.js ${nodeVersion} and package targets to Node.js ${packageNodeVersion}`,\n );\n } catch (error) {\n log.err('Failed to upgrade');\n log.subtle(inspect(error));\n process.exitCode = 1;\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AACf,oBAA2B;AAE3B,qBAAoB;AACpB,qBAA4C;AAE5C,oBAAgC;AAChC,qBAAwC;AAqBxC,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAA4B;AAAA,EAC1B;AAAA,IACE,MAAM;AAAA,IACN,MAAM;AAAA,IACN,OAAO,MAAM;AAAA,IACb,SAAS;AAAA,MACP,SAAS;AAAA,QACP,cAAc;AAAA,QACd,QAAQ;AAAA,QACR,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,IAEP,OAAO,MACL;AAAA,IACF,SAAS;AAAA,MACP,SAAS;AAAA,QACP,cAAc;AAAA,QACd,QAAQ,iBAAiB,WAAW;AAAA,QACpC,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,OAAO;AAAA,IACP,OAAO,MACL;AAAA,IACF,SAAS;AAAA,MACP,SAAS;AAAA,QACP,cAAc;AAAA,QACd,QAAQ,kCAAkC,WAAW;AAAA,QACrD,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF;AA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AAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAKM;AACJ,QAAM,WAAW,SAAS,WAAW,MAAM,GAAG,SAAS;AACvD,QAAM,gBAAAA,QAAG,SAAS,UAAU,MAAM,QAAQ;AAC5C;AAEA,MAAM,UAAU,OAAO,UAAoB,QAAgB;AACzD,aAAW,YAAY,WAAW,QAAQ,GAAG;AAC3C,UAAM,YAAY,KAAK,QAAQ;AAAA,EACjC;AACF;AAEO,MAAM,uBAAuB,OAClC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAOA,MAAM,QAAQ,IAAI,MACf;AACH,qBAAI;AAAA,IACF,gCAAgC,WAAW,mCAAmC,kBAAkB;AAAA,EAClG;AAEA,MAAI;AACF,cAAM,wCAAwB,UAAU,aAAa;AACrD,UAAM;AAAA,MACJ;AAAA,QACE;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,MACA;AAAA,IACF;AAEA,uBAAI;AAAA,MACF,+BAA+B,WAAW,mCAAmC,kBAAkB;AAAA,IACjG;AAAA,EACF,SAAS,OAAO;AACd,uBAAI,IAAI,mBAAmB;AAC3B,uBAAI,WAAO,qBAAQ,KAAK,CAAC;AACzB,YAAQ,WAAW;AAAA,EACrB;AACF;",
|
|
6
6
|
"names": ["fs"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PatchReturnType } from '../../lint/internalLints/upgrade/index.js';
|
|
2
|
+
type PackageInfo = {
|
|
3
|
+
name: string;
|
|
4
|
+
version: string;
|
|
5
|
+
};
|
|
6
|
+
export declare const upgradeInfraPackages: (mode: "lint" | "format", packages: PackageInfo[]) => Promise<PatchReturnType>;
|
|
7
|
+
export declare const tryUpgradeInfraPackages: (mode: "lint" | "format", packages: PackageInfo[]) => Promise<PatchReturnType>;
|
|
8
|
+
export {};
|