skuba 7.5.0-timeout-20240210030715 → 7.5.0-timeout-20240210035306
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/skuba.js +3 -4
- package/lib/skuba.js.map +2 -2
- package/package.json +1 -1
package/lib/skuba.js
CHANGED
|
@@ -34,7 +34,7 @@ var import_logo = require("./utils/logo");
|
|
|
34
34
|
var import_validation = require("./utils/validation");
|
|
35
35
|
const THIRTY_MINUTES = 30 * 60 * 1e3;
|
|
36
36
|
const skuba = async () => {
|
|
37
|
-
const { commandName
|
|
37
|
+
const { commandName } = (0, import_args.parseProcessArgs)(process.argv);
|
|
38
38
|
if (import_command.COMMAND_SET.has(commandName)) {
|
|
39
39
|
const moduleName = (0, import_command.commandToModule)(commandName);
|
|
40
40
|
const commandModule = require(import_path.default.join(import_command.COMMAND_DIR, moduleName));
|
|
@@ -44,10 +44,9 @@ const skuba = async () => {
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
const run = commandModule[moduleName];
|
|
47
|
-
if (!(0, import_env.isCiEnv)() ||
|
|
47
|
+
if (!(0, import_env.isCiEnv)() || process.env.SKUBA_NO_TIMEOUT === "true") {
|
|
48
48
|
return run();
|
|
49
49
|
}
|
|
50
|
-
const timeoutArg = args.find((arg) => arg.startsWith("--timeout-ms="))?.split("=")[1];
|
|
51
50
|
const timeoutId = setTimeout(
|
|
52
51
|
() => {
|
|
53
52
|
import_logging.log.err(
|
|
@@ -57,7 +56,7 @@ const skuba = async () => {
|
|
|
57
56
|
(0, import_why_is_node_running.default)();
|
|
58
57
|
process.exit(1);
|
|
59
58
|
},
|
|
60
|
-
|
|
59
|
+
process.env.SKUBA_TIMEOUT_MS ? parseInt(process.env.SKUBA_TIMEOUT_MS, 10) : THIRTY_MINUTES
|
|
61
60
|
);
|
|
62
61
|
return run().finally(() => clearTimeout(timeoutId));
|
|
63
62
|
}
|
package/lib/skuba.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../src/skuba.ts"],
|
|
4
|
-
"sourcesContent": ["#!/usr/bin/env node\n\n// @ts-expect-error - no types\nimport whyIsNodeRunning from 'why-is-node-running';\n\n/**\n * Entry point for the CLI.\n *\n * This is where you end up when you run:\n *\n * ```bash\n * [pnpm|yarn] skuba help\n * ```\n */\n\n// eslint-disable-next-line import/order -- why-is-node-running must be imported before anything else\nimport path from 'path';\n\nimport { parseProcessArgs } from './utils/args';\nimport {\n COMMAND_DIR,\n COMMAND_SET,\n type Command,\n commandToModule,\n} from './utils/command';\nimport { isCiEnv } from './utils/env';\nimport { handleCliError } from './utils/error';\nimport { showHelp } from './utils/help';\nimport { log } from './utils/logging';\nimport { showLogoAndVersionInfo } from './utils/logo';\nimport { hasProp } from './utils/validation';\n\nconst THIRTY_MINUTES = 30 * 60 * 1000;\n\nconst skuba = async () => {\n const { commandName
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAGA,iCAA6B;AAa7B,kBAAiB;AAEjB,kBAAiC;AACjC,qBAKO;AACP,iBAAwB;AACxB,mBAA+B;AAC/B,kBAAyB;AACzB,qBAAoB;AACpB,kBAAuC;AACvC,wBAAwB;AAExB,MAAM,iBAAiB,KAAK,KAAK;AAEjC,MAAM,QAAQ,YAAY;AACxB,QAAM,EAAE,
|
|
4
|
+
"sourcesContent": ["#!/usr/bin/env node\n\n// @ts-expect-error - no types\nimport whyIsNodeRunning from 'why-is-node-running';\n\n/**\n * Entry point for the CLI.\n *\n * This is where you end up when you run:\n *\n * ```bash\n * [pnpm|yarn] skuba help\n * ```\n */\n\n// eslint-disable-next-line import/order -- why-is-node-running must be imported before anything else\nimport path from 'path';\n\nimport { parseProcessArgs } from './utils/args';\nimport {\n COMMAND_DIR,\n COMMAND_SET,\n type Command,\n commandToModule,\n} from './utils/command';\nimport { isCiEnv } from './utils/env';\nimport { handleCliError } from './utils/error';\nimport { showHelp } from './utils/help';\nimport { log } from './utils/logging';\nimport { showLogoAndVersionInfo } from './utils/logo';\nimport { hasProp } from './utils/validation';\n\nconst THIRTY_MINUTES = 30 * 60 * 1000;\n\nconst skuba = async () => {\n const { commandName } = parseProcessArgs(process.argv);\n\n if (COMMAND_SET.has(commandName)) {\n const moduleName = commandToModule(commandName as Command);\n\n /* eslint-disable @typescript-eslint/no-var-requires */\n const commandModule = require(\n path.join(COMMAND_DIR, moduleName),\n ) as unknown;\n\n if (!hasProp(commandModule, moduleName)) {\n log.err(log.bold(commandName), \"couldn't run! Please submit an issue.\");\n process.exitCode = 1;\n return;\n }\n\n const run = commandModule[moduleName] as () => Promise<unknown>;\n\n // If we're not in a CI environment, we don't need to worry about timeouts, which are primarily to prevent\n // builds running \"forever\" in CI without our knowledge.\n // Local commands may run for a long time, e.g. `skuba node` and `skuba start`, which are unlikely to be used in CI.\n if (!isCiEnv() || process.env.SKUBA_NO_TIMEOUT === 'true') {\n return run();\n }\n\n const timeoutId = setTimeout(\n () => {\n log.err(\n log.bold(commandName),\n 'timed out. This may indicate a process hanging - please file an issue.',\n );\n // eslint-disable-next-line @typescript-eslint/no-unsafe-call\n whyIsNodeRunning();\n // Need to force exit because promises may be hanging so node won't exit on its own.\n process.exit(1);\n },\n process.env.SKUBA_TIMEOUT_MS\n ? parseInt(process.env.SKUBA_TIMEOUT_MS, 10)\n : THIRTY_MINUTES,\n );\n\n return run().finally(() => clearTimeout(timeoutId));\n }\n\n log.err(log.bold(commandName), 'is not recognised as a command.');\n await showLogoAndVersionInfo();\n showHelp();\n\n process.exitCode = 1;\n return;\n};\n\nskuba().catch(handleCliError);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;AAGA,iCAA6B;AAa7B,kBAAiB;AAEjB,kBAAiC;AACjC,qBAKO;AACP,iBAAwB;AACxB,mBAA+B;AAC/B,kBAAyB;AACzB,qBAAoB;AACpB,kBAAuC;AACvC,wBAAwB;AAExB,MAAM,iBAAiB,KAAK,KAAK;AAEjC,MAAM,QAAQ,YAAY;AACxB,QAAM,EAAE,YAAY,QAAI,8BAAiB,QAAQ,IAAI;AAErD,MAAI,2BAAY,IAAI,WAAW,GAAG;AAChC,UAAM,iBAAa,gCAAgB,WAAsB;AAGzD,UAAM,gBAAgB,QACpB,YAAAA,QAAK,KAAK,4BAAa,UAAU,CACnC;AAEA,QAAI,KAAC,2BAAQ,eAAe,UAAU,GAAG;AACvC,yBAAI,IAAI,mBAAI,KAAK,WAAW,GAAG,uCAAuC;AACtE,cAAQ,WAAW;AACnB;AAAA,IACF;AAEA,UAAM,MAAM,cAAc,UAAU;AAKpC,QAAI,KAAC,oBAAQ,KAAK,QAAQ,IAAI,qBAAqB,QAAQ;AACzD,aAAO,IAAI;AAAA,IACb;AAEA,UAAM,YAAY;AAAA,MAChB,MAAM;AACJ,2BAAI;AAAA,UACF,mBAAI,KAAK,WAAW;AAAA,UACpB;AAAA,QACF;AAEA,uCAAAC,SAAiB;AAEjB,gBAAQ,KAAK,CAAC;AAAA,MAChB;AAAA,MACA,QAAQ,IAAI,mBACR,SAAS,QAAQ,IAAI,kBAAkB,EAAE,IACzC;AAAA,IACN;AAEA,WAAO,IAAI,EAAE,QAAQ,MAAM,aAAa,SAAS,CAAC;AAAA,EACpD;AAEA,qBAAI,IAAI,mBAAI,KAAK,WAAW,GAAG,iCAAiC;AAChE,YAAM,oCAAuB;AAC7B,4BAAS;AAET,UAAQ,WAAW;AACnB;AACF;AAEA,MAAM,EAAE,MAAM,2BAAc;",
|
|
6
6
|
"names": ["path", "whyIsNodeRunning"]
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "skuba",
|
|
3
|
-
"version": "7.5.0-timeout-
|
|
3
|
+
"version": "7.5.0-timeout-20240210035306",
|
|
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",
|