@wix/cli 1.1.60 → 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 (120) hide show
  1. package/build/{DevCommand-AEGLMQVP.js → DevCommand-3CEY3HPC.js} +16 -15
  2. package/build/{DevCommand-AEGLMQVP.js.map → DevCommand-3CEY3HPC.js.map} +1 -1
  3. package/build/{DevCommand-GO3Z73V7.js → DevCommand-NPVKUDPR.js} +26 -875
  4. package/build/DevCommand-NPVKUDPR.js.map +1 -0
  5. package/build/{LoginCommand-SGLKXJF6.js → LoginCommand-RTNDZF77.js} +11 -11
  6. package/build/{LogoutCommand-YL6M6BT7.js → LogoutCommand-CUOS2BUH.js} +7 -7
  7. package/build/PreviewCommand-5GAG7MBS.js +471 -0
  8. package/build/PreviewCommand-5GAG7MBS.js.map +1 -0
  9. package/build/{WhoamiCommand-4EJZYY4W.js → WhoamiCommand-VZ6KKOVQ.js} +4 -4
  10. package/build/{chunk-PGR3OZNK.js → chunk-2KK3GKES.js} +6 -6
  11. package/build/{chunk-RNMVLLSA.js → chunk-2WA6TGDO.js} +6 -6
  12. package/build/{chunk-XWFG3TRU.js → chunk-332V5RP4.js} +47 -7
  13. package/build/{chunk-XWFG3TRU.js.map → chunk-332V5RP4.js.map} +1 -1
  14. package/build/{chunk-SELJR2HV.js → chunk-3NEXZN7N.js} +5 -66
  15. package/build/chunk-3NEXZN7N.js.map +1 -0
  16. package/build/{chunk-EDNJGHVN.js → chunk-3UE73ERL.js} +22 -7
  17. package/build/chunk-3UE73ERL.js.map +1 -0
  18. package/build/{chunk-YQ2ZYOKK.js → chunk-6K6VPM3T.js} +6 -6
  19. package/build/chunk-6LI4WGAW.js +43 -0
  20. package/build/chunk-6LI4WGAW.js.map +1 -0
  21. package/build/chunk-6XRFJZTQ.js +74 -0
  22. package/build/chunk-6XRFJZTQ.js.map +1 -0
  23. package/build/{chunk-B23S4M74.js → chunk-6YVNZGPU.js} +4 -4
  24. package/build/{chunk-B23S4M74.js.map → chunk-6YVNZGPU.js.map} +1 -1
  25. package/build/{chunk-24KEFD7K.js → chunk-77YDQA7O.js} +6 -6
  26. package/build/chunk-B5A3CFP2.js +135 -0
  27. package/build/chunk-B5A3CFP2.js.map +1 -0
  28. package/build/{chunk-QZJC3FP3.js → chunk-DEO7G3RD.js} +5 -5
  29. package/build/{chunk-LPA74SM5.js → chunk-DP2BL2V4.js} +7 -7
  30. package/build/{chunk-J2FXQRPG.js → chunk-G4NFI3XC.js} +4 -4
  31. package/build/{chunk-GG7YZNYL.js → chunk-H6BDO22X.js} +10 -4
  32. package/build/{chunk-GG7YZNYL.js.map → chunk-H6BDO22X.js.map} +1 -1
  33. package/build/{chunk-GFSMOEGG.js → chunk-HMGX4HL2.js} +49 -18
  34. package/build/chunk-HMGX4HL2.js.map +1 -0
  35. package/build/{chunk-CRXPC3TE.js → chunk-HV2IEAOB.js} +2 -2
  36. package/build/{chunk-WVS26NCB.js → chunk-J573TQNU.js} +470 -470
  37. package/build/chunk-J573TQNU.js.map +1 -0
  38. package/build/{chunk-GIS574I5.js → chunk-KOGQSQ4I.js} +2 -2
  39. package/build/{chunk-OISYBAR4.js → chunk-L53ZVQB7.js} +139 -113
  40. package/build/{chunk-OISYBAR4.js.map → chunk-L53ZVQB7.js.map} +1 -1
  41. package/build/{chunk-2DE7QM5C.js → chunk-M34KVUTA.js} +2 -2
  42. package/build/{chunk-XANTHYQG.js → chunk-N3OHN3MH.js} +4 -4
  43. package/build/{chunk-XANTHYQG.js.map → chunk-N3OHN3MH.js.map} +1 -1
  44. package/build/{chunk-DWEFYET4.js → chunk-P4UAXEEN.js} +14 -132
  45. package/build/chunk-P4UAXEEN.js.map +1 -0
  46. package/build/{chunk-LCYX5MZA.js → chunk-PTIE2TCP.js} +3 -3
  47. package/build/{chunk-BNWDAMAL.js → chunk-PX2L3CCA.js} +2 -2
  48. package/build/chunk-PX2L3CCA.js.map +1 -0
  49. package/build/chunk-Q3GS63B5.js +901 -0
  50. package/build/chunk-Q3GS63B5.js.map +1 -0
  51. package/build/{chunk-5XUFGBCU.js → chunk-SEOIN2A6.js} +7 -3
  52. package/build/chunk-SEOIN2A6.js.map +1 -0
  53. package/build/{chunk-P5FUKDOS.js → chunk-V7JWKPQI.js} +6 -6
  54. package/build/{chunk-VRDC2KLN.js → chunk-VXGNI7CP.js} +5 -2
  55. package/build/{chunk-VRDC2KLN.js.map → chunk-VXGNI7CP.js.map} +1 -1
  56. package/build/{chunk-VNZYI6OK.js → chunk-XFEYPXEY.js} +3 -3
  57. package/build/{chunk-G6TDIUNY.js → chunk-Y4ZVXLXY.js} +2 -2
  58. package/build/{chunk-BVAC4BZH.js → chunk-ZVHSVTAJ.js} +5 -5
  59. package/build/{dev-72CJF6Z6.js → dev-FOGJASYZ.js} +29 -28
  60. package/build/{dev-72CJF6Z6.js.map → dev-FOGJASYZ.js.map} +1 -1
  61. package/build/index.js +27 -27
  62. package/build/{install-7NZK44CY.js → install-NSVJU2EB.js} +20 -19
  63. package/build/{install-7NZK44CY.js.map → install-NSVJU2EB.js.map} +1 -1
  64. package/build/{preview-NIPXK2PL.js → preview-RQ5CLHV5.js} +22 -20
  65. package/build/{preview-NIPXK2PL.js.map → preview-RQ5CLHV5.js.map} +1 -1
  66. package/build/{publish-Z3WVKI47.js → publish-YWESFDVY.js} +28 -25
  67. package/build/publish-YWESFDVY.js.map +1 -0
  68. package/build/{render-command-I6OSOLTK.js → render-command-4GOKWOT7.js} +10 -10
  69. package/build/{render-command-OTTR4HS4.js → render-command-E3JPPTZA.js} +11 -11
  70. package/build/{render-command-GJLP3KAJ.js → render-command-WMEIFR3G.js} +12 -12
  71. package/build/{run-command-BR7STFFP.js → run-command-D54S2NI5.js} +9 -9
  72. package/build/{src-IRKCACSZ.js → src-4W7XB5DS.js} +20 -8
  73. package/build/src-4W7XB5DS.js.map +1 -0
  74. package/build/{src-7HIQOGPY.js → src-HA6XHM2E.js} +7 -7
  75. package/build/{src-U45WATPX.js → src-IIEVMGC3.js} +17 -17
  76. package/build/{src-U7SGKJCW.js → src-NGHHXRWJ.js} +2 -2
  77. package/build/{src-QJJ7EIYT.js → src-NS46VL23.js} +6 -6
  78. package/build/{src-QCND6FA3.js → src-OIVJ4AKD.js} +6 -6
  79. package/build/{sync-types-JLBBFIOB.js → sync-types-SQEHJPEG.js} +14 -13
  80. package/build/{uninstall-KQDD5ADQ.js → uninstall-ASZ55QZA.js} +19 -18
  81. package/build/{uninstall-KQDD5ADQ.js.map → uninstall-ASZ55QZA.js.map} +1 -1
  82. package/package.json +2 -2
  83. package/build/DevCommand-GO3Z73V7.js.map +0 -1
  84. package/build/chunk-5XUFGBCU.js.map +0 -1
  85. package/build/chunk-BNWDAMAL.js.map +0 -1
  86. package/build/chunk-DWEFYET4.js.map +0 -1
  87. package/build/chunk-EDNJGHVN.js.map +0 -1
  88. package/build/chunk-GFSMOEGG.js.map +0 -1
  89. package/build/chunk-SELJR2HV.js.map +0 -1
  90. package/build/chunk-WVS26NCB.js.map +0 -1
  91. package/build/publish-Z3WVKI47.js.map +0 -1
  92. package/build/src-IRKCACSZ.js.map +0 -1
  93. /package/build/{LoginCommand-SGLKXJF6.js.map → LoginCommand-RTNDZF77.js.map} +0 -0
  94. /package/build/{LogoutCommand-YL6M6BT7.js.map → LogoutCommand-CUOS2BUH.js.map} +0 -0
  95. /package/build/{WhoamiCommand-4EJZYY4W.js.map → WhoamiCommand-VZ6KKOVQ.js.map} +0 -0
  96. /package/build/{chunk-PGR3OZNK.js.map → chunk-2KK3GKES.js.map} +0 -0
  97. /package/build/{chunk-RNMVLLSA.js.map → chunk-2WA6TGDO.js.map} +0 -0
  98. /package/build/{chunk-YQ2ZYOKK.js.map → chunk-6K6VPM3T.js.map} +0 -0
  99. /package/build/{chunk-24KEFD7K.js.map → chunk-77YDQA7O.js.map} +0 -0
  100. /package/build/{chunk-QZJC3FP3.js.map → chunk-DEO7G3RD.js.map} +0 -0
  101. /package/build/{chunk-LPA74SM5.js.map → chunk-DP2BL2V4.js.map} +0 -0
  102. /package/build/{chunk-J2FXQRPG.js.map → chunk-G4NFI3XC.js.map} +0 -0
  103. /package/build/{chunk-CRXPC3TE.js.map → chunk-HV2IEAOB.js.map} +0 -0
  104. /package/build/{chunk-GIS574I5.js.map → chunk-KOGQSQ4I.js.map} +0 -0
  105. /package/build/{chunk-2DE7QM5C.js.map → chunk-M34KVUTA.js.map} +0 -0
  106. /package/build/{chunk-LCYX5MZA.js.map → chunk-PTIE2TCP.js.map} +0 -0
  107. /package/build/{chunk-P5FUKDOS.js.map → chunk-V7JWKPQI.js.map} +0 -0
  108. /package/build/{chunk-VNZYI6OK.js.map → chunk-XFEYPXEY.js.map} +0 -0
  109. /package/build/{chunk-G6TDIUNY.js.map → chunk-Y4ZVXLXY.js.map} +0 -0
  110. /package/build/{chunk-BVAC4BZH.js.map → chunk-ZVHSVTAJ.js.map} +0 -0
  111. /package/build/{render-command-I6OSOLTK.js.map → render-command-4GOKWOT7.js.map} +0 -0
  112. /package/build/{render-command-OTTR4HS4.js.map → render-command-E3JPPTZA.js.map} +0 -0
  113. /package/build/{render-command-GJLP3KAJ.js.map → render-command-WMEIFR3G.js.map} +0 -0
  114. /package/build/{run-command-BR7STFFP.js.map → run-command-D54S2NI5.js.map} +0 -0
  115. /package/build/{src-7HIQOGPY.js.map → src-HA6XHM2E.js.map} +0 -0
  116. /package/build/{src-U45WATPX.js.map → src-IIEVMGC3.js.map} +0 -0
  117. /package/build/{src-QCND6FA3.js.map → src-NGHHXRWJ.js.map} +0 -0
  118. /package/build/{src-QJJ7EIYT.js.map → src-NS46VL23.js.map} +0 -0
  119. /package/build/{src-U7SGKJCW.js.map → src-OIVJ4AKD.js.map} +0 -0
  120. /package/build/{sync-types-JLBBFIOB.js.map → sync-types-SQEHJPEG.js.map} +0 -0
