@wix/cli-app 1.1.125 → 1.1.126

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 (64) hide show
  1. package/build/{AddPermissionCommand-IZV3UDJQ.js → AddPermissionCommand-4KBT3UEO.js} +2 -2
  2. package/build/{DevCommand-4Q2GY2MV.js → DevCommand-XHPQCRLQ.js} +10 -10
  3. package/build/{GenerateCommand-JM3UR2B4.js → GenerateCommand-SWNFGTMF.js} +7 -7
  4. package/build/{LogsCommand-OWXS7FSS.js → LogsCommand-KB6RLF4U.js} +3 -3
  5. package/build/PreviewCommand-JAYWK572.js +19 -0
  6. package/build/ReleaseCommand-L5EVCMGK.js +23 -0
  7. package/build/{ServeCommand-3O6WV3OG.js → ServeCommand-LTEYN4BP.js} +3 -3
  8. package/build/{build-PZPA4VW6.js → build-45REWBBU.js} +6 -6
  9. package/build/{chunk-XDVS5U63.js → chunk-2DDAFTMT.js} +361 -385
  10. package/build/chunk-2DDAFTMT.js.map +1 -0
  11. package/build/{chunk-3QYQCPHD.js → chunk-2NL5XLAV.js} +25 -14
  12. package/build/{chunk-3QYQCPHD.js.map → chunk-2NL5XLAV.js.map} +1 -1
  13. package/build/{chunk-UP5R334C.js → chunk-3ZWZQAA3.js} +7 -7
  14. package/build/{chunk-XKYWADFI.js → chunk-4NJK2T2E.js} +2 -2
  15. package/build/{chunk-4CLUA5K6.js → chunk-62ODBQND.js} +6 -6
  16. package/build/{chunk-73IEEATV.js → chunk-6B55IRBV.js} +2 -2
  17. package/build/{chunk-PJNY3IAX.js → chunk-A6VMLDIX.js} +2 -2
  18. package/build/{chunk-SUFNUPR2.js → chunk-CMBNHN5R.js} +2 -2
  19. package/build/{chunk-22M4W7BK.js → chunk-F7VDDMJ2.js} +2 -2
  20. package/build/{chunk-VWANLXSD.js → chunk-IZHIX2TH.js} +7 -2
  21. package/build/{chunk-VWANLXSD.js.map → chunk-IZHIX2TH.js.map} +1 -1
  22. package/build/{chunk-5VPCVH55.js → chunk-JYBUXFM2.js} +4 -4
  23. package/build/{chunk-EPKRIM3V.js → chunk-NOFDNNIP.js} +3 -3
  24. package/build/{chunk-VHUNARG2.js → chunk-RU6JT53E.js} +2 -2
  25. package/build/{chunk-IJDV4MGV.js → chunk-TDRWEF2B.js} +4 -4
  26. package/build/{chunk-F5KDSDTS.js → chunk-TMUISA2Z.js} +6 -6
  27. package/build/{chunk-Q66WJZYR.js → chunk-XBM2N7YZ.js} +2 -2
  28. package/build/{chunk-XGXONE7F.js → chunk-YXMQAR4L.js} +2 -2
  29. package/build/index.js +23 -23
  30. package/build/platform-sdk/editor.js +1 -1
  31. package/build/platform-sdk/editor.js.map +1 -1
  32. package/build/platform-sdk/site.js.map +1 -1
  33. package/build/{preview-Z7R5SNFJ.js → preview-UEVMLVY4.js} +12 -12
  34. package/build/{release-IGJBVIMI.js → release-2R6C5TVB.js} +14 -14
  35. package/build/{render-command-M7ACRQFE.js → render-command-WTRCTYH3.js} +5 -5
  36. package/package.json +3 -3
  37. package/build/PreviewCommand-P75NAWNH.js +0 -19
  38. package/build/ReleaseCommand-C7MKXJQR.js +0 -23
  39. package/build/chunk-XDVS5U63.js.map +0 -1
  40. /package/build/{AddPermissionCommand-IZV3UDJQ.js.map → AddPermissionCommand-4KBT3UEO.js.map} +0 -0
  41. /package/build/{DevCommand-4Q2GY2MV.js.map → DevCommand-XHPQCRLQ.js.map} +0 -0
  42. /package/build/{GenerateCommand-JM3UR2B4.js.map → GenerateCommand-SWNFGTMF.js.map} +0 -0
  43. /package/build/{LogsCommand-OWXS7FSS.js.map → LogsCommand-KB6RLF4U.js.map} +0 -0
  44. /package/build/{PreviewCommand-P75NAWNH.js.map → PreviewCommand-JAYWK572.js.map} +0 -0
  45. /package/build/{ReleaseCommand-C7MKXJQR.js.map → ReleaseCommand-L5EVCMGK.js.map} +0 -0
  46. /package/build/{ServeCommand-3O6WV3OG.js.map → ServeCommand-LTEYN4BP.js.map} +0 -0
  47. /package/build/{build-PZPA4VW6.js.map → build-45REWBBU.js.map} +0 -0
  48. /package/build/{chunk-UP5R334C.js.map → chunk-3ZWZQAA3.js.map} +0 -0
  49. /package/build/{chunk-XKYWADFI.js.map → chunk-4NJK2T2E.js.map} +0 -0
  50. /package/build/{chunk-4CLUA5K6.js.map → chunk-62ODBQND.js.map} +0 -0
  51. /package/build/{chunk-73IEEATV.js.map → chunk-6B55IRBV.js.map} +0 -0
  52. /package/build/{chunk-PJNY3IAX.js.map → chunk-A6VMLDIX.js.map} +0 -0
  53. /package/build/{chunk-SUFNUPR2.js.map → chunk-CMBNHN5R.js.map} +0 -0
  54. /package/build/{chunk-22M4W7BK.js.map → chunk-F7VDDMJ2.js.map} +0 -0
  55. /package/build/{chunk-5VPCVH55.js.map → chunk-JYBUXFM2.js.map} +0 -0
  56. /package/build/{chunk-EPKRIM3V.js.map → chunk-NOFDNNIP.js.map} +0 -0
  57. /package/build/{chunk-VHUNARG2.js.map → chunk-RU6JT53E.js.map} +0 -0
  58. /package/build/{chunk-IJDV4MGV.js.map → chunk-TDRWEF2B.js.map} +0 -0
  59. /package/build/{chunk-F5KDSDTS.js.map → chunk-TMUISA2Z.js.map} +0 -0
  60. /package/build/{chunk-Q66WJZYR.js.map → chunk-XBM2N7YZ.js.map} +0 -0
  61. /package/build/{chunk-XGXONE7F.js.map → chunk-YXMQAR4L.js.map} +0 -0
  62. /package/build/{preview-Z7R5SNFJ.js.map → preview-UEVMLVY4.js.map} +0 -0
  63. /package/build/{release-IGJBVIMI.js.map → release-2R6C5TVB.js.map} +0 -0
  64. /package/build/{render-command-M7ACRQFE.js.map → render-command-WTRCTYH3.js.map} +0 -0
