@wix/cli-app 1.1.3 → 1.1.4

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 (92) hide show
  1. package/build/CreateVersionCommand-GQGVJR2K.js +4 -0
  2. package/build/CreateVersionCommand-GQGVJR2K.js.map +1 -0
  3. package/build/DevCommand-YM45UVWH.js +4 -0
  4. package/build/DevCommand-YM45UVWH.js.map +1 -0
  5. package/build/PreviewCommand-YUT7MBJD.js +4 -0
  6. package/build/ServeCommand-6EQIDSKT.js +4 -0
  7. package/build/ServeCommand-6EQIDSKT.js.map +1 -0
  8. package/build/build-2Z6AK6IG.js +4 -0
  9. package/build/build-2Z6AK6IG.js.map +1 -0
  10. package/build/chunk-4G4S755D.js +4 -0
  11. package/build/chunk-4G4S755D.js.map +1 -0
  12. package/build/chunk-5575RXZG.js +4 -0
  13. package/build/chunk-5575RXZG.js.map +1 -0
  14. package/build/chunk-ACRXISY6.js +23 -0
  15. package/build/chunk-ACRXISY6.js.map +1 -0
  16. package/build/{chunk-7T43YDHD.js → chunk-DA3635LY.js} +2 -2
  17. package/build/{chunk-GAEEULSA.js → chunk-DF4D5JWF.js} +2 -2
  18. package/build/{chunk-HMJ5TWEC.js → chunk-EIA66VA3.js} +59 -38
  19. package/build/chunk-EIA66VA3.js.map +1 -0
  20. package/build/chunk-ETUINW6P.js +11 -0
  21. package/build/chunk-ETUINW6P.js.map +1 -0
  22. package/build/chunk-JZGJM7PY.js +108 -0
  23. package/build/chunk-JZGJM7PY.js.map +1 -0
  24. package/build/chunk-MWPJ22NN.js +4 -0
  25. package/build/chunk-MWPJ22NN.js.map +1 -0
  26. package/build/{chunk-7PCCZH2Q.js → chunk-NTAE6I4M.js} +2 -2
  27. package/build/{chunk-BJOLH7YC.js → chunk-Q2OX64Q5.js} +2 -2
  28. package/build/{chunk-UO6ED7UB.js → chunk-SHI7GZUR.js} +2 -2
  29. package/build/chunk-VMFKU4BM.js +75 -0
  30. package/build/chunk-VMFKU4BM.js.map +1 -0
  31. package/build/chunk-VMK5HC33.js +4 -0
  32. package/build/chunk-VMK5HC33.js.map +1 -0
  33. package/build/{chunk-SGABAIB5.js → chunk-ZYZVQVJV.js} +2 -2
  34. package/build/devtools-SH22YG5Z.js +10 -0
  35. package/build/devtools-SH22YG5Z.js.map +1 -0
  36. package/build/index.js +1 -1
  37. package/build/index.js.map +1 -1
  38. package/build/preview-4C3FDYR4.js +4 -0
  39. package/build/preview-4C3FDYR4.js.map +1 -0
  40. package/build/render-command-EB3I47CB.js +4 -0
  41. package/build/render-command-EB3I47CB.js.map +1 -0
  42. package/internal/component-hmr-wrapper.tsx +63 -0
  43. package/package.json +9 -6
  44. package/build/CreateVersionCommand-PIV2LH7B.js +0 -4
  45. package/build/CreateVersionCommand-PIV2LH7B.js.map +0 -1
  46. package/build/DevCommand-UIDNUWIP.js +0 -4
  47. package/build/DevCommand-UIDNUWIP.js.map +0 -1
  48. package/build/PreviewCommand-UKHGM3U7.js +0 -4
  49. package/build/ServeCommand-JX2AYHNK.js +0 -4
  50. package/build/ServeCommand-JX2AYHNK.js.map +0 -1
  51. package/build/SiteIdProvider-UIS4BKVC.js +0 -4
  52. package/build/SiteIdProvider-UIS4BKVC.js.map +0 -1
  53. package/build/build-X5PQLJYY.js +0 -4
  54. package/build/build-X5PQLJYY.js.map +0 -1
  55. package/build/chunk-44TZXTHO.js +0 -4
  56. package/build/chunk-44TZXTHO.js.map +0 -1
  57. package/build/chunk-7PDV5QDK.js +0 -4
  58. package/build/chunk-7PDV5QDK.js.map +0 -1
  59. package/build/chunk-7XQUV5HO.js +0 -4
  60. package/build/chunk-7XQUV5HO.js.map +0 -1
  61. package/build/chunk-AWOTQVII.js +0 -4
  62. package/build/chunk-AWOTQVII.js.map +0 -1
  63. package/build/chunk-BOTVIAFU.js +0 -4
  64. package/build/chunk-BOTVIAFU.js.map +0 -1
  65. package/build/chunk-BQW2QNTV.js +0 -4
  66. package/build/chunk-BQW2QNTV.js.map +0 -1
  67. package/build/chunk-BXSRILE5.js +0 -4
  68. package/build/chunk-BXSRILE5.js.map +0 -1
  69. package/build/chunk-EICHKHNE.js +0 -7
  70. package/build/chunk-EICHKHNE.js.map +0 -1
  71. package/build/chunk-GXCVI5BG.js +0 -75
  72. package/build/chunk-GXCVI5BG.js.map +0 -1
  73. package/build/chunk-HMJ5TWEC.js.map +0 -1
  74. package/build/chunk-NQPO4DHF.js +0 -106
  75. package/build/chunk-NQPO4DHF.js.map +0 -1
  76. package/build/chunk-UFOJJCTK.js +0 -4
  77. package/build/chunk-UFOJJCTK.js.map +0 -1
  78. package/build/chunk-XD45SKTN.js +0 -23
  79. package/build/chunk-XD45SKTN.js.map +0 -1
  80. package/build/devtools-D522YHXH.js +0 -10
  81. package/build/devtools-D522YHXH.js.map +0 -1
  82. package/build/preview-5ELYGXV7.js +0 -4
  83. package/build/preview-5ELYGXV7.js.map +0 -1
  84. package/build/render-command-VECNS26S.js +0 -4
  85. package/build/render-command-VECNS26S.js.map +0 -1
  86. /package/build/{PreviewCommand-UKHGM3U7.js.map → PreviewCommand-YUT7MBJD.js.map} +0 -0
  87. /package/build/{chunk-7T43YDHD.js.map → chunk-DA3635LY.js.map} +0 -0
  88. /package/build/{chunk-GAEEULSA.js.map → chunk-DF4D5JWF.js.map} +0 -0
  89. /package/build/{chunk-7PCCZH2Q.js.map → chunk-NTAE6I4M.js.map} +0 -0
  90. /package/build/{chunk-BJOLH7YC.js.map → chunk-Q2OX64Q5.js.map} +0 -0
  91. /package/build/{chunk-UO6ED7UB.js.map → chunk-SHI7GZUR.js.map} +0 -0
  92. /package/build/{chunk-SGABAIB5.js.map → chunk-ZYZVQVJV.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/non-interactive/preview/index.ts","../src/non-interactive/preview/preview.ts","../src/non-interactive/preview/resolve-site-id.ts","../src/non-interactive/logger.ts"],"sourcesContent":["export { nonInteractivePreview } from './preview.js';\n","import { cwd } from 'node:process';\nimport { ARMClient } from '@wix/arm-client';\nimport { isLoggedInToAccount } from '@wix/cli-auth';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { addUserFields } from '@wix/cli-telemetry';\nimport { createHttpClient } from '@wix/cli-http-client';\nimport type { CommandServices } from '@wix/cli-command-contract';\nimport { loadProjectModel } from '../../model.js';\nimport { createPreviewTag } from '../../preview/create-preview-tag.js';\nimport { uploadApplication } from '../../hosting/upload-application.js';\nimport { resolveSiteId } from './resolve-site-id.js';\nimport { log } from '../logger.js';\n\nexport async function nonInteractivePreview(\n options: { site?: string; baseUrl?: string },\n services: CommandServices\n) {\n const model = await loadProjectModel(cwd());\n const authData = await isLoggedInToAccount();\n\n if (!authData) {\n throw new CliError({\n code: CliErrorCode.AuthenticationRequired(),\n });\n }\n\n services.errorReporter.setUser({ id: authData.userInfo.userId });\n addUserFields(services.biLogger, authData.userInfo.userId);\n\n const httpClient = createHttpClient({\n type: 'backoffice',\n getAppToken: () => authData.getAccessToken(),\n });\n\n const siteId = options.site ?? (await resolveSiteId(model, httpClient));\n const serveUrl =\n options.baseUrl ??\n (await uploadApplication(\n model.config.appId,\n model.projectFolder,\n services.biLogger,\n httpClient\n ));\n\n const arm = new ARMClient(httpClient);\n\n const { dashboardPageUrl } = await createPreviewTag({\n model,\n siteId,\n arm,\n serveUrl,\n });\n\n log(dashboardPageUrl);\n}\n","import { match } from 'variant';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { SiteListClient } from '@wix/site-list-client';\nimport type { HttpClient } from '@wix/cli-http-client';\nimport type { ProjectModel } from '../../model.js';\nimport { resolveConfiguredSite } from '../../site-id/resolve-configured-site.js';\n\nexport async function resolveSiteId(\n model: ProjectModel,\n httpClient: HttpClient\n) {\n const siteListClient = new SiteListClient(httpClient);\n\n const site = await resolveConfiguredSite({\n projectFolder: model.projectFolder,\n siteListClient,\n });\n\n return match(site, {\n NotConfigured: () => {\n throw new CliError({\n code: CliErrorCode.SiteConfiguredRequired(),\n });\n },\n NotFound: () => {\n throw new CliError({\n code: CliErrorCode.SiteConfiguredRequired(),\n });\n },\n Resolved: ({ site }) => site.id,\n });\n}\n","export function log(message: string) {\n // eslint-disable-next-line no-console\n console.log(message);\n}\n"],"mappings":";;6ZAAAA,ICAAC,IAAA,OAAS,OAAAC,MAAW,eCApBC,IAAA,IAAAC,EAAsB,SAOtB,eAAsBC,EACpBC,EACAC,EACA,CACA,IAAMC,EAAiB,IAAIC,EAAeF,CAAU,EAE9CG,EAAO,MAAMC,EAAsB,CACvC,cAAeL,EAAM,cACrB,eAAAE,CACF,CAAC,EAED,SAAO,SAAME,EAAM,CACjB,cAAe,IAAM,CACnB,MAAM,IAAIE,EAAS,CACjB,KAAMC,EAAa,uBAAuB,CAC5C,CAAC,CACH,EACA,SAAU,IAAM,CACd,MAAM,IAAID,EAAS,CACjB,KAAMC,EAAa,uBAAuB,CAC5C,CAAC,CACH,EACA,SAAU,CAAC,CAAE,KAAAH,CAAK,IAAMA,EAAK,EAC/B,CAAC,CACH,CC/BAI,IAAO,SAASC,EAAIC,EAAiB,CAEnC,QAAQ,IAAIA,CAAO,CACrB,CFUA,eAAsBC,EACpBC,EACAC,EACA,CACA,IAAMC,EAAQ,MAAMC,EAAiBC,EAAI,CAAC,EACpCC,EAAW,MAAMC,EAAoB,EAE3C,GAAI,CAACD,EACH,MAAM,IAAIE,EAAS,CACjB,KAAMC,EAAa,uBAAuB,CAC5C,CAAC,EAGHP,EAAS,cAAc,QAAQ,CAAE,GAAII,EAAS,SAAS,MAAO,CAAC,EAC/DI,EAAcR,EAAS,SAAUI,EAAS,SAAS,MAAM,EAEzD,IAAMK,EAAaC,EAAiB,CAClC,KAAM,aACN,YAAa,IAAMN,EAAS,eAAe,CAC7C,CAAC,EAEKO,EAASZ,EAAQ,MAAS,MAAMa,EAAcX,EAAOQ,CAAU,EAC/DI,EACJd,EAAQ,SACP,MAAMe,EACLb,EAAM,OAAO,MACbA,EAAM,cACND,EAAS,SACTS,CACF,EAEIM,EAAM,IAAIC,EAAUP,CAAU,EAE9B,CAAE,iBAAAQ,CAAiB,EAAI,MAAMC,EAAiB,CAClD,MAAAjB,EACA,OAAAU,EACA,IAAAI,EACA,SAAAF,CACF,CAAC,EAEDM,EAAIF,CAAgB,CACtB","names":["init_esm_shims","init_esm_shims","cwd","init_esm_shims","import_variant","resolveSiteId","model","httpClient","siteListClient","SiteListClient","site","resolveConfiguredSite","CliError","CliErrorCode","init_esm_shims","log","message","nonInteractivePreview","options","services","model","loadProjectModel","cwd","authData","isLoggedInToAccount","CliError","CliErrorCode","addUserFields","httpClient","createHttpClient","siteId","resolveSiteId","serveUrl","uploadApplication","arm","ARMClient","dashboardPageUrl","createPreviewTag","log"]}
@@ -1,4 +0,0 @@
1
- import { createRequire as _createRequire } from 'node:module';
2
- const require = _createRequire(import.meta.url);
3
- import{a as p,b as I}from"./chunk-EICHKHNE.js";import{a as g}from"./chunk-7PCCZH2Q.js";import{a as h,b as C}from"./chunk-UO6ED7UB.js";import{D as s,I as f,J as l,S as v,U as u}from"./chunk-NQPO4DHF.js";import{$ as n,aa as w,t as P}from"./chunk-GXCVI5BG.js";import{h as c}from"./chunk-HFDLXX7R.js";c();import{cwd as y}from"node:process";import e from"react";async function F({biLogger:t,errorReporter:r}){let o=await n(y());r.setContext("app info",{appId:o.config.appId,...o.config.projectId?{projectId:o.config.projectId}:{}}),t.updateDefaults({_appId:o.config.appId})}async function H(t,{biLogger:r,errorReporter:o},i,m){await L(t,{biLogger:r,errorReporter:o},async()=>{let a=await n(y()),j=P(a.projectFolder);await s(e.createElement(l,{value:r},e.createElement(v,{value:o},e.createElement(u,{onLogin:d=>{o.setUser({id:d.userId}),h(r,d.userId)}},e.createElement(f,{messages:I},e.createElement(g,{filePath:j},e.createElement(w,{value:a,watchForChanges:m?.watchForModelChanges},i)))))))})}async function L(t,r,o){await F(r);let i=C({biLogger:r.biLogger,command:t,cliVersion:p,flow:"Apps"});try{await o(),i.succeed()}catch(m){throw i.failed(m),m}}export{H as renderCommand,L as runCommand};
4
- //# sourceMappingURL=render-command-VECNS26S.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/commands/render-command.tsx"],"sourcesContent":["import { cwd } from 'node:process';\nimport React, { type ReactElement } from 'react';\nimport { AccountAuthProvider, type UserInfo } from '@wix/cli-auth';\nimport { render } from '@wix/cli-ui-kit';\nimport { I18nProvider } from '@wix/cli-i18n';\nimport { DebugLogProvider } from '@wix/cli-debug-log';\nimport { getDebugLogFilePath } from '@wix/cli-core-definitions';\nimport { ErrorReporterProvider } from '@wix/cli-error-reporting';\nimport { BiProvider } from '@wix/cli-telemetry-react';\nimport { addUserFields, reportCommandStartEvent } from '@wix/cli-telemetry';\nimport type { CommandServices } from '@wix/cli-command-contract';\nimport type { Command } from '@commander-js/extra-typings';\nimport { loadProjectModel, ProjectModelProvider } from '../model.js';\nimport messages from '../messages.json';\nimport { version } from '../../package.json';\n\ninterface Options {\n watchForModelChanges?: boolean;\n}\n\nasync function initServices({ biLogger, errorReporter }: CommandServices) {\n const model = await loadProjectModel(cwd());\n\n errorReporter.setContext('app info', {\n appId: model.config.appId,\n ...(model.config.projectId ? { projectId: model.config.projectId } : {}),\n });\n\n biLogger.updateDefaults({\n _appId: model.config.appId,\n });\n}\n\nexport async function renderCommand(\n command: Command,\n { biLogger, errorReporter }: CommandServices,\n tree: ReactElement,\n options?: Options\n) {\n await runCommand(command, { biLogger, errorReporter }, async () => {\n const model = await loadProjectModel(cwd());\n const debugLogFilePath = getDebugLogFilePath(model.projectFolder);\n\n const handleLogin = (userInfo: UserInfo) => {\n errorReporter.setUser({ id: userInfo.userId });\n addUserFields(biLogger, userInfo.userId);\n };\n\n await render(\n <BiProvider value={biLogger}>\n <ErrorReporterProvider value={errorReporter}>\n <AccountAuthProvider onLogin={handleLogin}>\n <I18nProvider messages={messages}>\n <DebugLogProvider filePath={debugLogFilePath}>\n <ProjectModelProvider\n value={model}\n watchForChanges={options?.watchForModelChanges}\n >\n {tree}\n </ProjectModelProvider>\n </DebugLogProvider>\n </I18nProvider>\n </AccountAuthProvider>\n </ErrorReporterProvider>\n </BiProvider>\n );\n });\n}\n\nexport async function runCommand(\n command: Command,\n services: CommandServices,\n commandFn: () => Promise<void>\n) {\n await initServices(services);\n\n const commandStatus = reportCommandStartEvent({\n biLogger: services.biLogger,\n command,\n cliVersion: version,\n flow: 'Apps',\n });\n\n try {\n await commandFn();\n commandStatus.succeed();\n } catch (e) {\n commandStatus.failed(e);\n throw e;\n }\n}\n"],"mappings":";;ySAAAA,IAAA,OAAS,OAAAC,MAAW,eACpB,OAAOC,MAAkC,QAmBzC,eAAeC,EAAa,CAAE,SAAAC,EAAU,cAAAC,CAAc,EAAoB,CACxE,IAAMC,EAAQ,MAAMC,EAAiBC,EAAI,CAAC,EAE1CH,EAAc,WAAW,WAAY,CACnC,MAAOC,EAAM,OAAO,MACpB,GAAIA,EAAM,OAAO,UAAY,CAAE,UAAWA,EAAM,OAAO,SAAU,EAAI,CAAC,CACxE,CAAC,EAEDF,EAAS,eAAe,CACtB,OAAQE,EAAM,OAAO,KACvB,CAAC,CACH,CAEA,eAAsBG,EACpBC,EACA,CAAE,SAAAN,EAAU,cAAAC,CAAc,EAC1BM,EACAC,EACA,CACA,MAAMC,EAAWH,EAAS,CAAE,SAAAN,EAAU,cAAAC,CAAc,EAAG,SAAY,CACjE,IAAMC,EAAQ,MAAMC,EAAiBC,EAAI,CAAC,EACpCM,EAAmBC,EAAoBT,EAAM,aAAa,EAOhE,MAAMU,EACJC,EAAA,cAACC,EAAA,CAAW,MAAOd,GACjBa,EAAA,cAACE,EAAA,CAAsB,MAAOd,GAC5BY,EAAA,cAACG,EAAA,CAAoB,QARNC,GAAuB,CAC1ChB,EAAc,QAAQ,CAAE,GAAIgB,EAAS,MAAO,CAAC,EAC7CC,EAAclB,EAAUiB,EAAS,MAAM,CACzC,GAMQJ,EAAA,cAACM,EAAA,CAAa,SAAUC,GACtBP,EAAA,cAACQ,EAAA,CAAiB,SAAUX,GAC1BG,EAAA,cAACS,EAAA,CACC,MAAOpB,EACP,gBAAiBM,GAAS,sBAEzBD,CACH,CACF,CACF,CACF,CACF,CACF,CACF,CACF,CAAC,CACH,CAEA,eAAsBE,EACpBH,EACAiB,EACAC,EACA,CACA,MAAMzB,EAAawB,CAAQ,EAE3B,IAAME,EAAgBC,EAAwB,CAC5C,SAAUH,EAAS,SACnB,QAAAjB,EACA,WAAYqB,EACZ,KAAM,MACR,CAAC,EAED,GAAI,CACF,MAAMH,EAAU,EAChBC,EAAc,QAAQ,CACxB,OAASG,EAAG,CACV,MAAAH,EAAc,OAAOG,CAAC,EAChBA,CACR,CACF","names":["init_esm_shims","cwd","React","initServices","biLogger","errorReporter","model","loadProjectModel","cwd","renderCommand","command","tree","options","runCommand","debugLogFilePath","getDebugLogFilePath","render","React","BiProvider","ErrorReporterProvider","AccountAuthProvider","userInfo","addUserFields","I18nProvider","messages_default","DebugLogProvider","ProjectModelProvider","services","commandFn","commandStatus","reportCommandStartEvent","version","e"]}