@uniformdev/cli 19.7.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 +53 -193
  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";
@@ -597,148 +571,6 @@ function writeCanvasPackage(filename, packageContents) {
597
571
  writeUniformPackage(filename, packageContents);
598
572
  }
599
573
 
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
574
  // src/commands/canvas/commands/component/pull.ts
743
575
  var ComponentPullModule = {
744
576
  command: "pull <directory>",
@@ -782,7 +614,7 @@ var ComponentPullModule = {
782
614
  diff: diffMode
783
615
  }) => {
784
616
  const fetch3 = nodeFetchProxy(proxy);
785
- const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
617
+ const client = new UncachedCanvasClient3({ apiKey, apiHost, fetch: fetch3, projectId });
786
618
  const source = createComponentDefinitionEngineDataSource({ client });
787
619
  let target;
788
620
  const isPackage = isPathAPackageFile(directory);
@@ -853,7 +685,7 @@ var ComponentPushModule = {
853
685
  diff: diffMode
854
686
  }) => {
855
687
  const fetch3 = nodeFetchProxy(proxy);
856
- const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
688
+ const client = new UncachedCanvasClient4({ apiKey, apiHost, fetch: fetch3, projectId });
857
689
  let source;
858
690
  const isPackage = isPathAPackageFile(directory);
859
691
  if (isPackage) {
@@ -935,6 +767,40 @@ import yargs2 from "yargs";
935
767
 
936
768
  // src/commands/canvas/commands/composition/get.ts
937
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
938
804
  var CompositionGetModule = {
939
805
  command: "get <id>",
940
806
  describe: "Fetch a composition",
@@ -1156,7 +1022,7 @@ var CompositionPublishModule = {
1156
1022
  }
1157
1023
  const compositionIDsArray = compositionIDs ? compositionIDs.split(",").map((id) => id.trim()) : void 0;
1158
1024
  const fetch3 = nodeFetchProxy(proxy);
1159
- const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
1025
+ const client = new UncachedCanvasClient9({ apiKey, apiHost, fetch: fetch3, projectId });
1160
1026
  const source = createComponentInstanceEngineDataSource({
1161
1027
  client,
1162
1028
  state: "preview",
@@ -1224,7 +1090,7 @@ var CompositionPullModule = {
1224
1090
  diff: diffMode
1225
1091
  }) => {
1226
1092
  const fetch3 = nodeFetchProxy(proxy);
1227
- const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
1093
+ const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
1228
1094
  const source = createComponentInstanceEngineDataSource({ client, state });
1229
1095
  const isPackage = isPathAPackageFile(directory);
1230
1096
  let target;
@@ -1297,7 +1163,7 @@ var CompositionPushModule = {
1297
1163
  diff: diffMode
1298
1164
  }) => {
1299
1165
  const fetch3 = nodeFetchProxy(proxy);
1300
- const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy });
1166
+ const client = new UncachedCanvasClient11({ apiKey, apiHost, fetch: fetch3, projectId });
1301
1167
  let source;
1302
1168
  const isPackage = isPathAPackageFile(directory);
1303
1169
  if (isPackage) {
@@ -1520,7 +1386,6 @@ var DataTypePullModule = {
1520
1386
  apiHost,
1521
1387
  fetch: fetch3,
1522
1388
  projectId,
1523
- limitPolicy,
1524
1389
  bypassCache: true
1525
1390
  });
1526
1391
  const source = createDataTypeEngineDataSource({ client });
@@ -1597,7 +1462,6 @@ var DataTypePushModule = {
1597
1462
  apiHost,
1598
1463
  fetch: fetch3,
1599
1464
  projectId,
1600
- limitPolicy,
1601
1465
  bypassCache: true
1602
1466
  });
1603
1467
  let source;
@@ -1785,9 +1649,6 @@ function writeContextPackage(filename, packageContents) {
1785
1649
  writeUniformPackage(filename, packageContents);
1786
1650
  }
1787
1651
 
1788
- // src/commands/context/util.ts
1789
- var limitPolicy2 = pLimit(8);
1790
-
1791
1652
  // src/commands/context/commands/aggregate/pull.ts
1792
1653
  var AggregatePullModule = {
1793
1654
  command: "pull <directory>",
@@ -1831,7 +1692,7 @@ var AggregatePullModule = {
1831
1692
  diff: diffMode
1832
1693
  }) => {
1833
1694
  const fetch3 = nodeFetchProxy(proxy);
1834
- const client = new UncachedAggregateClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
1695
+ const client = new UncachedAggregateClient3({ apiKey, apiHost, fetch: fetch3, projectId });
1835
1696
  const source = createAggregateEngineDataSource({ client });
1836
1697
  let target;
1837
1698
  const isPackage = isPathAPackageFile(directory);
@@ -1901,7 +1762,7 @@ var AggregatePushModule = {
1901
1762
  diff: diffMode
1902
1763
  }) => {
1903
1764
  const fetch3 = nodeFetchProxy(proxy);
1904
- const client = new UncachedAggregateClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
1765
+ const client = new UncachedAggregateClient4({ apiKey, apiHost, fetch: fetch3, projectId });
1905
1766
  let source;
1906
1767
  const isPackage = isPathAPackageFile(directory);
1907
1768
  if (isPackage) {
@@ -2153,7 +2014,7 @@ var EnrichmentPullModule = {
2153
2014
  diff: diffMode
2154
2015
  }) => {
2155
2016
  const fetch3 = nodeFetchProxy(proxy);
2156
- const client = new UncachedEnrichmentClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2017
+ const client = new UncachedEnrichmentClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2157
2018
  const source = createEnrichmentEngineDataSource({ client });
2158
2019
  let target;
2159
2020
  const isPackage = isPathAPackageFile(directory);
@@ -2223,7 +2084,7 @@ var EnrichmentPushModule = {
2223
2084
  diff: diffMode
2224
2085
  }) => {
2225
2086
  const fetch3 = nodeFetchProxy(proxy);
2226
- const client = new UncachedEnrichmentClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2087
+ const client = new UncachedEnrichmentClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2227
2088
  let source;
2228
2089
  const isPackage = isPathAPackageFile(directory);
2229
2090
  if (isPackage) {
@@ -2526,7 +2387,7 @@ var QuirkPullModule = {
2526
2387
  diff: diffMode
2527
2388
  }) => {
2528
2389
  const fetch3 = nodeFetchProxy(proxy);
2529
- const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2390
+ const client = new UncachedQuirkClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2530
2391
  const source = createQuirkEngineDataSource({ client });
2531
2392
  let target;
2532
2393
  const isPackage = isPathAPackageFile(directory);
@@ -2596,7 +2457,7 @@ var QuirkPushModule = {
2596
2457
  diff: diffMode
2597
2458
  }) => {
2598
2459
  const fetch3 = nodeFetchProxy(proxy);
2599
- const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2460
+ const client = new UncachedQuirkClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2600
2461
  let source;
2601
2462
  const isPackage = isPathAPackageFile(directory);
2602
2463
  if (isPackage) {
@@ -2792,7 +2653,7 @@ var SignalPullModule = {
2792
2653
  diff: diffMode
2793
2654
  }) => {
2794
2655
  const fetch3 = nodeFetchProxy(proxy);
2795
- const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2656
+ const client = new UncachedSignalClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2796
2657
  const source = createSignalEngineDataSource({ client });
2797
2658
  let target;
2798
2659
  const isPackage = isPathAPackageFile(directory);
@@ -2862,7 +2723,7 @@ var SignalPushModule = {
2862
2723
  diff: diffMode
2863
2724
  }) => {
2864
2725
  const fetch3 = nodeFetchProxy(proxy);
2865
- const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2726
+ const client = new UncachedSignalClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2866
2727
  let source;
2867
2728
  const isPackage = isPathAPackageFile(directory);
2868
2729
  if (isPackage) {
@@ -3058,7 +2919,7 @@ var TestPullModule = {
3058
2919
  diff: diffMode
3059
2920
  }) => {
3060
2921
  const fetch3 = nodeFetchProxy(proxy);
3061
- const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2922
+ const client = new UncachedTestClient3({ apiKey, apiHost, fetch: fetch3, projectId });
3062
2923
  const source = createTestEngineDataSource({ client });
3063
2924
  let target;
3064
2925
  const isPackage = isPathAPackageFile(directory);
@@ -3128,7 +2989,7 @@ var TestPushModule = {
3128
2989
  diff: diffMode
3129
2990
  }) => {
3130
2991
  const fetch3 = nodeFetchProxy(proxy);
3131
- const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch3, projectId, limitPolicy: limitPolicy2 });
2992
+ const client = new UncachedTestClient4({ apiKey, apiHost, fetch: fetch3, projectId });
3132
2993
  let source;
3133
2994
  const isPackage = isPathAPackageFile(directory);
3134
2995
  if (isPackage) {
@@ -3234,7 +3095,7 @@ import { PostHog } from "posthog-node";
3234
3095
  // package.json
3235
3096
  var package_default = {
3236
3097
  name: "@uniformdev/cli",
3237
- version: "19.7.0",
3098
+ version: "19.8.0",
3238
3099
  description: "Uniform command line interface tool",
3239
3100
  license: "SEE LICENSE IN LICENSE.txt",
3240
3101
  main: "./cli.js",
@@ -3262,7 +3123,7 @@ var package_default = {
3262
3123
  graphql: "16.6.0",
3263
3124
  "graphql-request": "6.0.0",
3264
3125
  "https-proxy-agent": "^5.0.1",
3265
- inquirer: "9.2.0",
3126
+ inquirer: "9.2.1",
3266
3127
  "isomorphic-git": "1.21.0",
3267
3128
  "isomorphic-unfetch": "^3.1.0",
3268
3129
  "js-yaml": "^4.1.0",
@@ -3281,9 +3142,8 @@ var package_default = {
3281
3142
  "@types/js-yaml": "4.0.5",
3282
3143
  "@types/jsonwebtoken": "9.0.2",
3283
3144
  "@types/lodash.isequalwith": "4.4.7",
3284
- "@types/node": "18.16.3",
3285
- "@types/yargs": "17.0.24",
3286
- "p-limit": "4.0.0"
3145
+ "@types/node": "18.16.4",
3146
+ "@types/yargs": "17.0.24"
3287
3147
  },
3288
3148
  bin: {
3289
3149
  uniform: "./cli.js"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.7.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.7.0",
20
- "@uniformdev/context": "19.7.0",
21
- "@uniformdev/project-map": "19.7.0",
22
- "@uniformdev/redirect": "19.7.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": "bbcd8d36ccb082d87f1f434a94d6d9402ddb5424"
62
+ "gitHead": "70eb9277bbfaee5f9245e1b26b4e77caede22944"
64
63
  }