@uniformdev/cli 19.214.1-alpha.34 → 19.214.1-alpha.35

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 +106 -21
  2. package/package.json +9 -9
package/dist/index.mjs CHANGED
@@ -2495,7 +2495,8 @@ var CompositionPublishModule = {
2495
2495
  onlyCompositions,
2496
2496
  onlyPatterns,
2497
2497
  patternType,
2498
- verbose
2498
+ verbose,
2499
+ directory
2499
2500
  }) => {
2500
2501
  if (!all && !ids || all && ids) {
2501
2502
  console.error(`Specify --all or composition ID(s) to publish.`);
@@ -2522,6 +2523,7 @@ var CompositionPublishModule = {
2522
2523
  patternType,
2523
2524
  verbose
2524
2525
  });
2526
+ const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
2525
2527
  await syncEngine({
2526
2528
  source,
2527
2529
  target,
@@ -2529,7 +2531,21 @@ var CompositionPublishModule = {
2529
2531
  mode: "createOrUpdate",
2530
2532
  whatIf,
2531
2533
  verbose,
2532
- log: createPublishStatusSyncEngineConsoleLogger({ status: "publish" })
2534
+ log: createPublishStatusSyncEngineConsoleLogger({ status: "publish" }),
2535
+ onBeforeCompareObjects: async (sourceObject) => {
2536
+ return replaceLocalUrlsWithRemoteReferences({
2537
+ entity: sourceObject,
2538
+ fileClient
2539
+ });
2540
+ },
2541
+ compareContents: compareCompositionsOrEntriesWithoutAssetUrls,
2542
+ onBeforeWriteObject: async (sourceObject) => {
2543
+ return uploadFilesForCompositionOrEntry({
2544
+ entity: sourceObject,
2545
+ directory,
2546
+ fileClient
2547
+ });
2548
+ }
2533
2549
  });
2534
2550
  }
2535
2551
  };
@@ -4320,7 +4336,18 @@ var EntryPublishModule = {
4320
4336
  )
4321
4337
  )
4322
4338
  ),
4323
- handler: async ({ apiHost, edgeApiHost, apiKey, proxy, ids, all, project: projectId, whatIf, verbose }) => {
4339
+ handler: async ({
4340
+ apiHost,
4341
+ edgeApiHost,
4342
+ apiKey,
4343
+ proxy,
4344
+ ids,
4345
+ all,
4346
+ project: projectId,
4347
+ whatIf,
4348
+ verbose,
4349
+ directory
4350
+ }) => {
4324
4351
  if (!all && !ids || all && ids) {
4325
4352
  console.error(`Specify --all or entry ID(s) to publish.`);
4326
4353
  process.exit(1);
@@ -4340,13 +4367,28 @@ var EntryPublishModule = {
4340
4367
  entryIDs: entryIDsArray,
4341
4368
  onlyEntries: true
4342
4369
  });
4370
+ const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
4343
4371
  await syncEngine({
4344
4372
  source,
4345
4373
  target,
4346
4374
  // Publishing is one-direction operation, so no need to support automatic un-publishing
4347
4375
  mode: "createOrUpdate",
4348
4376
  whatIf,
4349
- log: createPublishStatusSyncEngineConsoleLogger({ status: "publish" })
4377
+ log: createPublishStatusSyncEngineConsoleLogger({ status: "publish" }),
4378
+ onBeforeCompareObjects: async (sourceObject) => {
4379
+ return replaceLocalUrlsWithRemoteReferences({
4380
+ entity: sourceObject,
4381
+ fileClient
4382
+ });
4383
+ },
4384
+ compareContents: compareCompositionsOrEntriesWithoutAssetUrls,
4385
+ onBeforeWriteObject: async (sourceObject) => {
4386
+ return uploadFilesForCompositionOrEntry({
4387
+ entity: sourceObject,
4388
+ directory,
4389
+ fileClient
4390
+ });
4391
+ }
4350
4392
  });
4351
4393
  }
4352
4394
  };
