@uniformdev/cli 19.6.0 → 19.8.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.
Files changed (2) hide show
  1. package/dist/index.mjs +55 -194
  2. package/package.json +9 -10
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";
@@ -57,11 +31,12 @@ async function createArraySyncEngineDataSource({
57
31
  if (result[identifier]) {
58
32
  throw new Error(`Identifier ${identifier} was not unique.`);
59
33
  }
34
+ const displayName = selectDisplayName12(current);
60
35
  result[identifier] = {
61
36
  id: identifier,
62
37
  object: current,
63
38
  providerId: identifier,
64
- displayName: selectDisplayName12(current)[0]
39
+ displayName: Array.isArray(displayName) ? displayName[0] : displayName
65
40
  };
66
41
  }
67
42
  return result;
@@ -596,148 +571,6 @@ function writeCanvasPackage(filename, packageContents) {
596
571
  writeUniformPackage(filename, packageContents);
597
572
  }
598
573
 
599
- // src/commands/canvas/util.ts
600
- import { CANVAS_DRAFT_STATE, CANVAS_PUBLISHED_STATE } from "@uniformdev/canvas";
601
-
602
- // ../../node_modules/.pnpm/yocto-queue@1.0.0/node_modules/yocto-queue/index.js
603
- var Node = class {
604
- value;
605
- next;
606
- constructor(value) {
607
- this.value = value;
608
- }
609
- };
610
- var _head, _tail, _size;
611
- var Queue = class {
612
- constructor() {
613
- __privateAdd(this, _head, void 0);
614
- __privateAdd(this, _tail, void 0);
615
- __privateAdd(this, _size, void 0);
616
- this.clear();
617
- }
618
- enqueue(value) {
619
- const node = new Node(value);
620
- if (__privateGet(this, _head)) {
621
- __privateGet(this, _tail).next = node;
622
- __privateSet(this, _tail, node);
623
- } else {
624
- __privateSet(this, _head, node);
625
- __privateSet(this, _tail, node);
626
- }
627
- __privateWrapper(this, _size)._++;
628
- }
629
- dequeue() {
630
- const current = __privateGet(this, _head);
631
- if (!current) {
632
- return;
633
- }
634
- __privateSet(this, _head, __privateGet(this, _head).next);
635
- __privateWrapper(this, _size)._--;
636
- return current.value;
637
- }
638
- clear() {
639
- __privateSet(this, _head, void 0);
640
- __privateSet(this, _tail, void 0);
641
- __privateSet(this, _size, 0);
642
- }
643
- get size() {
644
- return __privateGet(this, _size);
645
- }
646
- *[Symbol.iterator]() {
647
- let current = __privateGet(this, _head);
648
- while (current) {
649
- yield current.value;
650
- current = current.next;
651
- }
652
- }
653
- };
654
- _head = new WeakMap();
655
- _tail = new WeakMap();
656
- _size = new WeakMap();
657
-
658
- // ../../node_modules/.pnpm/p-limit@4.0.0/node_modules/p-limit/index.js
659
- function pLimit(concurrency) {
660
- if (!((Number.isInteger(concurrency) || concurrency === Number.POSITIVE_INFINITY) && concurrency > 0)) {
661
- throw new TypeError("Expected `concurrency` to be a number from 1 and up");
662
- }
663
- const queue = new Queue();
664
- let activeCount = 0;
665
- const next = () => {
666
- activeCount--;
667
- if (queue.size > 0) {
668
- queue.dequeue()();
669
- }
670
- };
671
- const run = async (fn, resolve, args) => {
672
- activeCount++;
673
- const result = (async () => fn(...args))();
674
- resolve(result);
675
- try {
676
- await result;
677
- } catch {
678
- }
679
- next();
680
- };
681
- const enqueue = (fn, resolve, args) => {
682
- queue.enqueue(run.bind(void 0, fn, resolve, args));
683
- (async () => {
684
- await Promise.resolve();
685
- if (activeCount < concurrency && queue.size > 0) {
686
- queue.dequeue()();
687
- }
688
- })();
689
- };
690
- const generator = (fn, ...args) => new Promise((resolve) => {
691
- enqueue(fn, resolve, args);
692
- });
693
- Object.defineProperties(generator, {
694
- activeCount: {
695
- get: () => activeCount
696
- },
697
- pendingCount: {
698
- get: () => queue.size
699
- },
700
- clearQueue: {
701
- value: () => {
702
- queue.clear();
703
- }
704
- }
705
- });
706
- return generator;
707
- }
708
-
709
- // src/commands/canvas/util.ts
710
- function prepCompositionForDisk(composition) {
711
- const prepped = {
712
- ...composition
713
- };
714
- delete prepped.projectId;
715
- delete prepped.state;
716
- return prepped;
717
- }
718
- function withStateOptions(yargs20) {
719
- return yargs20.option("state", {
720
- type: "string",
721
- describe: `Composition state to fetch.`,
722
- choices: ["preview", "published"],
723
- default: "preview"
724
- });
725
- }
726
- function convertCompositionState(state) {
727
- const number = Number(state);
728
- if (!isNaN(number)) {
729
- return number;
730
- }
731
- if (!state) {
732
- return CANVAS_PUBLISHED_STATE;
733
- }
734
- if (typeof state !== "string") {
735
- throw new Error('state must be "published", "preview", or a number');
736
- }
737
- return state === "preview" ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE;
738
- }
739
- var limitPolicy = pLimit(8);
740
-
741
574
  // src/commands/canvas/commands/component/pull.ts
742
575
  var ComponentPullModule = {
743
576
  command: "pull <directory>",
@@ -781,7 +614,7 @@ var ComponentPullModule = {
781
614
  diff: diffMode
782
615
  }) => {
783
616
  const fetch3 = nodeFetchProxy(proxy);
784
- const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
617
+ const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId });
785
618
  const source = createComponentDefinitionEngineDataSource({ client });