@@ -3,7 +3,7 @@ const require = _createRequire(import.meta.url);
3
3
  import {
4
4
  getBackendEventSlug,
5
5
  require_baseUniq
6
- } from "./chunk-VWANLXSD.js";
6
+ } from "./chunk-IZHIX2TH.js";
7
7
  import {
8
8
  API_BASEURL_PLACEHOLDER,
9
9
  AlgorithmType,
@@ -91,7 +91,7 @@ import {
91
91
  virtualSiteComponentPreviewScriptAssets,
92
92
  virtualSiteComponentScriptAssets,
93
93
  virtualSiteComponentSdkScriptAssets
94
- } from "./chunk-3QYQCPHD.js";
94
+ } from "./chunk-2NL5XLAV.js";
95
95
  import {
96
96
  __commonJS,
97
97
  __esm,
@@ -30954,6 +30954,7 @@ function getViteConfig(model, options, { appSecret, webhookPublicKey }) {
30954
30954
 
30955
30955
  // src/vite/configs/build-command/browser.ts
30956
30956
  init_esm_shims();
30957
+ import { mergeConfig } from "vite";
30957
30958
 
30958
30959
  // ../../node_modules/vite-plugin-externals/dist/es/src/index.js
30959
30960
  init_esm_shims();
@@ -38976,232 +38977,6 @@ init_esm_shims();
38976
38977
  var import_variant = __toESM(require_lib(), 1);
38977
38978
  import { join as join4 } from "node:path";
38978
38979
  var import_node_html_parser = __toESM(require_dist(), 1);
38979
- function getEmbeddedScriptEntries(model) {
38980
- const entries = model.components.filter((0, import_variant.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => join4(model.projectFolder, comp.relativePath));
38981
- return new Set(entries);
38982
- }
38983
- function getEmbeddedScriptHtmlUrl(filename) {
38984
- return `__STATICS_BASE_URL_PLACEHOLDER__${filename}`;
38985
- }
38986
- function embeddedScriptSDKSupport(options) {
38987
- const { initialModel, type } = options;
38988
- const query = "?wix-context-internal";
38989
- const virtualModuleId = "virtual:wix-context-module";
38990
- const resolvedVirtualModuleId = `\0${virtualModuleId}`;
38991
- const virtualScriptId = "virtual:wix-context-reexport-script";
38992
- const resolvedVirtualScriptId = `\0${virtualScriptId}`;
38993
- let id;
38994
- let fileName;
38995
- let entriesSet = getEmbeddedScriptEntries(initialModel);
38996
- return [
38997
- {
38998
- name: "wix:embedded-script-sdk-support-modules",
38999
- enforce: "pre",
39000
- resolveId(id2) {
39001
- if (id2 === virtualModuleId) {
39002
- return resolvedVirtualModuleId;
39003
- }
39004
- if (id2.endsWith(virtualScriptId)) {
39005
- return resolvedVirtualScriptId;
39006
- }
39007
- return null;
39008
- },
39009
- load(id2) {
39010
- if (id2 === resolvedVirtualModuleId) {
39011
- return defaultOutdent`
39012
- import { enableClient } from '@wix/cli-app/internal/platform-sdk/site';
39013
- const { injectGetAccessToken } = enableClient('${initialModel.config.appId}');
39014
- export const injectAccessTokenFunction = (getAppToken) => {
39015
- injectGetAccessToken(getAppToken);
39016
- };
39017
- `;
39018
- }
39019
- if (id2 === resolvedVirtualScriptId) {
39020
- return `export * from '${virtualModuleId}';`;
39021
- }
39022
- return null;
39023
- }
39024
- },
39025
- {
39026
- name: "wix:embedded-script-sdk-support-serve",
39027
- apply: "serve",
39028
- enforce: "pre",
39029
- configureServer() {
39030
- if (type === "dev" /* dev */) {
39031
- options.projectModelWatcher.onChange((model) => {
39032
- entriesSet = getEmbeddedScriptEntries(model);
39033
- });
39034
- }
39035
- },
39036
- transform(code, id2) {
39037
- if (id2.endsWith(query)) {
39038
- const s2 = new MagicString(code);
39039
- s2.prepend(`import '${virtualModuleId}';
39040
- `);
39041
- return {
39042
- code: s2.toString(),
39043
- map: s2.generateMap()
39044
- };
39045
- }
39046
- return null;
39047
- },
39048
- transformIndexHtml: {
39049
- order: "pre",
39050
- handler(html, ctx) {
39051
- if (entriesSet.has(ctx.filename)) {
39052
- const root = (0, import_node_html_parser.parse)(html);
39053
- const scripts = root.querySelectorAll('script[type="module"]');
39054
- for (const script of scripts) {
39055
- const src = script.getAttribute("src");
39056
- if (src) {
39057
- script.setAttribute("src", `${src}${query}`);
39058
- } else {
39059
- script.innerHTML = `import '${virtualModuleId}';
39060
- ${script.innerHTML}`;
39061
- }
39062
- }
39063
- return {
39064
- tags: [
39065
- {
39066
- tag: "script",
39067
- attrs: {
39068
- type: "module",
39069
- accesstoken: "true",
39070
- src: virtualScriptId
39071
- }
39072
- }
39073
- ],
39074
- html: root.toString()
39075
- };
39076
- }
39077
- return html;
39078
- }
39079
- }
39080
- },
39081
- {
39082
- name: "wix:embedded-script-sdk-support-build-pre",
39083
- apply: "build",
39084
- enforce: "pre",
39085
- transformIndexHtml: {
39086
- order: "pre",
39087
- handler(html, ctx) {
39088
- if (entriesSet.has(ctx.filename)) {
39089
- return {
39090
- tags: [
39091
- {
39092
- tag: "script",
39093
- attrs: {
39094
- type: "module",
39095
- src: virtualModuleId
39096
- }
39097
- }
39098
- ],
39099
- html
39100
- };
39101
- }
39102
- return html;
39103
- }
39104
- }
39105
- },
39106
- {
39107
- name: "wix:embedded-script-sdk-support-build-post",
39108
- apply: "build",
39109
- enforce: "pre",
39110
- buildStart() {
39111
- this.emitFile({
39112
- type: "chunk",
39113
- id: virtualModuleId,
39114
- preserveSignature: "exports-only"
39115
- });
39116
- id = this.emitFile({
39117
- type: "chunk",
39118
- id: virtualScriptId,
39119
- preserveSignature: "exports-only"
39120
- });
39121
- },
39122
- generateBundle() {
39123
- fileName = this.getFileName(id);
39124
- },
39125
- transformIndexHtml(html, ctx) {
39126
- if (entriesSet.has(ctx.filename)) {
39127
- return {
39128
- tags: [
39129
- {
39130
- tag: "script",
39131
- attrs: {
39132
- type: "module",
39133
- crossorigin: true,
39134
- accesstoken: "true",
39135
- src: getEmbeddedScriptHtmlUrl(fileName)
39136
- }
39137
- }
39138
- ],
39139
- html
39140
- };
39141
- }
39142
- return html;
39143
- }
39144
- }
39145
- ];
39146
- }
39147
-
39148
- // src/vite/plugins/monitoring.ts
39149
- init_esm_shims();
39150
- var import_monitoring_buildtime2 = __toESM(require_build(), 1);
39151
-
39152
- // src/app-manifest/monitoring.ts
39153
- init_esm_shims();
39154
- var getMonitoringProvider = (monitoring2) => {
39155
- if ("sentry" in monitoring2) {
39156
- return {
39157
- type: MonitoringType.SENTRY,
39158
- sentryOptions: monitoring2.sentry
39159
- };
39160
- }
39161
- return monitoring2.custom;
39162
- };
39163
-
39164
- // src/vite/plugins/monitoring.ts
39165
- function monitoring({ initialModel }) {
39166
- const { monitoring: monitoring2 } = initialModel.config;
39167
- if (!monitoring2) {
39168
- return null;
39169
- }
39170
- try {
39171
- return (0, import_monitoring_buildtime2.getMonitoringVitePlugins)({
39172
- appId: initialModel.config.appId,
39173
- silent: true,
39174
- provider: getMonitoringProvider(monitoring2)
39175
- });
39176
- } catch (e) {
39177
- throw new CliError({
39178
- cause: e,
39179
- code: CliErrorCode.FailedToCreateMonitoringVitePlugin({
39180
- configPath: WIX_CONFIG_FILENAME
39181
- })
39182
- });
39183
- }
39184
- }
39185
-
39186
- // src/vite/plugins/fbjs-hotfix-plugin.ts
39187
- init_esm_shims();
39188
- function fbjsHotfixPlugin() {
39189
- return {
39190
- name: "fbjs-hotfix",
39191
- transform(code, id) {
39192
- if (id.endsWith("node_modules/fbjs/lib/UnicodeBidi.js")) {
39193
- return {
39194
- code: code.replaceAll("\\u17D8", "")
39195
- };
39196
- }
39197
- return null;
39198
- }
39199
- };
39200
- }
39201
-
39202
- // src/vite/plugins/config-extensions-file-emitter.ts
39203
- init_esm_shims();
39204
- import { join as join5, basename as basename2 } from "node:path";
39205
38980
 
39206
38981
  // ../cli-app-manifest/build/index.js
39207
38982
  init_esm_shims();
@@ -39813,7 +39588,7 @@ var siteComponentSchema = external_exports.object({
39813
39588
  compName: external_exports.string().optional(),
39814
39589
  compData: external_exports.object({
39815
39590
  editorReactComponent: external_exports.object({
39816
- type: external_exports.string().min(1).max(100),
39591
+ type: external_exports.string().min(1),
39817
39592
  description: external_exports.string().min(5),
39818
39593
  resources: siteComponentResourcesSchema,
39819
39594
  installation: external_exports.unknown(),
@@ -40242,7 +40017,179 @@ var updateAppManifestComponents = ({
40242
40017
  return updatedManifest;
40243
40018
  };
40244
40019
 
40020
+ // src/vite/plugins/embedded-script-sdk-support.ts
40021
+ function getEmbeddedScriptEntries(model) {
40022
+ const entries = model.components.filter((0, import_variant.isType)(DevCenterComponent.EmbeddedScript)).map((comp) => join4(model.projectFolder, comp.relativePath));
40023
+ return new Set(entries);
40024
+ }
40025
+ function getEmbeddedScriptHtmlUrl(filename) {
40026
+ return `${BASE_URL_PLACEHOLDER}${filename}`;
40027
+ }
40028
+ function embeddedScriptSDKSupport(options) {
40029
+ const { initialModel, type } = options;
40030
+ const query = "?wix-context-internal";
40031
+ const virtualModuleId = "virtual:wix-context-module";
40032
+ const resolvedVirtualModuleId = `\0${virtualModuleId}`;
40033
+ const virtualScriptId = "virtual:wix-context-reexport-script";
40034
+ const resolvedVirtualScriptId = `\0${virtualScriptId}`;
40035
+ let id;
40036
+ let fileName;
40037
+ let entriesSet = getEmbeddedScriptEntries(initialModel);
40038
+ return [
40039
+ {
40040
+ name: "wix:embedded-script-sdk-support-modules",
40041
+ enforce: "pre",
40042
+ resolveId(id2) {
40043
+ if (id2 === virtualModuleId) {
40044
+ return resolvedVirtualModuleId;
40045
+ }
40046
+ if (id2.endsWith(virtualScriptId)) {
40047
+ return resolvedVirtualScriptId;
40048
+ }
40049
+ return null;
40050
+ },
40051
+ load(id2) {
40052
+ if (id2 === resolvedVirtualModuleId) {
40053
+ return defaultOutdent`
40054
+ import { enableClient } from '@wix/cli-app/internal/platform-sdk/site';
40055
+ const { injectGetAccessToken } = enableClient('${initialModel.config.appId}');
40056
+ export const injectAccessTokenFunction = (getAppToken) => {
40057
+ injectGetAccessToken(getAppToken);
40058
+ };
40059
+ `;
40060
+ }
40061
+ if (id2 === resolvedVirtualScriptId) {
40062
+ return `export * from '${virtualModuleId}';`;
40063
+ }
40064
+ return null;
40065
+ }
40066
+ },
40067
+ {
40068
+ name: "wix:embedded-script-sdk-support-serve",
40069
+ apply: "serve",
40070
+ enforce: "pre",
40071
+ configureServer() {
40072
+ if (type === "dev" /* dev */) {
40073
+ options.projectModelWatcher.onChange((model) => {
40074
+ entriesSet = getEmbeddedScriptEntries(model);
40075
+ });
40076
+ }
40077
+ },
40078
+ transform(code, id2) {
40079
+ if (id2.endsWith(query)) {
40080
+ const s2 = new MagicString(code);
40081
+ s2.prepend(`import '${virtualModuleId}';
40082
+ `);
40083
+ return {
40084
+ code: s2.toString(),
40085
+ map: s2.generateMap()
40086
+ };
40087
+ }
40088
+ return null;
40089
+ },
40090
+ transformIndexHtml: {
40091
+ order: "pre",
40092
+ handler(html, ctx) {
40093
+ if (entriesSet.has(ctx.filename)) {
40094
+ const root = (0, import_node_html_parser.parse)(html);
40095
+ const scripts = root.querySelectorAll('script[type="module"]');
40096
+ for (const script of scripts) {
40097
+ const src = script.getAttribute("src");
40098
+ if (src) {
40099
+ script.setAttribute("src", `${src}${query}`);
40100
+ } else {
40101
+ script.innerHTML = `import '${virtualModuleId}';
40102
+ ${script.innerHTML}`;
40103
+ }
40104
+ }
40105
+ return {
40106
+ tags: [
40107
+ {
40108
+ tag: "script",
40109
+ attrs: {
40110
+ type: "module",
40111
+ accesstoken: "true",
40112
+ src: virtualScriptId
40113
+ }
40114
+ }
40115
+ ],
40116
+ html: root.toString()
40117
+ };
40118
+ }
40119
+ return html;
40120
+ }
40121
+ }
40122
+ },
40123
+ {
40124
+ name: "wix:embedded-script-sdk-support-build-pre",
40125
+ apply: "build",
40126
+ enforce: "pre",
40127
+ transformIndexHtml: {
40128
+ order: "pre",
40129
+ handler(html, ctx) {
40130
+ if (entriesSet.has(ctx.filename)) {
40131
+ return {
40132
+ tags: [
40133
+ {
40134
+ tag: "script",
40135
+ attrs: {
40136
+ type: "module",
40137
+ src: virtualModuleId
40138
+ }
40139
+ }
40140
+ ],
40141
+ html
40142
+ };
40143
+ }
40144
+ return html;
40145
+ }
40146
+ }
40147
+ },
40148
+ {
40149
+ name: "wix:embedded-script-sdk-support-build-post",
40150
+ apply: "build",
40151
+ enforce: "pre",
40152
+ buildStart() {
40153
+ this.emitFile({
40154
+ type: "chunk",
40155
+ id: virtualModuleId,
40156
+ preserveSignature: "exports-only"
40157
+ });
40158
+ id = this.emitFile({
40159
+ type: "chunk",
40160
+ id: virtualScriptId,
40161
+ preserveSignature: "exports-only"
40162
+ });
40163
+ },
40164
+ generateBundle() {
40165
+ fileName = this.getFileName(id);
40166
+ },
40167
+ transformIndexHtml(html, ctx) {
40168
+ if (entriesSet.has(ctx.filename)) {
40169
+ return {
40170
+ tags: [
40171
+ {
40172
+ tag: "script",
40173
+ attrs: {
40174
+ type: "module",
40175
+ crossorigin: true,
40176
+ accesstoken: "true",
40177
+ src: getEmbeddedScriptHtmlUrl(fileName)
40178
+ }
40179
+ }
40180
+ ],
40181
+ html
40182
+ };
40183
+ }
40184
+ return html;
40185
+ }
40186
+ }
40187
+ ];
40188
+ }
40189
+
40245
40190
  // src/vite/plugins/config-extensions-file-emitter.ts
40191
+ init_esm_shims();
40192
+ import { join as join5, basename as basename2 } from "node:path";
40246
40193
  var import_types_impl = __toESM(require_types_impl(), 1);
40247
40194
  async function processPresetsThumbnailUrls(presets, basePath, emitAssetFile) {
40248
40195
  for (const preset of Object.values(presets)) {
@@ -40344,6 +40291,65 @@ function configExtensionsFileEmitter(model) {
40344
40291
  };
40345
40292
  }
40346
40293
 
40294
+ // src/vite/plugins/hash-html-files.ts
40295
+ init_esm_shims();
40296
+ import { createHash as createHash2 } from "node:crypto";
40297
+ import { extname } from "node:path";
40298
+ function getHash(text) {
40299
+ return createHash2("sha256").update(text).digest("hex").substring(0, 8);
40300
+ }
40301
+ function hashHtmlFiles() {
40302
+ return {
40303
+ name: "hash-html-files",
40304
+ enforce: "post",
40305
+ generateBundle(_, bundle) {
40306
+ for (const id of Object.keys(bundle)) {
40307
+ const outputAsset = bundle[id];
40308
+ if (outputAsset?.type === "asset" && extname(outputAsset.fileName) === ".html") {
40309
+ const newFileName = outputAsset.fileName.replace(
40310
+ /(\.html)$/,
40311
+ `.ch.${getHash(outputAsset.source.toString())}.html`
40312
+ );
40313
+ outputAsset.fileName = newFileName;
40314
+ }
40315
+ }
40316
+ }
40317
+ };
40318
+ }
40319
+
40320
+ // src/vite/plugins/exports-custodian.ts
40321
+ init_esm_shims();
40322
+ var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
40323
+ var exportsCustodian = ({ initialModel }) => {
40324
+ const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
40325
+ const virtualSiteComponentPreviewAssets = virtualSiteComponentPreviewScriptAssets(initialModel);
40326
+ const virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(initialModel);
40327
+ return {
40328
+ name: "wix:exports-custodian",
40329
+ apply: "build",
40330
+ resolveId(id) {
40331
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
40332
+ return id;
40333
+ }
40334
+ return null;
40335
+ },
40336
+ load(id) {
40337
+ if (id === EXPORTS_CUSTODIAN_ENTRY) {
40338
+ return [
40339
+ ...virtualSiteComponentAssets.keys(),
40340
+ ...virtualSiteComponentPreviewAssets.keys(),
40341
+ ...virtualSiteComponentPanelAssets.keys()
40342
+ ].map((path9) => `import('${path9}');`).join("\n");
40343
+ }
40344
+ return null;
40345
+ }
40346
+ };
40347
+ };
40348
+
40349
+ // src/vite/configs/build-command/base.ts
40350
+ init_esm_shims();
40351
+ import { join as join6 } from "node:path";
40352
+
40347
40353
  // src/vite/plugins/web-methods-plugin.ts
40348
40354
  init_esm_shims();
40349
40355
  import path5 from "node:path";
@@ -40404,61 +40410,60 @@ function webMethodsPlugin({
40404
40410
  };
40405
40411
  }
40406
40412
 
40407
- // src/vite/plugins/hash-html-files.ts
40413
+ // src/vite/plugins/fbjs-hotfix-plugin.ts
40408
40414
  init_esm_shims();
40409
- import { createHash as createHash2 } from "node:crypto";
40410
- import { extname } from "node:path";
40411
- function getHash(text) {
40412
- return createHash2("sha256").update(text).digest("hex").substring(0, 8);
40413
- }
40414
- function hashHtmlFiles() {
40415
+ function fbjsHotfixPlugin() {
40415
40416
  return {
40416
- name: "hash-html-files",
40417
- enforce: "post",
40418
- generateBundle(_, bundle) {
40419
- for (const id of Object.keys(bundle)) {
40420
- const outputAsset = bundle[id];
40421
- if (outputAsset?.type === "asset" && extname(outputAsset.fileName) === ".html") {
40422
- const newFileName = outputAsset.fileName.replace(
40423
- /(\.html)$/,
40424
- `.ch.${getHash(outputAsset.source.toString())}.html`
40425
- );
40426
- outputAsset.fileName = newFileName;
40427
- }
40417
+ name: "fbjs-hotfix",
40418
+ transform(code, id) {
40419
+ if (id.endsWith("node_modules/fbjs/lib/UnicodeBidi.js")) {
40420
+ return {
40421
+ code: code.replaceAll("\\u17D8", "")
40422
+ };
40428
40423
  }
40424
+ return null;
40429
40425
  }
40430
40426
  };
40431
40427
  }
40432
40428
 
40433
- // src/vite/plugins/exports-custodian.ts
40429
+ // src/vite/plugins/monitoring.ts
40434
40430
  init_esm_shims();
40435
- var EXPORTS_CUSTODIAN_ENTRY = "virtual:wix-exports-custodian-entry";
40436
- var exportsCustodian = ({ initialModel }) => {
40437
- const virtualSiteComponentAssets = virtualSiteComponentScriptAssets(initialModel);
40438
- const virtualSiteComponentPreviewAssets = virtualSiteComponentPreviewScriptAssets(initialModel);
40439
- const virtualSiteComponentPanelAssets = virtualSiteComponentPanelScriptAssets(initialModel);
40440
- return {
40441
- name: "wix:exports-custodian",
40442
- apply: "build",
40443
- resolveId(id) {
40444
- if (id === EXPORTS_CUSTODIAN_ENTRY) {
40445
- return id;
40446
- }
40447
- return null;
40448
- },
40449
- load(id) {
40450
- if (id === EXPORTS_CUSTODIAN_ENTRY) {
40451
- return [
40452
- ...virtualSiteComponentAssets.keys(),
40453
- ...virtualSiteComponentPreviewAssets.keys(),
40454
- ...virtualSiteComponentPanelAssets.keys()
40455
- ].map((path9) => `import('${path9}');`).join("\n");
40456
- }
40457
- return null;
40458
- }
40459
- };
40431
+ var import_monitoring_buildtime2 = __toESM(require_build(), 1);
40432
+
40433
+ // src/app-manifest/monitoring.ts
40434
+ init_esm_shims();
40435
+ var getMonitoringProvider = (monitoring2) => {
40436
+ if ("sentry" in monitoring2) {
40437
+ return {
40438
+ type: MonitoringType.SENTRY,
40439
+ sentryOptions: monitoring2.sentry
40440
+ };
40441
+ }
40442
+ return monitoring2.custom;
40460
40443
  };
40461
40444
 
40445
+ // src/vite/plugins/monitoring.ts
40446
+ function monitoring({ initialModel }) {
40447
+ const { monitoring: monitoring2 } = initialModel.config;
40448
+ if (!monitoring2) {
40449
+ return null;
40450
+ }
40451
+ try {
40452
+ return (0, import_monitoring_buildtime2.getMonitoringVitePlugins)({
40453
+ appId: initialModel.config.appId,
40454
+ silent: true,
40455
+ provider: getMonitoringProvider(monitoring2)
40456
+ });
40457
+ } catch (e) {
40458
+ throw new CliError({
40459
+ cause: e,
40460
+ code: CliErrorCode.FailedToCreateMonitoringVitePlugin({
40461
+ configPath: WIX_CONFIG_FILENAME
40462
+ })
40463
+ });
40464
+ }
40465
+ }
40466
+
40462
40467
  // src/vite/plugins/force-hash-refresh.ts
40463
40468
  init_esm_shims();
40464
40469
  import path6 from "node:path";
@@ -40485,6 +40490,47 @@ var forceHashRefresh = () => {
40485
40490
  };
40486
40491
  };
40487
40492
 
40493
+ // src/vite/configs/build-command/base.ts
40494
+ function getBaseViteConfig({ model, outputDir, customLogger }) {
40495
+ return {
40496
+ configFile: false,
40497
+ root: model.projectFolder,
40498
+ customLogger,
40499
+ clearScreen: false,
40500
+ logLevel: "info",
40501
+ publicDir: false,
40502
+ build: {
40503
+ sourcemap: true,
40504
+ outDir: getAppBuildFolder(model.projectFolder),
40505
+ emptyOutDir: false,
40506
+ rollupOptions: {
40507
+ output: {
40508
+ assetFileNames: join6(outputDir, "assets/[name].ch.[hash][extname]"),
40509
+ chunkFileNames: join6(outputDir, "assets/[name].ch.[hash].js"),
40510
+ entryFileNames: join6(outputDir, "assets/[name].ch.[hash].js")
40511
+ }
40512
+ }
40513
+ },
40514
+ define: {
40515
+ "import.meta.env.BASE_API_URL": JSON.stringify(
40516
+ `${API_BASEURL_PLACEHOLDER}/functions`
40517
+ )
40518
+ },
40519
+ plugins: [
40520
+ webMethodsPlugin({
40521
+ projectFolder: model.projectFolder
40522
+ }),
40523
+ fbjsHotfixPlugin(),
40524
+ monitoring({ initialModel: model }),
40525
+ src_default({
40526
+ ignoreConfigErrors: true,
40527
+ root: model.projectFolder
40528
+ }),
40529
+ forceHashRefresh()
40530
+ ]
40531
+ };
40532
+ }
40533
+
40488
40534
  // src/vite/configs/build-command/browser.ts
40489
40535
  function getViteConfig2(model, options) {
40490
40536
  const virtualDashboardHTMLEntries = [
@@ -40521,17 +40567,13 @@ function getViteConfig2(model, options) {
40521
40567
  const virtualSiteComponentPresetEntries = [
40522
40568
  ...virtualSiteComponentPresetAssets(model)
40523
40569
  ].map(([assetId, assetPath]) => [assetId, assetPath]);
40524
- return {
40525
- configFile: false,
40526
- root: model.projectFolder,
40527
- customLogger: options.customLogger,
40528
- clearScreen: false,
40529
- logLevel: "info",
40530
- publicDir: false,
40531
- server: {},
40570
+ const baseConfig = getBaseViteConfig({
40571
+ ...options,
40572
+ model,
40573
+ outputDir: BROWSER_STATICS_FOLDER
40574
+ });
40575
+ const config = {
40532
40576
  build: {
40533
- sourcemap: true,
40534
- outDir: getAppBuildFolder(model.projectFolder),
40535
40577
  rollupOptions: {
40536
40578
  external: ["@wix/services-manager-react"],
40537
40579
  /*
@@ -40554,24 +40596,10 @@ function getViteConfig2(model, options) {
40554
40596
  ...virtualSiteComponentPresetEntries
40555
40597
  ]),
40556
40598
  ...virtualSiteComponentScriptEntries.length ? { [EXPORTS_CUSTODIAN_ENTRY]: EXPORTS_CUSTODIAN_ENTRY } : {}
40557
- },
40558
- output: {
40559
- assetFileNames: `${BROWSER_STATICS_FOLDER}/assets/[name].ch.[hash][extname]`,
40560
- chunkFileNames: `${BROWSER_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
40561
- entryFileNames: `${BROWSER_STATICS_FOLDER}/assets/[name].ch.[hash].js`
40562
40599
  }
40563
40600
  }
40564
40601
  },
40565
- define: {
40566
- "import.meta.env.BASE_API_URL": JSON.stringify(
40567
- `${API_BASEURL_PLACEHOLDER}/functions`
40568
- )
40569
- },
40570
40602
  plugins: [
40571
- webMethodsPlugin({
40572
- projectFolder: model.projectFolder
40573
- }),
40574
- fbjsHotfixPlugin(),
40575
40603
  moduleBundleBuildBrowser({
40576
40604
  initialModel: model
40577
40605
  }),
@@ -40592,13 +40620,7 @@ function getViteConfig2(model, options) {
40592
40620
  ...options
40593
40621
  }),
40594
40622
  exportsCustodian({ initialModel: model }),
40595
- configExtensionsFileEmitter(model),
40596
- monitoring({ initialModel: model }),
40597
- src_default({
40598
- ignoreConfigErrors: true,
40599
- root: model.projectFolder
40600
- }),
40601
- forceHashRefresh()
40623
+ configExtensionsFileEmitter(model)
40602
40624
  ],
40603
40625
  experimental: {
40604
40626
  /*
@@ -40631,69 +40653,47 @@ function getViteConfig2(model, options) {
40631
40653
  }
40632
40654
  }
40633
40655
  };
40656
+ return mergeConfig(config, baseConfig);
40634
40657
  }
40635
40658
 
40636
40659
  // src/vite/configs/build-command/worker.ts
40637
40660
  init_esm_shims();
40661
+ import { mergeConfig as mergeConfig2 } from "vite";
40638
40662
  function getViteConfig3(model, options) {
40639
40663
  const virtualBlocksScriptEntries = [
40640
40664
  ...virtualBlocksWidgetScriptAssets(model),
40641
40665
  ...virtualBlocksWidgetPanelScriptAssets(model)
40642
40666
  ].map(([assetId, component]) => [`script-asset-${component.id}`, assetId]);
40643
- return {
40644
- configFile: false,
40645
- root: model.projectFolder,
40646
- customLogger: options.customLogger,
40647
- clearScreen: false,
40648
- logLevel: "info",
40649
- publicDir: false,
40650
- server: {},
40667
+ const baseConfig = getBaseViteConfig({
40668
+ ...options,
40669
+ model,
40670
+ outputDir: WORKER_STATICS_FOLDER
40671
+ });
40672
+ const config = {
40651
40673
  ssr: {
40652
40674
  target: "webworker",
40653
40675
  noExternal: true
40654
40676
  },
40655
40677
  build: {
40656
40678
  ssr: true,
40657
- sourcemap: true,
40658
- outDir: getAppBuildFolder(model.projectFolder),
40659
40679
  rollupOptions: {
40660
40680
  input: {
40661
40681
  ...Object.fromEntries(virtualBlocksScriptEntries)
40662
40682
  },
40663
40683
  output: {
40664
- assetFileNames: `${WORKER_STATICS_FOLDER}/assets/[name].ch.[hash][extname]`,
40665
- chunkFileNames: `${WORKER_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
40666
- entryFileNames: `${WORKER_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
40667
40684
  // Need it to preserve shapes of our exports from virtual module bundles
40668
40685
  minifyInternalExports: false
40669
40686
  }
40670
40687
  }
40671
40688
  },
40672
- define: {
40673
- "import.meta.env.BASE_API_URL": JSON.stringify(
40674
- `${API_BASEURL_PLACEHOLDER}/functions`
40675
- )
40676
- },
40677
- plugins: [
40678
- webMethodsPlugin({
40679
- projectFolder: model.projectFolder
40680
- }),
40681
- fbjsHotfixPlugin(),
40682
- moduleBundleBuildWorker({
40683
- initialModel: model
40684
- }),
40685
- monitoring({ initialModel: model }),
40686
- src_default({
40687
- ignoreConfigErrors: true,
40688
- root: model.projectFolder
40689
- }),
40690
- forceHashRefresh()
40691
- ]
40689
+ plugins: [moduleBundleBuildWorker({ initialModel: model })]
40692
40690
  };
40691
+ return mergeConfig2(config, baseConfig);
40693
40692
  }
40694
40693
 
40695
40694
  // src/vite/configs/build-command/ssr.ts
40696
40695
  init_esm_shims();
40696
+ import { mergeConfig as mergeConfig3 } from "vite";
40697
40697
  function getViteConfig4(model, options) {
40698
40698
  const virtualSiteComponentScriptEntries = [
40699
40699
  ...virtualSiteComponentScriptAssets(model)
@@ -40710,56 +40710,32 @@ function getViteConfig4(model, options) {
40710
40710
  ...virtualSiteComponentScriptEntries,
40711
40711
  ...virtualSiteComponentPreviewScriptEntries
40712
40712
  ].map(([entryName, entryPath]) => {
40713
- return {
40714
- configFile: false,
40715
- root: model.projectFolder,
40716
- customLogger: options.customLogger,
40717
- clearScreen: false,
40718
- logLevel: "info",
40719
- publicDir: false,
40720
- server: {},
40713
+ const baseConfig = getBaseViteConfig({
40714
+ ...options,
40715
+ model,
40716
+ outputDir: SSR_STATICS_FOLDER
40717
+ });
40718
+ const config = {
40721
40719
  ssr: {
40722
40720
  target: "node",
40723
40721
  noExternal: true
40724
40722
  },
40725
40723
  build: {
40726
40724
  ssr: true,
40727
- sourcemap: true,
40728
40725
  ssrEmitAssets: true,
40729
- outDir: getAppBuildFolder(model.projectFolder),
40730
- emptyOutDir: false,
40731
40726
  rollupOptions: {
40732
40727
  external: ["react", "react-dom", "@wix/services-manager-react"],
40733
40728
  input: {
40734
40729
  [entryName]: entryPath
40735
40730
  },
40736
40731
  output: {
40737
- assetFileNames: `${SSR_STATICS_FOLDER}/assets/[name].ch.[hash][extname]`,
40738
- chunkFileNames: `${SSR_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
40739
- entryFileNames: `${SSR_STATICS_FOLDER}/assets/[name].ch.[hash].js`,
40740
40732
  inlineDynamicImports: true
40741
40733
  }
40742
40734
  }
40743
40735
  },
40744
- define: {
40745
- "import.meta.env.BASE_API_URL": JSON.stringify(
40746
- `${API_BASEURL_PLACEHOLDER}/functions`
40747
- )
40748
- },
40749
- plugins: [
40750
- webMethodsPlugin({
40751
- projectFolder: model.projectFolder
40752
- }),
40753
- fbjsHotfixPlugin(),
40754
- moduleBundleBuildSsr({ initialModel: model }),
40755
- monitoring({ initialModel: model }),
40756
- src_default({
40757
- ignoreConfigErrors: true,
40758
- root: model.projectFolder
40759
- }),
40760
- forceHashRefresh()
40761
- ]
40736
+ plugins: [moduleBundleBuildSsr({ initialModel: model })]
40762
40737
  };
40738
+ return mergeConfig3(config, baseConfig);
40763
40739
  });
40764
40740
  }
40765
40741
 
@@ -40882,7 +40858,7 @@ function ssl() {
40882
40858
 
40883
40859
  // src/vite/plugins/auto-origin.ts
40884
40860
  init_esm_shims();
40885
- import { dirname as dirname2, isAbsolute as isAbsolute2, join as join6 } from "node:path";
40861
+ import { dirname as dirname2, isAbsolute as isAbsolute2, join as join7 } from "node:path";
40886
40862
  var originPlaceholder = "__WIX_ORIGIN_PLACEHOLDER__";
40887
40863
  function getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress) {
40888
40864
  const url = new URL(assetUrl, viteAddress).href;
@@ -40892,7 +40868,7 @@ function getAbsoluteAssetUrl(originalUrl, assetUrl, viteAddress) {
40892
40868
  if (isAbsolute2(assetUrl)) {
40893
40869
  return url;
40894
40870
  }
40895
- return new URL(join6(dirname2(originalUrl), assetUrl), viteAddress).href;
40871
+ return new URL(join7(dirname2(originalUrl), assetUrl), viteAddress).href;
40896
40872
  }
40897
40873
  function autoOrigin() {
40898
40874
  let viteServer;
@@ -41269,13 +41245,13 @@ init_esm_shims();
41269
41245
  var import_variant4 = __toESM(require_lib(), 1);
41270
41246
  var import_uniqWith = __toESM(require_uniqWith(), 1);
41271
41247
  import { randomUUID as randomUUID3 } from "node:crypto";
41272
- import { dirname as dirname3, join as join7 } from "node:path";
41248
+ import { dirname as dirname3, join as join8 } from "node:path";
41273
41249
  function isTruthy(x) {
41274
41250
  return x != null && x !== false;
41275
41251
  }
41276
41252
  function parseImageField(asset, relativePath) {
41277
41253
  if (RELATIVE_ASSET_PATH_REGEX.test(asset)) {
41278
- return generateUrl(join7(dirname3(`/${relativePath}`), asset));
41254
+ return generateUrl(join8(dirname3(`/${relativePath}`), asset));
41279
41255
  }
41280
41256
  return asset;
41281
41257
  }
@@ -41752,7 +41728,7 @@ async function createAppManifest({
41752
41728
  compType: ComponentType.EDITOR_REACT_COMPONENT,
41753
41729
  compData: {
41754
41730
  editorReactComponent: {
41755
- type: component.elementType ?? `platform.builder.${appId}_${component.id}`,
41731
+ type: component.elementType,
41756
41732
  description: component.description,
41757
41733
  editorElement: {
41758
41734
  ...component.editorElement,
@@ -41806,7 +41782,7 @@ async function createAppManifest({
41806
41782
  // src/app-manifest/component-source.ts
41807
41783
  init_esm_shims();
41808
41784
  var import_variant5 = __toESM(require_lib(), 1);
41809
- import path8, { dirname as dirname4, join as join8 } from "node:path";
41785
+ import path8, { dirname as dirname4, join as join9 } from "node:path";
41810
41786
  import { pathToFileURL as pathToFileURL2 } from "node:url";
41811
41787
 
41812
41788
  // src/app-manifest/build-output-data-extractor.ts
@@ -41919,7 +41895,7 @@ async function getEventDevSlugs(component, backendDevServerUrl) {
41919
41895
  }
41920
41896
  async function getRegisteredExtensions(model) {
41921
41897
  const backendBuildFolder = getAppBackendBuildFolder(model.projectFolder);
41922
- const outputFilepath = join8(
41898
+ const outputFilepath = join9(
41923
41899
  backendBuildFolder,
41924
41900
  "getRegisteredExtensions.mjs"
41925
41901
  );
@@ -42147,14 +42123,14 @@ var siteComponentDevBuilder = (component) => {
42147
42123
  const elements = traverseElementsWithPresetFn(
42148
42124
  component.elements,
42149
42125
  (elementsStructure, presetName, presetConfig) => {
42150
- const elementPath = join8(
42126
+ const elementPath = join9(
42151
42127
  elementsStructure.reduce(
42152
- (acc, elementName) => join8(acc, ELEMENTS_DIR, elementName),
42128
+ (acc, elementName) => join9(acc, ELEMENTS_DIR, elementName),
42153
42129
  ""
42154
42130
  )
42155
42131
  );
42156
42132
  const presetCssUrl = generateUrl(
42157
- join8(
42133
+ join9(
42158
42134
  dirname4(component.relativePath),
42159
42135
  elementPath,
42160
42136
  PRESETS_DIR,
@@ -42177,7 +42153,7 @@ var siteComponentDevBuilder = (component) => {
42177
42153
  const presets = component.presets ? Object.entries(component.presets).reduce(
42178
42154
  (acc, [presetName, presetConfig]) => {
42179
42155
  const presetCssUrl = generateUrl(
42180
- join8(
42156
+ join9(
42181
42157
  dirname4(component.relativePath),
42182
42158
  PRESETS_DIR,
42183
42159
  `${presetName}.css`
@@ -42406,13 +42382,13 @@ function getComponentBuildSourceBuilder(model, browserBuildSource, workerBuildSo
42406
42382
  export {
42407
42383
  getViteConfig,
42408
42384
  getViteServerUrl2 as getViteServerUrl,
42409
- getMonitoringProvider,
42410
- getViteConfig5 as getViteConfig2,
42411
- getViteConfig6 as getViteConfig3,
42412
42385
  readAppManifest,
42413
42386
  updateMonitoring,
42414
42387
  updateTopology,
42415
42388
  updateAppManifestComponents,
42389
+ getMonitoringProvider,
42390
+ getViteConfig5 as getViteConfig2,
42391
+ getViteConfig6 as getViteConfig3,
42416
42392
  getViteConfig2 as getViteConfig4,
42417
42393
  getViteConfig3 as getViteConfig5,
42418
42394
  getViteConfig4 as getViteConfig6,
@@ -42427,4 +42403,4 @@ export {
42427
42403
  he/he.js:
42428
42404
  (*! https://mths.be/he v1.2.0 by @mathias | MIT license *)
42429
42405
  */
42430
- //# sourceMappingURL=chunk-XDVS5U63.js.map
42406
+ //# sourceMappingURL=chunk-2DDAFTMT.js.map