@usequark/quark-create-app 1.24.1 → 1.24.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usequark/quark-create-app",
|
|
3
|
-
"version": "1.24.
|
|
3
|
+
"version": "1.24.2",
|
|
4
4
|
"description": "CLI to scaffold new Quark projects with Next.js, Prisma, BullMQ, and Railway deployment",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"quark",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"sync-templates:check": "node scripts/sync-templates.js --check",
|
|
57
57
|
"regen-migration": "node scripts/regenerate-template-migration.js",
|
|
58
58
|
"smoke:published": "node scripts/smoke-published.js",
|
|
59
|
-
"test": "node test-cli.js && node --test src/utils.test.js && node --test src/prepare-hooks.test.js && node --test src/scaffold-output.test.js && node --test src/template-scripts.test.js && node --test src/scaffold-guards.test.js && node --test src/worker-dockerfile.test.js && node --test src/dependabot-config.test.js && node --test 'src/deploy/**/*.test.js' && node --test --test-concurrency=1 'src/deploy/**/*.integration.test.js'",
|
|
59
|
+
"test": "node test-cli.js && node --test src/utils.test.js && node --test src/prepare-hooks.test.js && node --test src/scaffold-output.test.js && node --test src/template-scripts.test.js && node --test src/scaffold-guards.test.js && node --test src/template-config.test.js && node --test src/worker-dockerfile.test.js && node --test src/dependabot-config.test.js && node --test 'src/deploy/**/*.test.js' && node --test --test-concurrency=1 'src/deploy/**/*.integration.test.js'",
|
|
60
60
|
"test:build": "node test-build.js",
|
|
61
61
|
"test:e2e": "node test-e2e.js",
|
|
62
62
|
"test:e2e:full": "node test-e2e-full.js",
|
|
@@ -131,6 +131,16 @@ export async function waitForRedis(
|
|
|
131
131
|
intervalMs = parseInt(process.env.WORKER_HEALTH_INTERVAL_MS || "1000", 10),
|
|
132
132
|
} = config;
|
|
133
133
|
|
|
134
|
+
// See waitForDatabase: reject a config object in the healthCheck slot
|
|
135
|
+
// rather than failing with an opaque TypeError.
|
|
136
|
+
if (typeof healthCheck !== "function") {
|
|
137
|
+
throw new AppError(
|
|
138
|
+
"waitForRedis expects a health check function as its first argument.",
|
|
139
|
+
500,
|
|
140
|
+
"REDIS_HEALTH_CHECK_INVALID",
|
|
141
|
+
);
|
|
142
|
+
}
|
|
143
|
+
|
|
134
144
|
const reportThrottledError = throttledError(logger, 3000);
|
|
135
145
|
|
|
136
146
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
@@ -190,6 +200,18 @@ export async function waitForDatabase(
|
|
|
190
200
|
intervalMs = parseInt(process.env.WORKER_DB_INTERVAL_MS || "2000", 10),
|
|
191
201
|
} = config;
|
|
192
202
|
|
|
203
|
+
// Guard against the config object being passed in the healthCheck slot:
|
|
204
|
+
// that surfaces as an opaque "healthCheck is not a function" TypeError and,
|
|
205
|
+
// because a TypeError is neither a schema nor a connection error, it
|
|
206
|
+
// rethrows on the first attempt so the retry config never applies.
|
|
207
|
+
if (typeof healthCheck !== "function") {
|
|
208
|
+
throw new AppError(
|
|
209
|
+
"waitForDatabase expects a health check function as its first argument.",
|
|
210
|
+
500,
|
|
211
|
+
"DATABASE_HEALTH_CHECK_INVALID",
|
|
212
|
+
);
|
|
213
|
+
}
|
|
214
|
+
|
|
193
215
|
const reportThrottledError = throttledError(logger, 5000);
|
|
194
216
|
|
|
195
217
|
for (let attempt = 1; attempt <= maxRetries; attempt++) {
|
|
@@ -379,7 +401,12 @@ async function startWorker() {
|
|
|
379
401
|
|
|
380
402
|
// Wait for database schema to be ready (migrations may still be running)
|
|
381
403
|
logger.info("Checking database schema readiness...");
|
|
382
|
-
|
|
404
|
+
// healthCheck takes the first argument; the config object must not be
|
|
405
|
+
// passed in its slot or the call throws "healthCheck is not a function".
|
|
406
|
+
await waitForDatabase(
|
|
407
|
+
undefined,
|
|
408
|
+
isDevMode ? { maxRetries: 5, intervalMs: 1000 } : {},
|
|
409
|
+
);
|
|
383
410
|
logger.info("Database schema ready");
|
|
384
411
|
|
|
385
412
|
// Register a worker for each queue
|