skuba 13.1.1 → 14.0.0-esbuild-bundle-support-20260101042604
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,6 +1,11 @@
|
|
|
1
1
|
interface EsbuildParameters {
|
|
2
2
|
debug: boolean;
|
|
3
3
|
type: string | undefined;
|
|
4
|
+
external?: string[];
|
|
5
|
+
minify?: boolean;
|
|
6
|
+
bundle?: boolean;
|
|
7
|
+
splitting?: boolean;
|
|
8
|
+
treeShaking?: boolean;
|
|
4
9
|
}
|
|
5
|
-
export declare const esbuild: ({ debug, type }: EsbuildParameters, args?: string[]) => Promise<void>;
|
|
10
|
+
export declare const esbuild: ({ debug, type, external, minify, bundle, splitting, treeShaking, }: EsbuildParameters, args?: string[]) => Promise<void>;
|
|
6
11
|
export {};
|
package/lib/cli/build/esbuild.js
CHANGED
|
@@ -28,7 +28,15 @@ var import_typescript = require("typescript");
|
|
|
28
28
|
var import_logging = require("../../utils/logging.js");
|
|
29
29
|
var import_args = require("./args.js");
|
|
30
30
|
var import_tsc = require("./tsc.js");
|
|
31
|
-
const esbuild = async ({
|
|
31
|
+
const esbuild = async ({
|
|
32
|
+
debug,
|
|
33
|
+
type,
|
|
34
|
+
external,
|
|
35
|
+
minify = false,
|
|
36
|
+
bundle = false,
|
|
37
|
+
splitting = false,
|
|
38
|
+
treeShaking = false
|
|
39
|
+
}, args = process.argv.slice(2)) => {
|
|
32
40
|
const log = (0, import_logging.createLogger)({ debug });
|
|
33
41
|
const tscArgs = (0, import_args.parseTscArgs)(args);
|
|
34
42
|
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
@@ -49,10 +57,14 @@ const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
|
49
57
|
log.debug(log.bold("Compiler options"));
|
|
50
58
|
log.debug((0, import_util.inspect)(compilerOptions));
|
|
51
59
|
const start = process.hrtime.bigint();
|
|
52
|
-
const bundle = false;
|
|
53
60
|
const isEsm = compilerOptions.module !== import_typescript.ModuleKind.CommonJS && type === "module";
|
|
61
|
+
const canSplit = bundle && splitting && isEsm && compilerOptions.outDir;
|
|
54
62
|
await (0, import_esbuild.build)({
|
|
55
63
|
bundle,
|
|
64
|
+
minify: bundle ? minify : false,
|
|
65
|
+
splitting: canSplit ? splitting : false,
|
|
66
|
+
treeShaking: bundle ? treeShaking : false,
|
|
67
|
+
external,
|
|
56
68
|
entryPoints,
|
|
57
69
|
format: !isEsm ? "cjs" : void 0,
|
|
58
70
|
outdir: compilerOptions.outDir,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/esbuild.ts"],
|
|
4
|
-
"sourcesContent": ["import { inspect } from 'util';\n\nimport { TsconfigPathsPlugin } from '@esbuild-plugins/tsconfig-paths';\nimport { build } from 'esbuild';\nimport { ModuleKind, ModuleResolutionKind, ScriptTarget } from 'typescript';\n\nimport { createLogger } from '../../utils/logging.js';\n\nimport { parseTscArgs } from './args.js';\nimport { getCustomConditions, readTsBuildConfig, tsc } from './tsc.js';\n\ninterface EsbuildParameters {\n debug: boolean;\n type: string | undefined;\n}\n\nexport const esbuild = async (\n {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,4BAAoC;AACpC,qBAAsB;AACtB,wBAA+D;AAE/D,qBAA6B;AAE7B,kBAA6B;AAC7B,iBAA4D;
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport { TsconfigPathsPlugin } from '@esbuild-plugins/tsconfig-paths';\nimport { build } from 'esbuild';\nimport { ModuleKind, ModuleResolutionKind, ScriptTarget } from 'typescript';\n\nimport { createLogger } from '../../utils/logging.js';\n\nimport { parseTscArgs } from './args.js';\nimport { getCustomConditions, readTsBuildConfig, tsc } from './tsc.js';\n\ninterface EsbuildParameters {\n debug: boolean;\n type: string | undefined;\n external?: string[];\n minify?: boolean;\n bundle?: boolean;\n splitting?: boolean;\n treeShaking?: boolean;\n}\n\nexport const esbuild = async (\n {\n debug,\n type,\n external,\n minify = false,\n bundle = false,\n splitting = false,\n treeShaking = false,\n }: EsbuildParameters,\n args = process.argv.slice(2),\n) => {\n const log = createLogger({ debug });\n\n const tscArgs = parseTscArgs(args);\n\n const customConditions = getCustomConditions();\n\n if (tscArgs.build) {\n log.err(\n 'skuba does not currently support the tsc --build flag with esbuild',\n );\n process.exitCode = 1;\n return;\n }\n\n const parsedCommandLine = readTsBuildConfig(args, log);\n\n if (!parsedCommandLine || process.exitCode) {\n return;\n }\n\n const { fileNames: entryPoints, options: compilerOptions } =\n parsedCommandLine;\n\n log.debug(log.bold('Files'));\n entryPoints.forEach((filepath) => log.debug(filepath));\n\n log.debug(log.bold('Compiler options'));\n log.debug(inspect(compilerOptions));\n\n const start = process.hrtime.bigint();\n\n const isEsm =\n compilerOptions.module !== ModuleKind.CommonJS && type === 'module';\n\n const canSplit = bundle && splitting && isEsm && compilerOptions.outDir;\n\n await build({\n bundle,\n minify: bundle ? minify : false,\n splitting: canSplit ? splitting : false,\n treeShaking: bundle ? treeShaking : false,\n external,\n entryPoints,\n format: !isEsm ? 'cjs' : undefined,\n outdir: compilerOptions.outDir,\n logLevel: debug ? 'debug' : 'info',\n logLimit: 0,\n platform:\n compilerOptions.moduleResolution === ModuleResolutionKind.NodeJs ||\n compilerOptions.moduleResolution === ModuleResolutionKind.Node16\n ? 'node'\n : undefined,\n plugins: bundle\n ? []\n : [\n // evanw/esbuild#394\n // eslint-disable-next-line new-cap\n TsconfigPathsPlugin({\n tsconfig: { baseUrl: compilerOptions.baseUrl, compilerOptions },\n }),\n ],\n sourcemap: compilerOptions.sourceMap,\n // TODO: as of 0.18, the esbuild CLI no longer infers the target property to\n // avoid ambiguity where multiple `tsconfig.json`s are involved in a build.\n // This would be unusual for a typical SEEK project but we can still explore\n // an explicit setting once we implement `skuba.config.ts` (#1167).\n target: compilerOptions.target\n ? ScriptTarget[compilerOptions.target].toLocaleLowerCase()\n : undefined,\n tsconfig: tscArgs.pathname,\n conditions: customConditions?.length ? customConditions : undefined,\n });\n\n const end = process.hrtime.bigint();\n\n log.plain(`Built in ${log.timing(start, end)}.`);\n\n if (compilerOptions.declaration) {\n await tsc([\n '--declaration',\n '--emitDeclarationOnly',\n ...(tscArgs.project ? ['--project', tscArgs.project] : []),\n ]);\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,4BAAoC;AACpC,qBAAsB;AACtB,wBAA+D;AAE/D,qBAA6B;AAE7B,kBAA6B;AAC7B,iBAA4D;AAYrD,MAAM,UAAU,OACrB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AAAA,EACT,SAAS;AAAA,EACT,YAAY;AAAA,EACZ,cAAc;AAChB,GACA,OAAO,QAAQ,KAAK,MAAM,CAAC,MACxB;AACH,QAAM,UAAM,6BAAa,EAAE,MAAM,CAAC;AAElC,QAAM,cAAU,0BAAa,IAAI;AAEjC,QAAM,uBAAmB,gCAAoB;AAE7C,MAAI,QAAQ,OAAO;AACjB,QAAI;AAAA,MACF;AAAA,IACF;AACA,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,QAAM,wBAAoB,8BAAkB,MAAM,GAAG;AAErD,MAAI,CAAC,qBAAqB,QAAQ,UAAU;AAC1C;AAAA,EACF;AAEA,QAAM,EAAE,WAAW,aAAa,SAAS,gBAAgB,IACvD;AAEF,MAAI,MAAM,IAAI,KAAK,OAAO,CAAC;AAC3B,cAAY,QAAQ,CAAC,aAAa,IAAI,MAAM,QAAQ,CAAC;AAErD,MAAI,MAAM,IAAI,KAAK,kBAAkB,CAAC;AACtC,MAAI,UAAM,qBAAQ,eAAe,CAAC;AAElC,QAAM,QAAQ,QAAQ,OAAO,OAAO;AAEpC,QAAM,QACJ,gBAAgB,WAAW,6BAAW,YAAY,SAAS;AAE7D,QAAM,WAAW,UAAU,aAAa,SAAS,gBAAgB;AAEjE,YAAM,sBAAM;AAAA,IACV;AAAA,IACA,QAAQ,SAAS,SAAS;AAAA,IAC1B,WAAW,WAAW,YAAY;AAAA,IAClC,aAAa,SAAS,cAAc;AAAA,IACpC;AAAA,IACA;AAAA,IACA,QAAQ,CAAC,QAAQ,QAAQ;AAAA,IACzB,QAAQ,gBAAgB;AAAA,IACxB,UAAU,QAAQ,UAAU;AAAA,IAC5B,UAAU;AAAA,IACV,UACE,gBAAgB,qBAAqB,uCAAqB,UAC1D,gBAAgB,qBAAqB,uCAAqB,SACtD,SACA;AAAA,IACN,SAAS,SACL,CAAC,IACD;AAAA;AAAA;AAAA,UAGE,2CAAoB;AAAA,QAClB,UAAU,EAAE,SAAS,gBAAgB,SAAS,gBAAgB;AAAA,MAChE,CAAC;AAAA,IACH;AAAA,IACJ,WAAW,gBAAgB;AAAA;AAAA;AAAA;AAAA;AAAA,IAK3B,QAAQ,gBAAgB,SACpB,+BAAa,gBAAgB,MAAM,EAAE,kBAAkB,IACvD;AAAA,IACJ,UAAU,QAAQ;AAAA,IAClB,YAAY,kBAAkB,SAAS,mBAAmB;AAAA,EAC5D,CAAC;AAED,QAAM,MAAM,QAAQ,OAAO,OAAO;AAElC,MAAI,MAAM,YAAY,IAAI,OAAO,OAAO,GAAG,CAAC,GAAG;AAE/C,MAAI,gBAAgB,aAAa;AAC/B,cAAM,gBAAI;AAAA,MACR;AAAA,MACA;AAAA,MACA,GAAI,QAAQ,UAAU,CAAC,aAAa,QAAQ,OAAO,IAAI,CAAC;AAAA,IAC1D,CAAC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/lib/cli/build/index.js
CHANGED
|
@@ -33,8 +33,16 @@ const build = async (args = process.argv.slice(2)) => {
|
|
|
33
33
|
switch (manifest?.value) {
|
|
34
34
|
case "esbuild": {
|
|
35
35
|
const debug = (0, import_args.hasDebugFlag)(args);
|
|
36
|
+
const esbuildConfig = await (0, import_manifest.getManifestProperties)("esbuildConfig");
|
|
36
37
|
import_logging.log.plain((0, import_node_util.styleText)("yellow", "esbuild"));
|
|
37
|
-
await (0, import_esbuild.esbuild)(
|
|
38
|
+
await (0, import_esbuild.esbuild)(
|
|
39
|
+
{
|
|
40
|
+
debug,
|
|
41
|
+
type: manifest.type,
|
|
42
|
+
external: esbuildConfig?.value?.external
|
|
43
|
+
},
|
|
44
|
+
args
|
|
45
|
+
);
|
|
38
46
|
break;
|
|
39
47
|
}
|
|
40
48
|
// TODO: flip the default case over to `esbuild` in skuba vNext.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { styleText } from 'node:util';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { log } from '../../utils/logging.js';\nimport { getManifestProperties } from '../../utils/manifest.js';\n\nimport { copyAssets } from './assets.js';\nimport { esbuild } from './esbuild.js';\nimport { readTsBuildConfig, tsc } from './tsc.js';\n\nexport const build = async (args = process.argv.slice(2)) => {\n // TODO: define a unified `package.json#/skuba` schema and parser so we don't\n // need all these messy lookups.\n const manifest = await getManifestProperties('build');\n\n switch (manifest?.value) {\n case 'esbuild': {\n const debug = hasDebugFlag(args);\n\n log.plain(styleText('yellow', 'esbuild'));\n await esbuild({
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0B;AAE1B,kBAA6B;AAC7B,qBAAoB;AACpB,sBAAsC;AAEtC,oBAA2B;AAC3B,qBAAwB;AACxB,iBAAuC;AAEhC,MAAM,QAAQ,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAG3D,QAAM,WAAW,UAAM,uCAAsB,OAAO;AAEpD,UAAQ,UAAU,OAAO;AAAA,IACvB,KAAK,WAAW;AACd,YAAM,YAAQ,0BAAa,IAAI;
|
|
4
|
+
"sourcesContent": ["import { styleText } from 'node:util';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { log } from '../../utils/logging.js';\nimport { getManifestProperties } from '../../utils/manifest.js';\n\nimport { copyAssets } from './assets.js';\nimport { esbuild } from './esbuild.js';\nimport { readTsBuildConfig, tsc } from './tsc.js';\n\nexport const build = async (args = process.argv.slice(2)) => {\n // TODO: define a unified `package.json#/skuba` schema and parser so we don't\n // need all these messy lookups.\n const manifest = await getManifestProperties('build');\n\n switch (manifest?.value) {\n case 'esbuild': {\n const debug = hasDebugFlag(args);\n const esbuildConfig = await getManifestProperties<\n 'esbuildConfig',\n {\n external: string[];\n bundle: boolean;\n minify: boolean;\n splitting: boolean;\n treeShaking: boolean;\n }\n >('esbuildConfig');\n\n log.plain(styleText('yellow', 'esbuild'));\n await esbuild(\n {\n debug,\n type: manifest.type,\n external: esbuildConfig?.value?.external,\n },\n args,\n );\n break;\n }\n\n // TODO: flip the default case over to `esbuild` in skuba vNext.\n case undefined:\n case 'tsc': {\n log.plain(styleText('blue', 'tsc'));\n await tsc(args);\n break;\n }\n\n default: {\n log.err(\n 'We don\u2019t support the build tool specified in your',\n log.bold('package.json'),\n 'yet:',\n );\n log.err(\n log.subtle(\n JSON.stringify({ skuba: { build: manifest?.value } }, null, 2),\n ),\n );\n process.exitCode = 1;\n return;\n }\n }\n\n const parsedCommandLine = readTsBuildConfig(args, log);\n\n if (!parsedCommandLine || process.exitCode) {\n return;\n }\n\n const { options: compilerOptions } = parsedCommandLine;\n\n if (!compilerOptions.outDir) {\n return;\n }\n\n await copyAssets(compilerOptions.outDir);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,uBAA0B;AAE1B,kBAA6B;AAC7B,qBAAoB;AACpB,sBAAsC;AAEtC,oBAA2B;AAC3B,qBAAwB;AACxB,iBAAuC;AAEhC,MAAM,QAAQ,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAG3D,QAAM,WAAW,UAAM,uCAAsB,OAAO;AAEpD,UAAQ,UAAU,OAAO;AAAA,IACvB,KAAK,WAAW;AACd,YAAM,YAAQ,0BAAa,IAAI;AAC/B,YAAM,gBAAgB,UAAM,uCAS1B,eAAe;AAEjB,yBAAI,UAAM,4BAAU,UAAU,SAAS,CAAC;AACxC,gBAAM;AAAA,QACJ;AAAA,UACE;AAAA,UACA,MAAM,SAAS;AAAA,UACf,UAAU,eAAe,OAAO;AAAA,QAClC;AAAA,QACA;AAAA,MACF;AACA;AAAA,IACF;AAAA;AAAA,IAGA,KAAK;AAAA,IACL,KAAK,OAAO;AACV,yBAAI,UAAM,4BAAU,QAAQ,KAAK,CAAC;AAClC,gBAAM,gBAAI,IAAI;AACd;AAAA,IACF;AAAA,IAEA,SAAS;AACP,yBAAI;AAAA,QACF;AAAA,QACA,mBAAI,KAAK,cAAc;AAAA,QACvB;AAAA,MACF;AACA,yBAAI;AAAA,QACF,mBAAI;AAAA,UACF,KAAK,UAAU,EAAE,OAAO,EAAE,OAAO,UAAU,MAAM,EAAE,GAAG,MAAM,CAAC;AAAA,QAC/D;AAAA,MACF;AACA,cAAQ,WAAW;AACnB;AAAA,IACF;AAAA,EACF;AAEA,QAAM,wBAAoB,8BAAkB,MAAM,kBAAG;AAErD,MAAI,CAAC,qBAAqB,QAAQ,UAAU;AAC1C;AAAA,EACF;AAEA,QAAM,EAAE,SAAS,gBAAgB,IAAI;AAErC,MAAI,CAAC,gBAAgB,QAAQ;AAC3B;AAAA,EACF;AAEA,YAAM,0BAAW,gBAAgB,MAAM;AACzC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -21,11 +21,16 @@ __export(__exports, {
|
|
|
21
21
|
patches: () => patches
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(__exports);
|
|
24
|
+
var import_patchRootTsconfig = require("./patchRootTsconfig.js");
|
|
24
25
|
var import_upgradeNode = require("./upgradeNode.js");
|
|
25
26
|
const patches = [
|
|
26
27
|
{
|
|
27
28
|
apply: import_upgradeNode.tryUpgradeNode,
|
|
28
|
-
description: "Upgrade Node.js to
|
|
29
|
+
description: "Upgrade Node.js version to 24 and package targets to Node.js 20"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
apply: import_patchRootTsconfig.tryPatchRootTsConfig,
|
|
33
|
+
description: "Add 'rootDir' to root tsconfig.json compilerOptions"
|
|
29
34
|
}
|
|
30
35
|
];
|
|
31
36
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/13.1.1/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { tryPatchRootTsConfig } from './patchRootTsconfig.js';\nimport { tryUpgradeNode } from './upgradeNode.js';\n\nexport const patches: Patches = [\n {\n apply: tryUpgradeNode,\n description:\n 'Upgrade Node.js version to 24 and package targets to Node.js 20',\n },\n {\n apply: tryPatchRootTsConfig,\n description: \"Add 'rootDir' to root tsconfig.json compilerOptions\",\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,+BAAqC;AACrC,yBAA+B;AAExB,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,133 @@
|
|
|
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 patchRootTsconfig_exports = {};
|
|
30
|
+
__export(patchRootTsconfig_exports, {
|
|
31
|
+
patchRootConfig: () => patchRootConfig,
|
|
32
|
+
tryPatchRootTsConfig: () => tryPatchRootTsConfig
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(patchRootTsconfig_exports);
|
|
35
|
+
var import_util = require("util");
|
|
36
|
+
var import_lang_json = __toESM(require("@ast-grep/lang-json"));
|
|
37
|
+
var import_napi = require("@ast-grep/napi");
|
|
38
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
39
|
+
var import_logging = require("../../../../../../utils/logging.js");
|
|
40
|
+
const patchRootConfig = async ({
|
|
41
|
+
mode
|
|
42
|
+
}) => {
|
|
43
|
+
let tsconfigFile;
|
|
44
|
+
try {
|
|
45
|
+
tsconfigFile = await import_fs_extra.default.promises.readFile("tsconfig.json", "utf8");
|
|
46
|
+
} catch {
|
|
47
|
+
return {
|
|
48
|
+
result: "skip",
|
|
49
|
+
reason: "no root tsconfig.json found"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
(0, import_napi.registerDynamicLanguage)({ json: import_lang_json.default });
|
|
53
|
+
const tsconfig = await (0, import_napi.parseAsync)("json", tsconfigFile);
|
|
54
|
+
const ast = tsconfig.root();
|
|
55
|
+
const compilerOptionsObj = ast.find({
|
|
56
|
+
rule: {
|
|
57
|
+
pattern: {
|
|
58
|
+
context: '{"compilerOptions":}',
|
|
59
|
+
selector: "pair"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
if (!compilerOptionsObj) {
|
|
64
|
+
const startingBracket = ast.find({ rule: { pattern: "{" } });
|
|
65
|
+
if (!startingBracket) {
|
|
66
|
+
return {
|
|
67
|
+
result: "skip",
|
|
68
|
+
reason: "Unable to parse tsconfig.json"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
const edit2 = startingBracket.replace(
|
|
72
|
+
`{
|
|
73
|
+
"compilerOptions": {
|
|
74
|
+
"rootDir": "."
|
|
75
|
+
},`
|
|
76
|
+
);
|
|
77
|
+
const newSource2 = ast.commitEdits([edit2]);
|
|
78
|
+
if (mode === "lint") {
|
|
79
|
+
return {
|
|
80
|
+
result: "apply"
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
await import_fs_extra.default.promises.writeFile("tsconfig.json", newSource2, "utf8");
|
|
84
|
+
return {
|
|
85
|
+
result: "apply"
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const rootDirOption = compilerOptionsObj.find({
|
|
89
|
+
rule: { pattern: '"rootDir"' }
|
|
90
|
+
});
|
|
91
|
+
if (rootDirOption) {
|
|
92
|
+
return {
|
|
93
|
+
result: "skip",
|
|
94
|
+
reason: "rootDir already set in tsconfig.json"
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const compilerOptionsStart = compilerOptionsObj.find({
|
|
98
|
+
rule: { pattern: "{" }
|
|
99
|
+
});
|
|
100
|
+
if (!compilerOptionsStart) {
|
|
101
|
+
return {
|
|
102
|
+
result: "skip",
|
|
103
|
+
reason: "Unable to parse tsconfig.json compilerOptions"
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
const edit = compilerOptionsStart.replace(`{
|
|
107
|
+
"rootDir": ".",`);
|
|
108
|
+
const newSource = ast.commitEdits([edit]);
|
|
109
|
+
if (mode === "lint") {
|
|
110
|
+
return {
|
|
111
|
+
result: "apply"
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
await import_fs_extra.default.promises.writeFile("tsconfig.json", newSource, "utf8");
|
|
115
|
+
return {
|
|
116
|
+
result: "apply"
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
const tryPatchRootTsConfig = async (config) => {
|
|
120
|
+
try {
|
|
121
|
+
return await patchRootConfig(config);
|
|
122
|
+
} catch (err) {
|
|
123
|
+
import_logging.log.warn("Failed to patch root `tsconfig.json`");
|
|
124
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
125
|
+
return { result: "skip", reason: "due to an error" };
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
129
|
+
0 && (module.exports = {
|
|
130
|
+
patchRootConfig,
|
|
131
|
+
tryPatchRootTsConfig
|
|
132
|
+
});
|
|
133
|
+
//# sourceMappingURL=patchRootTsconfig.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/13.1.1/patchRootTsconfig.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport json from '@ast-grep/lang-json';\nimport { parseAsync, registerDynamicLanguage } from '@ast-grep/napi';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nexport const patchRootConfig: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n let tsconfigFile: string;\n try {\n tsconfigFile = await fs.promises.readFile('tsconfig.json', 'utf8');\n } catch {\n return {\n result: 'skip',\n reason: 'no root tsconfig.json found',\n };\n }\n\n registerDynamicLanguage({ json });\n const tsconfig = await parseAsync('json', tsconfigFile);\n const ast = tsconfig.root();\n\n const compilerOptionsObj = ast.find({\n rule: {\n pattern: {\n context: '{\"compilerOptions\":}',\n selector: 'pair',\n },\n },\n });\n\n if (!compilerOptionsObj) {\n const startingBracket = ast.find({ rule: { pattern: '{' } });\n\n if (!startingBracket) {\n return {\n result: 'skip',\n reason: 'Unable to parse tsconfig.json',\n };\n }\n\n const edit = startingBracket.replace(\n `{\n \"compilerOptions\": {\n \"rootDir\": \".\"\n },`,\n );\n\n const newSource = ast.commitEdits([edit]);\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await fs.promises.writeFile('tsconfig.json', newSource, 'utf8');\n\n return {\n result: 'apply',\n };\n }\n\n const rootDirOption = compilerOptionsObj.find({\n rule: { pattern: '\"rootDir\"' },\n });\n\n if (rootDirOption) {\n return {\n result: 'skip',\n reason: 'rootDir already set in tsconfig.json',\n };\n }\n\n const compilerOptionsStart = compilerOptionsObj.find({\n rule: { pattern: '{' },\n });\n\n if (!compilerOptionsStart) {\n return {\n result: 'skip',\n reason: 'Unable to parse tsconfig.json compilerOptions',\n };\n }\n\n const edit = compilerOptionsStart.replace(`{\n \"rootDir\": \".\",`);\n\n const newSource = ast.commitEdits([edit]);\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await fs.promises.writeFile('tsconfig.json', newSource, 'utf8');\n\n return {\n result: 'apply',\n };\n};\n\nexport const tryPatchRootTsConfig: PatchFunction = async (config) => {\n try {\n return await patchRootConfig(config);\n } catch (err) {\n log.warn('Failed to patch root `tsconfig.json`');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAwB;AAExB,uBAAiB;AACjB,kBAAoD;AACpD,sBAAe;AAEf,qBAAoB;AAGb,MAAM,kBAAiC,OAAO;AAAA,EACnD;AACF,MAAgC;AAC9B,MAAI;AACJ,MAAI;AACF,mBAAe,MAAM,gBAAAA,QAAG,SAAS,SAAS,iBAAiB,MAAM;AAAA,EACnE,QAAQ;AACN,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,2CAAwB,EAAE,uBAAAC,QAAK,CAAC;AAChC,QAAM,WAAW,UAAM,wBAAW,QAAQ,YAAY;AACtD,QAAM,MAAM,SAAS,KAAK;AAE1B,QAAM,qBAAqB,IAAI,KAAK;AAAA,IAClC,MAAM;AAAA,MACJ,SAAS;AAAA,QACP,SAAS;AAAA,QACT,UAAU;AAAA,MACZ;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,CAAC,oBAAoB;AACvB,UAAM,kBAAkB,IAAI,KAAK,EAAE,MAAM,EAAE,SAAS,IAAI,EAAE,CAAC;AAE3D,QAAI,CAAC,iBAAiB;AACpB,aAAO;AAAA,QACL,QAAQ;AAAA,QACR,QAAQ;AAAA,MACV;AAAA,IACF;AAEA,UAAMC,QAAO,gBAAgB;AAAA,MAC3B;AAAA;AAAA;AAAA;AAAA,IAIF;AAEA,UAAMC,aAAY,IAAI,YAAY,CAACD,KAAI,CAAC;AAExC,QAAI,SAAS,QAAQ;AACnB,aAAO;AAAA,QACL,QAAQ;AAAA,MACV;AAAA,IACF;AAEA,UAAM,gBAAAF,QAAG,SAAS,UAAU,iBAAiBG,YAAW,MAAM;AAE9D,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,gBAAgB,mBAAmB,KAAK;AAAA,IAC5C,MAAM,EAAE,SAAS,YAAY;AAAA,EAC/B,CAAC;AAED,MAAI,eAAe;AACjB,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,uBAAuB,mBAAmB,KAAK;AAAA,IACnD,MAAM,EAAE,SAAS,IAAI;AAAA,EACvB,CAAC;AAED,MAAI,CAAC,sBAAsB;AACzB,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,OAAO,qBAAqB,QAAQ;AAAA,oBACxB;AAElB,QAAM,YAAY,IAAI,YAAY,CAAC,IAAI,CAAC;AAExC,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,gBAAAH,QAAG,SAAS,UAAU,iBAAiB,WAAW,MAAM;AAE9D,SAAO;AAAA,IACL,QAAQ;AAAA,EACV;AACF;AAEO,MAAM,uBAAsC,OAAO,WAAW;AACnE,MAAI;AACF,WAAO,MAAM,gBAAgB,MAAM;AAAA,EACrC,SAAS,KAAK;AACZ,uBAAI,KAAK,sCAAsC;AAC/C,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": ["fs", "json", "edit", "newSource"]
|
|
7
|
+
}
|
|
@@ -23,7 +23,7 @@ __export(upgradeNode_exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(upgradeNode_exports);
|
|
24
24
|
var import_util = require("util");
|
|
25
25
|
var import_logging = require("../../../../../../utils/logging.js");
|
|
26
|
-
var
|
|
26
|
+
var import_migrate = require("../../../../../migrate/index.js");
|
|
27
27
|
const upgradeNode = async ({
|
|
28
28
|
mode
|
|
29
29
|
}) => {
|
|
@@ -36,10 +36,7 @@ const upgradeNode = async ({
|
|
|
36
36
|
if (mode === "lint") {
|
|
37
37
|
return { result: "apply" };
|
|
38
38
|
}
|
|
39
|
-
await (
|
|
40
|
-
nodeVersion: 22,
|
|
41
|
-
ECMAScriptVersion: "ES2024"
|
|
42
|
-
});
|
|
39
|
+
await import_migrate.migrations.node24();
|
|
43
40
|
return { result: "apply" };
|
|
44
41
|
};
|
|
45
42
|
const tryUpgradeNode = async (config) => {
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/13.1.1/upgradeNode.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport { migrations } from '../../../../../migrate/index.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst upgradeNode: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n if (process.env.SKIP_NODE_UPGRADE) {\n return {\n result: 'skip',\n reason: 'SKIP_NODE_UPGRADE environment variable set',\n };\n }\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n await migrations.node24();\n\n return { result: 'apply' };\n};\n\nexport const tryUpgradeNode: PatchFunction = async (config) => {\n try {\n return await upgradeNode(config);\n } catch (err) {\n log.warn('Failed to upgrade node version');\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,qBAAoB;AACpB,qBAA2B;AAG3B,MAAM,cAA6B,OAAO;AAAA,EACxC;AACF,MAAgC;AAC9B,MAAI,QAAQ,IAAI,mBAAmB;AACjC,WAAO;AAAA,MACL,QAAQ;AAAA,MACR,QAAQ;AAAA,IACV;AAAA,EACF;AACA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,QAAM,0BAAW,OAAO;AAExB,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,iBAAgC,OAAO,WAAW;AAC7D,MAAI;AACF,WAAO,MAAM,YAAY,MAAM;AAAA,EACjC,SAAS,KAAK;AACZ,uBAAI,KAAK,gCAAgC;AACzC,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/lib/cli/migrate/index.js
CHANGED
|
@@ -18,19 +18,58 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
19
|
var migrate_exports = {};
|
|
20
20
|
__export(migrate_exports, {
|
|
21
|
-
migrate: () => migrate
|
|
21
|
+
migrate: () => migrate,
|
|
22
|
+
migrations: () => migrations
|
|
22
23
|
});
|
|
23
24
|
module.exports = __toCommonJS(migrate_exports);
|
|
24
25
|
var import_logging = require("../../utils/logging.js");
|
|
25
26
|
var import_nodeVersion = require("./nodeVersion/index.js");
|
|
26
27
|
const migrations = {
|
|
27
28
|
node20: () => (0, import_nodeVersion.nodeVersionMigration)({
|
|
28
|
-
nodeVersion: 20,
|
|
29
|
-
ECMAScriptVersion: "ES2023"
|
|
29
|
+
nodeVersion: "20",
|
|
30
|
+
ECMAScriptVersion: "ES2023",
|
|
31
|
+
packageNodeVersion: "16",
|
|
32
|
+
packageECMAScriptVersion: "ES2021",
|
|
33
|
+
infraPackages: []
|
|
30
34
|
}),
|
|
31
35
|
node22: () => (0, import_nodeVersion.nodeVersionMigration)({
|
|
32
|
-
nodeVersion: 22,
|
|
33
|
-
ECMAScriptVersion: "ES2024"
|
|
36
|
+
nodeVersion: "22",
|
|
37
|
+
ECMAScriptVersion: "ES2024",
|
|
38
|
+
packageNodeVersion: "18",
|
|
39
|
+
packageECMAScriptVersion: "ES2022",
|
|
40
|
+
infraPackages: []
|
|
41
|
+
}),
|
|
42
|
+
node24: () => (0, import_nodeVersion.nodeVersionMigration)({
|
|
43
|
+
nodeVersion: "24",
|
|
44
|
+
ECMAScriptVersion: "ES2024",
|
|
45
|
+
packageNodeVersion: "20",
|
|
46
|
+
packageECMAScriptVersion: "ES2023",
|
|
47
|
+
infraPackages: [
|
|
48
|
+
{
|
|
49
|
+
name: "aws-cdk-lib",
|
|
50
|
+
version: "2.224.0"
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: "datadog-cdk-constructs-v2",
|
|
54
|
+
version: "3.4.0"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: "osls",
|
|
58
|
+
version: "3.61.0"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: "serverless",
|
|
62
|
+
version: "4.25.0"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
name: "serverless-plugin-datadog",
|
|
66
|
+
version: "5.114.0"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: "@types/node",
|
|
70
|
+
version: "24.10.1"
|
|
71
|
+
}
|
|
72
|
+
]
|
|
34
73
|
})
|
|
35
74
|
};
|
|
36
75
|
const logAvailableMigrations = () => {
|
|
@@ -61,6 +100,7 @@ const migrate = async (args = process.argv.slice(2)) => {
|
|
|
61
100
|
};
|
|
62
101
|
// Annotate the CommonJS export names for ESM import in node:
|
|
63
102
|
0 && (module.exports = {
|
|
64
|
-
migrate
|
|
103
|
+
migrate,
|
|
104
|
+
migrations
|
|
65
105
|
});
|
|
66
106
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/migrate/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { log } from '../../utils/logging.js';\n\nimport { nodeVersionMigration } from './nodeVersion/index.js';\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAEpB,yBAAqC;
|
|
4
|
+
"sourcesContent": ["import { log } from '../../utils/logging.js';\n\nimport { nodeVersionMigration } from './nodeVersion/index.js';\n\nexport const migrations = {\n node20: () =>\n nodeVersionMigration({\n nodeVersion: '20',\n ECMAScriptVersion: 'ES2023',\n packageNodeVersion: '16',\n packageECMAScriptVersion: 'ES2021',\n infraPackages: [],\n }),\n node22: () =>\n nodeVersionMigration({\n nodeVersion: '22',\n ECMAScriptVersion: 'ES2024',\n packageNodeVersion: '18',\n packageECMAScriptVersion: 'ES2022',\n infraPackages: [],\n }),\n node24: () =>\n nodeVersionMigration({\n nodeVersion: '24',\n ECMAScriptVersion: 'ES2024',\n packageNodeVersion: '20',\n packageECMAScriptVersion: 'ES2023',\n infraPackages: [\n {\n name: 'aws-cdk-lib',\n version: '2.224.0',\n },\n {\n name: 'datadog-cdk-constructs-v2',\n version: '3.4.0',\n },\n {\n name: 'osls',\n version: '3.61.0',\n },\n {\n name: 'serverless',\n version: '4.25.0',\n },\n {\n name: 'serverless-plugin-datadog',\n version: '5.114.0',\n },\n {\n name: '@types/node',\n version: '24.10.1',\n },\n ],\n }),\n} satisfies Record<string, () => Promise<void>>;\n\nconst logAvailableMigrations = () => {\n log.ok('Available migrations:');\n Object.keys(migrations).forEach((migration) => {\n log.ok(`- ${migration}`);\n });\n};\n\nexport const migrate = async (args = process.argv.slice(2)) => {\n if (!args[0]) {\n log.err('Provide a migration to run.');\n logAvailableMigrations();\n process.exitCode = 1;\n return;\n }\n\n if (args.includes('--help') || args.includes('-h') || args[0] === 'help') {\n logAvailableMigrations();\n return;\n }\n\n const migration = migrations[args[0] as keyof typeof migrations];\n\n if (!migration) {\n log.err(`Migration \"${args[0]}\" is not a valid option.`);\n logAvailableMigrations();\n process.exitCode = 1;\n return;\n }\n\n await migration();\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AAEpB,yBAAqC;AAE9B,MAAM,aAAa;AAAA,EACxB,QAAQ,UACN,yCAAqB;AAAA,IACnB,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,eAAe,CAAC;AAAA,EAClB,CAAC;AAAA,EACH,QAAQ,UACN,yCAAqB;AAAA,IACnB,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,eAAe,CAAC;AAAA,EAClB,CAAC;AAAA,EACH,QAAQ,UACN,yCAAqB;AAAA,IACnB,aAAa;AAAA,IACb,mBAAmB;AAAA,IACnB,oBAAoB;AAAA,IACpB,0BAA0B;AAAA,IAC1B,eAAe;AAAA,MACb;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,MACA;AAAA,QACE,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF;AAAA,EACF,CAAC;AACL;AAEA,MAAM,yBAAyB,MAAM;AACnC,qBAAI,GAAG,uBAAuB;AAC9B,SAAO,KAAK,UAAU,EAAE,QAAQ,CAAC,cAAc;AAC7C,uBAAI,GAAG,KAAK,SAAS,EAAE;AAAA,EACzB,CAAC;AACH;AAEO,MAAM,UAAU,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAC7D,MAAI,CAAC,KAAK,CAAC,GAAG;AACZ,uBAAI,IAAI,6BAA6B;AACrC,2BAAuB;AACvB,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,MAAI,KAAK,SAAS,QAAQ,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,CAAC,MAAM,QAAQ;AACxE,2BAAuB;AACvB;AAAA,EACF;AAEA,QAAM,YAAY,WAAW,KAAK,CAAC,CAA4B;AAE/D,MAAI,CAAC,WAAW;AACd,uBAAI,IAAI,cAAc,KAAK,CAAC,CAAC,0BAA0B;AACvD,2BAAuB;AACvB,YAAQ,WAAW;AACnB;AAAA,EACF;AAEA,QAAM,UAAU;AAClB;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,14 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const extractFromParentPackageJson: <T extends z.ZodRawShape>(schema: z.ZodObject<T>, currentPath: string) => Promise<{
|
|
3
|
-
packageJson: undefined;
|
|
4
|
-
packageJsonRelativePath: undefined;
|
|
5
|
-
} | {
|
|
6
|
-
packageJson: undefined;
|
|
7
|
-
packageJsonRelativePath: string;
|
|
8
|
-
} | {
|
|
9
|
-
packageJson: z.core.$InferObjectOutput<T, {}>;
|
|
10
|
-
packageJsonRelativePath: string;
|
|
11
|
-
}>;
|
|
12
|
-
export declare const isPatchableServerlessVersion: (currentPath: string) => Promise<boolean>;
|
|
13
|
-
export declare const isPatchableSkubaType: (currentPath: string) => Promise<boolean>;
|
|
14
|
-
export declare const isPatchableNodeVersion: (targetNodeVersion: number, currentPath: string) => Promise<boolean>;
|
|
1
|
+
export declare const isLikelyPackage: (currentPath: string) => Promise<boolean>;
|