@uniformdev/cli 19.7.0 → 19.9.2-alpha.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.mjs +86 -221
- package/package.json +10 -11
package/dist/index.mjs
CHANGED
|
@@ -1,30 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
var __accessCheck = (obj, member, msg) => {
|
|
3
|
-
if (!member.has(obj))
|
|
4
|
-
throw TypeError("Cannot " + msg);
|
|
5
|
-
};
|
|
6
|
-
var __privateGet = (obj, member, getter) => {
|
|
7
|
-
__accessCheck(obj, member, "read from private field");
|
|
8
|
-
return getter ? getter.call(obj) : member.get(obj);
|
|
9
|
-
};
|
|
10
|
-
var __privateAdd = (obj, member, value) => {
|
|
11
|
-
if (member.has(obj))
|
|
12
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
13
|
-
member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
|
|
14
|
-
};
|
|
15
|
-
var __privateSet = (obj, member, value, setter) => {
|
|
16
|
-
__accessCheck(obj, member, "write to private field");
|
|
17
|
-
setter ? setter.call(obj, value) : member.set(obj, value);
|
|
18
|
-
return value;
|
|
19
|
-
};
|
|
20
|
-
var __privateWrapper = (obj, member, setter, getter) => ({
|
|
21
|
-
set _(value) {
|
|
22
|
-
__privateSet(obj, member, value, setter);
|
|
23
|
-
},
|
|
24
|
-
get _() {
|
|
25
|
-
return __privateGet(obj, member, getter);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
2
|
|
|
29
3
|
// src/index.ts
|
|
30
4
|
import * as dotenv from "dotenv";
|
|
@@ -94,7 +68,7 @@ async function createArraySyncEngineDataSource({
|
|
|
94
68
|
}
|
|
95
69
|
|
|
96
70
|
// src/sync/fileSyncEngineDataSource.ts
|
|
97
|
-
import
|
|
71
|
+
import ansicolors from "ansi-colors";
|
|
98
72
|
import { existsSync, mkdirSync } from "fs";
|
|
99
73
|
import { readdir, unlink } from "fs/promises";
|
|
100
74
|
import { extname as extname2, join } from "path";
|
|
@@ -241,6 +215,7 @@ async function* paginateAsync(fetchPage, options) {
|
|
|
241
215
|
}
|
|
242
216
|
|
|
243
217
|
// src/sync/fileSyncEngineDataSource.ts
|
|
218
|
+
var { red } = ansicolors;
|
|
244
219
|
async function createFileSyncEngineDataSource({
|
|
245
220
|
directory,
|
|
246
221
|
format = "yaml",
|
|
@@ -274,7 +249,7 @@ async function createFileSyncEngineDataSource({
|
|
|
274
249
|
};
|
|
275
250
|
yield object;
|
|
276
251
|
} catch (e) {
|
|
277
|
-
console.error(
|
|
252
|
+
console.error(red(`Failed to read ${fullFilename}, data is likely invalid.
|
|
278
253
|
${e == null ? void 0 : e.message}`));
|
|
279
254
|
throw e;
|
|
280
255
|
}
|
|
@@ -460,36 +435,37 @@ ${innerError}`
|
|
|
460
435
|
};
|
|
461
436
|
|
|
462
437
|
// src/sync/syncEngineConsoleLogger.ts
|
|
463
|
-
import
|
|
438
|
+
import ansicolors2 from "ansi-colors";
|
|
439
|
+
var { gray, green, red: red2, white, yellow } = ansicolors2;
|
|
464
440
|
function createSyncEngineConsoleLogger(options) {
|
|
465
441
|
const { diffMode = "off", indent, prefix } = options ?? {};
|
|
466
442
|
return function syncEngineConsoleLogger({ action, displayName, whatIf, diff }) {
|
|
467
443
|
let actionTag = "";
|
|
468
444
|
switch (action) {
|
|
469
445
|
case "create":
|
|
470
|
-
actionTag =
|
|
446
|
+
actionTag = green("[A]");
|
|
471
447
|
break;
|
|
472
448
|
case "update":
|
|
473
|
-
actionTag =
|
|
449
|
+
actionTag = white("[U]");
|
|
474
450
|
break;
|
|
475
451
|
case "delete":
|
|
476
|
-
actionTag =
|
|
452
|
+
actionTag = yellow("[D]");
|
|
477
453
|
break;
|
|
478
454
|
}
|
|
479
455
|
let diffString = "";
|
|
480
456
|
if (diffMode === "on" || diffMode === "update" && action === "update") {
|
|
481
457
|
diffString = "\n" + diff.map((change) => {
|
|
482
458
|
if (change.added) {
|
|
483
|
-
return
|
|
459
|
+
return green(change.value);
|
|
484
460
|
}
|
|
485
461
|
if (change.removed) {
|
|
486
|
-
return
|
|
462
|
+
return red2(change.value);
|
|
487
463
|
}
|
|
488
464
|
return change.value;
|
|
489
465
|
}).join("");
|
|
490
466
|
}
|
|
491
467
|
console.log(
|
|
492
|
-
`${indent ?? ""}${whatIf ?
|
|
468
|
+
`${indent ?? ""}${whatIf ? gray("[WHATIF]") : ""}${actionTag}${prefix ?? ""} ${displayName}${diffString}`
|
|
493
469
|
);
|
|
494
470
|
};
|
|
495
471
|
}
|
|
@@ -597,148 +573,6 @@ function writeCanvasPackage(filename, packageContents) {
|
|
|
597
573
|
writeUniformPackage(filename, packageContents);
|
|
598
574
|
}
|
|
599
575
|
|
|
600
|
-
// src/commands/canvas/util.ts
|
|
601
|
-
import { CANVAS_DRAFT_STATE, CANVAS_PUBLISHED_STATE } from "@uniformdev/canvas";
|
|
602
|
-
|
|
603
|
-
// ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
|
|
604
|
-
var Node = class {
|
|
605
|
-
value;
|
|
606
|
-
next;
|
|
607
|
-
constructor(value) {
|
|
608
|
-
this.value = value;
|
|
609
|
-
}
|
|
610
|
-
};
|
|
611
|
-
var _head, _tail, _size;
|
|
612
|
-
var Queue = class {
|
|
613
|
-
constructor() {
|
|
614
|
-
__privateAdd(this, _head, void 0);
|
|
615
|
-
__privateAdd(this, _tail, void 0);
|
|
616
|
-
__privateAdd(this, _size, void 0);
|
|
617
|
-
this.clear();
|
|
618
|
-
}
|
|
619
|
-
enqueue(value) {
|
|
620
|
-
const node = new Node(value);
|
|
621
|
-
if (__privateGet(this, _head)) {
|
|
622
|
-
__privateGet(this, _tail).next = node;
|
|
623
|
-
__privateSet(this, _tail, node);
|
|
624
|
-
} else {
|
|
625
|
-
__privateSet(this, _head, node);
|
|
626
|
-
__privateSet(this, _tail, node);
|
|
627
|
-
}
|
|
628
|
-
__privateWrapper(this, _size)._++;
|
|
629
|
-
}
|
|
630
|
-
dequeue() {
|
|
631
|
-
const current = __privateGet(this, _head);
|
|
632
|
-
if (!current) {
|
|
633
|
-
return;
|
|
634
|
-
}
|
|
635
|
-
__privateSet(this, _head, __privateGet(this, _head).next);
|
|
636
|
-
__privateWrapper(this, _size)._--;
|
|
637
|
-
return current.value;
|
|
638
|
-
}
|
|
639
|
-
clear() {
|
|
640
|
-
__privateSet(this, _head, void 0);
|
|
641
|
-
__privateSet(this, _tail, void 0);
|
|
642
|
-
__privateSet(this, _size, 0);
|
|
643
|
-
}
|
|
644
|
-
get size() {
|
|
645
|
-
return __privateGet(this, _size);
|
|
646
|
-
}
|
|
647
|
-
*[Symbol.iterator]() {
|
|
648
|
-
let current = __privateGet(this, _head);
|
|
649
|
-
while (current) {
|
|
650
|
-
yield current.value;
|
|
651
|
-
current = current.next;
|
|
652
|
-
}
|
|
653
|
-
}
|
|
654
|
-
};
|
|
655
|
-
_head = new WeakMap();
|
|
656
|
-
_tail = new WeakMap();
|
|
657
|
-
_size = new WeakMap();
|
|
658
|
-
|
|
659
|
-
// ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
|
|
660
|
-
function pLimit(concurrency) {
|
|
661
|
-
if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
|
|
662
|
-
throw new TypeError("Expected `concurrency` to be a number from 1 and up");
|
|
663
|
-
}
|
|
664
|
-
const queue = new Queue();
|
|
665
|
-
let activeCount = 0;
|
|
666
|
-
const next = () => {
|
|
667
|
-
activeCount--;
|
|
668
|
-
if (queue.size > 0) {
|
|
669
|
-
queue.dequeue()();
|
|
670
|
-
}
|
|
671
|
-
};
|
|
672
|
-
const run = async (fn, resolve, args) => {
|
|
673
|
-
activeCount++;
|
|
674
|
-
const result = (async () => fn(...args))();
|
|
675
|
-
resolve(result);
|
|
676
|
-
try {
|
|
677
|
-
await result;
|
|
678
|
-
} catch {
|
|
679
|
-
}
|
|
680
|
-
next();
|
|
681
|
-
};
|
|
682
|
-
const enqueue = (fn, resolve, args) => {
|
|
683
|
-
queue.enqueue(run.bind(void 0, fn, resolve, args));
|
|
684
|
-
(async () => {
|
|
685
|
-
await Promise.resolve();
|
|
686
|
-
if (activeCount < concurrency && queue.size > 0) {
|
|
687
|
-
queue.dequeue()();
|
|
688
|
-
}
|
|
689
|
-
})();
|
|
690
|
-
};
|
|
691
|
-
const generator = (fn, ...args) => new Promise((resolve) => {
|
|
692
|
-
enqueue(fn, resolve, args);
|
|
693
|
-
});
|
|
694
|
-
Object.defineProperties(generator, {
|
|
695
|
-
activeCount: {
|
|
696
|
-
get: () => activeCount
|
|
697
|
-
},
|
|
698
|
-
pendingCount: {
|
|
699
|
-
get: () => queue.size
|
|
700
|
-
},
|
|
701
|
-
clearQueue: {
|
|
702
|
-
value: () => {
|
|
703
|
-
queue.clear();
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
return generator;
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
// src/commands/canvas/util.ts
|
|
711
|
-
function prepCompositionForDisk(composition) {
|
|
712
|
-
const prepped = {
|
|
713
|
-
...composition
|
|
714
|
-
};
|
|
715
|
-
delete prepped.projectId;
|
|
716
|
-
delete prepped.state;
|
|
717
|
-
return prepped;
|
|
718
|
-
}
|
|
719
|
-
function withStateOptions(yargs20) {
|
|
720
|
-
return yargs20.option("state", {
|
|
721
|
-
type: "string",
|
|
722
|
-
describe: `Composition state to fetch.`,
|
|
723
|
-
choices: ["preview", "published"],
|
|
724
|
-
default: "preview"
|
|
725
|
-
});
|
|
726
|
-
}
|
|
727
|
-
function convertCompositionState(state) {
|
|
728
|
-
const number = Number(state);
|
|
729
|
-
if (!isNaN(number)) {
|
|
730
|
-
return number;
|
|
731
|
-
}
|
|
732
|
-
if (!state) {
|
|
733
|
-
return CANVAS_PUBLISHED_STATE;
|
|
734
|
-
}
|
|
735
|
-
if (typeof state !== "string") {
|
|
736
|
-
throw new Error('state must be "published", "preview", or a number');
|
|
737
|
-
}
|
|
738
|
-
return state === "preview" ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE;
|
|
739
|
-
}
|
|
740
|
-
var limitPolicy = pLimit(8);
|
|
741
|
-
|
|
742
576
|
// src/commands/canvas/commands/component/pull.ts
|
|
743
577
|
var ComponentPullModule = {
|
|
744
578
|
command: "pull <directory>",
|
|
@@ -782,7 +616,7 @@ var ComponentPullModule = {
|
|
|
782
616
|
diff: diffMode
|
|
783
617
|
}) => {
|
|
784
618
|
const fetch3 = nodeFetchProxy(proxy);
|
|
785
|
-
const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId
|
|
619
|
+
const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
786
620
|
const source = createComponentDefinitionEngineDataSource({ client });
|
|
787
621
|
let target;
|
|
788
622
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -853,7 +687,7 @@ var ComponentPushModule = {
|
|
|
853
687
|
diff: diffMode
|
|
854
688
|
}) => {
|
|
855
689
|
const fetch3 = nodeFetchProxy(proxy);
|
|
856
|
-
const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId
|
|
690
|
+
const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
857
691
|
let source;
|
|
858
692
|
const isPackage = isPathAPackageFile(directory);
|
|
859
693
|
if (isPackage) {
|
|
@@ -935,6 +769,40 @@ import yargs2 from "yargs";
|
|
|
935
769
|
|
|
936
770
|
// src/commands/canvas/commands/composition/get.ts
|
|
937
771
|
import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canvas";
|
|
772
|
+
|
|
773
|
+
// src/commands/canvas/util.ts
|
|
774
|
+
import { CANVAS_DRAFT_STATE, CANVAS_PUBLISHED_STATE } from "@uniformdev/canvas";
|
|
775
|
+
function prepCompositionForDisk(composition) {
|
|
776
|
+
const prepped = {
|
|
777
|
+
...composition
|
|
778
|
+
};
|
|
779
|
+
delete prepped.projectId;
|
|
780
|
+
delete prepped.state;
|
|
781
|
+
return prepped;
|
|
782
|
+
}
|
|
783
|
+
function withStateOptions(yargs20) {
|
|
784
|
+
return yargs20.option("state", {
|
|
785
|
+
type: "string",
|
|
786
|
+
describe: `Composition state to fetch.`,
|
|
787
|
+
choices: ["preview", "published"],
|
|
788
|
+
default: "preview"
|
|
789
|
+
});
|
|
790
|
+
}
|
|
791
|
+
function convertCompositionState(state) {
|
|
792
|
+
const number = Number(state);
|
|
793
|
+
if (!isNaN(number)) {
|
|
794
|
+
return number;
|
|
795
|
+
}
|
|
796
|
+
if (!state) {
|
|
797
|
+
return CANVAS_PUBLISHED_STATE;
|
|
798
|
+
}
|
|
799
|
+
if (typeof state !== "string") {
|
|
800
|
+
throw new Error('state must be "published", "preview", or a number');
|
|
801
|
+
}
|
|
802
|
+
return state === "preview" ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE;
|
|
803
|
+
}
|
|
804
|
+
|
|
805
|
+
// src/commands/canvas/commands/composition/get.ts
|
|
938
806
|
var CompositionGetModule = {
|
|
939
807
|
command: "get <id>",
|
|
940
808
|
describe: "Fetch a composition",
|
|
@@ -1156,7 +1024,7 @@ var CompositionPublishModule = {
|
|
|
1156
1024
|
}
|
|
1157
1025
|
const compositionIDsArray = compositionIDs ? compositionIDs.split(",").map((id) => id.trim()) : void 0;
|
|
1158
1026
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1159
|
-
const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId
|
|
1027
|
+
const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1160
1028
|
const source = createComponentInstanceEngineDataSource({
|
|
1161
1029
|
client,
|
|
1162
1030
|
state: "preview",
|
|
@@ -1224,7 +1092,7 @@ var CompositionPullModule = {
|
|
|
1224
1092
|
diff: diffMode
|
|
1225
1093
|
}) => {
|
|
1226
1094
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1227
|
-
const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId
|
|
1095
|
+
const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1228
1096
|
const source = createComponentInstanceEngineDataSource({ client, state });
|
|
1229
1097
|
const isPackage = isPathAPackageFile(directory);
|
|
1230
1098
|
let target;
|
|
@@ -1297,7 +1165,7 @@ var CompositionPushModule = {
|
|
|
1297
1165
|
diff: diffMode
|
|
1298
1166
|
}) => {
|
|
1299
1167
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1300
|
-
const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId
|
|
1168
|
+
const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1301
1169
|
let source;
|
|
1302
1170
|
const isPackage = isPathAPackageFile(directory);
|
|
1303
1171
|
if (isPackage) {
|
|
@@ -1520,7 +1388,6 @@ var DataTypePullModule = {
|
|
|
1520
1388
|
apiHost,
|
|
1521
1389
|
fetch: fetch3,
|
|
1522
1390
|
projectId,
|
|
1523
|
-
limitPolicy,
|
|
1524
1391
|
bypassCache: true
|
|
1525
1392
|
});
|
|
1526
1393
|
const source = createDataTypeEngineDataSource({ client });
|
|
@@ -1597,7 +1464,6 @@ var DataTypePushModule = {
|
|
|
1597
1464
|
apiHost,
|
|
1598
1465
|
fetch: fetch3,
|
|
1599
1466
|
projectId,
|
|
1600
|
-
limitPolicy,
|
|
1601
1467
|
bypassCache: true
|
|
1602
1468
|
});
|
|
1603
1469
|
let source;
|
|
@@ -1785,9 +1651,6 @@ function writeContextPackage(filename, packageContents) {
|
|
|
1785
1651
|
writeUniformPackage(filename, packageContents);
|
|
1786
1652
|
}
|
|
1787
1653
|
|
|
1788
|
-
// src/commands/context/util.ts
|
|
1789
|
-
var limitPolicy2 = pLimit(8);
|
|
1790
|
-
|
|
1791
1654
|
// src/commands/context/commands/aggregate/pull.ts
|
|
1792
1655
|
var AggregatePullModule = {
|
|
1793
1656
|
command: "pull <directory>",
|
|
@@ -1831,7 +1694,7 @@ var AggregatePullModule = {
|
|
|
1831
1694
|
diff: diffMode
|
|
1832
1695
|
}) => {
|
|
1833
1696
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1834
|
-
const client = new UncachedAggregateClient3({ apiKey, apiHost, fetch: fetch3, projectId
|
|
1697
|
+
const client = new UncachedAggregateClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1835
1698
|
const source = createAggregateEngineDataSource({ client });
|
|
1836
1699
|
let target;
|
|
1837
1700
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -1901,7 +1764,7 @@ var AggregatePushModule = {
|
|
|
1901
1764
|
diff: diffMode
|
|
1902
1765
|
}) => {
|
|
1903
1766
|
const fetch3 = nodeFetchProxy(proxy);
|
|
1904
|
-
const client = new UncachedAggregateClient4({ apiKey, apiHost, fetch: fetch3, projectId
|
|
1767
|
+
const client = new UncachedAggregateClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
1905
1768
|
let source;
|
|
1906
1769
|
const isPackage = isPathAPackageFile(directory);
|
|
1907
1770
|
if (isPackage) {
|
|
@@ -2153,7 +2016,7 @@ var EnrichmentPullModule = {
|
|
|
2153
2016
|
diff: diffMode
|
|
2154
2017
|
}) => {
|
|
2155
2018
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2156
|
-
const client = new UncachedEnrichmentClient3({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2019
|
+
const client = new UncachedEnrichmentClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2157
2020
|
const source = createEnrichmentEngineDataSource({ client });
|
|
2158
2021
|
let target;
|
|
2159
2022
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -2223,7 +2086,7 @@ var EnrichmentPushModule = {
|
|
|
2223
2086
|
diff: diffMode
|
|
2224
2087
|
}) => {
|
|
2225
2088
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2226
|
-
const client = new UncachedEnrichmentClient4({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2089
|
+
const client = new UncachedEnrichmentClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2227
2090
|
let source;
|
|
2228
2091
|
const isPackage = isPathAPackageFile(directory);
|
|
2229
2092
|
if (isPackage) {
|
|
@@ -2285,9 +2148,10 @@ import yargs7 from "yargs";
|
|
|
2285
2148
|
|
|
2286
2149
|
// src/commands/context/commands/manifest/get.ts
|
|
2287
2150
|
import { ApiClientError, UncachedManifestClient } from "@uniformdev/context/api";
|
|
2288
|
-
import
|
|
2151
|
+
import ansicolors3 from "ansi-colors";
|
|
2289
2152
|
import { writeFile } from "fs";
|
|
2290
2153
|
import { exit } from "process";
|
|
2154
|
+
var { gray: gray2, green: green2, red: red3 } = ansicolors3;
|
|
2291
2155
|
var ManifestGetModule = {
|
|
2292
2156
|
command: "get [output]",
|
|
2293
2157
|
aliases: ["dl", "download"],
|
|
@@ -2326,7 +2190,7 @@ var ManifestGetModule = {
|
|
|
2326
2190
|
`, error);
|
|
2327
2191
|
exit(1);
|
|
2328
2192
|
}
|
|
2329
|
-
console.log(
|
|
2193
|
+
console.log(green2(`\u2705 ${output} has been updated from ${apiHost}`));
|
|
2330
2194
|
});
|
|
2331
2195
|
} else {
|
|
2332
2196
|
console.log(text);
|
|
@@ -2341,8 +2205,8 @@ var ManifestGetModule = {
|
|
|
2341
2205
|
} else {
|
|
2342
2206
|
message = e.toString();
|
|
2343
2207
|
}
|
|
2344
|
-
console.error(
|
|
2345
|
-
console.error(
|
|
2208
|
+
console.error(red3(`\u26A0 Error fetching Context manifest`));
|
|
2209
|
+
console.error(gray2(` \u2757 ${message}`));
|
|
2346
2210
|
exit(1);
|
|
2347
2211
|
}
|
|
2348
2212
|
}
|
|
@@ -2350,8 +2214,9 @@ var ManifestGetModule = {
|
|
|
2350
2214
|
|
|
2351
2215
|
// src/commands/context/commands/manifest/publish.ts
|
|
2352
2216
|
import { ApiClientError as ApiClientError2, UncachedManifestClient as UncachedManifestClient2 } from "@uniformdev/context/api";
|
|
2353
|
-
import
|
|
2217
|
+
import ansicolors4 from "ansi-colors";
|
|
2354
2218
|
import { exit as exit2 } from "process";
|
|
2219
|
+
var { gray: gray3, red: red4 } = ansicolors4;
|
|
2355
2220
|
var ManifestPublishModule = {
|
|
2356
2221
|
command: "publish",
|
|
2357
2222
|
describe: "Publish the Uniform Context manifest for a project",
|
|
@@ -2376,8 +2241,8 @@ var ManifestPublishModule = {
|
|
|
2376
2241
|
} else {
|
|
2377
2242
|
message = e.toString();
|
|
2378
2243
|
}
|
|
2379
|
-
console.error(
|
|
2380
|
-
console.error(
|
|
2244
|
+
console.error(red4(`\u26A0 Error publishing Context manifest`));
|
|
2245
|
+
console.error(gray3(` \u2757 ${message}`));
|
|
2381
2246
|
exit2(1);
|
|
2382
2247
|
}
|
|
2383
2248
|
}
|
|
@@ -2526,7 +2391,7 @@ var QuirkPullModule = {
|
|
|
2526
2391
|
diff: diffMode
|
|
2527
2392
|
}) => {
|
|
2528
2393
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2529
|
-
const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2394
|
+
const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2530
2395
|
const source = createQuirkEngineDataSource({ client });
|
|
2531
2396
|
let target;
|
|
2532
2397
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -2596,7 +2461,7 @@ var QuirkPushModule = {
|
|
|
2596
2461
|
diff: diffMode
|
|
2597
2462
|
}) => {
|
|
2598
2463
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2599
|
-
const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2464
|
+
const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2600
2465
|
let source;
|
|
2601
2466
|
const isPackage = isPathAPackageFile(directory);
|
|
2602
2467
|
if (isPackage) {
|
|
@@ -2792,7 +2657,7 @@ var SignalPullModule = {
|
|
|
2792
2657
|
diff: diffMode
|
|
2793
2658
|
}) => {
|
|
2794
2659
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2795
|
-
const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2660
|
+
const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2796
2661
|
const source = createSignalEngineDataSource({ client });
|
|
2797
2662
|
let target;
|
|
2798
2663
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -2862,7 +2727,7 @@ var SignalPushModule = {
|
|
|
2862
2727
|
diff: diffMode
|
|
2863
2728
|
}) => {
|
|
2864
2729
|
const fetch3 = nodeFetchProxy(proxy);
|
|
2865
|
-
const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2730
|
+
const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
2866
2731
|
let source;
|
|
2867
2732
|
const isPackage = isPathAPackageFile(directory);
|
|
2868
2733
|
if (isPackage) {
|
|
@@ -3058,7 +2923,7 @@ var TestPullModule = {
|
|
|
3058
2923
|
diff: diffMode
|
|
3059
2924
|
}) => {
|
|
3060
2925
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3061
|
-
const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2926
|
+
const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3062
2927
|
const source = createTestEngineDataSource({ client });
|
|
3063
2928
|
let target;
|
|
3064
2929
|
const isPackage = isPathAPackageFile(directory);
|
|
@@ -3128,7 +2993,7 @@ var TestPushModule = {
|
|
|
3128
2993
|
diff: diffMode
|
|
3129
2994
|
}) => {
|
|
3130
2995
|
const fetch3 = nodeFetchProxy(proxy);
|
|
3131
|
-
const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch3, projectId
|
|
2996
|
+
const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
3132
2997
|
let source;
|
|
3133
2998
|
const isPackage = isPathAPackageFile(directory);
|
|
3134
2999
|
if (isPackage) {
|
|
@@ -3234,7 +3099,7 @@ import { PostHog } from "posthog-node";
|
|
|
3234
3099
|
// package.json
|
|
3235
3100
|
var package_default = {
|
|
3236
3101
|
name: "@uniformdev/cli",
|
|
3237
|
-
version: "19.
|
|
3102
|
+
version: "19.9.1",
|
|
3238
3103
|
description: "Uniform command line interface tool",
|
|
3239
3104
|
license: "SEE LICENSE IN LICENSE.txt",
|
|
3240
3105
|
main: "./cli.js",
|
|
@@ -3254,7 +3119,7 @@ var package_default = {
|
|
|
3254
3119
|
"@uniformdev/context": "workspace:*",
|
|
3255
3120
|
"@uniformdev/project-map": "workspace:*",
|
|
3256
3121
|
"@uniformdev/redirect": "workspace:*",
|
|
3257
|
-
|
|
3122
|
+
"ansi-colors": "^4.1.3",
|
|
3258
3123
|
diff: "^5.0.0",
|
|
3259
3124
|
dotenv: "^16.0.3",
|
|
3260
3125
|
execa: "5.1.1",
|
|
@@ -3262,7 +3127,7 @@ var package_default = {
|
|
|
3262
3127
|
graphql: "16.6.0",
|
|
3263
3128
|
"graphql-request": "6.0.0",
|
|
3264
3129
|
"https-proxy-agent": "^5.0.1",
|
|
3265
|
-
inquirer: "9.2.
|
|
3130
|
+
inquirer: "9.2.1",
|
|
3266
3131
|
"isomorphic-git": "1.21.0",
|
|
3267
3132
|
"isomorphic-unfetch": "^3.1.0",
|
|
3268
3133
|
"js-yaml": "^4.1.0",
|
|
@@ -3281,9 +3146,8 @@ var package_default = {
|
|
|
3281
3146
|
"@types/js-yaml": "4.0.5",
|
|
3282
3147
|
"@types/jsonwebtoken": "9.0.2",
|
|
3283
3148
|
"@types/lodash.isequalwith": "4.4.7",
|
|
3284
|
-
"@types/node": "18.16.
|
|
3285
|
-
"@types/yargs": "17.0.24"
|
|
3286
|
-
"p-limit": "4.0.0"
|
|
3149
|
+
"@types/node": "18.16.8",
|
|
3150
|
+
"@types/yargs": "17.0.24"
|
|
3287
3151
|
},
|
|
3288
3152
|
bin: {
|
|
3289
3153
|
uniform: "./cli.js"
|
|
@@ -4264,7 +4128,7 @@ import yargs13 from "yargs";
|
|
|
4264
4128
|
import yargs12 from "yargs";
|
|
4265
4129
|
|
|
4266
4130
|
// src/commands/optimize/manifest/download.ts
|
|
4267
|
-
import
|
|
4131
|
+
import ansicolors5 from "ansi-colors";
|
|
4268
4132
|
import { writeFile as writeFile2 } from "fs";
|
|
4269
4133
|
import fetch2 from "isomorphic-unfetch";
|
|
4270
4134
|
import { exit as exit3 } from "process";
|
|
@@ -4273,6 +4137,7 @@ import { exit as exit3 } from "process";
|
|
|
4273
4137
|
var UniformBaseUrl = "https://uniform.app";
|
|
4274
4138
|
|
|
4275
4139
|
// src/commands/optimize/manifest/download.ts
|
|
4140
|
+
var { gray: gray4, green: green3, red: red5, yellow: yellow2 } = ansicolors5;
|
|
4276
4141
|
var module = {
|
|
4277
4142
|
command: "download [output]",
|
|
4278
4143
|
describe: "Download intent manifest",
|
|
@@ -4304,12 +4169,12 @@ var module = {
|
|
|
4304
4169
|
);
|
|
4305
4170
|
if (isLegacyApiKey) {
|
|
4306
4171
|
console.error(
|
|
4307
|
-
|
|
4172
|
+
yellow2(
|
|
4308
4173
|
"WARNING: you appear to be using a deprecated type of API key. Keys like this will stop working soon; please create new keys on uniform.app."
|
|
4309
4174
|
)
|
|
4310
4175
|
);
|
|
4311
4176
|
} else if (!project) {
|
|
4312
|
-
console.error(
|
|
4177
|
+
console.error(red5("You must specify the project ID"));
|
|
4313
4178
|
exit3(1);
|
|
4314
4179
|
}
|
|
4315
4180
|
const baseUrl = resolveBaseUrl();
|
|
@@ -4335,16 +4200,16 @@ var module = {
|
|
|
4335
4200
|
throw `${fetchResponse.status} ${fetchResponse.statusText}, content ${await fetchResponse.text()}`;
|
|
4336
4201
|
}
|
|
4337
4202
|
} catch (e) {
|
|
4338
|
-
console.error(
|
|
4339
|
-
console.error(
|
|
4203
|
+
console.error(red5(`\u26A0 Error fetching intent manifest ${manifestUrl}`));
|
|
4204
|
+
console.error(gray4(` \u2757 ${e}`));
|
|
4340
4205
|
exit3(1);
|
|
4341
4206
|
}
|
|
4342
4207
|
let json;
|
|
4343
4208
|
try {
|
|
4344
4209
|
json = await fetchResponse.json();
|
|
4345
4210
|
} catch (e) {
|
|
4346
|
-
console.error(
|
|
4347
|
-
console.error(
|
|
4211
|
+
console.error(red5(`\u26A0 Error parsing intent manifest ${manifestUrl}`));
|
|
4212
|
+
console.error(gray4(` \u2757 ${e}`));
|
|
4348
4213
|
console.error(`Response: ${await fetchResponse.text()}`);
|
|
4349
4214
|
exit3(1);
|
|
4350
4215
|
}
|
|
@@ -4356,7 +4221,7 @@ var module = {
|
|
|
4356
4221
|
`, error);
|
|
4357
4222
|
exit3(1);
|
|
4358
4223
|
}
|
|
4359
|
-
console.log(
|
|
4224
|
+
console.log(green3(`\u2705 ${output} has been updated from ${manifestUrl}`));
|
|
4360
4225
|
});
|
|
4361
4226
|
} else {
|
|
4362
4227
|
console.log(text);
|
|
@@ -5007,8 +4872,8 @@ var RedirectDefinitionGetModule = {
|
|
|
5007
4872
|
handler: async ({ apiHost, apiKey, proxy, id, format, project: projectId, filename }) => {
|
|
5008
4873
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5009
4874
|
const client = new UncachedRedirectClient({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5010
|
-
const res = await client.getRedirect(id);
|
|
5011
|
-
if (res) {
|
|
4875
|
+
const res = await client.getRedirect({ id });
|
|
4876
|
+
if (!res) {
|
|
5012
4877
|
console.error("Redirect does not exist");
|
|
5013
4878
|
process.exit(1);
|
|
5014
4879
|
} else {
|
|
@@ -5258,7 +5123,7 @@ var RedirectDefinitionUpdateModule = {
|
|
|
5258
5123
|
const fetch3 = nodeFetchProxy(proxy);
|
|
5259
5124
|
const client = new UncachedRedirectClient6({ apiKey, apiHost, fetch: fetch3, projectId });
|
|
5260
5125
|
const file = readFileToObject(filename);
|
|
5261
|
-
await client.upsertRedirect(file);
|
|
5126
|
+
await client.upsertRedirect(file.redirect);
|
|
5262
5127
|
}
|
|
5263
5128
|
};
|
|
5264
5129
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uniformdev/cli",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.9.2-alpha.3+547c8b11d",
|
|
4
4
|
"description": "Uniform command line interface tool",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"main": "./cli.js",
|
|
@@ -16,11 +16,11 @@
|
|
|
16
16
|
"format": "prettier --write \"src/**/*.{js,ts,tsx}\""
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"@uniformdev/canvas": "19.
|
|
20
|
-
"@uniformdev/context": "19.
|
|
21
|
-
"@uniformdev/project-map": "19.
|
|
22
|
-
"@uniformdev/redirect": "19.
|
|
23
|
-
"
|
|
19
|
+
"@uniformdev/canvas": "19.9.2-alpha.3+547c8b11d",
|
|
20
|
+
"@uniformdev/context": "19.9.2-alpha.3+547c8b11d",
|
|
21
|
+
"@uniformdev/project-map": "19.9.2-alpha.3+547c8b11d",
|
|
22
|
+
"@uniformdev/redirect": "19.9.2-alpha.3+547c8b11d",
|
|
23
|
+
"ansi-colors": "^4.1.3",
|
|
24
24
|
"diff": "^5.0.0",
|
|
25
25
|
"dotenv": "^16.0.3",
|
|
26
26
|
"execa": "5.1.1",
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"graphql": "16.6.0",
|
|
29
29
|
"graphql-request": "6.0.0",
|
|
30
30
|
"https-proxy-agent": "^5.0.1",
|
|
31
|
-
"inquirer": "9.2.
|
|
31
|
+
"inquirer": "9.2.1",
|
|
32
32
|
"isomorphic-git": "1.21.0",
|
|
33
33
|
"isomorphic-unfetch": "^3.1.0",
|
|
34
34
|
"js-yaml": "^4.1.0",
|
|
@@ -47,9 +47,8 @@
|
|
|
47
47
|
"@types/js-yaml": "4.0.5",
|
|
48
48
|
"@types/jsonwebtoken": "9.0.2",
|
|
49
49
|
"@types/lodash.isequalwith": "4.4.7",
|
|
50
|
-
"@types/node": "18.16.
|
|
51
|
-
"@types/yargs": "17.0.24"
|
|
52
|
-
"p-limit": "4.0.0"
|
|
50
|
+
"@types/node": "18.16.8",
|
|
51
|
+
"@types/yargs": "17.0.24"
|
|
53
52
|
},
|
|
54
53
|
"bin": {
|
|
55
54
|
"uniform": "./cli.js"
|
|
@@ -60,5 +59,5 @@
|
|
|
60
59
|
"publishConfig": {
|
|
61
60
|
"access": "public"
|
|
62
61
|
},
|
|
63
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "547c8b11d4655b34250c2fbe3f016c9bc12c3905"
|
|
64
63
|
}
|