skuba 13.0.0-custom-conditions-exports-20251007055842 → 13.0.0-custom-conditions-exports-20251009024033
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.js +3 -1
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/configure/modules/index.js +1 -1
- package/lib/cli/configure/modules/index.js.map +2 -2
- package/lib/cli/configure/modules/nodemon.d.ts +1 -1
- package/lib/cli/configure/modules/nodemon.js +1 -1
- package/lib/cli/configure/modules/nodemon.js.map +2 -2
- package/lib/cli/configure/modules/serverless.d.ts +1 -1
- package/lib/cli/configure/modules/serverless.js +1 -1
- package/lib/cli/configure/modules/serverless.js.map +2 -2
- package/lib/cli/configure/modules/skubaDive.d.ts +1 -1
- package/lib/cli/configure/modules/skubaDive.js +5 -1
- package/lib/cli/configure/modules/skubaDive.js.map +2 -2
- package/lib/cli/configure/modules/tslint.d.ts +1 -1
- package/lib/cli/configure/modules/tslint.js +1 -1
- package/lib/cli/configure/modules/tslint.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.js +6 -1
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/updateLambdaConfigs.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/updateLambdaConfigs.js +399 -0
- package/lib/cli/lint/internalLints/upgrade/patches/13.0.0/updateLambdaConfigs.js.map +7 -0
- package/lib/cli/start/index.js +2 -4
- package/lib/cli/start/index.js.map +2 -2
- package/package.json +5 -5
- package/template/express-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/express-rest-api/package.json +1 -1
- package/template/greeter/.buildkite/pipeline.yml +1 -1
- package/template/greeter/package.json +1 -1
- package/template/koa-rest-api/.buildkite/pipeline.yml +1 -1
- package/template/koa-rest-api/package.json +1 -1
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +2 -2
- package/template/lambda-sqs-worker-cdk/package.json +1 -1
package/lib/cli/build/esbuild.js
CHANGED
|
@@ -41,6 +41,7 @@ var import_tsc = require("./tsc.js");
|
|
|
41
41
|
const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
42
42
|
const log = (0, import_logging.createLogger)({ debug });
|
|
43
43
|
const tscArgs = (0, import_args.parseTscArgs)(args);
|
|
44
|
+
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
44
45
|
if (tscArgs.build) {
|
|
45
46
|
log.err(
|
|
46
47
|
"skuba does not currently support the tsc --build flag with esbuild"
|
|
@@ -80,7 +81,8 @@ const esbuild = async ({ debug, type }, args = process.argv.slice(2)) => {
|
|
|
80
81
|
// This would be unusual for a typical SEEK project but we can still explore
|
|
81
82
|
// an explicit setting once we implement `skuba.config.ts` (#1167).
|
|
82
83
|
target: compilerOptions.target ? import_typescript.ScriptTarget[compilerOptions.target].toLocaleLowerCase() : void 0,
|
|
83
|
-
tsconfig: tscArgs.pathname
|
|
84
|
+
tsconfig: tscArgs.pathname,
|
|
85
|
+
conditions: customConditions?.length ? customConditions : void 0
|
|
84
86
|
});
|
|
85
87
|
const end = process.hrtime.bigint();
|
|
86
88
|
log.plain(`Built in ${log.timing(start, end)}.`);
|
|
@@ -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 tsconfigPaths 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 { readTsBuildConfig, tsc } from './tsc.js';\n\ninterface EsbuildParameters {\n debug: boolean;\n type: string | undefined;\n}\n\nexport const esbuild = async (\n { debug, type }: EsbuildParameters,\n args = process.argv.slice(2),\n) => {\n const log = createLogger({ debug });\n\n const tscArgs = parseTscArgs(args);\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 // TODO: support `bundle`, `minify`, `splitting`, `treeShaking`\n const bundle = false;\n\n const isEsm =\n compilerOptions.module !== ModuleKind.CommonJS && type === 'module';\n\n await build({\n bundle,\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 tsconfigPaths({\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 });\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,4BAA0B;AAC1B,qBAAsB;AACtB,wBAA+D;AAE/D,qBAA6B;AAE7B,kBAA6B;AAC7B,
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport tsconfigPaths 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 { debug, type }: 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 // TODO: support `bundle`, `minify`, `splitting`, `treeShaking`\n const bundle = false;\n\n const isEsm =\n compilerOptions.module !== ModuleKind.CommonJS && type === 'module';\n\n await build({\n bundle,\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 tsconfigPaths({\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,4BAA0B;AAC1B,qBAAsB;AACtB,wBAA+D;AAE/D,qBAA6B;AAE7B,kBAA6B;AAC7B,iBAA4D;AAOrD,MAAM,UAAU,OACrB,EAAE,OAAO,KAAK,GACd,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,S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
|
@@ -43,7 +43,7 @@ const loadModules = (opts) => Promise.all(
|
|
|
43
43
|
import_serverless.serverlessModule,
|
|
44
44
|
import_skubaDive.skubaDiveModule,
|
|
45
45
|
import_tslint.tslintModule
|
|
46
|
-
].map((createModule) => createModule(opts))
|
|
46
|
+
].map(async (createModule) => createModule(opts))
|
|
47
47
|
);
|
|
48
48
|
// Annotate the CommonJS export names for ESM import in node:
|
|
49
49
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/modules/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Module, Options } from '../types.js';\n\nimport { eslintModule } from './eslint.js';\nimport { ignoreModule } from './ignore.js';\nimport { jestModule } from './jest.js';\nimport { nodemonModule } from './nodemon.js';\nimport { packageModule } from './package.js';\nimport { prettierModule } from './prettier.js';\nimport { renovateModule } from './renovate.js';\nimport { serverlessModule } from './serverless.js';\nimport { skubaDiveModule } from './skubaDive.js';\nimport { tslintModule } from './tslint.js';\n\nexport const loadModules = (opts: Options): Promise<Module[]> =>\n Promise.all(\n [\n eslintModule,\n ignoreModule,\n jestModule,\n nodemonModule,\n packageModule,\n prettierModule,\n renovateModule,\n serverlessModule,\n skubaDiveModule,\n tslintModule,\n ].map((createModule) => createModule(opts)),\n );\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA6B;AAC7B,oBAA6B;AAC7B,kBAA2B;AAC3B,qBAA8B;AAC9B,qBAA8B;AAC9B,sBAA+B;AAC/B,sBAA+B;AAC/B,wBAAiC;AACjC,uBAAgC;AAChC,oBAA6B;AAEtB,MAAM,cAAc,CAAC,SAC1B,QAAQ;AAAA,EACN;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,IAAI,
|
|
4
|
+
"sourcesContent": ["import type { Module, Options } from '../types.js';\n\nimport { eslintModule } from './eslint.js';\nimport { ignoreModule } from './ignore.js';\nimport { jestModule } from './jest.js';\nimport { nodemonModule } from './nodemon.js';\nimport { packageModule } from './package.js';\nimport { prettierModule } from './prettier.js';\nimport { renovateModule } from './renovate.js';\nimport { serverlessModule } from './serverless.js';\nimport { skubaDiveModule } from './skubaDive.js';\nimport { tslintModule } from './tslint.js';\n\nexport const loadModules = (opts: Options): Promise<Module[]> =>\n Promise.all(\n [\n eslintModule,\n ignoreModule,\n jestModule,\n nodemonModule,\n packageModule,\n prettierModule,\n renovateModule,\n serverlessModule,\n skubaDiveModule,\n tslintModule,\n ].map(async (createModule) => createModule(opts)),\n );\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,oBAA6B;AAC7B,oBAA6B;AAC7B,kBAA2B;AAC3B,qBAA8B;AAC9B,qBAA8B;AAC9B,sBAA+B;AAC/B,sBAA+B;AAC/B,wBAAiC;AACjC,uBAAgC;AAChC,oBAA6B;AAEtB,MAAM,cAAc,CAAC,SAC1B,QAAQ;AAAA,EACN;AAAA,IACE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,EAAE,IAAI,OAAO,iBAAiB,aAAa,IAAI,CAAC;AAClD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Module } from '../types.js';
|
|
2
|
-
export declare const nodemonModule: () => Module
|
|
2
|
+
export declare const nodemonModule: () => Promise<Module>;
|
|
@@ -22,7 +22,7 @@ __export(nodemon_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(nodemon_exports);
|
|
24
24
|
var import_deleteFiles = require("../processing/deleteFiles.js");
|
|
25
|
-
const nodemonModule = () => (0, import_deleteFiles.deleteFiles)("nodemon.json");
|
|
25
|
+
const nodemonModule = () => Promise.resolve((0, import_deleteFiles.deleteFiles)("nodemon.json"));
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
28
28
|
nodemonModule
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/modules/nodemon.ts"],
|
|
4
|
-
"sourcesContent": ["import { deleteFiles } from '../processing/deleteFiles.js';\nimport type { Module } from '../types.js';\n\nexport const nodemonModule = (): Module
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAGrB,MAAM,gBAAgB,
|
|
4
|
+
"sourcesContent": ["import { deleteFiles } from '../processing/deleteFiles.js';\nimport type { Module } from '../types.js';\n\nexport const nodemonModule = (): Promise<Module> =>\n Promise.resolve(deleteFiles('nodemon.json'));\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAGrB,MAAM,gBAAgB,MAC3B,QAAQ,YAAQ,gCAAY,cAAc,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Module, Options } from '../types.js';
|
|
2
|
-
export declare const serverlessModule: ({}: Options) => Module
|
|
2
|
+
export declare const serverlessModule: ({}: Options) => Promise<Module>;
|
|
@@ -21,7 +21,7 @@ __export(serverless_exports, {
|
|
|
21
21
|
serverlessModule: () => serverlessModule
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(serverless_exports);
|
|
24
|
-
const serverlessModule = ({}) => ({
|
|
24
|
+
const serverlessModule = ({}) => Promise.resolve({
|
|
25
25
|
"**/serverless*.yml": (inputFile, _files, _initialFiles) => {
|
|
26
26
|
if (!inputFile) {
|
|
27
27
|
return;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/modules/serverless.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Module, Options } from '../types.js';\n\nexport const serverlessModule = ({}: Options): Module
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,mBAAmB,CAAC,CAAC,
|
|
4
|
+
"sourcesContent": ["import type { Module, Options } from '../types.js';\n\nexport const serverlessModule = ({}: Options): Promise<Module> =>\n Promise.resolve({\n '**/serverless*.yml': (inputFile, _files, _initialFiles) => {\n if (!inputFile) {\n // Only configure files that exist.\n return;\n }\n\n return (\n inputFile\n // Rewire packaging patterns.\n .replace(/- (\\.?\\/)?dist\\//g, '- lib/')\n // Rewire handler paths.\n .replace(/handler: (\\.?\\/)?dist\\//g, 'handler: lib/')\n );\n },\n });\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEO,MAAM,mBAAmB,CAAC,CAAC,MAChC,QAAQ,QAAQ;AAAA,EACd,sBAAsB,CAAC,WAAW,QAAQ,kBAAkB;AAC1D,QAAI,CAAC,WAAW;AAEd;AAAA,IACF;AAEA,WACE,UAEG,QAAQ,qBAAqB,QAAQ,EAErC,QAAQ,4BAA4B,eAAe;AAAA,EAE1D;AACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Module, Options } from '../types.js';
|
|
2
|
-
export declare const skubaDiveModule: ({ entryPoint, type }: Options) => Module
|
|
2
|
+
export declare const skubaDiveModule: ({ entryPoint, type, }: Options) => Promise<Module>;
|
|
@@ -37,7 +37,11 @@ var import_javascript = require("../processing/javascript.js");
|
|
|
37
37
|
var import_loadFiles = require("../processing/loadFiles.js");
|
|
38
38
|
var import_package = require("../processing/package.js");
|
|
39
39
|
const DEFAULT_FILENAME = "src/register.ts";
|
|
40
|
-
const skubaDiveModule = ({
|
|
40
|
+
const skubaDiveModule = async ({
|
|
41
|
+
entryPoint,
|
|
42
|
+
type
|
|
43
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
44
|
+
}) => {
|
|
41
45
|
if (type === "package") {
|
|
42
46
|
return {};
|
|
43
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/modules/skubaDive.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport { SKUBA_DIVE_HOOKS } from '../dependencies/skubaDive.js';\nimport { prependImport, stripImports } from '../processing/javascript.js';\nimport { loadFiles } from '../processing/loadFiles.js';\nimport { parsePackage } from '../processing/package.js';\nimport type { Module, Options } from '../types.js';\n\nconst DEFAULT_FILENAME = 'src/register.ts';\n\nexport const skubaDiveModule = ({
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,uBAAiC;AACjC,wBAA4C;AAC5C,uBAA0B;AAC1B,qBAA6B;AAG7B,MAAM,mBAAmB;AAElB,MAAM,kBAAkB,
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport { SKUBA_DIVE_HOOKS } from '../dependencies/skubaDive.js';\nimport { prependImport, stripImports } from '../processing/javascript.js';\nimport { loadFiles } from '../processing/loadFiles.js';\nimport { parsePackage } from '../processing/package.js';\nimport type { Module, Options } from '../types.js';\n\nconst DEFAULT_FILENAME = 'src/register.ts';\n\nexport const skubaDiveModule = async ({\n entryPoint,\n type,\n // eslint-disable-next-line @typescript-eslint/require-await\n}: Options): Promise<Module> => {\n // skuba-dive is a runtime component; it's not appropriate for packages\n if (type === 'package') {\n return {};\n }\n\n return {\n ...loadFiles(DEFAULT_FILENAME, 'package.json'),\n\n [entryPoint]: (inputFile, files) => {\n const packageJson = parsePackage(files['package.json']);\n\n const registerFile = files[DEFAULT_FILENAME];\n\n if (\n !packageJson?.dependencies?.['skuba-dive'] ||\n inputFile === undefined ||\n inputFile.includes('skuba-dive/register') ||\n registerFile?.includes('skuba-dive/register')\n ) {\n return inputFile;\n }\n\n const outputFile = stripImports(SKUBA_DIVE_HOOKS, inputFile);\n\n const relativeToSrc = path.posix.relative(\n path.join(entryPoint, '..'),\n 'src',\n );\n\n // import skuba-dive directly from the entry point\n if (relativeToSrc === '') {\n return prependImport('skuba-dive/register', outputFile);\n }\n\n // import skuba-dive via src/register.ts\n files[DEFAULT_FILENAME] = prependImport(\n 'skuba-dive/register',\n registerFile,\n );\n\n return prependImport(`${relativeToSrc}/register`, outputFile);\n },\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,uBAAiC;AACjC,wBAA4C;AAC5C,uBAA0B;AAC1B,qBAA6B;AAG7B,MAAM,mBAAmB;AAElB,MAAM,kBAAkB,OAAO;AAAA,EACpC;AAAA,EACA;AAAA;AAEF,MAAgC;AAE9B,MAAI,SAAS,WAAW;AACtB,WAAO,CAAC;AAAA,EACV;AAEA,SAAO;AAAA,IACL,OAAG,4BAAU,kBAAkB,cAAc;AAAA,IAE7C,CAAC,UAAU,GAAG,CAAC,WAAW,UAAU;AAClC,YAAM,kBAAc,6BAAa,MAAM,cAAc,CAAC;AAEtD,YAAM,eAAe,MAAM,gBAAgB;AAE3C,UACE,CAAC,aAAa,eAAe,YAAY,KACzC,cAAc,UACd,UAAU,SAAS,qBAAqB,KACxC,cAAc,SAAS,qBAAqB,GAC5C;AACA,eAAO;AAAA,MACT;AAEA,YAAM,iBAAa,gCAAa,mCAAkB,SAAS;AAE3D,YAAM,gBAAgB,YAAAA,QAAK,MAAM;AAAA,QAC/B,YAAAA,QAAK,KAAK,YAAY,IAAI;AAAA,QAC1B;AAAA,MACF;AAGA,UAAI,kBAAkB,IAAI;AACxB,mBAAO,iCAAc,uBAAuB,UAAU;AAAA,MACxD;AAGA,YAAM,gBAAgB,QAAI;AAAA,QACxB;AAAA,QACA;AAAA,MACF;AAEA,iBAAO,iCAAc,GAAG,aAAa,aAAa,UAAU;AAAA,IAC9D;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["path"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Module } from '../types.js';
|
|
2
|
-
export declare const tslintModule: () => Module
|
|
2
|
+
export declare const tslintModule: () => Promise<Module>;
|
|
@@ -22,7 +22,7 @@ __export(tslint_exports, {
|
|
|
22
22
|
});
|
|
23
23
|
module.exports = __toCommonJS(tslint_exports);
|
|
24
24
|
var import_deleteFiles = require("../processing/deleteFiles.js");
|
|
25
|
-
const tslintModule = () => (0, import_deleteFiles.deleteFiles)("tslint.json", "tslint.yaml");
|
|
25
|
+
const tslintModule = () => Promise.resolve((0, import_deleteFiles.deleteFiles)("tslint.json", "tslint.yaml"));
|
|
26
26
|
// Annotate the CommonJS export names for ESM import in node:
|
|
27
27
|
0 && (module.exports = {
|
|
28
28
|
tslintModule
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/configure/modules/tslint.ts"],
|
|
4
|
-
"sourcesContent": ["import { deleteFiles } from '../processing/deleteFiles.js';\nimport type { Module } from '../types.js';\n\nexport const tslintModule = (): Module =>\n deleteFiles('tslint.json', 'tslint.yaml');\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAGrB,MAAM,eAAe,
|
|
4
|
+
"sourcesContent": ["import { deleteFiles } from '../processing/deleteFiles.js';\nimport type { Module } from '../types.js';\n\nexport const tslintModule = (): Promise<Module> =>\n Promise.resolve(deleteFiles('tslint.json', 'tslint.yaml'));\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAA4B;AAGrB,MAAM,eAAe,MAC1B,QAAQ,YAAQ,gCAAY,eAAe,aAAa,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -23,6 +23,7 @@ __export(__exports, {
|
|
|
23
23
|
module.exports = __toCommonJS(__exports);
|
|
24
24
|
var import_configureTsConfigForESM = require("./configureTsConfigForESM.js");
|
|
25
25
|
var import_rewriteSrcImports = require("./rewriteSrcImports.js");
|
|
26
|
+
var import_updateLambdaConfigs = require("./updateLambdaConfigs.js");
|
|
26
27
|
const patches = [
|
|
27
28
|
{
|
|
28
29
|
apply: import_rewriteSrcImports.rewriteSrcImports,
|
|
@@ -30,7 +31,11 @@ const patches = [
|
|
|
30
31
|
},
|
|
31
32
|
{
|
|
32
33
|
apply: import_configureTsConfigForESM.configureTsConfigForESM,
|
|
33
|
-
description: "Configure `tsconfig.json`, `package.json` and `jest.config.ts`
|
|
34
|
+
description: "Configure `tsconfig.json`, `package.json` and `jest.config.ts` to support custom conditions"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
apply: import_updateLambdaConfigs.updateLambdaConfigs,
|
|
38
|
+
description: "Update lambda function configurations to support custom conditions"
|
|
34
39
|
}
|
|
35
40
|
];
|
|
36
41
|
// Annotate the CommonJS export names for ESM import in node:
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/13.0.0/index.ts"],
|
|
4
|
-
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { configureTsConfigForESM } from './configureTsConfigForESM.js';\nimport { rewriteSrcImports } from './rewriteSrcImports.js';\n\nexport const patches: Patches = [\n {\n apply: rewriteSrcImports,\n description: \"Rewrite all 'src' imports to be '#src'\",\n },\n {\n apply: configureTsConfigForESM,\n description:\n 'Configure `tsconfig.json`, `package.json` and `jest.config.ts`
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qCAAwC;AACxC,+BAAkC;
|
|
4
|
+
"sourcesContent": ["import type { Patches } from '../../index.js';\n\nimport { configureTsConfigForESM } from './configureTsConfigForESM.js';\nimport { rewriteSrcImports } from './rewriteSrcImports.js';\nimport { updateLambdaConfigs } from './updateLambdaConfigs.js';\n\nexport const patches: Patches = [\n {\n apply: rewriteSrcImports,\n description: \"Rewrite all 'src' imports to be '#src'\",\n },\n {\n apply: configureTsConfigForESM,\n description:\n 'Configure `tsconfig.json`, `package.json` and `jest.config.ts` to support custom conditions',\n },\n {\n apply: updateLambdaConfigs,\n description:\n 'Update lambda function configurations to support custom conditions',\n },\n];\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAEA,qCAAwC;AACxC,+BAAkC;AAClC,iCAAoC;AAE7B,MAAM,UAAmB;AAAA,EAC9B;AAAA,IACE,OAAO;AAAA,IACP,aAAa;AAAA,EACf;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AAAA,EACA;AAAA,IACE,OAAO;AAAA,IACP,aACE;AAAA,EACJ;AACF;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -61,7 +61,7 @@ const hasRelativeRegisterImportRegex = /import\s+['"](\.\.?\/.*?register)(?:\.js
|
|
|
61
61
|
const hasRelativeImportRegex = /import\s+['"](\.\.?\/[^'"]*?)(?:\.js)?['"];?\s*/gm;
|
|
62
62
|
const hasSrcImportRegex = /import\s+(?:type\s+\{[^}]*\}|\{[^}]*\}|\*\s+as\s+\w+|\w+(?:\s*,\s*\{[^}]*\})?)\s+from\s+['"]src\/[^'"]*['"]/gm;
|
|
63
63
|
const hasImportRegex = /import\(\s*["']src\/[^'"]*["']\s*\)/gm;
|
|
64
|
-
const hasJestMockRegex = /jest\.mock\(\s*["']src\/[^'"]*["']/gm;
|
|
64
|
+
const hasJestMockRegex = /jest\.(mock|doMock)\(\s*["']src\/[^'"]*["']/gm;
|
|
65
65
|
const multiLineCommentRegex = /\/\*[\s\S]*?\*\//g;
|
|
66
66
|
const singleLineCommentRegex = /\/\/.*$/gm;
|
|
67
67
|
const whitespaceRegex = /\s/g;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/13.0.0/rewriteSrcImports.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nexport const hasSkubaDiveRegisterImportRegex =\n /import\\s+['\"](?:skuba-dive\\/register)(?:\\.js)?['\"];?\\s*/gm;\n\nexport const hasRelativeRegisterImportRegex =\n /import\\s+['\"](\\.\\.?\\/.*?register)(?:\\.js)?['\"];?\\s*/gm;\n\nexport const hasRelativeImportRegex =\n /import\\s+['\"](\\.\\.?\\/[^'\"]*?)(?:\\.js)?['\"];?\\s*/gm;\n\nexport const hasSrcImportRegex =\n /import\\s+(?:type\\s+\\{[^}]*\\}|\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+(?:\\s*,\\s*\\{[^}]*\\})?)\\s+from\\s+['\"]src\\/[^'\"]*['\"]/gm;\n\nexport const hasImportRegex = /import\\(\\s*[\"']src\\/[^'\"]*[\"']\\s*\\)/gm;\n\nexport const hasJestMockRegex = /jest\\.mock\\(\\s*[\"']src\\/[^'\"]*[\"']/gm;\n\nconst multiLineCommentRegex = /\\/\\*[\\s\\S]*?\\*\\//g;\n\nconst singleLineCommentRegex = /\\/\\/.*$/gm;\n\nconst whitespaceRegex = /\\s/g;\n\nconst removeSkubaDiveRegisterImport = (contents: string) =>\n contents.replace(hasSkubaDiveRegisterImportRegex, '');\n\nconst removeRelativeRegisterImport = (contents: string) =>\n contents.replace(hasRelativeRegisterImportRegex, '');\n\nconst removeSelectiveRelativeImports = (\n contents: string,\n file: string,\n deletionSet: Set<string>,\n): string =>\n contents.replace(hasRelativeImportRegex, (match, relativePath: string) => {\n if (!relativePath) {\n return match;\n }\n\n const fileDir = path.dirname(file);\n const resolvedPath = path.resolve(fileDir, relativePath);\n\n if (path.extname(relativePath)) {\n return deletionSet.has(resolvedPath) ? '' : match;\n }\n\n const possiblePaths = [`${resolvedPath}.ts`, `${resolvedPath}.js`];\n const shouldRemove = possiblePaths.some((possiblePath) =>\n deletionSet.has(possiblePath),\n );\n\n return shouldRemove ? '' : match;\n });\n\nexport const isFileEmpty = (contents: string): boolean =>\n contents\n .replace(multiLineCommentRegex, '')\n .replace(singleLineCommentRegex, '')\n .replace(whitespaceRegex, '').length === 0;\n\nexport const replaceSrcImport = (contents: string) => {\n const combinedSrcRegex = new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n );\n\n const withReplacedSrcImports = contents.replace(combinedSrcRegex, (match) =>\n match.replace(/(['\"])src\\//g, '$1#src/'),\n );\n\n return removeSkubaDiveRegisterImport(withReplacedSrcImports);\n};\n\nexport const replaceSrcImportWithConditionalRegisterRemoval = (\n contents: string,\n shouldRemoveRelativeRegister: boolean,\n) => {\n const combinedSrcRegex = new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n );\n\n const withReplacedSrcImports = contents.replace(combinedSrcRegex, (match) =>\n match.replace(/(['\"])src\\//g, '$1#src/'),\n );\n\n const withoutSkubaDive = removeSkubaDiveRegisterImport(\n withReplacedSrcImports,\n );\n\n return shouldRemoveRelativeRegister\n ? removeRelativeRegisterImport(withoutSkubaDive)\n : withoutSkubaDive;\n};\n\nexport const replaceSrcImportWithSelectiveRegisterRemoval = (\n contents: string,\n file: string,\n deletionSet: Set<string>,\n) => {\n const combinedSrcRegex = new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n );\n\n const withReplacedSrcImports = contents.replace(combinedSrcRegex, (match) =>\n match.replace(/(['\"])src\\//g, '$1#src/'),\n );\n\n const withoutSkubaDive = removeSkubaDiveRegisterImport(\n withReplacedSrcImports,\n );\n\n return removeSelectiveRelativeImports(withoutSkubaDive, file, deletionSet);\n};\n\nexport const tryRewriteSrcImports: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const tsFileNames = await glob(['**/*.ts', '**/*.test.ts'], {\n ignore: [\n '**/.git',\n '**/node_modules',\n 'src/cli/lint/internalLints/upgrade/patches/**/*',\n ],\n });\n\n if (!tsFileNames.length) {\n return {\n result: 'skip',\n reason: 'no .ts or test.ts files found',\n };\n }\n\n const tsFiles = await fetchFiles(tsFileNames);\n\n const filesWithSkubaDiveRemoved = tsFiles.map(({ file, contents }) => ({\n file,\n before: contents,\n afterSkubaDiveRemoval: removeSkubaDiveRegisterImport(\n contents.replace(\n new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n ),\n (match) => match.replace(/(['\"])src\\//g, '$1#src/'),\n ),\n ),\n }));\n\n const filesToDelete = new Set(\n filesWithSkubaDiveRemoved\n .filter(({ afterSkubaDiveRemoval }) => isFileEmpty(afterSkubaDiveRemoval))\n .map(({ file }) => path.resolve(file)),\n );\n\n const mapped = tsFiles.map(({ file, contents }) => ({\n file,\n before: contents,\n after: replaceSrcImportWithSelectiveRegisterRemoval(\n contents,\n file,\n filesToDelete,\n ),\n }));\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n mapped.map(async ({ file, before, after }) => {\n if (isFileEmpty(after)) {\n await fs.promises.unlink(file);\n return;\n }\n\n if (before !== after) {\n await fs.promises.writeFile(file, after);\n }\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const rewriteSrcImports: PatchFunction = async (config) => {\n try {\n return await tryRewriteSrcImports(config);\n } catch (err) {\n log.warn('Failed to rewrite src imports to #src');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
4
|
+
"sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\nexport const hasSkubaDiveRegisterImportRegex =\n /import\\s+['\"](?:skuba-dive\\/register)(?:\\.js)?['\"];?\\s*/gm;\n\nexport const hasRelativeRegisterImportRegex =\n /import\\s+['\"](\\.\\.?\\/.*?register)(?:\\.js)?['\"];?\\s*/gm;\n\nexport const hasRelativeImportRegex =\n /import\\s+['\"](\\.\\.?\\/[^'\"]*?)(?:\\.js)?['\"];?\\s*/gm;\n\nexport const hasSrcImportRegex =\n /import\\s+(?:type\\s+\\{[^}]*\\}|\\{[^}]*\\}|\\*\\s+as\\s+\\w+|\\w+(?:\\s*,\\s*\\{[^}]*\\})?)\\s+from\\s+['\"]src\\/[^'\"]*['\"]/gm;\n\nexport const hasImportRegex = /import\\(\\s*[\"']src\\/[^'\"]*[\"']\\s*\\)/gm;\n\nexport const hasJestMockRegex = /jest\\.(mock|doMock)\\(\\s*[\"']src\\/[^'\"]*[\"']/gm;\n\nconst multiLineCommentRegex = /\\/\\*[\\s\\S]*?\\*\\//g;\n\nconst singleLineCommentRegex = /\\/\\/.*$/gm;\n\nconst whitespaceRegex = /\\s/g;\n\nconst removeSkubaDiveRegisterImport = (contents: string) =>\n contents.replace(hasSkubaDiveRegisterImportRegex, '');\n\nconst removeRelativeRegisterImport = (contents: string) =>\n contents.replace(hasRelativeRegisterImportRegex, '');\n\nconst removeSelectiveRelativeImports = (\n contents: string,\n file: string,\n deletionSet: Set<string>,\n): string =>\n contents.replace(hasRelativeImportRegex, (match, relativePath: string) => {\n if (!relativePath) {\n return match;\n }\n\n const fileDir = path.dirname(file);\n const resolvedPath = path.resolve(fileDir, relativePath);\n\n if (path.extname(relativePath)) {\n return deletionSet.has(resolvedPath) ? '' : match;\n }\n\n const possiblePaths = [`${resolvedPath}.ts`, `${resolvedPath}.js`];\n const shouldRemove = possiblePaths.some((possiblePath) =>\n deletionSet.has(possiblePath),\n );\n\n return shouldRemove ? '' : match;\n });\n\nexport const isFileEmpty = (contents: string): boolean =>\n contents\n .replace(multiLineCommentRegex, '')\n .replace(singleLineCommentRegex, '')\n .replace(whitespaceRegex, '').length === 0;\n\nexport const replaceSrcImport = (contents: string) => {\n const combinedSrcRegex = new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n );\n\n const withReplacedSrcImports = contents.replace(combinedSrcRegex, (match) =>\n match.replace(/(['\"])src\\//g, '$1#src/'),\n );\n\n return removeSkubaDiveRegisterImport(withReplacedSrcImports);\n};\n\nexport const replaceSrcImportWithConditionalRegisterRemoval = (\n contents: string,\n shouldRemoveRelativeRegister: boolean,\n) => {\n const combinedSrcRegex = new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n );\n\n const withReplacedSrcImports = contents.replace(combinedSrcRegex, (match) =>\n match.replace(/(['\"])src\\//g, '$1#src/'),\n );\n\n const withoutSkubaDive = removeSkubaDiveRegisterImport(\n withReplacedSrcImports,\n );\n\n return shouldRemoveRelativeRegister\n ? removeRelativeRegisterImport(withoutSkubaDive)\n : withoutSkubaDive;\n};\n\nexport const replaceSrcImportWithSelectiveRegisterRemoval = (\n contents: string,\n file: string,\n deletionSet: Set<string>,\n) => {\n const combinedSrcRegex = new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n );\n\n const withReplacedSrcImports = contents.replace(combinedSrcRegex, (match) =>\n match.replace(/(['\"])src\\//g, '$1#src/'),\n );\n\n const withoutSkubaDive = removeSkubaDiveRegisterImport(\n withReplacedSrcImports,\n );\n\n return removeSelectiveRelativeImports(withoutSkubaDive, file, deletionSet);\n};\n\nexport const tryRewriteSrcImports: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n const tsFileNames = await glob(['**/*.ts', '**/*.test.ts'], {\n ignore: [\n '**/.git',\n '**/node_modules',\n 'src/cli/lint/internalLints/upgrade/patches/**/*',\n ],\n });\n\n if (!tsFileNames.length) {\n return {\n result: 'skip',\n reason: 'no .ts or test.ts files found',\n };\n }\n\n const tsFiles = await fetchFiles(tsFileNames);\n\n const filesWithSkubaDiveRemoved = tsFiles.map(({ file, contents }) => ({\n file,\n before: contents,\n afterSkubaDiveRemoval: removeSkubaDiveRegisterImport(\n contents.replace(\n new RegExp(\n [\n hasSrcImportRegex.source,\n hasImportRegex.source,\n hasJestMockRegex.source,\n ].join('|'),\n 'gm',\n ),\n (match) => match.replace(/(['\"])src\\//g, '$1#src/'),\n ),\n ),\n }));\n\n const filesToDelete = new Set(\n filesWithSkubaDiveRemoved\n .filter(({ afterSkubaDiveRemoval }) => isFileEmpty(afterSkubaDiveRemoval))\n .map(({ file }) => path.resolve(file)),\n );\n\n const mapped = tsFiles.map(({ file, contents }) => ({\n file,\n before: contents,\n after: replaceSrcImportWithSelectiveRegisterRemoval(\n contents,\n file,\n filesToDelete,\n ),\n }));\n\n if (mode === 'lint') {\n return {\n result: 'apply',\n };\n }\n\n await Promise.all(\n mapped.map(async ({ file, before, after }) => {\n if (isFileEmpty(after)) {\n await fs.promises.unlink(file);\n return;\n }\n\n if (before !== after) {\n await fs.promises.writeFile(file, after);\n }\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const rewriteSrcImports: PatchFunction = async (config) => {\n try {\n return await tryRewriteSrcImports(config);\n } catch (err) {\n log.warn('Failed to rewrite src imports to #src');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n};\n"],
|
|
5
5
|
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAwB;AAExB,uBAAqB;AACrB,sBAAe;AAEf,qBAAoB;AAGpB,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,MAAM,gBAAAA,QAAG,SAAS,SAAS,MAAM,MAAM;AAExD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAEK,MAAM,kCACX;AAEK,MAAM,iCACX;AAEK,MAAM,yBACX;AAEK,MAAM,oBACX;AAEK,MAAM,iBAAiB;AAEvB,MAAM,mBAAmB;AAEhC,MAAM,wBAAwB;AAE9B,MAAM,yBAAyB;AAE/B,MAAM,kBAAkB;AAExB,MAAM,gCAAgC,CAAC,aACrC,SAAS,QAAQ,iCAAiC,EAAE;AAEtD,MAAM,+BAA+B,CAAC,aACpC,SAAS,QAAQ,gCAAgC,EAAE;AAErD,MAAM,iCAAiC,CACrC,UACA,MACA,gBAEA,SAAS,QAAQ,wBAAwB,CAAC,OAAO,iBAAyB;AACxE,MAAI,CAAC,cAAc;AACjB,WAAO;AAAA,EACT;AAEA,QAAM,UAAU,YAAAC,QAAK,QAAQ,IAAI;AACjC,Q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AAA,IAClD;AAAA,IACA,QAAQ;AAAA,IACR,OAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF,EAAE;AAEF,MAAI,SAAS,QAAQ;AACnB,WAAO;AAAA,MACL,QAAQ;AAAA,IACV;AAAA,EACF;AAEA,QAAM,QAAQ;AAAA,IACZ,OAAO,IAAI,OAAO,EAAE,MAAM,QAAQ,MAAM,MAAM;AAC5C,UAAI,YAAY,KAAK,GAAG;AACtB,cAAM,gBAAAD,QAAG,SAAS,OAAO,IAAI;AAC7B;AAAA,MACF;AAEA,UAAI,WAAW,OAAO;AACpB,cAAM,gBAAAA,QAAG,SAAS,UAAU,MAAM,KAAK;AAAA,MACzC;AAAA,IACF,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,oBAAmC,OAAO,WAAW;AAChE,MAAI;AACF,WAAO,MAAM,qBAAqB,MAAM;AAAA,EAC1C,SAAS,KAAK;AACZ,uBAAI,KAAK,uCAAuC;AAChD,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
6
|
"names": ["fs", "path"]
|
|
7
7
|
}
|
|
@@ -0,0 +1,399 @@
|
|
|
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 updateLambdaConfigs_exports = {};
|
|
30
|
+
__export(updateLambdaConfigs_exports, {
|
|
31
|
+
tryUpdateLambdaConfigs: () => tryUpdateLambdaConfigs,
|
|
32
|
+
updateLambdaConfigs: () => updateLambdaConfigs
|
|
33
|
+
});
|
|
34
|
+
module.exports = __toCommonJS(updateLambdaConfigs_exports);
|
|
35
|
+
var import_util = require("util");
|
|
36
|
+
var import_fast_glob = require("fast-glob");
|
|
37
|
+
var import_fs_extra = __toESM(require("fs-extra"));
|
|
38
|
+
var import__ = require("../../../../../../index.js");
|
|
39
|
+
var import_logging = require("../../../../../../utils/logging.js");
|
|
40
|
+
const fetchFiles = async (files) => Promise.all(
|
|
41
|
+
files.map(async (file) => {
|
|
42
|
+
const contents = await import_fs_extra.default.promises.readFile(file, "utf8");
|
|
43
|
+
return {
|
|
44
|
+
file,
|
|
45
|
+
contents
|
|
46
|
+
};
|
|
47
|
+
})
|
|
48
|
+
);
|
|
49
|
+
const findBracedBlock = (content, pattern) => {
|
|
50
|
+
const match = pattern.exec(content);
|
|
51
|
+
if (!match) {
|
|
52
|
+
return void 0;
|
|
53
|
+
}
|
|
54
|
+
let braceCount = 1;
|
|
55
|
+
const startIndex = match.index + match[0].length;
|
|
56
|
+
let endIndex = startIndex;
|
|
57
|
+
while (braceCount > 0 && endIndex < content.length) {
|
|
58
|
+
if (content[endIndex] === "{") {
|
|
59
|
+
braceCount++;
|
|
60
|
+
} else if (content[endIndex] === "}") {
|
|
61
|
+
braceCount--;
|
|
62
|
+
}
|
|
63
|
+
endIndex++;
|
|
64
|
+
}
|
|
65
|
+
if (braceCount !== 0) {
|
|
66
|
+
return void 0;
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
content: content.slice(startIndex, endIndex - 1),
|
|
70
|
+
startIndex,
|
|
71
|
+
endIndex,
|
|
72
|
+
matchIndex: match.index
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const replaceAllBracedBlocks = (content, pattern, replacer) => {
|
|
76
|
+
let modified = content;
|
|
77
|
+
let hasChanges = false;
|
|
78
|
+
let match;
|
|
79
|
+
let offset = 0;
|
|
80
|
+
while ((match = pattern.exec(content)) !== null) {
|
|
81
|
+
const adjustedIndex = match.index + offset;
|
|
82
|
+
let braceCount = 1;
|
|
83
|
+
const startIndex = adjustedIndex + match[0].length;
|
|
84
|
+
let endIndex = startIndex;
|
|
85
|
+
while (braceCount > 0 && endIndex < modified.length) {
|
|
86
|
+
if (modified[endIndex] === "{") {
|
|
87
|
+
braceCount++;
|
|
88
|
+
} else if (modified[endIndex] === "}") {
|
|
89
|
+
braceCount--;
|
|
90
|
+
}
|
|
91
|
+
endIndex++;
|
|
92
|
+
}
|
|
93
|
+
if (braceCount !== 0) {
|
|
94
|
+
continue;
|
|
95
|
+
}
|
|
96
|
+
const blockContent = modified.slice(startIndex, endIndex - 1);
|
|
97
|
+
const replacement = replacer(blockContent);
|
|
98
|
+
if (replacement === void 0) {
|
|
99
|
+
continue;
|
|
100
|
+
}
|
|
101
|
+
const before = modified.slice(0, adjustedIndex);
|
|
102
|
+
const after = modified.slice(endIndex);
|
|
103
|
+
const fullReplacement = `${match[0].slice(0, -1)}{${replacement}}`;
|
|
104
|
+
modified = `${before}${fullReplacement}${after}`;
|
|
105
|
+
offset += fullReplacement.length - (endIndex - adjustedIndex);
|
|
106
|
+
hasChanges = true;
|
|
107
|
+
}
|
|
108
|
+
return hasChanges ? modified : void 0;
|
|
109
|
+
};
|
|
110
|
+
const patchCdkTsFile = ({
|
|
111
|
+
contents,
|
|
112
|
+
customCondition
|
|
113
|
+
}) => {
|
|
114
|
+
if (!contents.includes("aws_lambda_nodejs.NodejsFunction")) {
|
|
115
|
+
return void 0;
|
|
116
|
+
}
|
|
117
|
+
const modified = replaceAllBracedBlocks(
|
|
118
|
+
contents,
|
|
119
|
+
/bundling:\s*\{/g,
|
|
120
|
+
(bundlingContent) => {
|
|
121
|
+
if (bundlingContent.includes("--conditions")) {
|
|
122
|
+
return void 0;
|
|
123
|
+
}
|
|
124
|
+
const esbuildArgsBlock = findBracedBlock(
|
|
125
|
+
bundlingContent,
|
|
126
|
+
/esbuildArgs\s*:\s*\{/
|
|
127
|
+
);
|
|
128
|
+
if (esbuildArgsBlock) {
|
|
129
|
+
const argsContent = esbuildArgsBlock.content.trim();
|
|
130
|
+
const separator = argsContent ? ", " : "";
|
|
131
|
+
const newArgsContent = `'--conditions': '${customCondition}'${separator}${argsContent}`;
|
|
132
|
+
const modifiedBundlingContent2 = `${bundlingContent.slice(0, esbuildArgsBlock.matchIndex)}esbuildArgs: {${newArgsContent}}${bundlingContent.slice(esbuildArgsBlock.endIndex)}`;
|
|
133
|
+
return modifiedBundlingContent2;
|
|
134
|
+
}
|
|
135
|
+
const modifiedBundlingContent = bundlingContent.trimStart();
|
|
136
|
+
return `
|
|
137
|
+
esbuildArgs: { '--conditions': '${customCondition}' },
|
|
138
|
+
${modifiedBundlingContent}`;
|
|
139
|
+
}
|
|
140
|
+
);
|
|
141
|
+
if (!modified) {
|
|
142
|
+
return void 0;
|
|
143
|
+
}
|
|
144
|
+
return {
|
|
145
|
+
original: contents,
|
|
146
|
+
modified
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
const patchWebpackConfigFile = ({
|
|
150
|
+
contents,
|
|
151
|
+
customCondition
|
|
152
|
+
}) => {
|
|
153
|
+
const exportsBlock = findBracedBlock(contents, /module\.exports\s*=\s*\{/);
|
|
154
|
+
if (!exportsBlock) {
|
|
155
|
+
return void 0;
|
|
156
|
+
}
|
|
157
|
+
const exportsContent = exportsBlock.content;
|
|
158
|
+
if (exportsContent.includes(customCondition)) {
|
|
159
|
+
return void 0;
|
|
160
|
+
}
|
|
161
|
+
const resolveBlock = findBracedBlock(exportsContent, /resolve\s*:\s*\{/);
|
|
162
|
+
if (resolveBlock) {
|
|
163
|
+
const resolveContent = resolveBlock.content;
|
|
164
|
+
const conditionNamesMatch = /conditionNames\s*:\s*\[([^\]]*)\]/s.exec(
|
|
165
|
+
resolveContent
|
|
166
|
+
);
|
|
167
|
+
if (conditionNamesMatch?.[1] !== void 0) {
|
|
168
|
+
const existingConditions = conditionNamesMatch[1].trim();
|
|
169
|
+
const separator = existingConditions ? ", " : "";
|
|
170
|
+
const newConditionNames = `conditionNames: ['${customCondition}'${separator}${existingConditions}]`;
|
|
171
|
+
const modifiedResolveContent2 = `${resolveContent.slice(0, conditionNamesMatch.index)}${newConditionNames}${resolveContent.slice(conditionNamesMatch.index + conditionNamesMatch[0].length)}`;
|
|
172
|
+
const modifiedExportsContent3 = `${exportsContent.slice(0, resolveBlock.matchIndex)}resolve: {${modifiedResolveContent2}}${exportsContent.slice(resolveBlock.endIndex)}`;
|
|
173
|
+
const modified3 = `${contents.slice(0, exportsBlock.startIndex)}${modifiedExportsContent3}${contents.slice(exportsBlock.endIndex)}`;
|
|
174
|
+
return {
|
|
175
|
+
original: contents,
|
|
176
|
+
modified: modified3
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
const modifiedResolveContent = resolveContent.trimStart();
|
|
180
|
+
const newResolveContent = `
|
|
181
|
+
conditionNames: ['${customCondition}'],
|
|
182
|
+
${modifiedResolveContent}`;
|
|
183
|
+
const modifiedExportsContent2 = `${exportsContent.slice(0, resolveBlock.matchIndex)}resolve: {${newResolveContent}}${exportsContent.slice(resolveBlock.endIndex)}`;
|
|
184
|
+
const modified2 = `${contents.slice(0, exportsBlock.startIndex)}${modifiedExportsContent2}${contents.slice(exportsBlock.endIndex)}`;
|
|
185
|
+
return {
|
|
186
|
+
original: contents,
|
|
187
|
+
modified: modified2
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
const modifiedExportsContent = exportsContent.trimStart();
|
|
191
|
+
const newExportsContent = `
|
|
192
|
+
resolve: {
|
|
193
|
+
conditionNames: ['${customCondition}'],
|
|
194
|
+
},
|
|
195
|
+
${modifiedExportsContent}`;
|
|
196
|
+
const modified = `${contents.slice(0, exportsBlock.startIndex)}${newExportsContent}${contents.slice(exportsBlock.endIndex)}`;
|
|
197
|
+
return {
|
|
198
|
+
original: contents,
|
|
199
|
+
modified
|
|
200
|
+
};
|
|
201
|
+
};
|
|
202
|
+
const patchServerlessEsbuildFile = ({
|
|
203
|
+
contents,
|
|
204
|
+
customCondition
|
|
205
|
+
}) => {
|
|
206
|
+
if (contents.includes(customCondition)) {
|
|
207
|
+
return void 0;
|
|
208
|
+
}
|
|
209
|
+
if (!contents.includes("serverless-esbuild")) {
|
|
210
|
+
return void 0;
|
|
211
|
+
}
|
|
212
|
+
const esbuildBlockRegex = /^((?:build|custom):)\s*\n(\s+)(esbuild:)\s*\n((?:\2\s+.+\n)*)/gm;
|
|
213
|
+
let match;
|
|
214
|
+
let modified = contents;
|
|
215
|
+
let hasChanges = false;
|
|
216
|
+
esbuildBlockRegex.lastIndex = 0;
|
|
217
|
+
while ((match = esbuildBlockRegex.exec(contents)) !== null) {
|
|
218
|
+
const [fullMatch, blockType, baseIndent, esbuildLabel, esbuildContent] = match;
|
|
219
|
+
if (/esbuild:\s*false/.exec(fullMatch)) {
|
|
220
|
+
continue;
|
|
221
|
+
}
|
|
222
|
+
if (esbuildContent?.includes("conditions:")) {
|
|
223
|
+
continue;
|
|
224
|
+
}
|
|
225
|
+
const conditionsIndent = `${baseIndent} `;
|
|
226
|
+
const arrayItemIndent = `${conditionsIndent} `;
|
|
227
|
+
const newEsbuildBlock = `${blockType}
|
|
228
|
+
${baseIndent}${esbuildLabel}
|
|
229
|
+
${conditionsIndent}conditions:
|
|
230
|
+
${arrayItemIndent}- '${customCondition}'
|
|
231
|
+
${esbuildContent}`;
|
|
232
|
+
modified = modified.replace(fullMatch, newEsbuildBlock);
|
|
233
|
+
hasChanges = true;
|
|
234
|
+
}
|
|
235
|
+
if (!hasChanges) {
|
|
236
|
+
return void 0;
|
|
237
|
+
}
|
|
238
|
+
return {
|
|
239
|
+
original: contents,
|
|
240
|
+
modified
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
const patchServerlessFile = ({
|
|
244
|
+
contents,
|
|
245
|
+
customCondition
|
|
246
|
+
}) => {
|
|
247
|
+
if (contents.includes("esbuild")) {
|
|
248
|
+
return patchServerlessEsbuildFile({
|
|
249
|
+
contents,
|
|
250
|
+
customCondition
|
|
251
|
+
});
|
|
252
|
+
}
|
|
253
|
+
if (contents.includes("serverless-webpack")) {
|
|
254
|
+
return void 0;
|
|
255
|
+
}
|
|
256
|
+
if (contents.includes("package.json")) {
|
|
257
|
+
return void 0;
|
|
258
|
+
}
|
|
259
|
+
const packageBlockRegex = /^(\s*)(package:)\s*\n(\s+)(patterns:)\s*\n((?:\3\s+-\s+.+\n)*)/gm;
|
|
260
|
+
let match;
|
|
261
|
+
let modified = contents;
|
|
262
|
+
let hasChanges = false;
|
|
263
|
+
packageBlockRegex.lastIndex = 0;
|
|
264
|
+
while ((match = packageBlockRegex.exec(contents)) !== null) {
|
|
265
|
+
const [
|
|
266
|
+
fullMatch,
|
|
267
|
+
baseIndent,
|
|
268
|
+
packageLabel,
|
|
269
|
+
patternsIndent,
|
|
270
|
+
patternsLabel,
|
|
271
|
+
patternsContent
|
|
272
|
+
] = match;
|
|
273
|
+
if (patternsContent?.includes("package.json")) {
|
|
274
|
+
continue;
|
|
275
|
+
}
|
|
276
|
+
const arrayItemIndent = `${patternsIndent} `;
|
|
277
|
+
const newPackageBlock = `${baseIndent}${packageLabel}
|
|
278
|
+
${patternsIndent}${patternsLabel}
|
|
279
|
+
${patternsContent}${arrayItemIndent}- 'package.json'
|
|
280
|
+
`;
|
|
281
|
+
modified = modified.replace(fullMatch, newPackageBlock);
|
|
282
|
+
hasChanges = true;
|
|
283
|
+
}
|
|
284
|
+
if (!hasChanges) {
|
|
285
|
+
return void 0;
|
|
286
|
+
}
|
|
287
|
+
return {
|
|
288
|
+
original: contents,
|
|
289
|
+
modified
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
const tryUpdateLambdaConfigs = async ({
|
|
293
|
+
mode
|
|
294
|
+
}) => {
|
|
295
|
+
let customCondition;
|
|
296
|
+
try {
|
|
297
|
+
const { repo } = await import__.Git.getOwnerAndRepo({ dir: process.cwd() });
|
|
298
|
+
customCondition = `@seek/${repo}/source`;
|
|
299
|
+
} catch {
|
|
300
|
+
return { result: "skip", reason: "no repository name found" };
|
|
301
|
+
}
|
|
302
|
+
const [tsFileNames, webpackFileNames, serverlessFileNames] = await Promise.all([
|
|
303
|
+
(0, import_fast_glob.glob)("**/*.ts", {
|
|
304
|
+
ignore: [
|
|
305
|
+
"**/.git",
|
|
306
|
+
"**/node_modules",
|
|
307
|
+
"src/cli/lint/internalLints/upgrade/patches/**/*"
|
|
308
|
+
]
|
|
309
|
+
}),
|
|
310
|
+
(0, import_fast_glob.glob)("**/*webpack.config.js", {
|
|
311
|
+
ignore: ["**/.git", "**/node_modules"]
|
|
312
|
+
}),
|
|
313
|
+
(0, import_fast_glob.glob)("**/serverless*.y*ml", {
|
|
314
|
+
ignore: ["**/.git", "**/node_modules"]
|
|
315
|
+
})
|
|
316
|
+
]);
|
|
317
|
+
if (!tsFileNames.length && !webpackFileNames.length && !serverlessFileNames.length) {
|
|
318
|
+
return {
|
|
319
|
+
result: "skip",
|
|
320
|
+
reason: "no .ts or webpack config files or .yml files found"
|
|
321
|
+
};
|
|
322
|
+
}
|
|
323
|
+
const [tsFiles, webpackFiles, serverlessFiles] = await Promise.all([
|
|
324
|
+
fetchFiles(tsFileNames),
|
|
325
|
+
fetchFiles(webpackFileNames),
|
|
326
|
+
fetchFiles(serverlessFileNames)
|
|
327
|
+
]);
|
|
328
|
+
const filesToPatch = [
|
|
329
|
+
...tsFiles.flatMap(({ file, contents }) => {
|
|
330
|
+
const patched = patchCdkTsFile({
|
|
331
|
+
contents,
|
|
332
|
+
customCondition
|
|
333
|
+
});
|
|
334
|
+
if (patched && patched.modified !== patched.original) {
|
|
335
|
+
return {
|
|
336
|
+
file,
|
|
337
|
+
original: patched.original,
|
|
338
|
+
modified: patched.modified
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
return [];
|
|
342
|
+
}),
|
|
343
|
+
...webpackFiles.flatMap(({ file, contents }) => {
|
|
344
|
+
const patched = patchWebpackConfigFile({
|
|
345
|
+
contents,
|
|
346
|
+
customCondition
|
|
347
|
+
});
|
|
348
|
+
if (patched && patched.modified !== patched.original) {
|
|
349
|
+
return {
|
|
350
|
+
file,
|
|
351
|
+
original: patched.original,
|
|
352
|
+
modified: patched.modified
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
return [];
|
|
356
|
+
}),
|
|
357
|
+
...serverlessFiles.flatMap(({ file, contents }) => {
|
|
358
|
+
const patched = patchServerlessFile({
|
|
359
|
+
contents,
|
|
360
|
+
customCondition
|
|
361
|
+
});
|
|
362
|
+
if (patched && patched.modified !== patched.original) {
|
|
363
|
+
return {
|
|
364
|
+
file,
|
|
365
|
+
original: patched.original,
|
|
366
|
+
modified: patched.modified
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
return [];
|
|
370
|
+
})
|
|
371
|
+
];
|
|
372
|
+
if (!filesToPatch.length) {
|
|
373
|
+
return { result: "skip", reason: "no lambda configurations to patch" };
|
|
374
|
+
}
|
|
375
|
+
if (mode === "lint") {
|
|
376
|
+
return { result: "apply" };
|
|
377
|
+
}
|
|
378
|
+
await Promise.all(
|
|
379
|
+
filesToPatch.map(async ({ file, modified }) => {
|
|
380
|
+
await import_fs_extra.default.promises.writeFile(file, modified, "utf8");
|
|
381
|
+
})
|
|
382
|
+
);
|
|
383
|
+
return { result: "apply" };
|
|
384
|
+
};
|
|
385
|
+
const updateLambdaConfigs = async (config) => {
|
|
386
|
+
try {
|
|
387
|
+
return await tryUpdateLambdaConfigs(config);
|
|
388
|
+
} catch (err) {
|
|
389
|
+
import_logging.log.warn("Failed to write configure `tsconfig.json` and `package.json`");
|
|
390
|
+
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
391
|
+
return { result: "skip", reason: "due to an error" };
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
395
|
+
0 && (module.exports = {
|
|
396
|
+
tryUpdateLambdaConfigs,
|
|
397
|
+
updateLambdaConfigs
|
|
398
|
+
});
|
|
399
|
+
//# sourceMappingURL=updateLambdaConfigs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/cli/lint/internalLints/upgrade/patches/13.0.0/updateLambdaConfigs.ts"],
|
|
4
|
+
"sourcesContent": ["import { inspect } from 'util';\n\nimport { glob } from 'fast-glob';\nimport fs from 'fs-extra';\n\nimport { Git } from '../../../../../../index.js';\nimport { log } from '../../../../../../utils/logging.js';\nimport type { PatchFunction, PatchReturnType } from '../../index.js';\n\nconst fetchFiles = async (files: string[]) =>\n Promise.all(\n files.map(async (file) => {\n const contents = await fs.promises.readFile(file, 'utf8');\n\n return {\n file,\n contents,\n };\n }),\n );\n\n/**\n * Find a block delimited by braces and return its content and position\n * @param content The text to search in\n * @param pattern The regex pattern to match (should match up to the opening brace)\n * @returns Object containing the matched content and indices, or undefined if not found\n */\nconst findBracedBlock = (\n content: string,\n pattern: RegExp,\n):\n | {\n content: string;\n startIndex: number;\n endIndex: number;\n matchIndex: number;\n }\n | undefined => {\n const match = pattern.exec(content);\n if (!match) {\n return undefined;\n }\n\n // Find the matching closing brace\n let braceCount = 1;\n const startIndex = match.index + match[0].length;\n let endIndex = startIndex;\n\n while (braceCount > 0 && endIndex < content.length) {\n if (content[endIndex] === '{') {\n braceCount++;\n } else if (content[endIndex] === '}') {\n braceCount--;\n }\n endIndex++;\n }\n\n if (braceCount !== 0) {\n return undefined;\n }\n\n return {\n content: content.slice(startIndex, endIndex - 1),\n startIndex,\n endIndex,\n matchIndex: match.index,\n };\n};\n\n/**\n * Find and replace all braced blocks matching a pattern\n * @param content The text to search in\n * @param pattern The regex pattern to match (should be global and match up to the opening brace)\n * @param replacer Function that receives the block content and returns the replacement, or undefined to skip\n * @returns The modified content, or undefined if no changes were made\n */\nconst replaceAllBracedBlocks = (\n content: string,\n pattern: RegExp,\n replacer: (blockContent: string) => string | undefined,\n): string | undefined => {\n let modified = content;\n let hasChanges = false;\n let match: RegExpExecArray | null;\n let offset = 0;\n\n while ((match = pattern.exec(content)) !== null) {\n const adjustedIndex = match.index + offset;\n\n // Find the matching closing brace\n let braceCount = 1;\n const startIndex = adjustedIndex + match[0].length;\n let endIndex = startIndex;\n\n while (braceCount > 0 && endIndex < modified.length) {\n if (modified[endIndex] === '{') {\n braceCount++;\n } else if (modified[endIndex] === '}') {\n braceCount--;\n }\n endIndex++;\n }\n\n if (braceCount !== 0) {\n continue;\n }\n\n const blockContent = modified.slice(startIndex, endIndex - 1);\n const replacement = replacer(blockContent);\n\n if (replacement === undefined) {\n continue;\n }\n\n // Replace this block\n const before = modified.slice(0, adjustedIndex);\n const after = modified.slice(endIndex);\n const fullReplacement = `${match[0].slice(0, -1)}{${replacement}}`;\n modified = `${before}${fullReplacement}${after}`;\n\n // Adjust offset for next iteration\n offset += fullReplacement.length - (endIndex - adjustedIndex);\n hasChanges = true;\n }\n\n return hasChanges ? modified : undefined;\n};\n\nconst patchCdkTsFile = ({\n contents,\n customCondition,\n}: {\n contents: string;\n customCondition: string;\n}):\n | {\n original: string;\n modified: string;\n }\n | undefined => {\n if (!contents.includes('aws_lambda_nodejs.NodejsFunction')) {\n return undefined;\n }\n\n const modified = replaceAllBracedBlocks(\n contents,\n /bundling:\\s*\\{/g,\n (bundlingContent) => {\n // Check if --conditions already exists\n if (bundlingContent.includes('--conditions')) {\n return undefined;\n }\n\n // Find esbuildArgs block within bundling\n const esbuildArgsBlock = findBracedBlock(\n bundlingContent,\n /esbuildArgs\\s*:\\s*\\{/,\n );\n\n if (esbuildArgsBlock) {\n const argsContent = esbuildArgsBlock.content.trim();\n const separator = argsContent ? ', ' : '';\n const newArgsContent = `'--conditions': '${customCondition}'${separator}${argsContent}`;\n\n const modifiedBundlingContent = `${bundlingContent.slice(0, esbuildArgsBlock.matchIndex)}esbuildArgs: {${newArgsContent}}${bundlingContent.slice(esbuildArgsBlock.endIndex)}`;\n\n return modifiedBundlingContent;\n }\n\n // Add new esbuildArgs property\n const modifiedBundlingContent = bundlingContent.trimStart();\n return `\\n esbuildArgs: { '--conditions': '${customCondition}' },\\n ${modifiedBundlingContent}`;\n },\n );\n\n if (!modified) {\n return undefined;\n }\n\n return {\n original: contents,\n modified,\n };\n};\n\nconst patchWebpackConfigFile = ({\n contents,\n customCondition,\n}: {\n contents: string;\n customCondition: string;\n}):\n | {\n original: string;\n modified: string;\n }\n | undefined => {\n // Find module.exports block\n const exportsBlock = findBracedBlock(contents, /module\\.exports\\s*=\\s*\\{/);\n if (!exportsBlock) {\n return undefined;\n }\n\n const exportsContent = exportsBlock.content;\n\n // Check if resolve.conditionNames already has our custom condition\n if (exportsContent.includes(customCondition)) {\n return undefined;\n }\n\n // Find resolve block within module.exports\n const resolveBlock = findBracedBlock(exportsContent, /resolve\\s*:\\s*\\{/);\n\n if (resolveBlock) {\n const resolveContent = resolveBlock.content;\n\n // Find conditionNames array within resolve\n const conditionNamesMatch = /conditionNames\\s*:\\s*\\[([^\\]]*)\\]/s.exec(\n resolveContent,\n );\n\n if (conditionNamesMatch?.[1] !== undefined) {\n // Add custom condition to existing conditionNames array\n const existingConditions = conditionNamesMatch[1].trim();\n const separator = existingConditions ? ', ' : '';\n const newConditionNames = `conditionNames: ['${customCondition}'${separator}${existingConditions}]`;\n\n const modifiedResolveContent = `${resolveContent.slice(0, conditionNamesMatch.index)}${newConditionNames}${resolveContent.slice(conditionNamesMatch.index + conditionNamesMatch[0].length)}`;\n\n const modifiedExportsContent = `${exportsContent.slice(0, resolveBlock.matchIndex)}resolve: {${modifiedResolveContent}}${exportsContent.slice(resolveBlock.endIndex)}`;\n\n const modified = `${contents.slice(0, exportsBlock.startIndex)}${modifiedExportsContent}${contents.slice(exportsBlock.endIndex)}`;\n\n return {\n original: contents,\n modified,\n };\n }\n\n // Add conditionNames property to resolve block\n const modifiedResolveContent = resolveContent.trimStart();\n const newResolveContent = `\\n conditionNames: ['${customCondition}'],\\n ${modifiedResolveContent}`;\n\n const modifiedExportsContent = `${exportsContent.slice(0, resolveBlock.matchIndex)}resolve: {${newResolveContent}}${exportsContent.slice(resolveBlock.endIndex)}`;\n\n const modified = `${contents.slice(0, exportsBlock.startIndex)}${modifiedExportsContent}${contents.slice(exportsBlock.endIndex)}`;\n\n return {\n original: contents,\n modified,\n };\n }\n\n // Add resolve property with conditionNames to module.exports\n const modifiedExportsContent = exportsContent.trimStart();\n const newExportsContent = `\\n resolve: {\\n conditionNames: ['${customCondition}'],\\n },\\n ${modifiedExportsContent}`;\n\n const modified = `${contents.slice(0, exportsBlock.startIndex)}${newExportsContent}${contents.slice(exportsBlock.endIndex)}`;\n\n return {\n original: contents,\n modified,\n };\n};\n\nconst patchServerlessEsbuildFile = ({\n contents,\n customCondition,\n}: {\n contents: string;\n customCondition: string;\n}):\n | {\n original: string;\n modified: string;\n }\n | undefined => {\n // Check if custom condition already exists\n if (contents.includes(customCondition)) {\n return undefined;\n }\n\n // Check for serverless-esbuild plugin\n if (!contents.includes('serverless-esbuild')) {\n return undefined;\n }\n\n // Match either build: or custom: followed by esbuild: with nested configuration\n // This regex only matches multi-line esbuild blocks, not inline \"esbuild: false\"\n const esbuildBlockRegex =\n /^((?:build|custom):)\\s*\\n(\\s+)(esbuild:)\\s*\\n((?:\\2\\s+.+\\n)*)/gm;\n\n let match;\n let modified = contents;\n let hasChanges = false;\n\n // Reset regex lastIndex for multiple matches\n esbuildBlockRegex.lastIndex = 0;\n\n while ((match = esbuildBlockRegex.exec(contents)) !== null) {\n const [fullMatch, blockType, baseIndent, esbuildLabel, esbuildContent] =\n match;\n\n // Check if esbuild is disabled (esbuild: false)\n if (/esbuild:\\s*false/.exec(fullMatch)) {\n continue;\n }\n\n // Check if conditions already exists in this block\n if (esbuildContent?.includes('conditions:')) {\n continue;\n }\n\n // Determine indentation (should be baseIndent + 2 spaces for YAML)\n const conditionsIndent = `${baseIndent} `;\n const arrayItemIndent = `${conditionsIndent} `;\n\n // Build the new esbuild block with conditions added\n const newEsbuildBlock = `${blockType}\\n${baseIndent}${esbuildLabel}\\n${conditionsIndent}conditions:\\n${arrayItemIndent}- '${customCondition}'\\n${esbuildContent}`;\n\n // Replace in the modified content\n modified = modified.replace(fullMatch, newEsbuildBlock);\n hasChanges = true;\n }\n\n if (!hasChanges) {\n return undefined;\n }\n\n return {\n original: contents,\n modified,\n };\n};\n\nconst patchServerlessFile = ({\n contents,\n customCondition,\n}: {\n contents: string;\n customCondition: string;\n}):\n | {\n original: string;\n modified: string;\n }\n | undefined => {\n if (contents.includes('esbuild')) {\n return patchServerlessEsbuildFile({\n contents,\n customCondition,\n });\n }\n\n if (contents.includes('serverless-webpack')) {\n return undefined;\n }\n\n // patch package patterns for serverless framework\n if (contents.includes('package.json')) {\n return undefined;\n }\n\n // Match package: blocks with patterns: arrays\n const packageBlockRegex =\n /^(\\s*)(package:)\\s*\\n(\\s+)(patterns:)\\s*\\n((?:\\3\\s+-\\s+.+\\n)*)/gm;\n\n let match;\n let modified = contents;\n let hasChanges = false;\n\n // Reset regex lastIndex for multiple matches\n packageBlockRegex.lastIndex = 0;\n\n while ((match = packageBlockRegex.exec(contents)) !== null) {\n const [\n fullMatch,\n baseIndent,\n packageLabel,\n patternsIndent,\n patternsLabel,\n patternsContent,\n ] = match;\n\n // Check if package.json already exists in this block\n if (patternsContent?.includes('package.json')) {\n continue;\n }\n\n // Add package.json to the patterns list\n const arrayItemIndent = `${patternsIndent} `;\n const newPackageBlock = `${baseIndent}${packageLabel}\\n${patternsIndent}${patternsLabel}\\n${patternsContent}${arrayItemIndent}- 'package.json'\\n`;\n\n // Replace in the modified content\n modified = modified.replace(fullMatch, newPackageBlock);\n hasChanges = true;\n }\n\n if (!hasChanges) {\n return undefined;\n }\n\n return {\n original: contents,\n modified,\n };\n};\n\nexport const tryUpdateLambdaConfigs: PatchFunction = async ({\n mode,\n}): Promise<PatchReturnType> => {\n let customCondition: string;\n try {\n const { repo } = await Git.getOwnerAndRepo({ dir: process.cwd() });\n customCondition = `@seek/${repo}/source`;\n } catch {\n return { result: 'skip', reason: 'no repository name found' };\n }\n\n const [tsFileNames, webpackFileNames, serverlessFileNames] =\n await Promise.all([\n glob('**/*.ts', {\n ignore: [\n '**/.git',\n '**/node_modules',\n 'src/cli/lint/internalLints/upgrade/patches/**/*',\n ],\n }),\n glob('**/*webpack.config.js', {\n ignore: ['**/.git', '**/node_modules'],\n }),\n glob('**/serverless*.y*ml', {\n ignore: ['**/.git', '**/node_modules'],\n }),\n ]);\n\n if (\n !tsFileNames.length &&\n !webpackFileNames.length &&\n !serverlessFileNames.length\n ) {\n return {\n result: 'skip',\n reason: 'no .ts or webpack config files or .yml files found',\n };\n }\n\n const [tsFiles, webpackFiles, serverlessFiles] = await Promise.all([\n fetchFiles(tsFileNames),\n fetchFiles(webpackFileNames),\n fetchFiles(serverlessFileNames),\n ]);\n\n const filesToPatch = [\n ...tsFiles.flatMap(({ file, contents }) => {\n const patched = patchCdkTsFile({\n contents,\n customCondition,\n });\n if (patched && patched.modified !== patched.original) {\n return {\n file,\n original: patched.original,\n modified: patched.modified,\n };\n }\n return [];\n }),\n ...webpackFiles.flatMap(({ file, contents }) => {\n const patched = patchWebpackConfigFile({\n contents,\n customCondition,\n });\n if (patched && patched.modified !== patched.original) {\n return {\n file,\n original: patched.original,\n modified: patched.modified,\n };\n }\n return [];\n }),\n ...serverlessFiles.flatMap(({ file, contents }) => {\n const patched = patchServerlessFile({\n contents,\n customCondition,\n });\n if (patched && patched.modified !== patched.original) {\n return {\n file,\n original: patched.original,\n modified: patched.modified,\n };\n }\n return [];\n }),\n ];\n\n if (!filesToPatch.length) {\n return { result: 'skip', reason: 'no lambda configurations to patch' };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n await Promise.all(\n filesToPatch.map(async ({ file, modified }) => {\n await fs.promises.writeFile(file, modified, 'utf8');\n }),\n );\n\n return { result: 'apply' };\n};\n\nexport const updateLambdaConfigs: PatchFunction = async (config) => {\n try {\n return await tryUpdateLambdaConfigs(config);\n } catch (err) {\n log.warn('Failed to write configure `tsconfig.json` and `package.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,uBAAqB;AACrB,sBAAe;AAEf,eAAoB;AACpB,qBAAoB;AAGpB,MAAM,aAAa,OAAO,UACxB,QAAQ;AAAA,EACN,MAAM,IAAI,OAAO,SAAS;AACxB,UAAM,WAAW,MAAM,gBAAAA,QAAG,SAAS,SAAS,MAAM,MAAM;AAExD,WAAO;AAAA,MACL;AAAA,MACA;AAAA,IACF;AAAA,EACF,CAAC;AACH;AAQF,MAAM,kBAAkB,CAC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AQ,UAAU;AACpD,eAAO;AAAA,UACL;AAAA,UACA,UAAU,QAAQ;AAAA,UAClB,UAAU,QAAQ;AAAA,QACpB;AAAA,MACF;AACA,aAAO,CAAC;AAAA,IACV,CAAC;AAAA,EACH;AAEA,MAAI,CAAC,aAAa,QAAQ;AACxB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,oCAAoC;AAAA,EACvE;AAEA,MAAI,SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,QAAM,QAAQ;AAAA,IACZ,aAAa,IAAI,OAAO,EAAE,MAAM,SAAS,MAAM;AAC7C,YAAM,gBAAAJ,QAAG,SAAS,UAAU,MAAM,UAAU,MAAM;AAAA,IACpD,CAAC;AAAA,EACH;AAEA,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,sBAAqC,OAAO,WAAW;AAClE,MAAI;AACF,WAAO,MAAM,uBAAuB,MAAM;AAAA,EAC5C,SAAS,KAAK;AACZ,uBAAI,KAAK,8DAA8D;AACvE,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
|
+
"names": ["fs", "modifiedBundlingContent", "modifiedResolveContent", "modifiedExportsContent", "modified"]
|
|
7
|
+
}
|
package/lib/cli/start/index.js
CHANGED
|
@@ -40,10 +40,8 @@ var import_validation = require("../../utils/validation.js");
|
|
|
40
40
|
var import_tsc = require("../build/tsc.js");
|
|
41
41
|
const start = async () => {
|
|
42
42
|
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
(0, import_get_port.default)()
|
|
46
|
-
]);
|
|
43
|
+
const args = (0, import_args.parseRunArgs)(process.argv.slice(2));
|
|
44
|
+
const availablePort = await (0, import_get_port.default)();
|
|
47
45
|
const uniqueConditions = [
|
|
48
46
|
.../* @__PURE__ */ new Set([...args.conditions ?? [], ...customConditions])
|
|
49
47
|
];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/start/index.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { getEntryPointFromManifest } from '../../utils/manifest.js';\nimport { isIpPort } from '../../utils/validation.js';\nimport { getCustomConditions } from '../build/tsc.js';\n\nexport const start = async () => {\n const customConditions = getCustomConditions();\n const
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,sBAA0C;AAC1C,wBAAyB;AACzB,iBAAoC;AAE7B,MAAM,QAAQ,YAAY;AAC/B,QAAM,uBAAmB,gCAAoB;AAC7C,QAAM,
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { getEntryPointFromManifest } from '../../utils/manifest.js';\nimport { isIpPort } from '../../utils/validation.js';\nimport { getCustomConditions } from '../build/tsc.js';\n\nexport const start = async () => {\n const customConditions = getCustomConditions();\n const args = parseRunArgs(process.argv.slice(2));\n const availablePort = await getPort();\n\n const uniqueConditions = [\n ...new Set([...(args.conditions ?? []), ...customConditions]),\n ];\n\n args.entryPoint ??= await getEntryPointFromManifest();\n\n const execProcess = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return execProcess(\n 'tsx',\n 'watch',\n '--clear-screen=false',\n ...args.node,\n ...uniqueConditions.map((condition) => `--conditions=${condition}`),\n '--env-file-if-exists',\n '.env',\n '--require',\n 'tsconfig-paths/register',\n path.join(__dirname, '..', '..', 'wrapper', 'index.js'),\n ...args.script,\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,sBAA0C;AAC1C,wBAAyB;AACzB,iBAAoC;AAE7B,MAAM,QAAQ,YAAY;AAC/B,QAAM,uBAAmB,gCAAoB;AAC7C,QAAM,WAAO,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAC/C,QAAM,gBAAgB,UAAM,gBAAAA,SAAQ;AAEpC,QAAM,mBAAmB;AAAA,IACvB,GAAG,oBAAI,IAAI,CAAC,GAAI,KAAK,cAAc,CAAC,GAAI,GAAG,gBAAgB,CAAC;AAAA,EAC9D;AAEA,OAAK,eAAe,UAAM,2CAA0B;AAEpD,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,qBAAqB,KAAK;AAAA,MAC1B,cAAc,WAAO,4BAAS,KAAK,IAAI,IAAI,KAAK,OAAO,aAAa;AAAA,IACtE;AAAA,EACF,CAAC;AAED,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAG,KAAK;AAAA,IACR,GAAG,iBAAiB,IAAI,CAAC,cAAc,gBAAgB,SAAS,EAAE;AAAA,IAClE;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAAC,QAAK,KAAK,WAAW,MAAM,MAAM,WAAW,UAAU;AAAA,IACtD,GAAG,KAAK;AAAA,EACV;AACF;",
|
|
6
6
|
"names": ["getPort", "path"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "13.0.0-custom-conditions-exports-
|
|
3
|
+
"version": "13.0.0-custom-conditions-exports-20251009024033",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "SEEK development toolkit for backend applications and packages",
|
|
6
6
|
"homepage": "https://github.com/seek-oss/skuba#readme",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@changesets/cli": "2.29.7",
|
|
111
111
|
"@changesets/get-github-info": "0.6.0",
|
|
112
|
-
"@jest/reporters": "30.
|
|
113
|
-
"@jest/test-result": "30.
|
|
112
|
+
"@jest/reporters": "30.2.0",
|
|
113
|
+
"@jest/test-result": "30.2.0",
|
|
114
114
|
"@types/ejs": "3.1.5",
|
|
115
115
|
"@types/express": "5.0.3",
|
|
116
116
|
"@types/fs-extra": "11.0.4",
|
|
@@ -126,10 +126,10 @@
|
|
|
126
126
|
"enhanced-resolve": "5.18.3",
|
|
127
127
|
"express": "5.1.0",
|
|
128
128
|
"fastify": "5.6.1",
|
|
129
|
-
"jest-diff": "30.
|
|
129
|
+
"jest-diff": "30.2.0",
|
|
130
130
|
"jsonfile": "6.2.0",
|
|
131
131
|
"koa": "3.0.1",
|
|
132
|
-
"memfs": "4.
|
|
132
|
+
"memfs": "4.48.1",
|
|
133
133
|
"remark-cli": "12.0.1",
|
|
134
134
|
"remark-preset-lint-recommended": "7.0.1",
|
|
135
135
|
"semver": "7.7.2",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"@opentelemetry/api": "^1.9.0",
|
|
23
23
|
"@opentelemetry/core": "^2.0.0",
|
|
24
24
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.205.0",
|
|
25
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
25
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.61.0",
|
|
26
26
|
"@opentelemetry/instrumentation-http": "^0.205.0",
|
|
27
27
|
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
28
28
|
"@opentelemetry/sdk-node": "^0.205.0",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@opentelemetry/api": "^1.9.0",
|
|
25
25
|
"@opentelemetry/core": "^2.0.0",
|
|
26
26
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.205.0",
|
|
27
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
27
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.61.0",
|
|
28
28
|
"@opentelemetry/instrumentation-http": "^0.205.0",
|
|
29
29
|
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
30
30
|
"@opentelemetry/sdk-node": "^0.205.0",
|
|
@@ -23,7 +23,7 @@ configs:
|
|
|
23
23
|
concurrency: 1
|
|
24
24
|
plugins:
|
|
25
25
|
- *docker-ecr-cache
|
|
26
|
-
- docker-compose#v5.
|
|
26
|
+
- docker-compose#v5.11.0:
|
|
27
27
|
dependencies: false
|
|
28
28
|
environment:
|
|
29
29
|
- GITHUB_API_TOKEN
|
|
@@ -53,7 +53,7 @@ steps:
|
|
|
53
53
|
GET_NPM_TOKEN: please
|
|
54
54
|
plugins:
|
|
55
55
|
- *docker-ecr-cache
|
|
56
|
-
- docker-compose#v5.
|
|
56
|
+
- docker-compose#v5.11.0:
|
|
57
57
|
run: app
|
|
58
58
|
environment:
|
|
59
59
|
- GITHUB_API_TOKEN
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"datadog-lambda-js": "^12.0.0",
|
|
42
42
|
"dd-trace": "^5.0.0",
|
|
43
43
|
"pino-pretty": "^13.0.0",
|
|
44
|
-
"skuba": "13.0.0-custom-conditions-exports-
|
|
44
|
+
"skuba": "13.0.0-custom-conditions-exports-20251009024033"
|
|
45
45
|
},
|
|
46
46
|
"packageManager": "pnpm@10.17.1",
|
|
47
47
|
"engines": {
|