@lotiai/composer 0.2.0 → 0.2.2
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/dist/build-config/index.d.ts +52 -0
- package/dist/build-config/index.d.ts.map +1 -0
- package/dist/build-config/index.js +66 -0
- package/dist/build-config/index.js.map +1 -0
- package/dist/build-config/loader.d.ts +80 -0
- package/dist/build-config/loader.d.ts.map +1 -0
- package/dist/build-config/loader.js +238 -0
- package/dist/build-config/loader.js.map +1 -0
- package/dist/build-config/schema.d.ts +101 -0
- package/dist/build-config/schema.d.ts.map +1 -0
- package/dist/build-config/schema.js +94 -0
- package/dist/build-config/schema.js.map +1 -0
- package/dist/cli/commands/dev-temporal.d.ts +15 -0
- package/dist/cli/commands/dev-temporal.d.ts.map +1 -0
- package/dist/cli/commands/dev-temporal.js +68 -0
- package/dist/cli/commands/dev-temporal.js.map +1 -0
- package/dist/cli/commands/dev.d.ts +21 -0
- package/dist/cli/commands/dev.d.ts.map +1 -0
- package/dist/cli/commands/dev.js +421 -0
- package/dist/cli/commands/dev.js.map +1 -0
- package/dist/cli/commands/profiles.d.ts +15 -0
- package/dist/cli/commands/profiles.d.ts.map +1 -0
- package/dist/cli/commands/profiles.js +69 -0
- package/dist/cli/commands/profiles.js.map +1 -0
- package/dist/cli/index.d.ts +21 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +44 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +57 -0
- package/dist/index.js.map +1 -0
- package/dist/internal/async/build/workflow-factory.d.ts +212 -0
- package/dist/internal/async/build/workflow-factory.d.ts.map +1 -0
- package/dist/internal/async/build/workflow-factory.js +533 -0
- package/dist/internal/async/build/workflow-factory.js.map +1 -0
- package/dist/internal/async/build-scripts/utils/common.d.ts +28 -0
- package/dist/internal/async/build-scripts/utils/common.d.ts.map +1 -0
- package/dist/internal/async/build-scripts/utils/common.js +50 -0
- package/dist/internal/async/build-scripts/utils/common.js.map +1 -0
- package/dist/internal/async/build-scripts/utils/import-module.d.ts +19 -0
- package/dist/internal/async/build-scripts/utils/import-module.d.ts.map +1 -0
- package/dist/internal/async/build-scripts/utils/import-module.js +80 -0
- package/dist/internal/async/build-scripts/utils/import-module.js.map +1 -0
- package/dist/internal/async/build-scripts/utils/type-guards.d.ts +123 -0
- package/dist/internal/async/build-scripts/utils/type-guards.d.ts.map +1 -0
- package/dist/internal/async/build-scripts/utils/type-guards.js +145 -0
- package/dist/internal/async/build-scripts/utils/type-guards.js.map +1 -0
- package/dist/internal/async/config/cleanup-policy.d.ts +50 -0
- package/dist/internal/async/config/cleanup-policy.d.ts.map +1 -0
- package/dist/internal/async/config/cleanup-policy.js +20 -0
- package/dist/internal/async/config/cleanup-policy.js.map +1 -0
- package/dist/internal/async/config/worker-profiles.d.ts +172 -0
- package/dist/internal/async/config/worker-profiles.d.ts.map +1 -0
- package/dist/internal/async/config/worker-profiles.js +275 -0
- package/dist/internal/async/config/worker-profiles.js.map +1 -0
- package/dist/internal/async/execute/temporal-client.d.ts +182 -0
- package/dist/internal/async/execute/temporal-client.d.ts.map +1 -0
- package/dist/internal/async/execute/temporal-client.js +190 -0
- package/dist/internal/async/execute/temporal-client.js.map +1 -0
- package/dist/internal/async/execute/workflow-execution.d.ts +98 -0
- package/dist/internal/async/execute/workflow-execution.d.ts.map +1 -0
- package/dist/internal/async/execute/workflow-execution.js +191 -0
- package/dist/internal/async/execute/workflow-execution.js.map +1 -0
- package/dist/internal/async/metrics/task-queue-metrics.d.ts +74 -0
- package/dist/internal/async/metrics/task-queue-metrics.d.ts.map +1 -0
- package/dist/internal/async/metrics/task-queue-metrics.js +155 -0
- package/dist/internal/async/metrics/task-queue-metrics.js.map +1 -0
- package/dist/internal/async/register/activity-worker.d.ts +123 -0
- package/dist/internal/async/register/activity-worker.d.ts.map +1 -0
- package/dist/internal/async/register/activity-worker.js +355 -0
- package/dist/internal/async/register/activity-worker.js.map +1 -0
- package/dist/internal/async/register/generate-workflow-source.d.ts +43 -0
- package/dist/internal/async/register/generate-workflow-source.d.ts.map +1 -0
- package/dist/internal/async/register/generate-workflow-source.js +193 -0
- package/dist/internal/async/register/generate-workflow-source.js.map +1 -0
- package/dist/internal/async/register/workflow-worker.d.ts +125 -0
- package/dist/internal/async/register/workflow-worker.d.ts.map +1 -0
- package/dist/internal/async/register/workflow-worker.js +215 -0
- package/dist/internal/async/register/workflow-worker.js.map +1 -0
- package/dist/internal/async/register-scripts/start-activity-worker.d.ts +70 -0
- package/dist/internal/async/register-scripts/start-activity-worker.d.ts.map +1 -0
- package/dist/internal/async/register-scripts/start-activity-worker.js +75 -0
- package/dist/internal/async/register-scripts/start-activity-worker.js.map +1 -0
- package/dist/internal/async/register-scripts/start-all-workers.d.ts +81 -0
- package/dist/internal/async/register-scripts/start-all-workers.d.ts.map +1 -0
- package/dist/internal/async/register-scripts/start-all-workers.js +84 -0
- package/dist/internal/async/register-scripts/start-all-workers.js.map +1 -0
- package/dist/internal/async/register-scripts/start-workflow-worker.d.ts +69 -0
- package/dist/internal/async/register-scripts/start-workflow-worker.d.ts.map +1 -0
- package/dist/internal/async/register-scripts/start-workflow-worker.js +74 -0
- package/dist/internal/async/register-scripts/start-workflow-worker.js.map +1 -0
- package/dist/internal/async/register-scripts/sync-schedules-cli.d.ts +28 -0
- package/dist/internal/async/register-scripts/sync-schedules-cli.d.ts.map +1 -0
- package/dist/internal/async/register-scripts/sync-schedules-cli.js +124 -0
- package/dist/internal/async/register-scripts/sync-schedules-cli.js.map +1 -0
- package/dist/internal/async/register-scripts/sync-schedules-via-lambda.d.ts +55 -0
- package/dist/internal/async/register-scripts/sync-schedules-via-lambda.d.ts.map +1 -0
- package/dist/internal/async/register-scripts/sync-schedules-via-lambda.js +146 -0
- package/dist/internal/async/register-scripts/sync-schedules-via-lambda.js.map +1 -0
- package/dist/internal/async/register-scripts/sync-schedules.d.ts +68 -0
- package/dist/internal/async/register-scripts/sync-schedules.d.ts.map +1 -0
- package/dist/internal/async/register-scripts/sync-schedules.js +83 -0
- package/dist/internal/async/register-scripts/sync-schedules.js.map +1 -0
- package/dist/internal/async/schedule/constants.d.ts +10 -0
- package/dist/internal/async/schedule/constants.d.ts.map +1 -0
- package/dist/internal/async/schedule/constants.js +13 -0
- package/dist/internal/async/schedule/constants.js.map +1 -0
- package/dist/internal/async/schedule/define-schedule.d.ts +192 -0
- package/dist/internal/async/schedule/define-schedule.d.ts.map +1 -0
- package/dist/internal/async/schedule/define-schedule.js +79 -0
- package/dist/internal/async/schedule/define-schedule.js.map +1 -0
- package/dist/internal/async/schedule/index.d.ts +3 -0
- package/dist/internal/async/schedule/index.d.ts.map +1 -0
- package/dist/internal/async/schedule/index.js +9 -0
- package/dist/internal/async/schedule/index.js.map +1 -0
- package/dist/internal/async/schedule/schedule-definition-schema.d.ts +64 -0
- package/dist/internal/async/schedule/schedule-definition-schema.d.ts.map +1 -0
- package/dist/internal/async/schedule/schedule-definition-schema.js +77 -0
- package/dist/internal/async/schedule/schedule-definition-schema.js.map +1 -0
- package/dist/internal/async/schedule/sync-schedules.d.ts +71 -0
- package/dist/internal/async/schedule/sync-schedules.d.ts.map +1 -0
- package/dist/internal/async/schedule/sync-schedules.js +231 -0
- package/dist/internal/async/schedule/sync-schedules.js.map +1 -0
- package/dist/internal/async/utils/ensure-namespace.d.ts +16 -0
- package/dist/internal/async/utils/ensure-namespace.d.ts.map +1 -0
- package/dist/internal/async/utils/ensure-namespace.js +64 -0
- package/dist/internal/async/utils/ensure-namespace.js.map +1 -0
- package/dist/internal/async/utils/find-package-root.d.ts +9 -0
- package/dist/internal/async/utils/find-package-root.d.ts.map +1 -0
- package/dist/internal/async/utils/find-package-root.js +28 -0
- package/dist/internal/async/utils/find-package-root.js.map +1 -0
- package/dist/internal/async/utils/is-composer-error.d.ts +14 -0
- package/dist/internal/async/utils/is-composer-error.d.ts.map +1 -0
- package/dist/internal/async/utils/is-composer-error.js +17 -0
- package/dist/internal/async/utils/is-composer-error.js.map +1 -0
- package/dist/internal/context-provider.d.ts +316 -0
- package/dist/internal/context-provider.d.ts.map +1 -0
- package/dist/internal/context-provider.js +12 -0
- package/dist/internal/context-provider.js.map +1 -0
- package/dist/internal/create-composer.d.ts +57 -0
- package/dist/internal/create-composer.d.ts.map +1 -0
- package/dist/internal/create-composer.js +125 -0
- package/dist/internal/create-composer.js.map +1 -0
- package/dist/internal/dag-sync-fanout.d.ts +79 -0
- package/dist/internal/dag-sync-fanout.d.ts.map +1 -0
- package/dist/internal/dag-sync-fanout.js +59 -0
- package/dist/internal/dag-sync-fanout.js.map +1 -0
- package/dist/internal/dag-sync-step.d.ts +230 -0
- package/dist/internal/dag-sync-step.d.ts.map +1 -0
- package/dist/internal/dag-sync-step.js +159 -0
- package/dist/internal/dag-sync-step.js.map +1 -0
- package/dist/internal/dag-sync-workflow.d.ts +535 -0
- package/dist/internal/dag-sync-workflow.d.ts.map +1 -0
- package/dist/internal/dag-sync-workflow.js +843 -0
- package/dist/internal/dag-sync-workflow.js.map +1 -0
- package/dist/internal/defaults.d.ts +24 -0
- package/dist/internal/defaults.d.ts.map +1 -0
- package/dist/internal/defaults.js +102 -0
- package/dist/internal/defaults.js.map +1 -0
- package/dist/internal/errors.d.ts +109 -0
- package/dist/internal/errors.d.ts.map +1 -0
- package/dist/internal/errors.js +212 -0
- package/dist/internal/errors.js.map +1 -0
- package/dist/internal/index.d.ts +9 -0
- package/dist/internal/index.d.ts.map +1 -0
- package/dist/internal/index.js +22 -0
- package/dist/internal/index.js.map +1 -0
- package/dist/internal/observability.d.ts +63 -0
- package/dist/internal/observability.d.ts.map +1 -0
- package/dist/internal/observability.js +323 -0
- package/dist/internal/observability.js.map +1 -0
- package/dist/internal/types.d.ts +80 -0
- package/dist/internal/types.d.ts.map +1 -0
- package/dist/internal/types.js +9 -0
- package/dist/internal/types.js.map +1 -0
- package/dist/internal/workflow-planning.d.ts +107 -0
- package/dist/internal/workflow-planning.d.ts.map +1 -0
- package/dist/internal/workflow-planning.js +216 -0
- package/dist/internal/workflow-planning.js.map +1 -0
- package/dist/schedule-sync.d.ts +17 -0
- package/dist/schedule-sync.d.ts.map +1 -0
- package/dist/schedule-sync.js +22 -0
- package/dist/schedule-sync.js.map +1 -0
- package/dist/temporal-naming.d.ts +27 -0
- package/dist/temporal-naming.d.ts.map +1 -0
- package/dist/temporal-naming.js +33 -0
- package/dist/temporal-naming.js.map +1 -0
- package/package.json +29 -17
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dev:Up and Dev:Down Commands
|
|
3
|
+
*
|
|
4
|
+
* Start and stop the Temporal development server using the docker-compose file
|
|
5
|
+
* bundled with the @lotiai/composer package. This allows consumers to run
|
|
6
|
+
* `npx @lotiai/composer dev:up` without needing to manage compose files themselves.
|
|
7
|
+
*/
|
|
8
|
+
import type { CommandModule } from "yargs";
|
|
9
|
+
interface DevTemporalOptions {
|
|
10
|
+
detach: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const devUpCommand: CommandModule<object, DevTemporalOptions>;
|
|
13
|
+
export declare const devDownCommand: CommandModule<object, object>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=dev-temporal.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-temporal.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dev-temporal.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAsB3C,UAAU,kBAAkB;IAC1B,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,eAAO,MAAM,YAAY,EAAE,aAAa,CAAC,MAAM,EAAE,kBAAkB,CAsBlE,CAAC;AAEF,eAAO,MAAM,cAAc,EAAE,aAAa,CAAC,MAAM,EAAE,MAAM,CAYxD,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Dev:Up and Dev:Down Commands
|
|
4
|
+
*
|
|
5
|
+
* Start and stop the Temporal development server using the docker-compose file
|
|
6
|
+
* bundled with the @lotiai/composer package. This allows consumers to run
|
|
7
|
+
* `npx @lotiai/composer dev:up` without needing to manage compose files themselves.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.devDownCommand = exports.devUpCommand = void 0;
|
|
11
|
+
const node_child_process_1 = require("node:child_process");
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the path to the docker-compose.temporal.yml file shipped with
|
|
15
|
+
* the @lotiai/composer package. Uses __dirname so the path is correct whether
|
|
16
|
+
* the CLI is run from node_modules or from the source repo.
|
|
17
|
+
*/
|
|
18
|
+
function getComposeFilePath() {
|
|
19
|
+
// __dirname at runtime is dist/cli/commands/; the compose file is at the package root
|
|
20
|
+
return (0, node_path_1.resolve)(__dirname, "..", "..", "..", "docker-compose.temporal.yml");
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Runs `docker compose` with the given arguments, forwarding stdio to the terminal.
|
|
24
|
+
*/
|
|
25
|
+
function dockerCompose(args) {
|
|
26
|
+
const composeFile = getComposeFilePath();
|
|
27
|
+
(0, node_child_process_1.execFileSync)("docker", ["compose", "-f", composeFile, ...args], {
|
|
28
|
+
stdio: "inherit",
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
exports.devUpCommand = {
|
|
32
|
+
command: "dev:up",
|
|
33
|
+
describe: "Start the Temporal development server (PostgreSQL, Temporal, Temporal UI)",
|
|
34
|
+
builder: (yargs) => yargs.option("detach", {
|
|
35
|
+
alias: "d",
|
|
36
|
+
type: "boolean",
|
|
37
|
+
default: true,
|
|
38
|
+
description: "Run containers in the background",
|
|
39
|
+
}),
|
|
40
|
+
handler: (argv) => {
|
|
41
|
+
try {
|
|
42
|
+
const args = ["up"];
|
|
43
|
+
if (argv.detach) {
|
|
44
|
+
args.push("-d");
|
|
45
|
+
}
|
|
46
|
+
dockerCompose(args);
|
|
47
|
+
}
|
|
48
|
+
catch (error) {
|
|
49
|
+
console.error("Failed to start Temporal:", error instanceof Error ? error.message : error);
|
|
50
|
+
process.exit(1);
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
exports.devDownCommand = {
|
|
55
|
+
command: "dev:down",
|
|
56
|
+
describe: "Stop the Temporal development server",
|
|
57
|
+
builder: (yargs) => yargs,
|
|
58
|
+
handler: () => {
|
|
59
|
+
try {
|
|
60
|
+
dockerCompose(["down"]);
|
|
61
|
+
}
|
|
62
|
+
catch (error) {
|
|
63
|
+
console.error("Failed to stop Temporal:", error instanceof Error ? error.message : error);
|
|
64
|
+
process.exit(1);
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=dev-temporal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev-temporal.js","sourceRoot":"","sources":["../../../src/cli/commands/dev-temporal.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2DAAkD;AAClD,yCAAoC;AAGpC;;;;GAIG;AACH,SAAS,kBAAkB;IACzB,sFAAsF;IACtF,OAAO,IAAA,mBAAO,EAAC,SAAS,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,6BAA6B,CAAC,CAAC;AAC7E,CAAC;AAED;;GAEG;AACH,SAAS,aAAa,CAAC,IAAc;IACnC,MAAM,WAAW,GAAG,kBAAkB,EAAE,CAAC;IACzC,IAAA,iCAAY,EAAC,QAAQ,EAAE,CAAC,SAAS,EAAE,IAAI,EAAE,WAAW,EAAE,GAAG,IAAI,CAAC,EAAE;QAC9D,KAAK,EAAE,SAAS;KACjB,CAAC,CAAC;AACL,CAAC;AAMY,QAAA,YAAY,GAA8C;IACrE,OAAO,EAAE,QAAQ;IACjB,QAAQ,EAAE,2E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**
|
|
2
|
+
* Dev Command
|
|
3
|
+
*
|
|
4
|
+
* Development watch mode for Composer async workflows.
|
|
5
|
+
* Watches for TypeScript file changes, then:
|
|
6
|
+
* 1. Compiles TypeScript
|
|
7
|
+
* 2. Restarts Temporal workers (workers load definitions at startup)
|
|
8
|
+
*
|
|
9
|
+
* Works in both standalone projects and monorepos. The watch root is
|
|
10
|
+
* auto-detected by walking up from cwd to find `pnpm-lock.yaml`, and
|
|
11
|
+
* watch patterns are configured via `dev.watchPatterns` in the build config.
|
|
12
|
+
*/
|
|
13
|
+
import type { CommandModule } from "yargs";
|
|
14
|
+
interface DevOptions {
|
|
15
|
+
config?: string;
|
|
16
|
+
verbose: boolean;
|
|
17
|
+
workerScript?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const devCommand: CommandModule<object, DevOptions>;
|
|
20
|
+
export {};
|
|
21
|
+
//# sourceMappingURL=dev.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/dev.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAI3C,UAAU,UAAU;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,OAAO,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,EAAE,aAAa,CAAC,MAAM,EAAE,UAAU,CA6CxD,CAAC"}
|
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Dev Command
|
|
4
|
+
*
|
|
5
|
+
* Development watch mode for Composer async workflows.
|
|
6
|
+
* Watches for TypeScript file changes, then:
|
|
7
|
+
* 1. Compiles TypeScript
|
|
8
|
+
* 2. Restarts Temporal workers (workers load definitions at startup)
|
|
9
|
+
*
|
|
10
|
+
* Works in both standalone projects and monorepos. The watch root is
|
|
11
|
+
* auto-detected by walking up from cwd to find `pnpm-lock.yaml`, and
|
|
12
|
+
* watch patterns are configured via `dev.watchPatterns` in the build config.
|
|
13
|
+
*/
|
|
14
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
15
|
+
if (k2 === undefined) k2 = k;
|
|
16
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
17
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
18
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
19
|
+
}
|
|
20
|
+
Object.defineProperty(o, k2, desc);
|
|
21
|
+
}) : (function(o, m, k, k2) {
|
|
22
|
+
if (k2 === undefined) k2 = k;
|
|
23
|
+
o[k2] = m[k];
|
|
24
|
+
}));
|
|
25
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
26
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
27
|
+
}) : function(o, v) {
|
|
28
|
+
o["default"] = v;
|
|
29
|
+
});
|
|
30
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
31
|
+
var ownKeys = function(o) {
|
|
32
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
33
|
+
var ar = [];
|
|
34
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
35
|
+
return ar;
|
|
36
|
+
};
|
|
37
|
+
return ownKeys(o);
|
|
38
|
+
};
|
|
39
|
+
return function (mod) {
|
|
40
|
+
if (mod && mod.__esModule) return mod;
|
|
41
|
+
var result = {};
|
|
42
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
43
|
+
__setModuleDefault(result, mod);
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
})();
|
|
47
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
48
|
+
exports.devCommand = void 0;
|
|
49
|
+
const node_child_process_1 = require("node:child_process");
|
|
50
|
+
const node_path_1 = require("node:path");
|
|
51
|
+
const index_1 = require("../../build-config/index");
|
|
52
|
+
exports.devCommand = {
|
|
53
|
+
command: "dev",
|
|
54
|
+
describe: "Start development watch mode (compile, restart workers on changes)",
|
|
55
|
+
builder: (yargs) => yargs
|
|
56
|
+
.option("config", {
|
|
57
|
+
alias: "c",
|
|
58
|
+
type: "string",
|
|
59
|
+
description: "Path to composer.build-config.ts (auto-detected if not specified)",
|
|
60
|
+
})
|
|
61
|
+
.option("verbose", {
|
|
62
|
+
type: "boolean",
|
|
63
|
+
default: false,
|
|
64
|
+
description: "Enable verbose output",
|
|
65
|
+
})
|
|
66
|
+
.option("worker-script", {
|
|
67
|
+
type: "string",
|
|
68
|
+
description: "Path to the compiled start-all-workers .js script (relative to cwd). Overrides dev.startAllWorkersJsScript in config.",
|
|
69
|
+
}),
|
|
70
|
+
handler: async (argv) => {
|
|
71
|
+
const { config: configPath, verbose, workerScript: workerScriptArg } = argv;
|
|
72
|
+
if (verbose) {
|
|
73
|
+
console.log("Loading configuration...");
|
|
74
|
+
}
|
|
75
|
+
const { config } = await (0, index_1.loadBuildConfig)(configPath ? { configPath } : undefined);
|
|
76
|
+
// Resolve worker script: CLI arg > config > error
|
|
77
|
+
const workerScriptRelative = workerScriptArg ?? config.dev?.startAllWorkersJsScript;
|
|
78
|
+
if (!workerScriptRelative) {
|
|
79
|
+
console.error("Error: No worker script specified. Provide --worker-script or set dev.startAllWorkersJsScript in composer.build-config.ts.");
|
|
80
|
+
process.exit(1);
|
|
81
|
+
}
|
|
82
|
+
if (verbose) {
|
|
83
|
+
console.log(` workerScript: ${workerScriptRelative}`);
|
|
84
|
+
}
|
|
85
|
+
await runDevMode(config, workerScriptRelative, verbose);
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
// ─── Dev Mode Implementation ───────────────────────────────────────────────────
|
|
89
|
+
// Ported from packages/composer/scripts/watch-and-run.ts with config-driven
|
|
90
|
+
// worker script resolution.
|
|
91
|
+
// Track state
|
|
92
|
+
let workerProcess = null;
|
|
93
|
+
let debounceTimeout = null;
|
|
94
|
+
let isRebuilding = false;
|
|
95
|
+
let isShuttingDown = false; // For double Ctrl+C force kill pattern
|
|
96
|
+
let watcher = null; // Module-level so shutdown() can close it
|
|
97
|
+
const DEBOUNCE_MS = 300; // Wait for multi-file saves to complete
|
|
98
|
+
/**
|
|
99
|
+
* Spawn a process and return its exit code.
|
|
100
|
+
*/
|
|
101
|
+
async function spawnWithExitCode(command, args, description) {
|
|
102
|
+
return new Promise((resolve) => {
|
|
103
|
+
const startTime = Date.now();
|
|
104
|
+
const proc = (0, node_child_process_1.spawn)(command, args, {
|
|
105
|
+
stdio: "inherit",
|
|
106
|
+
cwd: process.cwd(),
|
|
107
|
+
});
|
|
108
|
+
proc.on("close", (code) => {
|
|
109
|
+
const duration = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
110
|
+
if (code === 0) {
|
|
111
|
+
console.log(`[checkmark] ${description} (${duration}s)\n`);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
console.error(`[x] ${description} failed with code ${code}\n`);
|
|
115
|
+
}
|
|
116
|
+
resolve(code ?? 1);
|
|
117
|
+
});
|
|
118
|
+
proc.on("error", (err) => {
|
|
119
|
+
console.error(`[x] ${description} error:`, err.message);
|
|
120
|
+
resolve(1);
|
|
121
|
+
});
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Compile TypeScript via `tsc --build`.
|
|
126
|
+
*
|
|
127
|
+
* Resolves `tsc` from the `typescript` package bundled as a direct dependency
|
|
128
|
+
* of @lotiai/composer, so it works regardless of whether the consumer has
|
|
129
|
+
* `typescript` installed or `tsc` on PATH.
|
|
130
|
+
*
|
|
131
|
+
* This follows project references in tsconfig.json, so in a monorepo it
|
|
132
|
+
* compiles the current package and all its transitive dependencies.
|
|
133
|
+
*/
|
|
134
|
+
async function compile() {
|
|
135
|
+
const tscPath = require.resolve("typescript/bin/tsc");
|
|
136
|
+
console.log("Compiling TypeScript (tsc --build)...");
|
|
137
|
+
const exitCode = await spawnWithExitCode(process.execPath, [tscPath, "--build"], "Compilation");
|
|
138
|
+
return exitCode === 0;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Stop the currently running workers
|
|
142
|
+
*/
|
|
143
|
+
async function stopWorkers() {
|
|
144
|
+
if (!workerProcess)
|
|
145
|
+
return;
|
|
146
|
+
return new Promise((resolve) => {
|
|
147
|
+
console.log("Stopping workers...");
|
|
148
|
+
// TODO: stdio stream destruction before SIGTERM may be unnecessary -- the
|
|
149
|
+
// 'exit' handler + SIGKILL fallback should ensure cleanup. Try removing
|
|
150
|
+
// the stream destruction and verify that stopWorkers() still resolves
|
|
151
|
+
// promptly (look for: the promise hanging because stdout/stderr keep
|
|
152
|
+
// the event loop alive after the child is killed).
|
|
153
|
+
if (workerProcess.stdout) {
|
|
154
|
+
workerProcess.stdout.removeAllListeners();
|
|
155
|
+
workerProcess.stdout.destroy();
|
|
156
|
+
}
|
|
157
|
+
if (workerProcess.stderr) {
|
|
158
|
+
workerProcess.stderr.removeAllListeners();
|
|
159
|
+
workerProcess.stderr.destroy();
|
|
160
|
+
}
|
|
161
|
+
// Try graceful shutdown first
|
|
162
|
+
workerProcess.kill("SIGTERM");
|
|
163
|
+
const timeout = setTimeout(() => {
|
|
164
|
+
// Force kill if still running after 5s
|
|
165
|
+
if (workerProcess && !workerProcess.killed) {
|
|
166
|
+
console.log("Force killing workers...");
|
|
167
|
+
workerProcess.kill("SIGKILL");
|
|
168
|
+
}
|
|
169
|
+
}, 5000);
|
|
170
|
+
workerProcess.on("exit", () => {
|
|
171
|
+
clearTimeout(timeout);
|
|
172
|
+
workerProcess = null;
|
|
173
|
+
console.log("[checkmark] Workers stopped\n");
|
|
174
|
+
resolve();
|
|
175
|
+
});
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Start the Temporal workers
|
|
180
|
+
*/
|
|
181
|
+
async function startWorkers(workerScriptPath) {
|
|
182
|
+
console.log("Starting workers...");
|
|
183
|
+
// Track worker readiness
|
|
184
|
+
// We wait for Temporal SDK's "Worker state changed" logs with state: 'RUNNING'
|
|
185
|
+
// This ensures workflow bundles are compiled and workers are actually polling
|
|
186
|
+
let workflowWorkerReady = false;
|
|
187
|
+
let activityWorkerReady = false;
|
|
188
|
+
let outputBuffer = ""; // Buffer to accumulate multi-line JSON logs from Temporal
|
|
189
|
+
const readyPromise = new Promise((resolve, reject) => {
|
|
190
|
+
const timeout = setTimeout(() => {
|
|
191
|
+
reject(new Error("Workers failed to start within 30 seconds"));
|
|
192
|
+
}, 30000);
|
|
193
|
+
const checkReady = () => {
|
|
194
|
+
if (workflowWorkerReady && activityWorkerReady) {
|
|
195
|
+
clearTimeout(timeout);
|
|
196
|
+
resolve();
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
workerProcess = (0, node_child_process_1.spawn)("node", [workerScriptPath], {
|
|
200
|
+
stdio: ["inherit", "pipe", "pipe"],
|
|
201
|
+
env: {
|
|
202
|
+
...process.env,
|
|
203
|
+
FORCE_COLOR: "1", // Preserve colors when piping output
|
|
204
|
+
},
|
|
205
|
+
});
|
|
206
|
+
// Parse stdout/stderr to detect when workers are actually ready
|
|
207
|
+
// We check both streams because Temporal logs can go to either
|
|
208
|
+
const parseWorkerOutput = (output) => {
|
|
209
|
+
// Add to buffer and keep last 5000 chars to avoid unbounded growth
|
|
210
|
+
outputBuffer += output;
|
|
211
|
+
if (outputBuffer.length > 5000) {
|
|
212
|
+
outputBuffer = outputBuffer.slice(-5000);
|
|
213
|
+
}
|
|
214
|
+
// Detect readiness from composer's own log messages, which are emitted
|
|
215
|
+
// regardless of the task queue names configured by the consumer.
|
|
216
|
+
if (outputBuffer.includes("Workflow Workers ready")) {
|
|
217
|
+
if (!workflowWorkerReady) {
|
|
218
|
+
console.log(" -> Workflow Worker now RUNNING");
|
|
219
|
+
workflowWorkerReady = true;
|
|
220
|
+
checkReady();
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
if (outputBuffer.includes("Activity Workers ready")) {
|
|
224
|
+
if (!activityWorkerReady) {
|
|
225
|
+
console.log(" -> Activity Worker now RUNNING");
|
|
226
|
+
activityWorkerReady = true;
|
|
227
|
+
checkReady();
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
};
|
|
231
|
+
workerProcess.stdout?.on("data", (data) => {
|
|
232
|
+
const output = data.toString();
|
|
233
|
+
parseWorkerOutput(output);
|
|
234
|
+
process.stdout.write(output);
|
|
235
|
+
});
|
|
236
|
+
workerProcess.stderr?.on("data", (data) => {
|
|
237
|
+
const output = data.toString();
|
|
238
|
+
parseWorkerOutput(output);
|
|
239
|
+
process.stderr.write(output);
|
|
240
|
+
});
|
|
241
|
+
workerProcess.on("error", (err) => {
|
|
242
|
+
clearTimeout(timeout);
|
|
243
|
+
reject(err);
|
|
244
|
+
});
|
|
245
|
+
workerProcess.on("exit", (code, signal) => {
|
|
246
|
+
clearTimeout(timeout);
|
|
247
|
+
if (signal !== "SIGTERM" && signal !== "SIGKILL") {
|
|
248
|
+
console.error(`Workers exited unexpectedly (code: ${code}, signal: ${signal})`);
|
|
249
|
+
}
|
|
250
|
+
workerProcess = null;
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
try {
|
|
254
|
+
await readyPromise;
|
|
255
|
+
console.log("\nTemporal Ready\n");
|
|
256
|
+
}
|
|
257
|
+
catch (error) {
|
|
258
|
+
console.error("Worker startup failed:", error);
|
|
259
|
+
throw error;
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
/**
|
|
263
|
+
* Full rebuild: compile -> restart
|
|
264
|
+
*/
|
|
265
|
+
async function rebuild(workerScriptPath, _verbose, trigger) {
|
|
266
|
+
if (isRebuilding) {
|
|
267
|
+
console.log("Skipping rebuild (already in progress)...\n");
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
270
|
+
isRebuilding = true;
|
|
271
|
+
const startTime = Date.now();
|
|
272
|
+
console.log("\n-------------------------------------------");
|
|
273
|
+
if (trigger) {
|
|
274
|
+
console.log(`Change detected: ${trigger}`);
|
|
275
|
+
}
|
|
276
|
+
console.log("Rebuilding...\n");
|
|
277
|
+
try {
|
|
278
|
+
const compileSuccess = await compile();
|
|
279
|
+
if (!compileSuccess) {
|
|
280
|
+
console.error("Compilation failed. Fix errors and save to retry.");
|
|
281
|
+
console.log("Still watching for changes...\n");
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
await stopWorkers();
|
|
285
|
+
await startWorkers(workerScriptPath);
|
|
286
|
+
const totalTime = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
287
|
+
console.log(`Total rebuild time: ${totalTime}s`);
|
|
288
|
+
console.log("Watching for changes...\n");
|
|
289
|
+
}
|
|
290
|
+
catch (error) {
|
|
291
|
+
console.error("Rebuild error:", error);
|
|
292
|
+
console.log("Still watching for changes...\n");
|
|
293
|
+
}
|
|
294
|
+
finally {
|
|
295
|
+
isRebuilding = false;
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Graceful shutdown
|
|
300
|
+
*/
|
|
301
|
+
async function shutdown() {
|
|
302
|
+
// Force kill on second Ctrl+C
|
|
303
|
+
if (isShuttingDown) {
|
|
304
|
+
console.log("\n\nForce killing all processes...");
|
|
305
|
+
// Force kill worker process immediately
|
|
306
|
+
if (workerProcess && !workerProcess.killed) {
|
|
307
|
+
workerProcess.kill("SIGKILL");
|
|
308
|
+
}
|
|
309
|
+
// TODO: setImmediate wrapping process.exit may be unnecessary -- process.exit()
|
|
310
|
+
// is synchronous and setImmediate does not reliably flush stdout. Try
|
|
311
|
+
// replacing with direct process.exit() and verify shutdown still works
|
|
312
|
+
// cleanly (check for truncated log output on exit).
|
|
313
|
+
setImmediate(() => process.exit(1));
|
|
314
|
+
return; // Don't proceed with graceful shutdown
|
|
315
|
+
}
|
|
316
|
+
isShuttingDown = true;
|
|
317
|
+
console.log("\n\nShutting down watch mode... (Press Ctrl+C again to force quit)");
|
|
318
|
+
// Set a timeout to force exit if graceful shutdown hangs
|
|
319
|
+
// This ensures we always exit even if watcher or workers don't close cleanly
|
|
320
|
+
const forceExitTimeout = setTimeout(() => {
|
|
321
|
+
console.log("\nGraceful shutdown timed out, forcing exit...");
|
|
322
|
+
process.exit(1);
|
|
323
|
+
}, 10000); // 10 second timeout
|
|
324
|
+
try {
|
|
325
|
+
// Clear any pending debounce
|
|
326
|
+
if (debounceTimeout) {
|
|
327
|
+
clearTimeout(debounceTimeout);
|
|
328
|
+
}
|
|
329
|
+
// Close file watcher
|
|
330
|
+
if (watcher) {
|
|
331
|
+
// Remove all listeners before closing to prevent them keeping event loop alive
|
|
332
|
+
watcher.removeAllListeners();
|
|
333
|
+
await watcher.close();
|
|
334
|
+
}
|
|
335
|
+
// Stop workers gracefully
|
|
336
|
+
await stopWorkers();
|
|
337
|
+
clearTimeout(forceExitTimeout);
|
|
338
|
+
console.log("Shutdown complete");
|
|
339
|
+
// TODO: setImmediate wrapping process.exit may be unnecessary -- process.exit()
|
|
340
|
+
// is synchronous and setImmediate does not reliably flush stdout. Try
|
|
341
|
+
// replacing with direct process.exit() and verify shutdown still works
|
|
342
|
+
// cleanly (check for truncated log output on exit).
|
|
343
|
+
setImmediate(() => process.exit(0));
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
clearTimeout(forceExitTimeout);
|
|
347
|
+
console.error("Shutdown error:", error);
|
|
348
|
+
// TODO: setImmediate wrapping process.exit may be unnecessary -- process.exit()
|
|
349
|
+
// is synchronous and setImmediate does not reliably flush stdout. Try
|
|
350
|
+
// replacing with direct process.exit() and verify shutdown still works
|
|
351
|
+
// cleanly (check for truncated log output on exit).
|
|
352
|
+
setImmediate(() => process.exit(1));
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
/**
|
|
356
|
+
* Main dev mode entry point
|
|
357
|
+
*/
|
|
358
|
+
async function runDevMode(config, workerScriptRelative, verbose) {
|
|
359
|
+
// Dynamic import to keep chokidar as an optional devDependency
|
|
360
|
+
const chokidar = await Promise.resolve().then(() => __importStar(require("chokidar")));
|
|
361
|
+
const workerScriptPath = (0, node_path_1.resolve)(process.cwd(), workerScriptRelative);
|
|
362
|
+
// watchPatterns are already resolved to absolute paths by the config loader
|
|
363
|
+
const watchPatterns = config.dev.watchPatterns;
|
|
364
|
+
console.log("Starting Composer Development Mode...\n");
|
|
365
|
+
console.log(`Watching: ${watchPatterns.join(", ")}`);
|
|
366
|
+
console.log("Excludes: dist/, node_modules/, *.gen.{ts,json}");
|
|
367
|
+
console.log("\nRuntime discovery mode: workers import compiled .js files directly");
|
|
368
|
+
console.log("");
|
|
369
|
+
// Handle file change with debouncing
|
|
370
|
+
const handleFileChange = (path) => {
|
|
371
|
+
if (debounceTimeout) {
|
|
372
|
+
clearTimeout(debounceTimeout);
|
|
373
|
+
}
|
|
374
|
+
// Debounce: wait for editor to finish saving multiple files
|
|
375
|
+
debounceTimeout = setTimeout(() => {
|
|
376
|
+
const relativePath = path.replace(`${process.cwd()}/`, "");
|
|
377
|
+
rebuild(workerScriptPath, verbose, relativePath);
|
|
378
|
+
}, DEBOUNCE_MS);
|
|
379
|
+
};
|
|
380
|
+
// Initial build - be forgiving for dev mode, allow starting with errors
|
|
381
|
+
console.log("Initial setup...\n");
|
|
382
|
+
const compileSuccess = await compile();
|
|
383
|
+
if (!compileSuccess) {
|
|
384
|
+
console.error("Initial compilation failed.");
|
|
385
|
+
console.log(" Fix errors and save to retry.\n");
|
|
386
|
+
console.log("Starting watch mode anyway...\n");
|
|
387
|
+
}
|
|
388
|
+
// Only start workers if compilation succeeded
|
|
389
|
+
if (compileSuccess) {
|
|
390
|
+
await startWorkers(workerScriptPath);
|
|
391
|
+
console.log("Watching for changes...\n");
|
|
392
|
+
}
|
|
393
|
+
else {
|
|
394
|
+
console.log("Initial setup incomplete. Workers not started.");
|
|
395
|
+
console.log(" Fix errors and save to complete setup.");
|
|
396
|
+
console.log("Watching for changes...\n");
|
|
397
|
+
}
|
|
398
|
+
// Setup file watcher (patterns are already absolute from config loader)
|
|
399
|
+
watcher = chokidar.watch(watchPatterns, {
|
|
400
|
+
persistent: true,
|
|
401
|
+
ignoreInitial: true,
|
|
402
|
+
ignored: [
|
|
403
|
+
"**/node_modules/**",
|
|
404
|
+
"**/dist/**",
|
|
405
|
+
"**/*.gen.ts",
|
|
406
|
+
"**/*.gen.json",
|
|
407
|
+
"**/coverage/**",
|
|
408
|
+
"**/test-results/**",
|
|
409
|
+
],
|
|
410
|
+
});
|
|
411
|
+
watcher.on("change", handleFileChange);
|
|
412
|
+
watcher.on("add", handleFileChange);
|
|
413
|
+
watcher.on("error", (error) => {
|
|
414
|
+
console.error("Watcher error:", error);
|
|
415
|
+
});
|
|
416
|
+
// Setup shutdown handlers
|
|
417
|
+
// Wrap shutdown() in arrow function with void to properly handle async without waiting
|
|
418
|
+
process.on("SIGINT", () => void shutdown());
|
|
419
|
+
process.on("SIGTERM", () => void shutdown());
|
|
420
|
+
}
|
|
421
|
+
//# sourceMappingURL=dev.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dev.js","sourceRoot":"","sources":["../../../src/cli/commands/dev.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,2DAA8D;AAC9D,yCAAoC;AAEpC,oDAA2D;AAS9C,QAAA,UAAU,GAAsC;IAC3D,OAAO,EAAE,KAAK;IACd,QAAQ,EAAE,oEAAoE;IAC9E,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,MAAM,CAAC,QAAQ,EAAE;QAChB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mEAAmE;KACjF,CAAC;SACD,MAAM,CAAC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IAED,8CAA8C;IAC9C,IAAI,cAAc,EAAE,CAAC;QACnB,MAAM,YAAY,CAAC,gBAAgB,CAAC,CAAC;QACrC,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACN,OAAO,CAAC,GAAG,CAAC,gDAAgD,CAAC,CAAC;QAC9D,OAAO,CAAC,GAAG,CAAC,2CAA2C,CAAC,CAAC;QACzD,OAAO,CAAC,GAAG,CAAC,2BAA2B,CAAC,CAAC;IAC3C,CAAC;IAED,wEAAwE;IACxE,OAAO,GAAG,QAAQ,CAAC,KAAK,CAAC,aAAa,EAAE;QACtC,UAAU,EAAE,IAAI;QAChB,aAAa,EAAE,IAAI;QACnB,OAAO,EAAE;YACP,oBAAoB;YACpB,YAAY;YACZ,aAAa;YACb,eAAe;YACf,gBAAgB;YAChB,oBAAoB;SACrB;KACF,CAAC,CAAC;IAEH,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,gBAAgB,CAAC,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAEpC,OAAO,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QAC5B,OAAO,CAAC,KAAK,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC;IACzC,CAAC,CAAC,CAAC;IAEH,0BAA0B;IAC1B,uFAAuF;IACvF,OAAO,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,CAAC,KAAK,QAAQ,EAAE,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profiles Command
|
|
3
|
+
*
|
|
4
|
+
* Resolves effective worker profile deployment topology for an environment,
|
|
5
|
+
* including dedicated profiles and fallback queue routing.
|
|
6
|
+
*/
|
|
7
|
+
import type { CommandModule } from "yargs";
|
|
8
|
+
interface ProfilesOptions {
|
|
9
|
+
config?: string;
|
|
10
|
+
env: string;
|
|
11
|
+
json: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const profilesCommand: CommandModule<object, ProfilesOptions>;
|
|
14
|
+
export {};
|
|
15
|
+
//# sourceMappingURL=profiles.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/profiles.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAQ3C,UAAU,eAAe;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,OAAO,CAAC;CACf;AAED,eAAO,MAAM,eAAe,EAAE,aAAa,CAAC,MAAM,EAAE,eAAe,CAiElE,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Profiles Command
|
|
4
|
+
*
|
|
5
|
+
* Resolves effective worker profile deployment topology for an environment,
|
|
6
|
+
* including dedicated profiles and fallback queue routing.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.profilesCommand = void 0;
|
|
10
|
+
const index_1 = require("../../build-config/index");
|
|
11
|
+
const worker_profiles_1 = require("../../internal/async/config/worker-profiles");
|
|
12
|
+
exports.profilesCommand = {
|
|
13
|
+
command: "profiles",
|
|
14
|
+
describe: "Resolve worker profile deployment and fallback queues for an environment",
|
|
15
|
+
builder: (yargs) => yargs
|
|
16
|
+
.option("config", {
|
|
17
|
+
alias: "c",
|
|
18
|
+
type: "string",
|
|
19
|
+
description: "Path to composer.build-config.ts (auto-detected if not specified)",
|
|
20
|
+
})
|
|
21
|
+
.option("env", {
|
|
22
|
+
type: "string",
|
|
23
|
+
demandOption: true,
|
|
24
|
+
description: "Environment to resolve (for example: local, preview, prod)",
|
|
25
|
+
})
|
|
26
|
+
.option("json", {
|
|
27
|
+
type: "boolean",
|
|
28
|
+
default: false,
|
|
29
|
+
description: "Output machine-readable JSON",
|
|
30
|
+
}),
|
|
31
|
+
handler: async (argv) => {
|
|
32
|
+
const { config: configPath, env, json } = argv;
|
|
33
|
+
try {
|
|
34
|
+
const { config } = await (0, index_1.loadBuildConfig)(configPath ? { configPath } : undefined);
|
|
35
|
+
const resolved = (0, worker_profiles_1.resolveProfilesForEnvironment)(env, config);
|
|
36
|
+
if (json) {
|
|
37
|
+
console.log(JSON.stringify(resolved, null, 2));
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
console.log(`Environment: ${env}`);
|
|
41
|
+
console.log("\nDedicated profiles:");
|
|
42
|
+
for (const profile of Object.keys(worker_profiles_1.WORKER_PROFILES)) {
|
|
43
|
+
const dedicated = resolved.dedicatedProfiles[profile];
|
|
44
|
+
if (!dedicated) {
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
console.log(` - ${profile} (${dedicated.taskQueue}) cpu=${dedicated.resources.cpu} memory=${dedicated.resources.memory} maxConcurrentActivities=${dedicated.resources.maxConcurrentActivities} initial=${dedicated.resources.initialCount} max=${dedicated.resources.maxCount}`);
|
|
48
|
+
}
|
|
49
|
+
console.log("\nFallback queues:");
|
|
50
|
+
let hasFallbacks = false;
|
|
51
|
+
for (const profile of Object.keys(worker_profiles_1.WORKER_PROFILES)) {
|
|
52
|
+
const queues = resolved.fallbackQueues[profile];
|
|
53
|
+
if (!queues || queues.length === 0) {
|
|
54
|
+
continue;
|
|
55
|
+
}
|
|
56
|
+
hasFallbacks = true;
|
|
57
|
+
console.log(` - ${profile}: ${queues.join(", ")}`);
|
|
58
|
+
}
|
|
59
|
+
if (!hasFallbacks) {
|
|
60
|
+
console.log(" - none");
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
console.error("Failed to resolve profiles:", error instanceof Error ? error.message : error);
|
|
65
|
+
process.exit(1);
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../../src/cli/commands/profiles.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAGH,oDAA2D;AAC3D,iFAIqD;AAQxC,QAAA,eAAe,GAA2C;IACrE,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,0EAA0E;IACpF,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK;SACF,MAAM,CAAC,QAAQ,EAAE;QAChB,KAAK,EAAE,GAAG;QACV,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mEAAmE;KACjF,CAAC;SACD,MAAM,CAAC,KAAK,EAAE;QACb,IAAI,EAAE,QAAQ;QACd,YAAY,EAAE,IAAI;QAClB,WAAW,EAAE,4DAA4D;KAC1E,CAAC;SACD,MAAM,CAAC,MAAM,EAAE;QACd,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,8BAA8B;KAC5C,CAAC;IACN,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,IAAI,CAAC;QAE/C,IAAI,CAAC;YACH,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAA,uBAAe,EAAC,UAAU,CAAC,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAClF,MAAM,QAAQ,GAAG,IAAA,+CAA6B,EAAC,GAAG,EAAE,MAAM,CAAC,CAAC;YAE5D,IAAI,IAAI,EAAE,CAAC;gBACT,OAAO,CAAC,GAAG,CAAC,IAAI,C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