@wix/cli 1.1.59 → 1.1.61

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 (128) hide show
  1. package/build/{DevCommand-PLIPWJKO.js → DevCommand-3CEY3HPC.js} +17 -16
  2. package/build/{DevCommand-PLIPWJKO.js.map → DevCommand-3CEY3HPC.js.map} +1 -1
  3. package/build/{DevCommand-D6QHU2YA.js → DevCommand-NPVKUDPR.js} +27 -876
  4. package/build/DevCommand-NPVKUDPR.js.map +1 -0
  5. package/build/{LoginCommand-NRZ4VWWM.js → LoginCommand-RTNDZF77.js} +12 -12
  6. package/build/{LogoutCommand-INOYIE67.js → LogoutCommand-CUOS2BUH.js} +8 -8
  7. package/build/PreviewCommand-5GAG7MBS.js +471 -0
  8. package/build/PreviewCommand-5GAG7MBS.js.map +1 -0
  9. package/build/{WhoamiCommand-4V4GTNFW.js → WhoamiCommand-VZ6KKOVQ.js} +5 -5
  10. package/build/{chunk-F3E4MMLD.js → chunk-2KK3GKES.js} +6 -6
  11. package/build/{chunk-6F2RSXHN.js → chunk-2NWGTFAC.js} +3 -3
  12. package/build/{chunk-6F2RSXHN.js.map → chunk-2NWGTFAC.js.map} +1 -1
  13. package/build/{chunk-Z7P6TDPB.js → chunk-2WA6TGDO.js} +6 -6
  14. package/build/{chunk-HYAIYTKF.js → chunk-332V5RP4.js} +59 -7
  15. package/build/{chunk-HYAIYTKF.js.map → chunk-332V5RP4.js.map} +1 -1
  16. package/build/{chunk-SELJR2HV.js → chunk-3NEXZN7N.js} +5 -66
  17. package/build/chunk-3NEXZN7N.js.map +1 -0
  18. package/build/{chunk-JG7FKL4X.js → chunk-3UE73ERL.js} +29 -9
  19. package/build/chunk-3UE73ERL.js.map +1 -0
  20. package/build/{chunk-OOGMXJJV.js → chunk-6K6VPM3T.js} +6 -6
  21. package/build/chunk-6LI4WGAW.js +43 -0
  22. package/build/chunk-6LI4WGAW.js.map +1 -0
  23. package/build/chunk-6XRFJZTQ.js +74 -0
  24. package/build/chunk-6XRFJZTQ.js.map +1 -0
  25. package/build/{chunk-5ZVEBKUO.js → chunk-6YVNZGPU.js} +597 -362
  26. package/build/chunk-6YVNZGPU.js.map +1 -0
  27. package/build/{chunk-U32RURCT.js → chunk-77YDQA7O.js} +6 -6
  28. package/build/chunk-B5A3CFP2.js +135 -0
  29. package/build/chunk-B5A3CFP2.js.map +1 -0
  30. package/build/{chunk-IFQQVSBK.js → chunk-BGKFJNUK.js} +2 -2
  31. package/build/{chunk-VEVISRHN.js → chunk-DEO7G3RD.js} +5 -5
  32. package/build/{chunk-CS26555F.js → chunk-DP2BL2V4.js} +7 -7
  33. package/build/{chunk-X7XOMWAQ.js → chunk-G4NFI3XC.js} +4 -4
  34. package/build/{chunk-T4OH34QF.js → chunk-H6BDO22X.js} +12 -4
  35. package/build/{chunk-T4OH34QF.js.map → chunk-H6BDO22X.js.map} +1 -1
  36. package/build/{chunk-QGSHUCNV.js → chunk-HMGX4HL2.js} +49 -18
  37. package/build/chunk-HMGX4HL2.js.map +1 -0
  38. package/build/{chunk-AXVTET6V.js → chunk-HV2IEAOB.js} +2 -2
  39. package/build/{chunk-V4DAKO7L.js → chunk-J573TQNU.js} +577 -574
  40. package/build/chunk-J573TQNU.js.map +1 -0
  41. package/build/{chunk-4HVBZRJL.js → chunk-KOGQSQ4I.js} +2 -2
  42. package/build/{chunk-4OBSJ6OG.js → chunk-L53ZVQB7.js} +139 -113
  43. package/build/{chunk-4OBSJ6OG.js.map → chunk-L53ZVQB7.js.map} +1 -1
  44. package/build/{chunk-N5IXBRXL.js → chunk-M34KVUTA.js} +2 -2
  45. package/build/{chunk-3RBFRZE2.js → chunk-N3OHN3MH.js} +5 -5
  46. package/build/{chunk-3RBFRZE2.js.map → chunk-N3OHN3MH.js.map} +1 -1
  47. package/build/{chunk-GLXEVSFE.js → chunk-P4UAXEEN.js} +14 -132
  48. package/build/chunk-P4UAXEEN.js.map +1 -0
  49. package/build/{chunk-BV3B44QL.js → chunk-PTIE2TCP.js} +3 -3
  50. package/build/{chunk-BNWDAMAL.js → chunk-PX2L3CCA.js} +2 -2
  51. package/build/chunk-PX2L3CCA.js.map +1 -0
  52. package/build/chunk-Q3GS63B5.js +901 -0
  53. package/build/chunk-Q3GS63B5.js.map +1 -0
  54. package/build/{chunk-5XUFGBCU.js → chunk-SEOIN2A6.js} +7 -3
  55. package/build/chunk-SEOIN2A6.js.map +1 -0
  56. package/build/{chunk-YUFAOC35.js → chunk-V7JWKPQI.js} +8 -8
  57. package/build/{chunk-VRDC2KLN.js → chunk-VXGNI7CP.js} +5 -2
  58. package/build/{chunk-VRDC2KLN.js.map → chunk-VXGNI7CP.js.map} +1 -1
  59. package/build/{chunk-CMXHWKEP.js → chunk-XFEYPXEY.js} +3 -3
  60. package/build/{chunk-G6TDIUNY.js → chunk-Y4ZVXLXY.js} +2 -2
  61. package/build/{chunk-PNUERA4W.js → chunk-ZVHSVTAJ.js} +5 -5
  62. package/build/{dev-TEWYYBKR.js → dev-FOGJASYZ.js} +31 -30
  63. package/build/{dev-TEWYYBKR.js.map → dev-FOGJASYZ.js.map} +1 -1
  64. package/build/index.js +29 -29
  65. package/build/{install-MTS6LPPU.js → install-NSVJU2EB.js} +22 -21
  66. package/build/{install-MTS6LPPU.js.map → install-NSVJU2EB.js.map} +1 -1
  67. package/build/{preview-TDMPHSVV.js → preview-RQ5CLHV5.js} +24 -22
  68. package/build/{preview-TDMPHSVV.js.map → preview-RQ5CLHV5.js.map} +1 -1
  69. package/build/{publish-5VLMBE6J.js → publish-YWESFDVY.js} +30 -27
  70. package/build/publish-YWESFDVY.js.map +1 -0
  71. package/build/{render-command-7OMEGPW4.js → render-command-4GOKWOT7.js} +11 -11
  72. package/build/{render-command-UQPFUBIL.js → render-command-E3JPPTZA.js} +12 -12
  73. package/build/{render-command-FELGYBEY.js → render-command-WMEIFR3G.js} +13 -13
  74. package/build/{run-command-3YTQS4ZX.js → run-command-D54S2NI5.js} +9 -9
  75. package/build/{src-Y334LPF5.js → src-4W7XB5DS.js} +21 -9
  76. package/build/src-4W7XB5DS.js.map +1 -0
  77. package/build/{src-4W2WPIAM.js → src-HA6XHM2E.js} +8 -8
  78. package/build/{src-7NEL65ZK.js → src-IIEVMGC3.js} +18 -18
  79. package/build/{src-UWOBS6D7.js → src-NGHHXRWJ.js} +2 -2
  80. package/build/{src-LA3GYOE6.js → src-NS46VL23.js} +7 -7
  81. package/build/{src-IBLQL7AB.js → src-OIVJ4AKD.js} +6 -6
  82. package/build/{src-BMV74WCO.js → src-XSN6C5L2.js} +3 -3
  83. package/build/sync-types-SQEHJPEG.js +31 -0
  84. package/build/{uninstall-M4DEVSQC.js → uninstall-ASZ55QZA.js} +20 -19
  85. package/build/{uninstall-M4DEVSQC.js.map → uninstall-ASZ55QZA.js.map} +1 -1
  86. package/package.json +3 -3
  87. package/build/DevCommand-D6QHU2YA.js.map +0 -1
  88. package/build/chunk-5XUFGBCU.js.map +0 -1
  89. package/build/chunk-5ZVEBKUO.js.map +0 -1
  90. package/build/chunk-BNWDAMAL.js.map +0 -1
  91. package/build/chunk-GLXEVSFE.js.map +0 -1
  92. package/build/chunk-JG7FKL4X.js.map +0 -1
  93. package/build/chunk-QGSHUCNV.js.map +0 -1
  94. package/build/chunk-SELJR2HV.js.map +0 -1
  95. package/build/chunk-V4DAKO7L.js.map +0 -1
  96. package/build/publish-5VLMBE6J.js.map +0 -1
  97. package/build/src-Y334LPF5.js.map +0 -1
  98. package/build/sync-types-W3PVOJTK.js +0 -30
  99. /package/build/{LoginCommand-NRZ4VWWM.js.map → LoginCommand-RTNDZF77.js.map} +0 -0
  100. /package/build/{LogoutCommand-INOYIE67.js.map → LogoutCommand-CUOS2BUH.js.map} +0 -0
  101. /package/build/{WhoamiCommand-4V4GTNFW.js.map → WhoamiCommand-VZ6KKOVQ.js.map} +0 -0
  102. /package/build/{chunk-F3E4MMLD.js.map → chunk-2KK3GKES.js.map} +0 -0
  103. /package/build/{chunk-Z7P6TDPB.js.map → chunk-2WA6TGDO.js.map} +0 -0
  104. /package/build/{chunk-OOGMXJJV.js.map → chunk-6K6VPM3T.js.map} +0 -0
  105. /package/build/{chunk-U32RURCT.js.map → chunk-77YDQA7O.js.map} +0 -0
  106. /package/build/{chunk-IFQQVSBK.js.map → chunk-BGKFJNUK.js.map} +0 -0
  107. /package/build/{chunk-VEVISRHN.js.map → chunk-DEO7G3RD.js.map} +0 -0
  108. /package/build/{chunk-CS26555F.js.map → chunk-DP2BL2V4.js.map} +0 -0
  109. /package/build/{chunk-X7XOMWAQ.js.map → chunk-G4NFI3XC.js.map} +0 -0
  110. /package/build/{chunk-AXVTET6V.js.map → chunk-HV2IEAOB.js.map} +0 -0
  111. /package/build/{chunk-4HVBZRJL.js.map → chunk-KOGQSQ4I.js.map} +0 -0
  112. /package/build/{chunk-N5IXBRXL.js.map → chunk-M34KVUTA.js.map} +0 -0
  113. /package/build/{chunk-BV3B44QL.js.map → chunk-PTIE2TCP.js.map} +0 -0
  114. /package/build/{chunk-YUFAOC35.js.map → chunk-V7JWKPQI.js.map} +0 -0
  115. /package/build/{chunk-CMXHWKEP.js.map → chunk-XFEYPXEY.js.map} +0 -0
  116. /package/build/{chunk-G6TDIUNY.js.map → chunk-Y4ZVXLXY.js.map} +0 -0
  117. /package/build/{chunk-PNUERA4W.js.map → chunk-ZVHSVTAJ.js.map} +0 -0
  118. /package/build/{render-command-7OMEGPW4.js.map → render-command-4GOKWOT7.js.map} +0 -0
  119. /package/build/{render-command-UQPFUBIL.js.map → render-command-E3JPPTZA.js.map} +0 -0
  120. /package/build/{render-command-FELGYBEY.js.map → render-command-WMEIFR3G.js.map} +0 -0
  121. /package/build/{run-command-3YTQS4ZX.js.map → run-command-D54S2NI5.js.map} +0 -0
  122. /package/build/{src-4W2WPIAM.js.map → src-HA6XHM2E.js.map} +0 -0
  123. /package/build/{src-7NEL65ZK.js.map → src-IIEVMGC3.js.map} +0 -0
  124. /package/build/{src-BMV74WCO.js.map → src-NGHHXRWJ.js.map} +0 -0
  125. /package/build/{src-LA3GYOE6.js.map → src-NS46VL23.js.map} +0 -0
  126. /package/build/{src-IBLQL7AB.js.map → src-OIVJ4AKD.js.map} +0 -0
  127. /package/build/{src-UWOBS6D7.js.map → src-XSN6C5L2.js.map} +0 -0
  128. /package/build/{sync-types-W3PVOJTK.js.map → sync-types-SQEHJPEG.js.map} +0 -0
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  resolveUrl,
5
5
  serializer
