@embeddables/cli 0.8.1 → 0.8.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/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +9 -2
- package/dist/compiler/reverse.d.ts.map +1 -1
- package/dist/compiler/reverse.js +19 -1
- package/dist/helpers/utils.d.ts +5 -0
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +13 -4
- package/dist/prompts/embeddables.d.ts.map +1 -1
- package/dist/prompts/embeddables.js +4 -1
- package/package.json +2 -1
- package/dist/command-history.d.ts +0 -13
- package/dist/command-history.d.ts.map +0 -1
- package/dist/command-history.js +0 -34
- package/dist/commands/diff.d.ts +0 -76
- package/dist/commands/diff.d.ts.map +0 -1
- package/dist/commands/diff.js +0 -653
- package/dist/commands/feedback.d.ts +0 -29
- package/dist/commands/feedback.d.ts.map +0 -1
- package/dist/commands/feedback.js +0 -267
- package/dist/compiler/flatten.js +0 -1
- package/dist/helpers/TEMP helpers file.d.ts +0 -1
- package/dist/helpers/TEMP helpers file.d.ts.map +0 -1
- package/dist/helpers/TEMP helpers file.js +0 -1
- package/dist/workbench/cloudflare-worker/README.md +0 -31
- package/dist/workbench/cloudflare-worker/public/workbench.css +0 -1614
- package/dist/workbench/cloudflare-worker/public/workbench.js +0 -77
- package/dist/workbench/cloudflare-worker/worker.js +0 -40
- package/dist/workbench/cloudflare-worker/wrangler.toml +0 -10
- package/dist/workbench/workbench.css +0 -1614
- package/dist/workbench/workbench.js +0 -77
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAiIA,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sGAAsG;IACtG,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,6FAA6F;IAC7F,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,iHAAiH;IACjH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"pull.d.ts","sourceRoot":"","sources":["../../src/commands/pull.ts"],"names":[],"mappings":"AAiIA,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,sGAAsG;IACtG,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACzB,6FAA6F;IAC7F,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,iHAAiH;IACjH,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAAA;AAED,wBAAsB,OAAO,CAAC,IAAI,EAAE,cAAc,iBAoVjD"}
|
package/dist/commands/pull.js
CHANGED
|
@@ -254,8 +254,15 @@ export async function runPull(opts) {
|
|
|
254
254
|
}
|
|
255
255
|
// Persist _version and _branch_id in config.json immediately so they survive reverseCompile
|
|
256
256
|
writePullMetadataToConfig(embeddableId, version, effectiveBranch, effectiveBranchName);
|
|
257
|
-
// Fetch and save flow metadata from DB (title, archived, created_at)
|
|
258
|
-
|
|
257
|
+
// Fetch and save flow metadata from DB (title, archived, created_at).
|
|
258
|
+
// The engine can resolve project slugs (e.g. "cursor-telehealth") to actual flows,
|
|
259
|
+
// so the flow.id from the response may differ from the user-provided embeddableId.
|
|
260
|
+
// Try the engine-reported flow ID first, then fall back to the user-provided ID.
|
|
261
|
+
const flowIdFromEngine = flow.id;
|
|
262
|
+
let metadata = await fetchEmbeddableMetadata(embeddableId);
|
|
263
|
+
if (!metadata && typeof flowIdFromEngine === 'string' && flowIdFromEngine !== embeddableId) {
|
|
264
|
+
metadata = await fetchEmbeddableMetadata(flowIdFromEngine);
|
|
265
|
+
}
|
|
259
266
|
if (metadata) {
|
|
260
267
|
const metadataPath = path.join('embeddables', embeddableId, 'metadata.json');
|
|
261
268
|
fs.mkdirSync(path.dirname(metadataPath), { recursive: true });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../src/compiler/reverse.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAA;AAqnBzD,wBAAsB,cAAc,CAClC,UAAU,EAAE;IACV,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAA;IACtB,WAAW,CAAC,EAAE,GAAG,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,EACD,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE;IACL,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5E,iBAkFF;
|
|
1
|
+
{"version":3,"file":"reverse.d.ts","sourceRoot":"","sources":["../../src/compiler/reverse.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,QAAQ,EAAiB,MAAM,YAAY,CAAA;AAqnBzD,wBAAsB,cAAc,CAClC,UAAU,EAAE;IACV,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,QAAQ,EAAE,CAAA;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC5B,cAAc,CAAC,EAAE,GAAG,EAAE,CAAA;IACtB,WAAW,CAAC,EAAE,GAAG,EAAE,CAAA;IACnB,UAAU,CAAC,EAAE,GAAG,EAAE,CAAA;IAClB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,EACD,YAAY,EAAE,MAAM,EACpB,IAAI,CAAC,EAAE;IACL,GAAG,CAAC,EAAE,OAAO,CAAA;IACb,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,YAAY,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;QAAC,UAAU,CAAC,EAAE,MAAM,CAAA;KAAE,CAAA;CAC5E,iBAkFF;AAkiDD;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKpD"}
|
package/dist/compiler/reverse.js
CHANGED
|
@@ -1189,6 +1189,19 @@ function htmlToJSXChildren(html, indent) {
|
|
|
1189
1189
|
break;
|
|
1190
1190
|
}
|
|
1191
1191
|
}
|
|
1192
|
+
// Skip <!DOCTYPE ...>, <?xml ...?>, and other non-element tags that the
|
|
1193
|
+
// main tag regex cannot match. Without this guard `pos` would never
|
|
1194
|
+
// advance, causing an infinite loop.
|
|
1195
|
+
if (html[pos] === '<' && (html[pos + 1] === '!' || html[pos + 1] === '?')) {
|
|
1196
|
+
const gtIdx = html.indexOf('>', pos);
|
|
1197
|
+
if (gtIdx !== -1) {
|
|
1198
|
+
pos = gtIdx + 1;
|
|
1199
|
+
continue;
|
|
1200
|
+
}
|
|
1201
|
+
else {
|
|
1202
|
+
break;
|
|
1203
|
+
}
|
|
1204
|
+
}
|
|
1192
1205
|
// Check for HTML tag
|
|
1193
1206
|
const tagMatch = html.slice(pos).match(/^<(\/?)([a-zA-Z][a-zA-Z0-9]*)\s*([^>]*)>/);
|
|
1194
1207
|
if (tagMatch) {
|
|
@@ -1360,8 +1373,13 @@ function htmlToJSXChildren(html, indent) {
|
|
|
1360
1373
|
result.push(`${indentStr}<${tagName}${attrsStr} />`);
|
|
1361
1374
|
continue;
|
|
1362
1375
|
}
|
|
1363
|
-
// Text content
|
|
1376
|
+
// Text content — if the next '<' is at the current position the character
|
|
1377
|
+
// wasn't consumed by any handler above. Skip it so we never stall.
|
|
1364
1378
|
const textEnd = html.indexOf('<', pos);
|
|
1379
|
+
if (textEnd === pos) {
|
|
1380
|
+
pos++;
|
|
1381
|
+
continue;
|
|
1382
|
+
}
|
|
1365
1383
|
if (textEnd === -1) {
|
|
1366
1384
|
// Rest is text
|
|
1367
1385
|
const text = html.slice(pos).trim();
|
package/dist/helpers/utils.d.ts
CHANGED
|
@@ -3,6 +3,11 @@ export declare function generateId(prefix: string): string;
|
|
|
3
3
|
* If the current working directory is inside embeddables/<id>/ (or a subfolder),
|
|
4
4
|
* returns that embeddable id and the project root (the directory containing the
|
|
5
5
|
* embeddables/ folder). Otherwise returns null.
|
|
6
|
+
*
|
|
7
|
+
* To avoid false positives (e.g. the user has a personal folder called "embeddables"
|
|
8
|
+
* containing multiple project directories), we verify that the candidate project root
|
|
9
|
+
* contains an embeddables.json config file — the canonical marker of an Embeddables project.
|
|
10
|
+
*
|
|
6
11
|
* When using the inferred id, callers should chdir(projectRoot) so relative
|
|
7
12
|
* paths like embeddables/<id>/... resolve correctly.
|
|
8
13
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/helpers/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,UAIxC;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,sBAAsB,IAAI;IAAE,YAAY,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAiB7F"}
|
package/dist/helpers/utils.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import fs from 'node:fs';
|
|
1
2
|
import path from 'node:path';
|
|
2
3
|
export function generateId(prefix) {
|
|
3
4
|
const randomString = Math.random().toString(20).slice(2) + Math.random().toString(20).slice(2);
|
|
@@ -7,6 +8,11 @@ export function generateId(prefix) {
|
|
|
7
8
|
* If the current working directory is inside embeddables/<id>/ (or a subfolder),
|
|
8
9
|
* returns that embeddable id and the project root (the directory containing the
|
|
9
10
|
* embeddables/ folder). Otherwise returns null.
|
|
11
|
+
*
|
|
12
|
+
* To avoid false positives (e.g. the user has a personal folder called "embeddables"
|
|
13
|
+
* containing multiple project directories), we verify that the candidate project root
|
|
14
|
+
* contains an embeddables.json config file — the canonical marker of an Embeddables project.
|
|
15
|
+
*
|
|
10
16
|
* When using the inferred id, callers should chdir(projectRoot) so relative
|
|
11
17
|
* paths like embeddables/<id>/... resolve correctly.
|
|
12
18
|
*/
|
|
@@ -17,10 +23,13 @@ export function inferEmbeddableFromCwd() {
|
|
|
17
23
|
if (parent === current)
|
|
18
24
|
break;
|
|
19
25
|
if (path.basename(parent) === 'embeddables') {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
26
|
+
const projectRoot = path.dirname(parent);
|
|
27
|
+
if (fs.existsSync(path.join(projectRoot, 'embeddables.json'))) {
|
|
28
|
+
return {
|
|
29
|
+
embeddableId: path.basename(current),
|
|
30
|
+
projectRoot,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
24
33
|
}
|
|
25
34
|
current = parent;
|
|
26
35
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"embeddables.d.ts","sourceRoot":"","sources":["../../src/prompts/embeddables.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kFAAkF;IAClF,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAqC1F;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"embeddables.d.ts","sourceRoot":"","sources":["../../src/prompts/embeddables.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kFAAkF;IAClF,eAAe,CAAC,EAAE,OAAO,CAAA;CAC1B;AAED;;GAEG;AACH,wBAAsB,uBAAuB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC,CAqC1F;AAED;;;GAGG;AACH,wBAAsB,uBAAuB,CAC3C,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,GAAG,IAAI,CAAC,CA+BpC;AAED;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAqExB;AAED;;GAEG;AACH,wBAAsB,wBAAwB,IAAI,OAAO,CAAC,eAAe,EAAE,CAAC,CAqC3E;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,GAAE,0BAA+B,GACvC,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAgCxB"}
|
|
@@ -57,11 +57,14 @@ export async function fetchEmbeddableMetadata(embeddableId) {
|
|
|
57
57
|
.from('flows')
|
|
58
58
|
.select('title, archived, created_at')
|
|
59
59
|
.eq('id', embeddableId)
|
|
60
|
-
.
|
|
60
|
+
.maybeSingle();
|
|
61
61
|
if (error) {
|
|
62
62
|
stdout.warn(pc.yellow(`Could not fetch embeddable metadata: ${error.message}`));
|
|
63
63
|
return null;
|
|
64
64
|
}
|
|
65
|
+
if (!data) {
|
|
66
|
+
return null;
|
|
67
|
+
}
|
|
65
68
|
return {
|
|
66
69
|
title: data.title || null,
|
|
67
70
|
archived: data.archived ?? false,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@embeddables/cli",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"bin": {
|
|
6
6
|
"embeddables": "./bin/embeddables.mjs"
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"test:verbose": "vitest --reporter verbose",
|
|
46
46
|
"build:prompts": "node scripts/build-prompts.cjs",
|
|
47
47
|
"prepack": "node scripts/readme-swap.cjs prepack",
|
|
48
|
+
"prepublishOnly": "npm run build",
|
|
48
49
|
"postpack": "node scripts/readme-swap.cjs postpack"
|
|
49
50
|
},
|
|
50
51
|
"dependencies": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export interface CommandHistoryEntry {
|
|
2
|
-
command: string;
|
|
3
|
-
args: string[];
|
|
4
|
-
exitCode: number;
|
|
5
|
-
durationMs: number;
|
|
6
|
-
timestamp: string;
|
|
7
|
-
error?: string;
|
|
8
|
-
}
|
|
9
|
-
export declare function getHistoryFilePath(): string;
|
|
10
|
-
export declare function readHistory(): CommandHistoryEntry[];
|
|
11
|
-
export declare function writeHistoryEntry(entry: CommandHistoryEntry): void;
|
|
12
|
-
export declare function getLastHistoryEntry(): CommandHistoryEntry | null;
|
|
13
|
-
//# sourceMappingURL=command-history.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"command-history.d.ts","sourceRoot":"","sources":["../src/command-history.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,wBAAgB,kBAAkB,IAAI,MAAM,CAE3C;AAED,wBAAgB,WAAW,IAAI,mBAAmB,EAAE,CAUnD;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,GAAG,IAAI,CAMlE;AAED,wBAAgB,mBAAmB,IAAI,mBAAmB,GAAG,IAAI,CAGhE"}
|
package/dist/command-history.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs';
|
|
2
|
-
import os from 'node:os';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
const MAX_ENTRIES = 20;
|
|
5
|
-
const HISTORY_DIR = path.join(os.homedir(), '.embeddables');
|
|
6
|
-
const HISTORY_FILE = path.join(HISTORY_DIR, 'history.json');
|
|
7
|
-
export function getHistoryFilePath() {
|
|
8
|
-
return HISTORY_FILE;
|
|
9
|
-
}
|
|
10
|
-
export function readHistory() {
|
|
11
|
-
try {
|
|
12
|
-
if (!fs.existsSync(HISTORY_FILE))
|
|
13
|
-
return [];
|
|
14
|
-
const raw = fs.readFileSync(HISTORY_FILE, 'utf8');
|
|
15
|
-
const parsed = JSON.parse(raw);
|
|
16
|
-
if (!Array.isArray(parsed))
|
|
17
|
-
return [];
|
|
18
|
-
return parsed;
|
|
19
|
-
}
|
|
20
|
-
catch {
|
|
21
|
-
return [];
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
export function writeHistoryEntry(entry) {
|
|
25
|
-
const history = readHistory();
|
|
26
|
-
history.push(entry);
|
|
27
|
-
const trimmed = history.slice(-MAX_ENTRIES);
|
|
28
|
-
fs.mkdirSync(HISTORY_DIR, { recursive: true });
|
|
29
|
-
fs.writeFileSync(HISTORY_FILE, JSON.stringify(trimmed, null, 2), 'utf8');
|
|
30
|
-
}
|
|
31
|
-
export function getLastHistoryEntry() {
|
|
32
|
-
const history = readHistory();
|
|
33
|
-
return history.length > 0 ? history[history.length - 1] : null;
|
|
34
|
-
}
|
package/dist/commands/diff.d.ts
DELETED
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
export type DiffDepth = 'pages' | 'components' | 'props';
|
|
2
|
-
export type RunDiffOptions = {
|
|
3
|
-
id?: string;
|
|
4
|
-
from?: string;
|
|
5
|
-
to?: string;
|
|
6
|
-
depth?: DiffDepth;
|
|
7
|
-
color?: boolean;
|
|
8
|
-
engine?: string;
|
|
9
|
-
branch?: string;
|
|
10
|
-
};
|
|
11
|
-
export interface PageDiff {
|
|
12
|
-
key: string;
|
|
13
|
-
title?: string;
|
|
14
|
-
status: 'added' | 'removed' | 'modified';
|
|
15
|
-
components?: ComponentDiff[];
|
|
16
|
-
}
|
|
17
|
-
export interface ComponentDiff {
|
|
18
|
-
id: string;
|
|
19
|
-
key?: string;
|
|
20
|
-
type?: string;
|
|
21
|
-
status: 'added' | 'removed' | 'modified';
|
|
22
|
-
props?: PropDiff[];
|
|
23
|
-
}
|
|
24
|
-
export interface PropDiff {
|
|
25
|
-
name: string;
|
|
26
|
-
status: 'added' | 'removed' | 'changed';
|
|
27
|
-
from?: unknown;
|
|
28
|
-
to?: unknown;
|
|
29
|
-
}
|
|
30
|
-
export interface SectionDiff {
|
|
31
|
-
name: string;
|
|
32
|
-
status: 'added' | 'removed' | 'modified';
|
|
33
|
-
}
|
|
34
|
-
export interface DiffSummary {
|
|
35
|
-
pagesAdded: number;
|
|
36
|
-
pagesRemoved: number;
|
|
37
|
-
pagesModified: number;
|
|
38
|
-
componentsAdded: number;
|
|
39
|
-
componentsRemoved: number;
|
|
40
|
-
componentsModified: number;
|
|
41
|
-
propsAdded: number;
|
|
42
|
-
propsRemoved: number;
|
|
43
|
-
propsChanged: number;
|
|
44
|
-
}
|
|
45
|
-
export interface DiffResult {
|
|
46
|
-
pages: PageDiff[];
|
|
47
|
-
globalComponents: ComponentDiff[];
|
|
48
|
-
sections: SectionDiff[];
|
|
49
|
-
summary: DiffSummary;
|
|
50
|
-
}
|
|
51
|
-
type Colorizer = {
|
|
52
|
-
red: (s: string) => string;
|
|
53
|
-
green: (s: string) => string;
|
|
54
|
-
yellow: (s: string) => string;
|
|
55
|
-
gray: (s: string) => string;
|
|
56
|
-
bold: (s: string) => string;
|
|
57
|
-
cyan: (s: string) => string;
|
|
58
|
-
dim: (s: string) => string;
|
|
59
|
-
white: (s: string) => string;
|
|
60
|
-
};
|
|
61
|
-
export interface ParsedVersionSpec {
|
|
62
|
-
version: string;
|
|
63
|
-
branch?: string;
|
|
64
|
-
}
|
|
65
|
-
export declare function parseVersionSpecifier(spec: string): ParsedVersionSpec;
|
|
66
|
-
export declare function versionLabel(spec: ParsedVersionSpec): string;
|
|
67
|
-
export declare function resolveLocalVersion(embeddableId: string): Promise<Record<string, unknown>>;
|
|
68
|
-
export declare function fetchCloudVersion(embeddableId: string, version: string, opts: {
|
|
69
|
-
engine?: string;
|
|
70
|
-
branch?: string;
|
|
71
|
-
}): Promise<Record<string, unknown>>;
|
|
72
|
-
export declare function computeDiff(from: Record<string, unknown>, to: Record<string, unknown>, depth: DiffDepth): DiffResult;
|
|
73
|
-
export declare function renderDiff(diff: DiffResult, depth: DiffDepth, c: Colorizer): string[];
|
|
74
|
-
export declare function runDiff(opts: RunDiffOptions): Promise<void>;
|
|
75
|
-
export {};
|
|
76
|
-
//# sourceMappingURL=diff.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"diff.d.ts","sourceRoot":"","sources":["../../src/commands/diff.ts"],"names":[],"mappings":"AAkBA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,YAAY,GAAG,OAAO,CAAA;AAExD,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,SAAS,CAAA;IACjB,KAAK,CAAC,EAAE,OAAO,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,OAAO,GAAG,SAAS,GAAG,UAAU,CAAA;IACx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