skuba 13.1.0 → 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.
Files changed (43) hide show
  1. package/lib/cli/build/esbuild.d.ts +6 -1
  2. package/lib/cli/build/esbuild.js +14 -2
  3. package/lib/cli/build/esbuild.js.map +2 -2
  4. package/lib/cli/build/index.js +9 -1
  5. package/lib/cli/build/index.js.map +2 -2
  6. package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.js +6 -1
  7. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/index.js.map +7 -0
  8. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.d.ts +3 -0
  9. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js +133 -0
  10. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.js.map +7 -0
  11. package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/upgradeNode.js +2 -5
  12. package/lib/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.js.map +7 -0
  13. package/lib/cli/migrate/index.d.ts +5 -0
  14. package/lib/cli/migrate/index.js +46 -6
  15. package/lib/cli/migrate/index.js.map +2 -2
  16. package/lib/cli/migrate/nodeVersion/checks.d.ts +1 -14
  17. package/lib/cli/migrate/nodeVersion/checks.js +27 -133
  18. package/lib/cli/migrate/nodeVersion/checks.js.map +3 -3
  19. package/lib/cli/migrate/nodeVersion/index.d.ts +8 -2
  20. package/lib/cli/migrate/nodeVersion/index.js +193 -49
  21. package/lib/cli/migrate/nodeVersion/index.js.map +2 -2
  22. package/lib/cli/migrate/nodeVersion/upgrade.d.ts +8 -0
  23. package/lib/cli/migrate/nodeVersion/upgrade.js +179 -0
  24. package/lib/cli/migrate/nodeVersion/upgrade.js.map +7 -0
  25. package/package.json +13 -19
  26. package/template/base/_pnpm-workspace.yaml +1 -0
  27. package/template/express-rest-api/.nvmrc +1 -1
  28. package/template/express-rest-api/package.json +4 -4
  29. package/template/greeter/.nvmrc +1 -1
  30. package/template/greeter/package.json +4 -4
  31. package/template/koa-rest-api/.nvmrc +1 -1
  32. package/template/koa-rest-api/package.json +5 -6
  33. package/template/lambda-sqs-worker-cdk/.nvmrc +1 -1
  34. package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +4 -4
  35. package/template/lambda-sqs-worker-cdk/infra/appStack.ts +3 -3
  36. package/template/lambda-sqs-worker-cdk/package.json +6 -6
  37. package/template/oss-npm-package/.nvmrc +1 -1
  38. package/template/private-npm-package/.nvmrc +1 -1
  39. package/template/private-npm-package/_package.json +1 -1
  40. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/index.js.map +0 -7
  41. package/lib/cli/lint/internalLints/upgrade/patches/9.1.0/upgradeNode.js.map +0 -7
  42. /package/lib/cli/lint/internalLints/upgrade/patches/{9.1.0 → 13.1.1}/index.d.ts +0 -0
  43. /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