@@ -4798,7 +4840,18 @@ var EntryPatternPublishModule = {
4798
4840
  )
4799
4841
  )
4800
4842
  ),
4801
- handler: async ({ apiHost, edgeApiHost, apiKey, proxy, ids, all, whatIf, project: projectId, verbose }) => {
4843
+ handler: async ({
4844
+ apiHost,
4845
+ edgeApiHost,
4846
+ apiKey,
4847
+ proxy,
4848
+ ids,
4849
+ all,
4850
+ whatIf,
4851
+ project: projectId,
4852
+ verbose,
4853
+ directory
4854
+ }) => {
4802
4855
  if (!all && !ids || all && ids) {
4803
4856
  console.error(`Specify --all or entry pattern ID(s) to publish.`);
4804
4857
  process.exit(1);
@@ -4818,13 +4871,28 @@ var EntryPatternPublishModule = {
4818
4871
  entryIDs: entryIDsArray,
4819
4872
  onlyPatterns: true
4820
4873
  });
4874
+ const fileClient = getFileClient({ apiKey, apiHost, fetch: fetch2, projectId });
4821
4875
  await syncEngine({
4822
4876
  source,
4823
4877
  target,
4824
4878
  // Publishing is one-direction operation, so no need to support automatic un-publishing
4825
4879
  mode: "createOrUpdate",
4826
4880
  whatIf,
4827
- log: createPublishStatusSyncEngineConsoleLogger({ status: "publish" })
4881
+ log: createPublishStatusSyncEngineConsoleLogger({ status: "publish" }),
4882
+ onBeforeCompareObjects: async (sourceObject) => {
4883
+ return replaceLocalUrlsWithRemoteReferences({
4884
+ entity: sourceObject,
4885
+ fileClient
4886
+ });
4887
+ },
4888
+ compareContents: compareCompositionsOrEntriesWithoutAssetUrls,
4889
+ onBeforeWriteObject: async (sourceObject) => {
4890
+ return uploadFilesForCompositionOrEntry({
4891
+ entity: sourceObject,
4892
+ directory,
4893
+ fileClient
4894
+ });
4895
+ }
4828
4896
  });
4829
4897
  }
4830
4898
  };
@@ -10645,7 +10713,8 @@ var SyncPushModule = {
10645
10713
  ...otherParams,
10646
10714
  patternType: "component",
10647
10715
  onlyPatterns: true,
10648
- all: true
10716
+ all: true,
10717
+ directory: getPushFilename("componentPattern", config2)
10649
10718
  }),
10650
10719
  {
10651
10720
  text: "publishing component patterns...",
@@ -10668,7 +10737,8 @@ var SyncPushModule = {
10668
10737
  ...otherParams,
10669
10738
  all: true,
10670
10739
  onlyPatterns: true,
10671
- patternType: "composition"
10740
+ patternType: "composition",
10741
+ directory: getPushFilename("compositionPattern", config2)
10672
10742
  }),
