skuba 12.1.0 → 12.2.0-main-20250826233130
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/jest/moduleNameMapper.js +3 -0
- package/lib/cli/build/esbuild.js +1 -1
- package/lib/cli/build/esbuild.js.map +2 -2
- package/lib/cli/build/index.js +1 -1
- package/lib/cli/build/index.js.map +2 -2
- package/lib/cli/build/tsc.d.ts +7 -4
- package/lib/cli/build/tsc.js +69 -45
- package/lib/cli/build/tsc.js.map +3 -3
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +1 -1
- package/package.json +5 -5
- package/template/express-rest-api/package.json +1 -1
- package/template/greeter/package.json +1 -1
- package/template/koa-rest-api/package.json +1 -1
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +2 -2
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +0 -14
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +1 -4
- package/template/lambda-sqs-worker-cdk/package.json +1 -3
package/jest/moduleNameMapper.js
CHANGED
|
@@ -47,6 +47,9 @@ module.exports.createModuleNameMapper = (getConfig) => {
|
|
|
47
47
|
useESM: true,
|
|
48
48
|
});
|
|
49
49
|
|
|
50
|
+
// Always try finding the file with extension before trying without
|
|
51
|
+
moduleNameMapper['^(\\.{1,2}/.*)\\.js$'] = ['$1.js', '$1'];
|
|
52
|
+
|
|
50
53
|
// Normalise away any `..`s that may crop up from `baseUrl` usage.
|
|
51
54
|
// For example, a `baseUrl` of `src` and a path of `../cli` will result in
|
|
52
55
|
// `<rootDir>/src/../cli`, which can be normalised to `<rootDir>/cli`.
|
package/lib/cli/build/esbuild.js
CHANGED
|
@@ -48,7 +48,7 @@ const esbuild = async ({ debug }, args = process.argv.slice(2)) => {
|
|
|
48
48
|
process.exitCode = 1;
|
|
49
49
|
return;
|
|
50
50
|
}
|
|
51
|
-
const parsedCommandLine = (0, import_tsc.
|
|
51
|
+
const parsedCommandLine = (0, import_tsc.readTsBuildConfig)(args, log);
|
|
52
52
|
if (!parsedCommandLine || process.exitCode) {
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
@@ -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 {
|
|
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 { readTsBuildConfig, tsc } from './tsc.js';\n\ninterface EsbuildParameters {\n debug: boolean;\n}\n\nexport const esbuild = async (\n { debug }: 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 await build({\n bundle,\n entryPoints,\n format: compilerOptions.module === ModuleKind.CommonJS ? 'cjs' : undefined,\n outdir: compilerOptions.outDir,\n logLevel: debug ? 'debug' : 'info',\n logLimit: 0,\n platform:\n compilerOptions.moduleResolution === ModuleResolutionKind.NodeJs\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,iBAAuC;AAMhC,MAAM,UAAU,OACrB,EAAE,MAAM,GACR,OAAO,QAAQ,KAAK,MAAM,CAAC,MACxB;AACH,QAAM,UAAM,6BAAa,EAAE,MAAM,CAAC;AAElC,QAAM,cAAU,0BAAa,IAAI;AAEjC,MAAI,QAAQ,OAAO;AACjB,QAAI;AAAA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AC;AAAA,EACH;AACF;",
|
|
6
6
|
"names": ["tsconfigPaths"]
|
|
7
7
|
}
|
package/lib/cli/build/index.js
CHANGED
|
@@ -65,7 +65,7 @@ const build = async (args = process.argv.slice(2)) => {
|
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
-
const parsedCommandLine = (0, import_tsc.
|
|
68
|
+
const parsedCommandLine = (0, import_tsc.readTsBuildConfig)(args, import_logging.log);
|
|
69
69
|
if (!parsedCommandLine || process.exitCode) {
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/index.ts"],
|
|
4
|
-
"sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { log } from '../../utils/logging.js';\nimport { getStringPropFromConsumerManifest } from '../../utils/manifest.js';\n\nimport { copyAssets } from './assets.js';\nimport { esbuild } from './esbuild.js';\nimport {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAElB,kBAA6B;AAC7B,qBAAoB;AACpB,sBAAkD;AAElD,oBAA2B;AAC3B,qBAAwB;AACxB,
|
|
4
|
+
"sourcesContent": ["import chalk from 'chalk';\n\nimport { hasDebugFlag } from '../../utils/args.js';\nimport { log } from '../../utils/logging.js';\nimport { getStringPropFromConsumerManifest } 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 tool = await getStringPropFromConsumerManifest('build');\n\n switch (tool) {\n case 'esbuild': {\n const debug = hasDebugFlag(args);\n\n log.plain(chalk.yellow('esbuild'));\n await esbuild({ debug }, args);\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(chalk.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(log.subtle(JSON.stringify({ skuba: { build: tool } }, null, 2)));\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,mBAAkB;AAElB,kBAA6B;AAC7B,qBAAoB;AACpB,sBAAkD;AAElD,oBAA2B;AAC3B,qBAAwB;AACxB,iBAAuC;AAEhC,MAAM,QAAQ,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAG3D,QAAM,OAAO,UAAM,mDAAkC,OAAO;AAE5D,UAAQ,MAAM;AAAA,IACZ,KAAK,WAAW;AACd,YAAM,YAAQ,0BAAa,IAAI;AAE/B,yBAAI,MAAM,aAAAA,QAAM,OAAO,SAAS,CAAC;AACjC,gBAAM,wBAAQ,EAAE,MAAM,GAAG,IAAI;AAC7B;AAAA,IACF;AAAA;AAAA,IAGA,KAAK;AAAA,IACL,KAAK,OAAO;AACV,yBAAI,MAAM,aAAAA,QAAM,KAAK,KAAK,CAAC;AAC3B,gBAAM,gBAAI,IAAI;AACd;AAAA,IACF;AAAA,IAEA,SAAS;AACP,yBAAI;AAAA,QACF;AAAA,QACA,mBAAI,KAAK,cAAc;AAAA,QACvB;AAAA,MACF;AACA,yBAAI,IAAI,mBAAI,OAAO,KAAK,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,EAAE,GAAG,MAAM,CAAC,CAAC,CAAC;AACvE,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": ["chalk"]
|
|
7
7
|
}
|
package/lib/cli/build/tsc.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
import { type Logger } from '../../utils/logging.js';
|
|
3
3
|
export declare const tsc: (args?: string[]) => Promise<import("execa").ExecaReturnValue<string>>;
|
|
4
|
-
export declare const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
export declare const readTsBuildConfig: (args: string[] | undefined, log: Logger) => ts.ParsedCommandLine | undefined;
|
|
5
|
+
export declare const readTsConfig: ({ dir, fileName, log, silentlyFail, }: {
|
|
6
|
+
dir: string;
|
|
7
|
+
fileName: string;
|
|
8
|
+
log: Logger;
|
|
9
|
+
silentlyFail?: boolean;
|
|
10
|
+
}) => ts.ParsedCommandLine | undefined;
|
|
8
11
|
export declare const getCustomConditions: () => string[];
|
package/lib/cli/build/tsc.js
CHANGED
|
@@ -29,10 +29,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var tsc_exports = {};
|
|
30
30
|
__export(tsc_exports, {
|
|
31
31
|
getCustomConditions: () => getCustomConditions,
|
|
32
|
-
|
|
32
|
+
readTsBuildConfig: () => readTsBuildConfig,
|
|
33
|
+
readTsConfig: () => readTsConfig,
|
|
33
34
|
tsc: () => tsc
|
|
34
35
|
});
|
|
35
36
|
module.exports = __toCommonJS(tsc_exports);
|
|
37
|
+
var import_path = __toESM(require("path"));
|
|
36
38
|
var import_typescript = __toESM(require("typescript"));
|
|
37
39
|
var import_exec = require("../../utils/exec.js");
|
|
38
40
|
var import_logging = require("../../utils/logging.js");
|
|
@@ -44,71 +46,93 @@ const formatHost = {
|
|
|
44
46
|
getNewLine: () => import_typescript.default.sys.newLine
|
|
45
47
|
};
|
|
46
48
|
const tsconfigCache = /* @__PURE__ */ new Map();
|
|
47
|
-
const computeCacheKey = (args) => Array.from(args).sort().toString();
|
|
48
49
|
const tsc = async (args = process.argv.slice(2)) => {
|
|
49
50
|
const tscArgs = (0, import_args.parseTscArgs)(args);
|
|
50
51
|
const defaultArgs = tscArgs.build || tscArgs.project ? [] : DEFAULT_ARGS;
|
|
51
52
|
return (0, import_exec.exec)("tsc", ...defaultArgs, ...args);
|
|
52
53
|
};
|
|
53
|
-
const
|
|
54
|
+
const readTsBuildConfig = (args = process.argv.slice(2), log) => {
|
|
54
55
|
const tscArgs = (0, import_args.parseTscArgs)(args);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
|
|
56
|
+
log.debug(
|
|
57
|
+
log.bold(
|
|
58
|
+
"tsconfig",
|
|
59
|
+
...tscArgs.project ? ["--project", tscArgs.project] : []
|
|
60
|
+
)
|
|
61
|
+
);
|
|
62
|
+
log.debug(tscArgs.pathname);
|
|
63
|
+
const parsedConfig = readTsConfig({
|
|
64
|
+
dir: tscArgs.dirname,
|
|
65
|
+
fileName: tscArgs.basename,
|
|
66
|
+
log
|
|
67
|
+
});
|
|
68
|
+
if (parsedConfig?.errors.length) {
|
|
69
|
+
log.err(`Could not parse ${tscArgs.basename}.`);
|
|
70
|
+
log.subtle(import_typescript.default.formatDiagnostics(parsedConfig.errors, formatHost));
|
|
71
|
+
process.exitCode = 1;
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
return parsedConfig;
|
|
75
|
+
};
|
|
76
|
+
const readTsConfig = ({
|
|
77
|
+
dir,
|
|
78
|
+
fileName,
|
|
79
|
+
log,
|
|
80
|
+
silentlyFail = false
|
|
81
|
+
}) => {
|
|
82
|
+
const pathName = import_path.default.join(dir, fileName);
|
|
83
|
+
const cachedConfig = tsconfigCache.get(pathName);
|
|
84
|
+
if (cachedConfig) {
|
|
85
|
+
return cachedConfig;
|
|
86
|
+
}
|
|
87
|
+
const tsconfigFile = import_typescript.default.findConfigFile(
|
|
88
|
+
dir,
|
|
89
|
+
import_typescript.default.sys.fileExists.bind(void 0),
|
|
90
|
+
fileName
|
|
91
|
+
);
|
|
92
|
+
if (!tsconfigFile) {
|
|
93
|
+
if (!silentlyFail) {
|
|
94
|
+
log.err(`Could not find ${pathName}.`);
|
|
71
95
|
process.exitCode = 1;
|
|
72
|
-
return;
|
|
73
96
|
}
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
const readConfigFile = import_typescript.default.readConfigFile(
|
|
100
|
+
tsconfigFile,
|
|
101
|
+
import_typescript.default.sys.readFile.bind(void 0)
|
|
102
|
+
);
|
|
103
|
+
if (readConfigFile.error) {
|
|
104
|
+
if (!silentlyFail) {
|
|
105
|
+
log.err(`Could not read ${pathName}.`);
|
|
80
106
|
log.subtle(import_typescript.default.formatDiagnostic(readConfigFile.error, formatHost));
|
|
81
107
|
process.exitCode = 1;
|
|
82
|
-
return;
|
|
83
108
|
}
|
|
84
|
-
parsedCommandLine = import_typescript.default.parseJsonConfigFileContent(
|
|
85
|
-
readConfigFile.config,
|
|
86
|
-
import_typescript.default.sys,
|
|
87
|
-
tscArgs.dirname
|
|
88
|
-
);
|
|
89
|
-
tsconfigCache.set(computeCacheKey(args), parsedCommandLine);
|
|
90
|
-
}
|
|
91
|
-
if (parsedCommandLine.errors.length) {
|
|
92
|
-
log.err(`Could not parse ${tscArgs.pathname}.`);
|
|
93
|
-
log.subtle(import_typescript.default.formatDiagnostics(parsedCommandLine.errors, formatHost));
|
|
94
|
-
process.exitCode = 1;
|
|
95
109
|
return;
|
|
96
110
|
}
|
|
97
|
-
|
|
111
|
+
const parsedConfig = import_typescript.default.parseJsonConfigFileContent(
|
|
112
|
+
readConfigFile.config,
|
|
113
|
+
import_typescript.default.sys,
|
|
114
|
+
dir
|
|
115
|
+
);
|
|
116
|
+
tsconfigCache.set(pathName, parsedConfig);
|
|
117
|
+
return parsedConfig;
|
|
98
118
|
};
|
|
99
119
|
const getCustomConditions = () => {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
120
|
+
const parsedConfig = readTsConfig({
|
|
121
|
+
dir: process.cwd(),
|
|
122
|
+
fileName: "tsconfig.json",
|
|
123
|
+
log: import_logging.log,
|
|
124
|
+
silentlyFail: true
|
|
125
|
+
});
|
|
126
|
+
if (!parsedConfig) {
|
|
105
127
|
return [];
|
|
106
128
|
}
|
|
129
|
+
return parsedConfig.options.customConditions ?? [];
|
|
107
130
|
};
|
|
108
131
|
// Annotate the CommonJS export names for ESM import in node:
|
|
109
132
|
0 && (module.exports = {
|
|
110
133
|
getCustomConditions,
|
|
111
|
-
|
|
134
|
+
readTsBuildConfig,
|
|
135
|
+
readTsConfig,
|
|
112
136
|
tsc
|
|
113
137
|
});
|
|
114
138
|
//# sourceMappingURL=tsc.js.map
|
package/lib/cli/build/tsc.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/tsc.ts"],
|
|
4
|
-
"sourcesContent": ["import ts from 'typescript';\n\nimport { exec } from '../../utils/exec.js';\nimport { type Logger, log as logger } from '../../utils/logging.js';\n\nimport { parseTscArgs } from './args.js';\n\nconst DEFAULT_ARGS = ['--project', 'tsconfig.build.json'] as const;\n\nconst formatHost: ts.FormatDiagnosticsHost = {\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: ts.sys.getCurrentDirectory.bind(undefined),\n getNewLine: () => ts.sys.newLine,\n};\n\nconst tsconfigCache = new Map<string, ts.ParsedCommandLine>();\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,wBAAe;AAEf,kBAAqB;AACrB,qBAA2C;AAE3C,kBAA6B;AAE7B,MAAM,eAAe,CAAC,aAAa,qBAAqB;AAExD,MAAM,aAAuC;AAAA,EAC3C,sBAAsB,CAAC,aAAa;AAAA,EACpC,qBAAqB,kBAAAA,QAAG,IAAI,oBAAoB,KAAK,MAAS;AAAA,EAC9D,YAAY,MAAM,kBAAAA,QAAG,IAAI;AAC3B;AAEA,MAAM,gBAAgB,oBAAI,IAAkC;
|
|
6
|
-
"names": ["ts", "logger"]
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport ts from 'typescript';\n\nimport { exec } from '../../utils/exec.js';\nimport { type Logger, log as logger } from '../../utils/logging.js';\n\nimport { parseTscArgs } from './args.js';\n\nconst DEFAULT_ARGS = ['--project', 'tsconfig.build.json'] as const;\n\nconst formatHost: ts.FormatDiagnosticsHost = {\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: ts.sys.getCurrentDirectory.bind(undefined),\n getNewLine: () => ts.sys.newLine,\n};\n\nconst tsconfigCache = new Map<string, ts.ParsedCommandLine>();\n\nexport const tsc = async (args = process.argv.slice(2)) => {\n const tscArgs = parseTscArgs(args);\n\n // Build flag is incompatible with project flag.\n const defaultArgs = tscArgs.build || tscArgs.project ? [] : DEFAULT_ARGS;\n\n return exec('tsc', ...defaultArgs, ...args);\n};\n\nexport const readTsBuildConfig = (\n args = process.argv.slice(2),\n log: Logger,\n) => {\n const tscArgs = parseTscArgs(args);\n\n log.debug(\n log.bold(\n 'tsconfig',\n ...(tscArgs.project ? ['--project', tscArgs.project] : []),\n ),\n );\n log.debug(tscArgs.pathname);\n\n const parsedConfig = readTsConfig({\n dir: tscArgs.dirname,\n fileName: tscArgs.basename,\n log,\n });\n\n if (parsedConfig?.errors.length) {\n log.err(`Could not parse ${tscArgs.basename}.`);\n log.subtle(ts.formatDiagnostics(parsedConfig.errors, formatHost));\n process.exitCode = 1;\n return;\n }\n\n return parsedConfig;\n};\n\nexport const readTsConfig = ({\n dir,\n fileName,\n log,\n silentlyFail = false,\n}: {\n dir: string;\n fileName: string;\n log: Logger;\n silentlyFail?: boolean;\n}) => {\n const pathName = path.join(dir, fileName);\n\n const cachedConfig = tsconfigCache.get(pathName);\n\n if (cachedConfig) {\n return cachedConfig;\n }\n\n const tsconfigFile = ts.findConfigFile(\n dir,\n ts.sys.fileExists.bind(undefined),\n fileName,\n );\n if (!tsconfigFile) {\n if (!silentlyFail) {\n log.err(`Could not find ${pathName}.`);\n process.exitCode = 1;\n }\n return;\n }\n\n const readConfigFile = ts.readConfigFile(\n tsconfigFile,\n ts.sys.readFile.bind(undefined),\n );\n if (readConfigFile.error) {\n if (!silentlyFail) {\n log.err(`Could not read ${pathName}.`);\n log.subtle(ts.formatDiagnostic(readConfigFile.error, formatHost));\n process.exitCode = 1;\n }\n return;\n }\n\n const parsedConfig = ts.parseJsonConfigFileContent(\n readConfigFile.config,\n ts.sys,\n dir,\n );\n\n tsconfigCache.set(pathName, parsedConfig);\n\n return parsedConfig;\n};\n\nexport const getCustomConditions = () => {\n const parsedConfig = readTsConfig({\n dir: process.cwd(),\n fileName: 'tsconfig.json',\n log: logger,\n silentlyFail: true,\n });\n\n if (!parsedConfig) {\n return [];\n }\n\n return parsedConfig.options.customConditions ?? [];\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,wBAAe;AAEf,kBAAq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MAAI,cAAc;AAChB,WAAO;AAAA,EACT;AAEA,QAAM,eAAe,kBAAAD,QAAG;AAAA,IACtB;AAAA,IACA,kBAAAA,QAAG,IAAI,WAAW,KAAK,MAAS;AAAA,IAChC;AAAA,EACF;AACA,MAAI,CAAC,cAAc;AACjB,QAAI,CAAC,cAAc;AACjB,UAAI,IAAI,kBAAkB,QAAQ,GAAG;AACrC,cAAQ,WAAW;AAAA,IACrB;AACA;AAAA,EACF;AAEA,QAAM,iBAAiB,kBAAAA,QAAG;AAAA,IACxB;AAAA,IACA,kBAAAA,QAAG,IAAI,SAAS,KAAK,MAAS;AAAA,EAChC;AACA,MAAI,eAAe,OAAO;AACxB,QAAI,CAAC,cAAc;AACjB,UAAI,IAAI,kBAAkB,QAAQ,GAAG;AACrC,UAAI,OAAO,kBAAAA,QAAG,iBAAiB,eAAe,OAAO,UAAU,CAAC;AAChE,cAAQ,WAAW;AAAA,IACrB;AACA;AAAA,EACF;AAEA,QAAM,eAAe,kBAAAA,QAAG;AAAA,IACtB,eAAe;AAAA,IACf,kBAAAA,QAAG;AAAA,IACH;AAAA,EACF;AAEA,gBAAc,IAAI,UAAU,YAAY;AAExC,SAAO;AACT;AAEO,MAAM,sBAAsB,MAAM;AACvC,QAAM,eAAe,aAAa;AAAA,IAChC,KAAK,QAAQ,IAAI;AAAA,IACjB,UAAU;AAAA,IACV,KAAK,eAAAE;AAAA,IACL,cAAc;AAAA,EAChB,CAAC;AAED,MAAI,CAAC,cAAc;AACjB,WAAO,CAAC;AAAA,EACV;AAEA,SAAO,aAAa,QAAQ,oBAAoB,CAAC;AACnD;",
|
|
6
|
+
"names": ["ts", "path", "logger"]
|
|
7
7
|
}
|
|
@@ -129,7 +129,7 @@ const patchRenovateConfig = async (mode, dir) => {
|
|
|
129
129
|
});
|
|
130
130
|
return { result: "apply" };
|
|
131
131
|
};
|
|
132
|
-
const tryPatchRenovateConfig = async ({
|
|
132
|
+
const tryPatchRenovateConfig = (async ({
|
|
133
133
|
mode,
|
|
134
134
|
dir = process.cwd()
|
|
135
135
|
}) => {
|
|
@@ -144,7 +144,7 @@ const tryPatchRenovateConfig = async ({
|
|
|
144
144
|
import_logging.log.subtle((0, import_util.inspect)(err));
|
|
145
145
|
return { result: "skip", reason: "due to an error" };
|
|
146
146
|
}
|
|
147
|
-
};
|
|
147
|
+
});
|
|
148
148
|
// Annotate the CommonJS export names for ESM import in node:
|
|
149
149
|
0 && (module.exports = {
|
|
150
150
|
tryPatchRenovateConfig
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../src/cli/lint/internalLints/patchRenovateConfig.ts"],
|
|
4
4
|
"sourcesContent": ["import path from 'path';\nimport { inspect } from 'util';\n\nimport fs from 'fs-extra';\nimport * as fleece from 'golden-fleece';\nimport * as z from 'zod/v4';\n\nimport * as Git from '../../../api/git/index.js';\nimport { log } from '../../../utils/logging.js';\nimport { createDestinationFileReader } from '../../configure/analysis/project.js';\nimport { RENOVATE_CONFIG_FILENAMES } from '../../configure/modules/renovate.js';\nimport { formatPrettier } from '../../configure/processing/prettier.js';\n\nimport type { PatchFunction, PatchReturnType } from './upgrade/index.js';\n\nconst EXISTING_REPO_PRESET_REGEX = /(github|local)>(seek-jobs|seekasia)\\//;\n\ntype RenovateFiletype = 'json' | 'json5';\n\ntype RenovatePreset =\n | 'local>seekasia/renovate-config'\n | 'local>seek-jobs/renovate-config';\n\nconst renovateConfigSchema = z.object({\n extends: z.array(z.string()),\n});\n\nconst ownerToRenovatePreset = (owner: string): RenovatePreset | undefined => {\n const lowercaseOwner = owner.toLowerCase();\n\n switch (lowercaseOwner) {\n case 'seekasia':\n return 'local>seekasia/renovate-config';\n\n case 'seek-jobs':\n return 'local>seek-jobs/renovate-config';\n\n default:\n return;\n }\n};\n\ntype PatchFile = (props: {\n filepath: string;\n input: string;\n presetToAdd: RenovatePreset;\n}) => Promise<void>;\n\nconst patchJson: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const json: unknown = JSON.parse(input);\n\n const config = renovateConfigSchema.safeParse(json);\n\n if (!config.success) {\n return;\n }\n\n config.data.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n await formatPrettier(JSON.stringify(config.data), { parser: 'json' }),\n );\n\n return;\n};\n\nconst patchJson5: PatchFile = async ({ filepath, input, presetToAdd }) => {\n const json: unknown = fleece.evaluate(input);\n\n const config = renovateConfigSchema.safeParse(json);\n\n if (!config.success) {\n return;\n }\n\n config.data.extends.unshift(presetToAdd);\n\n await fs.promises.writeFile(\n filepath,\n await formatPrettier(fleece.patch(input, config.data), { parser: 'json5' }),\n );\n\n return;\n};\n\nconst patchByFiletype: Record<RenovateFiletype, PatchFile> = {\n json: patchJson,\n json5: patchJson5,\n};\n\nconst patchRenovateConfig = async (\n mode: 'format' | 'lint',\n dir: string,\n): Promise<PatchReturnType> => {\n const readFile = createDestinationFileReader(dir);\n\n const { owner } = await Git.getOwnerAndRepo({ dir });\n\n const presetToAdd = ownerToRenovatePreset(owner);\n\n if (!presetToAdd) {\n return {\n result: 'skip',\n reason: 'owner does not map to a SEEK preset',\n };\n }\n\n const maybeConfigs = await Promise.all(\n RENOVATE_CONFIG_FILENAMES.map(async (filepath) => ({\n input: await readFile(filepath),\n filepath,\n })),\n );\n\n const config = maybeConfigs.find((maybeConfig) => Boolean(maybeConfig.input));\n if (!config?.input) {\n return { result: 'skip', reason: 'no config found' };\n }\n\n if (\n // The file appears to mention the baseline preset for the configured Git\n // owner. This is a naive check for simplicity.\n config.input.includes(presetToAdd) ||\n // Ignore any renovate configuration which already extends a SEEK-Jobs or seekasia config\n EXISTING_REPO_PRESET_REGEX.exec(config.input)\n ) {\n return {\n result: 'skip',\n reason: 'config already has a SEEK preset',\n };\n }\n\n if (mode === 'lint') {\n return { result: 'apply' };\n }\n\n const filetype: RenovateFiletype = config.filepath\n .toLowerCase()\n .endsWith('.json5')\n ? 'json5'\n : 'json';\n\n const patchFile = patchByFiletype[filetype];\n\n await patchFile({\n filepath: path.resolve(dir, config.filepath),\n input: config.input,\n presetToAdd,\n });\n\n return { result: 'apply' };\n};\n\nexport const tryPatchRenovateConfig = (async ({\n mode,\n dir = process.cwd(),\n}) => {\n try {\n // In a monorepo we may be invoked within a subdirectory, but we are working\n // with Renovate config that should be relative to the repository root.\n const gitRoot = await Git.findRoot({ dir });\n if (!gitRoot) {\n return { result: 'skip', reason: 'no Git root found' };\n }\n\n return await patchRenovateConfig(mode, gitRoot);\n } catch (err) {\n log.warn('Failed to patch Renovate config.');\n log.subtle(inspect(err));\n return { result: 'skip', reason: 'due to an error' };\n }\n}) satisfies PatchFunction;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AACjB,kBAAwB;AAExB,sBAAe;AACf,aAAwB;AACxB,QAAmB;AAEnB,UAAqB;AACrB,qBAAoB;AACpB,qBAA4C;AAC5C,sBAA0C;AAC1C,sBAA+B;AAI/B,MAAM,6BAA6B;AAQnC,MAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC;AAC7B,CAAC;AAED,MAAM,wBAAwB,CAAC,UAA8C;AAC3E,QAAM,iBAAiB,MAAM,YAAY;AAEzC,UAAQ,gBAAgB;AAAA,IACtB,KAAK;AACH,aAAO;AAAA,IAET,KAAK;AACH,aAAO;AAAA,IAET;AACE;AAAA,EACJ;AACF;AAQA,MAAM,YAAuB,OAAO,EAAE,UAAU,OAAO,YAAY,MAAM;AACvE,QAAM,OAAgB,KAAK,MAAM,KAAK;AAEtC,QAAM,SAAS,qBAAqB,UAAU,IAAI;AAElD,MAAI,CAAC,OAAO,SAAS;AACnB;AAAA,EACF;AAEA,SAAO,KAAK,QAAQ,QAAQ,WAAW;AAEvC,QAAM,gBAAAA,QAAG,SAAS;AAAA,IAChB;AAAA,IACA,UAAM,gCAAe,KAAK,UAAU,OAAO,IAAI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SAAS,QAAQ;AACnB,WAAO,EAAE,QAAQ,QAAQ;AAAA,EAC3B;AAEA,QAAM,WAA6B,OAAO,SACvC,YAAY,EACZ,SAAS,QAAQ,IAChB,UACA;AAEJ,QAAM,YAAY,gBAAgB,QAAQ;AAE1C,QAAM,UAAU;AAAA,IACd,UAAU,YAAAC,QAAK,QAAQ,KAAK,OAAO,QAAQ;AAAA,IAC3C,OAAO,OAAO;AAAA,IACd;AAAA,EACF,CAAC;AAED,SAAO,EAAE,QAAQ,QAAQ;AAC3B;AAEO,MAAM,0BAA0B,OAAO;AAAA,EAC5C;AAAA,EACA,MAAM,QAAQ,IAAI;AACpB,MAAM;AACJ,MAAI;AAGF,UAAM,UAAU,MAAM,IAAI,SAAS,EAAE,IAAI,CAAC;AAC1C,QAAI,CAAC,SAAS;AACZ,aAAO,EAAE,QAAQ,QAAQ,QAAQ,oBAAoB;AAAA,IACvD;AAEA,WAAO,MAAM,oBAAoB,MAAM,OAAO;AAAA,EAChD,SAAS,KAAK;AACZ,uBAAI,KAAK,kCAAkC;AAC3C,uBAAI,WAAO,qBAAQ,GAAG,CAAC;AACvB,WAAO,EAAE,QAAQ,QAAQ,QAAQ,kBAAkB;AAAA,EACrD;AACF;",
|
|
6
6
|
"names": ["fs", "path"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.2.0-main-20250826233130",
|
|
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",
|
|
@@ -97,10 +97,10 @@
|
|
|
97
97
|
"tsx": "^4.16.2",
|
|
98
98
|
"typescript": "~5.9.0",
|
|
99
99
|
"zod": "^4.0.0",
|
|
100
|
-
"eslint-config-skuba": "7.1.
|
|
100
|
+
"eslint-config-skuba": "7.1.1-main-20250826233130"
|
|
101
101
|
},
|
|
102
102
|
"devDependencies": {
|
|
103
|
-
"@changesets/cli": "2.29.
|
|
103
|
+
"@changesets/cli": "2.29.6",
|
|
104
104
|
"@changesets/get-github-info": "0.6.0",
|
|
105
105
|
"@jest/reporters": "30.0.5",
|
|
106
106
|
"@jest/test-result": "30.0.5",
|
|
@@ -120,9 +120,9 @@
|
|
|
120
120
|
"express": "5.1.0",
|
|
121
121
|
"fastify": "5.5.0",
|
|
122
122
|
"jest-diff": "30.0.5",
|
|
123
|
-
"jsonfile": "6.
|
|
123
|
+
"jsonfile": "6.2.0",
|
|
124
124
|
"koa": "3.0.1",
|
|
125
|
-
"memfs": "4.
|
|
125
|
+
"memfs": "4.38.2",
|
|
126
126
|
"remark-cli": "12.0.1",
|
|
127
127
|
"remark-preset-lint-recommended": "7.0.1",
|
|
128
128
|
"semver": "7.7.2",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@opentelemetry/api": "^1.9.0",
|
|
17
17
|
"@opentelemetry/core": "^2.0.0",
|
|
18
18
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.203.0",
|
|
19
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
19
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.57.0",
|
|
20
20
|
"@opentelemetry/instrumentation-http": "^0.203.0",
|
|
21
21
|
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
22
22
|
"@opentelemetry/sdk-node": "^0.203.0",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@opentelemetry/api": "^1.9.0",
|
|
19
19
|
"@opentelemetry/core": "^2.0.0",
|
|
20
20
|
"@opentelemetry/exporter-trace-otlp-grpc": "^0.203.0",
|
|
21
|
-
"@opentelemetry/instrumentation-aws-sdk": "^0.
|
|
21
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.57.0",
|
|
22
22
|
"@opentelemetry/instrumentation-http": "^0.203.0",
|
|
23
23
|
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
24
24
|
"@opentelemetry/sdk-node": "^0.203.0",
|
|
@@ -173,7 +173,6 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
173
173
|
},
|
|
174
174
|
"S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
|
|
175
175
|
},
|
|
176
|
-
"Description": "Updated at 1212-12-12T12:12:12.121Z",
|
|
177
176
|
"Environment": {
|
|
178
177
|
"Variables": {
|
|
179
178
|
"DD_API_KEY_SECRET_ARN": {
|
|
@@ -235,6 +234,7 @@ exports[`returns expected CloudFormation stack for dev 1`] = `
|
|
|
235
234
|
],
|
|
236
235
|
},
|
|
237
236
|
],
|
|
237
|
+
"MemorySize": 512,
|
|
238
238
|
"ReservedConcurrentExecutions": 3,
|
|
239
239
|
"Role": {
|
|
240
240
|
"Fn::GetAtt": [
|
|
@@ -926,7 +926,6 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
926
926
|
},
|
|
927
927
|
"S3Key": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.zip",
|
|
928
928
|
},
|
|
929
|
-
"Description": "Updated at 1212-12-12T12:12:12.121Z",
|
|
930
929
|
"Environment": {
|
|
931
930
|
"Variables": {
|
|
932
931
|
"DD_API_KEY_SECRET_ARN": {
|
|
@@ -988,6 +987,7 @@ exports[`returns expected CloudFormation stack for prod 1`] = `
|
|
|
988
987
|
],
|
|
989
988
|
},
|
|
990
989
|
],
|
|
990
|
+
"MemorySize": 512,
|
|
991
991
|
"ReservedConcurrentExecutions": 20,
|
|
992
992
|
"Role": {
|
|
993
993
|
"Fn::GetAtt": [
|
|
@@ -1,20 +1,6 @@
|
|
|
1
1
|
import { App, aws_secretsmanager, aws_sns } from 'aws-cdk-lib';
|
|
2
2
|
import { Template } from 'aws-cdk-lib/assertions';
|
|
3
3
|
|
|
4
|
-
const currentDate = '1212-12-12T12:12:12.121Z';
|
|
5
|
-
|
|
6
|
-
jest.useFakeTimers({
|
|
7
|
-
legacyFakeTimers: false,
|
|
8
|
-
doNotFake: [
|
|
9
|
-
'nextTick',
|
|
10
|
-
'setInterval',
|
|
11
|
-
'clearInterval',
|
|
12
|
-
'setTimeout',
|
|
13
|
-
'clearTimeout',
|
|
14
|
-
],
|
|
15
|
-
now: new Date(currentDate),
|
|
16
|
-
});
|
|
17
|
-
|
|
18
4
|
const originalDeployment = process.env.DEPLOYMENT;
|
|
19
5
|
const originalVersion = process.env.VERSION;
|
|
20
6
|
|
|
@@ -87,6 +87,7 @@ export class AppStack extends Stack {
|
|
|
87
87
|
const worker = new aws_lambda_nodejs.NodejsFunction(this, 'worker', {
|
|
88
88
|
architecture: aws_lambda.Architecture[architecture],
|
|
89
89
|
runtime: aws_lambda.Runtime.NODEJS_22_X,
|
|
90
|
+
memorySize: 512,
|
|
90
91
|
environmentEncryption: kmsKey,
|
|
91
92
|
// aws-sdk-v3 sets this to true by default, so it is not necessary to set the environment variable
|
|
92
93
|
// https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/node-reusing-connections.html
|
|
@@ -113,10 +114,6 @@ export class AppStack extends Stack {
|
|
|
113
114
|
}
|
|
114
115
|
: {}),
|
|
115
116
|
},
|
|
116
|
-
// https://github.com/aws/aws-cdk/issues/28237
|
|
117
|
-
// This forces the lambda to be updated on every deployment
|
|
118
|
-
// If you do not wish to use hotswap, you can remove the new Date().toISOString() from the description
|
|
119
|
-
description: `Updated at ${new Date().toISOString()}`,
|
|
120
117
|
reservedConcurrentExecutions: config.workerLambda.reservedConcurrency,
|
|
121
118
|
});
|
|
122
119
|
|
|
@@ -4,8 +4,6 @@
|
|
|
4
4
|
"license": "UNLICENSED",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"deploy": "cdk deploy appStack --require-approval never",
|
|
7
|
-
"deploy:hotswap": "pnpm --silent run deploy --hotswap",
|
|
8
|
-
"deploy:watch": "pnpm --silent deploy:hotswap --watch",
|
|
9
7
|
"format": "skuba format",
|
|
10
8
|
"lint": "skuba lint",
|
|
11
9
|
"start": "skuba start --port <%- port %>",
|
|
@@ -37,7 +35,7 @@
|
|
|
37
35
|
"datadog-lambda-js": "^12.0.0",
|
|
38
36
|
"dd-trace": "^5.0.0",
|
|
39
37
|
"pino-pretty": "^13.0.0",
|
|
40
|
-
"skuba": "
|
|
38
|
+
"skuba": "12.2.0-main-20250826233130"
|
|
41
39
|
},
|
|
42
40
|
"packageManager": "pnpm@10.14.0",
|
|
43
41
|
"engines": {
|