@@ -4,28 +4,32 @@ import {
4
4
  createVeloCLIServer,
5
5
  debounceQueue,
6
6
  require_chokidar
7
- } from "./chunk-B23S4M74.js";
7
+ } from "./chunk-6YVNZGPU.js";
8
8
  import "./chunk-EDFOB3LN.js";
9
+ import {
10
+ agnosticTypeSyncer_default
11
+ } from "./chunk-L53ZVQB7.js";
12
+ import "./chunk-OJHDGJWP.js";
13
+ import {
14
+ createSiteFsManager
15
+ } from "./chunk-Q3GS63B5.js";
9
16
  import {
10
17
  useVeloClient
11
- } from "./chunk-GFSMOEGG.js";
12
- import "./chunk-2DE7QM5C.js";
13
- import "./chunk-GIS574I5.js";
18
+ } from "./chunk-HMGX4HL2.js";
19
+ import "./chunk-M34KVUTA.js";
20
+ import "./chunk-6LI4WGAW.js";
21
+ import "./chunk-KOGQSQ4I.js";
14
22
  import {
15
23
  useProjectModel
16
- } from "./chunk-RNMVLLSA.js";
17
- import {
18
- agnosticTypeSyncer_default
19
- } from "./chunk-OISYBAR4.js";
20
- import "./chunk-OJHDGJWP.js";
24
+ } from "./chunk-2WA6TGDO.js";
21
25
  import "./chunk-YXFEXGAH.js";
