@pattern-stack/codegen 0.24.0 → 0.26.0
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/CHANGELOG.md +47 -0
- package/dist/{chunk-2VHZ7EKC.js → chunk-5AAA4LTE.js} +2 -2
- package/dist/{chunk-CKLM57IE.js → chunk-AC6T2JUX.js} +14 -14
- package/dist/{chunk-AS3NAZB6.js → chunk-B7SC2V45.js} +2 -2
- package/dist/{chunk-4MVGAMUA.js → chunk-BK5ICA2F.js} +4 -4
- package/dist/{chunk-W72PRNJY.js → chunk-BPYZCEHS.js} +2 -2
- package/dist/{chunk-J7JMVS2B.js → chunk-CZQUOIDY.js} +4 -4
- package/dist/{chunk-KYR3B3OW.js → chunk-DAHWN63L.js} +26 -5
- package/dist/chunk-DAHWN63L.js.map +1 -0
- package/dist/{chunk-37PILMIT.js → chunk-EEGVDRZE.js} +4 -4
- package/dist/{chunk-RFH7N6EP.js → chunk-FCPTHS42.js} +2 -2
- package/dist/chunk-H6QRQUAF.js +54 -0
- package/dist/chunk-H6QRQUAF.js.map +1 -0
- package/dist/{chunk-ENAR3F5S.js → chunk-HEOISQ6W.js} +6 -6
- package/dist/{chunk-CDLWYZVQ.js → chunk-IN3EWFB4.js} +4 -4
- package/dist/{chunk-WZOPWQN2.js → chunk-IXAE6BN6.js} +3 -3
- package/dist/{chunk-YULGWXCY.js → chunk-MVKW2BCR.js} +4 -4
- package/dist/{chunk-KFXXOFDC.js → chunk-N43D57AP.js} +2 -2
- package/dist/{chunk-JYBFPNBJ.js → chunk-SJGEBMJT.js} +2 -2
- package/dist/{chunk-HN5HT5WL.js → chunk-VI2VNA6Y.js} +4 -4
- package/dist/runtime/base-classes/activity-entity-service.js +3 -3
- package/dist/runtime/base-classes/base-service.js +2 -2
- package/dist/runtime/base-classes/index.js +6 -6
- package/dist/runtime/base-classes/integrated-entity-service.js +3 -3
- package/dist/runtime/base-classes/knowledge-entity-service.js +3 -3
- package/dist/runtime/base-classes/lifecycle-events.js +1 -1
- package/dist/runtime/base-classes/metadata-entity-service.js +3 -3
- package/dist/runtime/shared/logging/compact-console-logger.d.ts +55 -0
- package/dist/runtime/shared/logging/compact-console-logger.js +12 -0
- package/dist/runtime/shared/logging/compact-console-logger.js.map +1 -0
- package/dist/runtime/shared/logging/index.d.ts +2 -0
- package/dist/runtime/shared/logging/index.js +12 -0
- package/dist/runtime/shared/logging/index.js.map +1 -0
- package/dist/runtime/subsystems/analytics/analytics.module.js +2 -2
- package/dist/runtime/subsystems/analytics/index.js +4 -4
- package/dist/runtime/subsystems/auth/auth.module.js +1 -1
- package/dist/runtime/subsystems/auth/index.js +3 -3
- package/dist/runtime/subsystems/bridge/bridge-delivery.drizzle-backend.js +2 -2
- package/dist/runtime/subsystems/bridge/bridge-outbox-drain-hook.js +1 -1
- package/dist/runtime/subsystems/bridge/bridge.module.js +11 -11
- package/dist/runtime/subsystems/bridge/index.js +13 -13
- package/dist/runtime/subsystems/index.js +49 -49
- package/dist/runtime/subsystems/integration/index.js +12 -12
- package/dist/runtime/subsystems/integration/integration-run-recorder.drizzle-backend.js +2 -2
- package/dist/runtime/subsystems/integration/integration.module.js +3 -3
- package/dist/runtime/subsystems/jobs/index.js +24 -24
- package/dist/runtime/subsystems/jobs/job-orchestrator.bullmq-backend.js +4 -4
- package/dist/runtime/subsystems/jobs/job-run-service.memory-backend.js +2 -2
- package/dist/runtime/subsystems/jobs/job-worker.module.js +8 -8
- package/dist/runtime/subsystems/jobs/jobs-domain.module.js +7 -7
- package/dist/runtime/subsystems/observability/index.js +2 -2
- package/dist/runtime/subsystems/observability/observability.module.js +2 -2
- package/dist/runtime/subsystems/storage/index.js +4 -4
- package/dist/runtime/subsystems/storage/storage.module.js +2 -2
- package/dist/src/cli/index.js +101 -31
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/index.js +4 -4
- package/package.json +5 -1
- package/runtime/base-classes/lifecycle-events.ts +39 -6
- package/runtime/shared/logging/compact-console-logger.ts +102 -0
- package/runtime/shared/logging/index.ts +10 -0
- package/templates/subsystem/jobs/job-orchestration.schema.ejs.t +1 -0
- package/templates/subsystem/jobs/main-hook.ejs.t +1 -1
- package/templates/subsystem/jobs/prompt.js +40 -2
- package/templates/subsystem/jobs/worker.ejs.t +47 -35
- package/dist/chunk-KYR3B3OW.js.map +0 -1
- /package/dist/{chunk-2VHZ7EKC.js.map → chunk-5AAA4LTE.js.map} +0 -0
- /package/dist/{chunk-CKLM57IE.js.map → chunk-AC6T2JUX.js.map} +0 -0
- /package/dist/{chunk-AS3NAZB6.js.map → chunk-B7SC2V45.js.map} +0 -0
- /package/dist/{chunk-4MVGAMUA.js.map → chunk-BK5ICA2F.js.map} +0 -0
- /package/dist/{chunk-W72PRNJY.js.map → chunk-BPYZCEHS.js.map} +0 -0
- /package/dist/{chunk-J7JMVS2B.js.map → chunk-CZQUOIDY.js.map} +0 -0
- /package/dist/{chunk-37PILMIT.js.map → chunk-EEGVDRZE.js.map} +0 -0
- /package/dist/{chunk-RFH7N6EP.js.map → chunk-FCPTHS42.js.map} +0 -0
- /package/dist/{chunk-ENAR3F5S.js.map → chunk-HEOISQ6W.js.map} +0 -0
- /package/dist/{chunk-CDLWYZVQ.js.map → chunk-IN3EWFB4.js.map} +0 -0
- /package/dist/{chunk-WZOPWQN2.js.map → chunk-IXAE6BN6.js.map} +0 -0
- /package/dist/{chunk-YULGWXCY.js.map → chunk-MVKW2BCR.js.map} +0 -0
- /package/dist/{chunk-KFXXOFDC.js.map → chunk-N43D57AP.js.map} +0 -0
- /package/dist/{chunk-JYBFPNBJ.js.map → chunk-SJGEBMJT.js.map} +0 -0
- /package/dist/{chunk-HN5HT5WL.js.map → chunk-VI2VNA6Y.js.map} +0 -0
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
JOB_WORKER_MODULE_OPTIONS,
|
|
3
3
|
JobWorkerModule,
|
|
4
4
|
JobWorkerOrchestrator
|
|
5
|
-
} from "../../../chunk-
|
|
5
|
+
} from "../../../chunk-HEOISQ6W.js";
|
|
6
6
|
import "../../../chunk-7B7MMDOJ.js";
|
|
7
|
-
import "../../../chunk-
|
|
7
|
+
import "../../../chunk-AC6T2JUX.js";
|
|
8
|
+
import "../../../chunk-VQOAATIG.js";
|
|
9
|
+
import "../../../chunk-PNZSGAB2.js";
|
|
8
10
|
import "../../../chunk-3VEVGL74.js";
|
|
9
|
-
import "../../../chunk-
|
|
11
|
+
import "../../../chunk-IN3EWFB4.js";
|
|
12
|
+
import "../../../chunk-SNQ3TOWP.js";
|
|
10
13
|
import "../../../chunk-L3LZWWSX.js";
|
|
11
14
|
import "../../../chunk-DV4RV2DC.js";
|
|
12
|
-
import "../../../chunk-I6MVCB5A.js";
|
|
13
|
-
import "../../../chunk-RHVN6NA7.js";
|
|
14
15
|
import "../../../chunk-E6PLM6QG.js";
|
|
15
|
-
import "../../../chunk-VQOAATIG.js";
|
|
16
|
-
import "../../../chunk-PNZSGAB2.js";
|
|
17
|
-
import "../../../chunk-SNQ3TOWP.js";
|
|
18
16
|
import "../../../chunk-T4BIIU5E.js";
|
|
17
|
+
import "../../../chunk-I6MVCB5A.js";
|
|
18
|
+
import "../../../chunk-RHVN6NA7.js";
|
|
19
19
|
import "../../../chunk-Q6LRJ4VI.js";
|
|
20
20
|
import "../../../chunk-7P5ODGLA.js";
|
|
21
21
|
import "../../../chunk-ZPL74UQN.js";
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
JobsDomainModule
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-AC6T2JUX.js";
|
|
4
|
+
import "../../../chunk-VQOAATIG.js";
|
|
5
|
+
import "../../../chunk-PNZSGAB2.js";
|
|
4
6
|
import "../../../chunk-3VEVGL74.js";
|
|
5
|
-
import "../../../chunk-
|
|
7
|
+
import "../../../chunk-IN3EWFB4.js";
|
|
8
|
+
import "../../../chunk-SNQ3TOWP.js";
|
|
6
9
|
import "../../../chunk-L3LZWWSX.js";
|
|
7
10
|
import "../../../chunk-DV4RV2DC.js";
|
|
8
|
-
import "../../../chunk-I6MVCB5A.js";
|
|
9
|
-
import "../../../chunk-RHVN6NA7.js";
|
|
10
11
|
import "../../../chunk-E6PLM6QG.js";
|
|
11
|
-
import "../../../chunk-VQOAATIG.js";
|
|
12
|
-
import "../../../chunk-PNZSGAB2.js";
|
|
13
|
-
import "../../../chunk-SNQ3TOWP.js";
|
|
14
12
|
import "../../../chunk-T4BIIU5E.js";
|
|
13
|
+
import "../../../chunk-I6MVCB5A.js";
|
|
14
|
+
import "../../../chunk-RHVN6NA7.js";
|
|
15
15
|
import "../../../chunk-Q6LRJ4VI.js";
|
|
16
16
|
import "../../../chunk-7P5ODGLA.js";
|
|
17
17
|
import "../../../chunk-ZPL74UQN.js";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
} from "../../../chunk-EWYCWP4H.js";
|
|
6
6
|
import {
|
|
7
7
|
ObservabilityModule
|
|
8
|
-
} from "../../../chunk-
|
|
8
|
+
} from "../../../chunk-EEGVDRZE.js";
|
|
9
9
|
import {
|
|
10
10
|
BridgeMetricsReporter
|
|
11
11
|
} from "../../../chunk-AQFQ4BYM.js";
|
|
12
|
+
import "../../../chunk-PLUJEQLU.js";
|
|
12
13
|
import {
|
|
13
14
|
OBSERVABILITY,
|
|
14
15
|
OBSERVABILITY_MODULE_OPTIONS
|
|
15
16
|
} from "../../../chunk-Y7RRSEOC.js";
|
|
16
|
-
import "../../../chunk-PLUJEQLU.js";
|
|
17
17
|
import "../../../chunk-ZPL74UQN.js";
|
|
18
18
|
import "../../../chunk-H5NH7KPE.js";
|
|
19
19
|
import "../../../chunk-4LH67P4U.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ObservabilityModule
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-EEGVDRZE.js";
|
|
4
4
|
import "../../../chunk-AQFQ4BYM.js";
|
|
5
|
-
import "../../../chunk-Y7RRSEOC.js";
|
|
6
5
|
import "../../../chunk-PLUJEQLU.js";
|
|
6
|
+
import "../../../chunk-Y7RRSEOC.js";
|
|
7
7
|
import "../../../chunk-ZPL74UQN.js";
|
|
8
8
|
import "../../../chunk-H5NH7KPE.js";
|
|
9
9
|
import "../../../chunk-4LH67P4U.js";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import "../../../chunk-ZUMULSEQ.js";
|
|
2
2
|
import {
|
|
3
3
|
StorageModule
|
|
4
|
-
} from "../../../chunk-
|
|
4
|
+
} from "../../../chunk-BK5ICA2F.js";
|
|
5
|
+
import {
|
|
6
|
+
STORAGE
|
|
7
|
+
} from "../../../chunk-NYBCQZC7.js";
|
|
5
8
|
import {
|
|
6
9
|
LocalStorageBackend
|
|
7
10
|
} from "../../../chunk-JWNHNUYL.js";
|
|
8
11
|
import {
|
|
9
12
|
MemoryStorageBackend
|
|
10
13
|
} from "../../../chunk-3SZFUTXE.js";
|
|
11
|
-
import {
|
|
12
|
-
STORAGE
|
|
13
|
-
} from "../../../chunk-NYBCQZC7.js";
|
|
14
14
|
import "../../../chunk-J6MN42LG.js";
|
|
15
15
|
import "../../../chunk-GYGNEQSC.js";
|
|
16
16
|
import "../../../chunk-2E224ZSN.js";
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageModule
|
|
3
|
-
} from "../../../chunk-
|
|
3
|
+
} from "../../../chunk-BK5ICA2F.js";
|
|
4
|
+
import "../../../chunk-NYBCQZC7.js";
|
|
4
5
|
import "../../../chunk-JWNHNUYL.js";
|
|
5
6
|
import "../../../chunk-3SZFUTXE.js";
|
|
6
|
-
import "../../../chunk-NYBCQZC7.js";
|
|
7
7
|
import "../../../chunk-J6MN42LG.js";
|
|
8
8
|
import "../../../chunk-GYGNEQSC.js";
|
|
9
9
|
import "../../../chunk-2E224ZSN.js";
|
package/dist/src/cli/index.js
CHANGED
|
@@ -46,14 +46,15 @@ import {
|
|
|
46
46
|
writeManifest
|
|
47
47
|
} from "../../chunk-K4BQQ2NN.js";
|
|
48
48
|
import "../../chunk-KVOWSC5S.js";
|
|
49
|
+
import "../../chunk-N43D57AP.js";
|
|
49
50
|
import "../../chunk-PRWIX6UW.js";
|
|
50
|
-
import "../../chunk-
|
|
51
|
-
import "../../chunk-HN5HT5WL.js";
|
|
51
|
+
import "../../chunk-VI2VNA6Y.js";
|
|
52
52
|
import "../../chunk-EO2QPOKH.js";
|
|
53
|
+
import "../../chunk-SQDOBLBP.js";
|
|
54
|
+
import "../../chunk-LG57S2SC.js";
|
|
53
55
|
import "../../chunk-LLDJS7PJ.js";
|
|
54
56
|
import "../../chunk-HNWZFNKP.js";
|
|
55
57
|
import "../../chunk-AHV4GDYM.js";
|
|
56
|
-
import "../../chunk-SQDOBLBP.js";
|
|
57
58
|
import "../../chunk-43SBT72G.js";
|
|
58
59
|
import "../../chunk-4MF3HKJA.js";
|
|
59
60
|
import "../../chunk-TIZXQU26.js";
|
|
@@ -66,7 +67,6 @@ import "../../chunk-3CJFPU6Q.js";
|
|
|
66
67
|
import "../../chunk-YIVQ7KLS.js";
|
|
67
68
|
import "../../chunk-S5G3HO7N.js";
|
|
68
69
|
import "../../chunk-MZ6GV4YF.js";
|
|
69
|
-
import "../../chunk-LG57S2SC.js";
|
|
70
70
|
import "../../chunk-U64T4YZE.js";
|
|
71
71
|
import "../../chunk-2E224ZSN.js";
|
|
72
72
|
|
|
@@ -7408,7 +7408,7 @@ function resolveJobsScaffoldLocals(input) {
|
|
|
7408
7408
|
const { cwd, config, fileExists, readFile } = input;
|
|
7409
7409
|
const jobsBlock = config?.jobs ?? {};
|
|
7410
7410
|
const subsystemsRoot = resolveSubsystemsRootFromConfig(cwd, config);
|
|
7411
|
-
const workerPath = path16.resolve(cwd, "worker.ts");
|
|
7411
|
+
const workerPath = path16.resolve(cwd, "src", "worker.ts");
|
|
7412
7412
|
const mainTsPath = path16.resolve(cwd, "src/main.ts");
|
|
7413
7413
|
const configPath = path16.resolve(cwd, "codegen.config.yaml");
|
|
7414
7414
|
const schemaPath = path16.resolve(
|
|
@@ -7426,10 +7426,37 @@ function resolveJobsScaffoldLocals(input) {
|
|
|
7426
7426
|
configPath,
|
|
7427
7427
|
workerExists: fileExists(workerPath),
|
|
7428
7428
|
workerPath,
|
|
7429
|
+
jobWorkerModuleImport: resolveJobWorkerModuleImport(config),
|
|
7430
|
+
workerForRootOpts: resolveWorkerForRootOpts(jobsBlock),
|
|
7429
7431
|
schemaPath,
|
|
7430
|
-
mainHookInjected
|
|
7432
|
+
mainHookInjected,
|
|
7433
|
+
// #517 — in package mode the schema ships in the package (consumed via the
|
|
7434
|
+
// schema barrel), so the template is skipped; vendored mode renders it.
|
|
7435
|
+
skipSchema: resolveRuntimeMode(config) === "package"
|
|
7431
7436
|
};
|
|
7432
7437
|
}
|
|
7438
|
+
function resolveJobWorkerModuleImport(config) {
|
|
7439
|
+
return runtimeImport(resolveRuntimeMode(config), "subsystems/jobs/index");
|
|
7440
|
+
}
|
|
7441
|
+
function resolveWorkerForRootOpts(jobsBlock) {
|
|
7442
|
+
const backend = jobsBlock.backend ?? "drizzle";
|
|
7443
|
+
const parts = [`mode: 'standalone'`];
|
|
7444
|
+
if (backend === "bullmq") {
|
|
7445
|
+
parts.push(`backend: 'bullmq'`);
|
|
7446
|
+
const bullExt = jobsBlock.extensions?.bullmq;
|
|
7447
|
+
if (bullExt) {
|
|
7448
|
+
parts.push(`domainModuleExtensions: { bullmq: ${jsonToTs(bullExt)} }`);
|
|
7449
|
+
}
|
|
7450
|
+
} else {
|
|
7451
|
+
const workerExtClause = drizzleExtensionsClause(
|
|
7452
|
+
drizzleJobsExtensions(backend, jobsBlock),
|
|
7453
|
+
"domainModuleExtensions"
|
|
7454
|
+
);
|
|
7455
|
+
if (workerExtClause) parts.push(workerExtClause);
|
|
7456
|
+
}
|
|
7457
|
+
parts.push(`allPools: true`);
|
|
7458
|
+
return `{ ${parts.join(", ")} }`;
|
|
7459
|
+
}
|
|
7433
7460
|
function normaliseWorkerMode(raw) {
|
|
7434
7461
|
if (raw === "standalone") return "standalone";
|
|
7435
7462
|
return "embedded";
|
|
@@ -7437,6 +7464,9 @@ function normaliseWorkerMode(raw) {
|
|
|
7437
7464
|
function normaliseMultiTenant2(raw) {
|
|
7438
7465
|
return raw === true;
|
|
7439
7466
|
}
|
|
7467
|
+
function encodeWorkerForRootOpts(opts) {
|
|
7468
|
+
return Buffer.from(opts, "utf-8").toString("base64");
|
|
7469
|
+
}
|
|
7440
7470
|
function localsToHygenArgs2(locals) {
|
|
7441
7471
|
return [
|
|
7442
7472
|
"--appName",
|
|
@@ -7453,10 +7483,19 @@ function localsToHygenArgs2(locals) {
|
|
|
7453
7483
|
workerSkipValue(locals.workerExists),
|
|
7454
7484
|
"--workerPath",
|
|
7455
7485
|
locals.workerPath,
|
|
7486
|
+
"--jobWorkerModuleImport",
|
|
7487
|
+
locals.jobWorkerModuleImport,
|
|
7488
|
+
"--workerForRootOpts",
|
|
7489
|
+
encodeWorkerForRootOpts(locals.workerForRootOpts),
|
|
7456
7490
|
"--schemaPath",
|
|
7457
7491
|
locals.schemaPath,
|
|
7458
7492
|
"--mainHookInjected",
|
|
7459
|
-
workerSkipValue(locals.mainHookInjected)
|
|
7493
|
+
workerSkipValue(locals.mainHookInjected),
|
|
7494
|
+
// #517 — boolean-ish for `skip_if` (same '' / 'true' encoding as
|
|
7495
|
+
// workerExists / mainHookInjected). 'true' in package mode → the schema
|
|
7496
|
+
// template is skipped (the package ships the schema).
|
|
7497
|
+
"--skipSchema",
|
|
7498
|
+
workerSkipValue(locals.skipSchema)
|
|
7460
7499
|
];
|
|
7461
7500
|
}
|
|
7462
7501
|
|
|
@@ -8314,6 +8353,12 @@ var SubsystemInstallCommand = class extends Command3 {
|
|
|
8314
8353
|
return 1;
|
|
8315
8354
|
}
|
|
8316
8355
|
if (this.dryRun) {
|
|
8356
|
+
const jobsScaffoldDryRun = desc.name === "jobs" ? runJobsScaffold(ctx.cwd, ctx.config, {
|
|
8357
|
+
dryRun: true,
|
|
8358
|
+
json: isJsonMode(),
|
|
8359
|
+
forceConfig: this.forceConfig,
|
|
8360
|
+
skipConfigBlock: true
|
|
8361
|
+
}) : null;
|
|
8317
8362
|
if (isJsonMode()) {
|
|
8318
8363
|
printJson({
|
|
8319
8364
|
command: "subsystem install",
|
|
@@ -8321,7 +8366,8 @@ var SubsystemInstallCommand = class extends Command3 {
|
|
|
8321
8366
|
runtime: "package",
|
|
8322
8367
|
dryRun: true,
|
|
8323
8368
|
installList: already ? installed : [...installed, desc.name],
|
|
8324
|
-
configBlockOutcome
|
|
8369
|
+
configBlockOutcome,
|
|
8370
|
+
...jobsScaffoldDryRun ? { scaffold: jobsScaffoldDryRun } : {}
|
|
8325
8371
|
});
|
|
8326
8372
|
} else {
|
|
8327
8373
|
printInfo(`Dry run \u2014 runtime: package (no files vendored).`);
|
|
@@ -8330,6 +8376,14 @@ var SubsystemInstallCommand = class extends Command3 {
|
|
|
8330
8376
|
printInfo(` ${desc.name} config block would be ${configBlockOutcome}`);
|
|
8331
8377
|
}
|
|
8332
8378
|
printInfo(" would regenerate <generated>/subsystems.ts + subsystems-schema.ts");
|
|
8379
|
+
if (jobsScaffoldDryRun?.planned?.length) {
|
|
8380
|
+
printInfo(
|
|
8381
|
+
` jobs scaffold \u2014 ${jobsScaffoldDryRun.planned.length} template targets (worker + main.ts hook; schema ships in the package)`
|
|
8382
|
+
);
|
|
8383
|
+
for (const p of jobsScaffoldDryRun.planned) {
|
|
8384
|
+
console.log(` ${theme.muted(icons.arrow)} ${path24.relative(ctx.cwd, p) || p}`);
|
|
8385
|
+
}
|
|
8386
|
+
}
|
|
8333
8387
|
}
|
|
8334
8388
|
return 0;
|
|
8335
8389
|
}
|
|
@@ -8374,6 +8428,12 @@ var SubsystemInstallCommand = class extends Command3 {
|
|
|
8374
8428
|
const msg = err instanceof Error ? err.message : String(err);
|
|
8375
8429
|
printWarning(`barrel regeneration failed \u2014 ${msg}`);
|
|
8376
8430
|
}
|
|
8431
|
+
const jobsScaffold = desc.name === "jobs" ? runJobsScaffold(ctx.cwd, refreshed.config, {
|
|
8432
|
+
dryRun: false,
|
|
8433
|
+
json: isJsonMode(),
|
|
8434
|
+
forceConfig: this.forceConfig,
|
|
8435
|
+
skipConfigBlock: true
|
|
8436
|
+
}) : null;
|
|
8377
8437
|
if (isJsonMode()) {
|
|
8378
8438
|
printJson({
|
|
8379
8439
|
command: "subsystem install",
|
|
@@ -8385,7 +8445,8 @@ var SubsystemInstallCommand = class extends Command3 {
|
|
|
8385
8445
|
installOutcome: installResult.outcome,
|
|
8386
8446
|
configBlockOutcome,
|
|
8387
8447
|
barrelEmitted,
|
|
8388
|
-
schemaEmitted
|
|
8448
|
+
schemaEmitted,
|
|
8449
|
+
...jobsScaffold ? { scaffold: jobsScaffold } : {}
|
|
8389
8450
|
});
|
|
8390
8451
|
return 0;
|
|
8391
8452
|
}
|
|
@@ -8393,6 +8454,17 @@ var SubsystemInstallCommand = class extends Command3 {
|
|
|
8393
8454
|
if (installResult.outcome === "added") {
|
|
8394
8455
|
printInfo(`Added '${desc.name}' to subsystems.install.`);
|
|
8395
8456
|
}
|
|
8457
|
+
if (jobsScaffold) {
|
|
8458
|
+
if (jobsScaffold.ok) {
|
|
8459
|
+
printSuccess(
|
|
8460
|
+
`jobs scaffold applied (emitted src/worker.ts + src/main.ts hook; schema ships in the package).`
|
|
8461
|
+
);
|
|
8462
|
+
} else {
|
|
8463
|
+
printWarning(
|
|
8464
|
+
`jobs scaffold (Hygen) failed \u2014 config + barrels were written; re-run after fixing: ${jobsScaffold.error ?? "unknown error"}`
|
|
8465
|
+
);
|
|
8466
|
+
}
|
|
8467
|
+
}
|
|
8396
8468
|
printInfo(
|
|
8397
8469
|
`Regenerated <generated>/subsystems.ts (${barrelEmitted.join(", ") || "none"}) + subsystems-schema.ts (${schemaEmitted.join(", ") || "none"}).`
|
|
8398
8470
|
);
|
|
@@ -8622,14 +8694,10 @@ function runJobsScaffold(cwd, config, opts) {
|
|
|
8622
8694
|
const planned = [
|
|
8623
8695
|
...!locals.workerExists ? [locals.workerPath] : [],
|
|
8624
8696
|
locals.mainTsPath,
|
|
8625
|
-
locals.configPath,
|
|
8626
|
-
locals.schemaPath
|
|
8697
|
+
...opts.skipConfigBlock ? [] : [locals.configPath],
|
|
8698
|
+
...locals.skipSchema ? [] : [locals.schemaPath]
|
|
8627
8699
|
];
|
|
8628
|
-
const configBlockOutcome = planConfigBlockAction(
|
|
8629
|
-
locals.configPath,
|
|
8630
|
-
"jobs",
|
|
8631
|
-
opts.forceConfig
|
|
8632
|
-
);
|
|
8700
|
+
const configBlockOutcome = opts.skipConfigBlock ? void 0 : planConfigBlockAction(locals.configPath, "jobs", opts.forceConfig);
|
|
8633
8701
|
if (configBlockOutcome === "parse-error") {
|
|
8634
8702
|
return { ok: false, planned, configBlockOutcome };
|
|
8635
8703
|
}
|
|
@@ -8652,21 +8720,23 @@ function runJobsScaffold(cwd, config, opts) {
|
|
|
8652
8720
|
configBlockOutcome
|
|
8653
8721
|
};
|
|
8654
8722
|
}
|
|
8655
|
-
|
|
8656
|
-
|
|
8657
|
-
|
|
8658
|
-
|
|
8659
|
-
|
|
8660
|
-
|
|
8661
|
-
|
|
8662
|
-
|
|
8663
|
-
|
|
8664
|
-
|
|
8665
|
-
|
|
8666
|
-
|
|
8667
|
-
|
|
8668
|
-
|
|
8669
|
-
|
|
8723
|
+
if (!opts.skipConfigBlock && configBlockOutcome) {
|
|
8724
|
+
const configResult = runConfigBlockAction({
|
|
8725
|
+
cwd,
|
|
8726
|
+
actionFolder: "jobs-config",
|
|
8727
|
+
configPath: locals.configPath,
|
|
8728
|
+
subsystem: "jobs",
|
|
8729
|
+
outcome: configBlockOutcome,
|
|
8730
|
+
json: opts.json
|
|
8731
|
+
});
|
|
8732
|
+
if (!configResult.ok) {
|
|
8733
|
+
return {
|
|
8734
|
+
ok: false,
|
|
8735
|
+
planned,
|
|
8736
|
+
error: configResult.error,
|
|
8737
|
+
configBlockOutcome
|
|
8738
|
+
};
|
|
8739
|
+
}
|
|
8670
8740
|
}
|
|
8671
8741
|
return { ok: true, planned, configBlockOutcome };
|
|
8672
8742
|
}
|