6
- } from "./chunk-U32RURCT.js";
6
+ } from "./chunk-77YDQA7O.js";
7
7
  import {
8
8
  init_esm_shims
9
9
  } from "./chunk-PYIAC2GK.js";
@@ -179,4 +179,4 @@ export {
179
179
  createApp,
180
180
  deployApp
181
181
  };
182
- //# sourceMappingURL=chunk-4HVBZRJL.js.map
182
+ //# sourceMappingURL=chunk-KOGQSQ4I.js.map
@@ -3,6 +3,9 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  require_isexe
5
5
  } from "./chunk-OJHDGJWP.js";
6
+ import {
7
+ GridAppLayout
8
+ } from "./chunk-6LI4WGAW.js";
6
9
  import {
7
10
  require_http_cache_semantics
8
11
  } from "./chunk-YXFEXGAH.js";
@@ -10,13 +13,13 @@ import {
10
13
  resolveUrl,
11
14
  serializer,
12
15
  toURLSearchParams
13
- } from "./chunk-U32RURCT.js";
16
+ } from "./chunk-77YDQA7O.js";
14
17
  import {
15
18
  require_clean,
16
19
  require_is_core_module,
17
20
  require_semver,
18
21
  require_valid
19
- } from "./chunk-HYAIYTKF.js";
22
+ } from "./chunk-332V5RP4.js";
20
23
  import {
21
24
  require_index_node,
22
25
  require_ms,
@@ -24,10 +27,10 @@ import {
24
27
  } from "./chunk-WN3D6AOY.js";
25
28
  import {
26
29
  z
27
- } from "./chunk-BNWDAMAL.js";
30
+ } from "./chunk-PX2L3CCA.js";
28
31
  import {
29
32
  require_verror
30
- } from "./chunk-T4OH34QF.js";
33
+ } from "./chunk-H6BDO22X.js";
31
34
  import {
32
35
  __commonJS,
33
36
  __dirname,
@@ -49223,6 +49226,46 @@ var require_types_impl = __commonJS({
49223
49226
  }
49224
49227
  });
