@uniformdev/cli 19.86.1-alpha.13 → 19.87.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/dist/index.d.mts CHANGED
@@ -1,4 +1,9 @@
1
1
  #!/usr/bin/env node
2
+ type CLICompositionState = 'preview' | 'published' | number;
3
+ type StateArgs = {
4
+ state: CLICompositionState;
5
+ };
6
+
2
7
  type SyncMode = 'mirror' | 'createOrUpdate' | 'create';
3
8
  type EntityTypes = 'category' | 'dataType' | 'quirk' | 'test' | 'signal' | 'enrichment' | 'aggregate' | 'component' | 'composition' | 'pattern' | 'projectMapDefinition' | 'projectMapNode' | 'redirect' | 'entry' | 'contentType' | 'asset';
4
9
  type SyncFileFormat = 'yaml' | 'json';
@@ -8,7 +13,8 @@ type EntityConfiguration = {
8
13
  format?: SyncFileFormat;
9
14
  disabled?: true;
10
15
  };
11
- type CompositionAndPatternConfiguration = EntityConfiguration & {
16
+ type EntityWithStateConfiguration = EntityConfiguration & Partial<StateArgs>;
17
+ type PublishableEntitiesConfiguration = EntityWithStateConfiguration & {
12
18
  publish?: boolean;
13
19
  };
14
20
  type SerializationConfiguration = {
@@ -16,8 +22,9 @@ type SerializationConfiguration = {
16
22
  pull?: EntityConfiguration;
17
23
  push?: EntityConfiguration;
18
24
  } & EntityConfiguration> & {
19
- composition?: CompositionAndPatternConfiguration;
20
- pattern?: CompositionAndPatternConfiguration;
25
+ composition?: PublishableEntitiesConfiguration;
26
+ pattern?: PublishableEntitiesConfiguration;
27
+ entry?: EntityWithStateConfiguration;
21
28
  }>;
22
29
  directory: string;
23
30
  mode: SyncMode;
package/dist/index.mjs CHANGED
@@ -669,70 +669,30 @@ var AssetListModule = {
669
669
 
670
670
  // src/commands/canvas/commands/asset/pull.ts
671
671
  import { UncachedAssetClient as UncachedAssetClient3 } from "@uniformdev/assets";
672
- import { UncachedFileClient } from "@uniformdev/files";
673
672
 
674
673
  // src/files/index.ts
675
674
  import { preferredType } from "@thi.ng/mime";
676
675
  import { FILE_READY_STATE, getFileNameFromUrl } from "@uniformdev/files";
676
+ import { createHash } from "crypto";
677
677
  import fsj from "fs-jetpack";
678
678
  import sizeOf from "image-size";
679
679
  import PQueue from "p-queue";
680
680
  import { dirname as dirname2, join as join2 } from "path";
681
681
  var FILES_DIRECTORY_NAME = "files";
682
- var escapeRegExp = (string) => {
683
- return string.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
684
- };
685
682
  var urlToHash = (url) => {
686
- return Buffer.from(
687
- // We take only the first 64 characters of the pathname as
688
- // that's enough to guarantee uniqueness
689
- new URL(url).pathname.substring(0, 64)
690
- ).toString("base64");
691
- };
692
- var hashToPartialPathname = (hash) => {
693
- try {
694
- return Buffer.from(hash, "base64").toString("utf8");
695
- } catch {
696
- return null;
697
- }
698
- };
699
- var findUrlMatchingPartialPathname = (source, pathname) => {
700
- const escapedPathname = escapeRegExp(pathname);
701
- const regex = new RegExp(`"(https://([^"]*?)?img.uniform.(rocks|global)${escapedPathname}([^"]*?))"`);
702
- const match = source.match(regex);
703
- if (match && match[1]) {
704
- return match[1];
705
- }
706
- return null;
707
- };
708
- var urlToFileExtension = (url) => {
709
- try {
710
- const urlObject = new URL(url);
711
- const fileNameChunks = urlObject.pathname.split(".");
712
- return fileNameChunks.length > 1 ? fileNameChunks.at(-1) ?? null : null;
713
- } catch {
714
- return null;
715
- }
716
- };
717
- var urlToFileName = (url, hash) => {
718
- const fileName = hash ?? urlToHash(url);
719
- const fileExtension = urlToFileExtension(url);
683
+ const hash = createHash("sha256");
684
+ hash.update(url);
685
+ return hash.digest("hex");
686
+ };
687
+ var urlToFileName = (url) => {
688
+ const fileName = urlToHash(url);
689
+ const fileNameChunks = url.split(".");
690
+ const fileExtension = fileNameChunks.length > 1 ? fileNameChunks.at(-1) : "";
720
691
  return `${fileName}${fileExtension ? `.${fileExtension}` : ""}`;
721
692
  };
722
- var getFilesDirectory = (directory) => {
723
- const isPackage = isPathAPackageFile(directory);
724
- return isPackage ? dirname2(directory) : (
725
- // If we are syncing to a directory, we want to write all files into a
726
- // top-lvl folder. That way any entities that contain files will sync to the
727
- // same directory, so there is no duplication
728
- join2(directory, "..")
729
- );
730
- };
731
- var getUniformFileUrlMatches = (string) => {
732
- return string.matchAll(/"(https:\/\/([^"]*?)?img\.uniform\.(rocks|global)\/([^"]*?))"/g);
733
- };
734
693
  var deleteDownloadedFileByUrl = async (url, options) => {
735
- const writeDirectory = getFilesDirectory(options.directory);
694
+ const isPackage = isPathAPackageFile(options.directory);
695
+ const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
736
696
  const fileName = urlToFileName(url);
737
697
  const fileToDelete = join2(writeDirectory, FILES_DIRECTORY_NAME, fileName);
738
698
  try {
@@ -743,14 +703,18 @@ var deleteDownloadedFileByUrl = async (url, options) => {
743
703
  };
744
704
  var extractAndDownloadUniformFilesForObject = async (object, options) => {
745
705
  const objectAsString = JSON.stringify(object);
746
- const uniformFileUrlMatches = getUniformFileUrlMatches(objectAsString);
747
- const writeDirectory = getFilesDirectory(options.directory);
706
+ const uniformFileUrlMatches = objectAsString.matchAll(
707
+ /"(https:\/\/(.*)?img\.uniform\.(rocks|global)\/(.*?))"/g
708
+ );
709
+ const isPackage = isPathAPackageFile(options.directory);
710
+ const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
748
711
  if (uniformFileUrlMatches) {
749
712
  const fileDownloadQueue = new PQueue({ concurrency: 10 });
750
713
  for (const match of uniformFileUrlMatches) {
751
714
  const url = new URL(match[1]);
752
715
  fileDownloadQueue.add(async () => {
753
716
  try {
717
+ const fetchUrl = `${url.origin}${url.pathname}?format=original`;
754
718
  const fileName = urlToFileName(url.toString());
755
719
  const fileAlreadyExists = await fsj.existsAsync(
756
720
  join2(writeDirectory, FILES_DIRECTORY_NAME, fileName)
@@ -758,23 +722,6 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
758
722
  if (fileAlreadyExists) {
759
723
  return;
760
724
  }
761
- const file = await options.fileClient.get({ url: url.toString() }).catch(() => null);
762
- if (!file) {
763
- console.warn(`Skipping file ${url} as it does not exist in the project anymore`);
764
- return;
765
- }
766
- if (file.sourceId) {
767
- try {
768
- const hashAlreadyExists = await fsj.findAsync(join2(writeDirectory, FILES_DIRECTORY_NAME), {
769
- matching: [file.sourceId, `${file.sourceId}.*`]
770
- });
771
- if (hashAlreadyExists.length > 0) {
772
- return;
773
- }
774
- } catch {
775
- }
776
- }
777
- const fetchUrl = `${url.origin}${url.pathname}?format=original`;
778
725
  const response = await fetch(fetchUrl);
779
726
  if (!response.ok) {
780
727
  return;
@@ -792,8 +739,11 @@ var extractAndDownloadUniformFilesForObject = async (object, options) => {
792
739
  };
793
740
  var extractAndUploadUniformFilesForObject = async (object, options) => {
794
741
  let objectAsString = JSON.stringify(object);
795
- const uniformFileUrlMatches = getUniformFileUrlMatches(objectAsString);
796
- const writeDirectory = getFilesDirectory(options.directory);
742
+ const uniformFileUrlMatches = objectAsString.matchAll(
743
+ /"(https:\/\/(.*)?img\.uniform\.(rocks|global)\/(.*?))"/g
744
+ );
745
+ const isPackage = isPathAPackageFile(options.directory);
746
+ const writeDirectory = isPackage ? dirname2(options.directory) : options.directory;
797
747
  if (uniformFileUrlMatches) {
798
748
  const fileUploadQueue = new PQueue({ concurrency: 3 });
799
749
  for (const match of uniformFileUrlMatches) {
@@ -809,12 +759,11 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
809
759
  return;
810
760
  }
811
761
  const localFileName = urlToFileName(url);
812
- const expectedFilePath = join2(writeDirectory, FILES_DIRECTORY_NAME, localFileName);
813
- const fileExistsLocally = await fsj.existsAsync(expectedFilePath);
762
+ const fileExistsLocally = await fsj.existsAsync(
763
+ join2(writeDirectory, FILES_DIRECTORY_NAME, localFileName)
764
+ );
814
765
  if (!fileExistsLocally) {
815
- console.warn(
816
- `Skipping file ${url} as we couldn't find a local copy (looked at ${expectedFilePath})`
817
- );
766
+ console.warn(`Skipping file ${url} as we couldn't find a local copy`);
818
767
  return;
819
768
  }
820
769
  const fileBuffer = await fsj.readAsync(
@@ -866,8 +815,8 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
866
815
  return file.url;
867
816
  };
868
817
  const abortTimeout = setTimeout(() => {
869
- throw new Error(`Failed to upload file ${url} (upload timed out)`);
870
- }, 3e4);
818
+ throw new Error(`Failed to upload file ${url}`);
819
+ }, 1e4);
871
820
  const uploadedFileUrl = await checkForFile();
872
821
  clearTimeout(abortTimeout);
873
822
  objectAsString = objectAsString.replaceAll(`"${url}"`, `"${uploadedFileUrl}"`);
@@ -882,7 +831,9 @@ var extractAndUploadUniformFilesForObject = async (object, options) => {
882
831
  };
883
832
  var swapOutUniformFileUrlsForTargetProject = async (object, options) => {
884
833
  let objectAsString = JSON.stringify(object);
885
- const uniformFileUrlMatches = getUniformFileUrlMatches(objectAsString);
834
+ const uniformFileUrlMatches = objectAsString.matchAll(
835
+ /"(https:\/\/(.*)?img\.uniform\.(rocks|global)\/(.*?))"/g
836
+ );
886
837
  if (uniformFileUrlMatches) {
887
838
  const fileUrlReplacementQueue = new PQueue({ concurrency: 3 });
888
839
  for (const match of uniformFileUrlMatches) {
@@ -907,45 +858,6 @@ var swapOutUniformFileUrlsForTargetProject = async (object, options) => {
907
858
  }
908
859
  return JSON.parse(objectAsString);
909
860
  };
910
- var replaceRemoteUrlsWithLocalReferences = async (sourceObject, targetObject, options) => {
911
- let sourceObjectAsString = JSON.stringify(sourceObject);
912
- const targetObjectAsString = JSON.stringify(targetObject);
913
- const uniformFileUrlMatches = getUniformFileUrlMatches(sourceObjectAsString);
914
- const writeDirectory = getFilesDirectory(options.directory);
915
- if (uniformFileUrlMatches) {
916
- const fileUrlReplacementQueue = new PQueue({ concurrency: 3 });
917
- for (const match of uniformFileUrlMatches) {
918
- const url = match[1];
919
- fileUrlReplacementQueue.add(async () => {
920
- try {
921
- const localFileName = urlToFileName(url);
922
- const fileExistsLocally = await fsj.existsAsync(
923
- join2(writeDirectory, FILES_DIRECTORY_NAME, localFileName)
924
- );
925
- if (fileExistsLocally) {
926
- return;
927
- }
928
- const file = await options.fileClient.get({ url }).catch(() => null);
929
- if (!file || !file.sourceId) {
930
- return;
931
- }
932
- const originalPartialPath = hashToPartialPathname(file.sourceId);
933
- if (!originalPartialPath) {
934
- return;
935
- }
936
- const originalUrl = findUrlMatchingPartialPathname(targetObjectAsString, originalPartialPath);
937
- if (!originalUrl) {
938
- return;
939
- }
940
- sourceObjectAsString = sourceObjectAsString.replaceAll(`"${url}"`, `"${originalUrl}"`);
941
- } catch {
942
- }
943
- });
944
- }
945
- await fileUrlReplacementQueue.onIdle();
946
- }
947
- return JSON.parse(sourceObjectAsString);
948
- };
949
861
  var updateAssetFileIdBasedOnUrl = async (asset, options) => {
950
862
  var _a, _b, _c;
951
863
  const fileUrl = (_b = (_a = asset.asset.fields) == null ? void 0 : _a.url) == null ? void 0 : _b.value;
@@ -1097,7 +1009,6 @@ var AssetPullModule = {
1097
1009
  fetch: fetch3,
1098
1010
  projectId
1099
1011
  });
1100
- const fileClient = new UncachedFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
1101
1012
  const source = createAssetEngineDataSource({ client });
1102
1013
  let target;
1103
1014
  const isPackage = isPathAPackageFile(directory);
@@ -1139,27 +1050,14 @@ var AssetPullModule = {
1139
1050
  whatIf,
1140
1051
  allowEmptySource: true,
1141
1052
  log: createSyncEngineConsoleLogger({ diffMode }),
1142
- onBeforeCompareObjects: async (sourceObject, targetObject) => {
1143
- var _a, _b;
1053
+ onBeforeCompareObjects: async (sourceObject) => {
1144
1054
  delete sourceObject.object.asset._author;
1145
- const sourceObjectWithPotentiallySwappedUrl = await replaceRemoteUrlsWithLocalReferences(
1146
- sourceObject,
1147
- targetObject,
1148
- {
1149
- directory,
1150
- fileClient
1151
- }
1152
- );
1153
- if (((_a = sourceObjectWithPotentiallySwappedUrl.object.asset.fields) == null ? void 0 : _a.url) && ((_b = targetObject.object.asset.fields) == null ? void 0 : _b.url) && sourceObjectWithPotentiallySwappedUrl.object.asset.fields.url.value === targetObject.object.asset.fields.url.value) {
1154
- targetObject.object.asset.fields.file = sourceObjectWithPotentiallySwappedUrl.object.asset.fields.file;
1155
- }
1156
- return sourceObjectWithPotentiallySwappedUrl;
1055
+ return sourceObject;
1157
1056
  },
1158
1057
  onBeforeWriteObject: async (sourceObject) => {
1159
1058
  delete sourceObject.object.asset._author;
1160
1059
  return extractAndDownloadUniformFilesForObject(sourceObject, {
1161
- directory,
1162
- fileClient
1060
+ directory
1163
1061
  });
1164
1062
  }
1165
1063
  });
@@ -1168,7 +1066,7 @@ var AssetPullModule = {
1168
1066
 
1169
1067
  // src/commands/canvas/commands/asset/push.ts
1170
1068
  import { UncachedAssetClient as UncachedAssetClient4 } from "@uniformdev/assets";
1171
- import { UncachedFileClient as UncachedFileClient2 } from "@uniformdev/files";
1069
+ import { UncachedFileClient } from "@uniformdev/files";
1172
1070
  var AssetPushModule = {
1173
1071
  command: "push <directory>",
1174
1072
  describe: "Pushes all assets from files in a directory to Uniform",
@@ -1229,7 +1127,7 @@ var AssetPushModule = {
1229
1127
  });
1230
1128
  }
1231
1129
  const target = createAssetEngineDataSource({ client });
1232
- const fileClient = new UncachedFileClient2({ apiKey, apiHost, fetch: fetch3, projectId });
1130
+ const fileClient = new UncachedFileClient({ apiKey, apiHost, fetch: fetch3, projectId });
1233
1131
  await syncEngine({
1234
1132
  source,
1235
1133
  target,
@@ -1252,15 +1150,10 @@ var AssetPushModule = {
1252
1150
  return sourceObjectWithNewFileUrls;
1253
1151
  },
1254
1152
  onBeforeWriteObject: async (sourceObject) => {
1255
- const sourceObjectWithNewFileUrls = await swapOutUniformFileUrlsForTargetProject(
1256
- await extractAndUploadUniformFilesForObject(sourceObject, {
1257
- directory,
1258
- fileClient
1259
- }),
1260
- {
1261
- fileClient
1262
- }
1263
- );
1153
+ const sourceObjectWithNewFileUrls = await extractAndUploadUniformFilesForObject(sourceObject, {
1154
+ directory,
1155
+ fileClient
1156
+ });
1264
1157
  sourceObjectWithNewFileUrls.object = await updateAssetFileIdBasedOnUrl(
1265
1158
  sourceObjectWithNewFileUrls.object,
1266
1159
  {
@@ -2196,7 +2089,6 @@ var CompositionPublishModule = {
2196
2089
 
2197
2090
  // src/commands/canvas/commands/composition/pull.ts
2198
2091
  import { UncachedCanvasClient as UncachedCanvasClient10 } from "@uniformdev/canvas";
2199
- import { UncachedFileClient as UncachedFileClient3 } from "@uniformdev/files";
2200
2092
  var CompositionPullModule = {
2201
2093
  command: "pull <directory>",
2202
2094
  describe: "Pulls all compositions to local files in a directory",
@@ -2256,7 +2148,6 @@ var CompositionPullModule = {
2256
2148
  }) => {
2257
2149
  const fetch3 = nodeFetchProxy(proxy);
2258
2150
  const client = new UncachedCanvasClient10({ apiKey, apiHost, fetch: fetch3, projectId });
2259
- const fileClient = new UncachedFileClient3({ apiKey, apiHost, fetch: fetch3, projectId });
2260
2151
  const source = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
2261
2152
  const isPackage = isPathAPackageFile(directory);
2262
2153
  let target;
@@ -2286,16 +2177,9 @@ var CompositionPullModule = {
2286
2177
  whatIf,
2287
2178
  allowEmptySource: true,
2288
2179
  log: createSyncEngineConsoleLogger({ diffMode }),
2289
- onBeforeCompareObjects: async (sourceObject, targetObject) => {
2290
- return replaceRemoteUrlsWithLocalReferences(sourceObject, targetObject, {
2291
- directory,
2292
- fileClient
2293
- });
2294
- },
2295
2180
  onBeforeWriteObject: async (sourceObject) => {
2296
2181
  return extractAndDownloadUniformFilesForObject(sourceObject, {
2297
- directory,
2298
- fileClient
2182
+ directory
2299
2183
  });
2300
2184
  }
2301
2185
  });
@@ -2304,7 +2188,7 @@ var CompositionPullModule = {
2304
2188
 
2305
2189
  // src/commands/canvas/commands/composition/push.ts
2306
2190
  import { UncachedCanvasClient as UncachedCanvasClient11 } from "@uniformdev/canvas";
2307
- import { UncachedFileClient as UncachedFileClient4 } from "@uniformdev/files";
2191
+ import { UncachedFileClient as UncachedFileClient2 } from "@uniformdev/files";
2308
2192
  var CompositionPushModule = {
2309
2193
  command: "push <directory>",
2310
2194
  describe: "Pushes all compositions from files in a directory to Uniform Canvas",
@@ -2374,7 +2258,7 @@ var CompositionPushModule = {
2374
2258
  });
2375
2259
  }
2376
2260
  const target = createComponentInstanceEngineDataSource({ client, state, onlyCompositions, onlyPatterns });
2377
- const fileClient = new UncachedFileClient4({ apiKey, apiHost, fetch: fetch3, projectId });
2261
+ const fileClient = new UncachedFileClient2({ apiKey, apiHost, fetch: fetch3, projectId });
2378
2262
  await syncEngine({
2379
2263
  source,
2380
2264
  target,
@@ -3177,7 +3061,6 @@ var EntryListModule = {
3177
3061
 
3178
3062
  // src/commands/canvas/commands/entry/pull.ts
3179
3063
  import { ContentClient as ContentClient10 } from "@uniformdev/canvas";
3180
- import { UncachedFileClient as UncachedFileClient5 } from "@uniformdev/files";
3181
3064
 
3182
3065
  // src/commands/canvas/entryEngineDataSource.ts
3183
3066
  import { convertEntryToPutEntry } from "@uniformdev/canvas";
@@ -3277,7 +3160,6 @@ var EntryPullModule = {
3277
3160
  projectId,
3278
3161
  bypassCache: true
3279
3162
  });
3280
- const fileClient = new UncachedFileClient5({ apiKey, apiHost, fetch: fetch3, projectId });
3281
3163
  const source = createEntryEngineDataSource({ client, state });
3282
3164
  let target;
3283
3165
  const isPackage = isPathAPackageFile(directory);
@@ -3306,26 +3188,13 @@ var EntryPullModule = {
3306
3188
  mode,
3307
3189
  whatIf,
3308
3190
  allowEmptySource: true,
3309
- log: createSyncEngineConsoleLogger({ diffMode }),
3310
- onBeforeCompareObjects: async (sourceObject, targetObject) => {
3311
- return replaceRemoteUrlsWithLocalReferences(sourceObject, targetObject, {
3312
- directory,
3313
- fileClient
3314
- });
3315
- },
3316
- onBeforeWriteObject: async (sourceObject) => {
3317
- return extractAndDownloadUniformFilesForObject(sourceObject, {
3318
- directory,
3319
- fileClient
3320
- });
3321
- }
3191
+ log: createSyncEngineConsoleLogger({ diffMode })
3322
3192
  });
3323
3193
  }
3324
3194
  };
3325
3195
 
3326
3196
  // src/commands/canvas/commands/entry/push.ts
3327
3197
  import { ContentClient as ContentClient11 } from "@uniformdev/canvas";
3328
- import { UncachedFileClient as UncachedFileClient6 } from "@uniformdev/files";
3329
3198
  var EntryPushModule = {
3330
3199
  command: "push <directory>",
3331
3200
  describe: "Pushes all entries from files in a directory to Uniform",
@@ -3390,24 +3259,12 @@ var EntryPushModule = {
3390
3259
  });
3391
3260
  }
3392
3261
  const target = createEntryEngineDataSource({ client, state });
3393
- const fileClient = new UncachedFileClient6({ apiKey, apiHost, fetch: fetch3, projectId });
3394
3262
  await syncEngine({
3395
3263
  source,
3396
3264
  target,
3397
3265
  mode,
3398
3266
  whatIf,
3399
- log: createSyncEngineConsoleLogger({ diffMode }),
3400
- onBeforeCompareObjects: async (sourceObject) => {
3401
- return swapOutUniformFileUrlsForTargetProject(sourceObject, {
3402
- fileClient
3403
- });
3404
- },
3405
- onBeforeWriteObject: async (sourceObject) => {
3406
- return extractAndUploadUniformFilesForObject(sourceObject, {
3407
- directory,
3408
- fileClient
3409
- });
3410
- }
3267
+ log: createSyncEngineConsoleLogger({ diffMode })
3411
3268
  });
3412
3269
  }
3413
3270
  };
@@ -5598,7 +5455,7 @@ import { PostHog } from "posthog-node";
5598
5455
  // package.json
5599
5456
  var package_default = {
5600
5457
  name: "@uniformdev/cli",
5601
- version: "19.86.0",
5458
+ version: "19.87.0",
5602
5459
  description: "Uniform command line interface tool",
5603
5460
  license: "SEE LICENSE IN LICENSE.txt",
5604
5461
  main: "./cli.js",
@@ -7722,9 +7579,9 @@ var SyncPullModule = {
7722
7579
  )
7723
7580
  ),
7724
7581
  handler: async ({ serialization, ...otherParams }) => {
7582
+ var _a;
7725
7583
  const config2 = serialization;
7726
7584
  const enabledEntities = Object.entries({
7727
- asset: AssetPullModule,
7728
7585
  category: CategoryPullModule,
7729
7586
  dataType: DataTypePullModule,
7730
7587
  prompt: PromptPullModule,
@@ -7740,10 +7597,11 @@ var SyncPullModule = {
7740
7597
  projectMapNode: ProjectMapNodePullModule,
7741
7598
  redirect: RedirectDefinitionPullModule,
7742
7599
  entry: EntryPullModule,
7743
- contentType: ContentTypePullModule
7600
+ contentType: ContentTypePullModule,
7601
+ asset: AssetPullModule
7744
7602
  }).filter(([entityType]) => {
7745
- var _a, _b, _c, _d, _e, _f;
7746
- return Boolean((_a = config2.entitiesConfig) == null ? void 0 : _a[entityType]) && ((_c = (_b = config2.entitiesConfig) == null ? void 0 : _b[entityType]) == null ? void 0 : _c.disabled) !== true && ((_f = (_e = (_d = config2.entitiesConfig) == null ? void 0 : _d[entityType]) == null ? void 0 : _e.pull) == null ? void 0 : _f.disabled) !== true;
7603
+ var _a2, _b, _c, _d, _e, _f;
7604
+ return Boolean((_a2 = config2.entitiesConfig) == null ? void 0 : _a2[entityType]) && ((_c = (_b = config2.entitiesConfig) == null ? void 0 : _b[entityType]) == null ? void 0 : _c.disabled) !== true && ((_f = (_e = (_d = config2.entitiesConfig) == null ? void 0 : _d[entityType]) == null ? void 0 : _e.pull) == null ? void 0 : _f.disabled) !== true;
7747
7605
  });
7748
7606
  if (enabledEntities.length === 0) {
7749
7607
  throw new Error(
@@ -7752,10 +7610,14 @@ var SyncPullModule = {
7752
7610
  }
7753
7611
  for (const [entityType, module3] of enabledEntities) {
7754
7612
  const spinner = spin(entityType);
7613
+ const entityConfigSupportsPullState = (entityConfig2) => {
7614
+ return entityConfig2 !== void 0 && "state" in entityConfig2;
7615
+ };
7616
+ const entityConfig = (_a = config2.entitiesConfig) == null ? void 0 : _a[entityType];
7755
7617
  try {
7756
7618
  await module3.handler({
7757
7619
  ...otherParams,
7758
- state: 0,
7620
+ state: entityConfigSupportsPullState(entityConfig) ? entityConfig.state ?? 0 : 0,
7759
7621
  format: getFormat(entityType, config2),
7760
7622
  onlyCompositions: entityType === "composition" ? true : void 0,
7761
7623
  onlyPatterns: entityType === "pattern" ? true : void 0,
@@ -7816,7 +7678,6 @@ var SyncPushModule = {
7816
7678
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
7817
7679
  const config2 = serialization;
7818
7680
  const enabledEntities = Object.entries({
7819
- asset: AssetPushModule,
7820
7681
  category: CategoryPushModule,
7821
7682
  dataType: DataTypePushModule,
7822
7683
  prompt: PromptPushModule,
@@ -7832,7 +7693,8 @@ var SyncPushModule = {
7832
7693
  projectMapNode: ProjectMapNodePushModule,
7833
7694
  redirect: RedirectDefinitionPushModule,
7834
7695
  contentType: ContentTypePushModule,
7835
- entry: EntryPushModule
7696
+ entry: EntryPushModule,
7697
+ asset: AssetPushModule
7836
7698
  }).filter(([entityType]) => {
7837
7699
  var _a2, _b2, _c2, _d2, _e2, _f2;
7838
7700
  return Boolean((_a2 = config2.entitiesConfig) == null ? void 0 : _a2[entityType]) && ((_c2 = (_b2 = config2.entitiesConfig) == null ? void 0 : _b2[entityType]) == null ? void 0 : _c2.disabled) !== true && ((_f2 = (_e2 = (_d2 = config2.entitiesConfig) == null ? void 0 : _d2[entityType]) == null ? void 0 : _e2.push) == null ? void 0 : _f2.disabled) !== true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.86.1-alpha.13+962dd4d05",
3
+ "version": "19.87.0",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -17,12 +17,12 @@
17
17
  },
18
18
  "dependencies": {
19
19
  "@thi.ng/mime": "^2.2.23",
20
- "@uniformdev/assets": "19.86.1-alpha.13+962dd4d05",
21
- "@uniformdev/canvas": "19.86.1-alpha.13+962dd4d05",
22
- "@uniformdev/context": "19.86.1-alpha.13+962dd4d05",
23
- "@uniformdev/files": "19.86.1-alpha.13+962dd4d05",
24
- "@uniformdev/project-map": "19.86.1-alpha.13+962dd4d05",
25
- "@uniformdev/redirect": "19.86.1-alpha.13+962dd4d05",
20
+ "@uniformdev/assets": "19.87.0",
21
+ "@uniformdev/canvas": "19.87.0",
22
+ "@uniformdev/context": "19.87.0",
23
+ "@uniformdev/files": "19.87.0",
24
+ "@uniformdev/project-map": "19.87.0",
25
+ "@uniformdev/redirect": "19.87.0",
26
26
  "call-bind": "^1.0.2",
27
27
  "colorette": "2.0.20",
28
28
  "cosmiconfig": "8.3.6",
@@ -69,5 +69,5 @@
69
69
  "publishConfig": {
70
70
  "access": "public"
71
71
  },
72
- "gitHead": "962dd4d059ca4195e099d136fc469d8b97356c74"
72
+ "gitHead": "596b9c4afbabb8579dd0e6c80690df135d6c55fc"
73
73
  }