10673
10743
  {
10674
10744
  text: "publishing composition patterns...",
@@ -10690,7 +10760,8 @@ var SyncPushModule = {
10690
10760
  CompositionPublishModule.handler({
10691
10761
  ...otherParams,
10692
10762
  all: true,
10693
- onlyCompositions: true
10763
+ onlyCompositions: true,
10764
+ directory: getPushFilename("composition", config2)
10694
10765
  }),
10695
10766
  {
10696
10767
  text: "publishing compositions...",
@@ -10708,30 +10779,44 @@ var SyncPushModule = {
10708
10779
  }
10709
10780
  if (config2.entitiesConfig?.entry && config2.entitiesConfig?.entry?.push?.disabled !== true && config2.entitiesConfig?.entry?.publish) {
10710
10781
  try {
10711
- await spinPromise(EntryPublishModule.handler({ ...otherParams, all: true }), {
10712
- text: "publishing entries...",
10713
- successText: "published entries",
10714
- failText(error) {
10715
- return `publishing entries
10782
+ await spinPromise(
10783
+ EntryPublishModule.handler({
10784
+ ...otherParams,
10785
+ all: true,
10786
+ directory: getPushFilename("entry", config2)
10787
+ }),
10788
+ {
10789
+ text: "publishing entries...",
10790
+ successText: "published entries",
10791
+ failText(error) {
10792
+ return `publishing entries
10716
10793
 
10717
10794
  ${error.stack ?? error.message}`;
10795
+ }
10718
10796
  }
10719
- });
10797
+ );
10720
10798
  } catch {
10721
10799
  process.exit(1);
10722
10800
  }
10723
10801
  }
10724
10802
  if (config2.entitiesConfig?.entryPattern && config2.entitiesConfig?.entryPattern?.push?.disabled !== true && config2.entitiesConfig?.entryPattern?.publish) {
10725
10803
  try {
10726
- await spinPromise(EntryPatternPublishModule.handler({ ...otherParams, all: true }), {
10727
- text: "publishing entry patterns...",
10728
- successText: "published entry patterns",
10729
- failText(error) {
10730
- return `publishing entry patterns
10804
+ await spinPromise(
10805
+ EntryPatternPublishModule.handler({
10806
+ ...otherParams,
10807
+ all: true,
10808
+ directory: getPushFilename("entryPattern", config2)
10809
+ }),
10810
+ {
10811
+ text: "publishing entry patterns...",
10812
+ successText: "published entry patterns",
10813
+ failText(error) {
10814
+ return `publishing entry patterns
10731
10815
 
10732
10816
  ${error.stack ?? error.message}`;
10817
+ }
10733
10818
  }
10734
- });
10819
+ );
10735
10820
  } catch {
10736
10821
  process.exit(1);
10737
10822
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@uniformdev/cli",
3
- "version": "19.214.1-alpha.34+476b7be79b",
3
+ "version": "19.214.1-alpha.35+6fc698bf99",
4
4
  "description": "Uniform command line interface tool",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "main": "./cli.js",
@@ -27,13 +27,13 @@
27
27
  },
28
28
  "dependencies": {
29
29
  "@thi.ng/mime": "^2.2.23",
30
- "@uniformdev/assets": "19.214.1-alpha.34+476b7be79b",
31
- "@uniformdev/canvas": "19.214.1-alpha.34+476b7be79b",
32
- "@uniformdev/context": "19.214.1-alpha.34+476b7be79b",
33
- "@uniformdev/files": "19.214.1-alpha.34+476b7be79b",
34
- "@uniformdev/project-map": "19.214.1-alpha.34+476b7be79b",
35
- "@uniformdev/redirect": "19.214.1-alpha.34+476b7be79b",
36
- "@uniformdev/richtext": "19.214.1-alpha.34+476b7be79b",
30
+ "@uniformdev/assets": "19.214.1-alpha.35+6fc698bf99",
31
+ "@uniformdev/canvas": "19.214.1-alpha.35+6fc698bf99",
32
+ "@uniformdev/context": "19.214.1-alpha.35+6fc698bf99",
33
+ "@uniformdev/files": "19.214.1-alpha.35+6fc698bf99",
34
+ "@uniformdev/project-map": "19.214.1-alpha.35+6fc698bf99",
35
+ "@uniformdev/redirect": "19.214.1-alpha.35+6fc698bf99",
36
+ "@uniformdev/richtext": "19.214.1-alpha.35+6fc698bf99",
37
37
  "call-bind": "^1.0.2",
38
38
  "colorette": "2.0.20",
39
39
  "cosmiconfig": "9.0.0",
@@ -79,5 +79,5 @@
79
79
  "publishConfig": {
80
80
  "access": "public"
81
81
  },
82
- "gitHead": "476b7be79b950e65641ffb8698a13bc5d9b966f8"
82
+ "gitHead": "6fc698bf99ac7e8387e41b522af3582d0c8ab57e"
83
83
  }