skuba 13.0.0-custom-conditions-exports-20250730060544 → 13.0.0-custom-conditions-exports-20250923003120
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/README.md +1 -2
- package/config/tsconfig.json +2 -1
- package/jest/moduleNameMapper.js +3 -0
- package/lib/cli/build/assets.js +1 -1
- package/lib/cli/build/assets.js.map +2 -2
- 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 +9 -2
- package/lib/cli/build/tsc.js +76 -40
- package/lib/cli/build/tsc.js.map +3 -3
- package/lib/cli/configure/analyseDependencies.d.ts +2 -2
- package/lib/cli/configure/analyseDependencies.js.map +1 -1
- package/lib/cli/configure/analysis/package.d.ts +1 -1
- package/lib/cli/configure/analysis/package.js +1 -1
- package/lib/cli/configure/analysis/package.js.map +2 -2
- package/lib/cli/configure/ensureTemplateCompletion.d.ts +2 -2
- package/lib/cli/configure/ensureTemplateCompletion.js.map +1 -1
- package/lib/cli/configure/getEntryPoint.d.ts +2 -2
- package/lib/cli/configure/getEntryPoint.js.map +1 -1
- package/lib/cli/configure/getProjectType.d.ts +2 -2
- package/lib/cli/configure/getProjectType.js.map +1 -1
- package/lib/cli/configure/processing/package.js +8 -2
- package/lib/cli/configure/processing/package.js.map +2 -2
- package/lib/cli/init/getConfig.js +1 -1
- package/lib/cli/init/getConfig.js.map +2 -2
- package/lib/cli/lint/internal.js +1 -1
- package/lib/cli/lint/internal.js.map +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js +2 -2
- package/lib/cli/lint/internalLints/patchRenovateConfig.js.map +1 -1
- package/lib/cli/lint/internalLints/upgrade/index.d.ts +2 -2
- package/lib/cli/lint/internalLints/upgrade/index.js +7 -3
- package/lib/cli/lint/internalLints/upgrade/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/index.js.map +2 -2
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.d.ts +4 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js +162 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.2/unhandledRejections.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js +35 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.d.ts +3 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js +105 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.1.1/patchJestSnapshots.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/configureTsConfigForESM.d.ts +23 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/configureTsConfigForESM.js +321 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/configureTsConfigForESM.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/index.d.ts +2 -0
- package/lib/cli/lint/internalLints/upgrade/patches/{12.0.1 → 12.2.0}/index.js +5 -0
- package/lib/cli/lint/internalLints/upgrade/patches/12.2.0/index.js.map +7 -0
- package/lib/cli/lint/internalLints/upgrade/patches/{12.0.2 → 12.2.0}/rewriteSrcImports.js +7 -4
- package/lib/cli/lint/internalLints/upgrade/patches/{12.0.2 → 12.2.0}/rewriteSrcImports.js.map +3 -3
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/8.2.1/upgradeESLint.js.map +2 -2
- package/lib/cli/node/index.js +6 -0
- package/lib/cli/node/index.js.map +2 -2
- package/lib/cli/start/index.js +6 -0
- package/lib/cli/start/index.js.map +2 -2
- package/lib/cli/test/index.d.ts +1 -1
- package/lib/cli/test/index.js +18 -4
- package/lib/cli/test/index.js.map +2 -2
- package/lib/utils/args.d.ts +2 -0
- package/lib/utils/args.js +5 -0
- package/lib/utils/args.js.map +2 -2
- package/lib/utils/manifest.d.ts +1 -1
- package/lib/utils/manifest.js +1 -1
- package/lib/utils/manifest.js.map +2 -2
- package/lib/utils/template.d.ts +1 -1
- package/package.json +17 -20
- package/template/base/_.prettierrc.js +1 -1
- package/template/base/_eslint.config.js +1 -1
- package/template/base/_pnpm-workspace.yaml +1 -0
- package/template/base/jest.setup.ts +1 -1
- package/template/base/tsconfig.build.json +3 -0
- package/template/base/tsconfig.json +0 -1
- package/template/express-rest-api/.buildkite/pipeline.yml +6 -0
- package/template/express-rest-api/.env +1 -1
- package/template/express-rest-api/.gantry/dev.yml +5 -1
- package/template/express-rest-api/.gantry/prod.yml +5 -1
- package/template/express-rest-api/Dockerfile +1 -1
- package/template/express-rest-api/Dockerfile.dev-deps +1 -1
- package/template/express-rest-api/README.md +5 -5
- package/template/express-rest-api/gantry.apply.yml +17 -1
- package/template/express-rest-api/package.json +11 -5
- package/template/express-rest-api/src/api/healthCheck.ts +2 -2
- package/template/express-rest-api/src/config.ts +7 -7
- package/template/express-rest-api/src/framework/logging.ts +11 -7
- package/template/express-rest-api/src/framework/metrics.ts +1 -1
- package/template/express-rest-api/src/listen.ts +6 -0
- package/template/express-rest-api/src/tracing.ts +56 -0
- package/template/greeter/Dockerfile +1 -1
- package/template/greeter/README.md +2 -2
- package/template/greeter/package.json +2 -2
- package/template/koa-rest-api/.buildkite/pipeline.yml +6 -0
- package/template/koa-rest-api/.env +1 -1
- package/template/koa-rest-api/.gantry/dev.yml +3 -3
- package/template/koa-rest-api/.gantry/prod.yml +3 -3
- package/template/koa-rest-api/Dockerfile.dev-deps +1 -1
- package/template/koa-rest-api/README.md +6 -6
- package/template/koa-rest-api/gantry.apply.yml +15 -3
- package/template/koa-rest-api/package.json +10 -11
- package/template/koa-rest-api/skuba.template.js +1 -1
- package/template/koa-rest-api/src/api/healthCheck.ts +2 -2
- package/template/koa-rest-api/src/config.ts +7 -7
- package/template/koa-rest-api/src/framework/logging.ts +12 -8
- package/template/koa-rest-api/src/framework/metrics.ts +1 -1
- package/template/koa-rest-api/src/framework/server.test.ts +7 -8
- package/template/koa-rest-api/src/framework/server.ts +1 -4
- package/template/koa-rest-api/src/listen.ts +6 -0
- package/template/lambda-sqs-worker-cdk/.buildkite/pipeline.yml +6 -2
- package/template/lambda-sqs-worker-cdk/.env +1 -1
- package/template/lambda-sqs-worker-cdk/Dockerfile +1 -1
- package/template/lambda-sqs-worker-cdk/README.md +8 -8
- package/template/lambda-sqs-worker-cdk/infra/__snapshots__/appStack.test.ts.snap +54 -26
- package/template/lambda-sqs-worker-cdk/infra/appStack.test.ts +5 -22
- package/template/lambda-sqs-worker-cdk/infra/appStack.ts +16 -9
- package/template/lambda-sqs-worker-cdk/infra/config.ts +34 -20
- package/template/lambda-sqs-worker-cdk/infra/index.ts +1 -1
- package/template/lambda-sqs-worker-cdk/package.json +7 -9
- package/template/lambda-sqs-worker-cdk/src/app.test.ts +91 -51
- package/template/lambda-sqs-worker-cdk/src/app.ts +10 -9
- package/template/lambda-sqs-worker-cdk/src/config.ts +11 -16
- package/template/lambda-sqs-worker-cdk/src/framework/handler.test.ts +10 -5
- package/template/lambda-sqs-worker-cdk/src/framework/handler.ts +48 -24
- package/template/lambda-sqs-worker-cdk/src/framework/logging.ts +23 -11
- package/template/lambda-sqs-worker-cdk/src/framework/metrics.ts +1 -4
- package/template/lambda-sqs-worker-cdk/src/testing/handler.ts +4 -1
- package/template/lambda-sqs-worker-cdk/tsconfig.json +1 -2
- package/template/oss-npm-package/.github/workflows/release.yml +5 -6
- package/template/oss-npm-package/.github/workflows/validate.yml +5 -5
- package/template/oss-npm-package/_package.json +0 -3
- package/template/oss-npm-package/skuba.template.js +1 -1
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.1/configureTsConfigForESM.d.ts +0 -6
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.1/configureTsConfigForESM.js +0 -249
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.1/configureTsConfigForESM.js.map +0 -7
- package/lib/cli/lint/internalLints/upgrade/patches/12.0.1/index.js.map +0 -7
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.0.1 → 12.1.1}/index.d.ts +0 -0
- /package/lib/cli/lint/internalLints/upgrade/patches/{12.0.2 → 12.2.0}/rewriteSrcImports.d.ts +0 -0
package/lib/cli/node/index.js
CHANGED
|
@@ -38,12 +38,18 @@ var import_get_port = __toESM(require("get-port"));
|
|
|
38
38
|
var import_args = require("../../utils/args.js");
|
|
39
39
|
var import_exec = require("../../utils/exec.js");
|
|
40
40
|
var import_validation = require("../../utils/validation.js");
|
|
41
|
+
var import_tsc = require("../build/tsc.js");
|
|
41
42
|
const longRunning = true;
|
|
42
43
|
const node = async () => {
|
|
43
44
|
const args = (0, import_args.parseRunArgs)(process.argv.slice(2));
|
|
45
|
+
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
46
|
+
const uniqueConditions = [
|
|
47
|
+
.../* @__PURE__ */ new Set([...args.conditions ?? [], ...customConditions])
|
|
48
|
+
];
|
|
44
49
|
const availablePort = await (0, import_get_port.default)();
|
|
45
50
|
const commonArgs = [
|
|
46
51
|
...args.node,
|
|
52
|
+
...uniqueConditions.map((condition) => `--conditions=${condition}`),
|
|
47
53
|
"--env-file-if-exists",
|
|
48
54
|
".env",
|
|
49
55
|
"--require",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/node/index.ts"],
|
|
4
|
-
"sourcesContent": ["import path from 'path';\n\nimport execa from 'execa';\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { isIpPort } from '../../utils/validation.js';\n\nexport const longRunning = true;\n\nexport const node = async () => {\n const args = parseRunArgs(process.argv.slice(2));\n\n const availablePort = await getPort();\n\n const commonArgs = [\n ...args.node,\n '--env-file-if-exists',\n '.env',\n '--require',\n require.resolve('tsconfig-paths/register'),\n ];\n\n if (args.entryPoint) {\n const exec = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return exec(\n 'tsx',\n ...commonArgs,\n path.join(__dirname, '..', '..', 'wrapper', 'index.js'),\n ...args.script,\n );\n }\n\n return execa(\n require.resolve('tsx/cli'),\n [\n ...commonArgs,\n '--require',\n // Unsure if bug or feature that this is needed, but tsx appears to not do anything typescript in the REPL without this!\n // Doesn't occur when just running the tsx binary directly \uD83E\uDDD0\n require.resolve('tsx/patch-repl'),\n ],\n {\n stdio: 'inherit',\n },\n );\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAClB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,wBAAyB;
|
|
4
|
+
"sourcesContent": ["import path from 'path';\n\nimport execa from 'execa';\nimport getPort from 'get-port';\n\nimport { parseRunArgs } from '../../utils/args.js';\nimport { createExec } from '../../utils/exec.js';\nimport { isIpPort } from '../../utils/validation.js';\nimport { getCustomConditions } from '../build/tsc.js';\n\nexport const longRunning = true;\n\nexport const node = async () => {\n const args = parseRunArgs(process.argv.slice(2));\n const customConditions = getCustomConditions();\n\n const uniqueConditions = [\n ...new Set([...(args.conditions ?? []), ...customConditions]),\n ];\n\n const availablePort = await getPort();\n\n const commonArgs = [\n ...args.node,\n ...uniqueConditions.map((condition) => `--conditions=${condition}`),\n '--env-file-if-exists',\n '.env',\n '--require',\n require.resolve('tsconfig-paths/register'),\n ];\n\n if (args.entryPoint) {\n const exec = createExec({\n env: {\n __SKUBA_ENTRY_POINT: args.entryPoint,\n __SKUBA_PORT: String(isIpPort(args.port) ? args.port : availablePort),\n },\n });\n\n return exec(\n 'tsx',\n ...commonArgs,\n path.join(__dirname, '..', '..', 'wrapper', 'index.js'),\n ...args.script,\n );\n }\n\n return execa(\n require.resolve('tsx/cli'),\n [\n ...commonArgs,\n '--require',\n // Unsure if bug or feature that this is needed, but tsx appears to not do anything typescript in the REPL without this!\n // Doesn't occur when just running the tsx binary directly \uD83E\uDDD0\n require.resolve('tsx/patch-repl'),\n ],\n {\n stdio: 'inherit',\n },\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kBAAiB;AAEjB,mBAAkB;AAClB,sBAAoB;AAEpB,kBAA6B;AAC7B,kBAA2B;AAC3B,wBAAyB;AACzB,iBAAoC;AAE7B,MAAM,cAAc;AAEpB,MAAM,OAAO,YAAY;AAC9B,QAAM,WAAO,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAC/C,QAAM,uBAAmB,gCAAoB;AAE7C,QAAM,mBAAmB;AAAA,IACvB,GAAG,oBAAI,IAAI,CAAC,GAAI,KAAK,cAAc,CAAC,GAAI,GAAG,gBAAgB,CAAC;AAAA,EAC9D;AAEA,QAAM,gBAAgB,UAAM,gBAAAA,SAAQ;AAEpC,QAAM,aAAa;AAAA,IACjB,GAAG,KAAK;AAAA,IACR,GAAG,iBAAiB,IAAI,CAAC,cAAc,gBAAgB,SAAS,EAAE;AAAA,IAClE;AAAA,IACA;AAAA,IACA;AAAA,IACA,gBAAgB,yBAAyB;AAAA,EAC3C;AAEA,MAAI,KAAK,YAAY;AACnB,UAAM,WAAO,wBAAW;AAAA,MACtB,KAAK;AAAA,QACH,qBAAqB,KAAK;AAAA,QAC1B,cAAc,WAAO,4BAAS,KAAK,IAAI,IAAI,KAAK,OAAO,aAAa;AAAA,MACtE;AAAA,IACF,CAAC;AAED,WAAO;AAAA,MACL;AAAA,MACA,GAAG;AAAA,MACH,YAAAC,QAAK,KAAK,WAAW,MAAM,MAAM,WAAW,UAAU;AAAA,MACtD,GAAG,KAAK;AAAA,IACV;AAAA,EACF;AAEA,aAAO,aAAAC;AAAA,IACL,gBAAgB,SAAS;AAAA,IACzB;AAAA,MACE,GAAG;AAAA,MACH;AAAA;AAAA;AAAA,MAGA,gBAAgB,gBAAgB;AAAA,IAClC;AAAA,IACA;AAAA,MACE,OAAO;AAAA,IACT;AAAA,EACF;AACF;",
|
|
6
6
|
"names": ["getPort", "path", "execa"]
|
|
7
7
|
}
|
package/lib/cli/start/index.js
CHANGED
|
@@ -37,11 +37,16 @@ var import_args = require("../../utils/args.js");
|
|
|
37
37
|
var import_exec = require("../../utils/exec.js");
|
|
38
38
|
var import_manifest = require("../../utils/manifest.js");
|
|
39
39
|
var import_validation = require("../../utils/validation.js");
|
|
40
|
+
var import_tsc = require("../build/tsc.js");
|
|
40
41
|
const start = async () => {
|
|
42
|
+
const customConditions = (0, import_tsc.getCustomConditions)();
|
|
41
43
|
const [args, availablePort] = await Promise.all([
|
|
42
44
|
(0, import_args.parseRunArgs)(process.argv.slice(2)),
|
|
43
45
|
(0, import_get_port.default)()
|
|
44
46
|
]);
|
|
47
|
+
const uniqueConditions = [
|
|
48
|
+
.../* @__PURE__ */ new Set([...args.conditions ?? [], ...customConditions])
|
|
49
|
+
];
|
|
45
50
|
args.entryPoint ??= await (0, import_manifest.getEntryPointFromManifest)();
|
|
46
51
|
const execProcess = (0, import_exec.createExec)({
|
|
47
52
|
env: {
|
|
@@ -54,6 +59,7 @@ const start = async () => {
|
|
|
54
59
|
"watch",
|
|
55
60
|
"--clear-screen=false",
|
|
56
61
|
...args.node,
|
|
62
|
+
...uniqueConditions.map((condition) => `--conditions=${condition}`),
|
|
57
63
|
"--env-file-if-exists",
|
|
58
64
|
".env",
|
|
59
65
|
"--require",
|
|
@@ -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';\n\nexport const start = async () => {\n const [args, availablePort] = await Promise.all([\n parseRunArgs(process.argv.slice(2)),\n getPort(),\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 '--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;
|
|
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, availablePort] = await Promise.all([\n parseRunArgs(process.argv.slice(2)),\n getPort(),\n ]);\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,CAAC,MAAM,aAAa,IAAI,MAAM,QAAQ,IAAI;AAAA,QAC9C,0BAAa,QAAQ,KAAK,MAAM,CAAC,CAAC;AAAA,QAClC,gBAAAA,SAAQ;AAAA,EACV,CAAC;AAED,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/lib/cli/test/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const test: () => Promise<
|
|
1
|
+
export declare const test: () => Promise<import("execa").ExecaReturnValue<string>>;
|
package/lib/cli/test/index.js
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,18 +17,30 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
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
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
var test_exports = {};
|
|
20
30
|
__export(test_exports, {
|
|
21
31
|
test: () => test
|
|
22
32
|
});
|
|
23
33
|
module.exports = __toCommonJS(test_exports);
|
|
24
|
-
var
|
|
34
|
+
var import_exec = require("../../utils/exec.js");
|
|
25
35
|
const test = async () => {
|
|
26
|
-
process.env.NODE_ENV ??= "test";
|
|
27
|
-
process.env.TS_JEST_LOG ??= "stdout:error";
|
|
28
36
|
const argv = process.argv.slice(2);
|
|
29
|
-
|
|
37
|
+
const nodeOptions = process.env.NODE_OPTIONS ?? "";
|
|
38
|
+
const execWithEnv = (0, import_exec.createExec)({
|
|
39
|
+
env: {
|
|
40
|
+
NODE_OPTIONS: !nodeOptions.includes("--experimental-vm-modules") ? `${nodeOptions} --experimental-vm-modules --no-warnings=ExperimentalWarning` : nodeOptions
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
return execWithEnv(require.resolve("jest/bin/jest"), ...argv);
|
|
30
44
|
};
|
|
31
45
|
// Annotate the CommonJS export names for ESM import in node:
|
|
32
46
|
0 && (module.exports = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/cli/test/index.ts"],
|
|
4
|
-
"sourcesContent": ["import {
|
|
5
|
-
"mappings": "
|
|
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/lib/utils/args.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export declare const parseProcessArgs: (args?: string[]) => {
|
|
|
18
18
|
args: string[];
|
|
19
19
|
};
|
|
20
20
|
interface RunArgs {
|
|
21
|
+
/** The conditions to pass to the entry point script. */
|
|
22
|
+
conditions?: string[];
|
|
21
23
|
/** The path to the entry point script. */
|
|
22
24
|
entryPoint?: string;
|
|
23
25
|
/** The port to start an HTTP server on. */
|
package/lib/utils/args.js
CHANGED
|
@@ -100,6 +100,11 @@ const parseRunArgsIteration = (state, args) => {
|
|
|
100
100
|
}
|
|
101
101
|
return args.slice(1);
|
|
102
102
|
}
|
|
103
|
+
if (arg1.startsWith("--conditions=")) {
|
|
104
|
+
state.conditions ??= [];
|
|
105
|
+
state.conditions.push(arg1.slice(13));
|
|
106
|
+
return args.slice(1);
|
|
107
|
+
}
|
|
103
108
|
state.entryPoint = arg1;
|
|
104
109
|
state.script.push(...args.slice(1));
|
|
105
110
|
return [];
|
package/lib/utils/args.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/args.ts"],
|
|
4
|
-
"sourcesContent": ["import assert from 'assert';\n\nimport { COMMAND_ALIASES } from './command.js';\n\nexport const hasDebugFlag = (args = process.argv) =>\n args.some((arg) => arg.toLocaleLowerCase() === '--debug');\n\nexport const hasSerialFlag = (args = process.argv, env = process.env) =>\n args.some((arg) => arg.toLocaleLowerCase() === '--serial') ||\n Boolean(\n // Run serially on SEEK's central npm publishing pipeline.\n // Exhausting agents here can cause grief.\n env.BUILDKITE_AGENT_META_DATA_QUEUE?.split(',').some((queueName) =>\n queueName.startsWith('artefacts:npm'),\n ),\n );\n\n/**\n * Parse process arguments.\n *\n * This function mutates the input list by removing the command name element.\n * Downstream commands can access their args with an ordinary\n * `process.argv.slice(2)`.\n *\n * Example input:\n *\n * ```typescript\n * ['/bin/node', 'node_modules/.bin/skuba', 'test', '--foo', '--bar']\n * ```\n */\nexport const parseProcessArgs = (args = process.argv) => {\n const skubaIdx = args.findIndex((chunk) => /skuba(\\.[jt]s)?$/.test(chunk));\n\n assert(skubaIdx >= 0, 'Cannot parse args for `skuba`');\n\n const rawCommand = (args[skubaIdx + 1] ?? 'help').toLocaleLowerCase();\n\n const commandName = COMMAND_ALIASES[rawCommand] ?? rawCommand;\n\n const payload = {\n commandName,\n args: args.slice(skubaIdx + 2),\n };\n\n args.splice(skubaIdx + 1, 1);\n\n return payload;\n};\n\ninterface RunArgs {\n /** The path to the entry point script. */\n entryPoint?: string;\n\n /** The port to start an HTTP server on. */\n port?: number;\n\n /** Arguments passed through to the Node.js executable. */\n node: string[];\n\n /** Arguments passed through to the entry point script. */\n script: string[];\n}\n\n/**\n * Make a best effort to parse \"run\" args.\n *\n * These are arguments that would be passed to `skuba node` or `skuba start`.\n * Parsing is handrolled because we support some weird and wonderful behaviour:\n *\n * - The `--port` option may be intended for skuba itself\n * - The `--inspect` options may be intended for the Node.js inspector\n * - The entry point may be omitted in favour of `package.json` inference\n * - Other args may be intended for propagation to the entry point\n */\nexport const parseRunArgs = (argv: string[]): RunArgs => {\n const state: RunArgs = {\n node: [],\n script: [],\n };\n\n let args = argv.filter((element) => element.length);\n\n while (args.length) {\n args = parseRunArgsIteration(state, args);\n }\n\n return state;\n};\n\nconst isDigits = (arg: unknown): arg is string =>\n typeof arg === 'string' && /^\\d+$/.test(arg);\n\nconst parseRunArgsIteration = (state: RunArgs, args: string[]): string[] => {\n const [arg1, arg2] = args;\n\n if (!arg1) {\n return [];\n }\n\n if (/^--inspect(-brk)?=\\d+$/.test(arg1)) {\n state.node.push(arg1);\n return args.slice(1);\n }\n\n // Node.js inspector options that are optionally followed by a numeric port.\n if (['--inspect', '--inspect-brk'].includes(arg1)) {\n if (isDigits(arg2)) {\n state.node.push(`${arg1}=${arg2}`);\n return args.slice(2);\n }\n\n state.node.push(arg1);\n\n if (arg2) {\n // Some other string that doesn't relate to the Node.js inspector option.\n // This is presumably the entry point script to run.\n state.entryPoint = arg2;\n state.script.push(...args.slice(2));\n }\n\n return [];\n }\n\n if (/^--port=\\d+$/.test(arg1)) {\n state.port = Number(arg1.slice(7));\n return args.slice(1);\n }\n\n if (arg1 === '--port') {\n if (isDigits(arg2)) {\n state.port = Number(arg2);\n return args.slice(2);\n }\n\n // Invalid port argument; eat it.\n return args.slice(1);\n }\n\n state.entryPoint = arg1;\n state.script.push(...args.slice(1));\n return [];\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AAEnB,qBAAgC;AAEzB,MAAM,eAAe,CAAC,OAAO,QAAQ,SAC1C,KAAK,KAAK,CAAC,QAAQ,IAAI,kBAAkB,MAAM,SAAS;AAEnD,MAAM,gBAAgB,CAAC,OAAO,QAAQ,MAAM,MAAM,QAAQ,QAC/D,KAAK,KAAK,CAAC,QAAQ,IAAI,kBAAkB,MAAM,UAAU,KACzD;AAAA;AAAA;AAAA,EAGE,IAAI,iCAAiC,MAAM,GAAG,EAAE;AAAA,IAAK,CAAC,cACpD,UAAU,WAAW,eAAe;AAAA,EACtC;AACF;AAeK,MAAM,mBAAmB,CAAC,OAAO,QAAQ,SAAS;AACvD,QAAM,WAAW,KAAK,UAAU,CAAC,UAAU,mBAAmB,KAAK,KAAK,CAAC;AAEzE,oBAAAA,SAAO,YAAY,GAAG,+BAA+B;AAErD,QAAM,cAAc,KAAK,WAAW,CAAC,KAAK,QAAQ,kBAAkB;AAEpE,QAAM,cAAc,+BAAgB,UAAU,KAAK;AAEnD,QAAM,UAAU;AAAA,IACd;AAAA,IACA,MAAM,KAAK,MAAM,WAAW,CAAC;AAAA,EAC/B;AAEA,OAAK,OAAO,WAAW,GAAG,CAAC;AAE3B,SAAO;AACT;
|
|
4
|
+
"sourcesContent": ["import assert from 'assert';\n\nimport { COMMAND_ALIASES } from './command.js';\n\nexport const hasDebugFlag = (args = process.argv) =>\n args.some((arg) => arg.toLocaleLowerCase() === '--debug');\n\nexport const hasSerialFlag = (args = process.argv, env = process.env) =>\n args.some((arg) => arg.toLocaleLowerCase() === '--serial') ||\n Boolean(\n // Run serially on SEEK's central npm publishing pipeline.\n // Exhausting agents here can cause grief.\n env.BUILDKITE_AGENT_META_DATA_QUEUE?.split(',').some((queueName) =>\n queueName.startsWith('artefacts:npm'),\n ),\n );\n\n/**\n * Parse process arguments.\n *\n * This function mutates the input list by removing the command name element.\n * Downstream commands can access their args with an ordinary\n * `process.argv.slice(2)`.\n *\n * Example input:\n *\n * ```typescript\n * ['/bin/node', 'node_modules/.bin/skuba', 'test', '--foo', '--bar']\n * ```\n */\nexport const parseProcessArgs = (args = process.argv) => {\n const skubaIdx = args.findIndex((chunk) => /skuba(\\.[jt]s)?$/.test(chunk));\n\n assert(skubaIdx >= 0, 'Cannot parse args for `skuba`');\n\n const rawCommand = (args[skubaIdx + 1] ?? 'help').toLocaleLowerCase();\n\n const commandName = COMMAND_ALIASES[rawCommand] ?? rawCommand;\n\n const payload = {\n commandName,\n args: args.slice(skubaIdx + 2),\n };\n\n args.splice(skubaIdx + 1, 1);\n\n return payload;\n};\n\ninterface RunArgs {\n /** The conditions to pass to the entry point script. */\n conditions?: string[];\n\n /** The path to the entry point script. */\n entryPoint?: string;\n\n /** The port to start an HTTP server on. */\n port?: number;\n\n /** Arguments passed through to the Node.js executable. */\n node: string[];\n\n /** Arguments passed through to the entry point script. */\n script: string[];\n}\n\n/**\n * Make a best effort to parse \"run\" args.\n *\n * These are arguments that would be passed to `skuba node` or `skuba start`.\n * Parsing is handrolled because we support some weird and wonderful behaviour:\n *\n * - The `--port` option may be intended for skuba itself\n * - The `--inspect` options may be intended for the Node.js inspector\n * - The entry point may be omitted in favour of `package.json` inference\n * - Other args may be intended for propagation to the entry point\n */\nexport const parseRunArgs = (argv: string[]): RunArgs => {\n const state: RunArgs = {\n node: [],\n script: [],\n };\n\n let args = argv.filter((element) => element.length);\n\n while (args.length) {\n args = parseRunArgsIteration(state, args);\n }\n\n return state;\n};\n\nconst isDigits = (arg: unknown): arg is string =>\n typeof arg === 'string' && /^\\d+$/.test(arg);\n\nconst parseRunArgsIteration = (state: RunArgs, args: string[]): string[] => {\n const [arg1, arg2] = args;\n\n if (!arg1) {\n return [];\n }\n\n if (/^--inspect(-brk)?=\\d+$/.test(arg1)) {\n state.node.push(arg1);\n return args.slice(1);\n }\n\n // Node.js inspector options that are optionally followed by a numeric port.\n if (['--inspect', '--inspect-brk'].includes(arg1)) {\n if (isDigits(arg2)) {\n state.node.push(`${arg1}=${arg2}`);\n return args.slice(2);\n }\n\n state.node.push(arg1);\n\n if (arg2) {\n // Some other string that doesn't relate to the Node.js inspector option.\n // This is presumably the entry point script to run.\n state.entryPoint = arg2;\n state.script.push(...args.slice(2));\n }\n\n return [];\n }\n\n if (/^--port=\\d+$/.test(arg1)) {\n state.port = Number(arg1.slice(7));\n return args.slice(1);\n }\n\n if (arg1 === '--port') {\n if (isDigits(arg2)) {\n state.port = Number(arg2);\n return args.slice(2);\n }\n\n // Invalid port argument; eat it.\n return args.slice(1);\n }\n\n if (arg1.startsWith('--conditions=')) {\n state.conditions ??= [];\n state.conditions.push(arg1.slice(13));\n return args.slice(1);\n }\n\n state.entryPoint = arg1;\n state.script.push(...args.slice(1));\n return [];\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAmB;AAEnB,qBAAgC;AAEzB,MAAM,eAAe,CAAC,OAAO,QAAQ,SAC1C,KAAK,KAAK,CAAC,QAAQ,IAAI,kBAAkB,MAAM,SAAS;AAEnD,MAAM,gBAAgB,CAAC,OAAO,QAAQ,MAAM,MAAM,QAAQ,QAC/D,KAAK,KAAK,CAAC,QAAQ,IAAI,kBAAkB,MAAM,UAAU,KACzD;AAAA;AAAA;AAAA,EAGE,IAAI,iCAAiC,MAAM,GAAG,EAAE;AAAA,IAAK,CAAC,cACpD,UAAU,WAAW,eAAe;AAAA,EACtC;AACF;AAeK,MAAM,mBAAmB,CAAC,OAAO,QAAQ,SAAS;AACvD,QAAM,WAAW,KAAK,UAAU,CAAC,UAAU,mBAAmB,KAAK,KAAK,CAAC;AAEzE,oBAAAA,SAAO,YAAY,GAAG,+BAA+B;AAErD,QAAM,cAAc,KAAK,WAAW,CAAC,KAAK,QAAQ,kBAAkB;AAEpE,QAAM,cAAc,+BAAgB,UAAU,KAAK;AAEnD,QAAM,UAAU;AAAA,IACd;AAAA,IACA,MAAM,KAAK,MAAM,WAAW,CAAC;AAAA,EAC/B;AAEA,OAAK,OAAO,WAAW,GAAG,CAAC;AAE3B,SAAO;AACT;AA8BO,MAAM,eAAe,CAAC,SAA4B;AACvD,QAAM,QAAiB;AAAA,IACrB,MAAM,CAAC;AAAA,IACP,QAAQ,CAAC;AAAA,EACX;AAEA,MAAI,OAAO,KAAK,OAAO,CAAC,YAAY,QAAQ,MAAM;AAElD,SAAO,KAAK,QAAQ;AAClB,WAAO,sBAAsB,OAAO,IAAI;AAAA,EAC1C;AAEA,SAAO;AACT;AAEA,MAAM,WAAW,CAAC,QAChB,OAAO,QAAQ,YAAY,QAAQ,KAAK,GAAG;AAE7C,MAAM,wBAAwB,CAAC,OAAgB,SAA6B;AAC1E,QAAM,CAAC,MAAM,IAAI,IAAI;AAErB,MAAI,CAAC,MAAM;AACT,WAAO,CAAC;AAAA,EACV;AAEA,MAAI,yBAAyB,KAAK,IAAI,GAAG;AACvC,UAAM,KAAK,KAAK,IAAI;AACpB,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB;AAGA,MAAI,CAAC,aAAa,eAAe,EAAE,SAAS,IAAI,GAAG;AACjD,QAAI,SAAS,IAAI,GAAG;AAClB,YAAM,KAAK,KAAK,GAAG,IAAI,IAAI,IAAI,EAAE;AACjC,aAAO,KAAK,MAAM,CAAC;AAAA,IACrB;AAEA,UAAM,KAAK,KAAK,IAAI;AAEpB,QAAI,MAAM;AAGR,YAAM,aAAa;AACnB,YAAM,OAAO,KAAK,GAAG,KAAK,MAAM,CAAC,CAAC;AAAA,IACpC;AAEA,WAAO,CAAC;AAAA,EACV;AAEA,MAAI,eAAe,KAAK,IAAI,GAAG;AAC7B,UAAM,OAAO,OAAO,KAAK,MAAM,CAAC,CAAC;AACjC,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB;AAEA,MAAI,SAAS,UAAU;AACrB,QAAI,SAAS,IAAI,GAAG;AAClB,YAAM,OAAO,OAAO,IAAI;AACxB,aAAO,KAAK,MAAM,CAAC;AAAA,IACrB;AAGA,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB;AAEA,MAAI,KAAK,WAAW,eAAe,GAAG;AACpC,UAAM,eAAe,CAAC;AACtB,UAAM,WAAW,KAAK,KAAK,MAAM,EAAE,CAAC;AACpC,WAAO,KAAK,MAAM,CAAC;AAAA,EACrB;AAEA,QAAM,aAAa;AACnB,QAAM,OAAO,KAAK,GAAG,KAAK,MAAM,CAAC,CAAC;AAClC,SAAO,CAAC;AACV;",
|
|
6
6
|
"names": ["assert"]
|
|
7
7
|
}
|
package/lib/utils/manifest.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export type ProjectType = z.infer<typeof projectTypeSchema>;
|
|
|
4
4
|
export declare const projectTypeSchema: z.ZodUnion<readonly [z.ZodLiteral<"application">, z.ZodLiteral<"package">]>;
|
|
5
5
|
export declare const PROJECT_TYPES: readonly ["application", "package"];
|
|
6
6
|
export declare const getSkubaManifest: () => Promise<NormalizedPackageJson>;
|
|
7
|
-
export declare const getConsumerManifest: (cwd?: string) => Promise<readPkgUp.
|
|
7
|
+
export declare const getConsumerManifest: (cwd?: string) => Promise<readPkgUp.ReadResult | undefined>;
|
|
8
8
|
export declare const getPropFromConsumerManifest: <T extends string, V = unknown>(prop: T) => Promise<V | undefined>;
|
|
9
9
|
export declare const getStringPropFromConsumerManifest: <T extends string>(prop: T) => Promise<string | undefined>;
|
|
10
10
|
export declare const getEntryPointFromManifest: () => Promise<string>;
|
package/lib/utils/manifest.js
CHANGED
|
@@ -57,7 +57,7 @@ const getSkubaManifest = async () => {
|
|
|
57
57
|
}
|
|
58
58
|
return skubaManifest = result.packageJson;
|
|
59
59
|
};
|
|
60
|
-
const getConsumerManifest = (cwd) => (0, import_read_pkg_up.default)({ cwd });
|
|
60
|
+
const getConsumerManifest = (cwd) => (0, import_read_pkg_up.default)({ cwd, normalize: false });
|
|
61
61
|
const getPropFromConsumerManifest = async (prop) => {
|
|
62
62
|
const result = await getConsumerManifest();
|
|
63
63
|
return result !== void 0 && (0, import_validation.hasProp)(result.packageJson.skuba, prop) ? result.packageJson.skuba[prop] : void 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/utils/manifest.ts"],
|
|
4
|
-
"sourcesContent": ["import readPkgUp, { type NormalizedPackageJson } from 'read-pkg-up';\nimport * as z from 'zod/v4';\n\nimport { hasProp } from './validation.js';\n\nexport type ProjectType = z.infer<typeof projectTypeSchema>;\n\nexport const projectTypeSchema = z.union([\n z.literal('application'),\n z.literal('package'),\n]);\n\nexport const PROJECT_TYPES = ['application', 'package'] as const;\n\nconst DEFAULT_ENTRY_POINT = 'src/app.ts';\n\nlet skubaManifest: NormalizedPackageJson | undefined;\n\nexport const getSkubaManifest = async (): Promise<NormalizedPackageJson> => {\n if (skubaManifest !== undefined) {\n return skubaManifest;\n }\n\n const result = await readPkgUp({ cwd: __dirname });\n\n if (result === undefined) {\n throw Error('skuba could not find its own manifest');\n }\n\n return (skubaManifest = result.packageJson);\n};\n\nexport const getConsumerManifest = (cwd?: string)
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAsD;AACtD,QAAmB;AAEnB,wBAAwB;AAIjB,MAAM,oBAAoB,EAAE,MAAM;AAAA,EACvC,EAAE,QAAQ,aAAa;AAAA,EACvB,EAAE,QAAQ,SAAS;AACrB,CAAC;AAEM,MAAM,gBAAgB,CAAC,eAAe,SAAS;AAEtD,MAAM,sBAAsB;AAE5B,IAAI;AAEG,MAAM,mBAAmB,YAA4C;AAC1E,MAAI,kBAAkB,QAAW;AAC/B,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,UAAM,mBAAAA,SAAU,EAAE,KAAK,UAAU,CAAC;AAEjD,MAAI,WAAW,QAAW;AACxB,UAAM,MAAM,uCAAuC;AAAA,EACrD;AAEA,SAAQ,gBAAgB,OAAO;AACjC;AAEO,MAAM,sBAAsB,CAAC,
|
|
4
|
+
"sourcesContent": ["import readPkgUp, { type NormalizedPackageJson } from 'read-pkg-up';\nimport * as z from 'zod/v4';\n\nimport { hasProp } from './validation.js';\n\nexport type ProjectType = z.infer<typeof projectTypeSchema>;\n\nexport const projectTypeSchema = z.union([\n z.literal('application'),\n z.literal('package'),\n]);\n\nexport const PROJECT_TYPES = ['application', 'package'] as const;\n\nconst DEFAULT_ENTRY_POINT = 'src/app.ts';\n\nlet skubaManifest: NormalizedPackageJson | undefined;\n\nexport const getSkubaManifest = async (): Promise<NormalizedPackageJson> => {\n if (skubaManifest !== undefined) {\n return skubaManifest;\n }\n\n const result = await readPkgUp({ cwd: __dirname });\n\n if (result === undefined) {\n throw Error('skuba could not find its own manifest');\n }\n\n return (skubaManifest = result.packageJson);\n};\n\nexport const getConsumerManifest = (cwd?: string) =>\n readPkgUp({ cwd, normalize: false });\n\nexport const getPropFromConsumerManifest = async <\n T extends string,\n V = unknown,\n>(\n prop: T,\n): Promise<V | undefined> => {\n const result = await getConsumerManifest();\n\n return result !== undefined && hasProp<T, V>(result.packageJson.skuba, prop)\n ? result.packageJson.skuba[prop]\n : undefined;\n};\n\nexport const getStringPropFromConsumerManifest = async <T extends string>(\n prop: T,\n): Promise<string | undefined> => {\n const result = await getPropFromConsumerManifest(prop);\n\n return typeof result === 'string' ? result : undefined;\n};\n\nexport const getEntryPointFromManifest = async (): Promise<string> => {\n const entryPoint = await getStringPropFromConsumerManifest('entryPoint');\n\n return entryPoint ?? DEFAULT_ENTRY_POINT;\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAsD;AACtD,QAAmB;AAEnB,wBAAwB;AAIjB,MAAM,oBAAoB,EAAE,MAAM;AAAA,EACvC,EAAE,QAAQ,aAAa;AAAA,EACvB,EAAE,QAAQ,SAAS;AACrB,CAAC;AAEM,MAAM,gBAAgB,CAAC,eAAe,SAAS;AAEtD,MAAM,sBAAsB;AAE5B,IAAI;AAEG,MAAM,mBAAmB,YAA4C;AAC1E,MAAI,kBAAkB,QAAW;AAC/B,WAAO;AAAA,EACT;AAEA,QAAM,SAAS,UAAM,mBAAAA,SAAU,EAAE,KAAK,UAAU,CAAC;AAEjD,MAAI,WAAW,QAAW;AACxB,UAAM,MAAM,uCAAuC;AAAA,EACrD;AAEA,SAAQ,gBAAgB,OAAO;AACjC;AAEO,MAAM,sBAAsB,CAAC,YAClC,mBAAAA,SAAU,EAAE,KAAK,WAAW,MAAM,CAAC;AAE9B,MAAM,8BAA8B,OAIzC,SAC2B;AAC3B,QAAM,SAAS,MAAM,oBAAoB;AAEzC,SAAO,WAAW,cAAa,2BAAc,OAAO,YAAY,OAAO,IAAI,IACvE,OAAO,YAAY,MAAM,IAAI,IAC7B;AACN;AAEO,MAAM,oCAAoC,OAC/C,SACgC;AAChC,QAAM,SAAS,MAAM,4BAA4B,IAAI;AAErD,SAAO,OAAO,WAAW,WAAW,SAAS;AAC/C;AAEO,MAAM,4BAA4B,YAA6B;AACpE,QAAM,aAAa,MAAM,kCAAkC,YAAY;AAEvE,SAAO,cAAc;AACvB;",
|
|
6
6
|
"names": ["readPkgUp"]
|
|
7
7
|
}
|
package/lib/utils/template.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare const templateConfigSchema: z.ZodObject<{
|
|
|
23
23
|
name: z.ZodString;
|
|
24
24
|
message: z.ZodString;
|
|
25
25
|
initial: z.ZodString;
|
|
26
|
-
validate: z.ZodOptional<z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.
|
|
26
|
+
validate: z.ZodOptional<z.ZodPipe<z.ZodCustom<z.core.$InferInnerFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>, z.core.$InferInnerFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>, z.ZodTransform<(args_0: string) => string | boolean, z.core.$InferInnerFunctionType<z.ZodTuple<readonly [z.ZodString], null>, z.ZodUnion<readonly [z.ZodBoolean, z.ZodString]>>>>>;
|
|
27
27
|
}, z.core.$strip>>;
|
|
28
28
|
entryPoint: z.ZodOptional<z.ZodString>;
|
|
29
29
|
noSkip: z.ZodOptional<z.ZodBoolean>;
|
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-20250923003120",
|
|
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",
|
|
@@ -101,15 +101,15 @@
|
|
|
101
101
|
"tsconfig-paths": "^4.0.0",
|
|
102
102
|
"tsconfig-seek": "2.0.0",
|
|
103
103
|
"tsx": "^4.16.2",
|
|
104
|
-
"typescript": "~5.
|
|
105
|
-
"zod": "^
|
|
106
|
-
"eslint-config-skuba": "7.
|
|
104
|
+
"typescript": "~5.9.0",
|
|
105
|
+
"zod": "^4.0.0",
|
|
106
|
+
"eslint-config-skuba": "7.1.1"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
|
-
"@changesets/cli": "2.29.
|
|
109
|
+
"@changesets/cli": "2.29.6",
|
|
110
110
|
"@changesets/get-github-info": "0.6.0",
|
|
111
|
-
"@jest/reporters": "30.
|
|
112
|
-
"@jest/test-result": "30.
|
|
111
|
+
"@jest/reporters": "30.1.3",
|
|
112
|
+
"@jest/test-result": "30.1.3",
|
|
113
113
|
"@types/ejs": "3.1.5",
|
|
114
114
|
"@types/express": "5.0.3",
|
|
115
115
|
"@types/fs-extra": "11.0.4",
|
|
@@ -119,20 +119,20 @@
|
|
|
119
119
|
"@types/module-alias": "2.0.4",
|
|
120
120
|
"@types/npm-registry-fetch": "8.0.8",
|
|
121
121
|
"@types/npm-which": "3.0.4",
|
|
122
|
-
"@types/picomatch": "4.0.
|
|
123
|
-
"@types/semver": "7.7.
|
|
122
|
+
"@types/picomatch": "4.0.2",
|
|
123
|
+
"@types/semver": "7.7.1",
|
|
124
124
|
"@types/supertest": "6.0.3",
|
|
125
|
-
"enhanced-resolve": "5.18.
|
|
125
|
+
"enhanced-resolve": "5.18.3",
|
|
126
126
|
"express": "5.1.0",
|
|
127
|
-
"fastify": "5.
|
|
128
|
-
"jest-diff": "30.
|
|
129
|
-
"jsonfile": "6.
|
|
127
|
+
"fastify": "5.5.0",
|
|
128
|
+
"jest-diff": "30.1.2",
|
|
129
|
+
"jsonfile": "6.2.0",
|
|
130
130
|
"koa": "3.0.1",
|
|
131
|
-
"memfs": "4.
|
|
131
|
+
"memfs": "4.38.2",
|
|
132
132
|
"remark-cli": "12.0.1",
|
|
133
133
|
"remark-preset-lint-recommended": "7.0.1",
|
|
134
134
|
"semver": "7.7.2",
|
|
135
|
-
"supertest": "7.1.
|
|
135
|
+
"supertest": "7.1.4",
|
|
136
136
|
"type-fest": "2.19.0"
|
|
137
137
|
},
|
|
138
138
|
"peerDependencies": {
|
|
@@ -146,15 +146,12 @@
|
|
|
146
146
|
"engines": {
|
|
147
147
|
"node": ">=20.9.0"
|
|
148
148
|
},
|
|
149
|
-
"publishConfig": {
|
|
150
|
-
"provenance": true
|
|
151
|
-
},
|
|
152
149
|
"skuba": {
|
|
153
150
|
"build": "esbuild",
|
|
154
151
|
"entryPoint": "src/index.ts",
|
|
155
152
|
"template": null,
|
|
156
153
|
"type": "package",
|
|
157
|
-
"version": "12.0
|
|
154
|
+
"version": "12.2.0"
|
|
158
155
|
},
|
|
159
156
|
"scripts": {
|
|
160
157
|
"build": "scripts/build.sh",
|
|
@@ -168,7 +165,7 @@
|
|
|
168
165
|
"lint:packages": "pnpm --filter '!./template/**' lint",
|
|
169
166
|
"release": "pnpm --silent build && changeset publish",
|
|
170
167
|
"skuba": "pnpm --silent build && pnpm --silent skuba:exec",
|
|
171
|
-
"skuba:exec": "node
|
|
168
|
+
"skuba:exec": "node lib/skuba",
|
|
172
169
|
"stage": "changeset version && node ./.changeset/inject.js && pnpm format",
|
|
173
170
|
"test": "pnpm --silent skuba test --selectProjects unit",
|
|
174
171
|
"test:ci": "pnpm --silent skuba test --runInBand",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
module.exports = require('skuba/config/prettier');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
module.exports = require('eslint-config-skuba');
|
|
@@ -77,6 +77,9 @@ steps:
|
|
|
77
77
|
queue: <%- devBuildkiteQueueName %>
|
|
78
78
|
label: 🤞 Deploy Dev
|
|
79
79
|
concurrency_group: <%- teamName %>/deploy/gantry/<%- devGantryEnvironmentName %>
|
|
80
|
+
env:
|
|
81
|
+
DD_DEPLOYMENT_ENVIRONMENT: development
|
|
82
|
+
DD_DEPLOYMENT_SERVICE: <%- serviceName %>
|
|
80
83
|
key: deploy-dev
|
|
81
84
|
plugins:
|
|
82
85
|
- seek-jobs/gantry#v4.0.0:
|
|
@@ -93,6 +96,9 @@ steps:
|
|
|
93
96
|
branches: ${BUILDKITE_PIPELINE_DEFAULT_BRANCH}
|
|
94
97
|
concurrency_group: <%- teamName %>/deploy/gantry/<%- prodGantryEnvironmentName %>
|
|
95
98
|
depends_on: deploy-dev
|
|
99
|
+
env:
|
|
100
|
+
DD_DEPLOYMENT_ENVIRONMENT: production
|
|
101
|
+
DD_DEPLOYMENT_SERVICE: <%- serviceName %>
|
|
96
102
|
plugins:
|
|
97
103
|
- seek-jobs/gantry#v4.0.0:
|
|
98
104
|
command: apply
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
DEPLOYMENT=local
|
|
@@ -70,19 +70,19 @@ pnpm start:debug
|
|
|
70
70
|
|
|
71
71
|
This project is deployed through a [Buildkite pipeline](.buildkite/pipeline.yml).
|
|
72
72
|
|
|
73
|
-
- Commits to a feature branch can be deployed to the
|
|
74
|
-
- Commits to the default branch are automatically deployed to the
|
|
73
|
+
- Commits to a feature branch can be deployed to the development environment by unblocking a step in the Buildkite UI
|
|
74
|
+
- Commits to the default branch are automatically deployed to the development and production environments in sequence
|
|
75
75
|
|
|
76
76
|
To rapidly roll back a change,
|
|
77
77
|
retry an individual deployment step from the previous build in Buildkite.
|
|
78
|
-
Note that this will introduce drift between the head of the default Git branch and the live
|
|
78
|
+
Note that this will introduce drift between the head of the default Git branch and the live deployments;
|
|
79
79
|
use with caution and always follow up with a proper revert or fix in Git history.
|
|
80
80
|
|
|
81
81
|
## Support
|
|
82
82
|
|
|
83
83
|
### Dev
|
|
84
84
|
|
|
85
|
-
TODO: add support links for the dev
|
|
85
|
+
TODO: add support links for the dev deployment.
|
|
86
86
|
|
|
87
87
|
<!--
|
|
88
88
|
- CloudWatch dashboard
|
|
@@ -92,7 +92,7 @@ TODO: add support links for the dev environment.
|
|
|
92
92
|
|
|
93
93
|
### Prod
|
|
94
94
|
|
|
95
|
-
TODO: add support links for the prod
|
|
95
|
+
TODO: add support links for the prod deployment.
|
|
96
96
|
|
|
97
97
|
<!--
|
|
98
98
|
- CloudWatch dashboard
|
|
@@ -9,9 +9,14 @@ owner: '{{values "owner"}}'
|
|
|
9
9
|
image: '{{values "image"}}'
|
|
10
10
|
|
|
11
11
|
env:
|
|
12
|
-
|
|
12
|
+
DEPLOYMENT: '{{values "deployment"}}'
|
|
13
13
|
SERVICE: '{{values "service"}}'
|
|
14
14
|
|
|
15
|
+
DD_ENV: '{{values "env"}}'
|
|
16
|
+
DD_SERVICE: '{{values "service"}}'
|
|
17
|
+
|
|
18
|
+
OPENTELEMETRY_ENABLED: '{{values "openTelemetry.enabled"}}'
|
|
19
|
+
|
|
15
20
|
{{if .Values.cloudwatchDashboardDisabled}}
|
|
16
21
|
cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
|
|
17
22
|
{{end}}
|
|
@@ -20,6 +25,17 @@ cloudwatchDashboardDisabled: {{values "cloudwatchDashboardDisabled"}}
|
|
|
20
25
|
datadogSecretId: '{{values "datadogSecretId"}}'
|
|
21
26
|
{{end}}
|
|
22
27
|
|
|
28
|
+
# Uncomment if the `tin` tier is acceptable for your SEEK Auth Sidecar logs
|
|
29
|
+
# The eeeoh log forwarder bypasses Amazon CloudWatch for cost savings
|
|
30
|
+
# logSink:
|
|
31
|
+
# forwarder: eeeoh
|
|
32
|
+
# splunkIndex: '{{values "logSink.splunkIndex"}}'
|
|
33
|
+
|
|
34
|
+
openTelemetry:
|
|
35
|
+
datadogEnvironmentName: '{{values "env"}}'
|
|
36
|
+
enabled: {{values "openTelemetry.enabled"}}
|
|
37
|
+
useGantryServiceName: true
|
|
38
|
+
|
|
23
39
|
{{if .Values.pagerDutyEndpoint}}
|
|
24
40
|
pagerDutyEndpoint: '{{values "pagerDutyEndpoint"}}'
|
|
25
41
|
{{end}}
|
|
@@ -19,22 +19,28 @@
|
|
|
19
19
|
"test:watch": "skuba test --watch"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@
|
|
22
|
+
"@opentelemetry/api": "^1.9.0",
|
|
23
|
+
"@opentelemetry/core": "^2.0.0",
|
|
24
|
+
"@opentelemetry/exporter-trace-otlp-grpc": "^0.204.0",
|
|
25
|
+
"@opentelemetry/instrumentation-aws-sdk": "^0.58.0",
|
|
26
|
+
"@opentelemetry/instrumentation-http": "^0.204.0",
|
|
27
|
+
"@opentelemetry/propagator-b3": "^2.0.0",
|
|
28
|
+
"@opentelemetry/sdk-node": "^0.204.0",
|
|
29
|
+
"@seek/logger": "^11.1.0",
|
|
23
30
|
"express": "^5.0.0",
|
|
24
|
-
"hot-shots": "^
|
|
25
|
-
"seek-datadog-custom-metrics": "^
|
|
31
|
+
"hot-shots": "^11.0.0",
|
|
32
|
+
"seek-datadog-custom-metrics": "^6.0.0",
|
|
26
33
|
"skuba-dive": "^2.0.0"
|
|
27
34
|
},
|
|
28
35
|
"devDependencies": {
|
|
29
36
|
"@types/express": "^5.0.0",
|
|
30
37
|
"@types/node": "^22.13.10",
|
|
31
38
|
"@types/supertest": "^6.0.0",
|
|
32
|
-
"mime": "^4.0.1",
|
|
33
39
|
"pino-pretty": "^13.0.0",
|
|
34
40
|
"skuba": "*",
|
|
35
41
|
"supertest": "^7.0.0"
|
|
36
42
|
},
|
|
37
|
-
"packageManager": "pnpm@10.
|
|
43
|
+
"packageManager": "pnpm@10.15.1",
|
|
38
44
|
"engines": {
|
|
39
45
|
"node": ">=22"
|
|
40
46
|
}
|
|
@@ -3,8 +3,8 @@ import type { Handler } from 'express';
|
|
|
3
3
|
/**
|
|
4
4
|
* Signifies that the API is available to serve requests.
|
|
5
5
|
*
|
|
6
|
-
* The
|
|
7
|
-
* unhealthy and needs to be recycled.
|
|
6
|
+
* The workload hosting environment calls this endpoint to see if the container
|
|
7
|
+
* is unhealthy and needs to be recycled.
|
|
8
8
|
*/
|
|
9
9
|
export const healthCheckHandler: Handler = (_req, res) => {
|
|
10
10
|
res.send('');
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Env } from 'skuba-dive';
|
|
2
2
|
|
|
3
3
|
interface Config {
|
|
4
|
-
|
|
4
|
+
deployment: Deployment;
|
|
5
5
|
|
|
6
6
|
logLevel: string;
|
|
7
7
|
name: string;
|
|
@@ -11,17 +11,17 @@ interface Config {
|
|
|
11
11
|
port: number | null;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
type
|
|
14
|
+
type Deployment = (typeof deployments)[number];
|
|
15
15
|
|
|
16
16
|
const dev = '<%- devGantryEnvironmentName %>';
|
|
17
17
|
const prod = '<%- prodGantryEnvironmentName %>';
|
|
18
18
|
|
|
19
|
-
const
|
|
19
|
+
const deployments = ['local', 'test', dev, prod] as const;
|
|
20
20
|
|
|
21
|
-
const
|
|
21
|
+
const deployment = Env.oneOf(deployments)('DEPLOYMENT');
|
|
22
22
|
|
|
23
23
|
/* istanbul ignore next: config verification makes more sense in a smoke test */
|
|
24
|
-
const configs: Record<
|
|
24
|
+
const configs: Record<Deployment, () => Omit<Config, 'deployment'>> = {
|
|
25
25
|
local: () => ({
|
|
26
26
|
logLevel: 'debug',
|
|
27
27
|
name: '<%- serviceName %>',
|
|
@@ -60,6 +60,6 @@ const configs: Record<Environment, () => Omit<Config, 'environment'>> = {
|
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
export const config: Config = {
|
|
63
|
-
...configs[
|
|
64
|
-
|
|
63
|
+
...configs[deployment](),
|
|
64
|
+
deployment,
|
|
65
65
|
};
|