@lomray/vite-ssr-boost 7.1.0 → 8.0.0-beta.2

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 (248) hide show
  1. package/README.md +18 -1
  2. package/adapters/body.d.ts +5 -0
  3. package/adapters/body.js +2 -0
  4. package/adapters/body.js.map +1 -0
  5. package/adapters/compression.d.ts +11 -0
  6. package/adapters/compression.js +2 -0
  7. package/adapters/compression.js.map +1 -0
  8. package/adapters/edge.d.ts +11 -0
  9. package/adapters/edge.js +2 -0
  10. package/adapters/edge.js.map +1 -0
  11. package/adapters/express/create-request.d.ts +11 -0
  12. package/adapters/express/create-request.js +2 -0
  13. package/adapters/express/create-request.js.map +1 -0
  14. package/adapters/express/entry.d.ts +55 -0
  15. package/adapters/express/entry.js.map +1 -0
  16. package/{services → adapters/express}/prepare-server.d.ts +15 -40
  17. package/adapters/express/prepare-server.js +2 -0
  18. package/adapters/express/prepare-server.js.map +1 -0
  19. package/adapters/express/render.d.ts +63 -0
  20. package/adapters/express/render.js +2 -0
  21. package/adapters/express/render.js.map +1 -0
  22. package/adapters/express/server.d.ts +15 -0
  23. package/adapters/express/server.js +2 -0
  24. package/adapters/express/server.js.map +1 -0
  25. package/adapters/express.d.ts +11 -0
  26. package/adapters/express.js +2 -0
  27. package/adapters/express.js.map +1 -0
  28. package/adapters/fastify.d.ts +23 -0
  29. package/adapters/fastify.js +2 -0
  30. package/adapters/fastify.js.map +1 -0
  31. package/adapters/hono.d.ts +13 -0
  32. package/adapters/hono.js +2 -0
  33. package/adapters/hono.js.map +1 -0
  34. package/adapters/node.d.ts +19 -0
  35. package/adapters/node.js +2 -0
  36. package/adapters/node.js.map +1 -0
  37. package/browser/entry.d.ts +9 -9
  38. package/browser/entry.js +1 -1
  39. package/browser/entry.js.map +1 -1
  40. package/cli/build.d.ts +2 -2
  41. package/cli/build.js.map +1 -1
  42. package/cli/helpers/keyboard-input.d.ts +1 -1
  43. package/cli/helpers/keyboard-input.js +1 -1
  44. package/cli/helpers/keyboard-input.js.map +1 -1
  45. package/cli/helpers/vite-reset-cache.d.ts +1 -1
  46. package/cli/helpers/vite-reset-cache.js.map +1 -1
  47. package/cli/interfaces/actions.d.ts +8 -9
  48. package/cli/run-amplify-build.d.ts +1 -1
  49. package/cli/run-amplify-build.js.map +1 -1
  50. package/cli/run-dev.d.ts +3 -4
  51. package/cli/run-dev.js +1 -1
  52. package/cli/run-dev.js.map +1 -1
  53. package/cli/run-docker-build.d.ts +2 -2
  54. package/cli/run-docker-build.js.map +1 -1
  55. package/cli/run-prod.d.ts +5 -6
  56. package/cli/run-prod.js +1 -1
  57. package/cli/run-prod.js.map +1 -1
  58. package/cli/run-serverless.d.ts +3 -3
  59. package/cli/run-serverless.js +1 -1
  60. package/cli/run-serverless.js.map +1 -1
  61. package/cli/run-vercel-build.d.ts +1 -1
  62. package/cli/run-vercel-build.js.map +1 -1
  63. package/cli.js +1 -1
  64. package/cli.js.map +1 -1
  65. package/components/navigate.d.ts +3 -3
  66. package/components/navigate.js.map +1 -1
  67. package/components/only-client.d.ts +2 -2
  68. package/components/only-client.js +1 -1
  69. package/components/only-client.js.map +1 -1
  70. package/components/render-client.d.ts +4 -4
  71. package/components/render-client.js +1 -1
  72. package/components/render-client.js.map +1 -1
  73. package/components/response-status.d.ts +2 -2
  74. package/components/response-status.js +1 -1
  75. package/components/response-status.js.map +1 -1
  76. package/components/scroll-to-top.d.ts +2 -2
  77. package/components/scroll-to-top.js +1 -1
  78. package/components/scroll-to-top.js.map +1 -1
  79. package/components/with-suspense.d.ts +3 -3
  80. package/components/with-suspense.js.map +1 -1
  81. package/constants/cli-actions.d.ts +1 -1
  82. package/constants/cli-actions.js.map +1 -1
  83. package/constants/cli-context.d.ts +4 -5
  84. package/constants/cli-context.js.map +1 -1
  85. package/constants/cli-name.d.ts +1 -1
  86. package/constants/cli-name.js.map +1 -1
  87. package/constants/cli-shortcuts.d.ts +2 -2
  88. package/constants/cli-shortcuts.js +1 -1
  89. package/constants/cli-shortcuts.js.map +1 -1
  90. package/constants/common.js.map +1 -1
  91. package/constants/plugin-name.d.ts +1 -1
  92. package/constants/plugin-name.js.map +1 -1
  93. package/constants/stream-error.d.ts +1 -1
  94. package/constants/stream-error.js.map +1 -1
  95. package/context/server.d.ts +3 -4
  96. package/context/server.js.map +1 -1
  97. package/core/compose-html.d.ts +5 -0
  98. package/core/compose-html.js +2 -0
  99. package/core/compose-html.js.map +1 -0
  100. package/core/early-hints.d.ts +6 -0
  101. package/core/early-hints.js +2 -0
  102. package/core/early-hints.js.map +1 -0
  103. package/core/handler.d.ts +30 -0
  104. package/core/handler.js +2 -0
  105. package/core/handler.js.map +1 -0
  106. package/core/head-response.d.ts +5 -0
  107. package/core/head-response.js +2 -0
  108. package/core/head-response.js.map +1 -0
  109. package/core/headers.d.ts +12 -0
  110. package/core/headers.js +2 -0
  111. package/core/headers.js.map +1 -0
  112. package/core/render.d.ts +101 -0
  113. package/core/render.js +2 -0
  114. package/core/render.js.map +1 -0
  115. package/core/transform-html.d.ts +7 -0
  116. package/core/transform-html.js +2 -0
  117. package/core/transform-html.js.map +1 -0
  118. package/core/types.d.ts +7 -0
  119. package/core/types.js +2 -0
  120. package/core/types.js.map +1 -0
  121. package/edge/render-to-stream.d.ts +6 -0
  122. package/edge/render-to-stream.js +2 -0
  123. package/edge/render-to-stream.js.map +1 -0
  124. package/helpers/build-custom-state.d.ts +2 -3
  125. package/helpers/build-custom-state.js +1 -1
  126. package/helpers/build-custom-state.js.map +1 -1
  127. package/helpers/build-router-state.d.ts +2 -2
  128. package/helpers/build-router-state.js.map +1 -1
  129. package/helpers/create-focus-only.d.ts +3 -3
  130. package/helpers/create-focus-only.js.map +1 -1
  131. package/helpers/dev-marker.d.ts +1 -1
  132. package/helpers/dev-marker.js.map +1 -1
  133. package/helpers/get-server-state.d.ts +1 -1
  134. package/helpers/get-server-state.js.map +1 -1
  135. package/helpers/html-escape.d.ts +1 -1
  136. package/helpers/html-escape.js +1 -1
  137. package/helpers/html-escape.js.map +1 -1
  138. package/helpers/import-route.d.ts +7 -7
  139. package/helpers/import-route.js +1 -1
  140. package/helpers/import-route.js.map +1 -1
  141. package/helpers/is-route-file.d.ts +1 -1
  142. package/helpers/is-route-file.js.map +1 -1
  143. package/helpers/obtain-stream-error.d.ts +3 -3
  144. package/helpers/obtain-stream-error.js +1 -1
  145. package/helpers/obtain-stream-error.js.map +1 -1
  146. package/helpers/plugin-config.d.ts +5 -5
  147. package/helpers/plugin-config.js +1 -1
  148. package/helpers/plugin-config.js.map +1 -1
  149. package/helpers/print-server-info.d.ts +3 -4
  150. package/helpers/print-server-info.js +1 -1
  151. package/helpers/print-server-info.js.map +1 -1
  152. package/helpers/print-server-urls.d.ts +2 -2
  153. package/helpers/print-server-urls.js +1 -1
  154. package/helpers/print-server-urls.js.map +1 -1
  155. package/helpers/process-stop.d.ts +1 -1
  156. package/helpers/process-stop.js.map +1 -1
  157. package/helpers/resolve-server-urls.d.ts +3 -4
  158. package/helpers/resolve-server-urls.js +1 -1
  159. package/helpers/resolve-server-urls.js.map +1 -1
  160. package/helpers/serialize-errors.d.ts +2 -2
  161. package/helpers/serialize-errors.js.map +1 -1
  162. package/helpers/vite-aliases.d.ts +2 -2
  163. package/helpers/vite-aliases.js +1 -1
  164. package/helpers/vite-aliases.js.map +1 -1
  165. package/interfaces/fc-route.d.ts +4 -4
  166. package/interfaces/fc-route.js.map +1 -1
  167. package/interfaces/fc.d.ts +3 -4
  168. package/interfaces/route-object.d.ts +6 -6
  169. package/node/compress-response.d.ts +6 -0
  170. package/node/compress-response.js +2 -0
  171. package/node/compress-response.js.map +1 -0
  172. package/node/create-headers.d.ts +6 -0
  173. package/node/create-headers.js +2 -0
  174. package/node/create-headers.js.map +1 -0
  175. package/node/create-request.d.ts +13 -0
  176. package/node/create-request.js +2 -0
  177. package/node/create-request.js.map +1 -0
  178. package/node/http.d.ts +4 -0
  179. package/node/http.js +2 -0
  180. package/node/http.js.map +1 -0
  181. package/node/render-to-stream.d.ts +6 -0
  182. package/node/render-to-stream.js +2 -0
  183. package/node/render-to-stream.js.map +1 -0
  184. package/node/request-signal.d.ts +10 -0
  185. package/node/request-signal.js +2 -0
  186. package/node/request-signal.js.map +1 -0
  187. package/node/split-link-header.d.ts +5 -0
  188. package/node/split-link-header.js +2 -0
  189. package/node/split-link-header.js.map +1 -0
  190. package/node/write-early-hints.d.ts +6 -0
  191. package/node/write-early-hints.js +2 -0
  192. package/node/write-early-hints.js.map +1 -0
  193. package/node/write-fetch-response.d.ts +11 -0
  194. package/node/write-fetch-response.js +2 -0
  195. package/node/write-fetch-response.js.map +1 -0
  196. package/package.json +89 -27
  197. package/plugin.d.ts +7 -7
  198. package/plugin.js.map +1 -1
  199. package/plugins/create-spa-index.d.ts +3 -3
  200. package/plugins/create-spa-index.js.map +1 -1
  201. package/plugins/handle-custom-entrypoint.d.ts +4 -4
  202. package/plugins/handle-custom-entrypoint.js +1 -1
  203. package/plugins/handle-custom-entrypoint.js.map +1 -1
  204. package/plugins/make-aliases.d.ts +3 -3
  205. package/plugins/make-aliases.js +1 -1
  206. package/plugins/make-aliases.js.map +1 -1
  207. package/plugins/normalize-route.d.ts +3 -3
  208. package/plugins/normalize-route.js.map +1 -1
  209. package/services/build.d.ts +5 -51
  210. package/services/build.js +1 -1
  211. package/services/build.js.map +1 -1
  212. package/services/logger.d.ts +2 -30
  213. package/services/logger.js.map +1 -1
  214. package/services/parse-routes.d.ts +5 -42
  215. package/services/parse-routes.js +1 -1
  216. package/services/parse-routes.js.map +1 -1
  217. package/services/path-normalize.d.ts +3 -18
  218. package/services/path-normalize.js +1 -1
  219. package/services/path-normalize.js.map +1 -1
  220. package/services/server-api.d.ts +1 -7
  221. package/services/server-api.js.map +1 -1
  222. package/services/server-config.d.ts +7 -52
  223. package/services/server-config.js +1 -1
  224. package/services/server-config.js.map +1 -1
  225. package/services/ssr-manifest.d.ts +20 -60
  226. package/services/ssr-manifest.js +1 -1
  227. package/services/ssr-manifest.js.map +1 -1
  228. package/workflow/Dockerfile +1 -1
  229. package/helpers/handle-response.d.ts +0 -7
  230. package/helpers/handle-response.js +0 -2
  231. package/helpers/handle-response.js.map +0 -1
  232. package/node/create-fetch-request.d.ts +0 -7
  233. package/node/create-fetch-request.js +0 -2
  234. package/node/create-fetch-request.js.map +0 -1
  235. package/node/entry.d.ts +0 -63
  236. package/node/entry.js.map +0 -1
  237. package/node/render.d.ts +0 -64
  238. package/node/render.js +0 -2
  239. package/node/render.js.map +0 -1
  240. package/node/server.d.ts +0 -16
  241. package/node/server.js +0 -2
  242. package/node/server.js.map +0 -1
  243. package/node/write-response.d.ts +0 -14
  244. package/node/write-response.js +0 -2
  245. package/node/write-response.js.map +0 -1
  246. package/services/prepare-server.js +0 -2
  247. package/services/prepare-server.js.map +0 -1
  248. /package/{node → adapters/express}/entry.js +0 -0
package/cli/build.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"build.js","sources":["../../src/cli/build.ts"],"sourcesContent":["import { performance } from 'node:perf_hooks';\nimport chalk from 'chalk';\nimport cliName from '@constants/cli-name';\nimport type { IBuildParams } from '@services/build';\nimport Build from '@services/build';\n\n/**\n * Build application\n */\nasync function build(params: IBuildParams): Promise<void> {\n const perfStart = performance.now();\n const buildService = new Build(params);\n\n await buildService.build();\n\n const durationMs = Math.ceil(performance.now() - perfStart);\n const duration = durationMs > 1000 ? (durationMs / 1000).toFixed(2) : durationMs;\n const units = durationMs > 1000 ? 's' : 'ms';\n\n const buildDurationString = chalk.dim(\n `${chalk.yellowBright(buildService.getRunningBuildNames().join(','))} built in ${chalk.reset(chalk.bold(duration))} ${units}`,\n );\n\n console.info(\n `\\n ${chalk.green(`${chalk.bold(cliName.toUpperCase())}`)} ${buildDurationString} ${\n buildService.getIsProd() ? '' : chalk.redBright(`NODE_ENV=${buildService.getNodeEnv()}`)\n }\\n`,\n );\n}\n\nexport default build;\n"],"names":["async","build","params","perfStart","performance","now","buildService","Build","durationMs","Math","ceil","duration","toFixed","units","buildDurationString","chalk","dim","yellowBright","getRunningBuildNames","join","reset","bold","console","info","green","cliName","toUpperCase","getIsProd","redBright","getNodeEnv"],"mappings":"+IASAA,eAAeC,EAAMC,GACnB,MAAMC,EAAYC,EAAYC,MACxBC,EAAe,IAAIC,EAAML,SAEzBI,EAAaL,QAEnB,MAAMO,EAAaC,KAAKC,KAAKN,EAAYC,MAAQF,GAC3CQ,EAAWH,EAAa,KAAQA,EAAa,KAAMI,QAAQ,GAAKJ,EAChEK,EAAQL,EAAa,IAAO,IAAM,KAElCM,EAAsBC,EAAMC,IAChC,GAAGD,EAAME,aAAaX,EAAaY,uBAAuBC,KAAK,kBAAkBJ,EAAMK,MAAML,EAAMM,KAAKV,OAAcE,KAGxHS,QAAQC,KACN,OAAOR,EAAMS,MAAM,GAAGT,EAAMM,KAAKI,EAAQC,sBAAsBZ,KAC7DR,EAAaqB,YAAc,GAAKZ,EAAMa,UAAU,YAAYtB,EAAauB,oBAG/E"}
1
+ {"version":3,"file":"build.js","sources":["../../src/cli/build.ts"],"sourcesContent":[null],"names":["async","build","params","perfStart","performance","now","buildService","Build","durationMs","Math","ceil","duration","toFixed","units","buildDurationString","chalk","dim","yellowBright","getRunningBuildNames","join","reset","bold","console","info","green","cliName","toUpperCase","getIsProd","redBright","getNodeEnv"],"mappings":"+IASAA,eAAeC,EAAMC,GACnB,MAAMC,EAAYC,EAAYC,MACxBC,EAAe,IAAIC,EAAML,SAEzBI,EAAaL,QAEnB,MAAMO,EAAaC,KAAKC,KAAKN,EAAYC,MAAQF,GAC3CQ,EAAWH,EAAa,KAAQA,EAAa,KAAMI,QAAQ,GAAKJ,EAChEK,EAAQL,EAAa,IAAO,IAAM,KAElCM,EAAsBC,EAAMC,IAChC,GAAGD,EAAME,aAAaX,EAAaY,uBAAuBC,KAAK,kBAAkBJ,EAAMK,MAAML,EAAMM,KAAKV,OAAcE,KAGxHS,QAAQC,KACN,OAAOR,EAAMS,MAAM,GAAGT,EAAMM,KAAKI,EAAQC,sBAAsBZ,KAC7DR,EAAaqB,YAAc,GAAKZ,EAAMa,UAAU,YAAYtB,EAAauB,oBAG/E"}
@@ -2,4 +2,4 @@
2
2
  * Handle keyboard press buttons
