@stacksjs/actions 0.70.87 → 0.70.90
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/action.js +78 -2
- package/dist/actions.js +2 -2
- package/dist/add.js +20 -2
- package/dist/ai/request-model-access.js +10 -2
- package/dist/auth/client.js +44 -3
- package/dist/auth/prune.js +35 -2
- package/dist/auth/setup.js +152 -36
- package/dist/auth/token.js +10 -2
- package/dist/blog-admin.d.ts +55 -0
- package/dist/blog-admin.js +156 -0
- package/dist/blog.d.ts +11 -0
- package/dist/blog.js +306 -56
- package/dist/build/cli.js +6 -2
- package/dist/build/component-libs.js +7 -2
- package/dist/build/core.js +55 -2
- package/dist/build/desktop.js +5 -2
- package/dist/build/docs.js +5 -2
- package/dist/build/frontend-static.js +123 -8
- package/dist/build/server.js +6 -2
- package/dist/build/stacks.js +8 -2
- package/dist/build/views.js +11 -2
- package/dist/build.js +64 -2
- package/dist/bump.js +162 -7
- package/dist/cdn/invalidate-cache.js +0 -1
- package/dist/changelog.js +27 -3
- package/dist/check/ports.js +16 -2
- package/dist/clean.js +4 -2
- package/dist/commit.js +12 -2
- package/dist/copy-types.js +10 -3
- package/dist/database/seed.js +26 -2
- package/dist/deploy/create-receipt-rule.js +36 -2
- package/dist/deploy/index.js +1318 -44
- package/dist/dev/api.js +94 -6
- package/dist/dev/components.js +7 -2
- package/dist/dev/dashboard-globals.js +89 -3
- package/dist/dev/dashboard-utils.js +380 -2
- package/dist/dev/dashboard.js +435 -8
- package/dist/dev/desktop.js +5 -2
- package/dist/dev/docs.js +24 -2
- package/dist/dev/index.js +29 -2
- package/dist/dev/migrate-watcher.js +74 -2
- package/dist/dev/system-tray.js +5 -2
- package/dist/dev/views.js +147 -2
- package/dist/discover-packages.js +32 -2
- package/dist/domains/add.js +61 -2
- package/dist/domains/purchase.js +66 -2
- package/dist/domains/remove.js +24 -2
- package/dist/examples.js +34 -2
- package/dist/find-projects.js +16 -2
- package/dist/fresh.js +17 -2
- package/dist/generate/action-types.js +9 -4
- package/dist/generate/component-meta.js +9 -3
- package/dist/generate/custom-cli-file.js +20 -3
- package/dist/generate/env-files.js +46 -6
- package/dist/generate/ide-helpers.js +8 -3
- package/dist/generate/index.js +158 -2
- package/dist/generate/lib-entries.js +16 -3
- package/dist/generate/pantry-file.js +46 -2
- package/dist/generate/symlink-core.js +2 -2
- package/dist/generate/types.js +3 -2
- package/dist/generate/vscode-custom-data.js +9 -3
- package/dist/generate/web-types.js +0 -1
- package/dist/helpers/component-meta.js +295 -2
- package/dist/helpers/index.js +1 -2
- package/dist/helpers/lib-entries.js +73 -2
- package/dist/helpers/package-json.js +45 -14
- package/dist/helpers/utils.js +105 -2
- package/dist/helpers/vscode-custom-data.js +30 -2
- package/dist/index.d.ts +13 -0
- package/dist/index.js +50 -2
- package/dist/key-generate.js +24 -2
- package/dist/lint/fix.js +4 -3
- package/dist/lint/index.js +4 -3
- package/dist/lint/lint.js +34 -2
- package/dist/make-command.js +64 -14
- package/dist/make-job.js +41 -16
- package/dist/make-policy.js +74 -26
- package/dist/make-resource.js +50 -21
- package/dist/make.js +328 -2
- package/dist/migrate/database.js +16 -2
- package/dist/migrate/fresh.js +31 -2
- package/dist/orm/base.js +0 -2
- package/dist/orm/test.js +0 -1
- package/dist/prepublish.js +16 -2
- package/dist/queue/clear.js +42 -2
- package/dist/queue/dlq-purge.js +28 -2
- package/dist/queue/dlq-retry.js +35 -2
- package/dist/queue/dlq.js +55 -5
- package/dist/queue/failed.js +69 -5
- package/dist/queue/flush.js +49 -3
- package/dist/queue/inspect.js +154 -8
- package/dist/queue/list.js +69 -5
- package/dist/queue/monitor.js +94 -6
- package/dist/queue/pause.js +28 -2
- package/dist/queue/quarantine.js +42 -3
- package/dist/queue/resume.js +27 -2
- package/dist/queue/retry.js +41 -2
- package/dist/queue/schedule-list.js +33 -5
- package/dist/queue/schedule.js +12 -2
- package/dist/queue/status.js +68 -5
- package/dist/queue/table.js +10 -2
- package/dist/queue/unquarantine.js +27 -2
- package/dist/queue/work.js +57 -2
- package/dist/release.js +21 -3
- package/dist/route/list.js +78 -3
- package/dist/run-action.js +1 -2
- package/dist/saas/setup.js +9 -2
- package/dist/scaffold-crud.js +164 -40
- package/dist/schedule/run.js +7 -2
- package/dist/search/flush.js +10 -2
- package/dist/search/import.js +10 -2
- package/dist/search/settings-list.js +10 -2
- package/dist/search/settings.js +9 -2
- package/dist/serve/api.js +35 -2
- package/dist/setup/index.js +1 -2
- package/dist/setup/ssl.js +271 -2
- package/dist/stacks.js +265 -2
- package/dist/templates.js +301 -2
- package/dist/test/feature.js +11 -2
- package/dist/test/index.js +11 -2
- package/dist/test/ui.js +4 -2
- package/dist/test/unit.js +11 -2
- package/dist/typecheck.js +4 -2
- package/dist/types.js +16 -2
- package/dist/upgrade/binary.js +29 -2
- package/dist/upgrade/bun.js +0 -1
- package/dist/upgrade/dependencies.js +0 -2
- package/dist/upgrade/framework-utils.js +193 -2
- package/dist/upgrade/framework.js +310 -7
- package/dist/upgrade/index.js +17 -2
- package/dist/upgrade/packages.js +99 -12
- package/dist/upgrade/shell.js +40 -4
- package/dist/upgrade.js +38 -2
- package/package.json +16 -16
- package/dist/chunk-0c8sd1t6.js +0 -2
- package/dist/chunk-0g2nzhx9.js +0 -240
- package/dist/chunk-0gadhvn7.js +0 -3
- package/dist/chunk-0h27aa4r.js +0 -93
- package/dist/chunk-3peh8kqs.js +0 -851
- package/dist/chunk-62gdfav8.js +0 -3
- package/dist/chunk-6bk53y02.js +0 -3
- package/dist/chunk-78c5n3s2.js +0 -3
- package/dist/chunk-c74qv38e.js +0 -17
- package/dist/chunk-cdk2r2jd.js +0 -1
- package/dist/chunk-dbz9dp2h.js +0 -3
- package/dist/chunk-e142dheq.js +0 -3
- package/dist/chunk-ec4gky40.js +0 -3
- package/dist/chunk-h3d81wrg.js +0 -3
- package/dist/chunk-m3q0x4h0.js +0 -688
- package/dist/chunk-mqgbyhph.js +0 -5
- package/dist/chunk-n24m8prb.js +0 -3
- package/dist/chunk-n5eqwhck.js +0 -7
- package/dist/chunk-nsvnqv8y.js +0 -5
- package/dist/chunk-nty6mmx4.js +0 -283
- package/dist/chunk-s735m9mg.js +0 -1
- package/dist/chunk-tpb8jgsk.js +0 -7
- package/dist/chunk-tsbk5vne.js +0 -3
- package/dist/chunk-xg9xscqz.js +0 -1
- package/dist/chunk-y6e448he.js +0 -7
package/dist/queue/monitor.js
CHANGED
|
@@ -1,7 +1,95 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { Job, FailedJob } from "@stacksjs/orm";
|
|
4
|
+
import { getActiveJobCount, isWorkerRunning } from "@stacksjs/queue";
|
|
5
|
+
const options = parseArgs(), queueName = options.queue, refreshInterval = Number(options.interval) || 2000;
|
|
6
|
+
let isRunning = !0;
|
|
7
|
+
process.on("SIGINT", () => {
|
|
8
|
+
isRunning = !1;
|
|
9
|
+
console.log(`
|
|
3
10
|
|
|
4
|
-
Monitoring stopped.`)
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
Monitoring stopped.`);
|
|
12
|
+
process.exit(0);
|
|
13
|
+
});
|
|
14
|
+
process.on("SIGTERM", () => {
|
|
15
|
+
isRunning = !1;
|
|
16
|
+
process.exit(0);
|
|
17
|
+
});
|
|
18
|
+
async function getStats() {
|
|
19
|
+
const allJobs = queueName ? await Job.where("queue", queueName).get() : await Job.all(), failedJobs = queueName ? await FailedJob.where("queue", queueName).get() : await FailedJob.all(), now = Math.floor(Date.now() / 1000);
|
|
20
|
+
let pending = 0, processing = 0, delayed = 0;
|
|
21
|
+
for (const job of allJobs)
|
|
22
|
+
if (job.reserved_at)
|
|
23
|
+
processing++;
|
|
24
|
+
else if (job.available_at && Number(job.available_at) > now)
|
|
25
|
+
delayed++;
|
|
26
|
+
else
|
|
27
|
+
pending++;
|
|
28
|
+
return {
|
|
29
|
+
pending,
|
|
30
|
+
processing,
|
|
31
|
+
delayed,
|
|
32
|
+
failed: failedJobs.length,
|
|
33
|
+
total: allJobs.length,
|
|
34
|
+
workerRunning: isWorkerRunning(),
|
|
35
|
+
activeJobs: getActiveJobCount()
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
async function displayStats() {
|
|
39
|
+
const stats = await getStats(), timestamp = new Date().toLocaleTimeString();
|
|
40
|
+
console.clear();
|
|
41
|
+
console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");
|
|
42
|
+
console.log("\u2502 Queue Monitor \u2502");
|
|
43
|
+
console.log("\u2502 Press Ctrl+C to exit \u2502");
|
|
44
|
+
console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
|
|
45
|
+
console.log(`\u2502 Last Updated: ${timestamp.padEnd(48)} \u2502`);
|
|
46
|
+
console.log(`\u2502 Queue Filter: ${(queueName || "All Queues").padEnd(48)} \u2502`);
|
|
47
|
+
console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
|
|
48
|
+
console.log("\u2502 \u2502");
|
|
49
|
+
console.log(`\u2502 Pending Jobs: ${String(stats.pending).padStart(8)} \u2502`);
|
|
50
|
+
console.log(`\u2502 Processing Jobs: ${String(stats.processing).padStart(8)} \u2502`);
|
|
51
|
+
console.log(`\u2502 Delayed Jobs: ${String(stats.delayed).padStart(8)} \u2502`);
|
|
52
|
+
console.log(`\u2502 Failed Jobs: ${String(stats.failed).padStart(8)} \u2502`);
|
|
53
|
+
console.log("\u2502 \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 \u2502");
|
|
54
|
+
console.log(`\u2502 Total Jobs: ${String(stats.total).padStart(8)} \u2502`);
|
|
55
|
+
console.log("\u2502 \u2502");
|
|
56
|
+
console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
|
|
57
|
+
console.log("\u2502 Worker Status \u2502");
|
|
58
|
+
console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
|
|
59
|
+
console.log(`\u2502 Worker Running: ${(stats.workerRunning ? "Yes" : "No").padEnd(8)} \u2502`);
|
|
60
|
+
console.log(`\u2502 Active Jobs: ${String(stats.activeJobs).padStart(8)} \u2502`);
|
|
61
|
+
console.log("\u2502 \u2502");
|
|
62
|
+
console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
|
|
63
|
+
if (stats.failed > 0)
|
|
64
|
+
console.log(`
|
|
65
|
+
\u26A0\uFE0F Warning: ${stats.failed} failed job(s) - run 'buddy queue:failed' for details`);
|
|
66
|
+
if (!stats.workerRunning && stats.pending > 0)
|
|
67
|
+
console.log(`
|
|
68
|
+
\u26A0\uFE0F Warning: Worker not running but ${stats.pending} job(s) pending - run 'buddy queue:work'`);
|
|
69
|
+
}
|
|
70
|
+
try {
|
|
71
|
+
log.info(`Starting queue monitor...
|
|
72
|
+
`);
|
|
73
|
+
await displayStats();
|
|
74
|
+
while (isRunning) {
|
|
75
|
+
await new Promise((resolve) => setTimeout(resolve, refreshInterval));
|
|
76
|
+
if (isRunning)
|
|
77
|
+
await displayStats();
|
|
78
|
+
}
|
|
79
|
+
} catch (error) {
|
|
80
|
+
log.error("Monitor error:", error);
|
|
81
|
+
process.exit(1);
|
|
82
|
+
}
|
|
83
|
+
function parseArgs() {
|
|
84
|
+
const args = {};
|
|
85
|
+
process.argv.forEach((arg) => {
|
|
86
|
+
if (arg.startsWith("--")) {
|
|
87
|
+
const [key, value] = arg.slice(2).split("=");
|
|
88
|
+
if (key && value)
|
|
89
|
+
args[key] = value;
|
|
90
|
+
else if (key)
|
|
91
|
+
args[key] = "true";
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
return args;
|
|
95
|
+
}
|
package/dist/queue/pause.js
CHANGED
|
@@ -1,2 +1,28 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { pauseQueue } from "@stacksjs/queue";
|
|
4
|
+
const options = parseArgs(), queue = options.queue;
|
|
5
|
+
if (!queue) {
|
|
6
|
+
log.error("Usage: buddy queue:pause --queue=<name> [--for=300]");
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
const pauseSeconds = options.for ? Number.parseInt(options.for, 10) : 300;
|
|
10
|
+
try {
|
|
11
|
+
await pauseQueue(queue, pauseSeconds);
|
|
12
|
+
log.success(`Paused queue '${queue}' for ${pauseSeconds}s`);
|
|
13
|
+
process.exit(0);
|
|
14
|
+
} catch (error) {
|
|
15
|
+
log.error("Failed to pause queue", error);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
function parseArgs() {
|
|
19
|
+
const args = {};
|
|
20
|
+
process.argv.forEach((arg) => {
|
|
21
|
+
if (arg.startsWith("--")) {
|
|
22
|
+
const [key, value] = arg.slice(2).split("=");
|
|
23
|
+
if (key && value)
|
|
24
|
+
args[key] = value;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
return args;
|
|
28
|
+
}
|
package/dist/queue/quarantine.js
CHANGED
|
@@ -1,3 +1,42 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { listQuarantined, quarantineJob } from "@stacksjs/queue";
|
|
4
|
+
const options = parseArgs();
|
|
5
|
+
try {
|
|
6
|
+
if (options.add) {
|
|
7
|
+
const jobName = options.add;
|
|
8
|
+
await quarantineJob(jobName);
|
|
9
|
+
log.success(`Quarantined ${jobName}`);
|
|
10
|
+
process.exit(0);
|
|
11
|
+
}
|
|
12
|
+
const rows = await listQuarantined();
|
|
13
|
+
if (rows.length === 0) {
|
|
14
|
+
console.log("\u2713 No jobs currently quarantined");
|
|
15
|
+
process.exit(0);
|
|
16
|
+
}
|
|
17
|
+
console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");
|
|
18
|
+
console.log("\u2502 ID \u2502 Job Name \u2502 Payload Hash \u2502 Failures \u2502 Quarantined At \u2502");
|
|
19
|
+
console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
|
|
20
|
+
for (const row of rows) {
|
|
21
|
+
const id = String(row.id).padEnd(3), jn = (row.job_name || "?").substring(0, 32).padEnd(32), ph = (row.payload_hash || "?").substring(0, 16).padEnd(16), fc = String(row.failure_count ?? 0).padEnd(8), qa = (row.quarantined_at || "N/A").substring(0, 24).padEnd(24);
|
|
22
|
+
console.log(`\u2502 ${id} \u2502 ${jn} \u2502 ${ph} \u2502 ${fc} \u2502 ${qa} \u2502`);
|
|
23
|
+
}
|
|
24
|
+
console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
|
|
25
|
+
console.log(`
|
|
26
|
+
${rows.length} quarantined entrie(s). Use \`queue:unquarantine <JobName>\` to lift.`);
|
|
27
|
+
process.exit(0);
|
|
28
|
+
} catch (error) {
|
|
29
|
+
log.error("Failed to handle queue:quarantine", error);
|
|
30
|
+
process.exit(1);
|
|
31
|
+
}
|
|
32
|
+
function parseArgs() {
|
|
33
|
+
const args = {};
|
|
34
|
+
process.argv.forEach((arg) => {
|
|
35
|
+
if (arg.startsWith("--")) {
|
|
36
|
+
const [key, value] = arg.slice(2).split("=");
|
|
37
|
+
if (key && value)
|
|
38
|
+
args[key] = value;
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
return args;
|
|
42
|
+
}
|
package/dist/queue/resume.js
CHANGED
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { resumeQueue } from "@stacksjs/queue";
|
|
4
|
+
const options = parseArgs(), queue = options.queue;
|
|
5
|
+
if (!queue) {
|
|
6
|
+
log.error("Usage: buddy queue:resume --queue=<name>");
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
await resumeQueue(queue);
|
|
11
|
+
log.success(`Resumed queue '${queue}'`);
|
|
12
|
+
process.exit(0);
|
|
13
|
+
} catch (error) {
|
|
14
|
+
log.error("Failed to resume queue", error);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
function parseArgs() {
|
|
18
|
+
const args = {};
|
|
19
|
+
process.argv.forEach((arg) => {
|
|
20
|
+
if (arg.startsWith("--")) {
|
|
21
|
+
const [key, value] = arg.slice(2).split("=");
|
|
22
|
+
if (key && value)
|
|
23
|
+
args[key] = value;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return args;
|
|
27
|
+
}
|
package/dist/queue/retry.js
CHANGED
|
@@ -1,2 +1,41 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { executeFailedJobs, retryFailedJob } from "@stacksjs/queue";
|
|
4
|
+
const options = parseArgs(), jobId = options.id, all = options.all === "true";
|
|
5
|
+
try {
|
|
6
|
+
if (all) {
|
|
7
|
+
log.info("Retrying all failed jobs...");
|
|
8
|
+
await executeFailedJobs();
|
|
9
|
+
log.success("All failed jobs have been queued for retry");
|
|
10
|
+
} else if (jobId) {
|
|
11
|
+
const id = Number.parseInt(jobId, 10);
|
|
12
|
+
if (Number.isNaN(id)) {
|
|
13
|
+
log.error("Invalid job ID provided");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
log.info(`Retrying failed job ${id}...`);
|
|
17
|
+
await retryFailedJob(id);
|
|
18
|
+
log.success(`Failed job ${id} has been queued for retry`);
|
|
19
|
+
} else {
|
|
20
|
+
log.warn("Please provide a job ID or use --all to retry all failed jobs");
|
|
21
|
+
log.info("Usage: buddy queue:retry <id> or buddy queue:retry --all");
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
process.exit(0);
|
|
25
|
+
} catch (error) {
|
|
26
|
+
log.error("Failed to retry job(s)", error);
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
function parseArgs() {
|
|
30
|
+
const args = {};
|
|
31
|
+
process.argv.forEach((arg) => {
|
|
32
|
+
if (arg.startsWith("--")) {
|
|
33
|
+
const [key, value] = arg.slice(2).split("=");
|
|
34
|
+
if (key && value)
|
|
35
|
+
args[key] = value;
|
|
36
|
+
else if (key)
|
|
37
|
+
args[key] = "true";
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
return args;
|
|
41
|
+
}
|
|
@@ -1,5 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { discoverJobs, getScheduledJobs } from "@stacksjs/queue";
|
|
4
|
+
try {
|
|
5
|
+
log.info(`Discovering scheduled jobs...
|
|
6
|
+
`);
|
|
7
|
+
await discoverJobs();
|
|
8
|
+
const scheduledJobs = getScheduledJobs();
|
|
9
|
+
if (scheduledJobs.length === 0) {
|
|
10
|
+
log.info("No scheduled jobs found.");
|
|
11
|
+
log.info('Tip: Add a "rate" or "schedule" property to your job configuration.');
|
|
12
|
+
process.exit(0);
|
|
13
|
+
}
|
|
14
|
+
console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");
|
|
15
|
+
console.log("\u2502 Job Name \u2502 Schedule \u2502 Queue \u2502 Tries \u2502");
|
|
16
|
+
console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
|
|
17
|
+
for (const job of scheduledJobs) {
|
|
18
|
+
const name = job.name.substring(0, 48).padEnd(48), schedule = (job.config.rate || job.config.schedule || "N/A").substring(0, 21).padEnd(21), queue = (job.config.queue || "default").substring(0, 9).padEnd(9), tries = String(job.config.tries || 3).padStart(7);
|
|
19
|
+
console.log(`\u2502 ${name} \u2502 ${schedule} \u2502 ${queue} \u2502${tries} \u2502`);
|
|
20
|
+
}
|
|
21
|
+
console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
|
|
22
|
+
console.log(`
|
|
23
|
+
Total: ${scheduledJobs.length} scheduled job(s)`);
|
|
24
|
+
console.log(`
|
|
25
|
+
Schedule Formats:`);
|
|
26
|
+
console.log(' \u2022 Cron: "* * * * *" (minute hour day month dayOfWeek)');
|
|
27
|
+
console.log(" \u2022 Presets: @hourly, @daily, @weekly, @monthly");
|
|
28
|
+
console.log(" \u2022 Every: Every.Minute, Every.Hour, Every.Day");
|
|
29
|
+
process.exit(0);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
log.error("Failed to list scheduled jobs:", error);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
package/dist/queue/schedule.js
CHANGED
|
@@ -1,2 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { startScheduler } from "@stacksjs/queue";
|
|
4
|
+
log.info("Starting job scheduler...");
|
|
5
|
+
try {
|
|
6
|
+
await startScheduler();
|
|
7
|
+
log.success("Scheduler is running. Press Ctrl+C to stop.");
|
|
8
|
+
await new Promise(() => {});
|
|
9
|
+
} catch (error) {
|
|
10
|
+
log.error("Failed to start scheduler:", error);
|
|
11
|
+
process.exit(1);
|
|
12
|
+
}
|
package/dist/queue/status.js
CHANGED
|
@@ -1,5 +1,68 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { Job, FailedJob } from "@stacksjs/orm";
|
|
4
|
+
const options = parseArgs(), queueName = options.queue;
|
|
5
|
+
try {
|
|
6
|
+
log.info(`Fetching queue status...
|
|
7
|
+
`);
|
|
8
|
+
const allJobs = queueName ? await Job.where("queue", queueName).get() : await Job.all(), failedJobs = queueName ? await FailedJob.where("queue", queueName).get() : await FailedJob.all(), queueStats = new Map;
|
|
9
|
+
for (const job of allJobs) {
|
|
10
|
+
const queue = job.queue || "default";
|
|
11
|
+
if (!queueStats.has(queue))
|
|
12
|
+
queueStats.set(queue, { pending: 0, processing: 0, delayed: 0 });
|
|
13
|
+
const stats = queueStats.get(queue), now = Math.floor(Date.now() / 1000);
|
|
14
|
+
if (job.reserved_at)
|
|
15
|
+
stats.processing++;
|
|
16
|
+
else if (job.available_at && Number(job.available_at) > now)
|
|
17
|
+
stats.delayed++;
|
|
18
|
+
else
|
|
19
|
+
stats.pending++;
|
|
20
|
+
}
|
|
21
|
+
const failedStats = new Map;
|
|
22
|
+
for (const job of failedJobs) {
|
|
23
|
+
const queue = job.queue || "default";
|
|
24
|
+
failedStats.set(queue, (failedStats.get(queue) || 0) + 1);
|
|
25
|
+
}
|
|
26
|
+
console.log("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510");
|
|
27
|
+
console.log("\u2502 Queue \u2502 Pending \u2502 Processing \u2502 Delayed \u2502 Failed \u2502");
|
|
28
|
+
console.log("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524");
|
|
29
|
+
const allQueues = new Set([...queueStats.keys(), ...failedStats.keys()]);
|
|
30
|
+
if (allQueues.size === 0)
|
|
31
|
+
console.log("\u2502 No queues found \u2502");
|
|
32
|
+
else
|
|
33
|
+
for (const queue of allQueues) {
|
|
34
|
+
const stats = queueStats.get(queue) || { pending: 0, processing: 0, delayed: 0 }, failed = failedStats.get(queue) || 0, queueDisplay = queue.substring(0, 48).padEnd(48), pendingDisplay = String(stats.pending).padStart(8), processingDisplay = String(stats.processing).padStart(10), delayedDisplay = String(stats.delayed).padStart(8), failedDisplay = String(failed).padStart(6);
|
|
35
|
+
console.log(`\u2502 ${queueDisplay} \u2502${pendingDisplay} \u2502${processingDisplay} \u2502${delayedDisplay} \u2502${failedDisplay} \u2502`);
|
|
36
|
+
}
|
|
37
|
+
console.log("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
|
|
38
|
+
const totalPending = Array.from(queueStats.values()).reduce((sum, s) => sum + s.pending, 0), totalProcessing = Array.from(queueStats.values()).reduce((sum, s) => sum + s.processing, 0), totalDelayed = Array.from(queueStats.values()).reduce((sum, s) => sum + s.delayed, 0), totalFailed = Array.from(failedStats.values()).reduce((sum, n) => sum + n, 0);
|
|
39
|
+
console.log(`
|
|
40
|
+
Summary:`);
|
|
41
|
+
console.log(` Pending: ${totalPending}`);
|
|
42
|
+
console.log(` Processing: ${totalProcessing}`);
|
|
43
|
+
console.log(` Delayed: ${totalDelayed}`);
|
|
44
|
+
console.log(` Failed: ${totalFailed}`);
|
|
45
|
+
console.log(` Total: ${totalPending + totalProcessing + totalDelayed + totalFailed}`);
|
|
46
|
+
process.exit(0);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
49
|
+
if (/no such table:\s*(?:jobs|failed_jobs)\b/i.test(message)) {
|
|
50
|
+
process.stdout.write(`Queue tables are not set up yet.
|
|
51
|
+
`);
|
|
52
|
+
process.stdout.write("Run `buddy queue:table` to create the migrations, then `buddy migrate` to apply them.\n");
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
55
|
+
log.error("Failed to get queue status", error);
|
|
56
|
+
process.exit(1);
|
|
57
|
+
}
|
|
58
|
+
function parseArgs() {
|
|
59
|
+
const args = {};
|
|
60
|
+
process.argv.forEach((arg) => {
|
|
61
|
+
if (arg.startsWith("--")) {
|
|
62
|
+
const [key, value] = arg.slice(2).split("=");
|
|
63
|
+
if (key && value)
|
|
64
|
+
args[key] = value;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
return args;
|
|
68
|
+
}
|
package/dist/queue/table.js
CHANGED
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { createJobsMigration } from "@stacksjs/database";
|
|
3
|
+
import { log } from "@stacksjs/logging";
|
|
4
|
+
const result = await createJobsMigration();
|
|
5
|
+
if (result?.isErr) {
|
|
6
|
+
console.error(result.error);
|
|
7
|
+
log.error("generateMigrations failed", result.error);
|
|
8
|
+
process.exit(1);
|
|
9
|
+
}
|
|
10
|
+
process.exit(0);
|
|
@@ -1,2 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { unquarantineJob } from "@stacksjs/queue";
|
|
4
|
+
const options = parseArgs(), jobName = options.name;
|
|
5
|
+
if (!jobName) {
|
|
6
|
+
log.error("Usage: buddy queue:unquarantine --name=<JobName>");
|
|
7
|
+
process.exit(1);
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
await unquarantineJob(jobName);
|
|
11
|
+
log.success(`Lifted quarantine for ${jobName}`);
|
|
12
|
+
process.exit(0);
|
|
13
|
+
} catch (error) {
|
|
14
|
+
log.error("Failed to unquarantine", error);
|
|
15
|
+
process.exit(1);
|
|
16
|
+
}
|
|
17
|
+
function parseArgs() {
|
|
18
|
+
const args = {};
|
|
19
|
+
process.argv.forEach((arg) => {
|
|
20
|
+
if (arg.startsWith("--")) {
|
|
21
|
+
const [key, value] = arg.slice(2).split("=");
|
|
22
|
+
if (key && value)
|
|
23
|
+
args[key] = value;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
return args;
|
|
27
|
+
}
|
package/dist/queue/work.js
CHANGED
|
@@ -1,2 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { log } from "@stacksjs/logging";
|
|
3
|
+
import { startProcessor, stopProcessor } from "@stacksjs/queue";
|
|
4
|
+
process.on("unhandledRejection", (reason) => {
|
|
5
|
+
log.error(`Unhandled Rejection in queue worker: ${reason}`);
|
|
6
|
+
});
|
|
7
|
+
process.on("uncaughtException", (error) => {
|
|
8
|
+
log.error(`Uncaught Exception in queue worker: ${error.message}`);
|
|
9
|
+
});
|
|
10
|
+
const SHUTDOWN_GRACE_MS = Number(process.env.STACKS_QUEUE_SHUTDOWN_GRACE_MS) || 1e4;
|
|
11
|
+
let shuttingDown = !1;
|
|
12
|
+
async function gracefulShutdown(signal) {
|
|
13
|
+
if (shuttingDown)
|
|
14
|
+
return;
|
|
15
|
+
shuttingDown = !0;
|
|
16
|
+
log.info(`[queue] Worker received ${signal}, draining in-flight jobs (max ${SHUTDOWN_GRACE_MS / 1000}s)\u2026`);
|
|
17
|
+
setTimeout(() => {
|
|
18
|
+
log.warn("[queue] Drain window exceeded \u2014 forcing worker exit.");
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}, SHUTDOWN_GRACE_MS + 2000).unref();
|
|
21
|
+
try {
|
|
22
|
+
await stopProcessor({ graceMs: SHUTDOWN_GRACE_MS });
|
|
23
|
+
} catch (error) {
|
|
24
|
+
log.error("[queue] Error while draining worker on shutdown:", error);
|
|
25
|
+
}
|
|
26
|
+
process.exit(0);
|
|
27
|
+
}
|
|
28
|
+
process.on("SIGTERM", () => {
|
|
29
|
+
gracefulShutdown("SIGTERM");
|
|
30
|
+
});
|
|
31
|
+
process.on("SIGINT", () => {
|
|
32
|
+
gracefulShutdown("SIGINT");
|
|
33
|
+
});
|
|
34
|
+
const options = parseArgs(), queue = options.queue, concurrency = Number(options.concurrency) || 1;
|
|
35
|
+
log.info(`Starting queue worker with ${concurrency} concurrent worker(s)...`);
|
|
36
|
+
const result = await startProcessor(queue, {
|
|
37
|
+
concurrency
|
|
38
|
+
});
|
|
39
|
+
if (result.isErr) {
|
|
40
|
+
log.error("Failed to start queue worker:", result.error);
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
log.success("Queue worker started successfully!");
|
|
44
|
+
await new Promise(() => {});
|
|
45
|
+
function parseArgs() {
|
|
46
|
+
const args = {};
|
|
47
|
+
process.argv.forEach((arg) => {
|
|
48
|
+
if (arg.startsWith("--")) {
|
|
49
|
+
const [key, value] = arg.slice(2).split("=");
|
|
50
|
+
if (key && value)
|
|
51
|
+
args[key] = value;
|
|
52
|
+
else if (key)
|
|
53
|
+
args[key] = "true";
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
return args;
|
|
57
|
+
}
|
package/dist/release.js
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import
|
|
1
|
+
import { parseOptions } from "@stacksjs/cli";
|
|
2
|
+
import { app } from "@stacksjs/config";
|
|
3
|
+
import { Action } from "@stacksjs/enums";
|
|
4
|
+
import { log } from "@stacksjs/logging";
|
|
5
|
+
import { projectPath } from "@stacksjs/path";
|
|
6
|
+
import { runActions } from ".";
|
|
7
|
+
const raw = parseOptions() ?? {}, passthrough = {};
|
|
8
|
+
for (const [k, v] of Object.entries(raw)) {
|
|
9
|
+
if (k === "--" || k === "_")
|
|
10
|
+
continue;
|
|
11
|
+
passthrough[k] = v;
|
|
12
|
+
}
|
|
13
|
+
const isDryRun = passthrough.dryRun === !0 || passthrough.dryRun === "true", actions = isDryRun ? [Action.GenerateLibraryEntries, Action.Bump] : [Action.GenerateLibraryEntries, Action.LintFix, Action.Bump], result = await runActions(actions, {
|
|
14
|
+
cwd: projectPath(),
|
|
15
|
+
...passthrough
|
|
16
|
+
});
|
|
17
|
+
if (result && result.isErr) {
|
|
18
|
+
log.error(`Release failed: ${result.error?.message ?? String(result.error)}`);
|
|
19
|
+
process.exit(1);
|
|
20
|
+
}
|
|
21
|
+
log.success(`Successfully released ${app.name}`);
|