49225
49228
 
49229
+ // ../../node_modules/@wix/ambassador-velo-ide-v1-gridapp-filestructure/build/cjs/types.impl.js
49230
+ var require_types_impl2 = __commonJS({
49231
+ "../../node_modules/@wix/ambassador-velo-ide-v1-gridapp-filestructure/build/cjs/types.impl.js"(exports2) {
49232
+ "use strict";
49233
+ init_esm_shims();
49234
+ Object.defineProperty(exports2, "__esModule", { value: true });
49235
+ exports2.WebhookIdentityType = exports2.Action = exports2.GridAppLayout = exports2.FileType = void 0;
49236
+ var FileType;
49237
+ (function(FileType2) {
49238
+ FileType2["FILE"] = "FILE";
49239
+ FileType2["DIRECTORY"] = "DIRECTORY";
49240
+ })(FileType = exports2.FileType || (exports2.FileType = {}));
49241
+ var GridAppLayout3;
49242
+ (function(GridAppLayout4) {
49243
+ GridAppLayout4["UNKNOWN_GRID_APP_LAYOUT"] = "UNKNOWN_GRID_APP_LAYOUT";
49244
+ GridAppLayout4["ONLINE"] = "ONLINE";
49245
+ GridAppLayout4["GITHUB"] = "GITHUB";
49246
+ GridAppLayout4["GITHUB_BLOCKS"] = "GITHUB_BLOCKS";
49247
+ GridAppLayout4["WIX_IDE"] = "WIX_IDE";
49248
+ })(GridAppLayout3 = exports2.GridAppLayout || (exports2.GridAppLayout = {}));
49249
+ var Action;
49250
+ (function(Action2) {
49251
+ Action2["UNKNOWN"] = "UNKNOWN";
49252
+ Action2["UPDATE"] = "UPDATE";
49253
+ Action2["CREATE"] = "CREATE";
49254
+ Action2["MOVE"] = "MOVE";
49255
+ Action2["OVERWRITE"] = "OVERWRITE";
49256
+ Action2["COPY"] = "COPY";
49257
+ })(Action = exports2.Action || (exports2.Action = {}));
49258
+ var WebhookIdentityType;
49259
+ (function(WebhookIdentityType2) {
49260
+ WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
49261
+ WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
49262
+ WebhookIdentityType2["MEMBER"] = "MEMBER";
49263
+ WebhookIdentityType2["WIX_USER"] = "WIX_USER";
49264
+ WebhookIdentityType2["APP"] = "APP";
49265
+ })(WebhookIdentityType = exports2.WebhookIdentityType || (exports2.WebhookIdentityType = {}));
49266
+ }
49267
+ });
49268
+
49226
49269
  // ../../node_modules/@wix/velo-site-types-syncer/build/index.js
