clivly 0.15.0 → 0.17.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/{adapter-BMAUq4hf.d.mts → adapter-BpAfha3z.d.mts} +1 -3
- package/{adapter-IH3r_I8v.d.cts → adapter-BvSigBPG.d.cts} +1 -3
- package/{auth-adapter-CiEXcweZ.cjs → auth-adapter-CNVuxT9W.cjs} +1 -2
- package/{auth-adapter-Bt1GZiag.d.cts → auth-adapter-CsZE4ugg.d.cts} +1 -3
- package/{auth-adapter-CHy273qb.d.mts → auth-adapter-Q6CL2VHr.d.mts} +1 -3
- package/{auth-adapter-gfVDxf3d.mjs → auth-adapter-u91PByaw.mjs} +1 -2
- package/auth-better-auth.cjs +2 -4
- package/auth-better-auth.d.cts +1 -5
- package/auth-better-auth.d.mts +1 -5
- package/auth-better-auth.mjs +2 -4
- package/auth-clerk.cjs +2 -4
- package/auth-clerk.d.cts +1 -5
- package/auth-clerk.d.mts +1 -5
- package/auth-clerk.mjs +2 -4
- package/auth-workos.cjs +2 -4
- package/auth-workos.d.cts +1 -5
- package/auth-workos.d.mts +1 -5
- package/auth-workos.mjs +2 -4
- package/core-adapter.cjs +2 -3
- package/core-adapter.d.cts +1 -1
- package/core-adapter.d.mts +1 -1
- package/core-adapter.mjs +2 -3
- package/core-auth-adapter.cjs +3 -4
- package/core-auth-adapter.d.cts +1 -1
- package/core-auth-adapter.d.mts +1 -1
- package/core-auth-adapter.mjs +3 -5
- package/core-drizzle.cjs +3 -4
- package/core-drizzle.d.cts +1 -1
- package/core-drizzle.d.mts +1 -1
- package/core-drizzle.mjs +3 -5
- package/core-entity-config.cjs +3 -4
- package/core-entity-config.d.cts +1 -1
- package/core-entity-config.d.mts +1 -1
- package/core-entity-config.mjs +3 -5
- package/core-entity-heuristics.cjs +2 -3
- package/core-entity-heuristics.d.cts +1 -1
- package/core-entity-heuristics.d.mts +1 -1
- package/core-entity-heuristics.mjs +3 -5
- package/core-mapping-form.cjs +3 -4
- package/core-mapping-form.d.cts +1 -1
- package/core-mapping-form.d.mts +1 -1
- package/core-mapping-form.mjs +3 -5
- package/core-mapping-score.cjs +3 -4
- package/core-mapping-score.d.cts +1 -1
- package/core-mapping-score.d.mts +1 -1
- package/core-mapping-score.mjs +3 -5
- package/core-mappings-config.cjs +3 -4
- package/core-mappings-config.d.cts +1 -1
- package/core-mappings-config.d.mts +1 -1
- package/core-mappings-config.mjs +3 -5
- package/core-sync-engine.cjs +3 -4
- package/core-sync-engine.d.cts +1 -1
- package/core-sync-engine.d.mts +1 -1
- package/core-sync-engine.mjs +3 -5
- package/core-types.cjs +3 -4
- package/core-types.d.cts +1 -1
- package/core-types.d.mts +1 -1
- package/core-types.mjs +3 -5
- package/core-view-compiler.cjs +3 -4
- package/core-view-compiler.d.cts +1 -1
- package/core-view-compiler.d.mts +1 -1
- package/core-view-compiler.mjs +3 -5
- package/core.cjs +13 -13
- package/core.d.cts +11 -11
- package/core.d.mts +11 -11
- package/core.mjs +13 -14
- package/{deprecate-subpath-CmvZtCpE.mjs → deprecate-subpath-CK37DKXH.mjs} +1 -2
- package/{deprecate-subpath-B9ngvizt.cjs → deprecate-subpath-dGwDiHKV.cjs} +1 -2
- package/{drizzle-DcB7OfBp.cjs → drizzle-C0bfX-6a.cjs} +1 -2
- package/{drizzle-wbcuG-cy.mjs → drizzle-CZuOzIu4.mjs} +1 -2
- package/{drizzle-CiK37zJm.d.cts → drizzle-MUNZgh1l.d.cts} +1 -3
- package/{drizzle-ehVWLSrN.d.mts → drizzle-UJbPCzPJ.d.mts} +1 -3
- package/{drizzle-meta-Bb1JWYqf.cjs → drizzle-meta-BPnRLpsB.cjs} +1 -2
- package/{drizzle-meta-D-5k3n0i.mjs → drizzle-meta-D00lFvAk.mjs} +1 -2
- package/drizzle.cjs +7 -10
- package/drizzle.d.cts +3 -7
- package/drizzle.d.mts +3 -7
- package/drizzle.mjs +7 -10
- package/entity-config-BF7pcXFB.d.cts +632 -0
- package/{entity-config-Ccfb2IL9.mjs → entity-config-DQVSprlG.mjs} +8 -11
- package/{entity-config-BI4RYNKL.cjs → entity-config-nWWgJXLw.cjs} +8 -11
- package/entity-config-pzamFSKw.d.mts +632 -0
- package/index.cjs +51 -98
- package/index.d.cts +1 -12
- package/index.d.mts +1 -12
- package/index.mjs +51 -98
- package/{integration-state-BA4c0RbD.d.mts → integration-state-xK4PLm5T.d.cts} +0 -2
- package/{integration-state-BA4c0RbD.d.cts → integration-state-xK4PLm5T.d.mts} +0 -2
- package/{internal-C7NlPM3M.d.mts → internal-C-uvosSL.d.cts} +1 -17
- package/{internal-DsArcqkP.cjs → internal-CjJy-cy1.cjs} +42 -8
- package/{internal-CLvZdVj5.mjs → internal-DtLZyjf8.mjs} +37 -9
- package/{internal-D2J4VQWT.d.cts → internal-Gie7hCpK.d.mts} +1 -17
- package/internal-adapter.d.cts +1 -1
- package/internal-adapter.d.mts +1 -1
- package/internal-auth-adapter.cjs +1 -1
- package/internal-auth-adapter.d.cts +1 -1
- package/internal-auth-adapter.d.mts +1 -1
- package/internal-auth-adapter.mjs +1 -2
- package/internal-drizzle.cjs +1 -1
- package/internal-drizzle.d.cts +1 -1
- package/internal-drizzle.d.mts +1 -1
- package/internal-drizzle.mjs +1 -2
- package/internal-entity-config.cjs +1 -1
- package/internal-entity-config.d.cts +1 -1
- package/internal-entity-config.d.mts +1 -1
- package/internal-entity-config.mjs +1 -2
- package/internal-entity-heuristics.cjs +3 -4
- package/internal-entity-heuristics.d.cts +2 -4
- package/internal-entity-heuristics.d.mts +2 -4
- package/internal-entity-heuristics.mjs +3 -4
- package/internal-mapping-form.cjs +1 -1
- package/internal-mapping-form.d.cts +1 -1
- package/internal-mapping-form.d.mts +1 -1
- package/internal-mapping-form.mjs +1 -2
- package/internal-mapping-score.cjs +1 -1
- package/internal-mapping-score.d.cts +1 -1
- package/internal-mapping-score.d.mts +1 -1
- package/internal-mapping-score.mjs +1 -2
- package/internal-mappings-config.cjs +1 -1
- package/internal-mappings-config.d.cts +1 -1
- package/internal-mappings-config.d.mts +1 -1
- package/internal-mappings-config.mjs +1 -2
- package/internal-sync-engine.cjs +1 -1
- package/internal-sync-engine.d.cts +1 -1
- package/internal-sync-engine.d.mts +1 -1
- package/internal-sync-engine.mjs +1 -2
- package/internal-types.cjs +1 -1
- package/internal-types.d.cts +1 -1
- package/internal-types.d.mts +1 -1
- package/internal-types.mjs +1 -2
- package/internal-view-compiler.cjs +1 -1
- package/internal-view-compiler.d.cts +1 -1
- package/internal-view-compiler.d.mts +1 -1
- package/internal-view-compiler.mjs +1 -2
- package/internal.cjs +11 -10
- package/internal.d.cts +11 -11
- package/internal.d.mts +11 -11
- package/internal.mjs +11 -11
- package/{mapping-form-BpfON_ME.cjs → mapping-form-Bs6JQurC.cjs} +1 -2
- package/{mapping-form-XsLLCqW_.d.cts → mapping-form-BymksK7h.d.mts} +1 -3
- package/{mapping-form-DigkuvFc.mjs → mapping-form-C7kDMWzp.mjs} +1 -2
- package/{mapping-form-Btn-7gzv.d.mts → mapping-form-Cmf8y-1m.d.cts} +1 -3
- package/{mapping-score-D7Gzg7Ii.d.cts → mapping-score-BKrxddz0.d.cts} +0 -2
- package/{mapping-score-D7Gzg7Ii.d.mts → mapping-score-BKrxddz0.d.mts} +0 -2
- package/{mapping-score-C68uAqGB.mjs → mapping-score-CS-MTDL9.mjs} +1 -2
- package/{mapping-score-CaB3F4Uu.cjs → mapping-score-D2TCQiOr.cjs} +1 -2
- package/{mappings-config-CwQNQ6bA.mjs → mappings-config-C7FPwrJT.mjs} +3 -4
- package/{mappings-config-BCsRLohT.cjs → mappings-config-DBG-KnYl.cjs} +3 -4
- package/{mappings-config-D6_oCi2Q.d.mts → mappings-config-Dsz6rcJb.d.cts} +1 -3
- package/{mappings-config-iJzbcUMp.d.cts → mappings-config-ktJhxmHm.d.mts} +1 -3
- package/{namespace-probe-DykR0kgh.d.mts → namespace-probe-By8SCnym.d.mts} +2 -8
- package/{namespace-probe-H7yWc0JV.d.cts → namespace-probe-CTkb35Ro.d.cts} +2 -8
- package/package.json +1 -1
- package/{projection-BELgANG2.cjs → projection-B8RtxuEq.cjs} +35 -38
- package/{projection-DvNewmI1.mjs → projection-DNi_2dVa.mjs} +30 -39
- package/{projection-sql-DweUaWRc.mjs → projection-sql-BYv40Hen.mjs} +2 -3
- package/{projection-sql-DuCtFE9t.cjs → projection-sql-SuhzhsMe.cjs} +2 -3
- package/schemas-DySv963y.d.cts +2098 -0
- package/schemas-DySv963y.d.mts +2098 -0
- package/{sdk-ZMy4C4VK.cjs → sdk-BJ3OkhCq.cjs} +27 -50
- package/{sdk-DLoVPlGB.mjs → sdk-CXrarwvs.mjs} +27 -50
- package/sdk.cjs +2 -2
- package/sdk.d.cts +2 -10
- package/sdk.d.mts +2 -10
- package/sdk.mjs +2 -2
- package/{sync-engine-DH058G3w.mjs → sync-engine-BTUoH82k.mjs} +2 -3
- package/{sync-engine-C_5TpvfX.d.mts → sync-engine-C_SwnFgF.d.mts} +2 -4
- package/{sync-engine-CYsWOujz.d.cts → sync-engine-D9ltfqkD.d.cts} +2 -4
- package/{sync-engine-BGVDsrOQ.cjs → sync-engine-DBlSP9r2.cjs} +2 -3
- package/{types-YJTkXKzU.mjs → types-8KSw2AWg.mjs} +1 -2
- package/{types-Cq5gHCTq.cjs → types-B8m39L1s.cjs} +1 -2
- package/{types-CpAtAtxd.d.cts → types-BtQCi_qP.d.cts} +30 -3
- package/{types-CpAtAtxd.d.mts → types-CTOl3pAX.d.mts} +30 -3
- package/{view-compiler-C-6RydKK.mjs → view-compiler-B8tJ5IGw.mjs} +3 -4
- package/{view-compiler-CwKVoK1w.d.mts → view-compiler-BZgZisTG.d.mts} +1 -3
- package/{view-compiler-xiwm5iar.cjs → view-compiler-Ce_QE3dh.cjs} +3 -4
- package/{view-compiler-Cq8apvZ4.d.cts → view-compiler-D7GLf1n8.d.cts} +1 -3
- package/vite.cjs +1 -2
- package/vite.d.cts +2 -4
- package/vite.d.mts +2 -4
- package/vite.mjs +1 -2
- package/entity-config-ApnT5j3X.d.cts +0 -4472
- package/entity-config-CKcj4-M_.d.mts +0 -4473
package/index.cjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const require_entity_config = require("./entity-config-
|
|
4
|
-
require("./mapping-score-
|
|
3
|
+
const require_entity_config = require("./entity-config-nWWgJXLw.cjs");
|
|
4
|
+
require("./mapping-score-D2TCQiOr.cjs");
|
|
5
5
|
const require_internal_entity_heuristics = require("./internal-entity-heuristics.cjs");
|
|
6
|
-
const require_sdk = require("./sdk-
|
|
6
|
+
const require_sdk = require("./sdk-BJ3OkhCq.cjs");
|
|
7
7
|
let node_child_process = require("node:child_process");
|
|
8
8
|
let node_fs = require("node:fs");
|
|
9
9
|
let node_module = require("node:module");
|
|
@@ -13,7 +13,7 @@ let node_readline_promises = require("node:readline/promises");
|
|
|
13
13
|
let jiti = require("jiti");
|
|
14
14
|
let node_url = require("node:url");
|
|
15
15
|
let node_net = require("node:net");
|
|
16
|
-
|
|
16
|
+
// ../core/src/env-file.ts
|
|
17
17
|
const ENV_FILES = {
|
|
18
18
|
next: ".env.local",
|
|
19
19
|
"tanstack-start": ".env",
|
|
@@ -58,8 +58,7 @@ function resolveEnvFile(input) {
|
|
|
58
58
|
if (input.existing.includes(conventional)) return conventional;
|
|
59
59
|
return input.existing[0] ?? conventional;
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
//#region src/app-layout.ts
|
|
61
|
+
// src/app-layout.ts
|
|
63
62
|
function resolveAppLayout(cwd, fileExists = node_fs.existsSync) {
|
|
64
63
|
if (fileExists((0, node_path.join)(cwd, "src", "app"))) return "src/app";
|
|
65
64
|
if (fileExists((0, node_path.join)(cwd, "app"))) return "app";
|
|
@@ -78,8 +77,7 @@ Nothing was written. Please report this at https://github.com/amani-joseph/clivl
|
|
|
78
77
|
— Clivly should have detected the src/app layout automatically.
|
|
79
78
|
`;
|
|
80
79
|
}
|
|
81
|
-
|
|
82
|
-
//#region src/load-config.ts
|
|
80
|
+
// src/load-config.ts
|
|
83
81
|
const CONFIG_HINT = "Expected clivly.config.ts at your app root exporting `createClivlySDK({...})`.";
|
|
84
82
|
function resolveConfigPath(cwd, configPath) {
|
|
85
83
|
return (0, node_path.resolve)(cwd, configPath ?? "clivly.config.ts");
|
|
@@ -131,8 +129,7 @@ async function loadConfigSdk(path, requiredMethod) {
|
|
|
131
129
|
if (typeof sdk?.[requiredMethod] !== "function") throw new Error("default export is not a Clivly SDK instance");
|
|
132
130
|
return sdk;
|
|
133
131
|
}
|
|
134
|
-
|
|
135
|
-
//#region src/cli-config.ts
|
|
132
|
+
// src/cli-config.ts
|
|
136
133
|
const CLI_CONFIG_NAMES = [
|
|
137
134
|
"clivly.cli.ts",
|
|
138
135
|
"clivly.cli.js",
|
|
@@ -175,16 +172,14 @@ async function loadCliConfig(cwd) {
|
|
|
175
172
|
const envFiles = readEnvFiles(config);
|
|
176
173
|
return envFiles ? { envFiles } : {};
|
|
177
174
|
}
|
|
178
|
-
|
|
179
|
-
//#region src/dashboard-locations.ts
|
|
175
|
+
// src/dashboard-locations.ts
|
|
180
176
|
/** Secret + publishable keys. The Connect dialog mints them and shows the secret once. */
|
|
181
177
|
const CREDENTIALS_LOCATION = "Clivly dashboard → Connect app (or Settings → API keys)";
|
|
182
178
|
/** The signing secret Clivly Cloud uses on sync-trigger callbacks. */
|
|
183
179
|
const SYNC_SECRET_LOCATION = "Clivly dashboard → Integrations → Remote sync";
|
|
184
180
|
/** Chat widget records and their allowed origins. */
|
|
185
181
|
const WIDGET_LOCATION = "Clivly dashboard → Settings → Chat widget";
|
|
186
|
-
|
|
187
|
-
//#region src/detect.ts
|
|
182
|
+
// src/detect.ts
|
|
188
183
|
const FRAMEWORK_MARKERS = [
|
|
189
184
|
{
|
|
190
185
|
framework: "nextjs",
|
|
@@ -292,8 +287,7 @@ function addCommand(pm, packages) {
|
|
|
292
287
|
args: [pm === "npm" ? "install" : "add", ...packages]
|
|
293
288
|
};
|
|
294
289
|
}
|
|
295
|
-
|
|
296
|
-
//#region src/detect-workspace.ts
|
|
290
|
+
// src/detect-workspace.ts
|
|
297
291
|
const SELECTABLE_FRAMEWORKS = [
|
|
298
292
|
"nextjs",
|
|
299
293
|
"tanstack-start",
|
|
@@ -410,8 +404,7 @@ function detectAcrossWorkspace(appDeps, packages) {
|
|
|
410
404
|
sources
|
|
411
405
|
};
|
|
412
406
|
}
|
|
413
|
-
|
|
414
|
-
//#region src/tick-route.ts
|
|
407
|
+
// src/tick-route.ts
|
|
415
408
|
/**
|
|
416
409
|
* The tick route's public URL path, and the template `clivly login` writes for
|
|
417
410
|
* it.
|
|
@@ -448,8 +441,7 @@ const CLIVLY_TICK_PATH = "/api/clivly/tick";
|
|
|
448
441
|
* auto-detected, and `clivly dev` handles local development.
|
|
449
442
|
*/
|
|
450
443
|
const TRIGGER_URL_PLACEHOLDER = `https://<yourDomain.com>${CLIVLY_TICK_PATH}`;
|
|
451
|
-
|
|
452
|
-
//#region src/dev-tunnel.ts
|
|
444
|
+
// src/dev-tunnel.ts
|
|
453
445
|
const CLOUDFLARE_QUICK_TUNNEL_REGEX = /https:\/\/[a-z0-9-]+\.trycloudflare\.com/;
|
|
454
446
|
const DEFAULT_PORT = "3000";
|
|
455
447
|
/**
|
|
@@ -568,8 +560,7 @@ function cloudflaredMissingMessage() {
|
|
|
568
560
|
"Your app will still run locally; only dashboard-triggered sync is unavailable."
|
|
569
561
|
].join("\n");
|
|
570
562
|
}
|
|
571
|
-
|
|
572
|
-
//#region src/tunnel-identity.ts
|
|
563
|
+
// src/tunnel-identity.ts
|
|
573
564
|
/**
|
|
574
565
|
* Whether the published tunnel actually reaches *this* app's Clivly route.
|
|
575
566
|
*
|
|
@@ -687,8 +678,7 @@ function tunnelMismatchMessage(port) {
|
|
|
687
678
|
" Until then, dashboard-triggered syncs will not reach this app."
|
|
688
679
|
].join("\n");
|
|
689
680
|
}
|
|
690
|
-
|
|
691
|
-
//#region src/dev.ts
|
|
681
|
+
// src/dev.ts
|
|
692
682
|
const UNREACHABLE_RESULT = {
|
|
693
683
|
ok: false,
|
|
694
684
|
kind: "unreachable"
|
|
@@ -770,8 +760,7 @@ async function runDev(options) {
|
|
|
770
760
|
});
|
|
771
761
|
});
|
|
772
762
|
}
|
|
773
|
-
|
|
774
|
-
//#region src/dev-override.ts
|
|
763
|
+
// src/dev-override.ts
|
|
775
764
|
const TRIGGER_URL_PATH = "/clivly/sdk/trigger-url";
|
|
776
765
|
const HTTP_UNAUTHORIZED = 401;
|
|
777
766
|
const HTTP_NOT_FOUND = 404;
|
|
@@ -811,8 +800,7 @@ async function clearTunnelOverride(deps) {
|
|
|
811
800
|
if (res.ok) return { ok: true };
|
|
812
801
|
return failureFor(res.status);
|
|
813
802
|
}
|
|
814
|
-
|
|
815
|
-
//#region src/probe-module.ts
|
|
803
|
+
// src/probe-module.ts
|
|
816
804
|
async function probeModule(opts) {
|
|
817
805
|
for (const candidate of opts.candidates) {
|
|
818
806
|
let mod;
|
|
@@ -828,8 +816,7 @@ async function probeModule(opts) {
|
|
|
828
816
|
}
|
|
829
817
|
return null;
|
|
830
818
|
}
|
|
831
|
-
|
|
832
|
-
//#region src/workspace-graph.ts
|
|
819
|
+
// src/workspace-graph.ts
|
|
833
820
|
const WINDOWS_SEP$3 = /\\/g;
|
|
834
821
|
const MODULE_EXT$1 = /\.(ts|tsx|js|jsx|mjs|cjs|cts|mts)$/;
|
|
835
822
|
const BRACE_GROUP = /\{([^{}]*)\}/;
|
|
@@ -1065,8 +1052,7 @@ function toPackageSpecifier(pkg, absPath) {
|
|
|
1065
1052
|
if (subpath.length === 0) return pkg.name;
|
|
1066
1053
|
return exportsAllowSubpath(pkg.dir, subpath) ? `${pkg.name}/${subpath}` : null;
|
|
1067
1054
|
}
|
|
1068
|
-
|
|
1069
|
-
//#region src/discover-schema.ts
|
|
1055
|
+
// src/discover-schema.ts
|
|
1070
1056
|
const WINDOWS_SEP$2 = /\\/g;
|
|
1071
1057
|
const MODULE_EXT = /\.(ts|js|mjs|cts|mts)$/;
|
|
1072
1058
|
/**
|
|
@@ -1241,8 +1227,7 @@ async function discoverSchema(opts) {
|
|
|
1241
1227
|
db
|
|
1242
1228
|
};
|
|
1243
1229
|
}
|
|
1244
|
-
|
|
1245
|
-
//#region src/engine-check.ts
|
|
1230
|
+
// src/engine-check.ts
|
|
1246
1231
|
const MAJOR = /^v?(\d+)/;
|
|
1247
1232
|
const FIRST_NUMBER = /(\d+)/;
|
|
1248
1233
|
function currentMajor(version) {
|
|
@@ -1264,8 +1249,7 @@ Upgrade with \`nvm install ${need}\` (or your version manager of choice), then r
|
|
|
1264
1249
|
Set CLIVLY_SKIP_ENGINE_CHECK=1 to run anyway — expect unrelated-looking failures.
|
|
1265
1250
|
`;
|
|
1266
1251
|
}
|
|
1267
|
-
|
|
1268
|
-
//#region src/env-file.ts
|
|
1252
|
+
// src/env-file.ts
|
|
1269
1253
|
const REGEX_METACHARACTERS = /[.*+?^${}()|[\]\\]/g;
|
|
1270
1254
|
function escapeForRegExp(key) {
|
|
1271
1255
|
return key.replace(REGEX_METACHARACTERS, "\\$&");
|
|
@@ -1348,8 +1332,7 @@ function upsertEnvValues(existing, entries, options = {}) {
|
|
|
1348
1332
|
written
|
|
1349
1333
|
};
|
|
1350
1334
|
}
|
|
1351
|
-
|
|
1352
|
-
//#region src/help.ts
|
|
1335
|
+
// src/help.ts
|
|
1353
1336
|
const ROOT_HELP = `clivly — embed a CRM in your app
|
|
1354
1337
|
|
|
1355
1338
|
Usage:
|
|
@@ -1478,10 +1461,9 @@ function isHelpRequest(argv) {
|
|
|
1478
1461
|
}
|
|
1479
1462
|
function helpFor(command) {
|
|
1480
1463
|
if (!command) return ROOT_HELP;
|
|
1481
|
-
return COMMAND_HELP[command] ??
|
|
1464
|
+
return COMMAND_HELP[command] ?? "clivly — embed a CRM in your app\n\nUsage:\n clivly init [options] Scaffold Clivly (config, routes, env file) for your app\n clivly add widget [options] Scaffold the chat-session route\n clivly status [options] Check your setup, step by step\n clivly push-schema [options] Push schema, custom objects and mappings to Clivly\n clivly dev [options] Tunnel localhost so remote sync can reach you\n clivly login [options] Pair this machine and write credentials to your env file\n clivly --version Print the installed clivly version\n\nDeprecated aliases — each runs part of `clivly status` and still works:\n clivly ping credential + reachability\n clivly connect the above, plus config and trigger URL\n clivly doctor config, setup checks and edge safety\n\nPrefer `clivly status`: it runs the whole ladder and tells you which step you\nare on. The aliases are kept because output and docs have recommended them.\n\nRun `clivly <command> --help` for details on a command.\n";
|
|
1482
1465
|
}
|
|
1483
|
-
|
|
1484
|
-
//#region src/install.ts
|
|
1466
|
+
// src/install.ts
|
|
1485
1467
|
const defaultRun = (command, args, cwd) => new Promise((resolvePromise, reject) => {
|
|
1486
1468
|
const child = (0, node_child_process.spawn)(command, args, {
|
|
1487
1469
|
cwd,
|
|
@@ -1522,8 +1504,7 @@ async function installPackages(options) {
|
|
|
1522
1504
|
};
|
|
1523
1505
|
}
|
|
1524
1506
|
}
|
|
1525
|
-
|
|
1526
|
-
//#region src/install-needed.ts
|
|
1507
|
+
// src/install-needed.ts
|
|
1527
1508
|
/** Exact `name@version` only. Anything else is left for the package manager. */
|
|
1528
1509
|
const EXACT_VERSION = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z.-]+)?$/;
|
|
1529
1510
|
/**
|
|
@@ -1562,8 +1543,7 @@ function packagesNeedingInstall(packages, installedVersion) {
|
|
|
1562
1543
|
return present !== version;
|
|
1563
1544
|
});
|
|
1564
1545
|
}
|
|
1565
|
-
|
|
1566
|
-
//#region src/is-entry.ts
|
|
1546
|
+
// src/is-entry.ts
|
|
1567
1547
|
function isEntrypoint(argv1, moduleUrl, realpath = node_fs.realpathSync) {
|
|
1568
1548
|
if (!argv1) return false;
|
|
1569
1549
|
const modulePath = (0, node_url.fileURLToPath)(moduleUrl);
|
|
@@ -1576,8 +1556,7 @@ function isEntrypoint(argv1, moduleUrl, realpath = node_fs.realpathSync) {
|
|
|
1576
1556
|
};
|
|
1577
1557
|
return resolve(argv1) === resolve(modulePath);
|
|
1578
1558
|
}
|
|
1579
|
-
|
|
1580
|
-
//#region src/load-env.ts
|
|
1559
|
+
// src/load-env.ts
|
|
1581
1560
|
const LINE = /^\s*(?:export\s+)?([A-Za-z_][A-Za-z0-9_]*)\s*=(.*)$/;
|
|
1582
1561
|
const NEWLINE$1 = /\r?\n/;
|
|
1583
1562
|
const ESCAPED_NEWLINE = /\\n/g;
|
|
@@ -1652,8 +1631,7 @@ function loadEnv(cwd, env = process.env, options = {}) {
|
|
|
1652
1631
|
files
|
|
1653
1632
|
};
|
|
1654
1633
|
}
|
|
1655
|
-
|
|
1656
|
-
//#region src/secret-key-env.ts
|
|
1634
|
+
// src/secret-key-env.ts
|
|
1657
1635
|
const SECRET_KEY_ENV = "CLIVLY_SECRET_KEY";
|
|
1658
1636
|
const LEGACY_SECRET_KEY_ENV = "CLIVLY_API_KEY";
|
|
1659
1637
|
function readSecretKeyEnv(env) {
|
|
@@ -1661,8 +1639,7 @@ function readSecretKeyEnv(env) {
|
|
|
1661
1639
|
if (next && next.length > 0) return next;
|
|
1662
1640
|
return env[LEGACY_SECRET_KEY_ENV];
|
|
1663
1641
|
}
|
|
1664
|
-
|
|
1665
|
-
//#region src/login.ts
|
|
1642
|
+
// src/login.ts
|
|
1666
1643
|
const POLL_INTERVAL_MS = 2e3;
|
|
1667
1644
|
const POLL_BACKOFF_MULTIPLIER = 1.5;
|
|
1668
1645
|
const POLL_INTERVAL_MAX_MS = 1e4;
|
|
@@ -1805,8 +1782,7 @@ async function runLogin(options) {
|
|
|
1805
1782
|
writeCredentials(options, outcome);
|
|
1806
1783
|
return 0;
|
|
1807
1784
|
}
|
|
1808
|
-
|
|
1809
|
-
//#region src/plan-init.ts
|
|
1785
|
+
// src/plan-init.ts
|
|
1810
1786
|
function toScoredTable(table) {
|
|
1811
1787
|
return {
|
|
1812
1788
|
name: table.tableName,
|
|
@@ -2081,15 +2057,13 @@ function rankContactCandidates(tables) {
|
|
|
2081
2057
|
table
|
|
2082
2058
|
}));
|
|
2083
2059
|
}
|
|
2084
|
-
|
|
2085
|
-
//#region src/config-import.ts
|
|
2060
|
+
// src/config-import.ts
|
|
2086
2061
|
const WINDOWS_SEP$1 = /\\/g;
|
|
2087
2062
|
function configImport(generatedFilePath) {
|
|
2088
2063
|
const rel = (0, node_path.relative)((0, node_path.dirname)(generatedFilePath), "clivly.config").replace(WINDOWS_SEP$1, "/");
|
|
2089
2064
|
return rel.startsWith(".") ? rel : `./${rel}`;
|
|
2090
2065
|
}
|
|
2091
|
-
|
|
2092
|
-
//#region src/boot-hook.ts
|
|
2066
|
+
// src/boot-hook.ts
|
|
2093
2067
|
const BOOT_HOOK_PATHS = {
|
|
2094
2068
|
nextjs: "instrumentation.ts",
|
|
2095
2069
|
nuxt: "server/plugins/clivly.ts",
|
|
@@ -2238,8 +2212,7 @@ function planBootHook(framework, layout) {
|
|
|
2238
2212
|
owned: true
|
|
2239
2213
|
};
|
|
2240
2214
|
}
|
|
2241
|
-
|
|
2242
|
-
//#region src/render-config.ts
|
|
2215
|
+
// src/render-config.ts
|
|
2243
2216
|
const CLIVLY_ENV_KEYS = [
|
|
2244
2217
|
{
|
|
2245
2218
|
key: "CLIVLY_SECRET_KEY",
|
|
@@ -2364,8 +2337,7 @@ ${sources.join(",\n")},
|
|
|
2364
2337
|
});
|
|
2365
2338
|
`;
|
|
2366
2339
|
}
|
|
2367
|
-
|
|
2368
|
-
//#region src/render-auth.ts
|
|
2340
|
+
// src/render-auth.ts
|
|
2369
2341
|
const RESOLVE_USER = "const resolveUser = (req: Request) => adapter.getUser(req);";
|
|
2370
2342
|
const STUB = {
|
|
2371
2343
|
complete: false,
|
|
@@ -2439,8 +2411,7 @@ function renderAuthWiring(auth, authInstance = null) {
|
|
|
2439
2411
|
default: return STUB;
|
|
2440
2412
|
}
|
|
2441
2413
|
}
|
|
2442
|
-
|
|
2443
|
-
//#region src/tsconfig-alias.ts
|
|
2414
|
+
// src/tsconfig-alias.ts
|
|
2444
2415
|
const LEADING_DOT_SLASH$1 = /^\.\//;
|
|
2445
2416
|
const TRAILING_WILDCARD = /\/?\*$/;
|
|
2446
2417
|
const TRAILING_SLASH = /\/$/;
|
|
@@ -2516,8 +2487,7 @@ function baseReaching(mapped, target) {
|
|
|
2516
2487
|
if (base === "") return target === "" ? null : "";
|
|
2517
2488
|
return target.startsWith(`${base}/`) ? base : null;
|
|
2518
2489
|
}
|
|
2519
|
-
|
|
2520
|
-
//#region src/scaffold.ts
|
|
2490
|
+
// src/scaffold.ts
|
|
2521
2491
|
const TANSTACK_ROUTE_PREFIX = /^src\/routes\//;
|
|
2522
2492
|
const TS_EXTENSION = /\.ts$/;
|
|
2523
2493
|
const ROUTE_PATHS = {
|
|
@@ -2689,8 +2659,7 @@ function planWidgetScaffold(framework, layout = "app") {
|
|
|
2689
2659
|
owned: true
|
|
2690
2660
|
}];
|
|
2691
2661
|
}
|
|
2692
|
-
|
|
2693
|
-
//#region src/vite-boot-patch.ts
|
|
2662
|
+
// src/vite-boot-patch.ts
|
|
2694
2663
|
/** Config filenames to look for, in precedence order. */
|
|
2695
2664
|
const VITE_CONFIG_CANDIDATES = [
|
|
2696
2665
|
"vite.config.ts",
|
|
@@ -2728,8 +2697,7 @@ function patchViteConfig(source) {
|
|
|
2728
2697
|
const separator = rest.startsWith("\n") ? "" : " ";
|
|
2729
2698
|
return insertImports(`${source.slice(0, openBracketEnd)}${PLUGIN_CALL},${separator}${rest}`);
|
|
2730
2699
|
}
|
|
2731
|
-
|
|
2732
|
-
//#region src/plan-mutations.ts
|
|
2700
|
+
// src/plan-mutations.ts
|
|
2733
2701
|
function fileAction(existing, next, force) {
|
|
2734
2702
|
if (existing === null) return "create";
|
|
2735
2703
|
if (existing === next) return "unchanged";
|
|
@@ -2855,8 +2823,7 @@ function planWidgetMutations(args) {
|
|
|
2855
2823
|
};
|
|
2856
2824
|
});
|
|
2857
2825
|
}
|
|
2858
|
-
|
|
2859
|
-
//#region src/port-probe.ts
|
|
2826
|
+
// src/port-probe.ts
|
|
2860
2827
|
const PORT_PROBE_TIMEOUT_MS = 1500;
|
|
2861
2828
|
/** One connect attempt against a single address family. */
|
|
2862
2829
|
function connectsOn(port, host) {
|
|
@@ -2892,8 +2859,7 @@ function connectsOn(port, host) {
|
|
|
2892
2859
|
function isLocalPortListening(port) {
|
|
2893
2860
|
return Promise.all([connectsOn(port, "127.0.0.1"), connectsOn(port, "::1")]).then((results) => results.some(Boolean));
|
|
2894
2861
|
}
|
|
2895
|
-
|
|
2896
|
-
//#region src/quiet-host-output.ts
|
|
2862
|
+
// src/quiet-host-output.ts
|
|
2897
2863
|
/**
|
|
2898
2864
|
* Run `fn` with the process's stdout/stderr captured. Always restores the
|
|
2899
2865
|
* original writers, including when `fn` throws — a leaked patch would silence
|
|
@@ -2935,8 +2901,7 @@ async function quietly(fn) {
|
|
|
2935
2901
|
const { result } = await captureHostOutput(fn);
|
|
2936
2902
|
return result;
|
|
2937
2903
|
}
|
|
2938
|
-
|
|
2939
|
-
//#region src/probe-auth.ts
|
|
2904
|
+
// src/probe-auth.ts
|
|
2940
2905
|
const AUTH_MODULE_PATHS = [
|
|
2941
2906
|
"auth",
|
|
2942
2907
|
"lib/auth",
|
|
@@ -2970,8 +2935,7 @@ function probeAuthInstance(cwd, load) {
|
|
|
2970
2935
|
match: isBetterAuthInstance
|
|
2971
2936
|
}));
|
|
2972
2937
|
}
|
|
2973
|
-
|
|
2974
|
-
//#region src/push-schema.ts
|
|
2938
|
+
// src/push-schema.ts
|
|
2975
2939
|
/**
|
|
2976
2940
|
* "1 mapping" / "3 mappings" — a count nobody has to decode. The plural is
|
|
2977
2941
|
* explicit because appending "s" turns "entity" into "entitys".
|
|
@@ -3049,8 +3013,7 @@ async function runPushSchema(options) {
|
|
|
3049
3013
|
out(" Open Integrations → Mapping to map your tables.\n");
|
|
3050
3014
|
return 0;
|
|
3051
3015
|
}
|
|
3052
|
-
|
|
3053
|
-
//#region src/resolve-schema-path.ts
|
|
3016
|
+
// src/resolve-schema-path.ts
|
|
3054
3017
|
const COMMON_PATHS = [
|
|
3055
3018
|
"src/db/schema.ts",
|
|
3056
3019
|
"src/db/schema",
|
|
@@ -3128,8 +3091,7 @@ function resolveSchemaPath(opts) {
|
|
|
3128
3091
|
}
|
|
3129
3092
|
return null;
|
|
3130
3093
|
}
|
|
3131
|
-
|
|
3132
|
-
//#region src/resolve-target-app.ts
|
|
3094
|
+
// src/resolve-target-app.ts
|
|
3133
3095
|
function packageDeps(dir) {
|
|
3134
3096
|
const pkg = readPackageManifest(dir);
|
|
3135
3097
|
return {
|
|
@@ -3208,8 +3170,7 @@ function resolveTargetApp(start, boundary = (0, node_os.homedir)()) {
|
|
|
3208
3170
|
candidates: ranked
|
|
3209
3171
|
};
|
|
3210
3172
|
}
|
|
3211
|
-
|
|
3212
|
-
//#region src/status-ladder.ts
|
|
3173
|
+
// src/status-ladder.ts
|
|
3213
3174
|
const SATISFYING = /* @__PURE__ */ new Set(["pass", "warn"]);
|
|
3214
3175
|
function unmetPrerequisites(stage, satisfied) {
|
|
3215
3176
|
return (stage.needs ?? []).filter((id) => !satisfied.has(id));
|
|
@@ -3259,8 +3220,7 @@ async function runLadder(stages, ctx) {
|
|
|
3259
3220
|
function ladderExitCode(results) {
|
|
3260
3221
|
return results.every((result) => result.state !== "fail" && result.state !== "pending") ? 0 : 1;
|
|
3261
3222
|
}
|
|
3262
|
-
|
|
3263
|
-
//#region src/boot-hook-check.ts
|
|
3223
|
+
// src/boot-hook-check.ts
|
|
3264
3224
|
const REMIX_ENTRY_CANDIDATES = [
|
|
3265
3225
|
"app/entry.server.tsx",
|
|
3266
3226
|
"app/entry.server.ts",
|
|
@@ -3356,8 +3316,7 @@ function checkBootHook(readFile) {
|
|
|
3356
3316
|
detail: site
|
|
3357
3317
|
};
|
|
3358
3318
|
}
|
|
3359
|
-
|
|
3360
|
-
//#region src/cursor-store-check.ts
|
|
3319
|
+
// src/cursor-store-check.ts
|
|
3361
3320
|
/**
|
|
3362
3321
|
* Whether a config that will run on a serverless runtime persists its sync
|
|
3363
3322
|
* cursor.
|
|
@@ -3437,8 +3396,7 @@ function cursorStoreDetail(verdict) {
|
|
|
3437
3396
|
if (verdict.edgeRuntime === null) return "in-memory (fine on a long-lived host)";
|
|
3438
3397
|
return `No \`cursorStore\` on ${verdict.edgeRuntime} — memory does not survive between invocations, so every delta sync re-reads your entire source tables.`;
|
|
3439
3398
|
}
|
|
3440
|
-
|
|
3441
|
-
//#region src/edge-safety.ts
|
|
3399
|
+
// src/edge-safety.ts
|
|
3442
3400
|
const NODE_BUILTINS = /* @__PURE__ */ new Set([
|
|
3443
3401
|
"assert",
|
|
3444
3402
|
"buffer",
|
|
@@ -3592,8 +3550,7 @@ function analyzeConfigTree(input) {
|
|
|
3592
3550
|
}
|
|
3593
3551
|
return issues;
|
|
3594
3552
|
}
|
|
3595
|
-
|
|
3596
|
-
//#region src/status-stages.ts
|
|
3553
|
+
// src/status-stages.ts
|
|
3597
3554
|
const MODULE_CANDIDATES = [
|
|
3598
3555
|
".ts",
|
|
3599
3556
|
".tsx",
|
|
@@ -3851,8 +3808,7 @@ const STATUS_STAGES = [
|
|
|
3851
3808
|
function defaultLoadSdk(path) {
|
|
3852
3809
|
return loadConfigSdk(path, "doctor");
|
|
3853
3810
|
}
|
|
3854
|
-
|
|
3855
|
-
//#region src/workspace-section.ts
|
|
3811
|
+
// src/workspace-section.ts
|
|
3856
3812
|
const MARK$1 = {
|
|
3857
3813
|
active: "⏳",
|
|
3858
3814
|
blocked: "🔒",
|
|
@@ -3889,8 +3845,7 @@ function workspaceSection(result) {
|
|
|
3889
3845
|
lines: result.workspace.steps.map((step) => ` ${MARK$1[step.state]} ${step.label}${step.evidence ? ` ${step.evidence}` : ""}`)
|
|
3890
3846
|
};
|
|
3891
3847
|
}
|
|
3892
|
-
|
|
3893
|
-
//#region src/status.ts
|
|
3848
|
+
// src/status.ts
|
|
3894
3849
|
/** Stage ids each legacy command maps onto. */
|
|
3895
3850
|
const ALIAS_STAGE_IDS = {
|
|
3896
3851
|
status: STATUS_STAGES.map((stage) => stage.id),
|
|
@@ -3972,8 +3927,7 @@ async function runStatus(options) {
|
|
|
3972
3927
|
if (code !== 0 && results.some((result) => result.state === "pending")) out("\nSetup is incomplete — finish the steps above and re-run.\n");
|
|
3973
3928
|
return code;
|
|
3974
3929
|
}
|
|
3975
|
-
|
|
3976
|
-
//#region src/index.ts
|
|
3930
|
+
// src/index.ts
|
|
3977
3931
|
const ENV_FILE_CANDIDATES = [
|
|
3978
3932
|
".env",
|
|
3979
3933
|
".env.local",
|
|
@@ -4814,7 +4768,6 @@ async function main(argv) {
|
|
|
4814
4768
|
if (isEntrypoint(process.argv[1], require("url").pathToFileURL(__filename).href)) main(process.argv.slice(2)).then((code) => {
|
|
4815
4769
|
process.exitCode = code;
|
|
4816
4770
|
});
|
|
4817
|
-
//#endregion
|
|
4818
4771
|
exports.KNOWN_COMMANDS = KNOWN_COMMANDS;
|
|
4819
4772
|
exports.credentialsMissing = credentialsMissing;
|
|
4820
4773
|
exports.main = main;
|
package/index.d.cts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
//#region src/detect.d.ts
|
|
2
1
|
type Framework = "nextjs" | "tanstack-start" | "sveltekit" | "remix" | "nuxt" | "unknown";
|
|
3
2
|
type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/app-layout.d.ts
|
|
6
3
|
type AppLayout = "app" | "src/app";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/workspace-graph.d.ts
|
|
9
4
|
interface WorkspacePackage {
|
|
10
5
|
/** Absolute path to the package directory. */
|
|
11
6
|
dir: string;
|
|
@@ -17,8 +12,6 @@ interface WorkspaceGraph {
|
|
|
17
12
|
/** Absolute path to the workspace root (where the globs are declared). */
|
|
18
13
|
root: string;
|
|
19
14
|
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/discover-schema.d.ts
|
|
22
15
|
interface DiscoveredColumn {
|
|
23
16
|
dbName: string;
|
|
24
17
|
isPrimary: boolean;
|
|
@@ -49,16 +42,12 @@ interface DiscoveredSchema {
|
|
|
49
42
|
importPath: string;
|
|
50
43
|
tables: DiscoveredTable[];
|
|
51
44
|
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/probe-module.d.ts
|
|
54
45
|
interface ProbeHit {
|
|
55
46
|
/** Config-relative specifier to import it from, e.g. "./lib/db". */
|
|
56
47
|
importPath: string;
|
|
57
48
|
/** The name the matching value is exported under. */
|
|
58
49
|
moduleKey: string;
|
|
59
50
|
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/index.d.ts
|
|
62
51
|
export declare const KNOWN_COMMANDS: readonly ["init", "status", "push-schema", "add", "dev", "login", "help", "ping", "doctor", "connect"];
|
|
63
52
|
export declare function nearestCommand(input: string): string | undefined;
|
|
64
53
|
export interface AddDeps {
|
|
@@ -119,4 +108,4 @@ export declare function credentialsMissing(envContents: string): boolean;
|
|
|
119
108
|
export declare function runInit(options: RunInitOptions): Promise<number>;
|
|
120
109
|
export declare function runInitFromArgv(argv: string[], cwd: string): Promise<number>;
|
|
121
110
|
export declare function main(argv: string[]): Promise<number>;
|
|
122
|
-
|
|
111
|
+
export {};
|
package/index.d.mts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
//#region src/detect.d.ts
|
|
2
1
|
type Framework = "nextjs" | "tanstack-start" | "sveltekit" | "remix" | "nuxt" | "unknown";
|
|
3
2
|
type PackageManager = "npm" | "pnpm" | "yarn" | "bun";
|
|
4
|
-
//#endregion
|
|
5
|
-
//#region src/app-layout.d.ts
|
|
6
3
|
type AppLayout = "app" | "src/app";
|
|
7
|
-
//#endregion
|
|
8
|
-
//#region src/workspace-graph.d.ts
|
|
9
4
|
interface WorkspacePackage {
|
|
10
5
|
/** Absolute path to the package directory. */
|
|
11
6
|
dir: string;
|
|
@@ -17,8 +12,6 @@ interface WorkspaceGraph {
|
|
|
17
12
|
/** Absolute path to the workspace root (where the globs are declared). */
|
|
18
13
|
root: string;
|
|
19
14
|
}
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/discover-schema.d.ts
|
|
22
15
|
interface DiscoveredColumn {
|
|
23
16
|
dbName: string;
|
|
24
17
|
isPrimary: boolean;
|
|
@@ -49,16 +42,12 @@ interface DiscoveredSchema {
|
|
|
49
42
|
importPath: string;
|
|
50
43
|
tables: DiscoveredTable[];
|
|
51
44
|
}
|
|
52
|
-
//#endregion
|
|
53
|
-
//#region src/probe-module.d.ts
|
|
54
45
|
interface ProbeHit {
|
|
55
46
|
/** Config-relative specifier to import it from, e.g. "./lib/db". */
|
|
56
47
|
importPath: string;
|
|
57
48
|
/** The name the matching value is exported under. */
|
|
58
49
|
moduleKey: string;
|
|
59
50
|
}
|
|
60
|
-
//#endregion
|
|
61
|
-
//#region src/index.d.ts
|
|
62
51
|
export declare const KNOWN_COMMANDS: readonly ["init", "status", "push-schema", "add", "dev", "login", "help", "ping", "doctor", "connect"];
|
|
63
52
|
export declare function nearestCommand(input: string): string | undefined;
|
|
64
53
|
export interface AddDeps {
|
|
@@ -119,4 +108,4 @@ export declare function credentialsMissing(envContents: string): boolean;
|
|
|
119
108
|
export declare function runInit(options: RunInitOptions): Promise<number>;
|
|
120
109
|
export declare function runInitFromArgv(argv: string[], cwd: string): Promise<number>;
|
|
121
110
|
export declare function main(argv: string[]): Promise<number>;
|
|
122
|
-
|
|
111
|
+
export {};
|