3
3
  */
4
4
  declare function onKeyPress(input: string): void;
5
- export { onKeyPress as default };
5
+ export default onKeyPress;
@@ -1,2 +1,2 @@
1
- import o from"chalk";import t from"../../constants/cli-context.js";import i from"../../constants/cli-shortcuts.js";import r from"../../helpers/plugin-config.js";import e from"../../helpers/process-stop.js";let n=!1;function s(s){!async function(s){if(""===s||""===s)return void(t.server?.close((o=>e(o?1:0)))||e());if(n)return;const{config:c}=t,f=c?.getLogger(),{customShortcuts:l=[]}="object"==typeof c?.getVite()?.config?r(c.getVite().config):{},p=l.filter(Boolean).concat(i).filter((({isOnlyDev:o=!1})=>!o||o&&!c?.isProd));if("\r"===s)return f?.info("\r");"h"===s&&f?.info(["",o.bold(" Shortcuts"),...p.map((t=>o.dim(" press ")+o.bold(t.key)+o.dim(` to ${t.description}`)))].join("\n"));const m=p.find((({key:o})=>o===s));if(!m)return;n=!0,await m.action(t),n=!1}(s)}export{s as default};
1
+ import o from"chalk";import t from"../../constants/cli-context.js";import i from"../../constants/cli-shortcuts.js";import r from"../../helpers/plugin-config.js";import e from"../../helpers/process-stop.js";let n=!1;function s(s){!async function(s){if(""===s||""===s)return void(t.server?.close(o=>e(o?1:0))||e());if(n)return;const{config:c}=t,f=c?.getLogger(),{customShortcuts:l=[]}="object"==typeof c?.getVite()?.config?r(c.getVite().config):{},p=l.filter(Boolean).concat(i).filter(({isOnlyDev:o=!1})=>!o||o&&!c?.isProd);if("\r"===s)return f?.info("\r");"h"===s&&f?.info(["",o.bold(" Shortcuts"),...p.map(t=>o.dim(" press ")+o.bold(t.key)+o.dim(` to ${t.description}`))].join("\n"));const m=p.find(({key:o})=>o===s);if(!m)return;n=!0,await m.action(t),n=!1}(s)}export{s as default};
2
2
  //# sourceMappingURL=keyboard-input.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"keyboard-input.js","sources":["../../../src/cli/helpers/keyboard-input.ts"],"sourcesContent":["import chalk from 'chalk';\nimport cliContext from '@constants/cli-context';\nimport defaultShortcuts from '@constants/cli-shortcuts';\nimport getPluginConfig from '@helpers/plugin-config';\nimport processStop from '@helpers/process-stop';\n\nlet isActionRunning = false;\n\n/**\n * Handle keyboard press buttons\n */\nfunction onKeyPress(input: string): void {\n void runAction(input);\n}\n\n/**\n * Run shortcut\n */\nasync function runAction(input: string): Promise<void> {\n // ctrl+c or ctrl+d\n if (input === '\\x03' || input === '\\x04') {\n if (!cliContext.server?.close((e) => processStop(e ? 1 : 0))) {\n processStop();\n }\n\n return;\n }\n\n if (isActionRunning) {\n return;\n }\n\n const { config } = cliContext;\n const Logger = config?.getLogger();\n const { customShortcuts = [] } =\n typeof config?.getVite()?.config === 'object' ? getPluginConfig(config.getVite()!.config) : {};\n\n const shortcuts = customShortcuts\n .filter(Boolean)\n .concat(defaultShortcuts)\n .filter(({ isOnlyDev = false }) => !isOnlyDev || (isOnlyDev && !config?.isProd));\n\n // print empty line\n if (input === '\\r') {\n return Logger?.info('\\r');\n }\n\n // print help\n if (input === 'h') {\n Logger?.info(\n [\n '',\n chalk.bold(' Shortcuts'),\n ...shortcuts.map(\n (shortcut) =>\n chalk.dim(' press ') +\n chalk.bold(shortcut.key) +\n chalk.dim(` to ${shortcut.description}`),\n ),\n ].join('\\n'),\n );\n }\n\n // execute shortcut command\n const shortcut = shortcuts.find(({ key }) => key === input);\n\n if (!shortcut) {\n return;\n }\n\n isActionRunning = true;\n await shortcut.action(cliContext);\n isActionRunning = false;\n}\n\nexport default onKeyPress;\n"],"names":["isActionRunning","onKeyPress","input","async","cliContext","server","close","e","processStop","config","Logger","getLogger","customShortcuts","getVite","getPluginConfig","shortcuts","filter","Boolean","concat","defaultShortcuts","isOnlyDev","isProd","info","chalk","bold","map","shortcut","dim","key","description","join","find","action","runAction"],"mappings":"8MAMA,IAAIA,GAAkB,EAKtB,SAASC,EAAWC,IAOpBC,eAAyBD,GAEvB,GAAc,MAAVA,GAA8B,MAAVA,EAKtB,YAJKE,EAAWC,QAAQC,OAAOC,GAAMC,EAAYD,EAAI,EAAI,MACvDC,KAMJ,GAAIR,EACF,OAGF,MAAMS,OAAEA,GAAWL,EACbM,EAASD,GAAQE,aACjBC,gBAAEA,EAAkB,IACa,iBAA9BH,GAAQI,WAAWJ,OAAsBK,EAAgBL,EAAOI,UAAWJ,QAAU,CAAA,EAExFM,EAAYH,EACfI,OAAOC,SACPC,OAAOC,GACPH,QAAO,EAAGI,aAAY,MAAaA,GAAcA,IAAcX,GAAQY,SAG1E,GAAc,OAAVnB,EACF,OAAOQ,GAAQY,KAAK,MAIR,MAAVpB,GACFQ,GAAQY,KACN,CACE,GACAC,EAAMC,KAAK,kBACRT,EAAUU,KACVC,GACCH,EAAMI,IAAI,YACVJ,EAAMC,KAAKE,EAASE,KACpBL,EAAMI,IAAI,OAAOD,EAASG,kBAE9BC,KAAK,OAKX,MAAMJ,EAAWX,EAAUgB,MAAK,EAAGH,SAAUA,IAAQ1B,IAErD,IAAKwB,EACH,OAGF1B,GAAkB,QACZ0B,EAASM,OAAO5B,GACtBJ,GAAkB,CACpB,CA7DOiC,CAAU/B,EACjB"}
1
+ {"version":3,"file":"keyboard-input.js","sources":["../../../src/cli/helpers/keyboard-input.ts"],"sourcesContent":[null],"names":["isActionRunning","onKeyPress","input","async","cliContext","server","close","e","processStop","config","Logger","getLogger","customShortcuts","getVite","getPluginConfig","shortcuts","filter","Boolean","concat","defaultShortcuts","isOnlyDev","isProd","info","chalk","bold","map","shortcut","dim","key","description","join","find","action","runAction"],"mappings":"8MAMA,IAAIA,GAAkB,EAKtB,SAASC,EAAWC,IAOpBC,eAAyBD,GAEvB,GAAc,MAAVA,GAA8B,MAAVA,EAKtB,YAJKE,EAAWC,QAAQC,MAAOC,GAAMC,EAAYD,EAAI,EAAI,KACvDC,KAMJ,GAAIR,EACF,OAGF,MAAMS,OAAEA,GAAWL,EACbM,EAASD,GAAQE,aACjBC,gBAAEA,EAAkB,IACa,iBAA9BH,GAAQI,WAAWJ,OAAsBK,EAAgBL,EAAOI,UAAWJ,QAAU,CAAA,EAExFM,EAAYH,EACfI,OAAOC,SACPC,OAAOC,GACPH,OAAO,EAAGI,aAAY,MAAaA,GAAcA,IAAcX,GAAQY,QAG1E,GAAc,OAAVnB,EACF,OAAOQ,GAAQY,KAAK,MAIR,MAAVpB,GACFQ,GAAQY,KACN,CACE,GACAC,EAAMC,KAAK,kBACRT,EAAUU,IACVC,GACCH,EAAMI,IAAI,YACVJ,EAAMC,KAAKE,EAASE,KACpBL,EAAMI,IAAI,OAAOD,EAASG,iBAE9BC,KAAK,OAKX,MAAMJ,EAAWX,EAAUgB,KAAK,EAAGH,SAAUA,IAAQ1B,GAErD,IAAKwB,EACH,OAGF1B,GAAkB,QACZ0B,EAASM,OAAO5B,GACtBJ,GAAkB,CACpB,CA7DOiC,CAAU/B,EACjB"}
@@ -2,4 +2,4 @@
2
2
  * Reset vite cache
3
3
  */
4
4
  declare function viteResetCache(): Promise<void>;