49227
49270
  init_esm_shims();
49228
49271
  import { mkdir as mkdir5 } from "node:fs/promises";
@@ -49385,11 +49428,18 @@ async function pRetry(input, options) {
49385
49428
 
49386
49429
  // ../../node_modules/@wix/velo-site-types-syncer/build/index.js
49387
49430
  var import_comment_json2 = __toESM(require_src3(), 1);
49431
+ var import_http_client = __toESM(require_index_node(), 1);
49388
49432
  import { join as join3 } from "node:path";
49389
49433
  import { mkdir as mkdir2 } from "node:fs/promises";
49390
49434
  import { join as join32, dirname as dirname2, relative as relative22 } from "node:path";
49391
- import { mkdir as mkdir3, writeFile as writeFile3, rm, readFile as readFile3 } from "node:fs/promises";
49392
- import path, { dirname as dirname3, join as join5, relative as relative4 } from "node:path";
49435
+ import { mkdir as mkdir3, writeFile as writeFile3, rm as rm2, readFile as readFile3 } from "node:fs/promises";
49436
+ import path, { dirname as dirname3, join as join6, relative as relative4 } from "node:path";
49437
+ var import_verror2 = __toESM(require_verror(), 1);
49438
+ var import_types = __toESM(require_types_impl(), 1);
49439
+ var import_types_impl = __toESM(require_types_impl2(), 1);
49440
+ import { join as join5 } from "node:path";
49441
+ import { readdir, rm, unlink } from "node:fs/promises";
49442
+ import { existsSync } from "node:fs";
49393
49443
  import process2 from "node:process";
49394
49444
 
49395
49445
  // ../../node_modules/@wix/ambassador-typok-v1-site/build/es/http.impl.js
@@ -49553,49 +49603,10 @@ function getLatestPageTypes(payload) {
49553
49603
  getLatestPageTypes.__isAmbassador = true;
49554
49604
 
49555
49605
  // ../../node_modules/@wix/velo-site-types-syncer/build/index.js
49556
- var import_verror2 = __toESM(require_verror(), 1);
49557
- var import_http_client = __toESM(require_index_node(), 1);
49558
49606
  var import_verror3 = __toESM(require_verror(), 1);
49559
- var import_types = __toESM(require_types_impl(), 1);
49560
- import { join as join6 } from "node:path";
49561
- import { readdir, rm as rm2, unlink } from "node:fs/promises";
49562
- import { existsSync } from "node:fs";
49563
49607
  import { join as join7 } from "node:path";
49564
49608
  import { mkdir as mkdir4 } from "node:fs/promises";
49565
49609
 
49566
- // ../../node_modules/@wix/ambassador-velo-ide-v1-gridapp-filestructure/build/es/types.impl.js
49567
- init_esm_shims();
49568
- var FileType;
49569
- (function(FileType2) {
49570
- FileType2["FILE"] = "FILE";
49571
- FileType2["DIRECTORY"] = "DIRECTORY";
49572
- })(FileType || (FileType = {}));
49573
- var GridAppLayout;
49574
- (function(GridAppLayout3) {
49575
- GridAppLayout3["UNKNOWN_GRID_APP_LAYOUT"] = "UNKNOWN_GRID_APP_LAYOUT";
49576
- GridAppLayout3["ONLINE"] = "ONLINE";
49577
- GridAppLayout3["GITHUB"] = "GITHUB";
49578
- GridAppLayout3["GITHUB_BLOCKS"] = "GITHUB_BLOCKS";
49579
- GridAppLayout3["WIX_IDE"] = "WIX_IDE";
49580
- })(GridAppLayout || (GridAppLayout = {}));
49581
- var Action;
49582
- (function(Action2) {
49583
- Action2["UNKNOWN"] = "UNKNOWN";
49584
- Action2["UPDATE"] = "UPDATE";
49585
- Action2["CREATE"] = "CREATE";
49586
- Action2["MOVE"] = "MOVE";
49587
- Action2["OVERWRITE"] = "OVERWRITE";
49588
- Action2["COPY"] = "COPY";
49589
- })(Action || (Action = {}));
49590
- var WebhookIdentityType;
49591
- (function(WebhookIdentityType2) {
49592
- WebhookIdentityType2["UNKNOWN"] = "UNKNOWN";
49593
- WebhookIdentityType2["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
49594
- WebhookIdentityType2["MEMBER"] = "MEMBER";
49595
- WebhookIdentityType2["WIX_USER"] = "WIX_USER";
49596
- WebhookIdentityType2["APP"] = "APP";
49597
- })(WebhookIdentityType || (WebhookIdentityType = {}));
49598
-
49599
49610
  // ../../node_modules/@wix/ambassador-velo-ide-v1-path-transform/build/es/http.impl.js
49600
49611
  init_esm_shims();
49601
49612
  var _transformPathRequest = {};
@@ -50019,6 +50030,70 @@ async function updateRootConfigPageReferences(projectFolder, createdPageIds, rem
50019
50030
  );
50020
50031
  await writeRootConfig(projectFolder, rootConfig);
50021
50032
  }
50033
+ async function httpRequest(opts, requestOptions) {
50034
+ try {
50035
+ return await new import_http_client.HttpClient(opts).request(requestOptions);
50036
+ } catch (e) {
50037
+ if (e instanceof import_http_client.HttpError) {
50038
+ if (e.response?.status === 403) {
50039
+ throw new import_verror2.default(
50040
+ {
50041
+ name: "PermissionDenied",
50042
+ cause: e
50043
+ },
50044
+ "Forbidden operation. Missing permissions"
50045
+ );
50046
+ }
50047
+ throw e;
50048
+ } else {
50049
+ throw e;
50050
+ }
50051
+ }
50052
+ }
50053
+ var cleanupTypes = async (projectFolder) => {
50054
+ const typesDir = getTypesDir2(projectFolder);
50055
+ if (!existsSync(typesDir)) {
50056
+ return Promise.resolve();
50057
+ }
50058
+ const filesOrDirs = await readdir(typesDir, { withFileTypes: true });
50059
+ const rootConfigPath = join5(projectFolder, "jsconfig.json");
50060
+ const files = filesOrDirs.filter((f) => f.isFile());
50061
+ const dirs = filesOrDirs.filter(
50062
+ (dir) => dir.isDirectory() && dir.name !== WIX_CODE_TYPES_DIR
50063
+ );
50064
+ return Promise.all([
50065
+ () => {
50066
+ if (existsSync(rootConfigPath)) {
50067
+ return unlink(rootConfigPath);
50068
+ }
50069
+ Promise.resolve();
50070
+ },
50071
+ ...files.map((file) => unlink(join5(typesDir, file.name))),
50072
+ ...dirs.map((dir) => rm(join5(typesDir, dir.name), { recursive: true }))
50073
+ ]);
50074
+ };
50075
+ var getPageCodeFilePathFromLayoutPath = (pFolder, page) => {
50076
+ return join5(pFolder, page.pageMetaData.layoutPath);
50077
+ };
50078
+ var isGridAppLayout = (layout) => {
50079
+ return typeof layout === "string" && isValidGridAppLayout(layout);
50080
+ };
50081
+ var isCustomLayout = (layout) => {
50082
+ return typeof layout === "function";
50083
+ };
50084
+ var isValidGridAppLayout = (layout) => {
50085
+ return Object.keys(import_types.GridAppLayout).includes(layout);
50086
+ };
50087
+ var widgetDtsContent = `declare global {
50088
+ namespace $widget {
50089
+ const props: any;
50090
+ function fireEvent(eventName: string, data: any): void;
50091
+ function onPropsChanged(handler: onPropsChangedHandler): any;
50092
+ type onPropsChangedHandler = (oldProps: any, newProps: any) => void;
50093
+ }
50094
+ }
50095
+
50096
+ export {};`;
50022
50097
  async function syncTypesForPages(projectFolder, pagesData, definitions, hasMasterPage = true) {
50023
50098
  await writeFile3(
50024
50099
  definitions.types.getBackendDTSPath(projectFolder),
@@ -50042,7 +50117,7 @@ async function syncTypesForPages(projectFolder, pagesData, definitions, hasMaste
50042
50117
  await Promise.all(
50043
50118
  Object.entries(pageDeclarationsFiles).map(
50044
50119
  async ([filename, content]) => {
50045
- await writeFile3(join5(pageConfigDir, filename), content);
50120
+ await writeFile3(join6(pageConfigDir, filename), content);
50046
50121
  }
50047
50122
  )
50048
50123
  );
@@ -50079,7 +50154,7 @@ function getConfigForPage(projectFolder, page, definitions) {
50079
50154
  jsx: "react",
50080
50155
  paths: {
50081
50156
  "public/*": [
50082
- join5(
50157
+ join6(
50083
50158
  relative4(
50084
50159
  dirname3(configFilePath),
50085
50160
  definitions.layout.getPublicFolder(projectFolder)
@@ -50088,7 +50163,7 @@ function getConfigForPage(projectFolder, page, definitions) {
50088
50163
  )
50089
50164
  ],
50090
50165
  "backend/*.web.js": [
50091
- join5(
50166
+ join6(
50092
50167
  relative4(
50093
50168
  dirname3(configFilePath),
50094
50169
  definitions.layout.getBackendFolder(projectFolder)
@@ -50097,7 +50172,7 @@ function getConfigForPage(projectFolder, page, definitions) {
50097
50172
  )
50098
50173
  ],
50099
50174
  "backend/*.web": [
50100
- join5(
50175
+ join6(
50101
50176
  relative4(
50102
50177
  dirname3(configFilePath),
50103
50178
  definitions.layout.getBackendFolder(projectFolder)
@@ -50119,14 +50194,14 @@ function getConfigForPage(projectFolder, page, definitions) {
50119
50194
  ...Object.entries(
50120
50195
  getPageDeclarationFiles(projectFolder, page, definitions)
50121
50196
  ).map(([filename]) => filename),
50122
- join5(
50197
+ join6(
50123
50198
  relative4(
50124
50199
  dirname3(configFilePath),
50125
50200
  definitions.layout.getPublicFolder(projectFolder)
50126
50201
  ),
50127
50202
  "**/*"
50128
50203
  ),
50129
- join5(
50204
+ join6(
50130
50205
  relative4(
50131
50206
  dirname3(configFilePath),
50132
50207
  definitions.layout.getBackendFolder(projectFolder)
@@ -50158,6 +50233,7 @@ function getPageDeclarationFiles(projectFolder, page, definitions, hasMasterPage
50158
50233
  "index.d.ts": `type PageElementsMap = MasterPageElementsMap;`
50159
50234
  };
50160
50235
  }
50236
+ let returnedDeclarationFiles;
50161
50237
  if (hasMasterPage) {
50162
50238
  const masterPageDTSDir = dirname3(
50163
50239
  definitions.types.getPageConfigFilename(projectFolder, MASTER_PAGE_NAME)
@@ -50168,81 +50244,31 @@ function getPageDeclarationFiles(projectFolder, page, definitions, hasMasterPage
50168
50244
  page.pageMetaData.pageId
50169
50245
  )
50170
50246
  );
50171
- const masterPageDTSRelativePath = join5(
50247
+ const masterPageDTSRelativePath = join6(
50172
50248
  relative4(pageDTSDir, masterPageDTSDir),
50173
50249
  definitions.types.getPageElementsMapDTSFilename(MASTER_PAGE_NAME)
50174
50250
  );
50175
- return {
50251
+ returnedDeclarationFiles = {
50176
50252
  [pageDTSFilename]: `/// <reference path="${masterPageDTSRelativePath}" />
50177
50253
  type PageElementsMap = MasterPageElementsMap & {${pageElementsMapContent}}`
50178
50254
  };
50179
50255
  } else {
50180
- return {
50256
+ returnedDeclarationFiles = {
50181
50257
  [pageDTSFilename]: `type PageElementsMap = {${pageElementsMapContent}}`
50182
50258
  };
50183
50259
  }
50260
+ if (definitions.layout.outputLayout === import_types_impl.GridAppLayout.GITHUB_BLOCKS) {
50261
+ returnedDeclarationFiles["widget.d.ts"] = widgetDtsContent;
50262
+ }
50263
+ return returnedDeclarationFiles;
50184
50264
  }
50185
50265
  async function deletePageTypes(projectFolder, pageId, definitions) {
50186
50266
  const pageConfigFile = definitions.types.getPageConfigFilename(
50187
50267
  projectFolder,
50188
50268
  pageId
50189
50269
  );
50190
- await rm(path.dirname(pageConfigFile), { recursive: true });
50191
- }
50192
- async function httpRequest(opts, requestOptions) {
50193
- try {
50194
- return await new import_http_client.HttpClient(opts).request(requestOptions);
50195
- } catch (e) {
50196
- if (e instanceof import_http_client.HttpError) {
50197
- if (e.response?.status === 403) {
50198
- throw new import_verror3.default(
50199
- {
50200
- name: "PermissionDenied",
50201
- cause: e
50202
- },
50203
- "Forbidden operation. Missing permissions"
50204
- );
50205
- }
50206
- throw e;
50207
- } else {
50208
- throw e;
50209
- }
50210
- }
50270
+ await rm2(path.dirname(pageConfigFile), { recursive: true });
50211
50271
  }
50212
- var cleanupTypes = async (projectFolder) => {
50213
- const typesDir = getTypesDir2(projectFolder);
50214
- if (!existsSync(typesDir)) {
50215
- return Promise.resolve();
50216
- }
50217
- const filesOrDirs = await readdir(typesDir, { withFileTypes: true });
50218
- const rootConfigPath = join6(projectFolder, "jsconfig.json");
50219
- const files = filesOrDirs.filter((f) => f.isFile());
50220
- const dirs = filesOrDirs.filter(
50221
- (dir) => dir.isDirectory() && dir.name !== WIX_CODE_TYPES_DIR
50222
- );
50223
- return Promise.all([
50224
- () => {
50225
- if (existsSync(rootConfigPath)) {
50226
- return unlink(rootConfigPath);
50227
- }
50228
- Promise.resolve();
50229
- },
50230
- ...files.map((file) => unlink(join6(typesDir, file.name))),
50231
- ...dirs.map((dir) => rm2(join6(typesDir, dir.name), { recursive: true }))
50232
- ]);
50233
- };
50234
- var getPageCodeFilePathFromLayoutPath = (pFolder, page) => {
50235
- return join6(pFolder, page.pageMetaData.layoutPath);
50236
- };
50237
- var isGridAppLayout = (layout) => {
50238
- return typeof layout === "string" && isValidGridAppLayout(layout);
50239
- };
50240
- var isCustomLayout = (layout) => {
50241
- return typeof layout === "function";
50242
- };
50243
- var isValidGridAppLayout = (layout) => {
50244
- return Object.keys(import_types.GridAppLayout).includes(layout);
50245
- };
50246
50272
  var pageSchema = z.object({
50247
50273
  pageTitle: z.string().optional().default(""),
50248
50274
  pageMetaData: z.object({
@@ -50261,7 +50287,7 @@ var siteSchema = z.object({
50261
50287
  var getSiteTypesSchema = z.object({
50262
50288
  site: siteSchema
50263
50289
  });
50264
- var { WError } = import_verror2.default;
50290
+ var { WError } = import_verror3.default;
50265
50291
  async function fetchPagesData(metaSiteId, revision, requestOptions) {
50266
50292
  let response;
50267
50293
  try {
@@ -50498,7 +50524,8 @@ var createAgnosticTypeSyncer = async (projectFolder, layout = GridAppLayout.GITH
50498
50524
  layout: {
50499
50525
  getPageCodeFilePath: getPageCodeFilePathFromLayoutPath,
50500
50526
  getBackendFolder: (projectFolder_ = "") => join7(projectFolder_, backendFolder),
50501
- getPublicFolder: (projectFolder_ = "") => join7(projectFolder_, publicFolder)
50527
+ getPublicFolder: (projectFolder_ = "") => join7(projectFolder_, publicFolder),
50528
+ outputLayout: layout
50502
50529
  },
50503
50530
  types: {
50504
50531
  getBackendConfigPath,
@@ -50795,7 +50822,6 @@ async function syncTypes(projectFolder, pagesData, definitions = defaultDefiniti
50795
50822
  }
50796
50823
 
50797
50824
  export {
50798
- GridAppLayout,
50799
50825
  require_negotiator,
50800
50826
  agnosticTypeSyncer_default,
50801
50827
  syncRevisionTypes,
@@ -50883,4 +50909,4 @@ make-fetch-happen/lib/fetch.js:
50883
50909
  * governing permissions and limitations under the License.
50884
50910
  *)
50885
50911
  */
50886
- //# sourceMappingURL=chunk-4OBSJ6OG.js.map
50912
+ //# sourceMappingURL=chunk-L53ZVQB7.js.map