@wix/cli-app 1.1.30 → 1.1.31
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.
- package/build/CreateVersionCommand-5BULGDHW.js +4 -0
- package/build/{CreateVersionCommand-NFKBKYN5.js.map → CreateVersionCommand-5BULGDHW.js.map} +1 -1
- package/build/DevCommand-MXZUVA5G.js +4 -0
- package/build/{DevCommand-CSOEONPY.js.map → DevCommand-MXZUVA5G.js.map} +1 -1
- package/build/GenerateCommand-7ASJKBK2.js +99 -0
- package/build/{GenerateCommand-LHTPLGNF.js.map → GenerateCommand-7ASJKBK2.js.map} +1 -1
- package/build/LogsCommand-KEFNJUBL.js +4 -0
- package/build/{LogsCommand-GUWLKR7V.js.map → LogsCommand-KEFNJUBL.js.map} +1 -1
- package/build/PreviewCommand-BWLPYFTW.js +4 -0
- package/build/ServeCommand-BH655VZV.js +4 -0
- package/build/{ServeCommand-PHOYGKPH.js.map → ServeCommand-BH655VZV.js.map} +1 -1
- package/build/{build-N3GC2AJW.js → build-OKG7MQPN.js} +2 -2
- package/build/chunk-533OQ5SU.js +4 -0
- package/build/{chunk-Q5WWBUFO.js.map → chunk-533OQ5SU.js.map} +1 -1
- package/build/{chunk-TTWJWXLR.js → chunk-AAPM44JZ.js} +2 -2
- package/build/{chunk-XQLBMLA6.js → chunk-AC2U3YAW.js} +3 -3
- package/build/{chunk-XQLBMLA6.js.map → chunk-AC2U3YAW.js.map} +1 -1
- package/build/{chunk-EF6HOPCP.js → chunk-BO3GDVSJ.js} +2 -2
- package/build/chunk-BUB7G3II.js +4 -0
- package/build/{chunk-OR2CAHGP.js.map → chunk-BUB7G3II.js.map} +1 -1
- package/build/chunk-DGSU23ZZ.js +4 -0
- package/build/{chunk-25SA6SIS.js.map → chunk-DGSU23ZZ.js.map} +1 -1
- package/build/chunk-DPJN7TRY.js +4 -0
- package/build/{chunk-ZFOHUOI6.js.map → chunk-DPJN7TRY.js.map} +1 -1
- package/build/{chunk-BD6TU75M.js → chunk-DQQG35J6.js} +2 -2
- package/build/chunk-DRRMAC33.js +100 -0
- package/build/chunk-DRRMAC33.js.map +1 -0
- package/build/chunk-EGB6BHIM.js +4 -0
- package/build/{chunk-VH4K3U5M.js.map → chunk-EGB6BHIM.js.map} +1 -1
- package/build/chunk-HNCYDCAD.js +116 -0
- package/build/chunk-HNCYDCAD.js.map +1 -0
- package/build/chunk-IMUWPUOG.js +4 -0
- package/build/{chunk-AS45KVJN.js.map → chunk-IMUWPUOG.js.map} +1 -1
- package/build/chunk-J5ANBYWF.js +11 -0
- package/build/chunk-J5ANBYWF.js.map +1 -0
- package/build/chunk-LE2AC3SJ.js +4 -0
- package/build/{chunk-2T5VKPKE.js → chunk-MB3D7Y3B.js} +2 -2
- package/build/{chunk-5QLZSP2U.js → chunk-NXUGQOWV.js} +36 -36
- package/build/{chunk-5QLZSP2U.js.map → chunk-NXUGQOWV.js.map} +1 -1
- package/build/{chunk-SQZ5XNZ2.js → chunk-P2MQOXIV.js} +2 -2
- package/build/{chunk-SQZ5XNZ2.js.map → chunk-P2MQOXIV.js.map} +1 -1
- package/build/chunk-QP4M2ZZS.js +4 -0
- package/build/{chunk-H6SYLT4B.js.map → chunk-QP4M2ZZS.js.map} +1 -1
- package/build/chunk-U2XLB5AO.js +4 -0
- package/build/chunk-U2XLB5AO.js.map +1 -0
- package/build/chunk-VZ2WROQY.js +4 -0
- package/build/{chunk-L3HVHNTA.js.map → chunk-VZ2WROQY.js.map} +1 -1
- package/build/index.js +2 -2
- package/build/index.js.map +1 -1
- package/build/preview-A2JB6NDU.js +4 -0
- package/build/{preview-QZCCFP23.js.map → preview-A2JB6NDU.js.map} +1 -1
- package/build/render-command-CHJCQHTD.js +4 -0
- package/build/{render-command-AOEWP2JP.js.map → render-command-CHJCQHTD.js.map} +1 -1
- package/package.json +5 -5
- package/build/CreateVersionCommand-NFKBKYN5.js +0 -4
- package/build/DevCommand-CSOEONPY.js +0 -4
- package/build/GenerateCommand-LHTPLGNF.js +0 -99
- package/build/LogsCommand-GUWLKR7V.js +0 -4
- package/build/PreviewCommand-QAYLTUIX.js +0 -4
- package/build/ServeCommand-PHOYGKPH.js +0 -4
- package/build/chunk-25SA6SIS.js +0 -4
- package/build/chunk-5CHNGZ6H.js +0 -87
- package/build/chunk-5CHNGZ6H.js.map +0 -1
- package/build/chunk-AS45KVJN.js +0 -4
- package/build/chunk-C47JQ5AQ.js +0 -4
- package/build/chunk-C47JQ5AQ.js.map +0 -1
- package/build/chunk-E74YEX6I.js +0 -11
- package/build/chunk-E74YEX6I.js.map +0 -1
- package/build/chunk-GFH6QCDG.js +0 -4
- package/build/chunk-GFH6QCDG.js.map +0 -1
- package/build/chunk-GRIMGGL3.js +0 -4
- package/build/chunk-H6SYLT4B.js +0 -4
- package/build/chunk-JUS465G2.js +0 -19
- package/build/chunk-JUS465G2.js.map +0 -1
- package/build/chunk-L3HVHNTA.js +0 -4
- package/build/chunk-OR2CAHGP.js +0 -4
- package/build/chunk-PEDWEHXR.js +0 -99
- package/build/chunk-PEDWEHXR.js.map +0 -1
- package/build/chunk-Q5WWBUFO.js +0 -4
- package/build/chunk-VH4K3U5M.js +0 -4
- package/build/chunk-WZE4EKUX.js +0 -4
- package/build/chunk-WZE4EKUX.js.map +0 -1
- package/build/chunk-YLBOH353.js +0 -21
- package/build/chunk-YLBOH353.js.map +0 -1
- package/build/chunk-ZFOHUOI6.js +0 -4
- package/build/preview-QZCCFP23.js +0 -4
- package/build/render-command-AOEWP2JP.js +0 -4
- /package/build/{PreviewCommand-QAYLTUIX.js.map → PreviewCommand-BWLPYFTW.js.map} +0 -0
- /package/build/{build-N3GC2AJW.js.map → build-OKG7MQPN.js.map} +0 -0
- /package/build/{chunk-TTWJWXLR.js.map → chunk-AAPM44JZ.js.map} +0 -0
- /package/build/{chunk-EF6HOPCP.js.map → chunk-BO3GDVSJ.js.map} +0 -0
- /package/build/{chunk-BD6TU75M.js.map → chunk-DQQG35J6.js.map} +0 -0
- /package/build/{chunk-GRIMGGL3.js.map → chunk-LE2AC3SJ.js.map} +0 -0
- /package/build/{chunk-2T5VKPKE.js.map → chunk-MB3D7Y3B.js.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@wix/cli-app\",\n \"description\": \"CLI tool for Wix apps\",\n \"version\": \"1.1.
|
|
1
|
+
{"version":3,"sources":["../package.json"],"sourcesContent":["{\n \"name\": \"@wix/cli-app\",\n \"description\": \"CLI tool for Wix apps\",\n \"version\": \"1.1.31\",\n \"author\": \"Amit Dahan\",\n \"dependencies\": {\n \"@wix/cli-cloudflare-runtime\": \"workspace:*\",\n \"@wix/cli-miniflare\": \"workspace:*\",\n \"vite\": \"5.3.2\"\n },\n \"devDependencies\": {\n \"@commander-js/extra-typings\": \"^12.1.0\",\n \"@types/lodash\": \"^4.17.6\",\n \"@types/mustache\": \"^4.2.5\",\n \"@wix/ambassador-cli-site-override-service-v1-site-override\": \"^1.0.5\",\n \"@wix/ambassador-ctp-app-cloud-backend-service-v1-app-cloud-backend-deployment\": \"^1.0.5\",\n \"@wix/ambassador-ctp-app-cloud-deployer-service-v1-app-cloud-deployer\": \"^1.0.22\",\n \"@wix/ambassador-ctp-gradual-rollout-v1-app-config\": \"^1.0.67\",\n \"@wix/ambassador-devcenter-components-v1-component\": \"^1.0.421\",\n \"@wix/arm-client\": \"workspace:*\",\n \"@wix/bi-logger-dev-tools-data\": \"^1.51.0\",\n \"@wix/cli-app-definitions\": \"workspace:*\",\n \"@wix/cli-app-manifest\": \"workspace:*\",\n \"@wix/cli-auth\": \"workspace:*\",\n \"@wix/cli-command-contract\": \"workspace:*\",\n \"@wix/cli-core-definitions\": \"workspace:*\",\n \"@wix/cli-debug-log\": \"workspace:*\",\n \"@wix/cli-error\": \"workspace:*\",\n \"@wix/cli-error-reporting\": \"workspace:*\",\n \"@wix/cli-fs\": \"workspace:*\",\n \"@wix/cli-http-client\": \"workspace:*\",\n \"@wix/cli-http-client-react\": \"workspace:*\",\n \"@wix/cli-i18n\": \"workspace:*\",\n \"@wix/cli-logger\": \"workspace:*\",\n \"@wix/cli-site-selector\": \"workspace:*\",\n \"@wix/cli-ssl\": \"workspace:*\",\n \"@wix/cli-telemetry\": \"workspace:*\",\n \"@wix/cli-telemetry-react\": \"workspace:*\",\n \"@wix/cli-test-overrides\": \"workspace:*\",\n \"@wix/cli-tunnel\": \"workspace:*\",\n \"@wix/cli-ui-kit\": \"workspace:*\",\n \"@wix/cli-user-config\": \"workspace:*\",\n \"@wix/dev-center-client\": \"workspace:*\",\n \"@wix/extensions-data-client\": \"workspace:*\",\n \"@wix/gena\": \"workspace:*\",\n \"@wix/site-list-client\": \"workspace:*\",\n \"@wix/site-override-client\": \"workspace:*\",\n \"@wix/tsup-configs\": \"workspace:*\",\n \"@wix/user-browser\": \"workspace:*\",\n \"chalk\": \"^5.3.0\",\n \"chokidar\": \"^3.6.0\",\n \"commander\": \"^12.1.0\",\n \"fast-equals\": \"^5.0.1\",\n \"form-data\": \"^4.0.0\",\n \"globby\": \"^13.2.2\",\n \"lodash\": \"^4.17.21\",\n \"mustache\": \"^4.2.0\",\n \"p-retry\": \"^5.1.2\",\n \"p-wait-for\": \"^5.0.2\",\n \"prompts\": \"^2.4.2\",\n \"react\": \"^18.3.1\",\n \"semver\": \"^7.6.2\",\n \"tempy\": \"^3.1.0\",\n \"typed-emitter\": \"^2.1.0\",\n \"variant\": \"^3.0.0-dev.27\",\n \"vite-plugin-externals\": \"^0.6.2\",\n \"zod\": \"^3.23.8\",\n \"zod-to-json-schema\": \"^3.23.1\"\n },\n \"engines\": {\n \"node\": \">= 18.16\"\n },\n \"exports\": {\n \".\": \"./build/index.js\",\n \"./client\": {\n \"types\": \"./client.d.ts\"\n },\n \"./internal/component-hmr-wrapper\": \"./internal/component-hmr-wrapper.tsx\",\n \"./tsconfig.app.json\": \"./tsconfig.app.json\",\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"build\",\n \"schemas\",\n \"tsconfig.app.json\",\n \"client.d.ts\",\n \"internal\",\n \"templates\"\n ],\n \"peerDependencies\": {\n \"react\": \"^16.14 || ^17 || ^18\",\n \"react-dom\": \"^16.14 || ^17 || ^18\"\n },\n \"peerDependenciesMeta\": {\n \"react-dom\": {\n \"optional\": true\n }\n },\n \"perfer\": {\n \"bundleSize\": {\n \"files\": [\n {\n \"glob\": \"./build/index.js\",\n \"maxSize\": \"460kb\"\n }\n ]\n }\n },\n \"publishConfig\": {\n \"registry\": \"https://registry.npmjs.org/\",\n \"access\": \"public\",\n \"versionBumpStrategy\": \"manual\",\n \"logLevel\": \"verbose\"\n },\n \"scripts\": {\n \"build\": \"run -T tsup && yarn generate-schemas\",\n \"build:watch\": \"run -T tsup --watch\",\n \"generate-schemas\": \"node build-scripts/generate-schemas.js\",\n \"lint\": \"run -T lint-package\",\n \"test\": \"yarn workspace @wix/cli-app-spec run test\",\n \"test:watch\": \"yarn workspace @wix/cli-app-spec run test:watch\",\n \"typecheck\": \"run -T tsc --noEmit\"\n },\n \"sideEffects\": false,\n \"type\": \"module\",\n \"wix\": {\n \"artifact\": {\n \"groupId\": \"com.wixpress.npm\",\n \"artifactId\": \"wix-cli-app\"\n },\n \"validations\": {\n \"postBuild\": [\n \"typecheck\",\n \"lint\"\n ]\n }\n }\n}\n"],"mappings":";;AAGE,IAAAA,EAAW","names":["version"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
+
const require = _createRequire(import.meta.url);
|
|
3
|
+
import{v as f,w as m}from"./chunk-HNCYDCAD.js";import{f as l,g as d,v as U}from"./chunk-DRRMAC33.js";import{e as O,h as o}from"./chunk-V4TR6DCM.js";o();import{randomUUID as k}from"node:crypto";function L(r,t){r.updateDefaults(N(t))}function N(r){return r?{_client_id:r,_uuid:r,logged_user_id:r,logged_account_id:r,target_account_id:r}:{_client_id:k()}}o();import{uptime as h}from"node:process";o();var u=O(U(),1);import V from"node:os";import{platform as b,version as B}from"node:process";function w({cliVersion:r,flow:t}){return{...t?{flow:t}:{},cliVersion:r,isCI:u.default,nodeVersion:B,osName:F(),osVersion:V.release()}}function F(){switch(b){case"darwin":return"mac";case"win32":return"windows";default:return"linux"}}var x=()=>Math.round(h()*1e3);function j({biLogger:r,command:t,flow:y,cliVersion:E,projectId:p,extensions:n}){let S=t.opts(),C=t.args,_=new Set(["apiKey"]),c=Object.fromEntries(Object.entries(S).map(([e,s])=>{let v=_.has(e)?"<censored>":s;return[e,v]})),i={command:t.name(),arguments:C.join(","),flags:Object.keys(c).length?JSON.stringify(c):""};return r.report(f({...w({cliVersion:E,flow:y}),...i,...p?{projectId:p}:{},isValid:!0})),{succeed(){r.report(m({...i,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!0,isValid:!0}))},failed(e){let s=l(e)?{errorType:d(e)?"SystemError":"UserError",errorName:e.name,errorMessage:e.message}:e instanceof Error?{errorType:"UnknownError",errorName:e.name,errorMessage:e.message}:{errorType:"UnknownError",errorMessage:JSON.stringify(e)};r.report(m({...i,...s,...n?{extensions:JSON.stringify(n)}:{},duration:x(),isSuccess:!1,isValid:!0}))}}}o();export{L as a,j as b};
|
|
4
|
+
//# sourceMappingURL=chunk-QP4M2ZZS.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../cli-telemetry/src/add-user-fields.ts","../../cli-telemetry/src/command-bi-event.ts","../../cli-telemetry/src/environment.ts","../../cli-telemetry/src/index.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport type { BiLogger } from '@wix/wix-bi-logger-client';\n\nexport function addUserFields(logger: BiLogger, userId: string) {\n logger.updateDefaults(resolveUserFields(userId));\n}\n\nexport function resolveUserFields(userId?: string): Record<string, string> {\n if (!userId) {\n // anonymous users need to have an identifier for the bi platform to accept the event\n return {\n _client_id: randomUUID(),\n };\n }\n\n return {\n _client_id: userId,\n _uuid: userId,\n logged_user_id: userId,\n logged_account_id: userId,\n target_account_id: userId,\n };\n}\n","import type { BiLogger } from '@wix/wix-bi-logger-client';\nimport {\n wixCliCliCommand,\n wixCliCliCommandStatus,\n} from '@wix/bi-logger-wix-cli/v2';\nimport { isCliError, isCliSystemError } from '@wix/cli-error';\nimport { uptime } from 'node:process';\nimport { getEnvironmentInfo } from './environment.js';\n\ninterface CommandLike {\n name(): string;\n args: string[];\n opts(): Record<string, unknown>;\n}\n\nconst getDuration = () => Math.round(uptime() * 1000);\n\nexport function reportCommandStartEvent({\n biLogger,\n command,\n flow,\n cliVersion,\n projectId,\n extensions,\n}: {\n biLogger: BiLogger;\n command: CommandLike;\n flow: 'Apps' | 'Sites' | null;\n cliVersion: string;\n projectId?: string;\n extensions?: Record<string, number>;\n}) {\n const options = command.opts();\n const args = command.args;\n\n const privateOptions = new Set(['apiKey']);\n const sanitizedOptions = Object.fromEntries(\n Object.entries(options).map(([flagName, flagValue]) => {\n const value = privateOptions.has(flagName) ? '<censored>' : flagValue;\n return [flagName, value];\n })\n );\n\n const commandFields = {\n command: command.name(),\n arguments: args.join(','),\n flags: Object.keys(sanitizedOptions).length\n ? JSON.stringify(sanitizedOptions)\n : '',\n };\n\n biLogger.report(\n wixCliCliCommand({\n ...getEnvironmentInfo({ cliVersion, flow }),\n ...commandFields,\n ...(projectId ? { projectId } : {}),\n isValid: true,\n })\n );\n\n return {\n succeed() {\n biLogger.report(\n wixCliCliCommandStatus({\n ...commandFields,\n ...(extensions ? { extensions: JSON.stringify(extensions) } : {}),\n duration: getDuration(),\n isSuccess: true,\n isValid: true,\n })\n );\n },\n failed(error: unknown) {\n const errorFields = isCliError(error)\n ? {\n errorType: isCliSystemError(error) ? 'SystemError' : 'UserError',\n errorName: error.name,\n errorMessage: error.message,\n }\n : error instanceof Error\n ? {\n errorType: 'UnknownError',\n errorName: error.name,\n errorMessage: error.message,\n }\n : {\n errorType: 'UnknownError',\n errorMessage: JSON.stringify(error),\n };\n\n biLogger.report(\n wixCliCliCommandStatus({\n ...commandFields,\n ...errorFields,\n ...(extensions ? { extensions: JSON.stringify(extensions) } : {}),\n duration: getDuration(),\n isSuccess: false,\n isValid: true,\n })\n );\n },\n };\n}\n","import os from 'node:os';\nimport { platform, version as nodeVersion } from 'node:process';\nimport isCI from 'is-ci';\n\nexport function getEnvironmentInfo({\n cliVersion,\n flow,\n}: {\n cliVersion: string;\n flow: 'Sites' | 'Apps' | null;\n}) {\n return {\n ...(flow ? { flow } : {}),\n cliVersion,\n isCI,\n nodeVersion,\n osName: getOsName(),\n osVersion: os.release(),\n };\n}\n\nexport type EnvironmentInfo = ReturnType<typeof getEnvironmentInfo>;\n\n// https://stackoverflow.com/a/8684009\nfunction getOsName() {\n switch (platform) {\n case 'darwin':\n return 'mac';\n case 'win32':\n return 'windows';\n default:\n return 'linux';\n }\n}\n","export type { BiLogger } from '@wix/wix-bi-logger-client';\nexport { createBiLogger } from './create-bi-logger.js';\nexport { reportCommandStartEvent } from './command-bi-event.js';\nexport { addUserFields } from './add-user-fields.js';\n"],"mappings":";;
|
|
1
|
+
{"version":3,"sources":["../../cli-telemetry/src/add-user-fields.ts","../../cli-telemetry/src/command-bi-event.ts","../../cli-telemetry/src/environment.ts","../../cli-telemetry/src/index.ts"],"sourcesContent":["import { randomUUID } from 'node:crypto';\nimport type { BiLogger } from '@wix/wix-bi-logger-client';\n\nexport function addUserFields(logger: BiLogger, userId: string) {\n logger.updateDefaults(resolveUserFields(userId));\n}\n\nexport function resolveUserFields(userId?: string): Record<string, string> {\n if (!userId) {\n // anonymous users need to have an identifier for the bi platform to accept the event\n return {\n _client_id: randomUUID(),\n };\n }\n\n return {\n _client_id: userId,\n _uuid: userId,\n logged_user_id: userId,\n logged_account_id: userId,\n target_account_id: userId,\n };\n}\n","import type { BiLogger } from '@wix/wix-bi-logger-client';\nimport {\n wixCliCliCommand,\n wixCliCliCommandStatus,\n} from '@wix/bi-logger-wix-cli/v2';\nimport { isCliError, isCliSystemError } from '@wix/cli-error';\nimport { uptime } from 'node:process';\nimport { getEnvironmentInfo } from './environment.js';\n\ninterface CommandLike {\n name(): string;\n args: string[];\n opts(): Record<string, unknown>;\n}\n\nconst getDuration = () => Math.round(uptime() * 1000);\n\nexport function reportCommandStartEvent({\n biLogger,\n command,\n flow,\n cliVersion,\n projectId,\n extensions,\n}: {\n biLogger: BiLogger;\n command: CommandLike;\n flow: 'Apps' | 'Sites' | null;\n cliVersion: string;\n projectId?: string;\n extensions?: Record<string, number>;\n}) {\n const options = command.opts();\n const args = command.args;\n\n const privateOptions = new Set(['apiKey']);\n const sanitizedOptions = Object.fromEntries(\n Object.entries(options).map(([flagName, flagValue]) => {\n const value = privateOptions.has(flagName) ? '<censored>' : flagValue;\n return [flagName, value];\n })\n );\n\n const commandFields = {\n command: command.name(),\n arguments: args.join(','),\n flags: Object.keys(sanitizedOptions).length\n ? JSON.stringify(sanitizedOptions)\n : '',\n };\n\n biLogger.report(\n wixCliCliCommand({\n ...getEnvironmentInfo({ cliVersion, flow }),\n ...commandFields,\n ...(projectId ? { projectId } : {}),\n isValid: true,\n })\n );\n\n return {\n succeed() {\n biLogger.report(\n wixCliCliCommandStatus({\n ...commandFields,\n ...(extensions ? { extensions: JSON.stringify(extensions) } : {}),\n duration: getDuration(),\n isSuccess: true,\n isValid: true,\n })\n );\n },\n failed(error: unknown) {\n const errorFields = isCliError(error)\n ? {\n errorType: isCliSystemError(error) ? 'SystemError' : 'UserError',\n errorName: error.name,\n errorMessage: error.message,\n }\n : error instanceof Error\n ? {\n errorType: 'UnknownError',\n errorName: error.name,\n errorMessage: error.message,\n }\n : {\n errorType: 'UnknownError',\n errorMessage: JSON.stringify(error),\n };\n\n biLogger.report(\n wixCliCliCommandStatus({\n ...commandFields,\n ...errorFields,\n ...(extensions ? { extensions: JSON.stringify(extensions) } : {}),\n duration: getDuration(),\n isSuccess: false,\n isValid: true,\n })\n );\n },\n };\n}\n","import os from 'node:os';\nimport { platform, version as nodeVersion } from 'node:process';\nimport isCI from 'is-ci';\n\nexport function getEnvironmentInfo({\n cliVersion,\n flow,\n}: {\n cliVersion: string;\n flow: 'Sites' | 'Apps' | null;\n}) {\n return {\n ...(flow ? { flow } : {}),\n cliVersion,\n isCI,\n nodeVersion,\n osName: getOsName(),\n osVersion: os.release(),\n };\n}\n\nexport type EnvironmentInfo = ReturnType<typeof getEnvironmentInfo>;\n\n// https://stackoverflow.com/a/8684009\nfunction getOsName() {\n switch (platform) {\n case 'darwin':\n return 'mac';\n case 'win32':\n return 'windows';\n default:\n return 'linux';\n }\n}\n","export type { BiLogger } from '@wix/wix-bi-logger-client';\nexport { createBiLogger } from './create-bi-logger.js';\nexport { reportCommandStartEvent } from './command-bi-event.js';\nexport { addUserFields } from './add-user-fields.js';\n"],"mappings":";;oJAAAA,IAAA,OAAS,cAAAC,MAAkB,cAGpB,SAASC,EAAcC,EAAkBC,EAAgB,CAC9DD,EAAO,eAAeE,EAAkBD,CAAM,CAAC,CACjD,CAEO,SAASC,EAAkBD,EAAyC,CACzE,OAAKA,EAOE,CACL,WAAYA,EACZ,MAAOA,EACP,eAAgBA,EAChB,kBAAmBA,EACnB,kBAAmBA,CACrB,EAXS,CACL,WAAYH,EAAW,CACzB,CAUJ,CCtBAK,IAMA,OAAS,UAAAC,MAAc,eCNvBC,IAEA,IAAAC,EAAiB,SAFjB,OAAOC,MAAQ,UACf,OAAS,YAAAC,EAAU,WAAWC,MAAmB,eAG1C,SAASC,EAAmB,CACjC,WAAAC,EACA,KAAAC,CACF,EAGG,CACD,MAAO,CACL,GAAIA,EAAO,CAAE,KAAAA,CAAK,EAAI,CAAC,EACvB,WAAAD,EACA,OAAAE,QACA,YAAAJ,EACA,OAAQK,EAAU,EAClB,UAAWP,EAAG,QAAQ,CACxB,CACF,CAKA,SAASO,GAAY,CACnB,OAAQN,EAAU,CAChB,IAAK,SACH,MAAO,MACT,IAAK,QACH,MAAO,UACT,QACE,MAAO,OACX,CACF,CDlBA,IAAMO,EAAc,IAAM,KAAK,MAAMC,EAAO,EA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,GAAGH,EACH,GAAGK,EACH,GAAIb,EAAa,CAAE,WAAY,KAAK,UAAUA,CAAU,CAAE,EAAI,CAAC,EAC/D,SAAUR,EAAY,EACtB,UAAW,GACX,QAAS,EACX,CAAC,CACH,CACF,CACF,CACF,CEtGAwB","names":["init_esm_shims","randomUUID","addUserFields","logger","userId","resolveUserFields","init_esm_shims","uptime","init_esm_shims","import_is_ci","os","platform","nodeVersion","getEnvironmentInfo","cliVersion","flow","isCI","getOsName","getDuration","uptime","reportCommandStartEvent","biLogger","command","flow","cliVersion","projectId","extensions","options","args","privateOptions","sanitizedOptions","flagName","flagValue","value","commandFields","wixCliCliCommand","getEnvironmentInfo","wixCliCliCommandStatus","error","errorFields","isCliError","isCliSystemError","init_esm_shims"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
+
const require = _createRequire(import.meta.url);
|
|
3
|
+
import{b as ce}from"./chunk-DQQG35J6.js";import{b as $,c as ge,d as _e,e as ve}from"./chunk-DPJN7TRY.js";import{Ba as de,Fa as Se,Ga as W,Ha as fe,Ia as ye,R as ue,db as k,r as oe,s as re,t as le,u as H,x as me}from"./chunk-HNCYDCAD.js";import{G as B,H as j,L as N,M as pe,O as _,P as q,R as x,S as K,V as w,W as d,Y as ae,a as y,b,d as P,e as A,l as F,m as ie,y as se,z as ne}from"./chunk-DRRMAC33.js";import{e as p,h as o}from"./chunk-V4TR6DCM.js";o();var h=p(y(),1),R=p(b(),1);o();var M=p(y(),1),U=p(b(),1);o();o();var g=p(y(),1),Le=p(b(),1);o();var Q=p(y(),1),we=p(b(),1);o();var Ce=p(y(),1);function De(e){return{cliAction:({question:s,action:r,key:t,additionalInfo:i})=>e.report(ye({question:s,action:r,key:t,additionalInfo:JSON.stringify(i)})),cliFlowStepAnswered:({question:s,answer:r,additionalInfo:t})=>e.report(fe({question:s,answer:r,additionalInfo:JSON.stringify(t)}))}}function E(){let e=H();return(0,Ce.useMemo)(()=>De(e),[e])}var be=({onSubmit:e,onError:s,sites:r})=>{let t=E(),{t:i}=d(),{getDevSitesCount:n,getDevSitesLimit:l}=W(),{status:v}=x(()=>Promise.all([n(),l()]),[],{onError:s}),u=S=>{t.cliFlowStepAnswered({question:i("site_type_select.label"),answer:S.title}),e(S.value)};return(0,we.match)(v,{Error:()=>null,Loading:()=>Q.default.createElement(_,{text:i("general.loading")}),Success:({result:[S,f]})=>{let a=S>=f,C=r.length===0;return Q.default.createElement(j,{label:i("site_type_select.label"),options:[{availability:C?B.Disabled({reason:i("site_type_select.no_sites")}):B.Enabled(),title:i("site_type_select.pick_existing_site"),value:"select-existing-site"},{title:i("site_type_select.create_new_dev_site"),value:"create-dev-site",availability:a?B.Disabled({reason:i("site_type_select.create_new_dev_site.disabled",{limit:f})}):B.Enabled()}],onSubmit:u})}})};o();var T=p(y(),1),Te=p(b(),1);o();var J=p(y(),1);o();o();var Ie=p(y(),1);o();o();var xe=F.record(F.object({appDefinitionId:F.string().optional(),permissions:F.object({revoked:F.boolean()}).optional()}));var z=class{constructor(s){this.httpClient=s}isAppInstalled=async({metaSiteId:s,appId:r})=>{try{let{data:t}=await this.httpClient.request({url:`/_api/msm/v1/meta-site/editor-client-spec-map/${s}`}),i=xe.parse(t);return Object.values(i).some(l=>l.appDefinitionId===r&&!l.permissions?.revoked)}catch(t){throw new P({code:A.FailedToCheckIfAppInstalled(),cause:t})}}};function O(){let e=Se({type:"general"});return(0,Ie.useMemo)(()=>new z(e),[e])}var D=p(b(),1);o();var L=p(y(),1);var he=({siteId:e,appId:s})=>{let{t:r}=d(),t=E();return se(async(i,n)=>{n.return&&(t.cliAction({question:r("install_app_on_site.warning.instructions"),key:"enter",action:"install_app_on_site"}),await me(`https://manage.wix.com/installer/install?metaSiteId=${e}&appId=${s}&platform=cli&version=latest`))}),L.default.createElement(L.default.Fragment,null,L.default.createElement(w,{i18nKey:"install_app_on_site.warning"}),L.default.createElement(w,{i18nKey:"install_app_on_site.warning.instructions",components:[L.default.createElement(pe,{value:"enter"})]}))};var V=(0,D.variant)({Success:{},Canceled:{}});function Me(e){return e&&typeof e=="object"&&"name"in e&&e.name==="AbortError"}var Y=({appId:e,site:s,onSubmit:r,onError:t})=>{let{isAppInstalled:i}=O(),{status:n}=x(async({signal:l})=>{let{appInstallationPollInterval:v}=ie();try{return await re(()=>i({metaSiteId:s.id,appId:e}),{interval:v??2e3,timeout:{milliseconds:60*1e3*2,signal:l}}),V.Success()}catch(u){if(u instanceof oe)throw new P({code:A.SiteSelectorTimedout(),cause:u});if(Me(u))return V.Canceled();throw u}},[],{onError:t,onSuccess:l=>{(0,D.isType)(l,V.Success)&&r()}});return(0,D.match)(n,{Error:()=>null,Loading:()=>J.default.createElement(he,{siteId:s.id,appId:e}),Success:()=>J.default.createElement(N,{type:"success"},J.default.createElement(w,{i18nKey:"install_app_on_site.finished_successfully"}))})};var Pe=({status:e,appId:s,onSubmit:r,onError:t})=>{let{t:i}=d();return(0,Te.match)(e,{NotRequested:()=>null,Error:()=>null,Loading:()=>T.default.createElement(_,{text:i("create_dev_site.loading")}),Success:({result:n})=>T.default.createElement(T.default.Fragment,null,T.default.createElement(w,{i18nKey:"create_dev_site.success",components:[T.default.createElement(ne,{skin:"success",bold:!0})],values:{name:n.displayName}}),T.default.createElement(Y,{appId:s,site:n,onSubmit:()=>r(n),onError:t}))})};var Ae={"general.loading":"Loading...","site_type_select.label":"Select Development Site","site_type_select.create_new_dev_site":"Create a new Development Site","site_type_select.create_new_dev_site.disabled":"You have reached the maximum number of {limit} Development Sites","site_type_select.pick_existing_site":"Pick an existing site","site_type_select.no_sites":"No sites found","create_dev_site.loading":"Creating your new Development Site...","create_dev_site.success":"Development Site <0>{name}</0> created successfully! \u{1F680}","site_list_select.label":"Select Site","install_app_on_site.warning":"Your new application needs to be installed on the selected Development Site","install_app_on_site.warning.instructions":"Press <0/> to install the application in your browser","install_app_on_site.finished_successfully":"App installed on Development Site."};o();var I=p(y(),1);var ke=p(b(),1);o();var G=p(y(),1);var Fe=({onSubmit:e,sites:s})=>{let{t:r}=d(),t=E(),i=(0,G.useCallback)(n=>{t.cliFlowStepAnswered({question:r("site_list_select.label"),answer:n.title}),e(n.value)},[t,e,r]);return G.default.createElement(j,{label:r("site_list_select.label"),options:s.map(n=>({key:n.id,title:n.displayName,description:n.viewUrl,value:n})),onSubmit:i})};var Ee=({sites:e,appId:s,onSubmit:r,onError:t})=>{let{t:i}=d(),{isAppInstalled:n}=O(),[l,v]=(0,I.useState)(null),u=K((f,a)=>n({metaSiteId:a.id,appId:s}),{onError:t});async function S(f){await u.execute(f)?r(f):v(f)}return I.default.createElement(I.default.Fragment,null,I.default.createElement(Fe,{onSubmit:S,sites:e}),(0,ke.isType)(u.status,"Loading")&&I.default.createElement(_,{text:i("general.loading")}),l&&I.default.createElement(Y,{appId:s,site:l,onSubmit:()=>r(l),onError:t}))};var X=({appId:e,biLogger:s,onSubmit:r,onError:t})=>{let[i,n]=(0,g.useState)(null),{createDevSite:l}=W(),v=$(),{status:u}=x(()=>v.querySites({query:{cursorPaging:{limit:100}}}),[],{onError:t}),S=K(()=>l(),{onError:t});function f(a){n(a),a==="create-dev-site"&&S.execute()}return g.default.createElement(le,{value:s},g.default.createElement(ae,{messages:Ae},(0,Le.match)(u,{Error:()=>null,Loading:()=>g.default.createElement(_,{text:g.default.createElement(w,{i18nKey:"general.loading"})}),Success:({result:a})=>g.default.createElement(g.default.Fragment,null,g.default.createElement(be,{onSubmit:f,onError:t,sites:a}),i==="create-dev-site"&&g.default.createElement(Pe,{status:S.status,appId:e,onSubmit:r,onError:t}),i==="select-existing-site"&&g.default.createElement(Ee,{sites:a,appId:e,onSubmit:r,onError:t}))})))};var Z=({state:e,onSubmit:s})=>{let r=q(),{t}=d(),{model:i}=k(),n=H();return M.default.createElement(M.default.Fragment,null,(0,U.match)(e,{NotConfigured:(0,U.constant)(M.default.createElement(N,{type:"insight"},t("general.no_site_id_configured"))),NotFound:({id:l})=>M.default.createElement(N,{type:"error"},t("general.site_id_not_found",{id:l}))}),M.default.createElement(X,{appId:i.config.appId,biLogger:n,onSubmit:s,onError:r}))};var _i=({children:e,siteId:s})=>{let r=q(),{model:{projectFolder:t}}=k(),i=ce(),n=$(),{t:l}=d(),{status:v,merge:u}=x(async()=>ve({projectFolder:t,siteListClient:n,siteId:s,writeDebugLog:i}),[]),S=(0,h.useCallback)(async a=>{try{await de(t,{siteId:a.id}),u({result:_e.Resolved({site:a})})}catch{throw new P({code:A.FailedToSaveDevelopmentSite({path:ue})})}},[u,t]),f=(0,h.useCallback)(a=>S(a).catch(r),[r,S]);return(0,R.match)(v,{Error:()=>null,Loading:()=>h.default.createElement(_,{text:l("dev_command.site_provider.loading")}),Success:({result:a})=>(0,R.match)(a,{NotConfigured:C=>h.default.createElement(Z,{state:C,onSubmit:f}),NotFound:C=>h.default.createElement(Z,{state:C,onSubmit:f}),Resolved:({site:C})=>h.default.createElement(ge.Provider,{value:{site:C,setSite:S}},typeof e=="function"?e(C):e)})})};o();var ee=p(y(),1),te=p(b(),1);function bi(){let{model:e}=k(),s=(0,ee.useCallback)(t=>e.components.some(i=>i.platforms.some((0,te.isType)(t.type))),[e.components]),r=(0,ee.useCallback)(t=>e.components.every(i=>i.platforms.some((0,te.isType)(t.type))||i.platforms.length===0),[e.components]);return{isPlatformExists:s,hasSinglePlatform:r}}export{X as a,_i as b,bi as c};
|
|
4
|
+
//# sourceMappingURL=chunk-U2XLB5AO.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/site-id/SiteIdProvider.tsx","../src/site-id/ResolveSiteId.tsx","../../cli-site-selector/src/index.ts","../../cli-site-selector/src/SiteSelector.tsx","../../cli-site-selector/src/SiteTypeSelect.tsx","../../cli-site-selector/src/bi.ts","../../cli-site-selector/src/CreateDevSite.tsx","../../cli-site-selector/src/WaitForAppToBeInstalled.tsx","../../metasite-manager-client/src/index.ts","../../metasite-manager-client/src/useMetasiteManagerClient.ts","../../metasite-manager-client/src/metasite-manager-client.ts","../../metasite-manager-client/src/schemas.ts","../../cli-site-selector/src/OpenBrowser.tsx","../../cli-site-selector/src/messages.json","../../cli-site-selector/src/SelectExistingSite.tsx","../../cli-site-selector/src/SiteListSelect.tsx","../src/components/Platform/usePlatform.tsx"],"sourcesContent":["import React, { type FC, type ReactNode, useCallback } from 'react';\nimport { match } from 'variant';\nimport { useDebugLog } from '@wix/cli-debug-log';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport { APP_CONFIG_PATH } from '@wix/cli-app-definitions';\nimport { useAsync, useExit, Spinner } from '@wix/cli-ui-kit';\nimport { type Site, useSiteListClient } from '@wix/site-list-client';\nimport { useTranslation } from '@wix/cli-i18n';\nimport { saveAppConfig } from '../files/app.config.js';\nimport { useProjectModel } from '../model.js';\nimport { ResolveSiteId } from './ResolveSiteId.js';\nimport { SiteIdContext } from './context.js';\nimport { SiteIdState } from './site-id-state.js';\nimport { resolveConfiguredSite } from './resolve-configured-site.js';\n\nexport const SiteIdProvider: FC<{\n siteId?: string;\n children: ReactNode | ((site: Site) => ReactNode);\n}> = ({ children, siteId }) => {\n const exit = useExit();\n const {\n model: { projectFolder },\n } = useProjectModel();\n const writeDebugLog = useDebugLog();\n const siteListClient = useSiteListClient();\n const { t } = useTranslation();\n\n const { status, merge } = useAsync(\n async () =>\n resolveConfiguredSite({\n projectFolder,\n siteListClient,\n siteId,\n writeDebugLog,\n }),\n []\n );\n\n const setSite = useCallback(\n async (site: Site) => {\n try {\n await saveAppConfig(projectFolder, { siteId: site.id });\n merge({ result: SiteIdState.Resolved({ site }) });\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToSaveDevelopmentSite({\n path: APP_CONFIG_PATH,\n }),\n });\n }\n },\n [merge, projectFolder]\n );\n\n const handleResolveSiteId = useCallback(\n (site: Site) => setSite(site).catch(exit),\n [exit, setSite]\n );\n\n return match(status, {\n Error: () => null,\n Loading: () => <Spinner text={t('dev_command.site_provider.loading')} />,\n Success: ({ result: state }) => {\n return match(state, {\n NotConfigured: (variant) => (\n <ResolveSiteId state={variant} onSubmit={handleResolveSiteId} />\n ),\n NotFound: (variant) => (\n <ResolveSiteId state={variant} onSubmit={handleResolveSiteId} />\n ),\n Resolved: ({ site }) => (\n <SiteIdContext.Provider\n value={{\n site,\n setSite,\n }}\n >\n {typeof children === 'function' ? children(site) : children}\n </SiteIdContext.Provider>\n ),\n });\n },\n });\n};\n","import React, { type FC } from 'react';\nimport { match, constant } from 'variant';\nimport type { Site } from '@wix/site-list-client';\nimport { Alert, useExit } from '@wix/cli-ui-kit';\nimport { useTranslation } from '@wix/cli-i18n';\nimport { SiteSelector } from '@wix/cli-site-selector';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport { useProjectModel } from '../model.js';\nimport type { SiteIdState } from './site-id-state.js';\n\ninterface Props {\n state: SiteIdState<'NotConfigured' | 'NotFound'>;\n onSubmit: (site: Site) => void;\n}\n\nexport const ResolveSiteId: FC<Props> = ({ state, onSubmit }) => {\n const exit = useExit();\n const { t } = useTranslation();\n const { model } = useProjectModel();\n const biLogger = useBiLogger();\n\n return (\n <>\n {match(state, {\n NotConfigured: constant(\n <Alert type=\"insight\">{t('general.no_site_id_configured')}</Alert>\n ),\n NotFound: ({ id }) => (\n <Alert type=\"error\">{t('general.site_id_not_found', { id })}</Alert>\n ),\n })}\n <SiteSelector\n appId={model.config.appId}\n biLogger={biLogger}\n onSubmit={onSubmit}\n onError={exit}\n />\n </>\n );\n};\n","export { SiteSelector } from './SiteSelector.js';\n","import React, { type FC, useState } from 'react';\nimport { match } from 'variant';\nimport { I18nProvider, Trans } from '@wix/cli-i18n';\nimport type { Site } from '@wix/site-list-client';\nimport { Spinner, useAsync, useAsyncCallback } from '@wix/cli-ui-kit';\nimport { useDevCenterClient } from '@wix/dev-center-client';\nimport { useSiteListClient } from '@wix/site-list-client';\nimport type { BiLogger } from '@wix/cli-telemetry';\nimport { BiProvider } from '@wix/cli-telemetry-react';\nimport { SiteTypeSelect, type SiteType } from './SiteTypeSelect.js';\nimport { CreateDevSite } from './CreateDevSite.js';\nimport messages from './messages.json';\nimport { SelectExistingSite } from './SelectExistingSite.js';\n\ninterface Props {\n appId: string;\n biLogger: BiLogger;\n onSubmit: (site: Site) => void;\n onError: (error: unknown) => void;\n}\n\nexport const SiteSelector: FC<Props> = ({\n appId,\n biLogger,\n onSubmit,\n onError,\n}) => {\n const [siteType, setSiteType] = useState<SiteType | null>(null);\n const { createDevSite } = useDevCenterClient();\n const siteListClient = useSiteListClient();\n\n const { status } = useAsync(\n () =>\n siteListClient.querySites({\n query: {\n cursorPaging: {\n limit: 100,\n },\n },\n }),\n [],\n {\n onError,\n }\n );\n\n const createSite = useAsyncCallback(() => createDevSite(), {\n onError,\n });\n\n function handleSelectSiteType(siteType: SiteType) {\n setSiteType(siteType);\n if (siteType === 'create-dev-site') {\n createSite.execute();\n }\n }\n\n return (\n <BiProvider value={biLogger}>\n <I18nProvider messages={messages}>\n {match(status, {\n Error: () => null,\n Loading: () => <Spinner text={<Trans i18nKey=\"general.loading\" />} />,\n Success: ({ result: sites }) => (\n <>\n <SiteTypeSelect\n onSubmit={handleSelectSiteType}\n onError={onError}\n sites={sites}\n />\n {siteType === 'create-dev-site' && (\n <CreateDevSite\n status={createSite.status}\n appId={appId}\n onSubmit={onSubmit}\n onError={onError}\n />\n )}\n {siteType === 'select-existing-site' && (\n <SelectExistingSite\n sites={sites}\n appId={appId}\n onSubmit={onSubmit}\n onError={onError}\n />\n )}\n </>\n ),\n })}\n </I18nProvider>\n </BiProvider>\n );\n};\n","import React, { type FC } from 'react';\nimport { match } from 'variant';\nimport { useTranslation } from '@wix/cli-i18n';\nimport type { SelectOption } from '@wix/cli-ui-kit';\nimport {\n Spinner,\n SelectInput,\n useAsync,\n SelectOptionAvailability,\n} from '@wix/cli-ui-kit';\nimport { useDevCenterClient } from '@wix/dev-center-client';\nimport type { Site } from '@wix/site-list-client';\nimport { useSiteSelectorBi } from './bi.js';\n\nexport type SiteType = 'create-dev-site' | 'select-existing-site';\ninterface Props {\n onSubmit: (siteType: SiteType) => void;\n onError: (error: unknown) => void;\n sites: Site[];\n}\n\nexport const SiteTypeSelect: FC<Props> = ({ onSubmit, onError, sites }) => {\n const bi = useSiteSelectorBi();\n const { t } = useTranslation();\n const { getDevSitesCount, getDevSitesLimit } = useDevCenterClient();\n const { status } = useAsync(\n () => Promise.all([getDevSitesCount(), getDevSitesLimit()]),\n [],\n { onError }\n );\n\n const handleSubmit = (option: SelectOption<SiteType>) => {\n bi.cliFlowStepAnswered({\n question: t('site_type_select.label'),\n answer: option.title,\n });\n onSubmit(option.value);\n };\n\n return match(status, {\n Error: () => null,\n Loading: () => <Spinner text={t('general.loading')} />,\n Success: ({ result: [devSitesCount, devSitesLimit] }) => {\n const isDevSitesLimitReached = devSitesCount >= devSitesLimit;\n const userHasNoSites = sites.length === 0;\n\n return (\n <SelectInput<SiteType>\n label={t('site_type_select.label')}\n options={[\n {\n availability: userHasNoSites\n ? SelectOptionAvailability.Disabled({\n reason: t('site_type_select.no_sites'),\n })\n : SelectOptionAvailability.Enabled(),\n title: t('site_type_select.pick_existing_site'),\n value: 'select-existing-site',\n },\n {\n title: t('site_type_select.create_new_dev_site'),\n value: 'create-dev-site',\n availability: isDevSitesLimitReached\n ? SelectOptionAvailability.Disabled({\n reason: t('site_type_select.create_new_dev_site.disabled', {\n limit: devSitesLimit,\n }),\n })\n : SelectOptionAvailability.Enabled(),\n },\n ]}\n onSubmit={handleSubmit}\n />\n );\n },\n });\n};\n","import { useMemo } from 'react';\nimport type { BiLogger } from '@wix/cli-telemetry';\nimport { useBiLogger } from '@wix/cli-telemetry-react';\nimport {\n wixCliAction,\n wixCliAppFlowStepsAnswers,\n} from '@wix/bi-logger-dev-tools-data/v2';\n\nexport function siteSelectorBiEvents(biLogger: BiLogger) {\n return {\n cliAction: ({\n question,\n action,\n key,\n additionalInfo,\n }: {\n question: string;\n action: string;\n key: string;\n additionalInfo?: Record<string, unknown>;\n }) =>\n biLogger.report(\n wixCliAction({\n question,\n action,\n key,\n additionalInfo: JSON.stringify(additionalInfo),\n })\n ),\n cliFlowStepAnswered: ({\n question,\n answer,\n additionalInfo,\n }: {\n question: string;\n answer: string;\n additionalInfo?: Record<string, unknown>;\n }) =>\n biLogger.report(\n wixCliAppFlowStepsAnswers({\n question,\n answer,\n additionalInfo: JSON.stringify(additionalInfo),\n })\n ),\n };\n}\n\nexport function useSiteSelectorBi() {\n const biLogger = useBiLogger();\n return useMemo(() => siteSelectorBiEvents(biLogger), [biLogger]);\n}\n","import React, { type FC } from 'react';\nimport { match } from 'variant';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport type { AsyncCallbackStatus } from '@wix/cli-ui-kit';\nimport { Text, Spinner } from '@wix/cli-ui-kit';\nimport type { Site } from '@wix/site-list-client';\nimport { WaitForAppToBeInstalled } from './WaitForAppToBeInstalled.js';\n\ninterface Props {\n status: AsyncCallbackStatus<Site>;\n appId: string;\n onSubmit: (site: Site) => void;\n onError: (error: unknown) => void;\n}\n\nexport const CreateDevSite: FC<Props> = ({\n status,\n appId,\n onSubmit,\n onError,\n}) => {\n const { t } = useTranslation();\n\n return match(status, {\n NotRequested: () => null,\n Error: () => null,\n Loading: () => <Spinner text={t('create_dev_site.loading')} />,\n Success: ({ result }) => (\n <>\n <Trans\n i18nKey=\"create_dev_site.success\"\n components={[<Text skin=\"success\" bold />]}\n values={{ name: result.displayName }}\n />\n <WaitForAppToBeInstalled\n appId={appId}\n site={result}\n onSubmit={() => onSubmit(result)}\n onError={onError}\n />\n </>\n ),\n });\n};\n","import pWaitFor, { TimeoutError } from 'p-wait-for';\nimport React, { type FC } from 'react';\nimport { Trans } from '@wix/cli-i18n';\nimport { Alert, useAsync } from '@wix/cli-ui-kit';\nimport { useMetasiteManagerClient } from '@wix/metasite-manager-client';\nimport { isType, match, variant } from 'variant';\nimport { getTestOverrides } from '@wix/cli-test-overrides';\nimport { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { Site } from '@wix/site-list-client';\nimport { OpenBrowser } from './OpenBrowser.js';\n\ninterface Props {\n site: Site;\n appId: string;\n onSubmit: () => void;\n onError: (error: unknown) => void;\n}\n\nexport const AppInstallData = variant({\n Success: {},\n Canceled: {},\n});\n\nfunction isAbortError(error: unknown) {\n return (\n error &&\n typeof error === 'object' &&\n 'name' in error &&\n error.name === 'AbortError'\n );\n}\n\nexport const WaitForAppToBeInstalled: FC<Props> = ({\n appId,\n site,\n onSubmit,\n onError,\n}) => {\n const { isAppInstalled } = useMetasiteManagerClient();\n\n const { status } = useAsync(\n async ({ signal }) => {\n const { appInstallationPollInterval } = getTestOverrides();\n\n try {\n await pWaitFor(() => isAppInstalled({ metaSiteId: site.id, appId }), {\n interval: appInstallationPollInterval ?? 2000,\n timeout: {\n milliseconds: 60 * 1000 * 2,\n signal,\n },\n });\n\n return AppInstallData.Success();\n } catch (error) {\n if (error instanceof TimeoutError) {\n throw new CliError({\n code: CliErrorCode.SiteSelectorTimedout(),\n cause: error,\n });\n }\n\n if (isAbortError(error)) {\n return AppInstallData.Canceled();\n }\n\n throw error;\n }\n },\n [],\n {\n onError,\n onSuccess: (result) => {\n if (isType(result, AppInstallData.Success)) {\n onSubmit();\n }\n },\n }\n );\n\n return match(status, {\n Error: () => null,\n Loading: () => <OpenBrowser siteId={site.id} appId={appId} />,\n Success: () => (\n <Alert type=\"success\">\n <Trans i18nKey=\"install_app_on_site.finished_successfully\" />\n </Alert>\n ),\n });\n};\n","export { useMetasiteManagerClient } from './useMetasiteManagerClient.js';\n","import { useMemo } from 'react';\nimport { useHttpClient } from '@wix/cli-http-client-react';\nimport { MetasiteManagerClient } from './metasite-manager-client.js';\n\nexport function useMetasiteManagerClient(): MetasiteManagerClient {\n const httpClient = useHttpClient({ type: 'general' });\n return useMemo(() => new MetasiteManagerClient(httpClient), [httpClient]);\n}\n","import { CliError, CliErrorCode } from '@wix/cli-error';\nimport type { HttpClient } from '@wix/cli-http-client';\nimport { clientSpecMapSchema } from './schemas.js';\n\nexport class MetasiteManagerClient {\n constructor(private readonly httpClient: HttpClient) {}\n\n public isAppInstalled = async ({\n metaSiteId,\n appId,\n }: {\n metaSiteId: string;\n appId: string;\n }) => {\n try {\n const { data } = await this.httpClient.request({\n url: `/_api/msm/v1/meta-site/editor-client-spec-map/${metaSiteId}`,\n });\n\n const clientSpecMap = clientSpecMapSchema.parse(data);\n\n const isInstalled = Object.values(clientSpecMap).some(\n (spec) => spec.appDefinitionId === appId && !spec.permissions?.revoked\n );\n\n return isInstalled;\n } catch (e) {\n throw new CliError({\n code: CliErrorCode.FailedToCheckIfAppInstalled(),\n cause: e,\n });\n }\n };\n}\n","import { z } from 'zod';\n\nexport const clientSpecMapSchema = z.record(\n z.object({\n appDefinitionId: z.string().optional(),\n permissions: z.object({ revoked: z.boolean() }).optional(),\n })\n);\n\nexport type ClientSpecMap = z.TypeOf<typeof clientSpecMapSchema>;\n","import React, { type FC } from 'react';\nimport { Key, useInput } from '@wix/cli-ui-kit';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport { openBrowser } from '@wix/user-browser';\nimport { useSiteSelectorBi } from './bi.js';\n\ninterface Props {\n siteId: string;\n appId: string;\n}\n\nexport const OpenBrowser: FC<Props> = ({ siteId, appId }) => {\n const { t } = useTranslation();\n const bi = useSiteSelectorBi();\n\n useInput(async (input, key) => {\n if (key.return) {\n bi.cliAction({\n question: t('install_app_on_site.warning.instructions'),\n key: 'enter',\n action: 'install_app_on_site',\n });\n await openBrowser(\n `https://manage.wix.com/installer/install?metaSiteId=${siteId}&appId=${appId}&platform=cli&version=latest`\n );\n }\n });\n\n return (\n <>\n <Trans i18nKey=\"install_app_on_site.warning\" />\n <Trans\n i18nKey=\"install_app_on_site.warning.instructions\"\n components={[<Key value=\"enter\" />]}\n />\n </>\n );\n};\n","{\n \"general.loading\": \"Loading...\",\n \"site_type_select.label\": \"Select Development Site\",\n \"site_type_select.create_new_dev_site\": \"Create a new Development Site\",\n \"site_type_select.create_new_dev_site.disabled\": \"You have reached the maximum number of {limit} Development Sites\",\n \"site_type_select.pick_existing_site\": \"Pick an existing site\",\n \"site_type_select.no_sites\": \"No sites found\",\n \"create_dev_site.loading\": \"Creating your new Development Site...\",\n \"create_dev_site.success\": \"Development Site <0>{name}</0> created successfully! 🚀\",\n \"site_list_select.label\": \"Select Site\",\n \"install_app_on_site.warning\": \"Your new application needs to be installed on the selected Development Site\",\n \"install_app_on_site.warning.instructions\": \"Press <0/> to install the application in your browser\",\n \"install_app_on_site.finished_successfully\": \"App installed on Development Site.\"\n}\n","import React, { useState } from 'react';\nimport { Spinner, useAsyncCallback } from '@wix/cli-ui-kit';\nimport { useMetasiteManagerClient } from '@wix/metasite-manager-client';\nimport type { Site } from '@wix/site-list-client';\nimport { isType } from 'variant';\nimport { useTranslation } from '@wix/cli-i18n';\nimport { WaitForAppToBeInstalled } from './WaitForAppToBeInstalled.js';\nimport { SiteListSelect } from './SiteListSelect.js';\n\ninterface Props {\n sites: Site[];\n appId: string;\n onSubmit: (site: Site) => void;\n onError: (error: unknown) => void;\n}\n\nexport const SelectExistingSite = ({\n sites,\n appId,\n onSubmit,\n onError,\n}: Props) => {\n const { t } = useTranslation();\n const { isAppInstalled } = useMetasiteManagerClient();\n const [siteToInstallAppOn, setSiteToInstallAppOn] = useState<Site | null>(\n null\n );\n const checkAppInstalled = useAsyncCallback(\n (_, site: Site) => isAppInstalled({ metaSiteId: site.id, appId }),\n {\n onError,\n }\n );\n\n async function handleSelectSite(site: Site) {\n const isInstalled = await checkAppInstalled.execute(site);\n if (isInstalled) {\n onSubmit(site);\n } else {\n setSiteToInstallAppOn(site);\n }\n }\n\n return (\n <>\n <SiteListSelect onSubmit={handleSelectSite} sites={sites} />\n {isType(checkAppInstalled.status, 'Loading') && (\n <Spinner text={t('general.loading')} />\n )}\n {siteToInstallAppOn && (\n <WaitForAppToBeInstalled\n appId={appId}\n site={siteToInstallAppOn}\n onSubmit={() => onSubmit(siteToInstallAppOn)}\n onError={onError}\n />\n )}\n </>\n );\n};\n","import React, { useCallback, type FC } from 'react';\nimport { useTranslation } from '@wix/cli-i18n';\nimport type { SelectOption } from '@wix/cli-ui-kit';\nimport { SelectInput } from '@wix/cli-ui-kit';\nimport { type Site } from '@wix/site-list-client';\nimport { useSiteSelectorBi } from './bi.js';\n\ninterface Props {\n onSubmit: (site: Site) => void;\n sites: Site[];\n}\n\nexport const SiteListSelect: FC<Props> = ({ onSubmit, sites }) => {\n const { t } = useTranslation();\n const bi = useSiteSelectorBi();\n\n const handleSubmit = useCallback(\n (option: SelectOption<Site>) => {\n bi.cliFlowStepAnswered({\n question: t('site_list_select.label'),\n answer: option.title,\n });\n onSubmit(option.value);\n },\n [bi, onSubmit, t]\n );\n\n return (\n <SelectInput<Site>\n label={t('site_list_select.label')}\n options={sites.map((site) => ({\n key: site.id,\n title: site.displayName,\n description: site.viewUrl,\n value: site,\n }))}\n onSubmit={handleSubmit}\n />\n );\n};\n","import { useCallback } from 'react';\nimport { isType } from 'variant';\nimport type { PlatformType } from '@wix/cli-app-definitions';\nimport { useProjectModel } from '../../model.js';\n\nexport function usePlatform() {\n const { model } = useProjectModel();\n\n const isPlatformExists = useCallback(\n (platformType: PlatformType) =>\n model.components.some((component) =>\n component.platforms.some(isType(platformType.type))\n ),\n [model.components]\n );\n\n const hasSinglePlatform = useCallback(\n (platformType: PlatformType) =>\n model.components.every(\n (component) =>\n component.platforms.some(isType(platformType.type)) ||\n component.platforms.length === 0\n ),\n [model.components]\n );\n\n return {\n isPlatformExists,\n hasSinglePlatform,\n };\n}\n"],"mappings":";;kcAAAA,IAAA,IAAAC,EAA4D,SAC5DC,EAAsB,SCDtBC,IAAA,IAAAC,EAA+B,SAC/BC,EAAgC,SCDhCC,ICAAC,IAAA,IAAAC,EAAyC,SACzCC,GAAsB,SCDtBC,IAAA,IAAAC,EAA+B,SAC/BC,GAAsB,SCDtBC,IAAA,IAAAC,GAAwB,SAQjB,SAASC,GAAqBC,EAAoB,CACvD,MAAO,CACL,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,CAACH,EAAM,UAAU,CACnB,EAEMK,KAAoB,gBACvBF,GACCH,EAAM,WAAW,MACdI,GACCA,EAAU,UAAU,QAAK,WAAOD,EAAa,IAAI,CAAC,GAClDC,EAAU,UAAU,SAAW,CACnC,EACF,CAACJ,EAAM,UAAU,CACnB,EAEA,MAAO,CACL,iBAAAE,EACA,kBAAAG,CACF,CACF","names":["init_esm_shims","import_react","import_variant","init_esm_shims","import_react","import_variant","init_esm_shims","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","siteSelectorBiEvents","biLogger","question","action","key","additionalInfo","wixCliAction","answer","wixCliAppFlowStepsAnswers","useSiteSelectorBi","useBiLogger","SiteTypeSelect","onSubmit","onError","sites","bi","useSiteSelectorBi","t","useTranslation","getDevSitesCount","getDevSitesLimit","useDevCenterClient","status","useAsync","handleSubmit","option","React","Spinner","devSitesCount","devSitesLimit","isDevSitesLimitReached","userHasNoSites","SelectInput","SelectOptionAvailability","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","init_esm_shims","init_esm_shims","import_react","init_esm_shims","init_esm_shims","clientSpecMapSchema","z","MetasiteManagerClient","httpClient","metaSiteId","appId","data","clientSpecMap","clientSpecMapSchema","spec","e","CliError","CliErrorCode","useMetasiteManagerClient","httpClient","useHttpClient","MetasiteManagerClient","import_variant","init_esm_shims","import_react","OpenBrowser","siteId","appId","t","useTranslation","bi","useSiteSelectorBi","use_input_default","input","key","openBrowser","React","Trans","Key","AppInstallData","isAbortError","error","WaitForAppToBeInstalled","appId","site","onSubmit","onError","isAppInstalled","useMetasiteManagerClient","status","useAsync","signal","appInstallationPollInterval","getTestOverrides","pWaitFor","TimeoutError","CliError","CliErrorCode","result","React","OpenBrowser","Alert","Trans","CreateDevSite","status","appId","onSubmit","onError","t","useTranslation","React","Spinner","result","Trans","Text","WaitForAppToBeInstalled","messages_default","init_esm_shims","import_react","import_variant","init_esm_shims","import_react","SiteListSelect","onSubmit","sites","t","useTranslation","bi","useSiteSelectorBi","handleSubmit","option","React","SelectInput","site","SelectExistingSite","sites","appId","onSubmit","onError","t","useTranslation","isAppInstalled","useMetasiteManagerClient","siteToInstallAppOn","setSiteToInstallAppOn","checkAppInstalled","useAsyncCallback","_","site","handleSelectSite","React","SiteListSelect","Spinner","WaitForAppToBeInstalled","SiteSelector","appId","biLogger","onSubmit","onError","siteType","setSiteType","createDevSite","useDevCenterClient","siteListClient","useSiteListClient","status","useAsync","createSite","useAsyncCallback","handleSelectSiteType","React","BiProvider","I18nProvider","messages_default","Spinner","Trans","sites","SiteTypeSelect","CreateDevSite","SelectExistingSite","ResolveSiteId","state","onSubmit","exit","useExit","useTranslation","model","useProjectModel","biLogger","useBiLogger","React","Alert","id","SiteSelector","SiteIdProvider","children","siteId","exit","useExit","projectFolder","useProjectModel","writeDebugLog","useDebugLog","siteListClient","useSiteListClient","t","useTranslation","status","merge","useAsync","resolveConfiguredSite","setSite","site","saveAppConfig","SiteIdState","CliError","CliErrorCode","APP_CONFIG_PATH","handleResolveSiteId","React","Spinner","state","variant","ResolveSiteId","SiteIdContext","init_esm_shims","import_react","import_variant","usePlatform","model","useProjectModel","isPlatformExists","platformType","component","hasSinglePlatform"]}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { createRequire as _createRequire } from 'node:module';
|
|
2
|
+
const require = _createRequire(import.meta.url);
|
|
3
|
+
import{c as v}from"./chunk-U2XLB5AO.js";import{a as y}from"./chunk-BO3GDVSJ.js";import{j as C,l as L,m as u}from"./chunk-DPJN7TRY.js";import{ca as w,fa as E,ga as t,m}from"./chunk-HNCYDCAD.js";import{C as f,N as b,V as p,W as B,a as T,d as g,e as P,w as i,z as h}from"./chunk-DRRMAC33.js";import{e as D,h as s}from"./chunk-V4TR6DCM.js";s();async function K(o){let e=w(o),n=E(o);if(!await m(e)||!await m(n))throw new g({code:P.BuiltProjectNeeded()})}s();var r=D(T(),1);var a=({url:o,label:e,withPointer:n=!0})=>r.default.createElement(i,null,r.default.createElement(i,{marginRight:1},n&&r.default.createElement(f,null),r.default.createElement(i,{marginLeft:1},r.default.createElement(b,{url:o},e)))),z=()=>{let{t:o}=B(),{isPlatformExists:e,hasSinglePlatform:n}=v(),{dashboardExtensions:d}=y(),l=C(),x=k=>L({envConfig:l,platformType:k});return r.default.createElement(r.default.Fragment,null,n(t.Dashboard())?r.default.createElement(i,{flexDirection:"row"},r.default.createElement(p,{i18nKey:"general.open_preview.title_single"}),r.default.createElement(a,{withPointer:!1,url:u({envConfig:l,extension:d[0]}),label:o("general.platform.dashboard")})):r.default.createElement(i,{flexDirection:"column"},r.default.createElement(p,{i18nKey:"general.open_preview.title_multiple"}),r.default.createElement(i,{paddingLeft:2,flexDirection:"column"},e(t.Site())&&(l.site.viewUrl?r.default.createElement(a,{url:x(t.Site()),label:o("general.platform.site")}):r.default.createElement(i,{marginRight:1},r.default.createElement(f,null),r.default.createElement(i,{marginLeft:1},r.default.createElement(h,{skin:"secondary",underline:!0},o("general.platform.unpublished_site"))))),e(t.Editor())&&r.default.createElement(a,{url:x(t.Editor()),label:o("general.platform.editor")}),e(t.Dashboard())&&r.default.createElement(a,{url:u({envConfig:l,extension:d[0]}),label:o("general.platform.dashboard")}))))};export{K as a,z as b};
|
|
4
|
+
//# sourceMappingURL=chunk-VZ2WROQY.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/files/assert-build-output-exists.ts","../src/components/Platform/PlatformViewer.tsx"],"sourcesContent":["import { pathExists } from '@wix/cli-fs';\nimport {\n getAppBuildFolder,\n getAppManifestPath,\n} from '@wix/cli-app-definitions';\nimport { CliErrorCode, CliError } from '@wix/cli-error';\n\nexport async function assertBuildOutputExists(projectFolder: string) {\n const buildFolder = getAppBuildFolder(projectFolder);\n const manifestPath = getAppManifestPath(projectFolder);\n\n if (!(await pathExists(buildFolder)) || !(await pathExists(manifestPath))) {\n throw new CliError({\n code: CliErrorCode.BuiltProjectNeeded(),\n });\n }\n}\n","import React, { type FC } from 'react';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport { Box, Link, PointerSmallIcon, Text } from '@wix/cli-ui-kit';\nimport { PlatformType } from '@wix/cli-app-definitions';\nimport { useExtensions } from '../extensions/useExtensions.js';\nimport {\n resolveDashboardExtensionUrl,\n resolvePlatformUrl,\n useEnvConfig,\n} from '../extensions/utils.js';\nimport { usePlatform } from './usePlatform.js';\n\ntype PlatformLinkProps = {\n url: string;\n label: string;\n withPointer?: boolean;\n};\n\nexport const PlatformLink: FC<PlatformLinkProps> = ({\n url,\n label,\n withPointer = true,\n}) => {\n return (\n <Box>\n <Box marginRight={1}>\n {withPointer && <PointerSmallIcon />}\n <Box marginLeft={1}>\n <Link url={url}>{label}</Link>\n </Box>\n </Box>\n </Box>\n );\n};\n\nexport const PlatformViewer: FC = () => {\n const { t } = useTranslation();\n const { isPlatformExists, hasSinglePlatform } = usePlatform();\n const { dashboardExtensions } = useExtensions();\n const envConfig = useEnvConfig();\n\n const getPlatformUrl = (platformType: PlatformType) =>\n resolvePlatformUrl({\n envConfig,\n platformType,\n });\n\n return (\n <>\n {hasSinglePlatform(PlatformType.Dashboard()) ? (\n <Box flexDirection=\"row\">\n <Trans i18nKey=\"general.open_preview.title_single\" />\n <PlatformLink\n withPointer={false}\n url={resolveDashboardExtensionUrl({\n envConfig,\n extension: dashboardExtensions[0],\n })}\n label={t('general.platform.dashboard')}\n />\n </Box>\n ) : (\n <Box flexDirection=\"column\">\n <Trans i18nKey=\"general.open_preview.title_multiple\" />\n <Box paddingLeft={2} flexDirection=\"column\">\n {isPlatformExists(PlatformType.Site()) &&\n (envConfig.site.viewUrl ? (\n <PlatformLink\n url={getPlatformUrl(PlatformType.Site())}\n label={t('general.platform.site')}\n />\n ) : (\n <Box marginRight={1}>\n <PointerSmallIcon />\n <Box marginLeft={1}>\n <Text skin=\"secondary\" underline>\n {t('general.platform.unpublished_site')}\n </Text>\n </Box>\n </Box>\n ))}\n {isPlatformExists(PlatformType.Editor()) && (\n <PlatformLink\n url={getPlatformUrl(PlatformType.Editor())}\n label={t('general.platform.editor')}\n />\n )}\n {isPlatformExists(PlatformType.Dashboard()) && (\n <PlatformLink\n url={resolveDashboardExtensionUrl({\n envConfig,\n extension: dashboardExtensions[0],\n })}\n label={t('general.platform.dashboard')}\n />\n )}\n </Box>\n </Box>\n )}\n </>\n );\n};\n"],"mappings":";;
|
|
1
|
+
{"version":3,"sources":["../src/files/assert-build-output-exists.ts","../src/components/Platform/PlatformViewer.tsx"],"sourcesContent":["import { pathExists } from '@wix/cli-fs';\nimport {\n getAppBuildFolder,\n getAppManifestPath,\n} from '@wix/cli-app-definitions';\nimport { CliErrorCode, CliError } from '@wix/cli-error';\n\nexport async function assertBuildOutputExists(projectFolder: string) {\n const buildFolder = getAppBuildFolder(projectFolder);\n const manifestPath = getAppManifestPath(projectFolder);\n\n if (!(await pathExists(buildFolder)) || !(await pathExists(manifestPath))) {\n throw new CliError({\n code: CliErrorCode.BuiltProjectNeeded(),\n });\n }\n}\n","import React, { type FC } from 'react';\nimport { Trans, useTranslation } from '@wix/cli-i18n';\nimport { Box, Link, PointerSmallIcon, Text } from '@wix/cli-ui-kit';\nimport { PlatformType } from '@wix/cli-app-definitions';\nimport { useExtensions } from '../extensions/useExtensions.js';\nimport {\n resolveDashboardExtensionUrl,\n resolvePlatformUrl,\n useEnvConfig,\n} from '../extensions/utils.js';\nimport { usePlatform } from './usePlatform.js';\n\ntype PlatformLinkProps = {\n url: string;\n label: string;\n withPointer?: boolean;\n};\n\nexport const PlatformLink: FC<PlatformLinkProps> = ({\n url,\n label,\n withPointer = true,\n}) => {\n return (\n <Box>\n <Box marginRight={1}>\n {withPointer && <PointerSmallIcon />}\n <Box marginLeft={1}>\n <Link url={url}>{label}</Link>\n </Box>\n </Box>\n </Box>\n );\n};\n\nexport const PlatformViewer: FC = () => {\n const { t } = useTranslation();\n const { isPlatformExists, hasSinglePlatform } = usePlatform();\n const { dashboardExtensions } = useExtensions();\n const envConfig = useEnvConfig();\n\n const getPlatformUrl = (platformType: PlatformType) =>\n resolvePlatformUrl({\n envConfig,\n platformType,\n });\n\n return (\n <>\n {hasSinglePlatform(PlatformType.Dashboard()) ? (\n <Box flexDirection=\"row\">\n <Trans i18nKey=\"general.open_preview.title_single\" />\n <PlatformLink\n withPointer={false}\n url={resolveDashboardExtensionUrl({\n envConfig,\n extension: dashboardExtensions[0],\n })}\n label={t('general.platform.dashboard')}\n />\n </Box>\n ) : (\n <Box flexDirection=\"column\">\n <Trans i18nKey=\"general.open_preview.title_multiple\" />\n <Box paddingLeft={2} flexDirection=\"column\">\n {isPlatformExists(PlatformType.Site()) &&\n (envConfig.site.viewUrl ? (\n <PlatformLink\n url={getPlatformUrl(PlatformType.Site())}\n label={t('general.platform.site')}\n />\n ) : (\n <Box marginRight={1}>\n <PointerSmallIcon />\n <Box marginLeft={1}>\n <Text skin=\"secondary\" underline>\n {t('general.platform.unpublished_site')}\n </Text>\n </Box>\n </Box>\n ))}\n {isPlatformExists(PlatformType.Editor()) && (\n <PlatformLink\n url={getPlatformUrl(PlatformType.Editor())}\n label={t('general.platform.editor')}\n />\n )}\n {isPlatformExists(PlatformType.Dashboard()) && (\n <PlatformLink\n url={resolveDashboardExtensionUrl({\n envConfig,\n extension: dashboardExtensions[0],\n })}\n label={t('general.platform.dashboard')}\n />\n )}\n </Box>\n </Box>\n )}\n </>\n );\n};\n"],"mappings":";;gVAAAA,IAOA,eAAsBC,EAAwBC,EAAuB,CACnE,IAAMC,EAAcC,EAAkBF,CAAa,EAC7CG,EAAeC,EAAmBJ,CAAa,EAErD,GAAI,CAAE,MAAMK,EAAWJ,CAAW,GAAM,CAAE,MAAMI,EAAWF,CAAY,EACrE,MAAM,IAAIG,EAAS,CACjB,KAAMC,EAAa,mBAAmB,CACxC,CAAC,CAEL,CChBAC,IAAA,IAAAC,EAA+B,SAkBxB,IAAMC,EAAsC,CAAC,CAClD,IAAAC,EACA,MAAAC,EACA,YAAAC,EAAc,EAChB,IAEI,EAAAC,Q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ACf,EAAAD,QAAA,cAACoB,EAAA,CAAK,KAAK,YAAY,UAAS,IAC7Bf,EAAE,mCAAmC,CACxC,CACF,CACF,GAEHE,EAAiBU,EAAa,OAAO,CAAC,GACrC,EAAAjB,QAAA,cAACJ,EAAA,CACC,IAAKkB,EAAeG,EAAa,OAAO,CAAC,EACzC,MAAOZ,EAAE,yBAAyB,EACpC,EAEDE,EAAiBU,EAAa,UAAU,CAAC,GACxC,EAAAjB,QAAA,cAACJ,EAAA,CACC,IAAKuB,EAA6B,CAChC,UAAAP,EACA,UAAWF,EAAoB,CAAC,CAClC,CAAC,EACD,MAAOL,EAAE,4BAA4B,EACvC,CAEJ,CACF,CAEJ,CAEJ","names":["init_esm_shims","assertBuildOutputExists","projectFolder","buildFolder","getAppBuildFolder","manifestPath","getAppManifestPath","pathExists","CliError","CliErrorCode","init_esm_shims","import_react","PlatformLink","url","label","withPointer","React","Box_default","PointerSmallIcon","Link","PlatformViewer","t","useTranslation","isPlatformExists","hasSinglePlatform","usePlatform","dashboardExtensions","useExtensions","envConfig","useEnvConfig","getPlatformUrl","platformType","resolvePlatformUrl","PlatformType","Trans","resolveDashboardExtensionUrl","Text"]}
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createRequire as _createRequire } from 'node:module';
|
|
2
2
|
const require = _createRequire(import.meta.url);
|
|
3
|
-
import{a as A}from"./chunk-
|
|
3
|
+
import{a as A}from"./chunk-LE2AC3SJ.js";import{a as Z}from"./chunk-P2MQOXIV.js";import"./chunk-J5ANBYWF.js";import{a as S,l as V}from"./chunk-DRRMAC33.js";import{a as H,c as E,e as $,h as m}from"./chunk-V4TR6DCM.js";var k=E(W=>{"use strict";m();var P=class extends Error{constructor(e,t,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=t,this.exitCode=e,this.nestedError=void 0}},N=class extends P{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};W.CommanderError=P;W.InvalidArgumentError=N});var T=E(j=>{"use strict";m();var{InvalidArgumentError:He}=k(),M=class{constructor(e,t){switch(this.description=t||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,t){return t===this.defaultValue||!Array.isArray(t)?[e]:t.concat(e)}default(e,t){return this.defaultValue=e,this.defaultValueDescription=t,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(t,i)=>{if(!this.argChoices.includes(t))throw new He(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(t,i):t},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function ke(o){let e=o.name()+(o.variadic===!0?"...":"");return o.required?"<"+e+">":"["+e+"]"}j.Argument=M;j.humanReadableArgName=ke});var R=E(ee=>{"use strict";m();var{humanReadableArgName:Pe}=T(),U=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let t=e.commands.filter(n=>!n._hidden),i=e._getHelpCommand();return i&&!i._hidden&&t.push(i),this.sortSubcommands&&t.sort((n,r)=>n.name().localeCompare(r.name())),t}compareOptions(e,t){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(t))}visibleOptions(e){let t=e.options.filter(n=>!n.hidden),i=e._getHelpOption();if(i&&!i.hidden){let n=i.short&&e._findOption(i.short),r=i.long&&e._findOption(i.long);!n&&!r?t.push(i):i.long&&!r?t.push(e.createOption(i.long,i.description)):i.short&&!n&&t.push(e.createOption(i.short,i.description))}return this.sortOptions&&t.sort(this.compareOptions),t}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let t=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(r=>!r.hidden);t.push(...n)}return this.sortOptions&&t.sort(this.compareOptions),t}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(t=>{t.description=t.description||e._argsDescription[t.name()]||""}),e.registeredArguments.find(t=>t.description)?e.registeredArguments:[]}subcommandTerm(e){let t=e.registeredArguments.map(i=>Pe(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(t?" "+t:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,t){return t.visibleCommands(e).reduce((i,n)=>Math.max(i,t.subcommandTerm(n).length),0)}longestOptionTermLength(e,t){return t.visibleOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,t){return t.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,t.optionTerm(n).length),0)}longestArgumentTermLength(e,t){return t.visibleArguments(e).reduce((i,n)=>Math.max(i,t.argumentTerm(n).length),0)}commandUsage(e){let t=e._name;e._aliases[0]&&(t=t+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+t+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let t=[];return e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&t.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&t.push(`env: ${e.envVar}`),t.length>0?`${e.description} (${t.join(", ")})`:e.description}argumentDescription(e){let t=[];if(e.argChoices&&t.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&t.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),t.length>0){let i=`(${t.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatHelp(e,t){let i=t.padWidth(e,t),n=t.helpWidth||80,r=2,s=2;function u(p,x){if(x){let D=`${p.padEnd(i+s)}${x}`;return t.wrap(D,n-r,i+s)}return p}function a(p){return p.join(`
|
|
4
4
|
`).replace(/^/gm," ".repeat(r))}let l=[`Usage: ${t.commandUsage(e)}`,""],h=t.commandDescription(e);h.length>0&&(l=l.concat([t.wrap(h,n,0),""]));let c=t.visibleArguments(e).map(p=>u(t.argumentTerm(p),t.argumentDescription(p)));c.length>0&&(l=l.concat(["Arguments:",a(c),""]));let C=t.visibleOptions(e).map(p=>u(t.optionTerm(p),t.optionDescription(p)));if(C.length>0&&(l=l.concat(["Options:",a(C),""])),this.showGlobalOptions){let p=t.visibleGlobalOptions(e).map(x=>u(t.optionTerm(x),t.optionDescription(x)));p.length>0&&(l=l.concat(["Global Options:",a(p),""]))}let y=t.visibleCommands(e).map(p=>u(t.subcommandTerm(p),t.subcommandDescription(p)));return y.length>0&&(l=l.concat(["Commands:",a(y),""])),l.join(`
|
|
5
5
|
`)}padWidth(e,t){return Math.max(t.longestOptionTermLength(e,t),t.longestGlobalOptionTermLength(e,t),t.longestSubcommandTermLength(e,t),t.longestArgumentTermLength(e,t))}wrap(e,t,i,n=40){let r=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${r}]+`);if(e.match(s))return e;let u=t-i;if(u<n)return e;let a=e.slice(0,i),l=e.slice(i).replace(`\r
|
|
6
6
|
`,`
|
|
@@ -21,5 +21,5 @@ Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._life
|
|
|
21
21
|
`),this.outputHelp({error:!0}));let i=t||{},n=i.exitCode||1,r=i.code||"commander.error";this._exit(n,r,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in d.env){let t=e.attributeName();(this.getOptionValue(t)===void 0||["default","config","env"].includes(this.getOptionValueSource(t)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,d.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new Ue(this.options),t=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&t(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!t(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(e){let t=`error: missing required argument '${e}'`;this.error(t,{code:"commander.missingArgument"})}optionMissingArgument(e){let t=`error: option '${e.flags}' argument missing`;this.error(t,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let t=`error: required option '${e.flags}' not specified`;this.error(t,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,t){let i=s=>{let u=s.attributeName(),a=this.getOptionValue(u),l=this.options.find(c=>c.negate&&u===c.attributeName()),h=this.options.find(c=>!c.negate&&u===c.attributeName());return l&&(l.presetArg===void 0&&a===!1||l.presetArg!==void 0&&a===l.presetArg)?l:h||s},n=s=>{let u=i(s),a=u.attributeName();return this.getOptionValueSource(a)==="env"?`environment variable '${u.envVar}'`:`option '${u.flags}'`},r=`error: ${n(e)} cannot be used with ${n(t)}`;this.error(r,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let t="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],r=this;do{let s=r.createHelp().visibleOptions(r).filter(u=>u.long).map(u=>u.long);n=n.concat(s),r=r.parent}while(r&&!r._enablePositionalOptions);t=re(e,n)}let i=`error: unknown option '${e}'${t}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let t=this.registeredArguments.length,i=t===1?"":"s",r=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${t} argument${i} but got ${e.length}.`;this.error(r,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],t="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(r=>{n.push(r.name()),r.alias()&&n.push(r.alias())}),t=re(e,n)}let i=`error: unknown command '${e}'${t}`;this.error(i,{code:"commander.unknownCommand"})}version(e,t,i){if(e===void 0)return this._version;this._version=e,t=t||"-V, --version",i=i||"output the version number";let n=this.createOption(t,i);return this._versionOptionName=n.attributeName(),this._registerOption(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
|
|
22
22
|
`),this._exit(0,"commander.version",e)}),this}description(e,t){return e===void 0&&t===void 0?this._description:(this._description=e,t&&(this._argsDescription=t),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let t=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(t=this.commands[this.commands.length-1]),e===t._name)throw new Error("Command alias can't be the same as its name");let i=this.parent?._findCommand(e);if(i){let n=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${e}' to command '${this.name()}' as already have command '${n}'`)}return t._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(t=>this.alias(t)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let t=this.registeredArguments.map(i=>Me(i));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=v.basename(e,v.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let t=this.createHelp();return t.helpWidth===void 0&&(t.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),t.formatHelp(this,t)}_getHelpContext(e){e=e||{};let t={error:!!e.error},i;return t.error?i=n=>this._outputConfiguration.writeErr(n):i=n=>this._outputConfiguration.writeOut(n),t.write=e.write||i,t.command=this,t}outputHelp(e){let t;typeof e=="function"&&(t=e,e=void 0);let i=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(r=>r.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation(i);if(t&&(n=t(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._getHelpOption()?.long&&this.emit(this._getHelpOption().long),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(r=>r.emit("afterAllHelp",i))}helpOption(e,t){return typeof e=="boolean"?(e?this._helpOption=this._helpOption??void 0:this._helpOption=null,this):(e=e??"-h, --help",t=t??"display help for command",this._helpOption=this.createOption(e,t),this)}_getHelpOption(){return this._helpOption===void 0&&this.helpOption(void 0,void 0),this._helpOption}addHelpOption(e){return this._helpOption=e,this}help(e){this.outputHelp(e);let t=d.exitCode||0;t===0&&e&&typeof e!="function"&&e.error&&(t=1),this._exit(t,"commander.help","(outputHelp)")}addHelpText(e,t){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
|
|
23
23
|
Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,r=>{let s;typeof t=="function"?s=t({error:r.error,command:r.command}):s=t,s&&r.write(`${s}
|
|
24
|
-
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function se(o){return o.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",n="9229",r;return(r=e.match(/^(--inspect(-brk)?)$/))!==null?t=r[1]:(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=r[1],/^\d+$/.test(r[3])?n=r[3]:i=r[3]):(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=r[1],i=r[3],n=r[4]),t&&n!=="0"?`${t}=${i}:${parseInt(n)+1}`:e})}oe.Command=Q});var me=E(w=>{"use strict";m();var{Argument:ue}=T(),{Command:X}=ae(),{CommanderError:Re,InvalidArgumentError:le}=k(),{Help:Ge}=R(),{Option:he}=J();w.program=new X;w.createCommand=o=>new X(o);w.createOption=(o,e)=>new he(o,e);w.createArgument=(o,e)=>new ue(o,e);w.Command=X;w.Option=he;w.Argument=ue;w.Help=Ge;w.CommanderError=Re;w.InvalidArgumentError=le;w.InvalidOptionArgumentError=le});var de=E((O,ce)=>{"use strict";m();var b=me();O=ce.exports={};O.program=new b.Command;O.Argument=b.Argument;O.Command=b.Command;O.CommanderError=b.CommanderError;O.Help=b.Help;O.InvalidArgumentError=b.InvalidArgumentError;O.InvalidOptionArgumentError=b.InvalidArgumentError;O.Option=b.Option;O.createCommand=o=>new b.Command(o);O.createOption=(o,e)=>new b.Option(o,e);O.createArgument=(o,e)=>new b.Argument(o,e)});m();m();m();var pe=$(de(),1),{program:at,createCommand:_,createArgument:ut,createOption:lt,CommanderError:ht,InvalidArgumentError:I,InvalidOptionArgumentError:mt,Command:ct,Argument:dt,Option:fe,Help:pt}=pe.default;m();var ge=o=>_("build").action(async(e,t)=>{let{runCommand:i}=await import("./render-command-
|
|
24
|
+
`)}),this}_outputHelpIfRequested(e){let t=this._getHelpOption();t&&e.find(n=>t.is(n))&&(this.outputHelp(),this._exit(0,"commander.helpDisplayed","(outputHelp)"))}};function se(o){return o.map(e=>{if(!e.startsWith("--inspect"))return e;let t,i="127.0.0.1",n="9229",r;return(r=e.match(/^(--inspect(-brk)?)$/))!==null?t=r[1]:(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(t=r[1],/^\d+$/.test(r[3])?n=r[3]:i=r[3]):(r=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(t=r[1],i=r[3],n=r[4]),t&&n!=="0"?`${t}=${i}:${parseInt(n)+1}`:e})}oe.Command=Q});var me=E(w=>{"use strict";m();var{Argument:ue}=T(),{Command:X}=ae(),{CommanderError:Re,InvalidArgumentError:le}=k(),{Help:Ge}=R(),{Option:he}=J();w.program=new X;w.createCommand=o=>new X(o);w.createOption=(o,e)=>new he(o,e);w.createArgument=(o,e)=>new ue(o,e);w.Command=X;w.Option=he;w.Argument=ue;w.Help=Ge;w.CommanderError=Re;w.InvalidArgumentError=le;w.InvalidOptionArgumentError=le});var de=E((O,ce)=>{"use strict";m();var b=me();O=ce.exports={};O.program=new b.Command;O.Argument=b.Argument;O.Command=b.Command;O.CommanderError=b.CommanderError;O.Help=b.Help;O.InvalidArgumentError=b.InvalidArgumentError;O.InvalidOptionArgumentError=b.InvalidArgumentError;O.Option=b.Option;O.createCommand=o=>new b.Command(o);O.createOption=(o,e)=>new b.Option(o,e);O.createArgument=(o,e)=>new b.Argument(o,e)});m();m();m();var pe=$(de(),1),{program:at,createCommand:_,createArgument:ut,createOption:lt,CommanderError:ht,InvalidArgumentError:I,InvalidOptionArgumentError:mt,Command:ct,Argument:dt,Option:fe,Help:pt}=pe.default;m();var ge=o=>_("build").action(async(e,t)=>{let{runCommand:i}=await import("./render-command-CHJCQHTD.js"),{build:n}=await import("./build-OKG7MQPN.js");await i(t,o,n)});m();var _e=$(S(),1);var Ce=o=>{let e=A();return _("dev").option("-s, --https",e("dev_command_def.option.https")).action(async(t,i)=>{let{DevCommand:n}=await import("./DevCommand-MXZUVA5G.js"),{renderCommand:r}=await import("./render-command-CHJCQHTD.js"),{https:s=!1}=t;await r(i,o,_e.default.createElement(n,{https:s}),{watchForModelChanges:!0})})};m();var we=$(S(),1);m();function F(o){let e=V.union([V.string().uuid(),V.literal("current")]).transform(t=>t==="current"?void 0:t).safeParse(o);if(e.success)return e.data;throw new I('Value must be a valid GUID or "current"')}function q(o){let e=V.string().url().safeParse(o);if(e.success)return e.data;throw new I("Value must be a valid URL")}function Oe(o){let e=V.string().regex(/^(0|[1-9]\d*)\.(0|[1-9]\d*)(\.(0|[1-9]\d*))?$/).safeParse(o);if(e.success)return e.data;throw new I("Version value should be in semver format `x.x.x`")}var be=o=>{let e=A();return _("preview").option("-s, --site <site-id>",e("app_preview_command_def.option.site"),F).option("--base-url <url>",e("app_preview_command_def.option.base_url"),q).option("--no-input",e("app_preview_command_def.option.no_input")).action(async(t,i)=>{let{site:n,baseUrl:r,input:s}=t,{renderCommand:u,runCommand:a}=await import("./render-command-CHJCQHTD.js");if(!s)return a(i,o,async()=>{let{nonInteractivePreview:h}=await import("./preview-A2JB6NDU.js");return h({siteId:n,baseUrl:r},o)});let{PreviewCommand:l}=await import("./PreviewCommand-BWLPYFTW.js");await u(i,o,we.default.createElement(l,{baseUrl:r,siteIdOverride:n}))})};m();var Ae=$(S(),1);var ve=o=>{let e=A();return _("create-version").addOption(new fe("-t, --version-type <type>",e("create_version_command_def.option.version_type")).choices(["major","minor"])).option("-s, --site <site-id>",e("create_version_command_def.option.site"),F).option("-y, --approve-preview",e("create_version_command_def.option.approve_preview")).option("--base-url <url>",e("create_version_command_def.option.base_url"),q).action(async(t,i)=>{let{VersionType:n}=await import("./types.impl-L2DPGJ77.js"),{renderCommand:r}=await import("./render-command-CHJCQHTD.js"),{CreateVersionCommand:s}=await import("./CreateVersionCommand-5BULGDHW.js"),{approvePreview:u=!1,versionType:a,baseUrl:l,site:h}=t,c={major:n.MAJOR,minor:n.MINOR},C=a?c[a]:void 0;await r(i,o,Ae.default.createElement(s,{baseUrl:l,siteIdOverride:h,preApprovePreview:u,versionType:C}))})};m();var xe=$(S(),1);var Ee=o=>_("serve").action(async(e,t)=>{let{renderCommand:i}=await import("./render-command-CHJCQHTD.js"),{ServeCommand:n}=await import("./ServeCommand-BH655VZV.js");await i(t,o,xe.default.createElement(n,null))});m();var ye=$(S(),1);var $e=o=>{let e=A();return _("generate").description(e("generate_command.description")).action(async(t,i)=>{let{GenerateCommand:n}=await import("./GenerateCommand-7ASJKBK2.js"),{renderCommand:r}=await import("./render-command-CHJCQHTD.js");await r(i,o,ye.default.createElement(n,null))})};m();var Se=$(S(),1);var Ve=o=>{let e=A();return _("logs").option("--version <version>",e("app_preview_command_def.option.base_url"),Oe).action(async(t,i)=>{let{version:n}=t,{renderCommand:r}=await import("./render-command-CHJCQHTD.js"),{LogsCommand:s}=await import("./LogsCommand-KEFNJUBL.js");await r(i,o,Se.default.createElement(s,{version:n}))})};var Le=async o=>_("app").version(Z,"-v, --version","Output the version number").enablePositionalOptions(!0).helpOption("-h, --help","Display help for command").helpCommand(!1).addCommand(Ce(o)).addCommand(ge(o)).addCommand(Ee(o)).addCommand(be(o)).addCommand(ve(o)).addCommand($e(o)).addCommand(Ve(o));export{Le as getRootCommand};
|
|
25
25
|
//# sourceMappingURL=index.js.map
|