skuba 14.0.0-rfc-upgrade-on-test-20251217012156 → 14.0.0-tsdown-package-templates-20251225102319
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/assets.d.ts +0 -9
- package/lib/cli/build/assets.js +2 -22
- package/lib/cli/build/assets.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +1 -5
- package/lib/cli/lint/internalLints/upgrade/index.js +1 -2
- package/lib/cli/lint/internalLints/upgrade/index.js.map +2 -2
- package/lib/cli/test/index.js +0 -21
- package/lib/cli/test/index.js.map +2 -2
- package/package.json +3 -3
- package/template/greeter/package.json +2 -2
- package/template/lambda-sqs-worker-cdk/package.json +2 -2
- package/template/oss-npm-package/_package.json +16 -2
- package/template/oss-npm-package/tsconfig.json +2 -1
- package/template/oss-npm-package/tsdown.config.ts +12 -0
- package/template/private-npm-package/_package.json +16 -2
- package/template/private-npm-package/tsconfig.json +2 -1
- package/template/private-npm-package/tsdown.config.ts +12 -0
- package/lib/cli/buildPackage/index.d.ts +0 -1
- package/lib/cli/buildPackage/index.js +0 -67
- package/lib/cli/buildPackage/index.js.map +0 -7
|
@@ -1,11 +1,2 @@
|
|
|
1
|
-
import { styleText } from 'node:util';
|
|
2
1
|
import { type Logger } from '../../utils/logging.js';
|
|
3
|
-
type StyleColor = Parameters<typeof styleText>[0];
|
|
4
2
|
export declare const copyAssets: (destinationDir: string, logger?: Logger) => Promise<void>;
|
|
5
|
-
interface CopyAssetsConfig {
|
|
6
|
-
outDir: string;
|
|
7
|
-
name: string;
|
|
8
|
-
prefixColor: StyleColor;
|
|
9
|
-
}
|
|
10
|
-
export declare const copyAssetsConcurrently: (configs: CopyAssetsConfig[]) => Promise<void>;
|
|
11
|
-
export {};
|
package/lib/cli/build/assets.js
CHANGED
|
@@ -28,11 +28,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
29
|
var assets_exports = {};
|
|
30
30
|
__export(assets_exports, {
|
|
31
|
-
copyAssets: () => copyAssets
|
|
32
|
-
copyAssetsConcurrently: () => copyAssetsConcurrently
|
|
31
|
+
copyAssets: () => copyAssets
|
|
33
32
|
});
|
|
34
33
|
module.exports = __toCommonJS(assets_exports);
|
|
35
|
-
var import_node_util = require("node:util");
|
|
36
34
|
var import_path = __toESM(require("path"));
|
|
37
35
|
var import_fs_extra = __toESM(require("fs-extra"));
|
|
38
36
|
var import_copy = require("../../utils/copy.js");
|
|
@@ -78,26 +76,8 @@ const copyAssets = async (destinationDir, logger = import_logging.log) => {
|
|
|
78
76
|
})
|
|
79
77
|
);
|
|
80
78
|
};
|
|
81
|
-
const copyAssetsConcurrently = async (configs) => {
|
|
82
|
-
const maxNameLength = configs.reduce(
|
|
83
|
-
(length, command) => Math.max(length, command.name.length),
|
|
84
|
-
0
|
|
85
|
-
);
|
|
86
|
-
await Promise.all(
|
|
87
|
-
configs.map(
|
|
88
|
-
async ({ outDir, name, prefixColor }) => copyAssets(
|
|
89
|
-
outDir,
|
|
90
|
-
(0, import_logging.createLogger)({
|
|
91
|
-
debug: false,
|
|
92
|
-
prefixes: [(0, import_node_util.styleText)(prefixColor, `${name.padEnd(maxNameLength)} \u2502`)]
|
|
93
|
-
})
|
|
94
|
-
)
|
|
95
|
-
)
|
|
96
|
-
);
|
|
97
|
-
};
|
|
98
79
|
// Annotate the CommonJS export names for ESM import in node:
|
|
99
80
|
0 && (module.exports = {
|
|
100
|
-
copyAssets
|
|
101
|
-
copyAssetsConcurrently
|
|
81
|
+
copyAssets
|
|
102
82
|
});
|
|
103
83
|
//# sourceMappingURL=assets.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/build/assets.ts"],
|
|
4
|
-
"sourcesContent": ["import
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\n\nimport { copyFile } from '../../utils/copy.js';\nimport { buildPatternToFilepathMap, crawlDirectory } from '../../utils/dir.js';\nimport { type Logger, log } from '../../utils/logging.js';\nimport {\n getEntryPointFromManifest,\n getManifestProperties,\n} from '../../utils/manifest.js';\n\nexport const copyAssets = async (\n destinationDir: string,\n logger: Logger = log,\n) => {\n const manifest = await getManifestProperties<string, string[]>('assets');\n\n if (!manifest?.value) {\n return;\n }\n\n const entryPoint = await getEntryPointFromManifest();\n if (!entryPoint) {\n return;\n }\n\n const pathSegments = entryPoint.split(path.sep);\n const srcDir = (pathSegments.length > 1 && pathSegments[0]) || '';\n const resolvedSrcDir = path.resolve(path.dirname(manifest.path), srcDir);\n const resolvedDestinationDir = path.resolve(\n path.dirname(manifest.path),\n destinationDir,\n );\n\n const allFiles = await crawlDirectory(resolvedSrcDir);\n const filesByPattern = buildPatternToFilepathMap(manifest.value, allFiles, {\n cwd: resolvedSrcDir,\n dot: true,\n });\n const matchedFiles = Array.from(\n new Set(Object.values(filesByPattern).flat()),\n );\n\n await Promise.all(\n matchedFiles.map(async (filename) => {\n logger.subtle(`Copying ${filename}`);\n\n await fs.promises.mkdir(\n path.dirname(path.join(resolvedDestinationDir, filename)),\n { recursive: true },\n );\n await copyFile(\n path.join(resolvedSrcDir, filename),\n path.join(resolvedDestinationDir, filename),\n { processors: [] },\n );\n }),\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,kBAAyB;AACzB,iBAA0D;AAC1D,qBAAiC;AACjC,sBAGO;AAEA,MAAM,aAAa,OACxB,gBACA,SAAiB,uBACd;AACH,QAAM,WAAW,UAAM,uCAAwC,QAAQ;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promise<PatchReturnType>;
|
|
23
|
-
|
|
24
|
-
upgraded?: boolean;
|
|
25
|
-
};
|
|
26
|
-
export declare const upgradeSkuba: (mode: "lint" | "format", logger: Logger, additionalFlags?: string[]) => Promise<UpgradeSkubaResult>;
|
|
27
|
-
export {};
|
|
23
|
+
export declare const upgradeSkuba: (mode: "lint" | "format", logger: Logger, additionalFlags?: string[]) => Promise<InternalLintResult>;
|
|
@@ -140,8 +140,7 @@ const upgradeSkuba = async (mode, logger, additionalFlags = []) => {
|
|
|
140
140
|
logger.newline();
|
|
141
141
|
return {
|
|
142
142
|
ok: true,
|
|
143
|
-
fixable: false
|
|
144
|
-
upgraded: true
|
|
143
|
+
fixable: false
|
|
145
144
|
};
|
|
146
145
|
};
|
|
147
146
|
// 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/index.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport type { ReadResult } from 'read-pkg-up';\nimport { gte, sort } from 'semver';\n\nimport type { Logger } from '../../../../utils/logging.js';\nimport { getConsumerManifest } from '../../../../utils/manifest.js';\nimport {\n type PackageManagerConfig,\n detectPackageManager,\n} from '../../../../utils/packageManager.js';\nimport { getSkubaVersion } from '../../../../utils/version.js';\nimport { formatPackage } from '../../../configure/processing/package.js';\nimport type { SkubaPackageJson } from '../../../init/writePackageJson.js';\nimport type { InternalLintResult } from '../../internal.js';\n\nexport type Patches = Patch[];\nexport type Patch = {\n apply: PatchFunction;\n description: string;\n};\nexport type PatchReturnType =\n | { result: 'apply' }\n | { result: 'skip'; reason?: string };\n\nexport type PatchConfig = {\n mode: 'format' | 'lint';\n manifest: ReadResult;\n packageManager: PackageManagerConfig;\n dir?: string;\n};\n\nexport type PatchFunction = (config: PatchConfig) => Promise<PatchReturnType>;\n\nconst getPatches = async (manifestVersion: string): Promise<Patches> => {\n const patches = await fs.readdir(path.join(__dirname, 'patches'), {\n withFileTypes: true,\n });\n\n // The patches are sorted by the version they were added from.\n // Only return patches that are newer or equal to the current version.\n const patchesForVersion = sort(\n patches.flatMap((patch) =>\n // Is a directory rather than a JavaScript source file\n patch.isDirectory() &&\n // Has been added since the last patch run on the project\n gte(patch.name, manifestVersion)\n ? patch.name\n : [],\n ),\n );\n\n return (await Promise.all(patchesForVersion.map(resolvePatches))).flat();\n};\n\nconst fileExtensions = ['js', 'ts'];\n\n// Hack to allow our Jest environment/transform to resolve the patches\n// In normal scenarios this will resolve immediately after the .js import\nconst resolvePatches = async (version: string): Promise<Patches> => {\n for (const extension of fileExtensions) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access\n return (await import(`./patches/${version}/index.${extension}`)).patches;\n } catch {\n // Ignore\n }\n }\n throw new Error(`Could not resolve patches for ${version}`);\n};\n\
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,oBAA0B;AAG1B,sBAAoC;AACpC,4BAGO;AACP,qBAAgC;AAChC,qBAA8B;AAsB9B,MAAM,aAAa,OAAO,oBAA8C;AACtE,QAAM,UAAU,MAAM,gBAAAA,QAAG,QAAQ,YAAAC,QAAK,KAAK,WAAW,SAAS,GAAG;AAAA,IAChE,eAAe;AAAA,EACjB,CAAC;AAID,QAAM,wBAAoB;AAAA,IACxB,QAAQ;AAAA,MAAQ,CAAC;AAAA;AAAA,QAEf,MAAM,YAAY;AAAA,YAElB,mBAAI,MAAM,MAAM,eAAe,IAC3B,MAAM,OACN,CAAC;AAAA;AAAA,IACP;AAAA,EACF;AAEA,UAAQ,MAAM,QAAQ,IAAI,kBAAkB,IAAI,cAAc,CAAC,GAAG,KAAK;AACzE;AAEA,MAAM,iBAAiB,CAAC,MAAM,IAAI;AAIlC,MAAM,iBAAiB,OAAO,YAAsC;AAClE,aAAW,aAAa,gBAAgB;AACtC,QAAI;AAEF,cAAQ,MAAM,OAAO,aAAa,OAAO,UAAU,SAAS,KAAK;AAAA,IACnE,QAAQ;AAAA,IAER;AAAA,EACF;AACA,QAAM,IAAI,MAAM,iCAAiC,OAAO,EAAE;AAC5D;
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport fs from 'fs-extra';\nimport type { ReadResult } from 'read-pkg-up';\nimport { gte, sort } from 'semver';\n\nimport type { Logger } from '../../../../utils/logging.js';\nimport { getConsumerManifest } from '../../../../utils/manifest.js';\nimport {\n type PackageManagerConfig,\n detectPackageManager,\n} from '../../../../utils/packageManager.js';\nimport { getSkubaVersion } from '../../../../utils/version.js';\nimport { formatPackage } from '../../../configure/processing/package.js';\nimport type { SkubaPackageJson } from '../../../init/writePackageJson.js';\nimport type { InternalLintResult } from '../../internal.js';\n\nexport type Patches = Patch[];\nexport type Patch = {\n apply: PatchFunction;\n description: string;\n};\nexport type PatchReturnType =\n | { result: 'apply' }\n | { result: 'skip'; reason?: string };\n\nexport type PatchConfig = {\n mode: 'format' | 'lint';\n manifest: ReadResult;\n packageManager: PackageManagerConfig;\n dir?: string;\n};\n\nexport type PatchFunction = (config: PatchConfig) => Promise<PatchReturnType>;\n\nconst getPatches = async (manifestVersion: string): Promise<Patches> => {\n const patches = await fs.readdir(path.join(__dirname, 'patches'), {\n withFileTypes: true,\n });\n\n // The patches are sorted by the version they were added from.\n // Only return patches that are newer or equal to the current version.\n const patchesForVersion = sort(\n patches.flatMap((patch) =>\n // Is a directory rather than a JavaScript source file\n patch.isDirectory() &&\n // Has been added since the last patch run on the project\n gte(patch.name, manifestVersion)\n ? patch.name\n : [],\n ),\n );\n\n return (await Promise.all(patchesForVersion.map(resolvePatches))).flat();\n};\n\nconst fileExtensions = ['js', 'ts'];\n\n// Hack to allow our Jest environment/transform to resolve the patches\n// In normal scenarios this will resolve immediately after the .js import\nconst resolvePatches = async (version: string): Promise<Patches> => {\n for (const extension of fileExtensions) {\n try {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-member-access\n return (await import(`./patches/${version}/index.${extension}`)).patches;\n } catch {\n // Ignore\n }\n }\n throw new Error(`Could not resolve patches for ${version}`);\n};\n\nexport const upgradeSkuba = async (\n mode: 'lint' | 'format',\n logger: Logger,\n additionalFlags: string[] = [],\n): Promise<InternalLintResult> => {\n const [currentVersion, manifest, packageManager] = await Promise.all([\n getSkubaVersion(),\n getConsumerManifest(),\n detectPackageManager(),\n ]);\n\n if (!manifest) {\n throw new Error('Could not find a package json for this project');\n }\n\n manifest.packageJson.skuba ??= { version: '1.0.0' };\n\n const manifestVersion = additionalFlags.includes('--force-apply-all-patches')\n ? '1.0.0'\n : (manifest.packageJson.skuba as SkubaPackageJson).version;\n\n // We are up to date, skip patches\n if (gte(manifestVersion, currentVersion)) {\n return { ok: true, fixable: false };\n }\n\n const patches = await getPatches(manifestVersion);\n // No patches to apply even if version out of date. Early exit to avoid unnecessary commits.\n if (patches.length === 0) {\n return { ok: true, fixable: false };\n }\n\n if (mode === 'lint') {\n const results = await Promise.all(\n patches.map(\n async ({ apply }) =>\n await apply({\n mode,\n manifest,\n packageManager,\n }),\n ),\n );\n\n // No patches are applicable. Early exit to avoid unnecessary commits.\n if (results.every(({ result }) => result === 'skip')) {\n return { ok: true, fixable: false };\n }\n\n logger.warn(\n `skuba has patches to apply. Run ${logger.bold(\n `${packageManager.print.exec} skuba format`,\n )} to run them.`,\n );\n\n return {\n ok: false,\n fixable: true,\n annotations: [\n {\n // package.json as likely skuba version has changed\n // TODO: locate the \"skuba\": {} config in the package.json and annotate on the version property\n path: manifest.path,\n message: `skuba has patches to apply. Run ${packageManager.print.exec} skuba format to run them.`,\n },\n ],\n };\n }\n\n logger.plain('Updating skuba...');\n\n // Run these in series in case a subsequent patch relies on a previous patch\n for (const { apply, description } of patches) {\n const result = await apply({\n mode,\n manifest,\n packageManager,\n });\n logger.newline();\n if (result.result === 'skip') {\n logger.plain(\n `Patch skipped: ${description}${\n result.reason ? ` - ${result.reason}` : ''\n }`,\n );\n } else {\n logger.plain(`Patch applied: ${description}`);\n }\n }\n\n const updatedManifest = await getConsumerManifest();\n if (!updatedManifest) {\n throw new Error('Could not find a package json for this project');\n }\n\n (updatedManifest.packageJson.skuba as SkubaPackageJson).version =\n currentVersion;\n\n const updatedPackageJson = await formatPackage(updatedManifest.packageJson);\n\n await fs.writeFile(updatedManifest.path, updatedPackageJson);\n logger.newline();\n logger.plain('skuba update complete.');\n logger.newline();\n\n return {\n ok: true,\n fixable: false,\n };\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,sBAAe;AAEf,oBAA0B;AAG1B,sBAAoC;AACpC,4BAGO;AACP,qBAAgC;AAChC,qBAA8B;AAsB9B,MAAM,aAAa,OAAO,oBAA8C;AACtE,QAAM,UAAU,MAAM,gBAAAA,QAAG,QAAQ,YAAAC,QAAK,KAAK,WAAW,SAAS,GAAG;AAAA,IAChE,eAAe;AAAA,EACjB,CAAC;AAID,QAAM,wBAAoB;AAAA,IACxB,QAAQ;AAAA,MAAQ,CAAC;AAAA;AAAA,QAEf,MAAM,YAAY;AAAA,YAElB,mBAAI,MAAM,MAAM,eAAe,IAC3B,MAAM,OACN,CAAC;AAAA;AAAA,IACP;AAAA,EACF;AAEA,UAAQ,MAAM,QAAQ,IAAI,kBAAkB,IAAI,cAAc,CAAC,GAAG,KAAK;AACzE;AAEA,MAAM,iBAAiB,CAAC,MAAM,IAAI;AAIlC,MAAM,iBAAiB,OAAO,YAAsC;AAClE,aAAW,aAAa,gBAAgB;AACtC,QAAI;AAEF,cAAQ,MAAM,OAAO,aAAa,OAAO,UAAU,SAAS,KAAK;AAAA,IACnE,QAAQ;AAAA,IAER;AAAA,EACF;AACA,QAAM,IAAI,MAAM,iCAAiC,O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;AAEA,SAAO,MAAM,mBAAmB;AAGhC,aAAW,EAAE,OAAO,YAAY,KAAK,SAAS;AAC5C,UAAM,SAAS,MAAM,MAAM;AAAA,MACzB;AAAA,MACA;AAAA,MACA;AAAA,IACF,CAAC;AACD,WAAO,QAAQ;AACf,QAAI,OAAO,WAAW,QAAQ;AAC5B,aAAO;AAAA,QACL,kBAAkB,WAAW,GAC3B,OAAO,SAAS,MAAM,OAAO,MAAM,KAAK,EAC1C;AAAA,MACF;AAAA,IACF,OAAO;AACL,aAAO,MAAM,kBAAkB,WAAW,EAAE;AAAA,IAC9C;AAAA,EACF;AAEA,QAAM,kBAAkB,UAAM,qCAAoB;AAClD,MAAI,CAAC,iBAAiB;AACpB,UAAM,IAAI,MAAM,gDAAgD;AAAA,EAClE;AAEA,EAAC,gBAAgB,YAAY,MAA2B,UACtD;AAEF,QAAM,qBAAqB,UAAM,8BAAc,gBAAgB,WAAW;AAE1E,QAAM,gBAAAD,QAAG,UAAU,gBAAgB,MAAM,kBAAkB;AAC3D,SAAO,QAAQ;AACf,SAAO,MAAM,wBAAwB;AACrC,SAAO,QAAQ;AAEf,SAAO;AAAA,IACL,IAAI;AAAA,IACJ,SAAS;AAAA,EACX;AACF;",
|
|
6
6
|
"names": ["fs", "path"]
|
|
7
7
|
}
|
package/lib/cli/test/index.js
CHANGED
|
@@ -31,31 +31,10 @@ __export(test_exports, {
|
|
|
31
31
|
test: () => test
|
|
32
32
|
});
|
|
33
33
|
module.exports = __toCommonJS(test_exports);
|
|
34
|
-
var import_util = require("util");
|
|
35
|
-
var import_args = require("../../utils/args.js");
|
|
36
|
-
var import_env = require("../../utils/env.js");
|
|
37
34
|
var import_exec = require("../../utils/exec.js");
|
|
38
|
-
var import_logging = require("../../utils/logging.js");
|
|
39
|
-
var import_lint = require("../lint/index.js");
|
|
40
|
-
var import_upgrade = require("../lint/internalLints/upgrade/index.js");
|
|
41
35
|
const test = async () => {
|
|
42
36
|
const argv = process.argv.slice(2);
|
|
43
37
|
const nodeOptions = process.env.NODE_OPTIONS ?? "";
|
|
44
|
-
if ((0, import_env.isCiEnv)()) {
|
|
45
|
-
const logger = (0, import_logging.createLogger)({ debug: (0, import_args.hasDebugFlag)(argv) });
|
|
46
|
-
try {
|
|
47
|
-
const result = await (0, import_upgrade.upgradeSkuba)(
|
|
48
|
-
"format",
|
|
49
|
-
(0, import_logging.childLogger)(logger, { suffixes: [(0, import_util.styleText)("dim", "upgrade-skuba")] })
|
|
50
|
-
);
|
|
51
|
-
if (result.upgraded) {
|
|
52
|
-
await (0, import_lint.lint)(argv);
|
|
53
|
-
}
|
|
54
|
-
} catch (error) {
|
|
55
|
-
logger.warn("Failed to upgrade skuba before tests.");
|
|
56
|
-
logger.subtle((0, import_util.inspect)(error));
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
38
|
const execWithEnv = (0, import_exec.createExec)({
|
|
60
39
|
env: {
|
|
61
40
|
NODE_OPTIONS: !nodeOptions.includes("--experimental-vm-modules") ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning` : nodeOptions
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/test/index.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"sourcesContent": ["import { createExec } from '../../utils/exec.js';\n\nexport const test = async () => {\n const argv = process.argv.slice(2);\n\n const nodeOptions = process.env.NODE_OPTIONS ?? '';\n\n const execWithEnv = createExec({\n env: {\n NODE_OPTIONS: !nodeOptions.includes('--experimental-vm-modules')\n ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning`\n : nodeOptions,\n },\n });\n\n // Run Jest in a child process with proper environment\n return execWithEnv(require.resolve('jest/bin/jest'), ...argv);\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA2B;AAEpB,MAAM,OAAO,YAAY;AAC9B,QAAM,OAAO,QAAQ,KAAK,MAAM,CAAC;AAEjC,QAAM,cAAc,QAAQ,IAAI,gBAAgB;AAEhD,QAAM,kBAAc,wBAAW;AAAA,IAC7B,KAAK;AAAA,MACH,cAAc,CAAC,YAAY,SAAS,2BAA2B,IAC3D,GAAG,WAAW,iEACd;AAAA,IACN;AAAA,EACF,CAAC;AAGD,SAAO,YAAY,gBAAgB,eAAe,GAAG,GAAG,IAAI;AAC9D;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "14.0.0-
|
|
3
|
+
"version": "14.0.0-tsdown-package-templates-20251225102319",
|
|
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",
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
"tsx": "^4.21.0",
|
|
103
103
|
"typescript": "~5.9.0",
|
|
104
104
|
"zod": "^4.0.0",
|
|
105
|
-
"@skuba-lib/api": "^2.0.0-
|
|
106
|
-
"eslint-config-skuba": "8.0.0-
|
|
105
|
+
"@skuba-lib/api": "^2.0.0-tsdown-package-templates-20251225102319",
|
|
106
|
+
"eslint-config-skuba": "8.0.0-tsdown-package-templates-20251225102319"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"@changesets/cli": "2.29.8",
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"test:watch": "skuba test --watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"skuba-dive": "4.0.0-
|
|
22
|
+
"skuba-dive": "4.0.0-tsdown-package-templates-20251225102319"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@types/node": "^22.13.10",
|
|
26
|
-
"skuba": "14.0.0-
|
|
26
|
+
"skuba": "14.0.0-tsdown-package-templates-20251225102319"
|
|
27
27
|
},
|
|
28
28
|
"packageManager": "pnpm@10.25.0",
|
|
29
29
|
"engines": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"@aws-sdk/client-sns": "^3.363.0",
|
|
25
25
|
"@seek/aws-codedeploy-hooks": "^2.0.0",
|
|
26
26
|
"@seek/logger": "^11.1.0",
|
|
27
|
-
"skuba-dive": "4.0.0-
|
|
27
|
+
"skuba-dive": "4.0.0-tsdown-package-templates-20251225102319",
|
|
28
28
|
"zod": "^4.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"datadog-lambda-js": "^12.0.0",
|
|
43
43
|
"dd-trace": "^5.0.0",
|
|
44
44
|
"pino-pretty": "^13.0.0",
|
|
45
|
-
"skuba": "14.0.0-
|
|
45
|
+
"skuba": "14.0.0-tsdown-package-templates-20251225102319"
|
|
46
46
|
},
|
|
47
47
|
"packageManager": "pnpm@10.25.0",
|
|
48
48
|
"engines": {
|
|
@@ -14,6 +14,19 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"sideEffects": false,
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": {
|
|
20
|
+
"types": "./lib/index.d.mts",
|
|
21
|
+
"default": "./lib/index.mjs"
|
|
22
|
+
},
|
|
23
|
+
"require": {
|
|
24
|
+
"types": "./lib/index.d.cts",
|
|
25
|
+
"default": "./lib/index.cjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
17
30
|
"main": "./lib-commonjs/index.js",
|
|
18
31
|
"module": "./lib-es2015/index.js",
|
|
19
32
|
"types": "./lib-types/index.d.ts",
|
|
@@ -24,7 +37,7 @@
|
|
|
24
37
|
"lib*/**/*.json"
|
|
25
38
|
],
|
|
26
39
|
"scripts": {
|
|
27
|
-
"build": "
|
|
40
|
+
"build": "tsdown",
|
|
28
41
|
"commit": "cz",
|
|
29
42
|
"format": "skuba format",
|
|
30
43
|
"lint": "skuba lint",
|
|
@@ -42,7 +55,8 @@
|
|
|
42
55
|
"devDependencies": {
|
|
43
56
|
"@types/node": "^22.13.10",
|
|
44
57
|
"commitizen": "^4.2.4",
|
|
45
|
-
"skuba": "*"
|
|
58
|
+
"skuba": "*",
|
|
59
|
+
"tsdown": "^0.18.0"
|
|
46
60
|
},
|
|
47
61
|
"packageManager": "pnpm@10.7.0",
|
|
48
62
|
"engines": {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from 'tsdown/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['src/index.ts'],
|
|
5
|
+
format: ['esm', 'cjs'],
|
|
6
|
+
exports: true,
|
|
7
|
+
outDir: 'lib',
|
|
8
|
+
dts: {
|
|
9
|
+
// Bundles type declarations for the specified packages
|
|
10
|
+
resolve: ['sury'],
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -14,6 +14,19 @@
|
|
|
14
14
|
},
|
|
15
15
|
"license": "UNLICENSED",
|
|
16
16
|
"sideEffects": false,
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"import": {
|
|
20
|
+
"types": "./lib/index.d.mts",
|
|
21
|
+
"default": "./lib/index.mjs"
|
|
22
|
+
},
|
|
23
|
+
"require": {
|
|
24
|
+
"types": "./lib/index.d.cts",
|
|
25
|
+
"default": "./lib/index.cjs"
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
17
30
|
"main": "./lib-commonjs/index.js",
|
|
18
31
|
"module": "./lib-es2015/index.js",
|
|
19
32
|
"types": "./lib-types/index.d.ts",
|
|
@@ -24,7 +37,7 @@
|
|
|
24
37
|
"lib*/**/*.json"
|
|
25
38
|
],
|
|
26
39
|
"scripts": {
|
|
27
|
-
"build": "
|
|
40
|
+
"build": "tsdown",
|
|
28
41
|
"commit": "cz",
|
|
29
42
|
"format": "skuba format",
|
|
30
43
|
"lint": "skuba lint",
|
|
@@ -42,7 +55,8 @@
|
|
|
42
55
|
"devDependencies": {
|
|
43
56
|
"@types/node": "^22.13.10",
|
|
44
57
|
"commitizen": "^4.2.4",
|
|
45
|
-
"skuba": "*"
|
|
58
|
+
"skuba": "*",
|
|
59
|
+
"tsdown": "^0.18.0"
|
|
46
60
|
},
|
|
47
61
|
"packageManager": "pnpm@10.7.0",
|
|
48
62
|
"engines": {
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { defineConfig } from 'tsdown/config';
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ['src/index.ts'],
|
|
5
|
+
format: ['esm', 'cjs'],
|
|
6
|
+
exports: true,
|
|
7
|
+
outDir: 'lib',
|
|
8
|
+
dts: {
|
|
9
|
+
// Bundles type declarations for the specified packages
|
|
10
|
+
resolve: ['sury'],
|
|
11
|
+
},
|
|
12
|
+
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const buildPackage: (args?: string[]) => Promise<void>;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var buildPackage_exports = {};
|
|
20
|
-
__export(buildPackage_exports, {
|
|
21
|
-
buildPackage: () => buildPackage
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(buildPackage_exports);
|
|
24
|
-
var import_args = require("../../utils/args.js");
|
|
25
|
-
var import_exec = require("../../utils/exec.js");
|
|
26
|
-
var import_assets = require("../build/assets.js");
|
|
27
|
-
const buildPackage = async (args = process.argv.slice(2)) => {
|
|
28
|
-
await (0, import_exec.execConcurrently)(
|
|
29
|
-
[
|
|
30
|
-
{
|
|
31
|
-
command: "tsc --module CommonJS --outDir lib-commonjs --project tsconfig.build.json --moduleResolution node",
|
|
32
|
-
name: "commonjs",
|
|
33
|
-
prefixColor: "green"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
command: "tsc --module ES2015 --outDir lib-es2015 --project tsconfig.build.json --moduleResolution node",
|
|
37
|
-
name: "es2015",
|
|
38
|
-
prefixColor: "yellow"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
command: "tsc --allowJS false --declaration --emitDeclarationOnly --outDir lib-types --project tsconfig.build.json",
|
|
42
|
-
name: "types",
|
|
43
|
-
prefixColor: "blue"
|
|
44
|
-
}
|
|
45
|
-
],
|
|
46
|
-
{
|
|
47
|
-
maxProcesses: (0, import_args.hasSerialFlag)(args) ? 1 : void 0
|
|
48
|
-
}
|
|
49
|
-
);
|
|
50
|
-
await (0, import_assets.copyAssetsConcurrently)([
|
|
51
|
-
{
|
|
52
|
-
outDir: "lib-commonjs",
|
|
53
|
-
name: "commonjs",
|
|
54
|
-
prefixColor: "green"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
outDir: "lib-es2015",
|
|
58
|
-
name: "es2015",
|
|
59
|
-
prefixColor: "yellow"
|
|
60
|
-
}
|
|
61
|
-
]);
|
|
62
|
-
};
|
|
63
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
64
|
-
0 && (module.exports = {
|
|
65
|
-
buildPackage
|
|
66
|
-
});
|
|
67
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/cli/buildPackage/index.ts"],
|
|
4
|
-
"sourcesContent": ["import { hasSerialFlag } from '../../utils/args.js';\nimport { execConcurrently } from '../../utils/exec.js';\nimport { copyAssetsConcurrently } from '../build/assets.js';\n\nexport const buildPackage = async (args = process.argv.slice(2)) => {\n await execConcurrently(\n [\n {\n command:\n 'tsc --module CommonJS --outDir lib-commonjs --project tsconfig.build.json --moduleResolution node',\n name: 'commonjs',\n prefixColor: 'green',\n },\n {\n command:\n 'tsc --module ES2015 --outDir lib-es2015 --project tsconfig.build.json --moduleResolution node',\n name: 'es2015',\n prefixColor: 'yellow',\n },\n {\n command:\n 'tsc --allowJS false --declaration --emitDeclarationOnly --outDir lib-types --project tsconfig.build.json',\n name: 'types',\n prefixColor: 'blue',\n },\n ],\n {\n maxProcesses: hasSerialFlag(args) ? 1 : undefined,\n },\n );\n\n await copyAssetsConcurrently([\n {\n outDir: 'lib-commonjs',\n name: 'commonjs',\n prefixColor: 'green',\n },\n {\n outDir: 'lib-es2015',\n name: 'es2015',\n prefixColor: 'yellow',\n },\n ]);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAA8B;AAC9B,kBAAiC;AACjC,oBAAuC;AAEhC,MAAM,eAAe,OAAO,OAAO,QAAQ,KAAK,MAAM,CAAC,MAAM;AAClE,YAAM;AAAA,IACJ;AAAA,MACE;AAAA,QACE,SACE;AAAA,QACF,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,MACA;AAAA,QACE,SACE;AAAA,QACF,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,MACA;AAAA,QACE,SACE;AAAA,QACF,MAAM;AAAA,QACN,aAAa;AAAA,MACf;AAAA,IACF;AAAA,IACA;AAAA,MACE,kBAAc,2BAAc,IAAI,IAAI,IAAI;AAAA,IAC1C;AAAA,EACF;AAEA,YAAM,sCAAuB;AAAA,IAC3B;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,IACA;AAAA,MACE,QAAQ;AAAA,MACR,MAAM;AAAA,MACN,aAAa;AAAA,IACf;AAAA,EACF,CAAC;AACH;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|