22
26
  import {
23
27
  openBrowser,
24
28
  pLimit
25
- } from "./chunk-24KEFD7K.js";
29
+ } from "./chunk-77YDQA7O.js";
26
30
  import {
27
31
  useErrorReporter
28
- } from "./chunk-XWFG3TRU.js";
32
+ } from "./chunk-332V5RP4.js";
29
33
  import {
30
34
  Alert,
31
35
  Badge,
@@ -38,7 +42,7 @@ import {
38
42
  useAsyncCallback,
39
43
  useExit,
40
44
  use_input_default
41
- } from "./chunk-WVS26NCB.js";
45
+ } from "./chunk-J573TQNU.js";
42
46
  import "./chunk-WN3D6AOY.js";
43
47
  import "./chunk-W423UTD3.js";
44
48
  import "./chunk-2NWGTFAC.js";
@@ -46,16 +50,16 @@ import "./chunk-YU54OBFT.js";
46
50
  import "./chunk-XMTHMR2B.js";
47
51
  import {
48
52
  getSourceFolder
49
- } from "./chunk-5XUFGBCU.js";
50
- import "./chunk-EDNJGHVN.js";
53
+ } from "./chunk-SEOIN2A6.js";
54
+ import "./chunk-3UE73ERL.js";
51
55
  import {
52
56
  getTestOverrides
53
- } from "./chunk-BNWDAMAL.js";
57
+ } from "./chunk-PX2L3CCA.js";
54
58
  import {
55
59
  CliError,
56
60
  CliErrorCode,
57
61
  require_lib
58
- } from "./chunk-GG7YZNYL.js";
62
+ } from "./chunk-H6BDO22X.js";
59
63
  import {
60
64
  __commonJS,
61
65
  __require,
@@ -6060,859 +6064,6 @@ init_esm_shims();
6060
6064
  var import_react4 = __toESM(require_react(), 1);
6061
6065
  var import_variant = __toESM(require_lib(), 1);
6062
6066
 
6063
- // ../cli-site/src/site-fs-manager.ts
6064
- init_esm_shims();
6065
- import { relative } from "node:path";
6066
-
6067
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/index.js
6068
- init_esm_shims();
6069
-
6070
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/wixSiteFSManager.js
6071
- init_esm_shims();
6072
-
6073
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/code/index.js
6074
- init_esm_shims();
6075
-
6076
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/code/code.js
6077
- init_esm_shims();
6078
- import path from "path";
6079
-
6080
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/code/utils/veloUtils.js
6081
- init_esm_shims();
6082
-
6083
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/code/utils/constants.js
6084
- init_esm_shims();
6085
- var PAGE_CODE_TEMPLATE = `// API Reference: https://www.wix.com/velo/reference/api-overview/introduction
6086
- // \u201CHello, World!\u201D Example: https://learn-code.wix.com/en/article/hello-world
6087
-
6088
- $w.onReady(function () {
6089
- // Write your JavaScript here
6090
-
6091
- // To select an element by ID use: $w('#elementID')
6092
-
6093
- // Click 'Preview' to run your code
6094
- });
6095
- `;
6096
-
6097
- // ../../node_modules/@wix/anyide-cli-file-structure/node_modules/@wix/velo-github-layout-definitions/build/index.js
6098
- init_esm_shims();
6099
- import { join } from "node:path";
6100
- function getSourceFolder2(projectFolder) {
6101
- return join(projectFolder, "src");
6102
- }
6103
- function getPagesFolder(projectFolder = "") {
6104
- return join(getSourceFolder2(projectFolder), "pages");
6105
- }
6106
- function getPublicFolder(projectFolder = "") {
6107
- return join(getSourceFolder2(projectFolder), "public");
6108
- }
6109
- function getBackendFolder(projectFolder = "") {
6110
- return join(getSourceFolder2(projectFolder), "backend");
6111
- }
6112
-
6113
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/types.js
6114
- init_esm_shims();
6115
- var foldersType = {
6116
- backend: "backend",
6117
- public: "public"
6118
- };
6119
-
6120
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/code/utils/veloUtils.js
6121
- var createDefaultPageCodeFile = async (siteFileSystem, filePath) => siteFileSystem.writeFile(filePath, PAGE_CODE_TEMPLATE);
6122
- var getPageCodeFilePath = (pageId) => `${getPagesFolder()}/${pageId}.js`;
6123
- var convertToGithubLayout = (state, path6, folderType) => {
6124
- switch (folderType) {
6125
- case foldersType.backend:
6126
- return transformPath(path6, state.fileStructure.getBackendFolderPath(), getBackendFolder());
6127
- case foldersType.public:
6128
- return transformPath(path6, state.fileStructure.getPublicFolderPath(), getPublicFolder());
6129
- }
6130
- };
6131
- var transformPath = (path6, basePath, folderPrefix) => {
6132
- const relativePath = path6.replace(`${basePath}/`, "");
6133
- return `${folderPrefix}/${relativePath}`;
6134
- };
6135
-
6136
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/code/code.js
6137
- var readAllFilesInDir = async (state, dir, folderType) => {
6138
- const entries = await state.fileSystem.readFolder(dir);
6139
- const filePromises = entries.map(async (entry) => {
6140
- const entryPath = path.join(dir, entry.name);
6141
- if (entry.isFile()) {
6142
- return {
6143
- path: convertToGithubLayout(state, entryPath, folderType),
6144
- content: await state.fileSystem.readFile(entryPath)
6145
- };
6146
- }
6147
- return readAllFilesInDir(state, entryPath, folderType);
6148
- });
6149
- return (await Promise.all(filePromises)).flat();
6150
- };
6151
- var readBackendFiles = async (state) => readAllFilesInDir(state, state.fileStructure.getBackendFolderPath(), foldersType.backend);
6152
- var readPublicFiles = async (state) => readAllFilesInDir(state, state.fileStructure.getPublicFolderPath(), foldersType.public);
6153
- var readPageCodeFiles = async (state) => {
6154
- const codeFiles = [];
6155
- const pages = state.pages.getAll();
6156
- for (const { pageId, pagePath } of pages) {
6157
- const page = state.fileStructure.getPageFilesPaths(pagePath);
6158
- const content = await state.fileSystem.readFile(page.code);
6159
- codeFiles.push({ path: getPageCodeFilePath(pageId), content });
6160
- }
6161
- return codeFiles;
6162
- };
6163
- var getSiteCode = async (state) => {
6164
- const allFiles = await Promise.all([
6165
- readBackendFiles(state),
6166
- readPublicFiles(state),
6167
- readPageCodeFiles(state)
6168
- ]);
6169
- return {
6170
- files: allFiles.flat(),
6171
- layout: "GITHUB",
6172
- ignoreForbiddenPaths: true
6173
- };
6174
- };
6175
- var onlinePathRegex = /^(public\/pages|public|backend)\/?((.+)\.js|.*)$/;
6176
- var splitOnlinePath = (onlinePath) => {
6177
- const [, folderPath, relativeFilePath, pageId] = onlinePathRegex.exec(onlinePath) ?? [];
6178
- return {
6179
- folderPath,
6180
- relativeFilePath,
6181
- pageId
6182
- };
6183
- };
6184
- var buildCodeFilePath = (folderPath, relativeFilePath) => {
6185
- if (!relativeFilePath) {
6186
- return folderPath;
6187
- }
6188
- return path.join(folderPath, relativeFilePath);
6189
- };
6190
- var buildPageCodeFilePath = ({ pages, fileStructure }, pageId) => {
6191
- if (!pageId) {
6192
- throw new Error("Invalid page code file path");
6193
- }
6194
- const pageFolderPath = pages.getFolderPath(pageId);
6195
- if (!pageFolderPath) {
6196
- throw new Error("Page does not exist");
6197
- }
6198
- return fileStructure.getPageFilesPaths(pageFolderPath).code;
6199
- };
6200
- var convertOnlineLayoutToRelativePath = (state, onlinePath) => {
6201
- const { fileStructure } = state;
6202
- const { folderPath, relativeFilePath, pageId } = splitOnlinePath(onlinePath);
6203
- switch (folderPath) {
6204
- case "public":
6205
- return buildCodeFilePath(fileStructure.getPublicFolderPath(), relativeFilePath);
6206
- case "backend":
6207
- return buildCodeFilePath(fileStructure.getBackendFolderPath(), relativeFilePath);
6208
- case "public/pages":
6209
- return buildPageCodeFilePath(state, pageId);
6210
- default:
6211
- throw new Error("Unknown online path");
6212
- }
6213
- };
6214
- var convertOnlineLayout = (state, basePath, onlinePath) => path.join(basePath, convertOnlineLayoutToRelativePath(state, onlinePath));
6215
-
6216
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/document/index.js
6217
- init_esm_shims();
6218
-
6219
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/document/document.js
6220
- init_esm_shims();
6221
-
6222
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/document/utils/wmlUtils.js
6223
- init_esm_shims();
6224
- var pageIdRegex = /<(?:Master)?Page\s[^>]*?(?<=\s)id="(.+?)".*?>/;
6225
- var getPageId = async (siteFileSystem, { structure }) => {
6226
- const structureXmlContent = await siteFileSystem.readFile(structure);
6227
- const [match2, pageId] = structureXmlContent.match(pageIdRegex) ?? [];
6228
- if (!match2) {
6229
- throw new Error("pageId not found in wml");
6230
- }
6231
- return pageId;
6232
- };
6233
- var mapWmlFiles = async (documentStructure, callbackFn) => {
6234
- const [structure, data, style] = await Promise.all([
6235
- callbackFn(documentStructure.structure, "structure"),
6236
- callbackFn(documentStructure.data, "data"),
6237
- callbackFn(documentStructure.style, "style")
6238
- ]);
6239
- return { structure, data, style };
6240
- };
6241
- var writeWmlFiles = async (siteFileSystem, documentStructure, wml) => {
6242
- const filesContent = convertWmlExportToFiles(wml);
6243
- await mapWmlFiles(documentStructure, (filePath, fileName) => siteFileSystem.writeFile(filePath, filesContent[fileName]));
6244
- };
6245
- var removeWmlFiles = async (siteFileSystem, documentStructure) => {
6246
- await mapWmlFiles(documentStructure, (filePath) => siteFileSystem.removeFile(filePath));
6247
- };
6248
- var writeWml = async (siteFileSystem, documentStructure, pageData) => {
6249
- if (pageData === null) {
6250
- return removeWmlFiles(siteFileSystem, documentStructure);
6251
- }
6252
- return writeWmlFiles(siteFileSystem, documentStructure, pageData.data);
6253
- };
6254
- var readWml = async (siteFileSystem, documentStructure) => {
6255
- const filesContent = await mapWmlFiles(documentStructure, async (filePath) => await siteFileSystem.readFile(filePath));
6256
- return convertFilesToWmlExport(filesContent);
6257
- };
6258
- var indentedStringify = (data) => JSON.stringify(data, void 0, 2);
6259
- var convertWmlExportToFiles = (wmlExport) => {
6260
- const dataWithoutVersion = JSON.parse(wmlExport.data.content);
6261
- const dataWithVersion = indentedStringify({ ...dataWithoutVersion, version: wmlExport.version });
6262
- return {
6263
- structure: wmlExport.structure.content,
6264
- style: wmlExport.style.content,
6265
- data: dataWithVersion
6266
- };
6267
- };
6268
- var convertFilesToWmlExport = (filesContent) => {
6269
- const { version, ...dataWithoutVersion } = JSON.parse(filesContent.data);
6270
- return {
6271
- structure: { type: "xml", content: filesContent.structure },
6272
- data: { type: "json", content: indentedStringify(dataWithoutVersion) },
6273
- style: { type: "css", content: filesContent.style },
6274
- version
6275
- };
6276
- };
6277
-
6278
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/document/document.js
6279
- var getDocumentPages = async (state) => {
6280
- const documentPages = {};
6281
- const pages = state.pages.getAll();
6282
- for (const { pageId, pagePath } of pages) {
6283
- const page = state.fileStructure.getPageFilesPaths(pagePath);
6284
- const data = await readWml(state.fileSystem, page.document);
6285
- documentPages[pageId] = { data };
6286
- }
6287
- return documentPages;
6288
- };
6289
- var getSiteDocument = async (state) => {
6290
- const documentPages = await getDocumentPages(state);
6291
- const { masterPage, ...otherPages } = documentPages;
6292
- if (!masterPage) {
6293
- throw new Error("Missing master page");
6294
- }
6295
- return {
6296
- pages: {
6297
- masterPage,
6298
- ...otherPages
6299
- }
6300
- };
6301
- };
6302
-
6303
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/document/externalUpdates.js
6304
- init_esm_shims();
6305
-
6306
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/page/utils.js
6307
- init_esm_shims();
6308
- import path2 from "path";
6309
- var generatePageFolderPathByInfo = (state, pageInfo) => {
6310
- const pagePath = state.fileStructure.getPagesPathsForType(pageInfo.type);
6311
- return path2.join(...pagePath.map((entry) => entry.type === "Folder" ? entry.name : pageInfo[entry.variableName]));
6312
- };
6313
- var escapeRegexSpecialChars = (str) => str.replace(/[.*+?^=!:${}()|[\]/\\]/g, "\\$&");
6314
- var isPathFormatMatching = (fullPath, basePath) => new RegExp(`^${escapeRegexSpecialChars(basePath)}(?: \\((\\d*)\\))?$`).test(fullPath);
6315
- var generateNewPagePath = (state, pageInfo, existingPageFolderPath) => {
6316
- let pageFolderPath = generatePageFolderPathByInfo(state, pageInfo);
6317
- if (existingPageFolderPath && isPathFormatMatching(existingPageFolderPath, pageFolderPath)) {
6318
- return existingPageFolderPath;
6319
- }
6320
- while (state.pages.getPageId(pageFolderPath)) {
6321
- pageFolderPath = incrementPathSuffix(pageFolderPath);
6322
- }
6323
- return pageFolderPath;
6324
- };
6325
- var createPageFiles = async (state, folderPath, pageData) => {
6326
- const pageStructure = state.fileStructure.getPageFilesPaths(folderPath);
6327
- await Promise.all([
6328
- writeWml(state.fileSystem, pageStructure.document, pageData),
6329
- createDefaultPageCodeFile(state.fileSystem, pageStructure.code)
6330
- ]);
6331
- };
6332
- var createPage = async (state, pageId, pageData) => {
6333
- const newPageFolder = generateNewPagePath(state, pageData.info);
6334
- await state.fileSystem.createFolder(newPageFolder);
6335
- await createPageFiles(state, newPageFolder, pageData);
6336
- state.pages.addPage(pageId, newPageFolder);
6337
- };
6338
- var removePage = async (state, pageId) => {
6339
- const folderPath = state.pages.getFolderPath(pageId);
6340
- if (!folderPath)
6341
- return;
6342
- await state.fileSystem.removeFolder(folderPath);
6343
- state.pages.removePageById(pageId);
6344
- };
6345
- var updatePage = async (state, pageId, existingPageFolderPath, pageData) => {
6346
- const expectedFolderPath = generateNewPagePath(state, pageData.info, existingPageFolderPath);
6347
- if (existingPageFolderPath !== expectedFolderPath) {
6348
- await removePage(state, pageId);
6349
- await createPage(state, pageId, pageData);
6350
- return;
6351
- }
6352
- const pageStructure = state.fileStructure.getPageFilesPaths(existingPageFolderPath);
6353
- await writeWml(state.fileSystem, pageStructure.document, pageData);
6354
- };
6355
- var incrementPathSuffix = (path6) => {
6356
- const [, origPath, suffix = 1] = path6.match(/^(.*?)(?: \((\d+)\))?$/) ?? [];
6357
- return `${origPath} (${Number(suffix) + 1})`;
6358
- };
6359
-
6360
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/document/externalUpdates.js
6361
- var applyPageUpdate = async (state, pageId, pageData) => {
6362
- if (pageData === null) {
6363
- return removePage(state, pageId);
6364
- }
6365
- const existingPageFolder = state.pages.getFolderPath(pageId);
6366
- if (existingPageFolder) {
6367
- return updatePage(state, pageId, existingPageFolder, pageData);
6368
- }
6369
- return createPage(state, pageId, pageData);
6370
- };
6371
- var applyDocumentExternalUpdates = async (state, { pages }) => {
6372
- for (const [pageId, pageData] of Object.entries(pages)) {
6373
- await applyPageUpdate(state, pageId, pageData);
6374
- }
6375
- };
6376
-
6377
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/state.js
6378
- init_esm_shims();
6379
-
6380
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/siteFileStructure.js
6381
- init_esm_shims();
6382
-
6383
- // ../../node_modules/@wix/anyide-template-layout/dist/index.js
6384
- init_esm_shims();
6385
-
6386
- // ../../node_modules/@wix/anyide-template-layout/dist/code.js
6387
- init_esm_shims();
6388
-
6389
- // ../../node_modules/@wix/anyide-template-layout/dist/configs/index.js
6390
- init_esm_shims();
6391
-
6392
- // ../../node_modules/@wix/anyide-template-layout/dist/configs/blocksConfig.js
6393
- init_esm_shims();
6394
- var blocksConfig = {
6395
- backend: "backend",
6396
- public: "public",
6397
- pages: {
6398
- structure: {
6399
- code: "index.js",
6400
- document: {
6401
- structure: "structure.xml",
6402
- data: "data.json",
6403
- style: "style.wcss"
6404
- }
6405
- },
6406
- folders: {
6407
- Widget: [
6408
- { name: "widgets", type: "Folder" },
6409
- { variableName: "widgetName", type: "DynamicFolder" }
6410
- ],
6411
- Panel: [
6412
- { name: "widgets", type: "Folder" },
6413
- { variableName: "widgetName", type: "DynamicFolder" },
6414
- { name: "panels", type: "Folder" },
6415
- { variableName: "panelName", type: "DynamicFolder" }
6416
- ]
6417
- }
6418
- }
6419
- };
6420
-
6421
- // ../../node_modules/@wix/anyide-template-layout/dist/configs/editorConfig.js
6422
- init_esm_shims();
6423
- var editorConfig = {
6424
- backend: "backend",
6425
- public: "public",
6426
- pages: {
6427
- structure: {
6428
- code: "index.js",
6429
- document: {
6430
- structure: "structure.xml",
6431
- data: "data.json",
6432
- style: "style.wcss"
6433
- }
6434
- },
6435
- folders: {
6436
- Page: [
6437
- { name: "pages", type: "Folder" },
6438
- { variableName: "title", type: "DynamicFolder" }
6439
- ]
6440
- }
6441
- }
6442
- };
6443
-
6444
- // ../../node_modules/@wix/anyide-template-layout/dist/configs/index.js
6445
- var configs = {
6446
- Editor: editorConfig,
6447
- Blocks: blocksConfig
6448
- };
6449
- var getConfig = (structureType) => {
6450
- const config = configs[structureType];
6451
- if (!config) {
6452
- throw new Error("Unknown file structure type: " + structureType);
6453
- }
6454
- return config;
6455
- };
6456
-
6457
- // ../../node_modules/@wix/anyide-template-layout/dist/code.js
6458
- var getBackendPath = (structureType) => getConfig(structureType).backend;
6459
- var getPublicPath = (structureType) => getConfig(structureType).public;
6460
-
6461
- // ../../node_modules/@wix/anyide-template-layout/dist/page.js
6462
- init_esm_shims();
6463
- import path3 from "path";
6464
- var getPagesPaths = (structureType) => getConfig(structureType).pages.folders;
6465
- var getPageFilesPaths = (structureType, folderPath) => {
6466
- const { pages } = getConfig(structureType);
6467
- const { structure } = pages;
6468
- return {
6469
- code: path3.join(folderPath, structure.code),
6470
- document: {
6471
- structure: path3.join(folderPath, structure.document.structure),
6472
- style: path3.join(folderPath, structure.document.style),
6473
- data: path3.join(folderPath, structure.document.data)
6474
- }
6475
- };
6476
- };
6477
- var getPageFilesNames = (structureType, pageStructureType) => {
6478
- const { pages } = getConfig(structureType);
6479
- const { structure } = pages;
6480
- if (pageStructureType === "document") {
6481
- return /* @__PURE__ */ new Set([
6482
- structure[pageStructureType].structure,
6483
- structure[pageStructureType].data,
6484
- structure[pageStructureType].style
6485
- ]);
6486
- }
6487
- return /* @__PURE__ */ new Set([structure[pageStructureType]]);
6488
- };
6489
-
6490
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/siteFileStructure.js
6491
- var SiteFileStructure = class {
6492
- fileStructureType;
6493
- constructor(fileStructureType) {
6494
- this.fileStructureType = fileStructureType;
6495
- }
6496
- getBackendFolderPath() {
6497
- return getBackendPath(this.fileStructureType);
6498
- }
6499
- getPublicFolderPath() {
6500
- return getPublicPath(this.fileStructureType);
6501
- }
6502
- getPagesPaths() {
6503
- return getPagesPaths(this.fileStructureType);
6504
- }
6505
- getPagesPathsForType(type) {
6506
- const paths = this.getPagesPaths();
6507
- const pathForType = paths[type];
6508
- if (!pathForType) {
6509
- throw new Error(`page type "${type}" is invalid for structureType "${this.fileStructureType}"`);
6510
- }
6511
- return pathForType;
6512
- }
6513
- getPageFilesPaths(pageFolderPath) {
6514
- return getPageFilesPaths(this.fileStructureType, pageFolderPath);
6515
- }
6516
- matchPagePath(filePath) {
6517
- const pageFilesPath = this.getPagesPaths();
6518
- const sortedPageFilesPath = Object.entries(pageFilesPath).sort((a, b) => b[1].length - a[1].length);
6519
- for (const [type, pagePath] of sortedPageFilesPath) {
6520
- const typeRegex = new RegExp(`^(${pagePath.map((entry) => entry.type === "Folder" ? entry.name : ".+?").join("/")})/(.+)`);
6521
- const path6 = typeRegex.exec(filePath);
6522
- if (path6) {
6523
- return {
6524
- type,
6525
- pagePath: path6[1],
6526
- fileName: path6[2]
6527
- };
6528
- }
6529
- }
6530
- return null;
6531
- }
6532
- getStructureInfoByFilePath(filePath) {
6533
- const backendPath = `${this.getBackendFolderPath()}/`;
6534
- const publicPath = `${this.getPublicFolderPath()}/`;
6535
- if (filePath.startsWith(backendPath)) {
6536
- return { type: "code", isPageFile: false, folderType: foldersType.backend };
6537
- }
6538
- if (filePath.startsWith(publicPath)) {
6539
- return { type: "code", isPageFile: false, folderType: foldersType.public };
6540
- }
6541
- const pageMatch = this.matchPagePath(filePath);
6542
- if (pageMatch) {
6543
- const { pagePath, fileName } = pageMatch;
6544
- const codeFiles = getPageFilesNames(this.fileStructureType, "code");
6545
- if (codeFiles.has(fileName)) {
6546
- return { type: "code", isPageFile: true, pagePath };
6547
- }
6548
- const documentFiles = getPageFilesNames(this.fileStructureType, "document");
6549
- if (documentFiles.has(fileName)) {
6550
- return { type: "document", isPageFile: true, pagePath };
6551
- }
6552
- }
6553
- return null;
6554
- }
6555
- };
6556
-
6557
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/siteFileSystem.js
6558
- init_esm_shims();
6559
- import fs from "fs/promises";
6560
- import path4 from "path";
6561
- var SiteFileSystem = class {
6562
- rootFolderPath;
6563
- constructor(rootFolderPath) {
6564
- this.rootFolderPath = rootFolderPath;
6565
- }
6566
- getFullPath(relativePath) {
6567
- return path4.join(this.rootFolderPath, relativePath);
6568
- }
6569
- async readFile(filePath) {
6570
- return fs.readFile(this.getFullPath(filePath), "utf-8");
6571
- }
6572
- async writeFile(filePath, content) {
6573
- return fs.writeFile(this.getFullPath(filePath), content);
6574
- }
6575
- async removeFile(filePath) {
6576
- return fs.rm(this.getFullPath(filePath));
6577
- }
6578
- async readFolder(folderPath) {
6579
- return fs.readdir(this.getFullPath(folderPath), { withFileTypes: true });
6580
- }
6581
- async createFolder(folderPath) {
6582
- await fs.mkdir(this.getFullPath(folderPath), { recursive: true });
6583
- }
6584
- async removeFolder(folderPath) {
6585
- return fs.rm(this.getFullPath(folderPath), { recursive: true });
6586
- }
6587
- };
6588
-
6589
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/stateBuilder.js
6590
- init_esm_shims();
6591
-
6592
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/sitePagesState.js
6593
- init_esm_shims();
6594
- var CaseInsensitiveMap = class {
6595
- map = /* @__PURE__ */ new Map();
6596
- normalizeKey(key) {
6597
- return key.toLowerCase();
6598
- }
6599
- get(key) {
6600
- return this.map.get(this.normalizeKey(key));
6601
- }
6602
- set(key, value) {
6603
- this.map.set(this.normalizeKey(key), value);
6604
- }
6605
- delete(key) {
6606
- this.map.delete(this.normalizeKey(key));
6607
- }
6608
- entries() {
6609
- return this.map.entries();
6610
- }
6611
- };
6612
- var SitePagesState = class {
6613
- pageIdToFolderPath = /* @__PURE__ */ new Map();
6614
- folderPathToPageId = new CaseInsensitiveMap();
6615
- validatePageIdExists(pageId) {
6616
- if (this.pageIdToFolderPath.has(pageId)) {
6617
- throw new Error(`Duplicated pageId found in structure.xml files: ${pageId}`);
6618
- }
6619
- }
6620
- getAll() {
6621
- const allPages = [];
6622
- for (const [pageId, pagePath] of this.pageIdToFolderPath.entries()) {
6623
- allPages.push({ pageId, pagePath });
6624
- }
6625
- return allPages;
6626
- }
6627
- addPage(pageId, folderPath) {
6628
- this.validatePageIdExists(pageId);
6629
- this.pageIdToFolderPath.set(pageId, folderPath);
6630
- this.folderPathToPageId.set(folderPath, pageId);
6631
- }
6632
- removePageById(pageId) {
6633
- const folderPath = this.pageIdToFolderPath.get(pageId);
6634
- if (folderPath === void 0) {
6635
- return;
6636
- }
6637
- this.pageIdToFolderPath.delete(pageId);
6638
- this.folderPathToPageId.delete(folderPath);
6639
- }
6640
- removePageByPath(path6) {
6641
- const pageId = this.folderPathToPageId.get(path6);
6642
- if (pageId === void 0) {
6643
- return;
6644
- }
6645
- this.pageIdToFolderPath.delete(pageId);
6646
- this.folderPathToPageId.delete(path6);
6647
- }
6648
- getFolderPath(pageId) {
6649
- return this.pageIdToFolderPath.get(pageId);
6650
- }
6651
- getPageId(folderPath) {
6652
- return this.folderPathToPageId.get(folderPath);
6653
- }
6654
- };
6655
-
6656
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/stateBuilder.js
6657
- import path5 from "path";
6658
- var getFoldersInPath = async (siteFileSystem, dirPath) => {
6659
- const entries = await siteFileSystem.readFolder(dirPath);
6660
- return entries.filter((entry) => entry.isDirectory()).map(({ name }) => name);
6661
- };
6662
- var getMatchingPaths = (folderName, paths) => paths.filter(([first]) => first?.type === "DynamicFolder" || first.name === folderName);
6663
- var getPages = async (siteFileSystem, paths, rootPath = "") => {
6664
- if (paths.length === 0)
6665
- return [];
6666
- const result = [];
6667
- const rootFolders = await getFoldersInPath(siteFileSystem, rootPath);
6668
- for (const folderName of rootFolders) {
6669
- const matchingPaths = getMatchingPaths(folderName, paths);
6670
- if (matchingPaths.length > 0) {
6671
- const finalPaths = matchingPaths.filter((p) => p.length === 1).map(() => path5.join(rootPath, folderName));
6672
- const nonFinalPaths = matchingPaths.filter((p) => p.length > 1).map(([, ...rest]) => rest);
6673
- const nestedPages = await getPages(siteFileSystem, nonFinalPaths, path5.join(rootPath, folderName));
6674
- result.push(...finalPaths, ...nestedPages);
6675
- }
6676
- }
6677
- return result;
6678
- };
6679
- var getAllPageFolders = async (siteFileStructure, siteFileSystem) => {
6680
- const paths = siteFileStructure.getPagesPaths();
6681
- return await getPages(siteFileSystem, Object.values(paths));
6682
- };
6683
- var buildPagesState = async (siteFileStructure, siteFileSystem) => {
6684
- const state = new SitePagesState();
6685
- const pagesFolders = await getAllPageFolders(siteFileStructure, siteFileSystem);
6686
- await Promise.all(pagesFolders.map(async (folderPath) => {
6687
- const filePaths = siteFileStructure.getPageFilesPaths(folderPath);
6688
- const pageId = await getPageId(siteFileSystem, filePaths.document);
6689
- state.addPage(pageId, folderPath);
6690
- }));
6691
- return state;
6692
- };
6693
-
6694
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/state/state.js
6695
- var buildState = async (rootFolderPath, fileStructureType) => {
6696
- const fileSystem = new SiteFileSystem(rootFolderPath);
6697
- const fileStructure = new SiteFileStructure(fileStructureType);
6698
- const pages = await buildPagesState(fileStructure, fileSystem);
6699
- return {
6700
- fileSystem,
6701
- fileStructure,
6702
- pages
6703
- };
6704
- };
6705
-
6706
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/applyFsUpdates.js
6707
- init_esm_shims();
6708
-
6709
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/code/fsUpdates.js
6710
- init_esm_shims();
6711
- var initVeloCodeUpdate = () => {
6712
- return {
6713
- layout: "GITHUB",
6714
- ignoreForbiddenPaths: true
6715
- };
6716
- };
6717
- var applyDeleteCode = (codeUpdate, path6) => {
6718
- if (!codeUpdate) {
6719
- codeUpdate = initVeloCodeUpdate();
6720
- }
6721
- codeUpdate.pathsToDelete ??= [];
6722
- codeUpdate.pathsToDelete.push(path6);
6723
- return codeUpdate;
6724
- };
6725
- var applyUpdateCode = (codeUpdate, veloFile) => {
6726
- if (!codeUpdate) {
6727
- codeUpdate = initVeloCodeUpdate();
6728
- }
6729
- codeUpdate.filesToUpdate ??= [];
6730
- codeUpdate.filesToUpdate.push(veloFile);
6731
- return codeUpdate;
6732
- };
6733
- var accumulateFsUpdateToVeloCodeUpdate = async (state, veloCodeUpdate, structureInfo, { path: path6, action }) => {
6734
- let result = veloCodeUpdate;
6735
- const pathInGithubLayout = convertToGithubLayout(state, path6, structureInfo.folderType);
6736
- if (action === "DELETE") {
6737
- result = applyDeleteCode(result, pathInGithubLayout);
6738
- } else if (action === "UPDATE") {
6739
- result = applyUpdateCode(result, {
6740
- path: pathInGithubLayout,
6741
- content: await state.fileSystem.readFile(path6)
6742
- });
6743
- }
6744
- return result;
6745
- };
6746
-
6747
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/page/fsUpdates.js
6748
- init_esm_shims();
6749
-
6750
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/document/fsUpdates.js
6751
- init_esm_shims();
6752
- var applyDocumentUpdate = (documentUpdate, pageId, value) => {
6753
- documentUpdate ??= { pages: {} };
6754
- documentUpdate.pages[pageId] = value;
6755
- return documentUpdate;
6756
- };
6757
-
6758
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/page/fsUpdates.js
6759
- var applyDeletePage = (siteFsUpdate, pageId) => {
6760
- siteFsUpdate.document = applyDocumentUpdate(siteFsUpdate.document, pageId, null);
6761
- const veloPath = getPageCodeFilePath(pageId);
6762
- siteFsUpdate.code = applyDeleteCode(siteFsUpdate.code, veloPath);
6763
- return siteFsUpdate;
6764
- };
6765
- var applyCodeUpdateInPage = async (state, siteFsUpdate, pageId, path6) => {
6766
- siteFsUpdate.code = applyUpdateCode(siteFsUpdate.code, {
6767
- path: getPageCodeFilePath(pageId),
6768
- content: await state.fileSystem.readFile(path6)
6769
- });
6770
- return siteFsUpdate;
6771
- };
6772
- var accumulatePageFsUpdateToWixSiteFSUpdate = async (state, siteFsUpdate, structureInfo, { action, path: path6 }) => {
6773
- const result = siteFsUpdate;
6774
- const pageId = state.pages.getPageId(structureInfo.pagePath);
6775
- if (action === "DELETE") {
6776
- if (!pageId) {
6777
- return result;
6778
- }
6779
- const { document, code } = applyDeletePage(result, pageId);
6780
- result.document = document;
6781
- result.code = code;
6782
- state.pages.removePageById(pageId);
6783
- } else if (action === "UPDATE") {
6784
- const page = state.fileStructure.getPageFilesPaths(structureInfo.pagePath);
6785
- if (structureInfo.type === "document") {
6786
- const wml = await readWml(state.fileSystem, page.document);
6787
- const pageIdInDocument = await getPageId(state.fileSystem, page.document);
6788
- const folderPathForPageIdInDocument = state.pages.getFolderPath(pageIdInDocument);
6789
- if (folderPathForPageIdInDocument && folderPathForPageIdInDocument !== structureInfo.pagePath) {
6790
- throw new Error(`Duplicated pageId found in structure.xml files: ${pageIdInDocument}`);
6791
- }
6792
- if (pageId !== pageIdInDocument) {
6793
- if (pageId) {
6794
- const { document, code } = applyDeletePage(result, pageId);
6795
- result.document = document;
6796
- result.code = code;
6797
- await applyCodeUpdateInPage(state, result, pageIdInDocument, page.code);
6798
- state.pages.removePageById(pageId);
6799
- }
6800
- state.pages.addPage(pageIdInDocument, structureInfo.pagePath);
6801
- }
6802
- result.document = applyDocumentUpdate(result.document, pageIdInDocument, { data: wml });
6803
- } else if (structureInfo.type === "code") {
6804
- if (!pageId) {
6805
- return result;
6806
- }
6807
- await applyCodeUpdateInPage(state, result, pageId, path6);
6808
- }
6809
- }
6810
- return result;
6811
- };
6812
-
6813
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/applyFsUpdates.js
6814
- var applyFsUpdates = async (state, updates) => {
6815
- const result = {};
6816
- for (const { path: path6, action } of updates) {
6817
- const structureInfo = state.fileStructure.getStructureInfoByFilePath(path6);
6818
- if (structureInfo === null)
6819
- continue;
6820
- if (structureInfo.isPageFile) {
6821
- const { document, code } = await accumulatePageFsUpdateToWixSiteFSUpdate(state, result, structureInfo, {
6822
- path: path6,
6823
- action
6824
- });
6825
- result.code = code;
6826
- result.document = document;
6827
- } else if (structureInfo.type === "code") {
6828
- result.code = await accumulateFsUpdateToVeloCodeUpdate(state, result.code, structureInfo, { path: path6, action });
6829
- }
6830
- }
6831
- return result;
6832
- };
6833
-
6834
- // ../../node_modules/@wix/anyide-cli-file-structure/dist/wixSiteFSManager.js
6835
- var WixSiteFSManager = class _WixSiteFSManager {
6836
- state;
6837
- constructor(state) {
6838
- this.state = state;
6839
- }
6840
- static async create(rootFolderPath, fileStructureType) {
6841
- const state = await buildState(rootFolderPath, fileStructureType);
6842
- return new _WixSiteFSManager(state);
6843
- }
6844
- getCode = async () => getSiteCode(this.state);
6845
- getDocument = async () => getSiteDocument(this.state);
6846
- applyFsUpdates = async (updates) => applyFsUpdates(this.state, updates);
6847
- applyExternalUpdates = async ({ code, document }) => {
6848
- if (code) {
6849
- throw new Error("external code updates are not supported");
6850
- }
6851
- if (document) {
6852
- await applyDocumentExternalUpdates(this.state, document);
6853
- }
6854
- };
6855
- createConvertOnlineLayoutApi = (basePath) => (onlinePath) => convertOnlineLayout(this.state, basePath, onlinePath);
6856
- };
6857
-
6858
- // ../cli-site/src/site-fs-manager.ts
6859
- async function createSiteFsManager(projectFolder) {
6860
- const srcFolder = getSourceFolder(projectFolder);
6861
- const fsManager = await WixSiteFSManager.create(srcFolder, "Editor").catch(
6862
- (error) => {
6863
- throw new CliError({
6864
- code: CliErrorCode.FailedToInitializeSiteFsManager(),
6865
- cause: error
6866
- });
6867
- }
6868
- );
6869
- return {
6870
- convertToOnlineLayout: fsManager.createConvertOnlineLayoutApi(
6871
- relative(projectFolder, srcFolder)
6872
- ),
6873
- async getCode() {
6874
- try {
6875
- return await fsManager.getCode();
6876
- } catch (error) {
6877
- throw new CliError({
6878
- code: CliErrorCode.FailedToGetSiteFsManagerCode(),
6879
- cause: error
6880
- });
6881
- }
6882
- },
6883
- async getDocument() {
6884
- try {
6885
- return await fsManager.getDocument();
6886
- } catch (error) {
6887
- throw new CliError({
6888
- code: CliErrorCode.FailedToGetSiteFsManagerDocument(),
6889
- cause: error
6890
- });
6891
- }
6892
- },
6893
- async applyFsUpdates(updates) {
6894
- try {
6895
- return await fsManager.applyFsUpdates(updates);
6896
- } catch (error) {
6897
- throw new CliError({
6898
- code: CliErrorCode.FailedToApplySiteFsManagerFsUpdates(),
6899
- cause: error
6900
- });
6901
- }
6902
- },
6903
- async applyExternalUpdates(update) {
6904
- try {
6905
- await fsManager.applyExternalUpdates(update);
6906
- } catch (error) {
6907
- throw new CliError({
6908
- code: CliErrorCode.FailedToApplySiteFsManagerExternalUpdates(),
6909
- cause: error
6910
- });
6911
- }
6912
- }
6913
- };
6914
- }
6915
-
6916
6067
  // ../cli-site/src/intellisense-adapter.ts
6917
6068
  init_esm_shims();
6918
6069
 
@@ -7368,16 +6519,16 @@ function useFsWatcher(projectFolder) {
7368
6519
  (events) => {
7369
6520
  const uniqEvents = new Map(events);
7370
6521
  const update = [];
7371
- for (const [path6, action] of uniqEvents) {
7372
- update.push({ path: path6, action });
6522
+ for (const [path, action] of uniqEvents) {
6523
+ update.push({ path, action });
7373
6524
  }
7374
6525
  eventHandler(update);
7375
6526
  },
7376
6527
  400
7377
6528
  );
7378
- watcher2.on("change", (path6) => debouncedHandler(path6, "UPDATE"));
7379
- watcher2.on("add", (path6) => debouncedHandler(path6, "UPDATE"));
7380
- watcher2.on("unlink", (path6) => debouncedHandler(path6, "DELETE"));
6529
+ watcher2.on("change", (path) => debouncedHandler(path, "UPDATE"));
6530
+ watcher2.on("add", (path) => debouncedHandler(path, "UPDATE"));
6531
+ watcher2.on("unlink", (path) => debouncedHandler(path, "DELETE"));
7381
6532
  }
7382
6533
  };
7383
6534
  });
@@ -7558,4 +6709,4 @@ export {
7558
6709
  sax/lib/sax.js:
7559
6710
  (*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
7560
6711
  */
7561
- //# sourceMappingURL=DevCommand-GO3Z73V7.js.map
6712
+ //# sourceMappingURL=DevCommand-NPVKUDPR.js.map