@wix/cli-app 1.1.30 → 1.1.32

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 (94) hide show
  1. package/build/CreateVersionCommand-AKOX3F4R.js +4 -0
  2. package/build/{CreateVersionCommand-NFKBKYN5.js.map → CreateVersionCommand-AKOX3F4R.js.map} +1 -1
  3. package/build/DevCommand-CVMI3OND.js +4 -0
  4. package/build/{DevCommand-CSOEONPY.js.map → DevCommand-CVMI3OND.js.map} +1 -1
  5. package/build/GenerateCommand-57P6KOOM.js +99 -0
  6. package/build/{GenerateCommand-LHTPLGNF.js.map → GenerateCommand-57P6KOOM.js.map} +1 -1
  7. package/build/LogsCommand-P5LW5VOI.js +4 -0
  8. package/build/{LogsCommand-GUWLKR7V.js.map → LogsCommand-P5LW5VOI.js.map} +1 -1
  9. package/build/PreviewCommand-AXFQVFBV.js +4 -0
  10. package/build/ServeCommand-CEFAI6Z4.js +4 -0
  11. package/build/{ServeCommand-PHOYGKPH.js.map → ServeCommand-CEFAI6Z4.js.map} +1 -1
  12. package/build/{build-N3GC2AJW.js → build-ISANKZIW.js} +2 -2
  13. package/build/chunk-6PKE6DT4.js +4 -0
  14. package/build/{chunk-VH4K3U5M.js.map → chunk-6PKE6DT4.js.map} +1 -1
  15. package/build/chunk-A5N3P734.js +4 -0
  16. package/build/{chunk-ZFOHUOI6.js.map → chunk-A5N3P734.js.map} +1 -1
  17. package/build/{chunk-BD6TU75M.js → chunk-ARPIRV47.js} +2 -2
  18. package/build/chunk-BOQ3NCXF.js +4 -0
  19. package/build/{chunk-25SA6SIS.js.map → chunk-BOQ3NCXF.js.map} +1 -1
  20. package/build/{chunk-TTWJWXLR.js → chunk-DPW3BI3Y.js} +2 -2
  21. package/build/chunk-DRRMAC33.js +100 -0
  22. package/build/chunk-DRRMAC33.js.map +1 -0
  23. package/build/chunk-EI7JLTNP.js +4 -0
  24. package/build/{chunk-H6SYLT4B.js.map → chunk-EI7JLTNP.js.map} +1 -1
  25. package/build/chunk-H2U4YHRN.js +4 -0
  26. package/build/{chunk-OR2CAHGP.js.map → chunk-H2U4YHRN.js.map} +1 -1
  27. package/build/chunk-J5ANBYWF.js +11 -0
  28. package/build/chunk-J5ANBYWF.js.map +1 -0
  29. package/build/{chunk-2T5VKPKE.js → chunk-K5V5YWVI.js} +2 -2
  30. package/build/chunk-KWUMJ6JQ.js +4 -0
  31. package/build/{chunk-Q5WWBUFO.js.map → chunk-KWUMJ6JQ.js.map} +1 -1
  32. package/build/chunk-LE2AC3SJ.js +4 -0
  33. package/build/chunk-MDC42U33.js +4 -0
  34. package/build/chunk-MDC42U33.js.map +1 -0
  35. package/build/chunk-MRVGH2GQ.js +4 -0
  36. package/build/{chunk-L3HVHNTA.js.map → chunk-MRVGH2GQ.js.map} +1 -1
  37. package/build/chunk-NXQAYU44.js +116 -0
  38. package/build/chunk-NXQAYU44.js.map +1 -0
  39. package/build/chunk-RPI6ANLU.js +4 -0
  40. package/build/{chunk-AS45KVJN.js.map → chunk-RPI6ANLU.js.map} +1 -1
  41. package/build/{chunk-SQZ5XNZ2.js → chunk-VQJRKVSE.js} +2 -2
  42. package/build/{chunk-SQZ5XNZ2.js.map → chunk-VQJRKVSE.js.map} +1 -1
  43. package/build/{chunk-5QLZSP2U.js → chunk-W2OGV6HU.js} +36 -36
  44. package/build/{chunk-5QLZSP2U.js.map → chunk-W2OGV6HU.js.map} +1 -1
  45. package/build/{chunk-XQLBMLA6.js → chunk-ZRKMSAZQ.js} +3 -3
  46. package/build/{chunk-XQLBMLA6.js.map → chunk-ZRKMSAZQ.js.map} +1 -1
  47. package/build/{chunk-EF6HOPCP.js → chunk-ZSNZ62EG.js} +2 -2
  48. package/build/index.js +2 -2
  49. package/build/index.js.map +1 -1
  50. package/build/preview-ABI3GMT6.js +4 -0
  51. package/build/{preview-QZCCFP23.js.map → preview-ABI3GMT6.js.map} +1 -1
  52. package/build/render-command-F4KJL2DD.js +4 -0
  53. package/build/{render-command-AOEWP2JP.js.map → render-command-F4KJL2DD.js.map} +1 -1
  54. package/package.json +5 -5
  55. package/build/CreateVersionCommand-NFKBKYN5.js +0 -4
  56. package/build/DevCommand-CSOEONPY.js +0 -4
  57. package/build/GenerateCommand-LHTPLGNF.js +0 -99
  58. package/build/LogsCommand-GUWLKR7V.js +0 -4
  59. package/build/PreviewCommand-QAYLTUIX.js +0 -4
  60. package/build/ServeCommand-PHOYGKPH.js +0 -4
  61. package/build/chunk-25SA6SIS.js +0 -4
  62. package/build/chunk-5CHNGZ6H.js +0 -87
  63. package/build/chunk-5CHNGZ6H.js.map +0 -1
  64. package/build/chunk-AS45KVJN.js +0 -4
  65. package/build/chunk-C47JQ5AQ.js +0 -4
  66. package/build/chunk-C47JQ5AQ.js.map +0 -1
  67. package/build/chunk-E74YEX6I.js +0 -11
  68. package/build/chunk-E74YEX6I.js.map +0 -1
  69. package/build/chunk-GFH6QCDG.js +0 -4
  70. package/build/chunk-GFH6QCDG.js.map +0 -1
  71. package/build/chunk-GRIMGGL3.js +0 -4
  72. package/build/chunk-H6SYLT4B.js +0 -4
  73. package/build/chunk-JUS465G2.js +0 -19
  74. package/build/chunk-JUS465G2.js.map +0 -1
  75. package/build/chunk-L3HVHNTA.js +0 -4
  76. package/build/chunk-OR2CAHGP.js +0 -4
  77. package/build/chunk-PEDWEHXR.js +0 -99
  78. package/build/chunk-PEDWEHXR.js.map +0 -1
  79. package/build/chunk-Q5WWBUFO.js +0 -4
  80. package/build/chunk-VH4K3U5M.js +0 -4
  81. package/build/chunk-WZE4EKUX.js +0 -4
  82. package/build/chunk-WZE4EKUX.js.map +0 -1
  83. package/build/chunk-YLBOH353.js +0 -21
  84. package/build/chunk-YLBOH353.js.map +0 -1
  85. package/build/chunk-ZFOHUOI6.js +0 -4
  86. package/build/preview-QZCCFP23.js +0 -4
  87. package/build/render-command-AOEWP2JP.js +0 -4
  88. /package/build/{PreviewCommand-QAYLTUIX.js.map → PreviewCommand-AXFQVFBV.js.map} +0 -0
  89. /package/build/{build-N3GC2AJW.js.map → build-ISANKZIW.js.map} +0 -0
  90. /package/build/{chunk-BD6TU75M.js.map → chunk-ARPIRV47.js.map} +0 -0
  91. /package/build/{chunk-TTWJWXLR.js.map → chunk-DPW3BI3Y.js.map} +0 -0
  92. /package/build/{chunk-2T5VKPKE.js.map → chunk-K5V5YWVI.js.map} +0 -0
  93. /package/build/{chunk-GRIMGGL3.js.map → chunk-LE2AC3SJ.js.map} +0 -0
  94. /package/build/{chunk-EF6HOPCP.js.map → chunk-ZSNZ62EG.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/app-manifest/validate.ts","../src/app-manifest/create.ts","../src/app-manifest/component-source.ts","../src/app-manifest/build-output-data-extractor.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { isType, match } from 'variant';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { CONFIG_FILENAME } from '@wix/cli-core-definitions';\nimport { replaceExtension } from '../dev-center/components/path.js';\nimport type { BackendComponent } from '../dev-center/components/dev-center-component.js';\nimport { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype NonBackendComponent = Exclude<DevCenterComponent, BackendComponent>;\n\nexport const validateComponents = (components: DevCenterComponent[]) => {\n const devCenterComponentsToIdMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n const componentsWithConfig = components.filter(\n (component): component is NonBackendComponent =>\n !isType(component, DevCenterComponent.Api) &&\n !isType(component, DevCenterComponent.Event) &&\n !isType(component, DevCenterComponent.ServicePlugin)\n );\n\n const sortedComponentsById = [...componentsWithConfig].sort((a, b) =>\n a.id.localeCompare(b.id)\n );\n sortedComponentsById.forEach((component) => {\n const componentList = devCenterComponentsToIdMap.get(component.id) ?? [];\n componentList.push(component);\n devCenterComponentsToIdMap.set(component.id, componentList);\n });\n\n const devCenterComponentsWithSameIDMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n devCenterComponentsToIdMap.forEach((devCenterComponents, key) => {\n if (devCenterComponents.length > 1) {\n devCenterComponentsWithSameIDMap.set(key, devCenterComponents);\n }\n });\n\n if (devCenterComponentsWithSameIDMap.size) {\n throw new CliError({\n code: CliErrorCode.DuplicateComponentIdsError({\n issues: Array.from(devCenterComponentsWithSameIDMap.entries()).map(\n ([id, devCenterComponents]) => {\n return {\n id,\n components: devCenterComponents\n .map((component) =>\n match(component, {\n DashboardPage: ({ title, relativePath }) => ({\n name: title,\n type: 'page' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'plugin' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardMenuPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'menu-plugin' as const,\n // We can use the relative path since the path already points to the menu config json\n path: relativePath,\n }),\n DashboardModal: ({ title, relativePath }) => ({\n name: title,\n type: 'modal' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardSidebarCategory: ({ label }) => ({\n name: label,\n type: 'sidebar-category' as const,\n path: CONFIG_FILENAME,\n }),\n EmbeddedScript: ({ relativePath }) => ({\n name: relativePath,\n type: 'embedded-script' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n CustomElement: ({ name, relativePath }) => ({\n name,\n type: 'custom-element' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n Topology: ({ name }) => ({\n name,\n type: 'topology' as const,\n // Topology component doesn't have a config file\n path: '',\n }),\n })\n )\n .sort((a, b) => a.name.localeCompare(b.name)),\n suggestedId: randomUUID(),\n };\n }\n ),\n }),\n });\n }\n};\n","import {\n ComponentType,\n BackOfficeHostingPlatforms,\n EmbeddedScriptPages,\n HeightMode,\n RegionType,\n CustomElementScriptType,\n} from '@wix/ambassador-devcenter-components-v1-component/types';\nimport { match } from 'variant';\nimport { randomUUID } from 'node:crypto';\nimport type {\n AppManifest,\n ComponentExperiment,\n BackofficePage,\n BackofficeExtensionWidget,\n BackofficeExtensionMenuItem,\n BackofficeSideCategory,\n BackofficeModal,\n EmbeddedScript,\n CustomElement,\n Webhook,\n Topology,\n} from '@wix/cli-app-manifest';\nimport { validateComponents } from './validate.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\nimport type { ComponentSourceBuilder } from './component-source.js';\n\ntype CreateAppManifestParams = {\n appId: string;\n backendServerUrl?: string;\n components: DevCenterComponent[];\n sentryDSN?: string;\n componentSourceBuilder: ComponentSourceBuilder;\n};\n\nfunction isTruthy<T>(x: T | undefined | null | false): x is T {\n return x !== undefined && x !== null && x !== false;\n}\n\nconst getExperiment = (\n component: DevCenterComponent<'DashboardPage'>,\n appId: string\n): ComponentExperiment => {\n if (component.experiments) {\n return {\n appId,\n componentId: component.id,\n spec: component.experiments.enabledBy,\n variantValue: 'true',\n };\n }\n return undefined;\n};\n\nexport const createCustomElementConfig = (\n component: DevCenterComponent<'CustomElement'>\n): CustomElement => {\n return {\n compId: component.id,\n compType: ComponentType.CUSTOM_ELEMENT_WIDGET as const,\n compName: component.name,\n compData: {\n customElementWidget: {\n base: {\n name: component.name,\n },\n widgetData: {\n tagName: component.tagName,\n scriptType: CustomElementScriptType.ES_MODULE,\n scriptUrl: 'https://dummy.web.com',\n },\n size: {\n width: {\n defaultWidth: component.width.defaultWidth,\n allowStretch: component.width.allowStretch,\n stretchByDefault: component.width.stretchByDefault,\n },\n height: {\n defaultHeight: component.height.defaultHeight,\n heightMode: HeightMode.FIXED,\n },\n },\n installation: {\n base: {\n autoAdd: component.installation?.autoAddToSite,\n essential: component.installation?.essential,\n maxInstances: component.installation?.essential ? 1 : 0,\n },\n widget: { region: RegionType.BODY },\n },\n behaviors: {},\n dependencies: component.dependencies,\n },\n },\n };\n};\n\nexport async function createAppManifest({\n appId,\n components,\n sentryDSN,\n componentSourceBuilder,\n}: CreateAppManifestParams): Promise<AppManifest> {\n validateComponents(components);\n\n return {\n appId,\n components: (\n await Promise.all(\n components.map(\n match({\n DashboardPage: async (component): Promise<BackofficePage> => {\n const componentSentryDSN = component.sentryDSN ?? sentryDSN;\n return {\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_PAGE as const,\n compData: {\n backOfficePage: {\n hostingPlatform:\n BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n fullPage: component.sidebar?.whenActive?.hideSidebar,\n hideInSidebar: component.sidebar?.disabled,\n priority: component.sidebar?.priority,\n routePath: component.route.slice(1),\n title: component.title,\n pageCategoryId: component.sidebar?.categoryId,\n activeSidebarPageId:\n component.sidebar?.whenActive?.selectedPageId,\n requiredPermission: component.requiredPermission,\n previousRoutePaths: component.additionalRoutes,\n ...(componentSentryDSN\n ? { errorReporting: { url: componentSentryDSN } }\n : undefined),\n ...(await componentSourceBuilder(component)),\n },\n },\n compName: component.title,\n experiment: getExperiment(component, appId),\n };\n },\n DashboardPlugin: async (\n component\n ): Promise<BackofficeExtensionWidget> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_WIDGET as const,\n compData: {\n backOfficeExtensionWidget: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n extends: component.extends,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardMenuPlugin: async (\n component\n ): Promise<BackofficeExtensionMenuItem> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_MENU_ITEM as const,\n compData: {\n backOfficeExtensionMenuItem: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n id: component.id,\n title: component.title,\n subtitle: component.subtitle,\n iconKey: component.iconKey,\n extends: component.extends,\n action: component.action,\n requiredPermission: component.requiredPermission,\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardModal: async (component): Promise<BackofficeModal> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_MODAL as const,\n compData: {\n backOfficeModal: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardSidebarCategory: async (\n component\n ): Promise<BackofficeSideCategory> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_SIDEBAR_CATEGORY as const,\n compData: {\n backOfficeSidebarCategory: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.label,\n priority: component.priority,\n },\n },\n compName: component.label,\n }),\n EmbeddedScript: async (component): Promise<EmbeddedScript> => ({\n compId: component.id,\n compType: ComponentType.EMBEDDED_SCRIPT as const,\n compName: component.name,\n compData: {\n embeddedScriptComponentData: {\n name: component.name,\n pages: EmbeddedScriptPages.NONE_PAGES,\n placement: component.placement,\n connectArticleUrl: '',\n embedCategory: component.scriptType,\n dependencies: component.dependencies,\n loadOnce: true,\n allowedForFreeSite: true,\n ...(await componentSourceBuilder(component)),\n },\n },\n }),\n CustomElement: async (component): Promise<CustomElement> => {\n const { scriptUrl, settingsUrl } = await componentSourceBuilder(\n component\n );\n\n const basicConfig = createCustomElementConfig(component);\n\n return {\n ...basicConfig,\n compData: {\n customElementWidget: {\n ...basicConfig.compData.customElementWidget,\n widgetData: {\n ...basicConfig.compData.customElementWidget.widgetData,\n scriptUrl,\n },\n behaviors: {\n ...basicConfig.compData.customElementWidget.behaviors,\n ...(component.relativePanelPath\n ? { settings: { settingsUrl } }\n : {}),\n },\n },\n },\n };\n },\n Topology: async (component): Promise<Topology> => {\n return {\n compId: component.id,\n compType: ComponentType.TOPOLOGY as const,\n compName: component.name,\n compData: {\n topology: {\n topology: {\n backendApiUrl: component.backendApiUrl,\n },\n },\n },\n };\n },\n Api: () => null,\n Event: async (component): Promise<Array<Webhook>> => {\n const webhookSlugs = await componentSourceBuilder(component);\n\n return webhookSlugs.map(({ webhookSlug }) => ({\n compName: webhookSlug,\n compId: randomUUID(),\n compType: ComponentType.WEBHOOK,\n compData: {\n webhook: {\n callbackUrl: '__WEBHOOKS_URL_PLACEHOLDER__',\n webhookSlug,\n },\n },\n }));\n },\n ServicePlugin: () => null,\n })\n )\n )\n )\n .filter(isTruthy)\n .flat(),\n };\n}\n","import { BackOfficeScriptAssetType } from '@wix/ambassador-devcenter-components-v1-component/types';\nimport type { ComponentSource } from '@wix/cli-app-manifest';\nimport { match } from 'variant';\nimport { join } from 'node:path';\nimport { getAppBackendBuildFolder } from '@wix/cli-app-definitions';\nimport type * as GetRegisteredEvents from '@wix/cli-cloudflare-runtime/getRegisteredEvents';\nimport { getBackendEventSlug } from '@wix/extensions-data-client';\nimport {\n virtualModuleIdForScriptAsset,\n virtualPathForHTMLAsset,\n} from '../dev-center/components/dashboard/config.js';\nimport {\n virtualModuleIdForCustomElementScriptAsset,\n virtualPathForCustomElementPanelHTMLAsset,\n} from '../dev-center/components/site/config.js';\nimport type { ProjectModel } from '../model.js';\nimport type { ViteBuildOutput } from './build-output-data-extractor.js';\nimport {\n extractModuleBundleContent,\n extractModuleBundleName,\n} from './build-output-data-extractor.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype DashboardSource =\n | {\n iframeUrl: string;\n scriptAsset?: never;\n }\n | {\n scriptAsset: ComponentSource['scriptAsset'];\n iframeUrl?: never;\n };\n\ntype EmbeddedScriptSource = {\n template: string;\n};\n\ntype CustomElementSource = { scriptUrl: string; settingsUrl: string };\n\ntype EventSource = {\n webhookSlug: string;\n};\n\nexport type ComponentSourceBuilder = <T extends DevCenterComponent>(\n component: T\n) => Promise<\n T extends DevCenterComponent<'EmbeddedScript'>\n ? EmbeddedScriptSource\n : T extends DevCenterComponent<'CustomElement'>\n ? CustomElementSource\n : T extends DevCenterComponent<'DashboardPage'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardPlugin'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardModal'>\n ? DashboardSource\n : T extends DevCenterComponent<'Event'>\n ? Array<EventSource>\n : undefined\n>;\n\nasync function getEmbeddedScriptDevTemplate(\n component: DevCenterComponent<'EmbeddedScript'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(component.relativePath, backendDevServerUrl).href;\n const devTemplate = await fetch(url).then((res) => res.text());\n\n return devTemplate;\n}\n\nasync function getEventDevSlugs(\n component: DevCenterComponent<'Event'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(`__get-registered-events`, backendDevServerUrl).href;\n const response = await fetch(url);\n\n if (!response.ok) {\n return [];\n }\n\n const eventTypes = await response.json();\n const devSlugs = eventTypes[`/${component.relativePath}`];\n\n return devSlugs as Array<string>;\n}\n\nasync function getEventProdSlugs(\n component: DevCenterComponent<'Event'>,\n model: ProjectModel\n) {\n const backendBuildFolder = getAppBackendBuildFolder(model.projectFolder);\n const outputFilepath = join(backendBuildFolder, 'getRegisteredEvents.mjs');\n\n const { getRegisteredEvents } = await (import(outputFilepath) as Promise<\n typeof GetRegisteredEvents\n >);\n\n const eventsMap = await getRegisteredEvents();\n\n return eventsMap[`/${component.relativePath}`];\n}\n\nconst dashboardSourceBuilder = (\n component:\n | DevCenterComponent<'DashboardPage'>\n | DevCenterComponent<'DashboardPlugin'>\n | DevCenterComponent<'DashboardModal'>,\n model: ProjectModel,\n clientBuildOutput?: ViteBuildOutput\n): DashboardSource => {\n if (!model.config.trusted) {\n return {\n iframeUrl: virtualPathForHTMLAsset(component.id),\n };\n }\n const moduleId = virtualModuleIdForScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptAsset: {\n exportedName: component.id,\n containerId: model.config.appId,\n url: componentUrl,\n scriptType: BackOfficeScriptAssetType.MODULE,\n },\n };\n};\n\nconst embeddedScriptBuilder = async (\n component: DevCenterComponent<'EmbeddedScript'>,\n clientBuildOutput?: ViteBuildOutput,\n devServerUrl?: string\n): Promise<EmbeddedScriptSource> => {\n return {\n template: clientBuildOutput\n ? extractModuleBundleContent(clientBuildOutput, component.relativePath)\n : await getEmbeddedScriptDevTemplate(component, devServerUrl),\n };\n};\n\nconst eventSourceBuilder = async (\n component: DevCenterComponent<'Event'>,\n model: ProjectModel,\n backendBuildOutput?: ViteBuildOutput,\n backendDevServerUrl?: string\n): Promise<Array<EventSource>> => {\n const fullSlugNames = backendBuildOutput\n ? await getEventProdSlugs(component, model)\n : await getEventDevSlugs(component, backendDevServerUrl);\n\n const webhookSlugs = await Promise.all(\n fullSlugNames?.map(getBackendEventSlug)\n );\n\n return webhookSlugs.map((webhookSlug) => ({\n webhookSlug,\n }));\n};\n\nconst customElementBuilder = (\n component: DevCenterComponent<'CustomElement'>,\n clientBuildOutput?: ViteBuildOutput\n): CustomElementSource => {\n const moduleId = virtualModuleIdForCustomElementScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptUrl: componentUrl,\n settingsUrl: virtualPathForCustomElementPanelHTMLAsset(component.id),\n };\n};\n\nexport function getComponentSourceBuilder({\n model,\n clientBuildOutput,\n backendBuildOutput,\n clientDevServerUrl,\n backendDevServerUrl,\n}: {\n model: ProjectModel;\n clientBuildOutput?: ViteBuildOutput;\n backendBuildOutput?: ViteBuildOutput;\n clientDevServerUrl?: string;\n backendDevServerUrl?: string;\n}) {\n return (async (component: DevCenterComponent) => {\n const source = match(component, {\n EmbeddedScript: (embeddedScriptComponent) =>\n embeddedScriptBuilder(\n embeddedScriptComponent,\n clientBuildOutput,\n clientDevServerUrl\n ),\n DashboardSidebarCategory: () => {},\n CustomElement: (customElementComponent) =>\n customElementBuilder(customElementComponent, clientBuildOutput),\n DashboardPage: (dashboardPageComponent) =>\n dashboardSourceBuilder(\n dashboardPageComponent,\n model,\n clientBuildOutput\n ),\n DashboardPlugin: (dashboardPluginComponent) =>\n dashboardSourceBuilder(\n dashboardPluginComponent,\n model,\n clientBuildOutput\n ),\n DashboardModal: (dashboardModalComponent) =>\n dashboardSourceBuilder(\n dashboardModalComponent,\n model,\n clientBuildOutput\n ),\n DashboardMenuPlugin: () => {},\n Topology: () => {},\n Api: () => {},\n Event: (component) =>\n eventSourceBuilder(\n component,\n model,\n backendBuildOutput,\n backendDevServerUrl\n ),\n ServicePlugin: () => {},\n });\n\n return source;\n }) as ComponentSourceBuilder;\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { build } from 'vite';\n\nexport type ViteBuildOutput = Awaited<ReturnType<typeof build>>;\n\nfunction extractBuildOutputs(buildOutput: ViteBuildOutput) {\n const isValidRollupOutput =\n 'output' in buildOutput || Array.isArray(buildOutput);\n\n if (!isValidRollupOutput) {\n throw new CliError({ code: CliErrorCode.InvalidViteBuildOutput() });\n }\n\n const outputs = Array.isArray(buildOutput)\n ? buildOutput.flatMap((output) => output.output)\n : buildOutput.output;\n\n return outputs;\n}\n\nexport function extractModuleBundleName(\n buildOutput: ViteBuildOutput,\n moduleId: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find(\n (output) => output.type === 'chunk' && output.facadeModuleId === moduleId\n );\n\n if (!output) {\n throw new CliError({ code: CliErrorCode.ViteModuleBundleNotFound() });\n }\n\n return output.fileName;\n}\n\nexport function extractModuleBundleContent(\n buildOutput: ViteBuildOutput,\n fileName: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find((output) => output.fileName === fileName);\n\n if (!output || !('source' in output)) {\n throw new CliError({\n code: CliErrorCode.ViteFileNotFoundInOutput({ fileName }),\n });\n }\n\n return output.source.toString();\n}\n"],"mappings":";;uPAAAA,IACA,IAAAC,EAA8B,SAD9B,OAAS,cAAAC,MAAkB,cAUpB,IAAMC,EAAsBC,GAAqC,CACtE,IAAMC,EACJ,IAAI,IASuB,C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M,CAAC,EAC5B,SAAU,IAAM,CAAC,EACjB,IAAK,IAAM,CAAC,EACZ,MAAQd,GACNwB,EACExB,EACAO,EACAkB,EACAxB,CACF,EACF,cAAe,IAAM,CAAC,CACxB,CAAC,CAIL","names":["init_esm_shims","import_variant","randomUUID","validateComponents","components","devCenterComponentsToIdMap","component","DevCenterComponent","a","b","componentList","devCenterComponentsWithSameIDMap","devCenterComponents","key","CliError","CliErrorCode","id","title","relativePath","replaceExtension","label","CONFIG_FILENAME","name","randomUUID","init_esm_shims","import_variant","randomUUID","isTruthy","x","getExperiment","component","appId","createCustomElementConfig","ComponentType","CustomElementScriptType","HeightMode","RegionType","createAppManifest","components","sentryDSN","componentSourceBuilder","validateComponents","componentSentryDSN","BackOfficeHostingPlatforms","EmbeddedScriptPages","scriptUrl","settingsUrl","basicConfig","webhookSlug","randomUUID","init_esm_shims","import_variant","join","init_esm_shims","extractBuildOutputs","buildOutput","CliError","CliErrorCode","output","extractModuleBundleName","moduleId","extractModuleBundleContent","fileName","getEmbeddedScriptDevTemplate","component","backendDevServerUrl","url","res","getEventDevSlugs","response","getEventProdSlugs","model","backendBuildFolder","getAppBackendBuildFolder","outputFilepath","join","getRegisteredEvents","dashboardSourceBuilder","clientBuildOutput","virtualPathForHTMLAsset","moduleId","virtualModuleIdForScriptAsset","componentUrl","extractModuleBundleName","BackOfficeScriptAssetType","embeddedScriptBuilder","devServerUrl","extractModuleBundleContent","eventSourceBuilder","backendBuildOutput","fullSlugNames","getBackendEventSlug","webhookSlug","customElementBuilder","virtualModuleIdForCustomElementScriptAsset","virtualPathForCustomElementPanelHTMLAsset","getComponentSourceBuilder","clientDevServerUrl","embeddedScriptComponent","customElementComponent","dashboardPageComponent","dashboardPluginComponent","dashboardModalComponent"]}
1
+ {"version":3,"sources":["../src/app-manifest/validate.ts","../src/app-manifest/create.ts","../src/app-manifest/component-source.ts","../src/app-manifest/build-output-data-extractor.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport { isType, match } from 'variant';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { CONFIG_FILENAME } from '@wix/cli-core-definitions';\nimport { replaceExtension } from '../dev-center/components/path.js';\nimport type { BackendComponent } from '../dev-center/components/dev-center-component.js';\nimport { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype NonBackendComponent = Exclude<DevCenterComponent, BackendComponent>;\n\nexport const validateComponents = (components: DevCenterComponent[]) => {\n const devCenterComponentsToIdMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n const componentsWithConfig = components.filter(\n (component): component is NonBackendComponent =>\n !isType(component, DevCenterComponent.Api) &&\n !isType(component, DevCenterComponent.Event) &&\n !isType(component, DevCenterComponent.ServicePlugin)\n );\n\n const sortedComponentsById = [...componentsWithConfig].sort((a, b) =>\n a.id.localeCompare(b.id)\n );\n sortedComponentsById.forEach((component) => {\n const componentList = devCenterComponentsToIdMap.get(component.id) ?? [];\n componentList.push(component);\n devCenterComponentsToIdMap.set(component.id, componentList);\n });\n\n const devCenterComponentsWithSameIDMap: Map<string, NonBackendComponent[]> =\n new Map();\n\n devCenterComponentsToIdMap.forEach((devCenterComponents, key) => {\n if (devCenterComponents.length > 1) {\n devCenterComponentsWithSameIDMap.set(key, devCenterComponents);\n }\n });\n\n if (devCenterComponentsWithSameIDMap.size) {\n throw new CliError({\n code: CliErrorCode.DuplicateComponentIdsError({\n issues: Array.from(devCenterComponentsWithSameIDMap.entries()).map(\n ([id, devCenterComponents]) => {\n return {\n id,\n components: devCenterComponents\n .map((component) =>\n match(component, {\n DashboardPage: ({ title, relativePath }) => ({\n name: title,\n type: 'page' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'plugin' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardMenuPlugin: ({ title, relativePath }) => ({\n name: title,\n type: 'menu-plugin' as const,\n // We can use the relative path since the path already points to the menu config json\n path: relativePath,\n }),\n DashboardModal: ({ title, relativePath }) => ({\n name: title,\n type: 'modal' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n DashboardSidebarCategory: ({ label }) => ({\n name: label,\n type: 'sidebar-category' as const,\n path: CONFIG_FILENAME,\n }),\n EmbeddedScript: ({ relativePath }) => ({\n name: relativePath,\n type: 'embedded-script' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n CustomElement: ({ name, relativePath }) => ({\n name,\n type: 'custom-element' as const,\n path: replaceExtension(relativePath, 'json'),\n }),\n Topology: ({ name }) => ({\n name,\n type: 'topology' as const,\n // Topology component doesn't have a config file\n path: '',\n }),\n })\n )\n .sort((a, b) => a.name.localeCompare(b.name)),\n suggestedId: randomUUID(),\n };\n }\n ),\n }),\n });\n }\n};\n","import {\n ComponentType,\n BackOfficeHostingPlatforms,\n EmbeddedScriptPages,\n HeightMode,\n RegionType,\n CustomElementScriptType,\n} from '@wix/ambassador-devcenter-components-v1-component/types';\nimport { match } from 'variant';\nimport { randomUUID } from 'node:crypto';\nimport type {\n AppManifest,\n ComponentExperiment,\n BackofficePage,\n BackofficeExtensionWidget,\n BackofficeExtensionMenuItem,\n BackofficeSideCategory,\n BackofficeModal,\n EmbeddedScript,\n CustomElement,\n Webhook,\n Topology,\n} from '@wix/cli-app-manifest';\nimport { validateComponents } from './validate.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\nimport type { ComponentSourceBuilder } from './component-source.js';\n\ntype CreateAppManifestParams = {\n appId: string;\n backendServerUrl?: string;\n components: DevCenterComponent[];\n sentryDSN?: string;\n componentSourceBuilder: ComponentSourceBuilder;\n};\n\nfunction isTruthy<T>(x: T | undefined | null | false): x is T {\n return x !== undefined && x !== null && x !== false;\n}\n\nconst getExperiment = (\n component: DevCenterComponent<'DashboardPage'>,\n appId: string\n): ComponentExperiment => {\n if (component.experiments) {\n return {\n appId,\n componentId: component.id,\n spec: component.experiments.enabledBy,\n variantValue: 'true',\n };\n }\n return undefined;\n};\n\nexport const createCustomElementConfig = (\n component: DevCenterComponent<'CustomElement'>\n): CustomElement => {\n return {\n compId: component.id,\n compType: ComponentType.CUSTOM_ELEMENT_WIDGET as const,\n compName: component.name,\n compData: {\n customElementWidget: {\n base: {\n name: component.name,\n },\n widgetData: {\n tagName: component.tagName,\n scriptType: CustomElementScriptType.ES_MODULE,\n scriptUrl: 'https://dummy.web.com',\n },\n size: {\n width: {\n defaultWidth: component.width.defaultWidth,\n allowStretch: component.width.allowStretch,\n stretchByDefault: component.width.stretchByDefault,\n },\n height: {\n defaultHeight: component.height.defaultHeight,\n heightMode: HeightMode.FIXED,\n },\n },\n installation: {\n base: {\n autoAdd: component.installation?.autoAddToSite,\n essential: component.installation?.essential,\n maxInstances: component.installation?.essential ? 1 : 0,\n },\n widget: { region: RegionType.BODY },\n },\n behaviors: {},\n dependencies: component.dependencies,\n },\n },\n };\n};\n\nexport async function createAppManifest({\n appId,\n components,\n sentryDSN,\n componentSourceBuilder,\n}: CreateAppManifestParams): Promise<AppManifest> {\n validateComponents(components);\n\n return {\n appId,\n components: (\n await Promise.all(\n components.map(\n match({\n DashboardPage: async (component): Promise<BackofficePage> => {\n const componentSentryDSN = component.sentryDSN ?? sentryDSN;\n return {\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_PAGE as const,\n compData: {\n backOfficePage: {\n hostingPlatform:\n BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n fullPage: component.sidebar?.whenActive?.hideSidebar,\n hideInSidebar: component.sidebar?.disabled,\n priority: component.sidebar?.priority,\n routePath: component.route.slice(1),\n title: component.title,\n pageCategoryId: component.sidebar?.categoryId,\n activeSidebarPageId:\n component.sidebar?.whenActive?.selectedPageId,\n requiredPermission: component.requiredPermission,\n previousRoutePaths: component.additionalRoutes,\n ...(componentSentryDSN\n ? { errorReporting: { url: componentSentryDSN } }\n : undefined),\n ...(await componentSourceBuilder(component)),\n },\n },\n compName: component.title,\n experiment: getExperiment(component, appId),\n };\n },\n DashboardPlugin: async (\n component\n ): Promise<BackofficeExtensionWidget> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_WIDGET as const,\n compData: {\n backOfficeExtensionWidget: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n extends: component.extends,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardMenuPlugin: async (\n component\n ): Promise<BackofficeExtensionMenuItem> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_EXTENSION_MENU_ITEM as const,\n compData: {\n backOfficeExtensionMenuItem: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n id: component.id,\n title: component.title,\n subtitle: component.subtitle,\n iconKey: component.iconKey,\n extends: component.extends,\n action: component.action,\n requiredPermission: component.requiredPermission,\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardModal: async (component): Promise<BackofficeModal> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_MODAL as const,\n compData: {\n backOfficeModal: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.title,\n requiredPermission: component.requiredPermission,\n width: component.width,\n height: component.height,\n ...(await componentSourceBuilder(component)),\n ...(component.sentryDSN\n ? { errorReporting: { url: component.sentryDSN } }\n : undefined),\n },\n },\n compName: component.title,\n }),\n DashboardSidebarCategory: async (\n component\n ): Promise<BackofficeSideCategory> => ({\n compId: component.id,\n compType: ComponentType.BACK_OFFICE_SIDEBAR_CATEGORY as const,\n compData: {\n backOfficeSidebarCategory: {\n hostingPlatform: BackOfficeHostingPlatforms.BUSINESS_MANAGER,\n title: component.label,\n priority: component.priority,\n },\n },\n compName: component.label,\n }),\n EmbeddedScript: async (component): Promise<EmbeddedScript> => ({\n compId: component.id,\n compType: ComponentType.EMBEDDED_SCRIPT as const,\n compName: component.name,\n compData: {\n embeddedScriptComponentData: {\n name: component.name,\n pages: EmbeddedScriptPages.NONE_PAGES,\n placement: component.placement,\n connectArticleUrl: '',\n embedCategory: component.scriptType,\n dependencies: component.dependencies,\n loadOnce: true,\n allowedForFreeSite: true,\n ...(await componentSourceBuilder(component)),\n },\n },\n }),\n CustomElement: async (component): Promise<CustomElement> => {\n const { scriptUrl, settingsUrl } = await componentSourceBuilder(\n component\n );\n\n const basicConfig = createCustomElementConfig(component);\n\n return {\n ...basicConfig,\n compData: {\n customElementWidget: {\n ...basicConfig.compData.customElementWidget,\n widgetData: {\n ...basicConfig.compData.customElementWidget.widgetData,\n scriptUrl,\n },\n behaviors: {\n ...basicConfig.compData.customElementWidget.behaviors,\n ...(component.relativePanelPath\n ? { settings: { settingsUrl } }\n : {}),\n },\n },\n },\n };\n },\n Topology: async (component): Promise<Topology> => {\n return {\n compId: component.id,\n compType: ComponentType.TOPOLOGY as const,\n compName: component.name,\n compData: {\n topology: {\n topology: {\n backendApiUrl: component.backendApiUrl,\n },\n },\n },\n };\n },\n Api: () => null,\n Event: async (component): Promise<Array<Webhook>> => {\n const webhookSlugs = await componentSourceBuilder(component);\n\n return webhookSlugs.map(({ webhookSlug }) => ({\n compName: webhookSlug,\n compId: randomUUID(),\n compType: ComponentType.WEBHOOK,\n compData: {\n webhook: {\n callbackUrl: '__WEBHOOKS_URL_PLACEHOLDER__',\n webhookSlug,\n },\n },\n }));\n },\n ServicePlugin: () => null,\n })\n )\n )\n )\n .filter(isTruthy)\n .flat(),\n };\n}\n","import { BackOfficeScriptAssetType } from '@wix/ambassador-devcenter-components-v1-component/types';\nimport type { ComponentSource } from '@wix/cli-app-manifest';\nimport { match } from 'variant';\nimport { join } from 'node:path';\nimport { getAppBackendBuildFolder } from '@wix/cli-app-definitions';\nimport type * as GetRegisteredEvents from '@wix/cli-cloudflare-runtime/getRegisteredEvents';\nimport { getBackendEventSlug } from '@wix/extensions-data-client';\nimport {\n virtualModuleIdForScriptAsset,\n virtualPathForHTMLAsset,\n} from '../dev-center/components/dashboard/config.js';\nimport {\n virtualModuleIdForCustomElementScriptAsset,\n virtualPathForCustomElementPanelHTMLAsset,\n} from '../dev-center/components/site/config.js';\nimport type { ProjectModel } from '../model.js';\nimport type { ViteBuildOutput } from './build-output-data-extractor.js';\nimport {\n extractModuleBundleContent,\n extractModuleBundleName,\n} from './build-output-data-extractor.js';\nimport type { DevCenterComponent } from '../dev-center/components/dev-center-component.js';\n\ntype DashboardSource =\n | {\n iframeUrl: string;\n scriptAsset?: never;\n }\n | {\n scriptAsset: ComponentSource['scriptAsset'];\n iframeUrl?: never;\n };\n\ntype EmbeddedScriptSource = {\n template: string;\n};\n\ntype CustomElementSource = { scriptUrl: string; settingsUrl: string };\n\ntype EventSource = {\n webhookSlug: string;\n};\n\nexport type ComponentSourceBuilder = <T extends DevCenterComponent>(\n component: T\n) => Promise<\n T extends DevCenterComponent<'EmbeddedScript'>\n ? EmbeddedScriptSource\n : T extends DevCenterComponent<'CustomElement'>\n ? CustomElementSource\n : T extends DevCenterComponent<'DashboardPage'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardPlugin'>\n ? DashboardSource\n : T extends DevCenterComponent<'DashboardModal'>\n ? DashboardSource\n : T extends DevCenterComponent<'Event'>\n ? Array<EventSource>\n : undefined\n>;\n\nasync function getEmbeddedScriptDevTemplate(\n component: DevCenterComponent<'EmbeddedScript'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(component.relativePath, backendDevServerUrl).href;\n const devTemplate = await fetch(url).then((res) => res.text());\n\n return devTemplate;\n}\n\nasync function getEventDevSlugs(\n component: DevCenterComponent<'Event'>,\n backendDevServerUrl?: string\n) {\n const url = new URL(`__get-registered-events`, backendDevServerUrl).href;\n const response = await fetch(url);\n\n if (!response.ok) {\n return [];\n }\n\n const eventTypes = await response.json();\n const devSlugs = eventTypes[`/${component.relativePath}`] ?? [];\n\n return devSlugs as Array<string>;\n}\n\nasync function getEventProdSlugs(\n component: DevCenterComponent<'Event'>,\n model: ProjectModel\n) {\n const backendBuildFolder = getAppBackendBuildFolder(model.projectFolder);\n const outputFilepath = join(backendBuildFolder, 'getRegisteredEvents.mjs');\n\n const { getRegisteredEvents } = await (import(outputFilepath) as Promise<\n typeof GetRegisteredEvents\n >);\n\n const eventsMap = await getRegisteredEvents();\n\n return eventsMap[`/${component.relativePath}`];\n}\n\nconst dashboardSourceBuilder = (\n component:\n | DevCenterComponent<'DashboardPage'>\n | DevCenterComponent<'DashboardPlugin'>\n | DevCenterComponent<'DashboardModal'>,\n model: ProjectModel,\n clientBuildOutput?: ViteBuildOutput\n): DashboardSource => {\n if (!model.config.trusted) {\n return {\n iframeUrl: virtualPathForHTMLAsset(component.id),\n };\n }\n const moduleId = virtualModuleIdForScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptAsset: {\n exportedName: component.id,\n containerId: model.config.appId,\n url: componentUrl,\n scriptType: BackOfficeScriptAssetType.MODULE,\n },\n };\n};\n\nconst embeddedScriptBuilder = async (\n component: DevCenterComponent<'EmbeddedScript'>,\n clientBuildOutput?: ViteBuildOutput,\n devServerUrl?: string\n): Promise<EmbeddedScriptSource> => {\n return {\n template: clientBuildOutput\n ? extractModuleBundleContent(clientBuildOutput, component.relativePath)\n : await getEmbeddedScriptDevTemplate(component, devServerUrl),\n };\n};\n\nconst eventSourceBuilder = async (\n component: DevCenterComponent<'Event'>,\n model: ProjectModel,\n backendBuildOutput?: ViteBuildOutput,\n backendDevServerUrl?: string\n): Promise<Array<EventSource>> => {\n const fullSlugNames = backendBuildOutput\n ? await getEventProdSlugs(component, model)\n : await getEventDevSlugs(component, backendDevServerUrl);\n\n const webhookSlugs = await Promise.all(\n fullSlugNames?.map(getBackendEventSlug)\n );\n\n return webhookSlugs.map((webhookSlug) => ({\n webhookSlug,\n }));\n};\n\nconst customElementBuilder = (\n component: DevCenterComponent<'CustomElement'>,\n clientBuildOutput?: ViteBuildOutput\n): CustomElementSource => {\n const moduleId = virtualModuleIdForCustomElementScriptAsset(component.id);\n const componentUrl = clientBuildOutput\n ? extractModuleBundleName(clientBuildOutput, moduleId)\n : `/@id/${moduleId}?import`;\n\n return {\n scriptUrl: componentUrl,\n settingsUrl: virtualPathForCustomElementPanelHTMLAsset(component.id),\n };\n};\n\nexport function getComponentSourceBuilder({\n model,\n clientBuildOutput,\n backendBuildOutput,\n clientDevServerUrl,\n backendDevServerUrl,\n}: {\n model: ProjectModel;\n clientBuildOutput?: ViteBuildOutput;\n backendBuildOutput?: ViteBuildOutput;\n clientDevServerUrl?: string;\n backendDevServerUrl?: string;\n}) {\n return (async (component: DevCenterComponent) => {\n const source = match(component, {\n EmbeddedScript: (embeddedScriptComponent) =>\n embeddedScriptBuilder(\n embeddedScriptComponent,\n clientBuildOutput,\n clientDevServerUrl\n ),\n DashboardSidebarCategory: () => {},\n CustomElement: (customElementComponent) =>\n customElementBuilder(customElementComponent, clientBuildOutput),\n DashboardPage: (dashboardPageComponent) =>\n dashboardSourceBuilder(\n dashboardPageComponent,\n model,\n clientBuildOutput\n ),\n DashboardPlugin: (dashboardPluginComponent) =>\n dashboardSourceBuilder(\n dashboardPluginComponent,\n model,\n clientBuildOutput\n ),\n DashboardModal: (dashboardModalComponent) =>\n dashboardSourceBuilder(\n dashboardModalComponent,\n model,\n clientBuildOutput\n ),\n DashboardMenuPlugin: () => {},\n Topology: () => {},\n Api: () => {},\n Event: (component) =>\n eventSourceBuilder(\n component,\n model,\n backendBuildOutput,\n backendDevServerUrl\n ),\n ServicePlugin: () => {},\n });\n\n return source;\n }) as ComponentSourceBuilder;\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { build } from 'vite';\n\nexport type ViteBuildOutput = Awaited<ReturnType<typeof build>>;\n\nfunction extractBuildOutputs(buildOutput: ViteBuildOutput) {\n const isValidRollupOutput =\n 'output' in buildOutput || Array.isArray(buildOutput);\n\n if (!isValidRollupOutput) {\n throw new CliError({ code: CliErrorCode.InvalidViteBuildOutput() });\n }\n\n const outputs = Array.isArray(buildOutput)\n ? buildOutput.flatMap((output) => output.output)\n : buildOutput.output;\n\n return outputs;\n}\n\nexport function extractModuleBundleName(\n buildOutput: ViteBuildOutput,\n moduleId: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find(\n (output) => output.type === 'chunk' && output.facadeModuleId === moduleId\n );\n\n if (!output) {\n throw new CliError({ code: CliErrorCode.ViteModuleBundleNotFound() });\n }\n\n return output.fileName;\n}\n\nexport function extractModuleBundleContent(\n buildOutput: ViteBuildOutput,\n fileName: string\n) {\n const outputs = extractBuildOutputs(buildOutput);\n\n const output = outputs.find((output) => output.fileName === fileName);\n\n if (!output || !('source' in output)) {\n throw new CliError({\n code: CliErrorCode.ViteFileNotFoundInOutput({ fileName }),\n });\n }\n\n return output.source.toString();\n}\n"],"mappings":";;8PAAAA,IACA,IAAAC,EAA8B,SAD9B,OAAS,cAAAC,MAAkB,cAUpB,IAAMC,EAAsBC,GAAqC,CACtE,IAAMC,EACJ,IAAI,IASuB,CAAC,GAPDD,EAAW,OACrCE,GACC,IAAC,UAAOA,EAAWC,EAAmB,GAAG,GACzC,IAAC,UAAOD,EAAWC,EAAmB,KAAK,GAC3C,IAAC,UAAOD,EAAWC,EAAmB,aAAa,CACvD,CAEqD,EAAE,KAAK,CAACC,EAAGC,IAC9DD,EAAE,GAAG,cAAcC,EAAE,EAAE,CACzB,EACqB,QAASH,GAAc,CAC1C,IAAMI,EAAgBL,EAA2B,IAAIC,EAAU,EAAE,GAAK,CAAC,EACvEI,EAAc,KAAKJ,CAAS,EAC5BD,EAA2B,IAAIC,EAAU,GAAII,CAAa,CAC5D,CAAC,EAED,IAAMC,EACJ,IAAI,IAQN,GANAN,EAA2B,QAAQ,CAACO,EAAqBC,IAAQ,CAC3DD,EAAoB,OAAS,GAC/BD,EAAiC,IAAI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CAAmB,EAMzD,OAJqB,MAAM,QAAQ,IACjCyB,GAAe,IAAIC,CAAmB,CACxC,GAEoB,IAAKC,IAAiB,CACxC,YAAAA,CACF,EAAE,CACJ,EAEMC,EAAuB,CAC3B7B,EACAc,IACwB,CACxB,IAAME,EAAWc,EAA2C9B,EAAU,EAAE,EAKxE,MAAO,CACL,UALmBc,EACjBK,EAAwBL,EAAmBE,CAAQ,EACnD,QAAQA,CAAQ,UAIlB,YAAae,EAA0C/B,EAAU,EAAE,CACrE,CACF,EAEO,SAASgC,GAA0B,CACxC,MAAAzB,EACA,kBAAAO,EACA,mBAAAW,EACA,mBAAAQ,EACA,oBAAAhC,CACF,EAMG,CACD,MAAQ,OAAOD,MACE,SAAMA,EAAW,CAC9B,eAAiBkC,GACfb,EACEa,EACApB,EACAmB,CACF,EACF,yBAA0B,IAAM,CAAC,EACjC,cAAgBE,GACdN,EAAqBM,EAAwBrB,CAAiB,EAChE,cAAgBsB,GACdvB,EACEuB,EACA7B,EACAO,CACF,EACF,gBAAkBuB,GAChBxB,EACEwB,EACA9B,EACAO,CACF,EACF,eAAiBwB,GACfzB,EACEyB,EACA/B,EACAO,CACF,EACF,oBAAqB,IAAM,CAAC,EAC5B,SAAU,IAAM,CAAC,EACjB,IAAK,IAAM,CAAC,EACZ,MAAQd,GACNwB,EACExB,EACAO,EACAkB,EACAxB,CACF,EACF,cAAe,IAAM,CAAC,CACxB,CAAC,CAIL","names":["init_esm_shims","import_variant","randomUUID","validateComponents","components","devCenterComponentsToIdMap","component","DevCenterComponent","a","b","componentList","devCenterComponentsWithSameIDMap","devCenterComponents","key","CliError","CliErrorCode","id","title","relativePath","replaceExtension","label","CONFIG_FILENAME","name","randomUUID","init_esm_shims","import_variant","randomUUID","isTruthy","x","getExperiment","component","appId","createCustomElementConfig","ComponentType","CustomElementScriptType","HeightMode","RegionType","createAppManifest","components","sentryDSN","componentSourceBuilder","validateComponents","componentSentryDSN","BackOfficeHostingPlatforms","EmbeddedScriptPages","scriptUrl","settingsUrl","basicConfig","webhookSlug","randomUUID","init_esm_shims","import_variant","join","init_esm_shims","extractBuildOutputs","buildOutput","CliError","CliErrorCode","output","extractModuleBundleName","moduleId","extractModuleBundleContent","fileName","getEmbeddedScriptDevTemplate","component","backendDevServerUrl","url","res","getEventDevSlugs","response","getEventProdSlugs","model","backendBuildFolder","getAppBackendBuildFolder","outputFilepath","join","getRegisteredEvents","dashboardSourceBuilder","clientBuildOutput","virtualPathForHTMLAsset","moduleId","virtualModuleIdForScriptAsset","componentUrl","extractModuleBundleName","BackOfficeScriptAssetType","embeddedScriptBuilder","devServerUrl","extractModuleBundleContent","eventSourceBuilder","backendBuildOutput","fullSlugNames","getBackendEventSlug","webhookSlug","customElementBuilder","virtualModuleIdForCustomElementScriptAsset","virtualPathForCustomElementPanelHTMLAsset","getComponentSourceBuilder","clientDevServerUrl","embeddedScriptComponent","customElementComponent","dashboardPageComponent","dashboardPluginComponent","dashboardModalComponent"]}
@@ -1,4 +1,4 @@
1
1
  import { createRequire as _createRequire } from 'node:module';
2
2
  const require = _createRequire(import.meta.url);
3
- import{b as p}from"./chunk-VH4K3U5M.js";import{b as r,c as i}from"./chunk-Q5WWBUFO.js";import{h as o}from"./chunk-V4TR6DCM.js";o();var M=async({model:e,arm:a,serveUrl:n,backendServerUrl:t,topologyComponentId:s})=>{let l=await p(e.projectFolder),m=i(r(l,n,t),{id:s,baseApiUrl:t});return a.createAppRelease(m,e.config.projectId)};export{M as a};
4
- //# sourceMappingURL=chunk-TTWJWXLR.js.map
3
+ import{b as p}from"./chunk-6PKE6DT4.js";import{b as r,c as i}from"./chunk-KWUMJ6JQ.js";import{h as o}from"./chunk-V4TR6DCM.js";o();var M=async({model:e,arm:a,serveUrl:n,backendServerUrl:t,topologyComponentId:s})=>{let l=await p(e.projectFolder),m=i(r(l,n,t),{id:s,baseApiUrl:t});return a.createAppRelease(m,e.config.projectId)};export{M as a};
4
+ //# sourceMappingURL=chunk-DPW3BI3Y.js.map