786
619
  let target;
787
620
  const isPackage = isPathAPackageFile(directory);
@@ -852,7 +685,7 @@ var ComponentPushModule = {
852
685
  diff: diffMode
853
686
  }) => {
854
687
  const fetch3 = nodeFetchProxy(proxy);
855
- const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
688
+ const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId });
856
689
  let source;
857
690
  const isPackage = isPathAPackageFile(directory);
858
691
  if (isPackage) {
@@ -934,6 +767,40 @@ import yargs2 from "yargs";
934
767
 
935
768
  // src/commands/canvas/commands/composition/get.ts
936
769
  import { UncachedCanvasClient as UncachedCanvasClient7 } from "@uniformdev/canvas";
770
+
771
+ // src/commands/canvas/util.ts
772
+ import { CANVAS_DRAFT_STATE, CANVAS_PUBLISHED_STATE } from "@uniformdev/canvas";
773
+ function prepCompositionForDisk(composition) {
774
+ const prepped = {
775
+ ...composition
776
+ };
777
+ delete prepped.projectId;
778
+ delete prepped.state;
779
+ return prepped;
780
+ }
781
+ function withStateOptions(yargs20) {
782
+ return yargs20.option("state", {
783
+ type: "string",
784
+ describe: `Composition state to fetch.`,
785
+ choices: ["preview", "published"],
786
+ default: "preview"
787
+ });
788
+ }
789
+ function convertCompositionState(state) {
790
+ const number = Number(state);
791
+ if (!isNaN(number)) {
792
+ return number;
793
+ }
794
+ if (!state) {
795
+ return CANVAS_PUBLISHED_STATE;
796
+ }
797
+ if (typeof state !== "string") {
798
+ throw new Error('state must be "published", "preview", or a number');
799
+ }
800
+ return state === "preview" ? CANVAS_DRAFT_STATE : CANVAS_PUBLISHED_STATE;
801
+ }
802
+
803
+ // src/commands/canvas/commands/composition/get.ts
937
804
  var CompositionGetModule = {
938
805
  command: "get <id>",
939
806
  describe: "Fetch a composition",
@@ -1155,7 +1022,7 @@ var CompositionPublishModule = {
1155
1022
  }
1156
1023
  const compositionIDsArray = compositionIDs ? compositionIDs.split(",").map((id) => id.trim()) : void 0;
1157
1024
  const fetch3 = nodeFetchProxy(proxy);
1158
- const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
1025
+ const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
1159
1026
  const source = createComponentInstanceEngineDataSource({
1160
1027
  client,
1161
1028
  state: "preview",
@@ -1223,7 +1090,7 @@ var CompositionPullModule = {
1223
1090
  diff: diffMode
1224
1091
  }) => {
1225
1092
  const fetch3 = nodeFetchProxy(proxy);
1226
- const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
1093
+ const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
1227
1094
  const source = createComponentInstanceEngineDataSource({ client, state });
1228
1095
  const isPackage = isPathAPackageFile(directory);
1229
1096
  let target;
@@ -1296,7 +1163,7 @@ var CompositionPushModule = {
1296
1163
  diff: diffMode
1297
1164
  }) => {
1298
1165
  const fetch3 = nodeFetchProxy(proxy);
1299
- const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
1166
+ const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId });
1300
1167
  let source;
1301
1168
  const isPackage = isPathAPackageFile(directory);
1302
1169
  if (isPackage) {
@@ -1519,7 +1386,6 @@ var DataTypePullModule = {
1519
1386
  apiHost,
1520
1387
  fetch: fetch3,
1521
1388
  projectId,
1522
- limitPolicy,
1523
1389
  bypassCache: true
1524
1390
  });
1525
1391
  const source = createDataTypeEngineDataSource({ client });
@@ -1596,7 +1462,6 @@ var DataTypePushModule = {
1596
1462
  apiHost,
1597
1463
  fetch: fetch3,
1598
1464
  projectId,
1599
- limitPolicy,
1600
1465
  bypassCache: true
1601
1466
  });
1602
1467
  let source;
@@ -1784,9 +1649,6 @@ function writeContextPackage(filename, packageContents) {
1784
1649
  writeUniformPackage(filename, packageContents);
1785
1650
  }
1786
1651
 
1787
- // src/commands/context/util.ts
1788
- var limitPolicy2 = pLimit(8);
1789
-
1790
1652
  // src/commands/context/commands/aggregate/pull.ts
1791
1653
  var AggregatePullModule = {
1792
1654
  command: "pull <directory>",
@@ -1830,7 +1692,7 @@ var AggregatePullModule = {
1830
1692
  diff: diffMode
1831
1693
  }) => {
1832
1694
  const fetch3 = nodeFetchProxy(proxy);
1833
- const client = new UncachedAggregateClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
1695
+ const client = new UncachedAggregateClient3({ apiKey, apiHost, fetch: fetch3, projectId });
1834
1696
  const source = createAggregateEngineDataSource({ client });
1835
1697
  let target;
1836
1698
  const isPackage = isPathAPackageFile(directory);
@@ -1900,7 +1762,7 @@ var AggregatePushModule = {
1900
1762
  diff: diffMode
1901
1763
  }) => {
1902
1764
  const fetch3 = nodeFetchProxy(proxy);
1903
- const client = new UncachedAggregateClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
1765
+ const client = new UncachedAggregateClient4({ apiKey, apiHost, fetch: fetch3, projectId });
1904
1766
  let source;
1905
1767
  const isPackage = isPathAPackageFile(directory);
1906
1768
  if (isPackage) {
@@ -2152,7 +2014,7 @@ var EnrichmentPullModule = {
2152
2014
  diff: diffMode
2153
2015
  }) => {
2154
2016
  const fetch3 = nodeFetchProxy(proxy);
2155
- const client = new UncachedEnrichmentClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2017
+ const client = new UncachedEnrichmentClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2156
2018
  const source = createEnrichmentEngineDataSource({ client });
2157
2019
  let target;
2158
2020
  const isPackage = isPathAPackageFile(directory);
@@ -2222,7 +2084,7 @@ var EnrichmentPushModule = {
2222
2084
  diff: diffMode
2223
2085
  }) => {
2224
2086
  const fetch3 = nodeFetchProxy(proxy);
2225
- const client = new UncachedEnrichmentClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2087
+ const client = new UncachedEnrichmentClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2226
2088
  let source;
2227
2089
  const isPackage = isPathAPackageFile(directory);
2228
2090
  if (isPackage) {
@@ -2525,7 +2387,7 @@ var QuirkPullModule = {
2525
2387
  diff: diffMode
2526
2388
  }) => {
2527
2389
  const fetch3 = nodeFetchProxy(proxy);
2528
- const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2390
+ const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2529
2391
  const source = createQuirkEngineDataSource({ client });
2530
2392
  let target;
2531
2393
  const isPackage = isPathAPackageFile(directory);
@@ -2595,7 +2457,7 @@ var QuirkPushModule = {
2595
2457
  diff: diffMode
2596
2458
  }) => {
2597
2459
  const fetch3 = nodeFetchProxy(proxy);
2598
- const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2460
+ const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2599
2461
  let source;
2600
2462
  const isPackage = isPathAPackageFile(directory);
2601
2463
  if (isPackage) {
@@ -2791,7 +2653,7 @@ var SignalPullModule = {
2791
2653
  diff: diffMode
2792
2654
  }) => {
2793
2655
  const fetch3 = nodeFetchProxy(proxy);
2794
- const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2656
+ const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2795
2657
  const source = createSignalEngineDataSource({ client });
2796
2658
  let target;
2797
2659
  const isPackage = isPathAPackageFile(directory);
@@ -2861,7 +2723,7 @@ var SignalPushModule = {
2861
2723
  diff: diffMode
2862
2724
  }) => {
2863
2725
  const fetch3 = nodeFetchProxy(proxy);
2864
- const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2726
+ const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2865
2727
  let source;
2866
2728
  const isPackage = isPathAPackageFile(directory);
2867
2729
  if (isPackage) {
@@ -3057,7 +2919,7 @@ var TestPullModule = {
3057
2919
  diff: diffMode
3058
2920
  }) => {
3059
2921
  const fetch3 = nodeFetchProxy(proxy);
3060
- const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2922
+ const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch3, projectId });
3061
2923
  const source = createTestEngineDataSource({ client });
3062
2924
  let target;
3063
2925
  const isPackage = isPathAPackageFile(directory);
@@ -3127,7 +2989,7 @@ var TestPushModule = {
3127
2989
  diff: diffMode
3128
2990
  }) => {
3129
2991
  const fetch3 = nodeFetchProxy(proxy);
3130
- const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2992
+ const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch3, projectId });
3131
2993
  let source;
3132
2994
  const isPackage = isPathAPackageFile(directory);
3133
2995
  if (isPackage) {
@@ -3233,7 +3095,7 @@ import { PostHog } from "posthog-node";
3233
3095
  // package.json
3234
3096
  var package_default = {
3235
3097
  name: "@uniformdev/cli",
3236
- version: "19.6.0",
3098
+ version: "19.8.0",
3237
3099
  description: "Uniform command line interface tool",
3238
3100
  license: "SEE LICENSE IN LICENSE.txt",
3239
3101
  main: "./cli.js",
@@ -3261,7 +3123,7 @@ var package_default = {
3261
3123
  graphql: "16.6.0",
3262
3124
  "graphql-request": "6.0.0",
3263
3125
  "https-proxy-agent": "^5.0.1",
3264
- inquirer: "9.2.0",
3126
+ inquirer: "9.2.1",
3265
3127
  "isomorphic-git": "1.21.0",
3266
3128
  "isomorphic-unfetch": "^3.1.0",
3267
3129
  "js-yaml": "^4.1.0",
@@ -3280,9 +3142,8 @@ var package_default = {
3280
3142
  "@types/js-yaml": "4.0.5",
3281
3143
  "@types/jsonwebtoken": "9.0.2",
3282
3144
  "@types/lodash.isequalwith": "4.4.7",
3283
- "@types/node": "18.16.3",
3284
- "@types/yargs": "17.0.24",
3285
- "p-limit": "4.0.0"
3145
+ "@types/node": "18.16.4",
3146
+ "@types/yargs": "17.0.24"
3286
3147
  },
3287
3148
  bin: {
3288
3149
  uniform: "./cli.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.6.0",
3
+ "version": "19.8.0",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -16,10 +16,10 @@
16
16
  "format": "prettier --write \"src/**/*.{js,ts,tsx}\""
17
17
  },
18
18
  "dependencies": {
19
- "@uniformdev/canvas": "19.6.0",
20
- "@uniformdev/context": "19.6.0",
21
- "@uniformdev/project-map": "19.6.0",
22
- "@uniformdev/redirect": "19.6.0",
19
+ "@uniformdev/canvas": "19.8.0",
20
+ "@uniformdev/context": "19.8.0",
21
+ "@uniformdev/project-map": "19.8.0",
22
+ "@uniformdev/redirect": "19.8.0",
23
23
  "chalk": "^5.2.0",
24
24
  "diff": "^5.0.0",
25
25
  "dotenv": "^16.0.3",
@@ -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.0",
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.3",
51
- "@types/yargs": "17.0.24",
52
- "p-limit": "4.0.0"
50
+ "@types/node": "18.16.4",
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": "a14550dd1caa33fa1310ada642d06ce79bbe4eac"
62
+ "gitHead": "70eb9277bbfaee5f9245e1b26b4e77caede22944"
64
63
  }