nimblybase 0.1.1 → 0.1.3
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/index.js +26 -15
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -349,7 +349,7 @@ function when(iso) {
|
|
|
349
349
|
|
|
350
350
|
// src/api.ts
|
|
351
351
|
var DEFAULT_API_URL = "https://api-uat.nimblybase.com";
|
|
352
|
-
var VERSION = "0.1.
|
|
352
|
+
var VERSION = "0.1.3";
|
|
353
353
|
function dashboardUrl(api) {
|
|
354
354
|
const match = /^https:\/\/api(-[a-z0-9]+)?\.(.+)$/.exec(api);
|
|
355
355
|
return match ? `https://app${match[1] ?? ""}.${match[2]}` : null;
|
|
@@ -1651,7 +1651,13 @@ async function readSchema(path) {
|
|
|
1651
1651
|
throw new CliError(`${path} is not valid JSON: ${err instanceof Error ? err.message : String(err)}`, EXIT.usage);
|
|
1652
1652
|
}
|
|
1653
1653
|
}
|
|
1654
|
-
|
|
1654
|
+
function unwrapSchema(parsed) {
|
|
1655
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed)) return parsed;
|
|
1656
|
+
if ("schema" in parsed) return parsed.schema;
|
|
1657
|
+
if (!("lineage" in parsed)) return parsed;
|
|
1658
|
+
const { lineage: _lineage, ...schema } = parsed;
|
|
1659
|
+
return schema;
|
|
1660
|
+
}
|
|
1655
1661
|
var lineageOf = (parsed) => {
|
|
1656
1662
|
const raw = parsed?.lineage;
|
|
1657
1663
|
return typeof raw === "string" && raw.trim() !== "" ? raw.trim() : void 0;
|
|
@@ -1749,7 +1755,8 @@ async function push(flags) {
|
|
|
1749
1755
|
json({ plan, applied });
|
|
1750
1756
|
return;
|
|
1751
1757
|
}
|
|
1752
|
-
|
|
1758
|
+
const statements = applied.statements === void 0 ? "" : ` (${applied.statements} SQL statement${applied.statements === 1 ? "" : "s"})`;
|
|
1759
|
+
out(`${paint("green", "\u2713")} Applied ${applied.applied} change${applied.applied === 1 ? "" : "s"}${statements} to ${project.slug}.`);
|
|
1753
1760
|
}
|
|
1754
1761
|
async function migrations(flags) {
|
|
1755
1762
|
const ctx = await context(flags.api);
|
|
@@ -1772,7 +1779,9 @@ function describePlan(plan, slug, path) {
|
|
|
1772
1779
|
}
|
|
1773
1780
|
out(`${plan.operations.length} change${plan.operations.length === 1 ? "" : "s"} between ${path} and ${slug}:`);
|
|
1774
1781
|
out();
|
|
1775
|
-
for (const op of plan.operations)
|
|
1782
|
+
for (const op of plan.operations) {
|
|
1783
|
+
for (const statement of describe(op)) out(` ${statement}`);
|
|
1784
|
+
}
|
|
1776
1785
|
out();
|
|
1777
1786
|
if (plan.unsupported.length > 0) {
|
|
1778
1787
|
for (const u of plan.unsupported) note(`${paint("yellow", "cannot apply")} ${u.reason}`);
|
|
@@ -1783,7 +1792,8 @@ function describePlan(plan, slug, path) {
|
|
|
1783
1792
|
}
|
|
1784
1793
|
function describe(op) {
|
|
1785
1794
|
const marker = op.destructive ? paint("red", "-") : paint("green", "+");
|
|
1786
|
-
|
|
1795
|
+
const statements = Array.isArray(op.sql) ? op.sql : [op.sql];
|
|
1796
|
+
return statements.map((sql2) => `${marker} ${sql2}`);
|
|
1787
1797
|
}
|
|
1788
1798
|
|
|
1789
1799
|
// src/commands/sql.ts
|
|
@@ -2747,7 +2757,8 @@ function proposeArchitecture(repository, capabilities) {
|
|
|
2747
2757
|
continue;
|
|
2748
2758
|
}
|
|
2749
2759
|
const capability = byId.get(serviceId);
|
|
2750
|
-
|
|
2760
|
+
const configurable = capability?.supported === true && (capability.state === "not_enabled" || capability.state === "not_configured");
|
|
2761
|
+
if (!capability?.available && !configurable) {
|
|
2751
2762
|
services.push({
|
|
2752
2763
|
id: serviceId,
|
|
2753
2764
|
decision: "unavailable",
|
|
@@ -2760,7 +2771,7 @@ function proposeArchitecture(repository, capabilities) {
|
|
|
2760
2771
|
}
|
|
2761
2772
|
services.push({
|
|
2762
2773
|
id: serviceId,
|
|
2763
|
-
decision: repository.runtime.kind === "external-server" && feature.id === "functions" ? "external" : "use",
|
|
2774
|
+
decision: repository.runtime.kind === "external-server" && feature.id === "functions" ? "external" : configurable ? "configure" : "use",
|
|
2764
2775
|
reason: `${feature.evidence.join("; ")}. ${capability.reason}`,
|
|
2765
2776
|
actions: FEATURE_ACTIONS[featureId]
|
|
2766
2777
|
});
|
|
@@ -3787,16 +3798,16 @@ var MAX_FILES2 = 2e3;
|
|
|
3787
3798
|
var MAX_READ_BYTES = 256 * 1024;
|
|
3788
3799
|
var MAX_TOTAL_READ_BYTES = 4 * 1024 * 1024;
|
|
3789
3800
|
var FEATURE_PATTERNS = {
|
|
3790
|
-
auth: /\b(auth|
|
|
3791
|
-
storage: /\b(
|
|
3792
|
-
realtime: /\b(
|
|
3793
|
-
vectors: /\b(
|
|
3794
|
-
functions: /\b(
|
|
3795
|
-
schedules: /\b(
|
|
3801
|
+
auth: /\b(auth(?:entication|enticated|orization|orized)?|log-?ins?|sign-?ins?|sign-?ups?|sessions?|user accounts?|passport|clerk|auth0)\b/i,
|
|
3802
|
+
storage: /\b(uploads?|attachments?|buckets?|object storage|file (?:uploads?|attachments?|storage)|s3|r2|multer|media)\b/i,
|
|
3803
|
+
realtime: /\b(real[ -]?time|websockets?|socket\.io|chat rooms?|live updates?)\b/i,
|
|
3804
|
+
vectors: /\b(vectors?|embeddings?|semantic search(?:es)?|rag|retrieval augmented)\b/i,
|
|
3805
|
+
functions: /\b(webhooks?|edge functions?|api routes?|http handlers?|express|fastify|hono)\b/i,
|
|
3806
|
+
schedules: /\b(crons?|schedules?|scheduled|periodic)\b/i,
|
|
3796
3807
|
ai: /\b(openai|anthropic|workers ai|language model|llm|chatbot|ai sdk)\b/i,
|
|
3797
3808
|
cache: /\b(redis|cache|memoiz)\w*/i,
|
|
3798
|
-
jobs: /\b(
|
|
3799
|
-
crawler: /\b(
|
|
3809
|
+
jobs: /\b(queues?|background jobs?|worker jobs?|bullmq|celery|sidekiq)\b/i,
|
|
3810
|
+
crawler: /\b(crawls?|crawlers?|scrapes?|playwright|puppeteer|browser automation)\b/i
|
|
3800
3811
|
};
|
|
3801
3812
|
async function architect(flags, ...words) {
|
|
3802
3813
|
const root = resolve4(flags.dir ?? ".");
|