- extractFromParentPackageJson: () => extractFromParentPackageJson,
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
- const getParentFile = async (file, cwd = process.cwd()) => {
43
- const path = await (0, import_find_up.default)(file, { cwd });
44
- if (!path) {
45
- return void 0;
46
- }
47
- return {
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
- return { packageJson: result.data, packageJsonRelativePath: path };
69
- };
70
- const isPatchableServerlessVersion = async (currentPath) => {
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
- const serverlessVersion = packageJson?.devDependencies.serverless;
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 (!(0, import_semver.satisfies)(serverlessVersion, "4.x.x")) {
91
- import_logging.log.warn(
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
- import_logging.log.ok(
97
- `Proceeding with migration of Serverless version ${serverlessVersion}`
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.files) {
116
- import_logging.log.warn(
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
- const type = packageJson?.skuba?.type;
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 (type === "package") {
129
- import_logging.log.warn(
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
- import_logging.log.ok(`Proceeding with migration of skuba project type ${type}`);
135
- return true;
136
- };
137
- const isPatchableNodeVersion = async (targetNodeVersion, currentPath) => {
138
- const nvmrcFile = await getParentFile(".nvmrc");
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
- import_logging.log.ok(
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
- extractFromParentPackageJson,
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 findUp from 'find-up';\nimport fs from 'fs-extra';\nimport { coerce, lte, satisfies } from 'semver';\nimport * as z from 'zod/v4';\n\nimport { log } from '../../../utils/logging.js';\n\nconst getParentFile = async (file: string, cwd: string = process.cwd()) => {\n const path = await findUp(file, { cwd });\n if (!path) {\n return undefined;\n }\n return {\n fileContent: await fs.readFile(path, 'utf-8'),\n path,\n };\n};\n\nexport const extractFromParentPackageJson = async <T extends z.ZodRawShape>(\n schema: z.ZodObject<T>,\n currentPath: string,\n) => {\n const file = await getParentFile('package.json', currentPath);\n if (!file) {\n return { packageJson: undefined, packageJsonRelativePath: undefined };\n }\n const { fileContent: packageJson, path } = file;\n let rawJSON;\n try {\n rawJSON = JSON.parse(packageJson) as unknown;\n } catch {\n throw new Error(`${path} is not valid JSON`);\n }\n const result = schema.safeParse(rawJSON);\n if (!result.success) {\n return { packageJson: undefined, packageJsonRelativePath: path };\n }\n\n return { packageJson: result.data, packageJsonRelativePath: path };\n};\n\nexport const isPatchableServerlessVersion = async (\n currentPath: string,\n): Promise<boolean> => {\n const { packageJson, packageJsonRelativePath } =\n await extractFromParentPackageJson(\n z.object({\n devDependencies: z.object({\n serverless: z.string().optional(),\n }),\n }),\n currentPath,\n );\n if (!packageJson) {\n log.warn('package.json not found, ensure it is in the correct location');\n return false;\n }\n\n const serverlessVersion = packageJson?.devDependencies.serverless;\n\n if (!serverlessVersion) {\n log.subtle(\n `Serverless version not found in ${packageJsonRelativePath}, assuming it is not a dependency`,\n );\n return true;\n }\n\n if (!satisfies(serverlessVersion, '4.x.x')) {\n log.warn(\n `Serverless version ${serverlessVersion} cannot be migrated; use Serverless 4.x to automatically migrate Serverless files`,\n );\n return false;\n }\n\n log.ok(\n `Proceeding with migration of Serverless version ${serverlessVersion}`,\n );\n return true;\n};\n\nexport const isPatchableSkubaType = async (\n currentPath: string,\n): Promise<boolean> => {\n const { packageJson, packageJsonRelativePath } =\n await extractFromParentPackageJson(\n z.object({\n skuba: z\n .object({\n type: z.string().optional(),\n })\n .optional(),\n files: z.string().array().optional(),\n }),\n currentPath,\n );\n\n if (!packageJson) {\n log.warn('package.json not found, ensure it is in the correct location');\n return false;\n }\n\n if (packageJson.files) {\n log.warn(\n 'Migrations are not supported for packages; update manually to ensure major runtime deprecations are intended',\n );\n return false;\n }\n\n const type = packageJson?.skuba?.type;\n\n if (!type) {\n log.warn(\n `skuba project type not found in ${packageJsonRelativePath}; add a package.json#/skuba/type to ensure the correct migration can be applied`,\n );\n return false;\n }\n if (type === 'package') {\n log.warn(\n 'Migrations are not supported for packages; update manually to ensure major runtime deprecations are intended',\n );\n return false;\n }\n\n log.ok(`Proceeding with migration of skuba project type ${type}`);\n return true;\n};\n\nexport const isPatchableNodeVersion = async (\n targetNodeVersion: number,\n currentPath: string,\n): Promise<boolean> => {\n const nvmrcFile = await getParentFile('.nvmrc');\n const nodeVersionFile = await getParentFile('.node-version');\n const { packageJson } = await extractFromParentPackageJson(\n z.object({\n engines: z.object({\n node: z.string(),\n }),\n }),\n currentPath,\n );\n\n const nvmrcNodeVersion = nvmrcFile?.fileContent;\n const nodeVersion = nodeVersionFile?.fileContent;\n const engineVersion = packageJson?.engines.node;\n\n const currentNodeVersion = nvmrcNodeVersion || nodeVersion || engineVersion;\n\n const coercedTargetVersion = coerce(targetNodeVersion.toString())?.version;\n const coercedCurrentVersion = coerce(currentNodeVersion)?.version;\n\n const isNodeVersionValid =\n coercedTargetVersion &&\n coercedCurrentVersion &&\n lte(coercedCurrentVersion, coercedTargetVersion);\n\n if (!isNodeVersionValid) {\n log.warn(\n `Node.js version ${coercedCurrentVersion ?? 'unknown'} cannot be migrated to ${coercedTargetVersion}`,\n );\n return false;\n }\n\n log.ok(\n `Proceeding with migration from Node.js ${coercedCurrentVersion} to ${coercedTargetVersion}`,\n );\n return true;\n};\n"],
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AAO;AAAA,MACP,SAAS,EAAE,OAAO;AAAA,QAChB,MAAM,EAAE,OAAO;AAAA,MACjB,CAAC;AAAA,IACH,CAAC;AAAA,IACD;AAAA,EACF;AAEA,QAAM,mBAAmB,WAAW;AACpC,QAAM,cAAc,iBAAiB;AACrC,QAAM,gBAAgB,aAAa,QAAQ;AAE3C,QAAM,qBAAqB,oBAAoB,eAAe;AAE9D,QAAM,2BAAuB,sBAAO,kBAAkB,SAAS,CAAC,GAAG;AACnE,QAAM,4BAAwB,sBAAO,kBAAkB,GAAG;AAE1D,QAAM,qBACJ,wBACA,6BACA,mBAAI,uBAAuB,oBAAoB;AAEjD,MAAI,CAAC,oBAAoB;AACvB,uBAAI;AAAA,MACF,mBAAmB,yBAAyB,SAAS,0BAA0B,oBAAoB;AAAA,IACrG;AACA,WAAO;AAAA,EACT;AAEA,qBAAI;AAAA,IACF,0CAA0C,qBAAqB,OAAO,oBAAoB;AAAA,EAC5F;AACA,SAAO;AACT;",
6
- "names": ["findUp", "fs"]
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: number;
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: `FROM$1 $2node:${nodeVersion}$4$6`
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+-debian(\d+)(@sha256:[a-f0-9]{64})?(\.[^- \n]+)?(-[^ \n]+)?( .+|)$/gm,
54
- replace: `FROM$1 gcr.io/distroless/nodejs${nodeVersion}-debian$2$4$5$6`
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+.x\b/gm,
59
- tests: [import_checks.isPatchableServerlessVersion],
60
- replace: `nodejs${nodeVersion}.x`
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+\b/gm,
65
- tests: [import_checks.isPatchableServerlessVersion],
66
- replace: `node${nodeVersion}`
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: `NODEJS_${nodeVersion}_X`
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: `$1${nodeVersion}$3`
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: `$1$2$3${nodeVersion}$5`
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: `${nodeVersion}`
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
- tests: [import_checks.isPatchableServerlessVersion, import_checks.isPatchableSkubaType],
92
- replace: `$1${nodeVersion}$3`
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
- tests: [import_checks.isPatchableServerlessVersion, import_checks.isPatchableSkubaType],
98
- replace: `$1${ECMAScriptVersion}"`
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
- tests: [import_checks.isPatchableServerlessVersion, import_checks.isPatchableSkubaType],
104
- replace: `$1$2${ECMAScriptVersion}$4$5`
105
- },
106
- {
107
- files: "**/docker-compose*.y*ml",
108
- regex: () => /(image: )(public.ecr.aws\/docker\/library\/)?(node:)[0-9.]+(\.[^- \n]+)?(-[^ \n]+)?$/gm,
109
- replace: `$1$2$3${nodeVersion}$5`
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
- if (patch.regex && !patch.regex().test(contents)) {
242
+ const regexResult = patch.regex().exec(contents);
243
+ if (!regexResult) {
125
244
  return;
126
245
  }
127
- if (patch.tests) {
128
- const results = await Promise.all(
129
- patch.tests.map((test) => test(path))
130
- );
131
- if (!results.every(Boolean)) {
132
- return;
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: patch.replace,
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
- }) => await import_fs_extra.default.promises.writeFile(
150
- path,
151
- regex ? contents.replaceAll(regex(), templated) : templated
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(`Upgrading to Node.js ${nodeVersion}`);
296
+ import_logging.log.ok(
297
+ `Upgrading project to Node.js ${nodeVersion} and package targets to Node.js ${packageNodeVersion}`
298
+ );
163
299
  try {
164
- if (!await (0, import_checks.isPatchableNodeVersion)(nodeVersion, dir)) {
165
- throw new Error("Node.js version is not patchable");
166
- }
167
- await upgrade({ nodeVersion, ECMAScriptVersion }, dir);
168
- import_logging.log.ok("Upgraded to Node.js", nodeVersion);
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 {\n isPatchableNodeVersion,\n isPatchableServerlessVersion,\n isPatchableSkubaType,\n} from './checks.js';\n\ntype FileSelector =\n | { files: string; file?: never }\n | { file: string; files?: never };\n\ntype SubPatch = FileSelector & {\n tests?: Array<(path: string) => Promise<boolean>>;\n regex?: () => RegExp;\n replace: string;\n};\n\nconst subPatches = ({\n nodeVersion,\n ECMAScriptVersion,\n}: Versions): SubPatch[] => [\n { file: '.nvmrc', replace: `${nodeVersion}\\n` },\n {\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: `FROM$1 $2node:${nodeVersion}$4$6`,\n },\n {\n files: '**/Dockerfile*',\n regex: () =>\n /^FROM(.*) gcr.io\\/distroless\\/nodejs\\d+-debian(\\d+)(@sha256:[a-f0-9]{64})?(\\.[^- \\n]+)?(-[^ \\n]+)?( .+|)$/gm,\n replace: `FROM$1 gcr.io/distroless/nodejs${nodeVersion}-debian$2$4$5$6`,\n },\n\n {\n files: '**/serverless*.y*ml',\n regex: () => /\\bnodejs\\d+.x\\b/gm,\n tests: [isPatchableServerlessVersion],\n replace: `nodejs${nodeVersion}.x`,\n },\n {\n files: '**/serverless*.y*ml',\n regex: () => /\\bnode\\d+\\b/gm,\n tests: [isPatchableServerlessVersion],\n replace: `node${nodeVersion}`,\n },\n\n {\n files: '**/infra/**/*.ts',\n regex: () => /NODEJS_\\d+_X/g,\n replace: `NODEJS_${nodeVersion}_X`,\n },\n {\n files: '**/infra/**/*.ts',\n regex: () => /(target:\\s*'node)(\\d+)(.+)$/gm,\n replace: `$1${nodeVersion}$3`,\n },\n\n {\n files: '**/.buildkite/*',\n regex: () =>\n /(image: )(public.ecr.aws\\/docker\\/library\\/)?(node:)[0-9.]+(\\.[^- \\n]+)?(-[^ \\n]+)?$/gm,\n replace: `$1$2$3${nodeVersion}$5`,\n },\n {\n files: '.node-version*',\n regex: () => /(\\d+(?:\\.\\d+)*)/g,\n replace: `${nodeVersion}`,\n },\n\n {\n files: '**/package.json',\n regex: () =>\n /([\"']engines[\"']:\\s*{[\\s\\S]*?[\"']node[\"']:\\s*[\"']>=)(\\d+(?:\\.\\d+)*)(['\"]\\s*})/gm,\n tests: [isPatchableServerlessVersion, isPatchableSkubaType],\n replace: `$1${nodeVersion}$3`,\n },\n\n {\n files: '**/tsconfig*.json',\n regex: () => /(\"target\":\\s*\")(ES\\d+)\"/gim,\n tests: [isPatchableServerlessVersion, isPatchableSkubaType],\n replace: `$1${ECMAScriptVersion}\"`,\n },\n {\n files: '**/tsconfig*.json',\n regex: () => /(\"lib\":\\s*\\[)([\\S\\s]*?)(ES\\d+)([\\S\\s]*?)(\\])/gim,\n tests: [isPatchableServerlessVersion, isPatchableSkubaType],\n replace: `$1$2${ECMAScriptVersion}$4$5`,\n },\n\n {\n files: '**/docker-compose*.y*ml',\n regex: () =>\n /(image: )(public.ecr.aws\\/docker\\/library\\/)?(node:)[0-9.]+(\\.[^- \\n]+)?(-[^ \\n]+)?$/gm,\n\n replace: `$1$2$3${nodeVersion}$5`,\n },\n];\n\ntype Versions = {\n nodeVersion: number;\n ECMAScriptVersion: string;\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 if (patch.regex && !patch.regex().test(contents)) {\n return;\n }\n\n if (patch.tests) {\n const results = await Promise.all(\n patch.tests.map((test) => test(path)),\n );\n if (!results.every(Boolean)) {\n return;\n }\n }\n\n await writePatchedContents({\n path,\n contents,\n templated: patch.replace,\n regex: patch.regex,\n });\n }),\n );\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 await fs.promises.writeFile(\n path,\n regex ? contents.replaceAll(regex(), templated) : templated,\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 }: {\n nodeVersion: number;\n ECMAScriptVersion: string;\n },\n dir = process.cwd(),\n) => {\n log.ok(`Upgrading to Node.js ${nodeVersion}`);\n try {\n if (!(await isPatchableNodeVersion(nodeVersion, dir))) {\n throw new Error('Node.js version is not patchable');\n }\n\n await upgrade({ nodeVersion, ECMAScriptVersion }, dir);\n\n log.ok('Upgraded to Node.js', nodeVersion);\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;AAEf,qBAAoB;AACpB,qBAA4C;AAE5C,oBAIO;AAYP,MAAM,aAAa,CAAC;AAAA,EAClB;AAAA,EACA;AACF,MAA4B;AAAA,EAC1B,EAAE,MAAM,UAAU,SAAS,GAAG,WAAW;AAAA,EAAK;AAAA,EAC9C;AAAA,IACE,OAAO;AAAA,IAEP,OAAO,MACL;AAAA,IACF,SAAS,iBAAiB,WAAW;AAAA,EACvC;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,MACL;AAAA,IACF,SAAS,kCAAkC,WAAW;AAAA,EACxD;AAAA,EAEA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,MAAM;AAAA,IACb,OAAO,CAAC,0CAA4B;AAAA,IACpC,SAAS,SAAS,WAAW;AAAA,EAC/B;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,MAAM;AAAA,IACb,OAAO,CAAC,0CAA4B;AAAA,IACpC,SAAS,OAAO,WAAW;AAAA,EAC7B;AAAA,EAEA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,MAAM;AAAA,IACb,SAAS,UAAU,WAAW;AAAA,EAChC;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,MAAM;AAAA,IACb,SAAS,KAAK,WAAW;AAAA,EAC3B;AAAA,EAEA;AAAA,IACE,OAAO;AAAA,IACP,OAAO,MACL;AAAA,IACF,SAAS,SAAS,WAAW;AAAA,EA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A,QACF;AAAA,MACF;AAEA,YAAM,qBAAqB;AAAA,QACzB;AAAA,QACA;AAAA,QACA,WAAW,MAAM;AAAA,QACjB,OAAO,MAAM;AAAA,MACf,CAAC;AAAA,IACH,CAAC;AAAA,EACH;AACF;AAEA,MAAM,uBAAuB,OAAO;AAAA,EAClC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAME,MAAM,gBAAAA,QAAG,SAAS;AAAA,EAChB;AAAA,EACA,QAAQ,SAAS,WAAW,MAAM,GAAG,SAAS,IAAI;AACpD;AAEF,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;AACF,GAIA,MAAM,QAAQ,IAAI,MACf;AACH,qBAAI,GAAG,wBAAwB,WAAW,EAAE;AAC5C,MAAI;AACF,QAAI,CAAE,UAAM,sCAAuB,aAAa,GAAG,GAAI;AACrD,YAAM,IAAI,MAAM,kCAAkC;AAAA,IACpD;AAEA,UAAM,QAAQ,EAAE,aAAa,kBAAkB,GAAG,GAAG;AAErD,uBAAI,GAAG,uBAAuB,WAAW;AAAA,EAC3C,SAAS,OAAO;AACd,uBAAI,IAAI,mBAAmB;AAC3B,uBAAI,WAAO,qBAAQ,KAAK,CAAC;AACzB,YAAQ,WAAW;AAAA,EACrB;AACF;",
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,SAA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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 {};