5
- export { viteResetCache as default };
5
+ export default viteResetCache;
@@ -1 +1 @@
1
- {"version":3,"file":"vite-reset-cache.js","sources":["../../../src/cli/helpers/vite-reset-cache.ts"],"sourcesContent":["import fs from 'node:fs';\nimport chalk from 'chalk';\nimport { resolveConfig } from 'vite';\n\n/**\n * Reset vite cache\n */\nasync function viteResetCache(): Promise<void> {\n const config = await resolveConfig({}, 'build');\n const { cacheDir } = config;\n\n if (fs.existsSync(cacheDir)) {\n fs.rmSync(cacheDir, { recursive: true, force: true });\n }\n\n console.info(chalk.dim(chalk.yellowBright('vite cache cleared.')));\n}\n\nexport default viteResetCache;\n"],"names":["async","viteResetCache","config","resolveConfig","cacheDir","fs","existsSync","rmSync","recursive","force","console","info","chalk","dim","yellowBright"],"mappings":"iFAOAA,eAAeC,IACb,MAAMC,QAAeC,EAAc,CAAA,EAAI,UACjCC,SAAEA,GAAaF,EAEjBG,EAAGC,WAAWF,IAChBC,EAAGE,OAAOH,EAAU,CAAEI,WAAW,EAAMC,OAAO,IAGhDC,QAAQC,KAAKC,EAAMC,IAAID,EAAME,aAAa,wBAC5C"}
1
+ {"version":3,"file":"vite-reset-cache.js","sources":["../../../src/cli/helpers/vite-reset-cache.ts"],"sourcesContent":[null],"names":["async","viteResetCache","config","resolveConfig","cacheDir","fs","existsSync","rmSync","recursive","force","console","info","chalk","dim","yellowBright"],"mappings":"iFAOAA,eAAeC,IACb,MAAMC,QAAeC,EAAc,CAAA,EAAI,UACjCC,SAAEA,GAAaF,EAEjBG,EAAGC,WAAWF,IAChBC,EAAGE,OAAOH,EAAU,CAAEI,WAAW,EAAMC,OAAO,IAGhDC,QAAQC,KAAKC,EAAMC,IAAID,EAAME,aAAa,wBAC5C"}
@@ -1,12 +1,12 @@
1
- import { IBuildParams } from "../../services/build.js";
2
- interface IDevActionParams {
1
+ import type { IBuildParams } from '../../services/build.js';
2
+ export interface IDevActionParams {
3
3
  host?: boolean;
4
4
  port?: number;
5
5
  resetCache?: boolean;
6
6
  mode?: string;
7
7
  entrypoint?: string;
8
8
  }
9
- interface IBuildActionParams {
9
+ export interface IBuildActionParams {
10
10
  focusOnly?: IBuildParams['focusOnly'];
11
11
  clientOptions?: string;
12
12
  serverOptions?: string;
@@ -16,32 +16,31 @@ interface IBuildActionParams {
16
16
  serverless?: boolean;
17
17
  throwWarnings?: boolean;
18
18
  }
19
- interface IStartActionParams {
19
+ export interface IStartActionParams {
20
20
  host?: boolean;
21
21
  port?: number;
22
22
  focusOnly?: IBuildParams['focusOnly'];
23
23
  modulePreload?: boolean;
24
24
  buildDir?: string;
25
25
  }
26
- interface IPreviewActionParams extends IStartActionParams {
26
+ export interface IPreviewActionParams extends IStartActionParams {
27
27
  mode?: string;
28
28
  }
29
- interface IBuildDockerActionParams {
29
+ export interface IBuildDockerActionParams {
30
30
  imageName: string;
31
31
  dockerOptions?: string;
32
32
  dockerFile?: string;
33
33
  focusOnly?: IBuildParams['focusOnly'];
34
34
  mode?: string;
35
35
  }
36
- interface IBuildAmplifyActionParams {
36
+ export interface IBuildAmplifyActionParams {
37
37
  manifestFile?: string;
38
38
  mode?: string;
39
39
  isOptimize?: boolean;
40
40
  }
41
- interface IBuildVercelActionParams {
41
+ export interface IBuildVercelActionParams {
42
42
  configFile?: string;
43
43
  configVcFile?: string;
44
44
  mode?: string;
45
45
  isOptimize?: boolean;
46
46
  }
47
- export { IDevActionParams, IBuildActionParams, IStartActionParams, IPreviewActionParams, IBuildDockerActionParams, IBuildAmplifyActionParams, IBuildVercelActionParams };
@@ -7,4 +7,4 @@ interface IRunAmplifyBuildParams {
7
7
  * Create AWS Amplify SSR build
8
8
  */
9
9
  declare function runAmplifyBuild({ manifestFile, mode, isOptimize, }: IRunAmplifyBuildParams): Promise<void>;
10
- export { runAmplifyBuild as default };
10
+ export default runAmplifyBuild;
@@ -1 +1 @@
1
- {"version":3,"file":"run-amplify-build.js","sources":["../../src/cli/run-amplify-build.ts"],"sourcesContent":["import type { ExecSyncOptions } from 'child_process';\nimport childProcess from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { cwd } from 'node:process';\nimport chalk from 'chalk';\nimport { resolveConfig } from 'vite';\nimport getPluginConfig from '@helpers/plugin-config';\n\ninterface IRunAmplifyBuildParams {\n manifestFile?: string;\n mode?: string;\n isOptimize?: boolean;\n}\n\n/**\n * Create AWS Amplify SSR build\n */\nasync function runAmplifyBuild({\n manifestFile,\n mode = '',\n isOptimize = false,\n}: IRunAmplifyBuildParams): Promise<void> {\n const config = await resolveConfig({}, 'build', mode);\n const pluginConfig = getPluginConfig(config);\n const {\n root,\n build: { outDir },\n } = config;\n const projectRoot = cwd();\n const buildDir = `.${path.resolve(root, outDir).replace(projectRoot, '')}`; // relative path\n const manFile = manifestFile || `${pluginConfig.pluginPath}/workflow/amplify-manifest.json`;\n const amplifyDir = `${projectRoot}/.amplify-hosting`;\n const computeDir = `${amplifyDir}/compute/default`;\n const stdOpts: ExecSyncOptions = {\n stdio: 'inherit',\n };\n\n // Check build server\n if (!fs.existsSync(`${buildDir}/server/start.js`)) {\n console.error(\n chalk.red(\n 'Failed create Amplify build: Before, you should create standard build with `eject` option.',\n ),\n );\n\n return;\n }\n\n if (fs.existsSync(amplifyDir)) {\n childProcess.execSync(`rm -rf ${amplifyDir}`, stdOpts);\n }\n\n fs.mkdirSync(computeDir, { recursive: true });\n childProcess.execSync(`cp -r ${buildDir} ${computeDir}/build`, stdOpts);\n childProcess.execSync(`cp ${projectRoot}/package.json ${computeDir}/package.json`, stdOpts);\n childProcess.execSync(\n `cp ${projectRoot}/package-lock.json ${computeDir}/package-lock.json`,\n stdOpts,\n );\n childProcess.execSync(`cp -r ${buildDir}/client ${amplifyDir}/static`, stdOpts);\n childProcess.execSync(`cp ${manFile} ${amplifyDir}/deploy-manifest.json`, stdOpts);\n childProcess.execSync(`cp -r ${projectRoot}/node_modules ${computeDir}/node_modules`);\n\n if (isOptimize) {\n childProcess.execSync(`cd ${computeDir} && npm ci --omit=dev`, stdOpts);\n }\n\n // cleanup\n childProcess.execSync(`rm -rf ${computeDir}/build/client/assets`, stdOpts);\n\n console.info(`\\n${chalk.cyan('AWS Amplify build success created.')}`);\n}\n\nexport default runAmplifyBuild;\n"],"names":["async","runAmplifyBuild","manifestFile","mode","isOptimize","config","resolveConfig","pluginConfig","getPluginConfig","root","build","outDir","projectRoot","cwd","buildDir","path","resolve","replace","manFile","pluginPath","amplifyDir","computeDir","stdOpts","stdio","fs","existsSync","childProcess","execSync","mkdirSync","recursive","console","info","chalk","cyan","error","red"],"mappings":"0NAkBAA,eAAeC,GAAgBC,aAC7BA,EAAYC,KACZA,EAAO,GAAEC,WACTA,GAAa,IAEb,MAAMC,QAAeC,EAAc,CAAA,EAAI,QAASH,GAC1CI,EAAeC,EAAgBH,IAC/BI,KACJA,EACAC,OAAOC,OAAEA,IACPN,EACEO,EAAcC,IACdC,EAAW,IAAIC,EAAKC,QAAQP,EAAME,GAAQM,QAAQL,EAAa,MAC/DM,EAAUhB,GAAgB,GAAGK,EAAaY,4CAC1CC,EAAa,GAAGR,qBAChBS,EAAa,GAAGD,oBAChBE,EAA2B,CAC/BC,MAAO,WAIJC,EAAGC,WAAW,GAAGX,sBAUlBU,EAAGC,WAAWL,IAChBM,EAAaC,SAAS,UAAUP,IAAcE,GAGhDE,EAAGI,UAAUP,EAAY,CAAEQ,WAAW,IACtCH,EAAaC,SAAS,SAASb,KAAYO,UAAoBC,GAC/DI,EAAaC,SAAS,MAAMf,kBAA4BS,iBAA2BC,GACnFI,EAAaC,SACX,MAAMf,uBAAiCS,sBACvCC,GAEFI,EAAaC,SAAS,SAASb,YAAmBM,WAAqBE,GACvEI,EAAaC,SAAS,MAAMT,KAAWE,yBAAmCE,GAC1EI,EAAaC,SAAS,SAASf,kBAA4BS,kBAEvDjB,GACFsB,EAAaC,SAAS,MAAMN,yBAAmCC,GAIjEI,EAAaC,SAAS,UAAUN,wBAAkCC,GAElEQ,QAAQC,KAAK,KAAKC,EAAMC,KAAK,0CA/B3BH,QAAQI,MACNF,EAAMG,IACJ,8FA8BR"}
1
+ {"version":3,"file":"run-amplify-build.js","sources":["../../src/cli/run-amplify-build.ts"],"sourcesContent":[null],"names":["async","runAmplifyBuild","manifestFile","mode","isOptimize","config","resolveConfig","pluginConfig","getPluginConfig","root","build","outDir","projectRoot","cwd","buildDir","path","resolve","replace","manFile","pluginPath","amplifyDir","computeDir","stdOpts","stdio","fs","existsSync","childProcess","execSync","mkdirSync","recursive","console","info","chalk","cyan","error","red"],"mappings":"0NAkBAA,eAAeC,GAAgBC,aAC7BA,EAAYC,KACZA,EAAO,GAAEC,WACTA,GAAa,IAEb,MAAMC,QAAeC,EAAc,CAAA,EAAI,QAASH,GAC1CI,EAAeC,EAAgBH,IAC/BI,KACJA,EACAC,OAAOC,OAAEA,IACPN,EACEO,EAAcC,IACdC,EAAW,IAAIC,EAAKC,QAAQP,EAAME,GAAQM,QAAQL,EAAa,MAC/DM,EAAUhB,GAAgB,GAAGK,EAAaY,4CAC1CC,EAAa,GAAGR,qBAChBS,EAAa,GAAGD,oBAChBE,EAA2B,CAC/BC,MAAO,WAIJC,EAAGC,WAAW,GAAGX,sBAUlBU,EAAGC,WAAWL,IAChBM,EAAaC,SAAS,UAAUP,IAAcE,GAGhDE,EAAGI,UAAUP,EAAY,CAAEQ,WAAW,IACtCH,EAAaC,SAAS,SAASb,KAAYO,UAAoBC,GAC/DI,EAAaC,SAAS,MAAMf,kBAA4BS,iBAA2BC,GACnFI,EAAaC,SACX,MAAMf,uBAAiCS,sBACvCC,GAEFI,EAAaC,SAAS,SAASb,YAAmBM,WAAqBE,GACvEI,EAAaC,SAAS,MAAMT,KAAWE,yBAAmCE,GAC1EI,EAAaC,SAAS,SAASf,kBAA4BS,kBAEvDjB,GACFsB,EAAaC,SAAS,MAAMN,yBAAmCC,GAIjEI,EAAaC,SAAS,UAAUN,wBAAkCC,GAElEQ,QAAQC,KAAK,KAAKC,EAAMC,KAAK,0CA/B3BH,QAAQI,MACNF,EAAMG,IACJ,8FA8BR"}
package/cli/run-dev.d.ts CHANGED
@@ -1,6 +1,5 @@
1
- /// <reference types="node" />
2
- import { Server } from 'node:net';
3
- import ServerConfig from "../services/server-config.js";
1
+ import type { Server } from 'node:net';
2
+ import ServerConfig from '../services/server-config.js';
4
3
  interface IRunDevParams {
5
4
  version: string;
6
5
  isHost?: boolean;
@@ -17,4 +16,4 @@ interface IRunDevOut {
17
16
  * Run development server
18
17
  */
19
18
  declare function runDev({ version, isHost, isPrintInfo, mode, port, entrypointName, }: IRunDevParams): Promise<IRunDevOut>;
20
- export { runDev as default };
19
+ export default runDev;
package/cli/run-dev.js CHANGED
@@ -1,2 +1,2 @@
1
- import{performance as o}from"node:perf_hooks";import r from"../node/server.js";import{setCurrentEntrypointName as t}from"../plugins/handle-custom-entrypoint.js";import e from"../services/server-config.js";async function n({version:n,isHost:i,isPrintInfo:s,mode:m,port:p,entrypointName:f}){global.viteBoostStartTime=o.now(),f&&t(f);const a=e.init({isHost:i,mode:m,entrypointName:f},{port:p}),{run:c}=await r(a);return{server:c({version:n,isPrintInfo:s}),config:a}}export{n as default};
1
+ import{performance as o}from"node:perf_hooks";import r from"../adapters/express/server.js";import{setCurrentEntrypointName as t}from"../plugins/handle-custom-entrypoint.js";import e from"../services/server-config.js";async function s({version:s,isHost:i,isPrintInfo:n,mode:m,port:p,entrypointName:a}){global.viteBoostStartTime=o.now(),a&&t(a);const f=e.init({isHost:i,mode:m,entrypointName:a},{port:p}),{run:c}=await r(f);return{server:c({version:s,isPrintInfo:n}),config:f}}export{s as default};
2
2
  //# sourceMappingURL=run-dev.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-dev.js","sources":["../../src/cli/run-dev.ts"],"sourcesContent":["import type { Server } from 'node:net';\nimport { performance } from 'node:perf_hooks';\nimport createServer from '@node/server';\nimport { setCurrentEntrypointName } from '@plugins/handle-custom-entrypoint';\nimport ServerConfig from '@services/server-config';\n\ninterface IRunDevParams {\n version: string;\n isHost?: boolean;\n isPrintInfo?: boolean;\n mode?: string;\n port?: number;\n entrypointName?: string;\n}\n\ninterface IRunDevOut {\n server: Server;\n config: ServerConfig;\n}\n\n/**\n * Run development server\n */\nasync function runDev({\n version,\n isHost,\n isPrintInfo,\n mode,\n port,\n entrypointName,\n}: IRunDevParams): Promise<IRunDevOut> {\n global.viteBoostStartTime = performance.now();\n\n if (entrypointName) {\n setCurrentEntrypointName(entrypointName);\n }\n\n const config = ServerConfig.init(\n { isHost, mode, entrypointName },\n {\n port,\n },\n );\n const { run } = await createServer(config);\n\n return {\n server: run({ version, isPrintInfo }),\n config,\n };\n}\n\nexport default runDev;\n"],"names":["async","runDev","version","isHost","isPrintInfo","mode","port","entrypointName","global","viteBoostStartTime","performance","now","setCurrentEntrypointName","config","ServerConfig","init","run","createServer","server"],"mappings":"6MAuBAA,eAAeC,GAAOC,QACpBA,EAAOC,OACPA,EAAMC,YACNA,EAAWC,KACXA,EAAIC,KACJA,EAAIC,eACJA,IAEAC,OAAOC,mBAAqBC,EAAYC,MAEpCJ,GACFK,EAAyBL,GAG3B,MAAMM,EAASC,EAAaC,KAC1B,CAAEZ,SAAQE,OAAME,kBAChB,CACED,UAGEU,IAAEA,SAAcC,EAAaJ,GAEnC,MAAO,CACLK,OAAQF,EAAI,CAAEd,UAASE,gBACvBS,SAEJ"}
1
+ {"version":3,"file":"run-dev.js","sources":["../../src/cli/run-dev.ts"],"sourcesContent":[null],"names":["async","runDev","version","isHost","isPrintInfo","mode","port","entrypointName","global","viteBoostStartTime","performance","now","setCurrentEntrypointName","config","ServerConfig","init","run","createServer","server"],"mappings":"yNAuBAA,eAAeC,GAAOC,QACpBA,EAAOC,OACPA,EAAMC,YACNA,EAAWC,KACXA,EAAIC,KACJA,EAAIC,eACJA,IAEAC,OAAOC,mBAAqBC,EAAYC,MAEpCJ,GACFK,EAAyBL,GAG3B,MAAMM,EAASC,EAAaC,KAC1B,CAAEZ,SAAQE,OAAME,kBAChB,CACED,UAGEU,IAAEA,SAAcC,EAAaJ,GAEnC,MAAO,CACLK,OAAQF,EAAI,CAAEd,UAASE,gBACvBS,SAEJ"}
@@ -1,4 +1,4 @@
1
- import { IBuildParams } from "../services/build.js";
1
+ import type { IBuildParams } from '../services/build.js';
2
2
  interface IRunDockerBuildParams {
3
3
  imageName: string;
4
4
  dockerOptions?: string;
@@ -10,4 +10,4 @@ interface IRunDockerBuildParams {
10
10
  * Build docker image
11
11
  */
12
12
  declare function runDockerBuild({ imageName, dockerFile, focusOnly, dockerOptions, mode, }: IRunDockerBuildParams): Promise<void>;
13
- export { runDockerBuild as default };
13
+ export default runDockerBuild;
@@ -1 +1 @@
1
- {"version":3,"file":"run-docker-build.js","sources":["../../src/cli/run-docker-build.ts"],"sourcesContent":["import childProcess from 'node:child_process';\nimport path from 'node:path';\nimport { cwd } from 'node:process';\nimport { resolveConfig } from 'vite';\nimport createFocusOnly from '@helpers/create-focus-only';\nimport getPluginConfig from '@helpers/plugin-config';\nimport type { IBuildParams } from '@services/build';\n\ninterface IRunDockerBuildParams {\n imageName: string;\n dockerOptions?: string;\n dockerFile?: string;\n focusOnly?: IBuildParams['focusOnly'];\n mode?: string;\n}\n\n/**\n * Build docker image\n */\nasync function runDockerBuild({\n imageName,\n dockerFile,\n focusOnly,\n dockerOptions = '',\n mode = '',\n}: IRunDockerBuildParams): Promise<void> {\n const nodeEnv = mode === 'production' ? 'production' : 'development';\n const config = await resolveConfig({}, 'build', mode);\n const pluginConfig = getPluginConfig(config);\n const {\n root,\n build: { outDir },\n } = config;\n const projectRoot = cwd();\n const buildDir = `.${path.resolve(root, outDir).replace(projectRoot, '')}`; // relative path\n const runType = createFocusOnly(focusOnly).isOnlyClient() ? 'spa' : 'ssr';\n const docFile = dockerFile || `${pluginConfig.pluginPath}/workflow/Dockerfile`;\n\n childProcess.execSync(\n `docker build -f ${docFile}` +\n ` --build-arg BUILD_PATH=${buildDir}` +\n ` --build-arg RUN_TYPE=${runType} --build-arg ENV_MODE=${nodeEnv}` +\n ` ${dockerOptions} -t ${imageName} ${projectRoot}`,\n {\n stdio: 'inherit',\n env: {\n ...process.env,\n },\n },\n );\n}\n\nexport default runDockerBuild;\n"],"names":["async","runDockerBuild","imageName","dockerFile","focusOnly","dockerOptions","mode","nodeEnv","config","resolveConfig","pluginConfig","getPluginConfig","root","build","outDir","projectRoot","cwd","buildDir","path","resolve","replace","runType","createFocusOnly","isOnlyClient","docFile","pluginPath","childProcess","execSync","stdio","env","process"],"mappings":"6NAmBAA,eAAeC,GAAeC,UAC5BA,EAASC,WACTA,EAAUC,UACVA,EAASC,cACTA,EAAgB,GAAEC,KAClBA,EAAO,KAEP,MAAMC,EAAmB,eAATD,EAAwB,aAAe,cACjDE,QAAeC,EAAc,CAAA,EAAI,QAASH,GAC1CI,EAAeC,EAAgBH,IAC/BI,KACJA,EACAC,OAAOC,OAAEA,IACPN,EACEO,EAAcC,IACdC,EAAW,IAAIC,EAAKC,QAAQP,EAAME,GAAQM,QAAQL,EAAa,MAC/DM,EAAUC,EAAgBlB,GAAWmB,eAAiB,MAAQ,MAC9DC,EAAUrB,GAAc,GAAGO,EAAae,iCAE9CC,EAAaC,SACX,mBAAmBH,4BACUP,0BACFI,0BAAgCd,KACrDF,QAAoBH,KAAaa,IACvC,CACEa,MAAO,UACPC,IAAK,IACAC,QAAQD,MAInB"}
1
+ {"version":3,"file":"run-docker-build.js","sources":["../../src/cli/run-docker-build.ts"],"sourcesContent":[null],"names":["async","runDockerBuild","imageName","dockerFile","focusOnly","dockerOptions","mode","nodeEnv","config","resolveConfig","pluginConfig","getPluginConfig","root","build","outDir","projectRoot","cwd","buildDir","path","resolve","replace","runType","createFocusOnly","isOnlyClient","docFile","pluginPath","childProcess","execSync","stdio","env","process"],"mappings":"6NAmBAA,eAAeC,GAAeC,UAC5BA,EAASC,WACTA,EAAUC,UACVA,EAASC,cACTA,EAAgB,GAAEC,KAClBA,EAAO,KAEP,MAAMC,EAAmB,eAATD,EAAwB,aAAe,cACjDE,QAAeC,EAAc,CAAA,EAAI,QAASH,GAC1CI,EAAeC,EAAgBH,IAC/BI,KACJA,EACAC,OAAOC,OAAEA,IACPN,EACEO,EAAcC,IACdC,EAAW,IAAIC,EAAKC,QAAQP,EAAME,GAAQM,QAAQL,EAAa,MAC/DM,EAAUC,EAAgBlB,GAAWmB,eAAiB,MAAQ,MAC9DC,EAAUrB,GAAc,GAAGO,EAAae,iCAE9CC,EAAaC,SACX,mBAAmBH,4BACUP,0BACFI,0BAAgCd,KACrDF,QAAoBH,KAAaa,IACvC,CACEa,MAAO,UACPC,IAAK,IACAC,QAAQD,MAInB"}
package/cli/run-prod.d.ts CHANGED
@@ -1,13 +1,12 @@
1
- /// <reference types="node" />
2
- import { Server } from 'node:net';
3
- import { IBuildParams } from "../services/build.js";
4
- import ServerConfig from "../services/server-config.js";
1
+ import type { Server } from 'node:net';
2
+ import type { IBuildParams } from '../services/build.js';
3
+ import ServerConfig from '../services/server-config.js';
5
4
  interface IRunProdParams {
6
5
  version: string;
7
6
  port?: number;
8
7
  isHost?: boolean;
9
8
  isPrintInfo?: boolean;
10
- focusOnly?: IBuildParams['focusOnly'];
9
+ focusOnly?: NonNullable<IBuildParams['focusOnly']>;
11
10
  mode?: string;
12
11
  modulePreload?: boolean;
13
12
  buildDir?: string;
@@ -20,4 +19,4 @@ interface IRunProdOut {
20
19
  * Run production server
21
20
  */
22
21
  declare function runProd({ version, isHost, isPrintInfo, port, buildDir, focusOnly, modulePreload, }: IRunProdParams): Promise<IRunProdOut>;
23
- export { runProd as default };
22
+ export default runProd;
package/cli/run-prod.js CHANGED
@@ -1,2 +1,2 @@
1
- import{performance as o}from"node:perf_hooks";import r from"../helpers/create-focus-only.js";import i from"../node/server.js";import e from"../services/server-config.js";async function s({version:s,isHost:t,isPrintInfo:n,port:l,buildDir:f,focusOnly:a,modulePreload:m=!1}){global.viteBoostStartTime||(global.viteBoostStartTime=o.now());const c=e.init({isHost:t,isProd:!0,isOnlyClient:r(a).isOnlyClient(),isModulePreload:m},{port:l,root:f}),{run:d}=await i(c);return{server:d({version:s,isPrintInfo:n}),config:c}}export{s as default};
1
+ import{performance as o}from"node:perf_hooks";import r from"../adapters/express/server.js";import e from"../helpers/create-focus-only.js";import s from"../services/server-config.js";async function i({version:i,isHost:t,isPrintInfo:n,port:l,buildDir:a,focusOnly:f,modulePreload:m=!1}){global.viteBoostStartTime||(global.viteBoostStartTime=o.now());const p=s.init({isHost:t,isProd:!0,isOnlyClient:e(f).isOnlyClient(),isModulePreload:m},{port:l,root:a}),{run:c}=await r(p);return{server:c({version:i,isPrintInfo:n}),config:p}}export{i as default};
2
2
  //# sourceMappingURL=run-prod.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-prod.js","sources":["../../src/cli/run-prod.ts"],"sourcesContent":["import type { Server } from 'node:net';\nimport { performance } from 'node:perf_hooks';\nimport createFocusOnly from '@helpers/create-focus-only';\nimport createServer from '@node/server';\nimport type { IBuildParams } from '@services/build';\nimport ServerConfig from '@services/server-config';\n\ninterface IRunProdParams {\n version: string;\n port?: number;\n isHost?: boolean;\n isPrintInfo?: boolean;\n focusOnly?: IBuildParams['focusOnly'];\n mode?: string;\n modulePreload?: boolean;\n buildDir?: string;\n}\n\ninterface IRunProdOut {\n server: Server;\n config: ServerConfig;\n}\n\n/**\n * Run production server\n */\nasync function runProd({\n version,\n isHost,\n isPrintInfo,\n port,\n buildDir,\n focusOnly,\n modulePreload = false,\n}: IRunProdParams): Promise<IRunProdOut> {\n if (!global.viteBoostStartTime) {\n global.viteBoostStartTime = performance.now();\n }\n\n const config = ServerConfig.init(\n {\n isHost,\n isProd: true,\n isOnlyClient: createFocusOnly(focusOnly).isOnlyClient(),\n isModulePreload: modulePreload,\n },\n { port, root: buildDir },\n );\n const { run } = await createServer(config);\n\n return {\n server: run({ version, isPrintInfo }),\n config,\n };\n}\n\nexport default runProd;\n"],"names":["async","runProd","version","isHost","isPrintInfo","port","buildDir","focusOnly","modulePreload","global","viteBoostStartTime","performance","now","config","ServerConfig","init","isProd","isOnlyClient","createFocusOnly","isModulePreload","root","run","createServer","server"],"mappings":"0KA0BAA,eAAeC,GAAQC,QACrBA,EAAOC,OACPA,EAAMC,YACNA,EAAWC,KACXA,EAAIC,SACJA,EAAQC,UACRA,EAASC,cACTA,GAAgB,IAEXC,OAAOC,qBACVD,OAAOC,mBAAqBC,EAAYC,OAG1C,MAAMC,EAASC,EAAaC,KAC1B,CACEZ,SACAa,QAAQ,EACRC,aAAcC,EAAgBX,GAAWU,eACzCE,gBAAiBX,GAEnB,CAAEH,OAAMe,KAAMd,KAEVe,IAAEA,SAAcC,EAAaT,GAEnC,MAAO,CACLU,OAAQF,EAAI,CAAEnB,UAASE,gBACvBS,SAEJ"}
1
+ {"version":3,"file":"run-prod.js","sources":["../../src/cli/run-prod.ts"],"sourcesContent":[null],"names":["async","runProd","version","isHost","isPrintInfo","port","buildDir","focusOnly","modulePreload","global","viteBoostStartTime","performance","now","config","ServerConfig","init","isProd","isOnlyClient","createFocusOnly","isModulePreload","root","run","createServer","server"],"mappings":"sLA0BAA,eAAeC,GAAQC,QACrBA,EAAOC,OACPA,EAAMC,YACNA,EAAWC,KACXA,EAAIC,SACJA,EAAQC,UACRA,EAASC,cACTA,GAAgB,IAEXC,OAAOC,qBACVD,OAAOC,mBAAqBC,EAAYC,OAG1C,MAAMC,EAASC,EAAaC,KAC1B,CACEZ,SACAa,QAAQ,EACRC,aAAcC,EAAgBX,GAAWU,eACzCE,gBAAiBX,GAEnB,CAAEH,OAAMe,KAAMd,KAEVe,IAAEA,SAAcC,EAAaT,GAEnC,MAAO,CACLU,OAAQF,EAAI,CAAEnB,UAASE,gBACvBS,SAEJ"}
@@ -1,4 +1,4 @@
1
- import { Express } from 'express';
1
+ import type { ICreateServerOut } from '../adapters/express/server.js';
2
2
  interface IRunServerlessParams {
3
3
  version: string;
4
4
  modulePreload?: boolean;
@@ -6,5 +6,5 @@ interface IRunServerlessParams {
6
6
  /**
7
7
  * Run serverless
8
8
  */
9
- declare function runServerless({ version, modulePreload, }: IRunServerlessParams): Promise<Express>;
10
- export { runServerless as default };
9
+ declare function runServerless({ version, modulePreload, }: IRunServerlessParams): Promise<ICreateServerOut['app']>;
10
+ export default runServerless;
@@ -1,2 +1,2 @@
1
- import{performance as o}from"node:perf_hooks";import r from"../helpers/print-server-info.js";import e from"../node/server.js";import i from"../services/server-config.js";async function t({version:t,modulePreload:s=!1}){global.viteBoostStartTime||(global.viteBoostStartTime=o.now());const n=i.init({isProd:!0,isOnlyClient:!1,isModulePreload:s}),{app:a}=await e(n);return r(n,{version:t}),a}export{t as default};
1
+ import{performance as o}from"node:perf_hooks";import r from"../adapters/express/server.js";import e from"../helpers/print-server-info.js";import s from"../services/server-config.js";async function i({version:i,modulePreload:t=!1}){global.viteBoostStartTime||(global.viteBoostStartTime=o.now());const n=s.init({isProd:!0,isOnlyClient:!1,isModulePreload:t}),{app:a}=await r(n);return e(n,{version:i}),a}export{i as default};
2
2
  //# sourceMappingURL=run-serverless.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"run-serverless.js","sources":["../../src/cli/run-serverless.ts"],"sourcesContent":["import { performance } from 'node:perf_hooks';\nimport type { Express } from 'express';\nimport printServerInfo from '@helpers/print-server-info';\nimport createServer from '@node/server';\nimport ServerConfig from '@services/server-config';\n\ninterface IRunServerlessParams {\n version: string;\n modulePreload?: boolean;\n}\n\n/**\n * Run serverless\n */\nasync function runServerless({\n version,\n modulePreload = false,\n}: IRunServerlessParams): Promise<Express> {\n if (!global.viteBoostStartTime) {\n global.viteBoostStartTime = performance.now();\n }\n\n const config = ServerConfig.init({\n isProd: true,\n isOnlyClient: false,\n isModulePreload: modulePreload,\n });\n\n const { app } = await createServer(config);\n\n void printServerInfo(config, { version });\n\n return app;\n}\n\nexport default runServerless;\n"],"names":["async","runServerless","version","modulePreload","global","viteBoostStartTime","performance","now","config","ServerConfig","init","isProd","isOnlyClient","isModulePreload","app","createServer","printServerInfo"],"mappings":"0KAcAA,eAAeC,GAAcC,QAC3BA,EAAOC,cACPA,GAAgB,IAEXC,OAAOC,qBACVD,OAAOC,mBAAqBC,EAAYC,OAG1C,MAAMC,EAASC,EAAaC,KAAK,CAC/BC,QAAQ,EACRC,cAAc,EACdC,gBAAiBV,KAGbW,IAAEA,SAAcC,EAAaP,GAInC,OAFKQ,EAAgBR,EAAQ,CAAEN,YAExBY,CACT"}
1
+ {"version":3,"file":"run-serverless.js","sources":["../../src/cli/run-serverless.ts"],"sourcesContent":[null],"names":["async","runServerless","version","modulePreload","global","viteBoostStartTime","performance","now","config","ServerConfig","init","isProd","isOnlyClient","isModulePreload","app","createServer","printServerInfo"],"mappings":"sLAcAA,eAAeC,GAAcC,QAC3BA,EAAOC,cACPA,GAAgB,IAEXC,OAAOC,qBACVD,OAAOC,mBAAqBC,EAAYC,OAG1C,MAAMC,EAASC,EAAaC,KAAK,CAC/BC,QAAQ,EACRC,cAAc,EACdC,gBAAiBV,KAGbW,IAAEA,SAAcC,EAAaP,GAInC,OAFKQ,EAAgBR,EAAQ,CAAEN,YAExBY,CACT"}
@@ -8,4 +8,4 @@ interface IRunVercelBuildParams {
8
8
  * Create Vercel SSR build
9
9
  */
10
10
  declare function runVercelBuild({ configFile, configVcFile, mode, isOptimize, }: IRunVercelBuildParams): Promise<void>;
11
- export { runVercelBuild as default };
11
+ export default runVercelBuild;
@@ -1 +1 @@
1
- {"version":3,"file":"run-vercel-build.js","sources":["../../src/cli/run-vercel-build.ts"],"sourcesContent":["import type { ExecSyncOptions } from 'child_process';\nimport childProcess from 'node:child_process';\nimport fs from 'node:fs';\nimport path from 'node:path';\nimport { cwd } from 'node:process';\nimport chalk from 'chalk';\nimport { resolveConfig } from 'vite';\nimport getPluginConfig from '@helpers/plugin-config';\n\ninterface IRunVercelBuildParams {\n configFile?: string;\n configVcFile?: string;\n mode?: string;\n isOptimize?: boolean;\n}\n\n/**\n * Create Vercel SSR build\n */\nasync function runVercelBuild({\n configFile,\n configVcFile,\n mode = '',\n isOptimize = false,\n}: IRunVercelBuildParams): Promise<void> {\n const config = await resolveConfig({}, 'build', mode);\n const pluginConfig = getPluginConfig(config);\n const {\n root,\n build: { outDir },\n } = config;\n const projectRoot = cwd();\n const buildDir = `.${path.resolve(root, outDir).replace(projectRoot, '')}`; // relative path\n const manFile = configFile || `${pluginConfig.pluginPath}/workflow/vercel.config.json`;\n const manVcFile = configVcFile || `${pluginConfig.pluginPath}/workflow/vercel.vc-config.json`;\n const outputDir = `${projectRoot}/.vercel/output`;\n const stdOpts: ExecSyncOptions = {\n stdio: 'inherit',\n };\n\n // Check build serverless\n if (!fs.existsSync(`${buildDir}/server/serverless.js`)) {\n console.error(\n chalk.red(\n 'Failed create Vercel build: Before, you should create standard build with `serverless` option.',\n ),\n );\n\n return;\n }\n\n if (fs.existsSync(outputDir)) {\n childProcess.execSync(`rm -rf ${outputDir}`, stdOpts);\n }\n\n fs.mkdirSync(outputDir, { recursive: true });\n fs.mkdirSync(`${outputDir}/functions/index.func`, { recursive: true });\n childProcess.execSync(`cp ${manFile} ${outputDir}/config.json`, stdOpts);\n childProcess.execSync(\n `cp ${manVcFile} ${outputDir}/functions/index.func/.vc-config.json`,\n stdOpts,\n );\n childProcess.execSync(\n `cp ${buildDir}/server/serverless.js ${outputDir}/functions/index.func/index.js`,\n stdOpts,\n );\n childProcess.execSync(\n `cp -r ${projectRoot}/node_modules ${outputDir}/functions/index.func/node_modules`,\n stdOpts,\n );\n childProcess.execSync(`cp -r ${buildDir} ${outputDir}/functions/index.func/build`, stdOpts);\n childProcess.execSync(\n `cp -r ${projectRoot}/package.json ${outputDir}/functions/index.func/package.json`,\n stdOpts,\n );\n childProcess.execSync(\n `cp -r ${projectRoot}/package-lock.json ${outputDir}/functions/index.func/package-lock.json`,\n stdOpts,\n );\n childProcess.execSync(`cp -r ${buildDir}/client ${outputDir}/static`, stdOpts);\n\n if (isOptimize) {\n childProcess.execSync(`cd ${outputDir}/functions/index.func && npm ci --omit=dev`, stdOpts);\n }\n\n console.info(`\\n${chalk.cyan('Vercel build success created.')}`);\n}\n\nexport default runVercelBuild;\n"],"names":["async","runVercelBuild","configFile","configVcFile","mode","isOptimize","config","resolveConfig","pluginConfig","getPluginConfig","root","build","outDir","projectRoot","cwd","buildDir","path","resolve","replace","manFile","pluginPath","manVcFile","outputDir","stdOpts","stdio","fs","existsSync","childProcess","execSync","mkdirSync","recursive","console","info","chalk","cyan","error","red"],"mappings":"0NAmBAA,eAAeC,GAAeC,WAC5BA,EAAUC,aACVA,EAAYC,KACZA,EAAO,GAAEC,WACTA,GAAa,IAEb,MAAMC,QAAeC,EAAc,CAAA,EAAI,QAASH,GAC1CI,EAAeC,EAAgBH,IAC/BI,KACJA,EACAC,OAAOC,OAAEA,IACPN,EACEO,EAAcC,IACdC,EAAW,IAAIC,EAAKC,QAAQP,EAAME,GAAQM,QAAQL,EAAa,MAC/DM,EAAUjB,GAAc,GAAGM,EAAaY,yCACxCC,EAAYlB,GAAgB,GAAGK,EAAaY,4CAC5CE,EAAY,GAAGT,mBACfU,EAA2B,CAC/BC,MAAO,WAIJC,EAAGC,WAAW,GAAGX,2BAUlBU,EAAGC,WAAWJ,IAChBK,EAAaC,SAAS,UAAUN,IAAaC,GAG/CE,EAAGI,UAAUP,EAAW,CAAEQ,WAAW,IACrCL,EAAGI,UAAU,GAAGP,yBAAkC,CAAEQ,WAAW,IAC/DH,EAAaC,SAAS,MAAMT,KAAWG,gBAAyBC,GAChEI,EAAaC,SACX,MAAMP,KAAaC,yCACnBC,GAEFI,EAAaC,SACX,MAAMb,0BAAiCO,kCACvCC,GAEFI,EAAaC,SACX,SAASf,kBAA4BS,sCACrCC,GAEFI,EAAaC,SAAS,SAASb,KAAYO,+BAAwCC,GACnFI,EAAaC,SACX,SAASf,kBAA4BS,sCACrCC,GAEFI,EAAaC,SACX,SAASf,uBAAiCS,2CAC1CC,GAEFI,EAAaC,SAAS,SAASb,YAAmBO,WAAoBC,GAElElB,GACFsB,EAAaC,SAAS,MAAMN,8CAAuDC,GAGrFQ,QAAQC,KAAK,KAAKC,EAAMC,KAAK,qCA3C3BH,QAAQI,MACNF,EAAMG,IACJ,kGA0CR"}
1
+ {"version":3,"file":"run-vercel-build.js","sources":["../../src/cli/run-vercel-build.ts"],"sourcesContent":[null],"names":["async","runVercelBuild","configFile","configVcFile","mode","isOptimize","config","resolveConfig","pluginConfig","getPluginConfig","root","build","outDir","projectRoot","cwd","buildDir","path","resolve","replace","manFile","pluginPath","manVcFile","outputDir","stdOpts","stdio","fs","existsSync","childProcess","execSync","mkdirSync","recursive","console","info","chalk","cyan","error","red"],"mappings":"0NAmBAA,eAAeC,GAAeC,WAC5BA,EAAUC,aACVA,EAAYC,KACZA,EAAO,GAAEC,WACTA,GAAa,IAEb,MAAMC,QAAeC,EAAc,CAAA,EAAI,QAASH,GAC1CI,EAAeC,EAAgBH,IAC/BI,KACJA,EACAC,OAAOC,OAAEA,IACPN,EACEO,EAAcC,IACdC,EAAW,IAAIC,EAAKC,QAAQP,EAAME,GAAQM,QAAQL,EAAa,MAC/DM,EAAUjB,GAAc,GAAGM,EAAaY,yCACxCC,EAAYlB,GAAgB,GAAGK,EAAaY,4CAC5CE,EAAY,GAAGT,mBACfU,EAA2B,CAC/BC,MAAO,WAIJC,EAAGC,WAAW,GAAGX,2BAUlBU,EAAGC,WAAWJ,IAChBK,EAAaC,SAAS,UAAUN,IAAaC,GAG/CE,EAAGI,UAAUP,EAAW,CAAEQ,WAAW,IACrCL,EAAGI,UAAU,GAAGP,yBAAkC,CAAEQ,WAAW,IAC/DH,EAAaC,SAAS,MAAMT,KAAWG,gBAAyBC,GAChEI,EAAaC,SACX,MAAMP,KAAaC,yCACnBC,GAEFI,EAAaC,SACX,MAAMb,0BAAiCO,kCACvCC,GAEFI,EAAaC,SACX,SAASf,kBAA4BS,sCACrCC,GAEFI,EAAaC,SAAS,SAASb,KAAYO,+BAAwCC,GACnFI,EAAaC,SACX,SAASf,kBAA4BS,sCACrCC,GAEFI,EAAaC,SACX,SAASf,uBAAiCS,2CAC1CC,GAEFI,EAAaC,SAAS,SAASb,YAAmBO,WAAoBC,GAElElB,GACFsB,EAAaC,SAAS,MAAMN,8CAAuDC,GAGrFQ,QAAQC,KAAK,KAAKC,EAAMC,KAAK,qCA3C3BH,QAAQI,MACNF,EAAMG,IACJ,kGA0CR"}
package/cli.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{readFileSync as e}from"fs";import o from"chalk";import{Command as i,Option as n}from"commander";import t from"./cli/build.js";import r from"./cli/helpers/keyboard-input.js";import s from"./cli/helpers/vite-reset-cache.js";import d from"./cli/run-amplify-build.js";import a from"./cli/run-dev.js";import c from"./cli/run-docker-build.js";import l from"./cli/run-prod.js";import p from"./cli/run-vercel-build.js";import m from"./constants/cli-actions.js";import f from"./constants/cli-context.js";import u from"./constants/cli-name.js";const{description:O,version:w}=JSON.parse(e(new URL("./package.json",import.meta.url),"utf8")),v=()=>{process.stdin.isTTY&&(process.stdin.setRawMode(!0),process.stdin.on("data",r).setEncoding("utf8").resume())},y=new i;y.name(u).description(O).version(w).hook("preAction",((e,o)=>{global.viteBoostAction=o.name()}));const g=new n("--host","Ability to access the local instance on other devices under the same network.").default(!1),b=new n("--focus-only [focusOnly]","Build or Start only specified part of app.").default("app").choices(["all","app","client","server","entrypoint"]),h=new n("--port [port]","Server port.").default(3e3),k=new n("--mode [mode]","Env mode.").env("VITE_ENV_MODE").default("production"),P=new n("--build-dir [buildDir]","Build directory output.");y.command(m.dev).description("Run development server.").addOption(g).addOption(h).addOption(new n("--reset-cache","Clear vite cache before run.").default(!1)).addOption(new n("--mode [mode]","Env mode.").env("VITE_ENV_MODE").default("development")).addOption(new n("--entrypoint [entrypoint]","Run only entrypoint by name.")).action((async({host:e,port:i,resetCache:n,mode:t,entrypoint:r})=>{n&&await s();const d=async n=>{console.info(o.cyan("Starting the development server..."));const{server:s,config:d}=await a({version:w,isHost:e,isPrintInfo:n,port:i,mode:t,entrypointName:r});f.server=s,f.config=d};return f.reboot=d,v(),d()})),y.command(m.build).description("Create production build.").addOption(b).addOption(k).addOption(new n("--client-options [client-options]",'Pass vite build options for client. Example: --client-options="--ssrManifest"').env("VITE_BUILD_CLIENT_OPTIONS").default("")).addOption(new n("--server-options [server-options]","Pass vite build options for server.").env("VITE_BUILD_SERVER_OPTIONS").default("")).addOption(new n("--unlock-robots","Change general directive Disallow to Allow in robots.txt").default(!1)).addOption(new n("--eject","Produces entrypoint file to run app without cli").default(!1)).addOption(new n("--serverless","Produces entrypoint file to run app like serverless function").default(!1)).addOption(new n("--throw-warnings","The build will abort with an error if warnings occur in the process.").default(!1)).action((async({focusOnly:e,clientOptions:o,serverOptions:i,mode:n,unlockRobots:r,eject:s,serverless:d,throwWarnings:a})=>{await t({focusOnly:e,isUnlockRobots:r,isNoWarnings:a,isEject:s,isServerless:d,clientOptions:o,serverOptions:i,mode:n})})),y.command(m.start).description("Run production server.").addOption(g).addOption(h).addOption(b).addOption(P).addOption(new n("--module-preload","Add module preload scripts to server output.").default(!1)).action((({host:e,port:o,focusOnly:i,modulePreload:n,buildDir:t})=>{const r=async r=>{const{server:s,config:d}=await l({version:w,isHost:e,isPrintInfo:r,port:o,focusOnly:i,modulePreload:n,buildDir:t});f.server=s,f.config=d};return f.reboot=r,v(),r()})),y.command(m.preview).description("Build and preview production.").addOption(b).addOption(g).addOption(h).addOption(k).addOption(P).action((async({host:e,port:i,focusOnly:n,mode:r,buildDir:s})=>{global.viteBoostStartTime=performance.now();const d=async t=>{const{server:r,config:d}=await l({version:w,isHost:e,isPrintInfo:t,port:i,focusOnly:n,buildDir:s});r.on("listening",(()=>{setTimeout((()=>{d.getLogger().info(o.yellow("\n Running preview mode... \n"))}),0)})),f.server=r,f.config=d};f.reboot=d,v();await t({mode:r,isWatch:!0,focusOnly:n,clientOptions:"-w",serverOptions:"-w",onFinish:()=>{d()}})})),y.command(m.buildDocker).description("Create docker image with production build.").requiredOption("--image-name <image-name>","Docker image name.").addOption(new n("--docker-options [docker-options]","Extra docker options which pass to docker build command.")).addOption(new n("--docker-file [docker-file]","Name of the Dockerfile (Default is PLUGIN_PATH/workflow/Dockerfile).")).addOption(b).addOption(k).action((async({imageName:e,dockerOptions:o,dockerFile:i,focusOnly:n,mode:t})=>{await c({imageName:e,dockerOptions:o,dockerFile:i,focusOnly:n,mode:t})})),y.command(m.buildAmplify).description("Create AWS Amplify production build.").addOption(new n("--manifest-file [manifest-file]","Path to the Amplify manifest file (Default is PLUGIN_PATH/workflow/amplify-manifest.json).")).addOption(new n("--is-optimize","Optimize node_modules folder.").default(!1)).addOption(k).action((async({manifestFile:e,mode:o,isOptimize:i})=>{await d({manifestFile:e,mode:o,isOptimize:i})})),y.command(m.buildVercel).description("Create Vercel serverless production build.").addOption(new n("--config-file [config-file]","Path to the Vercel config.json file (Default is PLUGIN_PATH/workflow/vercel.config.json).")).addOption(new n("--config-vc-file [config-vc-file]","Path to the Vercel vc-config.json file (Default is PLUGIN_PATH/workflow/vercel.vc-config.json).")).addOption(new n("--is-optimize","Optimize node_modules folder.").default(!1)).addOption(k).action((async({configFile:e,configVcFile:o,mode:i,isOptimize:n})=>{await p({configFile:e,configVcFile:o,mode:i,isOptimize:n})})),y.parse();
2
+ import{readFileSync as e}from"fs";import o from"chalk";import{Command as i,Option as n}from"commander";import t from"./cli/build.js";import r from"./cli/helpers/keyboard-input.js";import s from"./cli/helpers/vite-reset-cache.js";import d from"./cli/run-amplify-build.js";import a from"./cli/run-dev.js";import c from"./cli/run-docker-build.js";import l from"./cli/run-prod.js";import p from"./cli/run-vercel-build.js";import m from"./constants/cli-actions.js";import f from"./constants/cli-context.js";import u from"./constants/cli-name.js";const{description:O,version:w}=JSON.parse(e(new URL("./package.json",import.meta.url),"utf8")),v=()=>{process.stdin.isTTY&&(process.stdin.setRawMode(!0),process.stdin.on("data",r).setEncoding("utf8").resume())},y=new i;y.name(u).description(O).version(w).hook("preAction",(e,o)=>{global.viteBoostAction=o.name()});const g=new n("--host","Ability to access the local instance on other devices under the same network.").default(!1),b=new n("--focus-only [focusOnly]","Build or Start only specified part of app.").default("app").choices(["all","app","client","server","entrypoint"]),h=new n("--port [port]","Server port.").default(3e3),k=new n("--mode [mode]","Env mode.").env("VITE_ENV_MODE").default("production"),P=new n("--build-dir [buildDir]","Build directory output.");y.command(m.dev).description("Run development server.").addOption(g).addOption(h).addOption(new n("--reset-cache","Clear vite cache before run.").default(!1)).addOption(new n("--mode [mode]","Env mode.").env("VITE_ENV_MODE").default("development")).addOption(new n("--entrypoint [entrypoint]","Run only entrypoint by name.")).action(async({host:e,port:i,resetCache:n,mode:t,entrypoint:r})=>{n&&await s();const d=async n=>{console.info(o.cyan("Starting the development server..."));const{server:s,config:d}=await a({version:w,isHost:e,isPrintInfo:n,port:i,mode:t,entrypointName:r});f.server=s,f.config=d};return f.reboot=d,v(),d()}),y.command(m.build).description("Create production build.").addOption(b).addOption(k).addOption(new n("--client-options [client-options]",'Pass vite build options for client. Example: --client-options="--ssrManifest"').env("VITE_BUILD_CLIENT_OPTIONS").default("")).addOption(new n("--server-options [server-options]","Pass vite build options for server.").env("VITE_BUILD_SERVER_OPTIONS").default("")).addOption(new n("--unlock-robots","Change general directive Disallow to Allow in robots.txt").default(!1)).addOption(new n("--eject","Produces entrypoint file to run app without cli").default(!1)).addOption(new n("--serverless","Produces entrypoint file to run app like serverless function").default(!1)).addOption(new n("--throw-warnings","The build will abort with an error if warnings occur in the process.").default(!1)).action(async({focusOnly:e,clientOptions:o,serverOptions:i,mode:n,unlockRobots:r,eject:s,serverless:d,throwWarnings:a})=>{await t({focusOnly:e,isUnlockRobots:r,isNoWarnings:a,isEject:s,isServerless:d,clientOptions:o,serverOptions:i,mode:n})}),y.command(m.start).description("Run production server.").addOption(g).addOption(h).addOption(b).addOption(P).addOption(new n("--module-preload","Add module preload scripts to server output.").default(!1)).action(({host:e,port:o,focusOnly:i,modulePreload:n,buildDir:t})=>{const r=async r=>{const{server:s,config:d}=await l({version:w,isHost:e,isPrintInfo:r,port:o,focusOnly:i,modulePreload:n,buildDir:t});f.server=s,f.config=d};return f.reboot=r,v(),r()}),y.command(m.preview).description("Build and preview production.").addOption(b).addOption(g).addOption(h).addOption(k).addOption(P).action(async({host:e,port:i,focusOnly:n,mode:r,buildDir:s})=>{global.viteBoostStartTime=performance.now();const d=async t=>{const{server:r,config:d}=await l({version:w,isHost:e,isPrintInfo:t,port:i,focusOnly:n,buildDir:s});r.on("listening",()=>{setTimeout(()=>{d.getLogger().info(o.yellow("\n Running preview mode... \n"))},0)}),f.server=r,f.config=d};f.reboot=d,v();await t({mode:r,isWatch:!0,focusOnly:n,clientOptions:"-w",serverOptions:"-w",onFinish:()=>{d()}})}),y.command(m.buildDocker).description("Create docker image with production build.").requiredOption("--image-name <image-name>","Docker image name.").addOption(new n("--docker-options [docker-options]","Extra docker options which pass to docker build command.")).addOption(new n("--docker-file [docker-file]","Name of the Dockerfile (Default is PLUGIN_PATH/workflow/Dockerfile).")).addOption(b).addOption(k).action(async({imageName:e,dockerOptions:o,dockerFile:i,focusOnly:n,mode:t})=>{await c({imageName:e,dockerOptions:o,dockerFile:i,focusOnly:n,mode:t})}),y.command(m.buildAmplify).description("Create AWS Amplify production build.").addOption(new n("--manifest-file [manifest-file]","Path to the Amplify manifest file (Default is PLUGIN_PATH/workflow/amplify-manifest.json).")).addOption(new n("--is-optimize","Optimize node_modules folder.").default(!1)).addOption(k).action(async({manifestFile:e,mode:o,isOptimize:i})=>{await d({manifestFile:e,mode:o,isOptimize:i})}),y.command(m.buildVercel).description("Create Vercel serverless production build.").addOption(new n("--config-file [config-file]","Path to the Vercel config.json file (Default is PLUGIN_PATH/workflow/vercel.config.json).")).addOption(new n("--config-vc-file [config-vc-file]","Path to the Vercel vc-config.json file (Default is PLUGIN_PATH/workflow/vercel.vc-config.json).")).addOption(new n("--is-optimize","Optimize node_modules folder.").default(!1)).addOption(k).action(async({configFile:e,configVcFile:o,mode:i,isOptimize:n})=>{await p({configFile:e,configVcFile:o,mode:i,isOptimize:n})}),y.parse();
3
3
  //# sourceMappingURL=cli.js.map
package/cli.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { readFileSync } from 'fs';\nimport chalk from 'chalk';\nimport { Command, Option } from 'commander';\nimport runBuild from '@cli/build';\nimport onKeyPress from '@cli/helpers/keyboard-input';\nimport viteResetCache from '@cli/helpers/vite-reset-cache';\nimport type {\n IBuildActionParams,\n IBuildAmplifyActionParams,\n IBuildDockerActionParams,\n IBuildVercelActionParams,\n IDevActionParams,\n IPreviewActionParams,\n IStartActionParams,\n} from '@cli/interfaces/actions';\nimport runAmplifyBuild from '@cli/run-amplify-build';\nimport runDev from '@cli/run-dev';\nimport runDockerBuild from '@cli/run-docker-build';\nimport runProd from '@cli/run-prod';\nimport runVercelBuild from '@cli/run-vercel-build';\nimport CliActions from '@constants/cli-actions';\nimport cliContext from '@constants/cli-context';\nimport cliName from '@constants/cli-name';\n\n/**\n * Parse package meta\n */\nconst { description, version } = JSON.parse(\n readFileSync(new URL('./package.json', import.meta.url), 'utf8'),\n) as { name: string; description: string; version: string };\n\n/**\n * Enable shortcuts\n * listen keyboard command\n */\nconst enableShortcuts = (): void => {\n if (process.stdin.isTTY) {\n process.stdin.setRawMode(true);\n process.stdin.on('data', onKeyPress).setEncoding('utf8').resume();\n }\n};\n\nconst program = new Command();\n\nprogram\n .name(cliName)\n .description(description)\n .version(version)\n .hook('preAction', (_, actionCommand) => {\n // pass cli action to plugin config\n global.viteBoostAction = actionCommand.name();\n });\n\n/**\n * Common options\n */\nconst hostOption = new Option(\n '--host',\n 'Ability to access the local instance on other devices under the same network.',\n).default(false);\nconst focusOnlyOption = new Option(\n '--focus-only [focusOnly]',\n 'Build or Start only specified part of app.',\n)\n .default('app')\n .choices(['all', 'app', 'client', 'server', 'entrypoint']);\nconst portOption = new Option('--port [port]', 'Server port.').default(3000);\nconst envModeOption = new Option('--mode [mode]', 'Env mode.')\n .env('VITE_ENV_MODE')\n .default('production');\nconst buildDirOption = new Option('--build-dir [buildDir]', 'Build directory output.');\n\n/**\n * Cli commands\n */\n\nprogram\n .command(CliActions.dev)\n .description('Run development server.')\n .addOption(hostOption)\n .addOption(portOption)\n .addOption(new Option('--reset-cache', 'Clear vite cache before run.').default(false))\n .addOption(new Option('--mode [mode]', 'Env mode.').env('VITE_ENV_MODE').default('development'))\n .addOption(new Option('--entrypoint [entrypoint]', 'Run only entrypoint by name.'))\n .action(async ({ host, port, resetCache, mode, entrypoint }: IDevActionParams) => {\n if (resetCache) {\n await viteResetCache();\n }\n\n const command = async (isPrintInfo?: boolean): Promise<void> => {\n console.info(chalk.cyan('Starting the development server...'));\n\n const { server, config } = await runDev({\n version,\n isHost: host,\n isPrintInfo,\n port,\n mode,\n entrypointName: entrypoint,\n });\n\n cliContext.server = server;\n cliContext.config = config;\n };\n\n cliContext.reboot = command;\n\n enableShortcuts();\n\n return command();\n });\n\nprogram\n .command(CliActions.build)\n .description('Create production build.')\n .addOption(focusOnlyOption)\n .addOption(envModeOption)\n .addOption(\n new Option(\n '--client-options [client-options]',\n 'Pass vite build options for client. Example: --client-options=\"--ssrManifest\"',\n )\n .env('VITE_BUILD_CLIENT_OPTIONS')\n .default(''),\n )\n .addOption(\n new Option('--server-options [server-options]', 'Pass vite build options for server.')\n .env('VITE_BUILD_SERVER_OPTIONS')\n .default(''),\n )\n .addOption(\n new Option(\n '--unlock-robots',\n 'Change general directive Disallow to Allow in robots.txt',\n ).default(false),\n )\n .addOption(\n new Option('--eject', 'Produces entrypoint file to run app without cli').default(false),\n )\n .addOption(\n new Option(\n '--serverless',\n 'Produces entrypoint file to run app like serverless function',\n ).default(false),\n )\n .addOption(\n new Option(\n '--throw-warnings',\n 'The build will abort with an error if warnings occur in the process.',\n ).default(false),\n )\n .action(\n async ({\n focusOnly,\n clientOptions,\n serverOptions,\n mode,\n unlockRobots,\n eject,\n serverless,\n throwWarnings,\n }: IBuildActionParams) => {\n await runBuild({\n focusOnly,\n isUnlockRobots: unlockRobots,\n isNoWarnings: throwWarnings,\n isEject: eject,\n isServerless: serverless,\n clientOptions,\n serverOptions,\n mode: mode!,\n });\n },\n );\n\nprogram\n .command(CliActions.start)\n .description('Run production server.')\n .addOption(hostOption)\n .addOption(portOption)\n .addOption(focusOnlyOption)\n .addOption(buildDirOption)\n .addOption(\n new Option('--module-preload', 'Add module preload scripts to server output.').default(false),\n )\n .action(({ host, port, focusOnly, modulePreload, buildDir }: IStartActionParams) => {\n const command = async (isPrintInfo?: boolean): Promise<void> => {\n const { server, config } = await runProd({\n version,\n isHost: host,\n isPrintInfo,\n port,\n focusOnly,\n modulePreload,\n buildDir,\n });\n\n cliContext.server = server;\n cliContext.config = config;\n };\n\n cliContext.reboot = command;\n\n enableShortcuts();\n\n return command();\n });\n\nprogram\n .command(CliActions.preview)\n .description('Build and preview production.')\n .addOption(focusOnlyOption)\n .addOption(hostOption)\n .addOption(portOption)\n .addOption(envModeOption)\n .addOption(buildDirOption)\n .action(async ({ host, port, focusOnly, mode, buildDir }: IPreviewActionParams) => {\n global.viteBoostStartTime = performance.now();\n\n const command = async (isPrintInfo?: boolean): Promise<void> => {\n const { server, config } = await runProd({\n version,\n isHost: host,\n isPrintInfo,\n port,\n focusOnly,\n buildDir,\n });\n\n server.on('listening', () => {\n setTimeout(() => {\n config.getLogger().info(chalk.yellow('\\n Running preview mode... \\n'));\n }, 0);\n });\n\n cliContext.server = server;\n cliContext.config = config;\n };\n\n cliContext.reboot = command;\n\n enableShortcuts();\n\n const buildOptions = '-w';\n\n await runBuild({\n mode: mode!,\n isWatch: true,\n focusOnly,\n clientOptions: buildOptions,\n serverOptions: buildOptions,\n onFinish: () => {\n void command();\n },\n });\n });\n\nprogram\n .command(CliActions.buildDocker)\n .description('Create docker image with production build.')\n .requiredOption('--image-name <image-name>', 'Docker image name.')\n .addOption(\n new Option(\n '--docker-options [docker-options]',\n 'Extra docker options which pass to docker build command.',\n ),\n )\n .addOption(\n new Option(\n '--docker-file [docker-file]',\n 'Name of the Dockerfile (Default is PLUGIN_PATH/workflow/Dockerfile).',\n ),\n )\n .addOption(focusOnlyOption)\n .addOption(envModeOption)\n .action(\n async ({ imageName, dockerOptions, dockerFile, focusOnly, mode }: IBuildDockerActionParams) => {\n await runDockerBuild({\n imageName,\n dockerOptions,\n dockerFile,\n focusOnly,\n mode,\n });\n },\n );\n\nprogram\n .command(CliActions.buildAmplify)\n .description('Create AWS Amplify production build.')\n .addOption(\n new Option(\n '--manifest-file [manifest-file]',\n 'Path to the Amplify manifest file (Default is PLUGIN_PATH/workflow/amplify-manifest.json).',\n ),\n )\n .addOption(new Option('--is-optimize', 'Optimize node_modules folder.').default(false))\n .addOption(envModeOption)\n .action(async ({ manifestFile, mode, isOptimize }: IBuildAmplifyActionParams) => {\n await runAmplifyBuild({\n manifestFile,\n mode,\n isOptimize,\n });\n });\n\nprogram\n .command(CliActions.buildVercel)\n .description('Create Vercel serverless production build.')\n .addOption(\n new Option(\n '--config-file [config-file]',\n 'Path to the Vercel config.json file (Default is PLUGIN_PATH/workflow/vercel.config.json).',\n ),\n )\n .addOption(\n new Option(\n '--config-vc-file [config-vc-file]',\n 'Path to the Vercel vc-config.json file (Default is PLUGIN_PATH/workflow/vercel.vc-config.json).',\n ),\n )\n .addOption(new Option('--is-optimize', 'Optimize node_modules folder.').default(false))\n .addOption(envModeOption)\n .action(async ({ configFile, configVcFile, mode, isOptimize }: IBuildVercelActionParams) => {\n await runVercelBuild({\n configFile,\n configVcFile,\n mode,\n isOptimize,\n });\n });\n\nprogram.parse();\n"],"names":["description","version","JSON","parse","readFileSync","URL","url","enableShortcuts","process","stdin","isTTY","setRawMode","on","onKeyPress","setEncoding","resume","program","Command","name","cliName","hook","_","actionCommand","global","viteBoostAction","hostOption","Option","default","focusOnlyOption","choices","portOption","envModeOption","env","buildDirOption","command","CliActions","dev","addOption","action","async","host","port","resetCache","mode","entrypoint","viteResetCache","isPrintInfo","console","info","chalk","cyan","server","config","runDev","isHost","entrypointName","cliContext","reboot","build","focusOnly","clientOptions","serverOptions","unlockRobots","eject","serverless","throwWarnings","runBuild","isUnlockRobots","isNoWarnings","isEject","isServerless","start","modulePreload","buildDir","runProd","preview","viteBoostStartTime","performance","now","setTimeout","getLogger","yellow","isWatch","onFinish","buildDocker","requiredOption","imageName","dockerOptions","dockerFile","runDockerBuild","buildAmplify","manifestFile","isOptimize","runAmplifyBuild","buildVercel","configFile","configVcFile","runVercelBuild"],"mappings":";6hBA6BA,MAAMA,YAAEA,EAAWC,QAAEA,GAAYC,KAAKC,MACpCC,EAAa,IAAIC,IAAI,6BAA8BC,KAAM,SAOrDC,EAAkB,KAClBC,QAAQC,MAAMC,QAChBF,QAAQC,MAAME,YAAW,GACzBH,QAAQC,MAAMG,GAAG,OAAQC,GAAYC,YAAY,QAAQC,SAC3D,EAGIC,EAAU,IAAIC,EAEpBD,EACGE,KAAKC,GACLnB,YAAYA,GACZC,QAAQA,GACRmB,KAAK,aAAa,CAACC,EAAGC,KAErBC,OAAOC,gBAAkBF,EAAcJ,MAAM,IAMjD,MAAMO,EAAa,IAAIC,EACrB,SACA,iFACAC,SAAQ,GACJC,EAAkB,IAAIF,EAC1B,2BACA,8CAECC,QAAQ,OACRE,QAAQ,CAAC,MAAO,MAAO,SAAU,SAAU,eACxCC,EAAa,IAAIJ,EAAO,gBAAiB,gBAAgBC,QAAQ,KACjEI,EAAgB,IAAIL,EAAO,gBAAiB,aAC/CM,IAAI,iBACJL,QAAQ,cACLM,EAAiB,IAAIP,EAAO,yBAA0B,2BAM5DV,EACGkB,QAAQC,EAAWC,KACnBpC,YAAY,2BACZqC,UAAUZ,GACVY,UAAUP,GACVO,UAAU,IAAIX,EAAO,gBAAiB,gCAAgCC,SAAQ,IAC9EU,UAAU,IAAIX,EAAO,gBAAiB,aAAaM,IAAI,iBAAiBL,QAAQ,gBAChFU,UAAU,IAAIX,EAAO,4BAA6B,iCAClDY,QAAOC,OAASC,OAAMC,OAAMC,aAAYC,OAAMC,iBACzCF,SACIG,IAGR,MAAMX,EAAUK,MAAOO,IACrBC,QAAQC,KAAKC,EAAMC,KAAK,uCAExB,MAAMC,OAAEA,EAAMC,OAAEA,SAAiBC,EAAO,CACtCpD,UACAqD,OAAQd,EACRM,cACAL,OACAE,OACAY,eAAgBX,IAGlBY,EAAWL,OAASA,EACpBK,EAAWJ,OAASA,CAAM,EAO5B,OAJAI,EAAWC,OAASvB,EAEpB3B,IAEO2B,GAAS,IAGpBlB,EACGkB,QAAQC,EAAWuB,OACnB1D,YAAY,4BACZqC,UAAUT,GACVS,UAAUN,GACVM,UACC,IAAIX,EACF,oCACA,iFAECM,IAAI,6BACJL,QAAQ,KAEZU,UACC,IAAIX,EAAO,oCAAqC,uCAC7CM,IAAI,6BACJL,QAAQ,KAEZU,UACC,IAAIX,EACF,kBACA,4DACAC,SAAQ,IAEXU,UACC,IAAIX,EAAO,UAAW,mDAAmDC,SAAQ,IAElFU,UACC,IAAIX,EACF,eACA,gEACAC,SAAQ,IAEXU,UACC,IAAIX,EACF,mBACA,wEACAC,SAAQ,IAEXW,QACCC,OACEoB,YACAC,gBACAC,gBACAlB,OACAmB,eACAC,QACAC,aACAC,0BAEMC,EAAS,CACbP,YACAQ,eAAgBL,EAChBM,aAAcH,EACdI,QAASN,EACTO,aAAcN,EACdJ,gBACAC,gBACAlB,KAAMA,GACN,IAIR3B,EACGkB,QAAQC,EAAWoC,OACnBvE,YAAY,0BACZqC,UAAUZ,GACVY,UAAUP,GACVO,UAAUT,GACVS,UAAUJ,GACVI,UACC,IAAIX,EAAO,mBAAoB,gDAAgDC,SAAQ,IAExFW,QAAO,EAAGE,OAAMC,OAAMkB,YAAWa,gBAAeC,eAC/C,MAAMvC,EAAUK,MAAOO,IACrB,MAAMK,OAAEA,EAAMC,OAAEA,SAAiBsB,EAAQ,CACvCzE,UACAqD,OAAQd,EACRM,cACAL,OACAkB,YACAa,gBACAC,aAGFjB,EAAWL,OAASA,EACpBK,EAAWJ,OAASA,CAAM,EAO5B,OAJAI,EAAWC,OAASvB,EAEpB3B,IAEO2B,GAAS,IAGpBlB,EACGkB,QAAQC,EAAWwC,SACnB3E,YAAY,iCACZqC,UAAUT,GACVS,UAAUZ,GACVY,UAAUP,GACVO,UAAUN,GACVM,UAAUJ,GACVK,QAAOC,OAASC,OAAMC,OAAMkB,YAAWhB,OAAM8B,eAC5ClD,OAAOqD,mBAAqBC,YAAYC,MAExC,MAAM5C,EAAUK,MAAOO,IACrB,MAAMK,OAAEA,EAAMC,OAAEA,SAAiBsB,EAAQ,CACvCzE,UACAqD,OAAQd,EACRM,cACAL,OACAkB,YACAc,aAGFtB,EAAOvC,GAAG,aAAa,KACrBmE,YAAW,KACT3B,EAAO4B,YAAYhC,KAAKC,EAAMgC,OAAO,kCAAkC,GACtE,EAAE,IAGPzB,EAAWL,OAASA,EACpBK,EAAWJ,OAASA,CAAM,EAG5BI,EAAWC,OAASvB,EAEpB3B,UAIM2D,EAAS,CACbvB,KAAMA,EACNuC,SAAS,EACTvB,YACAC,cANmB,KAOnBC,cAPmB,KAQnBsB,SAAU,KACHjD,GAAS,GAEhB,IAGNlB,EACGkB,QAAQC,EAAWiD,aACnBpF,YAAY,8CACZqF,eAAe,4BAA6B,sBAC5ChD,UACC,IAAIX,EACF,oCACA,6DAGHW,UACC,IAAIX,EACF,8BACA,yEAGHW,UAAUT,GACVS,UAAUN,GACVO,QACCC,OAAS+C,YAAWC,gBAAeC,aAAY7B,YAAWhB,iBAClD8C,EAAe,CACnBH,YACAC,gBACAC,aACA7B,YACAhB,QACA,IAIR3B,EACGkB,QAAQC,EAAWuD,cACnB1F,YAAY,wCACZqC,UACC,IAAIX,EACF,kCACA,+FAGHW,UAAU,IAAIX,EAAO,gBAAiB,iCAAiCC,SAAQ,IAC/EU,UAAUN,GACVO,QAAOC,OAASoD,eAAchD,OAAMiD,uBAC7BC,EAAgB,CACpBF,eACAhD,OACAiD,cACA,IAGN5E,EACGkB,QAAQC,EAAW2D,aACnB9F,YAAY,8CACZqC,UACC,IAAIX,EACF,8BACA,8FAGHW,UACC,IAAIX,EACF,oCACA,oGAGHW,UAAU,IAAIX,EAAO,gBAAiB,iCAAiCC,SAAQ,IAC/EU,UAAUN,GACVO,QAAOC,OAASwD,aAAYC,eAAcrD,OAAMiD,uBACzCK,EAAe,CACnBF,aACAC,eACArD,OACAiD,cACA,IAGN5E,EAAQb"}
1
+ {"version":3,"file":"cli.js","sources":["../src/cli.ts"],"sourcesContent":[null],"names":["description","version","JSON","parse","readFileSync","URL","url","enableShortcuts","process","stdin","isTTY","setRawMode","on","onKeyPress","setEncoding","resume","program","Command","name","cliName","hook","_","actionCommand","global","viteBoostAction","hostOption","Option","default","focusOnlyOption","choices","portOption","envModeOption","env","buildDirOption","command","CliActions","dev","addOption","action","async","host","port","resetCache","mode","entrypoint","viteResetCache","isPrintInfo","console","info","chalk","cyan","server","config","runDev","isHost","entrypointName","cliContext","reboot","build","focusOnly","clientOptions","serverOptions","unlockRobots","eject","serverless","throwWarnings","runBuild","isUnlockRobots","isNoWarnings","isEject","isServerless","start","modulePreload","buildDir","runProd","preview","viteBoostStartTime","performance","now","setTimeout","getLogger","yellow","isWatch","onFinish","buildDocker","requiredOption","imageName","dockerOptions","dockerFile","runDockerBuild","buildAmplify","manifestFile","isOptimize","runAmplifyBuild","buildVercel","configFile","configVcFile","runVercelBuild"],"mappings":"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"}
@@ -1,5 +1,5 @@
1
- import { FC } from 'react';
2
- import { NavigateProps } from 'react-router';
1
+ import type { FC } from 'react';
2
+ import type { NavigateProps } from 'react-router';
3
3
  interface INavigate {
4
4
  status?: number;
5
5
  }
@@ -9,4 +9,4 @@ type TProps = INavigate & NavigateProps;
9
9
  * @constructor
10
10
  */
11
11
  declare const Navigate: FC<TProps>;
12
- export { Navigate as default };
12
+ export default Navigate;
@@ -1 +1 @@
1
- {"version":3,"file":"navigate.js","sources":["../../src/components/navigate.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport React from 'react';\nimport type { NavigateProps } from 'react-router';\nimport { Navigate as DefaultNavigate } from 'react-router';\nimport { useServerContext } from '@context/server';\n\ninterface INavigate {\n status?: number;\n}\n\ntype TProps = INavigate & NavigateProps;\n\n/**\n * React router navigate with server support\n * @constructor\n */\nconst Navigate: FC<TProps> = ({ to, status = 301, ...rest }) => {\n const context = useServerContext();\n\n if (!context.isServer) {\n return <DefaultNavigate to={to} {...rest} />;\n }\n\n if (context) {\n const { basename } = context;\n const location = [basename, typeof to === 'string' ? to : [to.pathname, to.search, to.hash]]\n .flat()\n .filter(Boolean)\n .join('')\n .replace(/\\/+/g, '/');\n\n context.response = new Response('', { status, headers: new Headers({ Location: location }) });\n }\n\n return null;\n};\n\nexport default Navigate;\n"],"names":["Navigate","to","status","rest","context","useServerContext","isServer","React","createElement","DefaultNavigate","basename","location","pathname","search","hash","flat","filter","Boolean","join","replace","response","Response","headers","Headers","Location"],"mappings":"qHAgBA,MAAMA,EAAuB,EAAGC,KAAIC,SAAS,OAAQC,MACnD,MAAMC,EAAUC,IAEhB,IAAKD,EAAQE,SACX,OAAOC,EAAAC,cAACC,EAAe,CAACR,GAAIA,KAAQE,IAGtC,GAAIC,EAAS,CACX,MAAMM,SAAEA,GAAaN,EACfO,EAAW,CAACD,EAAwB,iBAAPT,EAAkBA,EAAK,CAACA,EAAGW,SAAUX,EAAGY,OAAQZ,EAAGa,OACnFC,OACAC,OAAOC,SACPC,KAAK,IACLC,QAAQ,OAAQ,KAEnBf,EAAQgB,SAAW,IAAIC,SAAS,GAAI,CAAEnB,SAAQoB,QAAS,IAAIC,QAAQ,CAAEC,SAAUb,KACjF,CAEA,OAAO,IAAI"}
1
+ {"version":3,"file":"navigate.js","sources":["../../src/components/navigate.tsx"],"sourcesContent":[null],"names":["Navigate","to","status","rest","context","useServerContext","isServer","React","createElement","DefaultNavigate","basename","location","pathname","search","hash","flat","filter","Boolean","join","replace","response","Response","headers","Headers","Location"],"mappings":"qHAgBA,MAAMA,EAAuB,EAAGC,KAAIC,SAAS,OAAQC,MACnD,MAAMC,EAAUC,IAEhB,IAAKD,EAAQE,SACX,OAAOC,EAAAC,cAACC,EAAe,CAACR,GAAIA,KAAQE,IAGtC,GAAIC,EAAS,CACX,MAAMM,SAAEA,GAAaN,EACfO,EAAW,CAACD,EAAwB,iBAAPT,EAAkBA,EAAK,CAACA,EAAGW,SAAUX,EAAGY,OAAQZ,EAAGa,OACnFC,OACAC,OAAOC,SACPC,KAAK,IACLC,QAAQ,OAAQ,KAEnBf,EAAQgB,SAAW,IAAIC,SAAS,GAAI,CAAEnB,SAAQoB,QAAS,IAAIC,QAAQ,CAAEC,SAAUb,KACjF,CAEA,OAAO"}
@@ -1,4 +1,4 @@
1
- import { ComponentType, ReactNode } from 'react';
1
+ import type { ComponentType, ReactNode } from 'react';
2
2
  interface IOnlyClient<T> {
3
3
  load: () => Promise<{
4
4
  default: ComponentType<T>;
@@ -13,4 +13,4 @@ interface IOnlyClient<T> {
13
13
  * @constructor
14
14
  */
15
15
  declare function OnlyClient<T>({ load, children, fallback, errorComponent, isMemorized, }: IOnlyClient<T>): ReactNode;
16
- export { OnlyClient as default };
16
+ export default OnlyClient;
@@ -1,2 +1,2 @@
1
- import e,{useState as t,useEffect as l,startTransition as n,lazy as o}from"react";const a=e.createElement("p",null,"Failed to load client side component.");function r({load:r,children:c,fallback:d,errorComponent:i=a,isMemorized:u=!1}){const[f,m]=t(null);return l((()=>{n((()=>{const e=o((()=>r().then((e=>({default:()=>c("default"in e?e.default:e)}))).catch((e=>(console.error("Client side component loading failed:",e),{default:()=>i})))));m(e)}))}),[!!u||c]),f?e.createElement(f,null):d}export{r as default};
1
+ import e,{useState as t,useEffect as l,startTransition as n,lazy as o}from"react";const a=e.createElement("p",null,"Failed to load client side component.");function r({load:r,children:c,fallback:d,errorComponent:i=a,isMemorized:u=!1}){const[f,m]=t(null);return l(()=>{n(()=>{const e=o(()=>r().then(e=>({default:()=>c("default"in e?e.default:e)})).catch(e=>(console.error("Client side component loading failed:",e),{default:()=>i})));m(e)})},[!!u||c]),f?e.createElement(f,null):d}export{r as default};
2
2
  //# sourceMappingURL=only-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"only-client.js","sources":["../../src/components/only-client.tsx"],"sourcesContent":["import type { ComponentType, ReactNode } from 'react';\nimport React, { lazy, startTransition, useEffect, useState } from 'react';\n\ninterface IOnlyClient<T> {\n load: () => Promise<{ default: ComponentType<T> } | ComponentType<T>>;\n children: (Component: ComponentType<T>) => ReactNode;\n fallback?: ReactNode;\n errorComponent?: ReactNode;\n isMemorized?: boolean;\n}\n\nconst defaultError = <p>Failed to load client side component.</p>;\n\n/**\n * Render component only on client side\n * @constructor\n */\nfunction OnlyClient<T>({\n load,\n children,\n fallback,\n errorComponent = defaultError,\n isMemorized = false,\n}: IOnlyClient<T>): ReactNode {\n const [Component, setComponent] = useState<ComponentType<unknown> | null>(null);\n\n useEffect(() => {\n startTransition(() => {\n const LoadedComponent = lazy(() =>\n load()\n .then((Loaded) => ({\n default: () => children('default' in Loaded ? Loaded.default : Loaded),\n }))\n .catch((error: Error) => {\n console.error('Client side component loading failed:', error);\n\n return { default: () => errorComponent };\n }),\n );\n\n setComponent(LoadedComponent);\n });\n }, [isMemorized ? true : children]);\n\n return Component ? <Component /> : fallback;\n}\n\nexport default OnlyClient;\n"],"names":["defaultError","React","createElement","OnlyClient","load","children","fallback","errorComponent","isMemorized","Component","setComponent","useState","useEffect","startTransition","LoadedComponent","lazy","then","Loaded","default","catch","error","console"],"mappings":"kFAWA,MAAMA,EAAeC,EAAAC,cAAA,IAAA,KAAA,yCAMrB,SAASC,GAAcC,KACrBA,EAAIC,SACJA,EAAQC,SACRA,EAAQC,eACRA,EAAiBP,EAAYQ,YAC7BA,GAAc,IAEd,MAAOC,EAAWC,GAAgBC,EAAwC,MAoB1E,OAlBAC,GAAU,KACRC,GAAgB,KACd,MAAMC,EAAkBC,GAAK,IAC3BX,IACGY,MAAMC,IAAM,CACXC,QAAS,IAAMb,EAAS,YAAaY,EAASA,EAAOC,QAAUD,OAEhEE,OAAOC,IACNC,QAAQD,MAAM,wCAAyCA,GAEhD,CAAEF,QAAS,IAAMX,QAI9BG,EAAaI,EAAgB,GAC7B,GACD,GAACN,GAAqBH,IAElBI,EAAYR,EAAAC,cAACO,EAAS,MAAMH,CACrC"}
1
+ {"version":3,"file":"only-client.js","sources":["../../src/components/only-client.tsx"],"sourcesContent":[null],"names":["defaultError","React","createElement","OnlyClient","load","children","fallback","errorComponent","isMemorized","Component","setComponent","useState","useEffect","startTransition","LoadedComponent","lazy","then","Loaded","default","catch","error","console"],"mappings":"kFAWA,MAAMA,EAAeC,EAAAC,cAAA,IAAA,KAAA,yCAMrB,SAASC,GAAcC,KACrBA,EAAIC,SACJA,EAAQC,SACRA,EAAQC,eACRA,EAAiBP,EAAYQ,YAC7BA,GAAc,IAEd,MAAOC,EAAWC,GAAgBC,EAAwC,MAoB1E,OAlBAC,EAAU,KACRC,EAAgB,KACd,MAAMC,EAAkBC,EAAK,IAC3BX,IACGY,KAAMC,IAAM,CACXC,QAAS,IAAMb,EAAS,YAAaY,EAASA,EAAOC,QAAUD,MAEhEE,MAAOC,IACNC,QAAQD,MAAM,wCAAyCA,GAEhD,CAAEF,QAAS,IAAMX,MAI9BG,EAAaI,MAEd,GAACN,GAAqBH,IAElBI,EAAYR,EAAAC,cAACO,EAAS,MAAMH,CACrC"}
@@ -1,5 +1,5 @@
1
- import { FC, ReactNode } from 'react';
2
- import { FCAny } from "../interfaces/fc.js";
1
+ import type { FC, ReactNode } from 'react';
2
+ import type { FCAny } from '../interfaces/fc.js';
3
3
  /**
4
4
  * HOC: Render component only on client side
5
5
  */
@@ -7,5 +7,5 @@ declare const renderClient: <T extends Record<string, any>>(Component: FCAny<T>
7
7
  element: ReactNode;
8
8
  } | {
9
9
  Component: FC | null;
10
- } | undefined) => FC<T>;
11
- export { renderClient as default };
10
+ }) => FC<T>;
11
+ export default renderClient;
@@ -1,2 +1,2 @@
1
- import e from"hoist-non-react-statics";import t,{useState as n,useEffect as o}from"react";const r=(r,m)=>{const l=e=>{const[l,c]=n(!1);return o((()=>{c(!0)}),[]),l&&r?t.createElement(r,{...e}):m&&"element"in m?m.element:m&&"Component"in m&&m.Component?t.createElement(m.Component,null):null};return r&&e(l,r),l};export{r as default};
1
+ import e from"hoist-non-react-statics";import t,{useState as n,useEffect as o}from"react";const r=(r,m)=>{const l=e=>{const[l,c]=n(!1);return o(()=>{c(!0)},[]),l&&r?t.createElement(r,{...e}):m&&"element"in m?m.element:m&&"Component"in m&&m.Component?t.createElement(m.Component,null):null};return r&&e(l,r),l};export{r as default};
2
2
  //# sourceMappingURL=render-client.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"render-client.js","sources":["../../src/components/render-client.tsx"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { FC, ReactNode } from 'react';\nimport React, { useEffect, useState } from 'react';\nimport type { FCAny } from '@interfaces/fc';\n\n/**\n * HOC: Render component only on client side\n */\nconst renderClient = <T extends Record<string, any>>(\n Component: FCAny<T> | null | undefined,\n Fallback?: { element: ReactNode } | { Component: FC | null },\n): FC<T> => {\n const Element: FC<T> = (props) => {\n const [shouldRender, setShouldRender] = useState(false);\n\n useEffect(() => {\n setShouldRender(true);\n }, []);\n\n if (shouldRender && Component) {\n return <Component {...props} />;\n }\n\n if (Fallback && 'element' in Fallback) {\n return Fallback.element;\n }\n\n if (Fallback && 'Component' in Fallback && Fallback.Component) {\n return <Fallback.Component />;\n }\n\n return null;\n };\n\n if (Component) {\n hoistNonReactStatics(Element, Component);\n }\n\n return Element;\n};\n\nexport default renderClient;\n"],"names":["renderClient","Component","Fallback","Element","props","shouldRender","setShouldRender","useState","useEffect","React","createElement","element","hoistNonReactStatics"],"mappings":"0FAQA,MAAMA,EAAe,CACnBC,EACAC,KAEA,MAAMC,EAAkBC,IACtB,MAAOC,EAAcC,GAAmBC,GAAS,GAMjD,OAJAC,GAAU,KACRF,GAAgB,EAAK,GACpB,IAECD,GAAgBJ,EACXQ,EAAAC,cAACT,EAAS,IAAKG,IAGpBF,GAAY,YAAaA,EACpBA,EAASS,QAGdT,GAAY,cAAeA,GAAYA,EAASD,UAC3CQ,EAAAC,cAACR,EAASD,gBAGZ,IAAI,EAOb,OAJIA,GACFW,EAAqBT,EAASF,GAGzBE,CAAO"}
1
+ {"version":3,"file":"render-client.js","sources":["../../src/components/render-client.tsx"],"sourcesContent":[null],"names":["renderClient","Component","Fallback","Element","props","shouldRender","setShouldRender","useState","useEffect","React","createElement","element","hoistNonReactStatics"],"mappings":"0FAQA,MAAMA,EAAe,CACnBC,EACAC,KAEA,MAAMC,EAAkBC,IACtB,MAAOC,EAAcC,GAAmBC,GAAS,GAMjD,OAJAC,EAAU,KACRF,GAAgB,IACf,IAECD,GAAgBJ,EACXQ,EAAAC,cAACT,EAAS,IAAKG,IAGpBF,GAAY,YAAaA,EACpBA,EAASS,QAGdT,GAAY,cAAeA,GAAYA,EAASD,UAC3CQ,EAAAC,cAACR,EAASD,gBAGZ,MAOT,OAJIA,GACFW,EAAqBT,EAASF,GAGzBE"}
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  interface IStatusGate {
3
3
  status: number;
4
4
  }
@@ -8,4 +8,4 @@ interface IStatusGate {
8
8
  * @constructor
9
9
  */
10
10
  declare const ResponseStatus: FC<IStatusGate>;
11
- export { ResponseStatus as default };
11
+ export default ResponseStatus;
@@ -1,2 +1,2 @@
1
- import{useServerContext as s}from"../context/server.js";const e=({status:e})=>{const t=s();return t.isServer&&(t.response=new Response("",{status:e})),null};export{e as default};
1
+ import{useServerContext as s}from"../context/server.js";const e=({status:e})=>{const t=s();return t.isServer&&(t.response=new Response(null,{status:e})),null};export{e as default};
2
2
  //# sourceMappingURL=response-status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"response-status.js","sources":["../../src/components/response-status.ts"],"sourcesContent":["import type { FC } from 'react';\nimport { useServerContext } from '@context/server';\n\ninterface IStatusGate {\n status: number;\n}\n\n/**\n * Change server response status\n * Example: <ResponseStatus status={400} />\n * @constructor\n */\nconst ResponseStatus: FC<IStatusGate> = ({ status }) => {\n const context = useServerContext();\n\n if (context.isServer) {\n context.response = new Response('', { status });\n }\n\n return null;\n};\n\nexport default ResponseStatus;\n"],"names":["ResponseStatus","status","context","useServerContext","isServer","response","Response"],"mappings":"wDAYA,MAAMA,EAAkC,EAAGC,aACzC,MAAMC,EAAUC,IAMhB,OAJID,EAAQE,WACVF,EAAQG,SAAW,IAAIC,SAAS,GAAI,CAAEL,YAGjC,IAAI"}
1
+ {"version":3,"file":"response-status.js","sources":["../../src/components/response-status.ts"],"sourcesContent":[null],"names":["ResponseStatus","status","context","useServerContext","isServer","response","Response"],"mappings":"wDAYA,MAAMA,EAAkC,EAAGC,aACzC,MAAMC,EAAUC,IAMhB,OAJID,EAAQE,WACVF,EAAQG,SAAW,IAAIC,SAAS,KAAM,CAAEL,YAGnC"}
@@ -1,4 +1,4 @@
1
- import { FC } from 'react';
1
+ import type { FC } from 'react';
2
2
  interface IScrollToTop {
3
3
  shouldReloadReset?: boolean;
4
4
  }
@@ -7,4 +7,4 @@ interface IScrollToTop {
7
7
  * @constructor
8
8
  */
9
9
  declare const ScrollToTop: FC<IScrollToTop>;
10
- export { ScrollToTop as default };
10
+ export default ScrollToTop;
@@ -1,2 +1,2 @@
1
- import{useRef as r,useEffect as t}from"react";import{useLocation as o}from"react-router";const e=({shouldReloadReset:e=!1})=>{const{pathname:n}=o(),a=r(n);return t((()=>{(e||a.current!==n)&&(a.current=n,window.scrollTo(0,0))}),[n]),null};export{e as default};
1
+ import{useRef as r,useEffect as t}from"react";import{useLocation as o}from"react-router";const e=({shouldReloadReset:e=!1})=>{const{pathname:n}=o(),a=r(n);return t(()=>{(e||a.current!==n)&&(a.current=n,window.scrollTo(0,0))},[n]),null};export{e as default};
2
2
  //# sourceMappingURL=scroll-to-top.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scroll-to-top.js","sources":["../../src/components/scroll-to-top.tsx"],"sourcesContent":["import type { FC } from 'react';\nimport { useEffect, useRef } from 'react';\nimport { useLocation } from 'react-router';\n\ninterface IScrollToTop {\n shouldReloadReset?: boolean;\n}\n\n/**\n * Scroll page to top on every pathname (url) change\n * @constructor\n */\nconst ScrollToTop: FC<IScrollToTop> = ({ shouldReloadReset = false }) => {\n const { pathname } = useLocation();\n const prev = useRef(pathname);\n\n useEffect(() => {\n if (!shouldReloadReset && prev.current === pathname) {\n return;\n }\n\n prev.current = pathname;\n window.scrollTo(0, 0);\n }, [pathname]);\n\n return null;\n};\n\nexport default ScrollToTop;\n"],"names":["ScrollToTop","shouldReloadReset","pathname","useLocation","prev","useRef","useEffect","current","window","scrollTo"],"mappings":"yFAYA,MAAMA,EAAgC,EAAGC,qBAAoB,MAC3D,MAAMC,SAAEA,GAAaC,IACfC,EAAOC,EAAOH,GAWpB,OATAI,GAAU,MACHL,GAAqBG,EAAKG,UAAYL,KAI3CE,EAAKG,QAAUL,EACfM,OAAOC,SAAS,EAAG,GAAE,GACpB,CAACP,IAEG,IAAI"}
1
+ {"version":3,"file":"scroll-to-top.js","sources":["../../src/components/scroll-to-top.tsx"],"sourcesContent":[null],"names":["ScrollToTop","shouldReloadReset","pathname","useLocation","prev","useRef","useEffect","current","window","scrollTo"],"mappings":"yFAYA,MAAMA,EAAgC,EAAGC,qBAAoB,MAC3D,MAAMC,SAAEA,GAAaC,IACfC,EAAOC,EAAOH,GAWpB,OATAI,EAAU,MACHL,GAAqBG,EAAKG,UAAYL,KAI3CE,EAAKG,QAAUL,EACfM,OAAOC,SAAS,EAAG,KAClB,CAACP,IAEG"}
@@ -1,7 +1,7 @@
1
- import { FC } from 'react';
2
- import { FCAny, FCC } from "../interfaces/fc.js";
1
+ import type { FC } from 'react';
2
+ import type { FCAny, FCC } from '../interfaces/fc.js';
3
3
  /**
4
4
  * HOC: Wrap component in suspense
5
5
  */
6
6
  declare const withSuspense: <T extends Record<string, any>>(Component: FCAny<T>, Suspense: FCC<Record<string, any>>) => FC<T>;
7
- export { withSuspense as default };
7
+ export default withSuspense;
@@ -1 +1 @@
1
- {"version":3,"file":"with-suspense.js","sources":["../../src/components/with-suspense.tsx"],"sourcesContent":["import hoistNonReactStatics from 'hoist-non-react-statics';\nimport type { FC } from 'react';\nimport React from 'react';\nimport type { FCAny, FCC } from '@interfaces/fc';\n\n/**\n * HOC: Wrap component in suspense\n */\nconst withSuspense = <T extends Record<string, any>>(\n Component: FCAny<T>,\n Suspense: FCC<Record<string, any>>,\n): FC<T> => {\n const Element: FC<T> = (props) => (\n <Suspense>\n <Component {...props} />\n </Suspense>\n );\n\n hoistNonReactStatics(Element, Component);\n\n return Element;\n};\n\nexport default withSuspense;\n"],"names":["withSuspense","Component","Suspense","Element","props","React","createElement","hoistNonReactStatics"],"mappings":"4DAQA,MAAMA,EAAe,CACnBC,EACAC,KAEA,MAAMC,EAAkBC,GACtBC,EAAAC,cAACJ,EAAQ,KACPG,EAAAC,cAACL,EAAS,IAAKG,KAMnB,OAFAG,EAAqBJ,EAASF,GAEvBE,CAAO"}
1
+ {"version":3,"file":"with-suspense.js","sources":["../../src/components/with-suspense.tsx"],"sourcesContent":[null],"names":["withSuspense","Component","Suspense","Element","props","React","createElement","hoistNonReactStatics"],"mappings":"4DAQA,MAAMA,EAAe,CACnBC,EACAC,KAEA,MAAMC,EAAkBC,GACtBC,EAAAC,cAACJ,EAAQ,KACPG,EAAAC,cAACL,EAAS,IAAKG,KAMnB,OAFAG,EAAqBJ,EAASF,GAEvBE"}
@@ -7,4 +7,4 @@ declare enum CliActions {
7
7
  start = "start",
8
8
  preview = "preview"
9
9
  }
10
- export { CliActions as default };
10
+ export default CliActions;
@@ -1 +1 @@
1
- {"version":3,"file":"cli-actions.js","sources":["../../src/constants/cli-actions.ts"],"sourcesContent":["enum CliActions {\n dev = 'dev',\n build = 'build',\n buildDocker = 'build-docker',\n buildAmplify = 'build-amplify',\n buildVercel = 'build-vercel',\n start = 'start',\n preview = 'preview',\n}\n\nexport default CliActions;\n"],"names":["CliActions","CliActions$1"],"mappings":"AAAA,IAAKA,GAAL,SAAKA,GACHA,EAAA,IAAA,MACAA,EAAA,MAAA,QACAA,EAAA,YAAA,eACAA,EAAA,aAAA,gBACAA,EAAA,YAAA,eACAA,EAAA,MAAA,QACAA,EAAA,QAAA,SACD,CARD,CAAKA,IAAAA,EAAU,CAAA,IAUf,IAAAC,EAAeD"}
1
+ {"version":3,"file":"cli-actions.js","sources":["../../src/constants/cli-actions.ts"],"sourcesContent":[null],"names":["CliActions","CliActions$1"],"mappings":"AAAA,IAAKA,GAAL,SAAKA,GACHA,EAAA,IAAA,MACAA,EAAA,MAAA,QACAA,EAAA,YAAA,eACAA,EAAA,aAAA,gBACAA,EAAA,YAAA,eACAA,EAAA,MAAA,QACAA,EAAA,QAAA,SACD,CARD,CAAKA,IAAAA,EAAU,CAAA,IAUf,IAAAC,EAAeD"}
@@ -1,7 +1,6 @@
1
- /// <reference types="node" />
2
- import { Server } from 'node:net';
3
- import ServerConfig from "../services/server-config.js";
4
- interface ICliContext {
1
+ import type { Server } from 'node:net';
2
+ import type ServerConfig from '../services/server-config.js';
3
+ export interface ICliContext {
5
4
  isProd?: boolean;
6
5
  server?: Server;
7
6
  config?: ServerConfig;
@@ -11,4 +10,4 @@ interface ICliContext {
11
10
  * Share CLI context
12
11
  */
13
12
  declare const cliContext: ICliContext;
14
- export { cliContext as default, ICliContext };
13
+ export default cliContext;
@@ -1 +1 @@
1
- {"version":3,"file":"cli-context.js","sources":["../../src/constants/cli-context.ts"],"sourcesContent":["import type { Server } from 'node:net';\nimport type ServerConfig from '@services/server-config';\n\nexport interface ICliContext {\n isProd?: boolean;\n server?: Server;\n config?: ServerConfig;\n reboot?: (isPrintInfo?: boolean) => Promise<void>; // reboot dev server\n}\n\n/**\n * Share CLI context\n */\nconst cliContext: ICliContext = {\n isProd: false,\n};\n\nexport default cliContext;\n"],"names":["cliContext","isProd"],"mappings":"AAaA,MAAMA,EAA0B,CAC9BC,QAAQ"}
1
+ {"version":3,"file":"cli-context.js","sources":["../../src/constants/cli-context.ts"],"sourcesContent":[null],"names":["cliContext","isProd"],"mappings":"AAaA,MAAMA,EAA0B,CAC9BC,QAAQ"}