@joystick.js/cli-canary 0.0.0-canary.162 → 0.0.0-canary.1621

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 (584) hide show
  1. package/.build/getFilesToBuild.js +1 -1
  2. package/.build/index.js +3 -3
  3. package/LICENSE.md +59 -0
  4. package/README.md +45 -4
  5. package/dist/cli.js +1 -76
  6. package/dist/commands/build/definition.js +1 -0
  7. package/dist/commands/build/index.js +1 -0
  8. package/dist/commands/create/build_package_json.js +1 -0
  9. package/dist/commands/create/definition.js +1 -0
  10. package/dist/commands/create/index.js +2 -0
  11. package/dist/commands/create/template/api/index.js +6 -0
  12. package/dist/commands/create/template/email/base.css +9 -0
  13. package/dist/commands/create/template/email/base.html +10 -0
  14. package/dist/commands/create/template/email/reset_password.js +20 -0
  15. package/dist/commands/create/template/i18n/en-US.js +14 -0
  16. package/dist/commands/create/template/index.client.js +1 -0
  17. package/dist/commands/create/template/index.css +34 -0
  18. package/dist/{functions/create/templates → commands/create/template}/index.html +2 -3
  19. package/dist/{functions/create/templates → commands/create/template}/index.server.js +6 -6
  20. package/dist/commands/create/template/public/apple-touch-icon-152x152.png +0 -0
  21. package/dist/commands/create/template/public/favicon.ico +0 -0
  22. package/dist/commands/create/template/public/joystick_logo.webp +0 -0
  23. package/dist/{functions/create/templates → commands/create/template}/public/manifest.json +4 -4
  24. package/dist/commands/create/template/public/splash-screen-1024x1024.png +0 -0
  25. package/{src/functions/create/templates → dist/commands/create/template}/ui/components/button/index.js +14 -6
  26. package/{src/functions/create/templates → dist/commands/create/template}/ui/layouts/app/index.js +2 -2
  27. package/dist/commands/create/template/ui/pages/error/index.js +50 -0
  28. package/dist/commands/create/template/ui/pages/index/index.js +121 -0
  29. package/dist/commands/help/definition.js +1 -0
  30. package/dist/commands/help/index.js +19 -0
  31. package/dist/commands/index.js +1 -0
  32. package/dist/commands/logout/definition.js +1 -0
  33. package/dist/commands/logout/index.js +3 -0
  34. package/dist/commands/push/cdn_mirrors.js +1 -0
  35. package/dist/commands/push/check_if_settings_valid.js +1 -0
  36. package/dist/commands/push/create_version.js +1 -0
  37. package/dist/commands/push/definition.js +1 -0
  38. package/dist/commands/push/get_app_domain.js +1 -0
  39. package/dist/commands/push/get_deployment.js +1 -0
  40. package/dist/commands/push/get_provision_domain.js +1 -0
  41. package/dist/commands/push/get_session_token.js +1 -0
  42. package/dist/commands/push/get_settings_file.js +1 -0
  43. package/dist/commands/push/handle_initial_deployment.js +1 -0
  44. package/dist/commands/push/handle_version_deployment.js +1 -0
  45. package/dist/commands/push/index.js +8 -0
  46. package/dist/commands/push/prompts/confirm_deployment.js +17 -0
  47. package/dist/commands/push/prompts/session_token.js +5 -0
  48. package/dist/commands/push/upload_build_to_cdn.js +1 -0
  49. package/dist/commands/push/validate_deployment.js +1 -0
  50. package/dist/commands/push/validate_push_config.js +1 -0
  51. package/dist/commands/start/definition.js +1 -0
  52. package/dist/commands/start/index.js +1 -0
  53. package/dist/commands/test/definition.js +1 -0
  54. package/dist/commands/test/index.js +1 -0
  55. package/dist/commands/update/definition.js +1 -0
  56. package/dist/commands/update/index.js +1 -0
  57. package/dist/commands/use/definition.js +1 -0
  58. package/dist/commands/use/index.js +1 -0
  59. package/dist/index.js +1 -7
  60. package/dist/lib/build/browser_path_exclusions.js +1 -0
  61. package/dist/lib/build/browser_paths.js +1 -0
  62. package/dist/lib/build/build_files.js +3 -0
  63. package/dist/lib/build/copy_paths.js +1 -0
  64. package/dist/lib/build/get_code_frame.js +1 -0
  65. package/dist/lib/build/get_file_operation.js +1 -0
  66. package/dist/lib/build/get_files_to_build.js +1 -0
  67. package/dist/lib/build/get_path_platform.js +1 -0
  68. package/dist/lib/build/get_platform_safe_path.js +1 -0
  69. package/dist/lib/build/get_tar_ignore_list.js +2 -0
  70. package/dist/lib/build/index.js +3 -0
  71. package/dist/lib/build/master_ignore_list.js +1 -0
  72. package/dist/lib/build/minify_file.js +1 -0
  73. package/dist/lib/build/node_paths.js +1 -0
  74. package/dist/lib/build/on_warn.js +10 -0
  75. package/dist/lib/build/plugins/bootstrap_component.js +33 -0
  76. package/dist/lib/build/plugins/generate_file_dependency_map.js +1 -0
  77. package/dist/lib/build/plugins/index.js +1 -0
  78. package/dist/lib/build/plugins/set_component_id.js +2 -0
  79. package/dist/lib/build/plugins/update_file_map.js +1 -0
  80. package/dist/lib/build/plugins/warn_node_environment.js +3 -0
  81. package/dist/lib/cli_log.js +13 -0
  82. package/dist/lib/color_log.js +1 -0
  83. package/dist/lib/command_exists.js +1 -0
  84. package/dist/lib/constants.js +1 -4
  85. package/dist/lib/debounce.js +1 -0
  86. package/dist/lib/decrypt_buffer.js +1 -0
  87. package/dist/lib/development_server/ava_config.js +1 -0
  88. package/dist/lib/development_server/check_if_port_occupied.js +1 -0
  89. package/dist/lib/development_server/cleanup.js +1 -0
  90. package/dist/lib/development_server/databases/download_database_binary.js +1 -0
  91. package/dist/lib/development_server/databases/mongodb/available_query_parameters.js +1 -0
  92. package/dist/lib/development_server/databases/mongodb/build_connection_string.js +1 -0
  93. package/dist/lib/development_server/databases/mongodb/build_query_parameters.js +1 -0
  94. package/dist/lib/development_server/databases/mongodb/check_connection.js +2 -0
  95. package/dist/lib/development_server/databases/mongodb/connect.js +1 -0
  96. package/dist/lib/development_server/databases/mongodb/index.js +1 -0
  97. package/dist/lib/development_server/databases/mongodb/installers/linux.js +1 -0
  98. package/dist/lib/development_server/databases/mongodb/installers/macos.js +1 -0
  99. package/dist/lib/development_server/databases/mongodb/installers/windows.js +1 -0
  100. package/dist/lib/development_server/databases/postgresql/check_connection.js +2 -0
  101. package/dist/lib/development_server/databases/postgresql/connect.js +1 -0
  102. package/dist/lib/development_server/databases/postgresql/index.js +2 -0
  103. package/dist/lib/development_server/databases/postgresql/installers/linux.js +1 -0
  104. package/dist/lib/development_server/databases/postgresql/installers/macos.js +1 -0
  105. package/dist/lib/development_server/databases/postgresql/installers/windows.js +1 -0
  106. package/dist/lib/development_server/databases/provider_map.js +1 -0
  107. package/dist/lib/development_server/get_database_process_ids.js +1 -0
  108. package/dist/lib/development_server/get_translations.js +1 -0
  109. package/dist/lib/development_server/hmr_server.js +1 -0
  110. package/dist/lib/development_server/index.js +10 -0
  111. package/dist/lib/development_server/kill_process_ids.js +1 -0
  112. package/dist/lib/development_server/run_tests.js +2 -0
  113. package/dist/lib/development_server/start_app_server.js +1 -0
  114. package/dist/lib/development_server/start_databases.js +1 -0
  115. package/dist/lib/development_server/start_hmr_server.js +1 -0
  116. package/dist/lib/development_server/watch_for_changes/browser_path_exclusions.js +1 -0
  117. package/dist/lib/development_server/watch_for_changes/browser_paths.js +1 -0
  118. package/dist/lib/development_server/watch_for_changes/get_after_run_tasks.js +1 -0
  119. package/dist/lib/development_server/watch_for_changes/get_file_codependencies.js +1 -0
  120. package/dist/lib/development_server/watch_for_changes/get_platform_safe_path.js +1 -0
  121. package/dist/lib/development_server/watch_for_changes/index.js +1 -0
  122. package/dist/lib/development_server/watch_for_changes/node_paths.js +1 -0
  123. package/dist/lib/development_server/watch_for_changes/read_file_dependency_map.js +1 -0
  124. package/dist/lib/development_server/watch_for_changes/watch_paths.js +1 -0
  125. package/dist/lib/dynamic_import.js +1 -0
  126. package/dist/lib/encrypt_buffer.js +1 -0
  127. package/dist/lib/generate_id.js +1 -0
  128. package/dist/lib/get_files_in_path.js +1 -0
  129. package/dist/lib/get_platform_safe_path.js +1 -0
  130. package/dist/lib/get_process_id_from_port.js +2 -0
  131. package/dist/lib/is_valid_json_string.js +1 -0
  132. package/dist/lib/kill_port_process.js +1 -0
  133. package/dist/lib/kill_process_id.js +1 -0
  134. package/dist/lib/load_settings.js +1 -0
  135. package/dist/lib/loader.js +2 -82
  136. package/dist/lib/log_bars.js +1 -0
  137. package/dist/lib/node_path_polyfills.js +1 -0
  138. package/dist/lib/parse_args.js +1 -0
  139. package/dist/lib/parse_options.js +1 -0
  140. package/dist/lib/path_exists.js +1 -0
  141. package/dist/lib/rainbow_road.js +1 -0
  142. package/dist/lib/replace_in_files.js +1 -0
  143. package/dist/lib/required_files.js +1 -0
  144. package/dist/lib/serialize_query_parameters.js +1 -0
  145. package/dist/lib/types.js +1 -6
  146. package/dist/lib/unique_array.js +1 -0
  147. package/increment_version.js +3 -0
  148. package/package.json +19 -38
  149. package/src/cli.js +59 -51
  150. package/src/commands/build/definition.js +58 -0
  151. package/src/commands/build/index.js +7 -0
  152. package/src/commands/create/build_package_json.js +20 -0
  153. package/src/commands/create/definition.js +35 -0
  154. package/src/commands/create/index.js +71 -0
  155. package/src/commands/create/template/api/index.js +6 -0
  156. package/src/commands/create/template/email/base.css +9 -0
  157. package/src/commands/create/template/email/base.html +10 -0
  158. package/src/commands/create/template/email/reset_password.js +20 -0
  159. package/src/commands/create/template/i18n/en-US.js +14 -0
  160. package/src/commands/create/template/index.client.js +1 -0
  161. package/src/commands/create/template/index.css +34 -0
  162. package/src/{functions/create/templates → commands/create/template}/index.html +2 -3
  163. package/src/{functions/create/templates → commands/create/template}/index.server.js +6 -6
  164. package/src/commands/create/template/public/apple-touch-icon-152x152.png +0 -0
  165. package/src/commands/create/template/public/favicon.ico +0 -0
  166. package/src/commands/create/template/public/joystick_logo.webp +0 -0
  167. package/src/{functions/create/templates → commands/create/template}/public/manifest.json +4 -4
  168. package/src/commands/create/template/public/splash-screen-1024x1024.png +0 -0
  169. package/{dist/functions/create/templates → src/commands/create/template}/ui/components/button/index.js +14 -6
  170. package/{dist/functions/create/templates → src/commands/create/template}/ui/layouts/app/index.js +2 -2
  171. package/src/commands/create/template/ui/pages/error/index.js +50 -0
  172. package/src/commands/create/template/ui/pages/index/index.js +121 -0
  173. package/src/commands/help/definition.js +12 -0
  174. package/src/commands/help/index.js +48 -0
  175. package/src/commands/index.js +23 -0
  176. package/src/commands/logout/definition.js +10 -0
  177. package/src/commands/logout/index.js +20 -0
  178. package/src/commands/push/cdn_mirrors.js +7 -0
  179. package/src/commands/push/check_if_settings_valid.js +10 -0
  180. package/src/commands/push/create_version.js +20 -0
  181. package/src/commands/push/definition.js +43 -0
  182. package/src/commands/push/get_app_domain.js +11 -0
  183. package/src/commands/push/get_deployment.js +19 -0
  184. package/src/commands/push/get_provision_domain.js +9 -0
  185. package/src/commands/push/get_session_token.js +31 -0
  186. package/src/commands/push/get_settings_file.js +47 -0
  187. package/src/commands/push/handle_initial_deployment.js +24 -0
  188. package/src/commands/push/handle_version_deployment.js +23 -0
  189. package/src/commands/push/index.js +190 -0
  190. package/src/commands/push/prompts/confirm_deployment.js +73 -0
  191. package/src/commands/push/prompts/session_token.js +11 -0
  192. package/src/commands/push/upload_build_to_cdn.js +59 -0
  193. package/src/commands/push/validate_deployment.js +19 -0
  194. package/src/commands/push/validate_push_config.js +18 -0
  195. package/src/commands/start/definition.js +58 -0
  196. package/src/commands/start/index.js +11 -0
  197. package/src/commands/test/definition.js +28 -0
  198. package/src/commands/test/index.js +12 -0
  199. package/src/commands/update/definition.js +28 -0
  200. package/src/commands/update/index.js +29 -0
  201. package/src/commands/use/definition.js +19 -0
  202. package/src/commands/use/index.js +54 -0
  203. package/src/index.js +0 -0
  204. package/src/lib/build/browser_path_exclusions.js +8 -0
  205. package/src/lib/build/browser_paths.js +11 -0
  206. package/src/lib/build/build_files.js +163 -0
  207. package/src/{functions/start/filesToCopy.js → lib/build/copy_paths.js} +7 -5
  208. package/src/lib/build/get_code_frame.js +11 -0
  209. package/src/lib/build/get_file_operation.js +25 -0
  210. package/src/lib/build/get_files_to_build.js +41 -0
  211. package/src/lib/build/get_path_platform.js +32 -0
  212. package/src/lib/build/get_platform_safe_path.js +6 -0
  213. package/src/lib/build/get_tar_ignore_list.js +41 -0
  214. package/src/lib/build/index.js +137 -0
  215. package/src/lib/build/master_ignore_list.js +14 -0
  216. package/src/lib/build/minify_file.js +15 -0
  217. package/src/lib/build/node_paths.js +19 -0
  218. package/src/lib/build/on_warn.js +70 -0
  219. package/src/lib/build/plugins/bootstrap_component.js +191 -0
  220. package/src/lib/build/plugins/generate_file_dependency_map.js +20 -0
  221. package/src/lib/build/plugins/index.js +26 -0
  222. package/src/lib/build/plugins/set_component_id.js +89 -0
  223. package/src/lib/build/plugins/update_file_map.js +98 -0
  224. package/src/lib/build/plugins/warn_node_environment.js +20 -0
  225. package/src/lib/{CLILog.js → cli_log.js} +12 -8
  226. package/src/lib/color_log.js +7 -0
  227. package/src/lib/command_exists.js +16 -0
  228. package/src/lib/constants.js +11 -1
  229. package/src/lib/debounce.js +9 -0
  230. package/src/lib/decrypt_buffer.js +12 -0
  231. package/src/lib/development_server/ava_config.js +14 -0
  232. package/src/lib/development_server/check_if_port_occupied.js +31 -0
  233. package/src/lib/development_server/cleanup.js +15 -0
  234. package/src/lib/development_server/databases/download_database_binary.js +35 -0
  235. package/src/lib/{dev/databases/mongodb/availableQueryParameters.js → development_server/databases/mongodb/available_query_parameters.js} +3 -1
  236. package/src/lib/development_server/databases/mongodb/build_connection_string.js +36 -0
  237. package/src/lib/development_server/databases/mongodb/build_query_parameters.js +17 -0
  238. package/src/lib/development_server/databases/mongodb/check_connection.js +41 -0
  239. package/src/lib/development_server/databases/mongodb/connect.js +27 -0
  240. package/src/lib/development_server/databases/mongodb/index.js +102 -0
  241. package/src/lib/development_server/databases/mongodb/installers/linux.js +107 -0
  242. package/src/lib/development_server/databases/mongodb/installers/macos.js +109 -0
  243. package/src/lib/development_server/databases/mongodb/installers/windows.js +90 -0
  244. package/src/lib/development_server/databases/postgresql/check_connection.js +56 -0
  245. package/src/lib/development_server/databases/postgresql/connect.js +33 -0
  246. package/src/lib/development_server/databases/postgresql/index.js +157 -0
  247. package/src/lib/development_server/databases/postgresql/installers/linux.js +80 -0
  248. package/src/lib/development_server/databases/postgresql/installers/macos.js +91 -0
  249. package/src/lib/development_server/databases/postgresql/installers/windows.js +83 -0
  250. package/src/lib/development_server/databases/provider_map.js +15 -0
  251. package/src/lib/development_server/get_database_process_ids.js +28 -0
  252. package/src/lib/development_server/get_translations.js +85 -0
  253. package/src/lib/development_server/hmr_server.js +94 -0
  254. package/src/lib/development_server/index.js +436 -0
  255. package/src/lib/development_server/kill_process_ids.js +8 -0
  256. package/src/lib/development_server/run_tests.js +84 -0
  257. package/src/lib/development_server/start_app_server.js +55 -0
  258. package/src/lib/development_server/start_databases.js +108 -0
  259. package/src/lib/development_server/start_hmr_server.js +36 -0
  260. package/src/lib/development_server/watch_for_changes/browser_path_exclusions.js +8 -0
  261. package/src/lib/development_server/watch_for_changes/browser_paths.js +11 -0
  262. package/src/lib/development_server/watch_for_changes/get_after_run_tasks.js +36 -0
  263. package/src/lib/development_server/watch_for_changes/get_file_codependencies.js +53 -0
  264. package/src/lib/development_server/watch_for_changes/get_platform_safe_path.js +6 -0
  265. package/src/lib/development_server/watch_for_changes/index.js +222 -0
  266. package/src/lib/development_server/watch_for_changes/node_paths.js +17 -0
  267. package/src/lib/development_server/watch_for_changes/read_file_dependency_map.js +18 -0
  268. package/src/lib/development_server/watch_for_changes/watch_paths.js +22 -0
  269. package/src/lib/dynamic_import.js +6 -0
  270. package/src/lib/encrypt_buffer.js +10 -0
  271. package/src/lib/generate_id.js +15 -0
  272. package/src/lib/get_files_in_path.js +25 -0
  273. package/src/lib/get_platform_safe_path.js +8 -0
  274. package/src/lib/get_process_id_from_port.js +26 -0
  275. package/src/lib/is_valid_json_string.js +10 -0
  276. package/src/lib/kill_port_process.js +12 -0
  277. package/src/lib/kill_process_id.js +19 -0
  278. package/src/lib/load_settings.js +43 -0
  279. package/src/lib/loader.js +4 -77
  280. package/src/lib/log_bars.js +7 -0
  281. package/src/lib/node_path_polyfills.js +23 -0
  282. package/src/lib/parse_args.js +16 -0
  283. package/src/lib/parse_options.js +16 -0
  284. package/src/lib/path_exists.js +11 -0
  285. package/src/lib/{rainbowRoad.js → rainbow_road.js} +4 -2
  286. package/src/lib/replace_in_files.js +40 -0
  287. package/src/lib/{dev/requiredFiles.js → required_files.js} +3 -1
  288. package/src/lib/serialize_query_parameters.js +7 -0
  289. package/src/lib/types.js +59 -2
  290. package/src/lib/unique_array.js +24 -0
  291. package/HMRNOTES.txt +0 -23
  292. package/_package.json +0 -56
  293. package/canary.js +0 -12
  294. package/dist/functions/build/getTarIgnoreList.js +0 -25
  295. package/dist/functions/build/index.js +0 -54
  296. package/dist/functions/create/buildPackageJSON.js +0 -20
  297. package/dist/functions/create/index.js +0 -193
  298. package/dist/functions/create/templates/api/index.js +0 -4
  299. package/dist/functions/create/templates/i18n/en-US.js +0 -4
  300. package/dist/functions/create/templates/index.client.js +0 -7
  301. package/dist/functions/create/templates/index.css +0 -20
  302. package/dist/functions/create/templates/public/apple-touch-icon-152x152.png +0 -0
  303. package/dist/functions/create/templates/public/favicon.ico +0 -0
  304. package/dist/functions/create/templates/public/splash-screen-1024x1024.png +0 -0
  305. package/dist/functions/create/templates/ui/pages/error/index.js +0 -31
  306. package/dist/functions/create/templates/ui/pages/index/index.js +0 -94
  307. package/dist/functions/index.js +0 -269
  308. package/dist/functions/logout/index.js +0 -20
  309. package/dist/functions/push/checkIfProvisionAvailable.js +0 -19
  310. package/dist/functions/push/deploy/index.js +0 -173
  311. package/dist/functions/push/deploy/initial.js +0 -100
  312. package/dist/functions/push/deploy/version.js +0 -100
  313. package/dist/functions/push/domains.js +0 -23
  314. package/dist/functions/push/getAvailableCDN.js +0 -23
  315. package/dist/functions/push/getDeployment.js +0 -41
  316. package/dist/functions/push/getDeploymentSummary.js +0 -38
  317. package/dist/functions/push/getInstanceSizeRegions.js +0 -37
  318. package/dist/functions/push/getInstanceSizesForRegion.js +0 -34
  319. package/dist/functions/push/getProviderInstanceSizes.js +0 -34
  320. package/dist/functions/push/getProviderRegions.js +0 -36
  321. package/dist/functions/push/getProvidersWithConnectionStatus.js +0 -20
  322. package/dist/functions/push/getSessionToken.js +0 -23
  323. package/dist/functions/push/getUserFromSessionToken.js +0 -37
  324. package/dist/functions/push/index.js +0 -210
  325. package/dist/functions/push/loginToCheatCode.js +0 -33
  326. package/dist/functions/push/pingProvisionAPI.js +0 -31
  327. package/dist/functions/push/prompts.js +0 -332
  328. package/dist/functions/push/providerMap.js +0 -11
  329. package/dist/functions/push/providers.js +0 -9
  330. package/dist/functions/reset/index.js +0 -0
  331. package/dist/functions/reset/reset.js +0 -127
  332. package/dist/functions/start/bootstrapLayoutComponent.js +0 -54
  333. package/dist/functions/start/bootstrapPageComponent.js +0 -51
  334. package/dist/functions/start/buildFile.js +0 -85
  335. package/dist/functions/start/buildFiles.js +0 -76
  336. package/dist/functions/start/buildPlugins.js +0 -183
  337. package/dist/functions/start/checkIfPortAvailable.js +0 -18
  338. package/dist/functions/start/cleanup/index.js +0 -18
  339. package/dist/functions/start/databases/mongodb/availableQueryParameters.js +0 -42
  340. package/dist/functions/start/databases/mongodb/buildConnectionString.js +0 -22
  341. package/dist/functions/start/databases/mongodb/buildQueryParameters.js +0 -14
  342. package/dist/functions/start/databases/mongodb/checkConnection.js +0 -35
  343. package/dist/functions/start/databases/mongodb/connect.js +0 -25
  344. package/dist/functions/start/databases/mongodb/index.js +0 -93
  345. package/dist/functions/start/databases/postgresql/checkConnection.js +0 -41
  346. package/dist/functions/start/databases/postgresql/connect.js +0 -27
  347. package/dist/functions/start/databases/postgresql/index.js +0 -106
  348. package/dist/functions/start/databases/redis.js +0 -0
  349. package/dist/functions/start/databases/startProvider.js +0 -16
  350. package/dist/functions/start/fileDependencyMapper.js +0 -22
  351. package/dist/functions/start/filesToCopy.js +0 -18
  352. package/dist/functions/start/generateId.js +0 -74
  353. package/dist/functions/start/getCodependenciesForFile.js +0 -64
  354. package/dist/functions/start/getFilesToBuild.js +0 -39
  355. package/dist/functions/start/getProcessIdFromPort.js +0 -60
  356. package/dist/functions/start/hmrServer.js +0 -66
  357. package/dist/functions/start/index.js +0 -11
  358. package/dist/functions/start/isWindows.js +0 -5
  359. package/dist/functions/start/minifyFile.js +0 -12
  360. package/dist/functions/start/onWarn.js +0 -63
  361. package/dist/functions/start/readFileDependencyMap.js +0 -16
  362. package/dist/functions/start/removeDeletedDependenciesFromMap.js +0 -18
  363. package/dist/functions/start/setComponentId.js +0 -46
  364. package/dist/functions/start/updateFileMap.js +0 -67
  365. package/dist/functions/test/index.js +0 -12
  366. package/dist/functions/update/index.js +0 -21
  367. package/dist/functions/use/index.js +0 -61
  368. package/dist/lib/CLILog.js +0 -49
  369. package/dist/lib/build/browserPathExclusions.js +0 -8
  370. package/dist/lib/build/browserPaths.js +0 -11
  371. package/dist/lib/build/buildFile.js +0 -84
  372. package/dist/lib/build/buildFiles.js +0 -240
  373. package/dist/lib/build/buildPlugins.js +0 -186
  374. package/dist/lib/build/getCodeFrame.js +0 -9
  375. package/dist/lib/build/minifyFile.js +0 -12
  376. package/dist/lib/build/nodePathExclusions.js +0 -7
  377. package/dist/lib/build/nodePaths.js +0 -12
  378. package/dist/lib/build/onWarn.js +0 -63
  379. package/dist/lib/build/removeDeletedDependenciesFromMap.js +0 -18
  380. package/dist/lib/build/setComponentId.js +0 -46
  381. package/dist/lib/build/updateFileMap.js +0 -67
  382. package/dist/lib/buildResolvePlugin.js +0 -21
  383. package/dist/lib/checkIfValidJSON.js +0 -11
  384. package/dist/lib/colorLog.js +0 -7
  385. package/dist/lib/dev/cleanup.js +0 -18
  386. package/dist/lib/dev/databases/mongodb/availableQueryParameters.js +0 -42
  387. package/dist/lib/dev/databases/mongodb/buildConnectionString.js +0 -22
  388. package/dist/lib/dev/databases/mongodb/buildQueryParameters.js +0 -14
  389. package/dist/lib/dev/databases/mongodb/checkConnection.js +0 -38
  390. package/dist/lib/dev/databases/mongodb/connect.js +0 -25
  391. package/dist/lib/dev/databases/mongodb/index.js +0 -93
  392. package/dist/lib/dev/databases/postgresql/checkConnection.js +0 -41
  393. package/dist/lib/dev/databases/postgresql/connect.js +0 -27
  394. package/dist/lib/dev/databases/postgresql/index.js +0 -106
  395. package/dist/lib/dev/databases/providerMap.js +0 -15
  396. package/dist/lib/dev/getCodependenciesForFile.js +0 -64
  397. package/dist/lib/dev/getFilesToBuild.js +0 -38
  398. package/dist/lib/dev/hmrServer.js +0 -66
  399. package/dist/lib/dev/index.js +0 -559
  400. package/dist/lib/dev/isWindows.js +0 -5
  401. package/dist/lib/dev/loadSettings.js +0 -79
  402. package/dist/lib/dev/readFileDependencyMap.js +0 -16
  403. package/dist/lib/dev/requiredFiles.js +0 -18
  404. package/dist/lib/dev/runBuild.js +0 -30
  405. package/dist/lib/dev/runTests.js +0 -96
  406. package/dist/lib/dev/startApp.js +0 -70
  407. package/dist/lib/dev/startDatabases.js +0 -109
  408. package/dist/lib/dev/startHMR.js +0 -55
  409. package/dist/lib/dev/tests.config.js +0 -6
  410. package/dist/lib/dev/updateFileMap.js +0 -67
  411. package/dist/lib/dev/validateProject.js +0 -0
  412. package/dist/lib/dev/watchlist.js +0 -15
  413. package/dist/lib/filesToCopy.js +0 -18
  414. package/dist/lib/generateId.js +0 -74
  415. package/dist/lib/getArgs.js +0 -14
  416. package/dist/lib/getOptions.js +0 -15
  417. package/dist/lib/getPlatformSafePath.js +0 -7
  418. package/dist/lib/getProcessIdFromPort.js +0 -60
  419. package/dist/lib/getProvider.js +0 -8
  420. package/dist/lib/help.js +0 -56
  421. package/dist/lib/isObject.js +0 -6
  422. package/dist/lib/isValidJSONString.js +0 -11
  423. package/dist/lib/isWindows.js +0 -5
  424. package/dist/lib/killProcesses.js +0 -0
  425. package/dist/lib/loadSettings.js +0 -33
  426. package/dist/lib/masterIgnoreList.js +0 -16
  427. package/dist/lib/nodeEnvironment.js +0 -9
  428. package/dist/lib/nodeEnvironments.js +0 -8
  429. package/dist/lib/parseCookiesFromLogin.js +0 -18
  430. package/dist/lib/rainbowRoad.js +0 -7
  431. package/dist/lib/readDirectorySync.js +0 -14
  432. package/dist/lib/regexes.js +0 -14
  433. package/dist/lib/replaceBackslashesWithForwardSlashes.js +0 -8
  434. package/dist/lib/replaceFileProtocol.js +0 -8
  435. package/dist/lib/serializeQueryParameters.js +0 -8
  436. package/dist/lib/settings.js +0 -4
  437. package/dist/lib/validateDatabasesFromSettings.js +0 -34
  438. package/dist/lib/wait.js +0 -8
  439. package/release.js +0 -40
  440. package/src/functions/build/getTarIgnoreList.js +0 -30
  441. package/src/functions/build/index.js +0 -63
  442. package/src/functions/create/buildPackageJSON.js +0 -18
  443. package/src/functions/create/index.js +0 -209
  444. package/src/functions/create/templates/api/index.js +0 -4
  445. package/src/functions/create/templates/i18n/en-US.js +0 -4
  446. package/src/functions/create/templates/index.client.js +0 -7
  447. package/src/functions/create/templates/index.css +0 -20
  448. package/src/functions/create/templates/public/apple-touch-icon-152x152.png +0 -0
  449. package/src/functions/create/templates/public/favicon.ico +0 -0
  450. package/src/functions/create/templates/public/splash-screen-1024x1024.png +0 -0
  451. package/src/functions/create/templates/ui/pages/error/index.js +0 -31
  452. package/src/functions/create/templates/ui/pages/index/index.js +0 -94
  453. package/src/functions/index.js +0 -269
  454. package/src/functions/logout/index.js +0 -20
  455. package/src/functions/push/checkIfProvisionAvailable.js +0 -20
  456. package/src/functions/push/deploy/index.js +0 -199
  457. package/src/functions/push/deploy/initial.js +0 -108
  458. package/src/functions/push/deploy/version.js +0 -108
  459. package/src/functions/push/domains.js +0 -23
  460. package/src/functions/push/getAvailableCDN.js +0 -27
  461. package/src/functions/push/getDeployment.js +0 -43
  462. package/src/functions/push/getDeploymentSummary.js +0 -39
  463. package/src/functions/push/getInstanceSizeRegions.js +0 -40
  464. package/src/functions/push/getInstanceSizesForRegion.js +0 -35
  465. package/src/functions/push/getProviderInstanceSizes.js +0 -35
  466. package/src/functions/push/getProviderRegions.js +0 -39
  467. package/src/functions/push/getProvidersWithConnectionStatus.js +0 -25
  468. package/src/functions/push/getSessionToken.js +0 -26
  469. package/src/functions/push/getUserFromSessionToken.js +0 -39
  470. package/src/functions/push/index.js +0 -245
  471. package/src/functions/push/loginToCheatCode.js +0 -34
  472. package/src/functions/push/pingProvisionAPI.js +0 -33
  473. package/src/functions/push/prompts.js +0 -276
  474. package/src/functions/push/providerMap.js +0 -8
  475. package/src/functions/push/providers.js +0 -6
  476. package/src/functions/reset/index.js +0 -0
  477. package/src/functions/reset/reset.js +0 -163
  478. package/src/functions/start/bootstrapLayoutComponent.js +0 -57
  479. package/src/functions/start/bootstrapPageComponent.js +0 -54
  480. package/src/functions/start/buildFile.js +0 -97
  481. package/src/functions/start/buildFiles.js +0 -101
  482. package/src/functions/start/buildPlugins.js +0 -215
  483. package/src/functions/start/checkIfPortAvailable.js +0 -21
  484. package/src/functions/start/cleanup/index.js +0 -23
  485. package/src/functions/start/databases/mongodb/availableQueryParameters.js +0 -39
  486. package/src/functions/start/databases/mongodb/buildConnectionString.js +0 -28
  487. package/src/functions/start/databases/mongodb/buildQueryParameters.js +0 -15
  488. package/src/functions/start/databases/mongodb/checkConnection.js +0 -36
  489. package/src/functions/start/databases/mongodb/connect.js +0 -25
  490. package/src/functions/start/databases/mongodb/index.js +0 -108
  491. package/src/functions/start/databases/postgresql/checkConnection.js +0 -43
  492. package/src/functions/start/databases/postgresql/connect.js +0 -27
  493. package/src/functions/start/databases/postgresql/index.js +0 -127
  494. package/src/functions/start/databases/redis.js +0 -0
  495. package/src/functions/start/databases/startProvider.js +0 -15
  496. package/src/functions/start/fileDependencyMapper.js +0 -24
  497. package/src/functions/start/generateId.js +0 -73
  498. package/src/functions/start/getCodependenciesForFile.js +0 -84
  499. package/src/functions/start/getFilesToBuild.js +0 -49
  500. package/src/functions/start/getProcessIdFromPort.js +0 -92
  501. package/src/functions/start/hmrServer.js +0 -78
  502. package/src/functions/start/index.js +0 -9
  503. package/src/functions/start/isWindows.js +0 -3
  504. package/src/functions/start/minifyFile.js +0 -10
  505. package/src/functions/start/onWarn.js +0 -68
  506. package/src/functions/start/readFileDependencyMap.js +0 -19
  507. package/src/functions/start/removeDeletedDependenciesFromMap.js +0 -19
  508. package/src/functions/start/setComponentId.js +0 -58
  509. package/src/functions/start/updateFileMap.js +0 -100
  510. package/src/functions/test/index.js +0 -10
  511. package/src/functions/update/index.js +0 -20
  512. package/src/functions/use/index.js +0 -62
  513. package/src/lib/build/browserPathExclusions.js +0 -6
  514. package/src/lib/build/browserPaths.js +0 -9
  515. package/src/lib/build/buildFile.js +0 -91
  516. package/src/lib/build/buildFiles.js +0 -273
  517. package/src/lib/build/buildPlugins.js +0 -222
  518. package/src/lib/build/getCodeFrame.js +0 -7
  519. package/src/lib/build/minifyFile.js +0 -10
  520. package/src/lib/build/nodePathExclusions.js +0 -5
  521. package/src/lib/build/nodePaths.js +0 -10
  522. package/src/lib/build/onWarn.js +0 -68
  523. package/src/lib/build/removeDeletedDependenciesFromMap.js +0 -19
  524. package/src/lib/build/setComponentId.js +0 -58
  525. package/src/lib/build/updateFileMap.js +0 -100
  526. package/src/lib/buildResolvePlugin.js +0 -32
  527. package/src/lib/checkIfValidJSON.js +0 -8
  528. package/src/lib/colorLog.js +0 -5
  529. package/src/lib/dev/cleanup.js +0 -26
  530. package/src/lib/dev/databases/mongodb/buildConnectionString.js +0 -28
  531. package/src/lib/dev/databases/mongodb/buildQueryParameters.js +0 -15
  532. package/src/lib/dev/databases/mongodb/checkConnection.js +0 -40
  533. package/src/lib/dev/databases/mongodb/connect.js +0 -25
  534. package/src/lib/dev/databases/mongodb/index.js +0 -108
  535. package/src/lib/dev/databases/postgresql/checkConnection.js +0 -43
  536. package/src/lib/dev/databases/postgresql/connect.js +0 -27
  537. package/src/lib/dev/databases/postgresql/index.js +0 -127
  538. package/src/lib/dev/databases/providerMap.js +0 -13
  539. package/src/lib/dev/getCodependenciesForFile.js +0 -84
  540. package/src/lib/dev/getFilesToBuild.js +0 -47
  541. package/src/lib/dev/hmrServer.js +0 -78
  542. package/src/lib/dev/index.js +0 -684
  543. package/src/lib/dev/isWindows.js +0 -3
  544. package/src/lib/dev/loadSettings.js +0 -90
  545. package/src/lib/dev/readFileDependencyMap.js +0 -19
  546. package/src/lib/dev/runBuild.js +0 -33
  547. package/src/lib/dev/runTests.js +0 -122
  548. package/src/lib/dev/startApp.js +0 -79
  549. package/src/lib/dev/startDatabases.js +0 -131
  550. package/src/lib/dev/startHMR.js +0 -62
  551. package/src/lib/dev/tests.config.js +0 -3
  552. package/src/lib/dev/updateFileMap.js +0 -100
  553. package/src/lib/dev/validateProject.js +0 -0
  554. package/src/lib/dev/watchlist.js +0 -13
  555. package/src/lib/filesToCopy.js +0 -15
  556. package/src/lib/generateId.js +0 -73
  557. package/src/lib/getArgs.js +0 -14
  558. package/src/lib/getOptions.js +0 -12
  559. package/src/lib/getProcessIdFromPort.js +0 -92
  560. package/src/lib/getProvider.js +0 -5
  561. package/src/lib/help.js +0 -56
  562. package/src/lib/isObject.js +0 -3
  563. package/src/lib/isValidJSONString.js +0 -8
  564. package/src/lib/killProcesses.js +0 -5
  565. package/src/lib/loadSettings.js +0 -40
  566. package/src/lib/masterIgnoreList.js +0 -13
  567. package/src/lib/nodeEnvironment.js +0 -6
  568. package/src/lib/nodeEnvironments.js +0 -8
  569. package/src/lib/parseCookiesFromLogin.js +0 -21
  570. package/src/lib/readDirectorySync.js +0 -13
  571. package/src/lib/regexes.js +0 -7
  572. package/src/lib/replaceBackslashesWithForwardSlashes.js +0 -8
  573. package/src/lib/replaceFileProtocol.js +0 -8
  574. package/src/lib/serializeQueryParameters.js +0 -5
  575. package/src/lib/settings.js +0 -1
  576. package/src/lib/validateDatabasesFromSettings.js +0 -37
  577. package/src/lib/wait.js +0 -5
  578. package/storage/.verdaccio-db.json +0 -1
  579. /package/{src/lib → .build}/getPlatformSafePath.js +0 -0
  580. /package/{src/lib → .build}/isWindows.js +0 -0
  581. /package/dist/{functions/create/templates → commands/create/template}/public/service-worker.js +0 -0
  582. /package/dist/{functions/create/templates → commands/create/template}/settings.development.json +0 -0
  583. /package/src/{functions/create/templates → commands/create/template}/public/service-worker.js +0 -0
  584. /package/src/{functions/create/templates → commands/create/template}/settings.development.json +0 -0
@@ -0,0 +1 @@
1
+ import e from"fs";import t from"path";import h from"os";import{promisify as d}from"util";import{pipeline as b}from"stream";import{execFile as y}from"child_process";const g=d(b),j=d(y),k=async(o=null)=>{const i=t.join(h.homedir(),".joystick","databases","postgresql"),s=t.join(i,"bin"),n=t.join(s,"bin");if(await q(i))return;await v(i,s,n);const p="https://get.enterprisedb.com/postgresql/postgresql-16.0-1-osx-binaries.zip",f=t.basename(new URL(p).pathname),c=t.join(i,f);process.loader.print("PostgreSQL not found. Downloading... (this may take a few minutes)"),await x(p,c),process.loader.print("Installing PostgreSQL...");const r=t.join(i,"temp");await e.promises.mkdir(r,{recursive:!0}),await j("unzip",["-q",c,"-d",r]);const m=t.join(r,"pgsql","bin"),w=await e.promises.readdir(m);for(const a of w)await e.promises.rename(t.join(m,a),t.join(n,a));const u=["share","lib","include"];for(const a of u){const l=t.join(r,"pgsql",a),_=t.join(s,a);await e.promises.access(l).then(()=>!0).catch(()=>!1)&&await e.promises.rename(l,_)}await e.promises.unlink(c),await e.promises.rm(r,{recursive:!0,force:!0}),await L(n),process.loader.print("PostgreSQL installed!")},x=async(o,i)=>{const s=await fetch(o);if(!s.ok)throw new Error(`Failed to download: ${s.statusText}`);await g(s.body,e.createWriteStream(i))},q=async o=>{try{return await e.promises.access(o),!0}catch{return!1}},v=async(o,i,s)=>{await e.promises.mkdir(o,{recursive:!0}),await e.promises.mkdir(i,{recursive:!0}),await e.promises.mkdir(s,{recursive:!0})},L=async o=>{const i=await e.promises.readdir(o);for(const s of i)await e.promises.chmod(t.join(o,s),"755")};var D=k;export{D as default};
@@ -0,0 +1 @@
1
+ import e from"fs";import t from"path";import h from"os";import{promisify as d}from"util";import{pipeline as b}from"stream";import{execFile as y}from"child_process";const g=d(b),j=d(y),k=async(s=null)=>{const i=t.join(h.homedir(),".joystick","databases","postgresql"),r=t.join(i,"bin"),c=t.join(r,"bin");if(await x(i))return;await q(i,r,c);const p="https://get.enterprisedb.com/postgresql/postgresql-16.0-1-windows-x64-binaries.zip",w=t.basename(new URL(p).pathname),n=t.join(i,w);process.loader.print("PostgreSQL not found. Downloading... (this may take a few minutes)"),await v(p,n),process.loader.print("Installing PostgreSQL...");const o=t.join(i,"temp");await e.promises.mkdir(o,{recursive:!0}),await j("powershell",["Expand-Archive","-Path",n,"-DestinationPath",o]);const m=t.join(o,"pgsql","bin"),f=await e.promises.readdir(m);for(const a of f)await e.promises.rename(t.join(m,a),t.join(c,a));const u=["share","lib","include"];for(const a of u){const l=t.join(o,"pgsql",a),_=t.join(r,a);await e.promises.access(l).then(()=>!0).catch(()=>!1)&&await e.promises.rename(l,_)}await e.promises.unlink(n),await e.promises.rm(o,{recursive:!0,force:!0}),process.loader.print("PostgreSQL installed!")},v=async(s,i)=>{const r=await fetch(s);if(!r.ok)throw new Error(`Failed to download: ${r.statusText}`);await g(r.body,e.createWriteStream(i))},x=async s=>{try{return await e.promises.access(s),!0}catch{return!1}},q=async(s,i,r)=>{await e.promises.mkdir(s,{recursive:!0}),await e.promises.mkdir(i,{recursive:!0}),await e.promises.mkdir(r,{recursive:!0})};var D=k;export{D as default};
@@ -0,0 +1 @@
1
+ import o from"./mongodb/connect.js";import n from"./postgresql/connect.js";const e={mongodb:{name:"MongoDB",connect:o},postgresql:{name:"PostgreSQL",connect:n}};var c=e;export{c as default};
@@ -0,0 +1 @@
1
+ const r=()=>{const t=[],o=Object.entries(process._databases||{});for(let s=0;s<o?.length;s+=1){const[d,e]=o[s];if(e?.pid&&t.push(e.pid),!e?.pid){const c=Object.entries(e);for(let n=0;n<c?.length;n+=1){const[p,i]=c[n];i?.pid&&t.push(i.pid)}}}return t};var a=r;export{a as default};
@@ -0,0 +1 @@
1
+ import g from"fs";import p from"../load_settings.js";import _ from"../types.js";import u from"../dynamic_import.js";const m=await p(process.env.NODE_ENV),h=async(n="",a="",t="")=>{const r=await u(`${process.cwd()}/${a}/i18n/${n}?v=${new Date().getTime()}`);if(r&&_.is_object(r)){const s=r[t];return s||r}return{}},d=(n="",a=[])=>{let t=[];n&&t.push(n);const r=a?.filter(e=>!e?.includes("*"));return t.push(...r),t.push(m?.config?.i18n?.defaultLanguage),t?.flatMap(e=>{const s=[e];return e?.length===2&&s.push(`${e.substring(0,2)}-`),e?.length>2&&(s.push(`${e?.split("-")[0]}`),s.push(`${e?.split("-")[0]}-`)),s})?.map(e=>e[e?.length-1]==="-"?new RegExp(`^${e}[A-Z]+.js`,"g"):new RegExp(`^${e}.js`,"g"))},w=(n="")=>n.split(",")?.map(t=>t.split(";")[0]),$=async(n="",a="",t={})=>{const r=g.readdirSync(`${n}/i18n`),e=w(t?.headers["accept-language"]),s=d(t?.context?.user?.language,e);let o=null;for(let i=0;i<s.length;i+=1){const c=s[i],l=r.find(f=>!!f.match(c));if(l){o=l;break}}return await h(o,n,a)};var j=$;export{j as default};
@@ -0,0 +1 @@
1
+ import p from"query-string";import{WebSocketServer as i}from"ws";import g from"../generate_id.js";import N from"./get_translations.js";process.title="joystick_hmr";var u=(()=>{const a=new i({port:parseInt(process.env.PORT,10)+1,path:"/_joystick/hmr"});process.on("message",async c=>{const e=JSON.parse(c);if(typeof process.HMR_CONNECTIONS=="object"&&e?.type){const t=Object.values(process.HMR_CONNECTIONS);for(let n=0;n<t?.length;n+=1){const s=t[n];s?.connection?.send&&(e?.type==="BUILD_ERROR"&&s.connection.send(JSON.stringify({type:"BUILD_ERROR"})),e?.type==="FILE_CHANGE"&&s.connection.send(JSON.stringify({type:"FILE_CHANGE",settings:e?.settings?{global:e?.settings?.global,public:e?.settings?.public}:null,i18n:e?.i18n_change?await N(".joystick/build",s?.page_component_path,{headers:{"accept-language":s?.browser_language},context:{user:{language:s?.user_language}}}):null,index_html_changed:e?.index_html_change,index_css_changed:e?.index_css_change,index_client_changed:e?.index_client_change})))}}}),a.on("connection",function(e,t={}){const n=g(16),[s,r]=t?.url?.split("?"),o=p.parse(r);process.HMR_CONNECTIONS={...process.HMR_CONNECTIONS||{},[n]:{connection:e,browser_language:o?.browser_language,user_language:o?.user_language,page_component_path:o?.page_component_path}},Object.keys(process.HMR_CONNECTIONS||{})?.length>0&&process.send({type:"HAS_HMR_CONNECTIONS"}),e.on("message",_=>{JSON.parse(_)?.type==="HMR_UPDATE_COMPLETE"&&process.send({type:"HMR_UPDATE_COMPLETE"})}),e.on("close",()=>{process.HMR_CONNECTIONS[n]&&(delete process.HMR_CONNECTIONS[n],Object.keys(process.HMR_CONNECTIONS||{})?.length===0&&process.send({type:"HAS_NO_HMR_CONNECTIONS"}))})})})();export{u as default};
@@ -0,0 +1,10 @@
1
+ import i from"chalk";import m from"child_process";import x from"fs";import"os";import g,{dirname as O}from"path";import{fileURLToPath as b}from"url";import k from"util";import u from"./check_if_port_occupied.js";import n from"../cli_log.js";import p from"./get_database_process_ids.js";import S from"../get_platform_safe_path.js";import y from"../kill_port_process.js";import h from"../load_settings.js";import $ from"../loader.js";import _ from"../path_exists.js";import v from"../required_files.js";import j from"./start_app_server.js";import D from"./start_databases.js";import T from"./start_hmr_server.js";import R from"./watch_for_changes/index.js";import I from"../constants.js";import N from"./kill_process_ids.js";import H from"./run_tests.js";import C from"../debounce.js";import M from"./databases/download_database_binary.js";const{stat:A}=x.promises,P=k.promisify(m.exec),d=parseInt(process?.version?.split(".")[0]?.replace("v",""),10),V=b(import.meta.url),f=O(V),l=[],q=async(s=!1)=>{const e=p();await H({watch:s,__dirname:f,process_ids:[...l,...e],cleanup_process:process.cleanup_process})},L=(s=[],e=0,t="")=>{const r=["--no-warnings"];e<19&&r.push("--experimental-specifier-resolution=node");const o=m.fork(g.resolve(`${t}/cleanup.js`),[],{detached:!0,silent:!0});process.cleanup_process=o,process.on("SIGINT",async()=>{const c=p();o.send(JSON.stringify({process_ids:[...s,...c]})),process.exit()}),process.on("SIGTERM",async()=>{const c=p();o.send(JSON.stringify({process_ids:[...s,...c]})),process.exit()})},G=async(s=[])=>{const e=s?.find(a=>a?.path?.match(I.SETTINGS_FILE_NAME_REGEX)?.length>0),t=s?.find(a=>a?.path?.includes("i18n")),r=s?.find(a=>a?.path?.includes("index.html")),o=s?.find(a=>a?.path?.includes("index.css")||a?.path?.includes("css/")),c=s?.find(a=>a?.path?.includes("index.client.js"));process.hmr_server_process.send(JSON.stringify({type:"FILE_CHANGE",settings:e?await h(process.env.NODE_ENV):null,i18n_change:!!t,index_html_change:!!r,index_css_change:!!o,index_client_change:!!c}))},J=(s=0,e=!1,t={})=>{process.hmr_server_process.on("message",async r=>{["HAS_HMR_CONNECTIONS","HAS_NO_HMR_CONNECTIONS","HMR_UPDATE_COMPLETE"].includes(r?.type)||process.loader.print(r),r?.type==="HAS_HMR_CONNECTIONS"&&(process.hmr_server_process.has_connections=!0),r?.type==="HAS_NO_HMR_CONNECTIONS"&&(process.hmr_server_process.has_connections=!1),r?.type==="HMR_UPDATE_COMPLETE"&&process.app_server_process&&!process.app_server_restarting&&(process.app_server_restarting=!0,w(s,e,t))})},U=()=>{process.hmr_server_process.on("error",s=>{n(s.toString(),{level:"danger",docs:"https://github.com/cheatcode/joystick"})}),process.hmr_server_process.stdout.on("data",s=>{console.log(s.toString())}),process.hmr_server_process.stderr.on("data",s=>{n(s.toString(),{level:"danger",docs:"https://github.com/cheatcode/joystick"})})},F=(s=0,e="",t=!1,r={})=>{process.hmr_server_process=T(s,e),l.push(process.hmr_server_process?.pid),U(),J(s,t,r)},B=async(s={})=>{const e=await h(process.env.NODE_ENV),t=e?.config?.databases?JSON.stringify(e?.config?.databases):"",r=s?.config?.databases?JSON.stringify(s?.config?.databases):"";return t!==r},w=async(s=0,e=!1,t=null)=>{C(async()=>{if(await B(t)){const o=p();n(`Database configuration has changed in settings.${process.env.NODE_ENV}.json. Please restart your app to add, change, or remove databases.`,{level:"danger",docs:"https://cheatcode.co/docs/joystick/structure"}),N([process.hmr_server_process?.pid,process.app_server_process?.pid,...o]),process.exit(0)}else N([...process.app_server_process.external_process_ids||[]]),await y(process.env.PORT),E(s,e)},300)},z=(s=!1)=>{process.app_server_process.external_process_ids=[],process.app_server_process.on("message",e=>{e?.external_process_id&&(process.app_server_process.external_process_ids=[...process.app_server_process.external_process_ids||[],e?.external_process_id])}),process.app_server_process.on("error",e=>{n(e.toString(),{level:"danger",docs:"https://github.com/cheatcode/joystick"})}),process.app_server_process.stdout.on("data",e=>{const t=e.toString(),r=t.includes("App running at:");t&&r&&process.env.NODE_ENV!=="test"&&process.loader.print(t),t&&!r&&!t.includes("BUILD_ERROR")&&console.log(t),t&&r&&process.env.NODE_ENV==="test"&&q(s)}),process.app_server_process.stderr.on("data",e=>{n(e.toString(),{level:"danger",docs:"https://cheatcode.co/docs/joystick"})})},E=(s=0,e=!1)=>{process.app_server_process=j(s,e),l.push(process.app_server_process?.pid),z(e),process.app_server_restarting=!1},X=async(s={})=>{const e=s?.config?.databases?.map((t={})=>t?.provider);for(let t=0;t<e?.length;t+=1){const r=e[t];await M(r)}},K=(s={},e=2600)=>{process.title=s?.environment==="test"?"joystick_test":"joystick",process.project_folder=g.basename(process.cwd()),process.loader=new $,s?.environment==="test"&&process.loader.print("Initializing test environment..."),process.env.LOGS_PATH=s?.logs||null,process.env.NODE_ENV=s?.environment||"development",process.env.PORT=e,process.env.IS_DEBUG_MODE=s?.debug},Q=(s=2600)=>{n(`Port ${s} is already occupied. To start Joystick on this port, clear it and try again.`,{level:"danger"}),process.exit(0)},W=(s=2600)=>parseInt(s||2600,10),Y=async()=>{const s=S(`${process.cwd()}/.joystick/build`);await _(s)&&await P(`${process.platform==="win32"?"rmdir /s /q":"rm -rf"} ${s}`)},Z=async()=>{const s=[];for(let e=0;e<v?.length;e+=1){const t=v[e],r=await _(`${process.cwd()}/${t.path}`),o=r&&await A(`${process.cwd()}/${t.path}`);t&&t.type==="file"&&(!r||r&&!o.isFile())&&s.push({type:"file",path:t.path}),t&&t.type==="directory"&&(!r||r&&!o.isDirectory())&&s.push({type:"directory",path:t.path})}if(s?.length>0){const e=s?.filter(o=>o.type==="file"),t=s?.filter(o=>o.type==="directory");let r=`The following paths are missing and required in a Joystick project:
2
+
3
+ `;if(e?.length>0){r+=` ${i.yellow(">")} Required Files:
4
+
5
+ `;for(let o=0;o<e?.length;o+=1){const c=e[o],a=o+1===e?.length;r+=` ${i.red(`/${c.path}
6
+ ${a&&t?.length>0?`
7
+ `:""}`)}`}}if(t?.length>0){r+=` ${i.yellow(">")} Required Directories:
8
+
9
+ `;for(let o=0;o<t?.length;o+=1){const c=t[o];r+=` ${i.red(`/${c.path}
10
+ `)}`}}n(r,{level:"danger",docs:"https://cheatcode.co/docs/joystick/structure"}),process.exit(0)}},ss=async()=>{const s=await _(`${process.cwd()}/.joystick`),e=await _(`${process.cwd()}/tests`);process.env.NODE_ENV==="test"&&(!s||!e)&&(n("joystick test must be run in a directory with a .joystick folder and tests folder.",{level:"danger",docs:"https://cheatcode.co/docs/joystick/cli/test"}),process.exit(0)),process.env.NODE_ENV!=="test"&&!s&&(n("joystick start must be run in a directory with a .joystick folder.",{level:"danger",docs:"https://cheatcode.co/docs/joystick/cli/start"}),process.exit(0))},es=async(s={})=>{await ss(),await Z(),await Y();const e=W(s?.port),t=await u(e),r=await u(e+1);t&&Q(e),r&&y(e),K(s,e);const o=await h(process.env.NODE_ENV);await X(o),await D({environment:process.env.NODE_ENV,port:e,settings:o}),R({hot_module_reload:(c=[])=>G(c),restart_app_server:()=>w(d,s?.watch,o),start_app_server:()=>E(d,s?.watch),start_hmr_server:s?.environment!=="test"?()=>F(d,f,s?.watch,o):null},{excluded_paths:o?.config?.build?.excluded_paths,custom_copy_paths:o?.config?.build?.copy_paths?.map(c=>({path:c}))||[]}),L(l,d,f)};var $s=es;export{$s as default};
@@ -0,0 +1 @@
1
+ const s=(e=[])=>{for(let l=0;l<e?.length;l+=1){const o=e[l];process.kill(o)}};var t=s;export{t as default};
@@ -0,0 +1,2 @@
1
+ import t from"child_process";import a from"../cli_log.js";const i=(e="")=>{if(e?.includes("Using configuration"))return null;if(e?.includes("No tests found"))return a("No tests found. Add tests in the /tests folder at the root of your Joystick app.",{level:"danger",docs:"https://cheatcode.co/docs/joystick/test/setup"});console.log(e)},r=(e="")=>{if(e?.includes("Using configuration"))return null;if(e?.includes("No tests found in")){const[s]=e?.split(",");return console.log(`${s}
2
+ `)}console.log(e)},d=(e={},s={})=>{e.stdout.on("data",function(n){const o=n.toString();r(o,s)}),e.stderr.on("data",function(n){const o=n.toString();i(o,s)})},l=(e={})=>{const s=`${process.cwd()}/node_modules/.bin/ava`;return new Promise(n=>{const o=t.exec(`DEBUG=ava:watcher && ${s} --config ${e?.__dirname}/ava_config.js ${e?.watch?"--watch":""}`,{stdio:"inherit",env:{...process.env,databases:process.databases,FORCE_COLOR:"1"}},c=>{c?(e.cleanup_process.send(JSON.stringify({process_ids:e?.process_ids})),process.exit(0)):(e.cleanup_process.send(JSON.stringify({process_ids:e?.process_ids})),process.exit(0))});d(o,e)})};var u=l;export{u as default};
@@ -0,0 +1 @@
1
+ import p from"child_process";import o from"path";const t=(s=[],e=!1)=>(process.env.NODE_ENV!=="test"&&process.loader.print("Starting app..."),p.fork(o.resolve(".joystick/build/index.server.js"),[],{execArgv:s,silent:!0,env:{FORCE_COLOR:"1",LOGS_PATH:process.env.LOGS_PATH,NODE_ENV:process.env.NODE_ENV,ROOT_URL:process.env.ROOT_URL,PORT:process.env.PORT,JOYSTICK_SETTINGS:process.env.JOYSTICK_SETTINGS}})),n=(s=0)=>{const e=["--no-warnings"];return process.env.NODE_ENV==="development"&&e.push("--dns-result-order=ipv4first"),s<19&&e.push("--experimental-specifier-resolution=node"),process.env.NODE_ENV==="development"&&process.env.IS_DEBUG_MODE==="true"&&e.push("--inspect"),e},c=(s=0,e=!1)=>{const r=n(s);return t(r,e)};var a=c;export{a as default};
@@ -0,0 +1 @@
1
+ import c from"../cli_log.js";import i from"./databases/provider_map.js";import d from"../types.js";const l=async(s="development",e={},r=2610,a=!1)=>{const t=i[e?.provider];t&&(process.env.NODE_ENV!=="test"&&process.loader.print(`Starting ${t?.name}${e?.name?` (${e?.name})`:""}...`),process._databases={...process._databases||{},[e.provider]:a?{...process._databases&&process._databases[e.provider]||{},[e?.name||`${e.provider}_${r}`]:await t.connect(e,r,s)}:await t.connect(e,r,s)})},p=async(s=[],e=2610,r="")=>{for(let a=0;a<s?.length;a+=1){const t=s[a],o=s?.filter(n=>n?.provider===n?.provider)?.length>1;await l(r,t,t?.port||e+a,o)}},u=(s=[])=>{const e=s.filter(o=>!d.is_object(o)),r=s.filter(o=>!!o.users),a=s.filter(o=>!!o.queues),t=s.filter(o=>!!o.sessions);return e&&e.length>0&&(c(`Please ensure that each database in the config.databases array in your settings.${process.env.NODE_ENV}.json is an object. Correct the array and restart your app.`,{level:"danger",docs:"https://cheatcode.co/docs/joystick/cli/databases"}),process.exit(1)),r&&r.length>1&&(c("Please select a single database for your user accounts and restart your app.",{level:"danger",docs:"https://cheatcode.co/docs/joystick/cli/databases#users"}),process.exit(1)),a&&a.length>1&&(c("Please select a single database for your queues and restart your app. If you need to spread queues across databases, use the database object on the queue definition instead (see documentation link below).",{level:"danger",docs:"https://cheatcode.co/docs/joystick/cli/databases#queues"}),process.exit(1)),t&&t.length>1&&(c("Please select a single database for your sessions and restart your app.",{level:"danger",docs:"https://cheatcode.co/docs/joystick/cli/databases#sessions"}),process.exit(1)),!0},f=async(s={})=>{const e=s?.settings?.config?.databases||[];e?.length>0&&(u(e),await p(e,s?.port+10,s?.environment))};var v=f;export{v as default};
@@ -0,0 +1 @@
1
+ import t from"child_process";import o from"path";const c=(e=[],r="")=>t.fork(o.resolve(`${r}/hmr_server.js`),[],{execArgv:e,silent:!0}),n=(e=0)=>{const r=["--no-warnings"];return e<19&&r.push("--experimental-specifier-resolution=node"),r},_=(e=0,r="")=>{const s=n(e);return c(s,r)};var a=_;export{a as default};
@@ -0,0 +1 @@
1
+ import t from"./get_platform_safe_path.js";const e=[t("lib/node"),t("tests/")];var s=e;export{s as default};
@@ -0,0 +1 @@
1
+ import e from"./get_platform_safe_path.js";const t=[e("email/"),e("lib/"),e("lib/browser"),e("ui/"),"index.client.js"];var i=t;export{i as default};
@@ -0,0 +1 @@
1
+ import d from"../../constants.js";import e from"../../get_platform_safe_path.js";const u=(s="")=>{const t=s==="index.html",_=s==="index.client.js",n=s.includes(e("lib/"))&&!s.includes(e("lib/node")),i=s.includes("css/"),r=s.includes("i18n"),o=s.match(d.SETTINGS_FILE_NAME_REGEX)?.length>0,c=s.includes(e("ui/"))||s==="index.css"||t||_||n,l=process.hmr_server_process&&process.hmr_server_process.has_connections&&(c||r||o)||!1;return i?["hot_module_reload"]:l?["hot_module_reload"]:["restart_app_server"]};var p=u;export{p as default};
@@ -0,0 +1 @@
1
+ import u from"./read_file_dependency_map.js";import l from"../../path_exists.js";import c from"../../get_platform_safe_path.js";const _=(r="",o={})=>Object.entries(o).filter(([a,t])=>{const i=t&&t.imports&&t.imports.some(s=>s.absolute_path.includes(r)||s.absolute_path?.toLowerCase()?.includes(r)),m=t&&t.requires&&t.requires.some(s=>s.absolute_path.includes(r)||s.absolute_path?.toLowerCase()?.includes(r));return i||m}).map(([a])=>a.replace(c(`${process.cwd()}/`),"")),p=async(r="")=>{const o=await u(),e=_(r,o);return Promise.all(e.filter(a=>l(a)))};var g=p;export{g as default};
@@ -0,0 +1 @@
1
+ const r=(e="")=>process.platform==="win32"?e.replace("/","\\"):e;var t=r;export{t as default};
@@ -0,0 +1 @@
1
+ import f from"chokidar";import h from"fs";import{dirname as m}from"path";import y from"../../build/build_files.js";import k from"../../debounce.js";import n from"./get_after_run_tasks.js";import v from"./get_file_codependencies.js";import p from"../../build/get_file_operation.js";import g from"../../build/get_path_platform.js";import w from"../../types.js";import R from"./watch_paths.js";const{mkdir:l,copyFile:b,rm:u}=h.promises,o=async(e={},s={})=>{const a=process.initial_build_complete?await v(e?.path):[];if(s?.is_build_file&&await y({files:[{path:e?.path,platform:g(e?.path)}]}).catch((r=[])=>{if(!process.initial_build_complete&&r?.length>0&&process.exit(0),process.initial_build_complete&&r?.length>0)throw process.app_server_process.send(JSON.stringify({type:"BUILD_ERROR",paths:r.filter(({success:t})=>!t)})),process.hmr_server_process.send(JSON.stringify({type:"BUILD_ERROR"})),new Error("BUILD_ERROR")}),a?.length>0)for(let r=0;r<a?.length;r+=1){const t=a[r];await o({path:t},s)}return Promise.resolve()},x=async(e={})=>{switch(e?.operation){case"add_directory":return l(`.joystick/build/${e?.path}`,{recursive:!0});case"build_file":return o(e,{is_build_file:!0});case"copy_file":return await l(m(`.joystick/build/${e?.path}`),{recursive:!0}),await b(e?.path,`.joystick/build/${e?.path}`),o(e,{is_build_file:!1});case"delete_directory":return u(`.joystick/build/${e?.path}`,{recursive:!0});case"delete_file":return await u(`.joystick/build/${e?.path}`,{recursive:!0}),o(e,{is_build_file:!1});default:return!0}},D=(e={})=>({operation:e?.event,path:e?.path,after_run_tasks:process.initial_build_complete?n(e?.path):["start_app_server","start_hmr_server"]}),O=(e={})=>({operation:e?.event,path:e?.path,after_run_tasks:process.initial_build_complete?n(e?.path):["start_app_server","start_hmr_server"]}),$=(e={})=>({operation:e?.event,path:e?.path,after_run_tasks:process.initial_build_complete?n(e?.path):["start_app_server","start_hmr_server"]}),E=(e={})=>({operation:e?.is_custom_copy_path?"copy_file":p(e?.path),path:e?.path,after_run_tasks:process.initial_build_complete?n(e?.path):["start_app_server","start_hmr_server"]}),B=(e={})=>({operation:e?.is_custom_copy_path?"copy_file":p(e?.path),path:e?.path,after_run_tasks:process.initial_build_complete?n(e?.path):["start_app_server","start_hmr_server"]}),I=(e={})=>{switch(e?.event){case"add_file":return B(e);case"change_file":return E(e);case"delete_file":return $(e);case"add_directory":return O(e);case"delete_directory":return D(e)}},L=async(e=[],s={})=>{try{const a=new Set([]);for(let t=0;t<e?.length;t+=1){const i=e[t],c=I(i);if(await x(c),c?.after_run_tasks)for(let _=0;_<c?.after_run_tasks?.length;_+=1){const d=c?.after_run_tasks[_];a.add(d)}}const r=Array.from(a);for(let t=0;t<r?.length;t+=1){const i=r[t];w.is_function(s[i])&&await s[i](e)}}catch{}},S=(e="")=>{switch(e){case"add":return"add_file";case"change":return"change_file";case"unlink":return"delete_file";case"addDir":return"add_directory";case"unlinkDir":return"delete_directory"}},U=(e={},s={})=>{const a=f.watch([...R,...s?.custom_copy_paths||[]].map(({path:t})=>t),{ignored:".joystick"});let r=[];process.initial_build_complete=!1,a.on("error",t=>console.error(t)),a.on("all",(t,i)=>{s?.excluded_paths?.some(_=>i.includes(_))||(r.push({event:S(t),path:i,is_custom_copy_path:s?.custom_copy_paths?.length?s?.custom_copy_paths.some(_=>i.includes(_?.path)):!1}),k(async()=>{await L(r,e),process.initial_build_complete=!0,r=[]},100))})};var M=U;export{M as default};
@@ -0,0 +1 @@
1
+ import e from"./get_platform_safe_path.js";var o=[e("api/"),e("caches/"),e("cronJobs/"),e("cron_jobs/"),e("fixtures/"),e("indexes/"),e("lib/node"),e("queues/"),e("routes/"),e("tests/"),e("uploaders/"),e("websockets/"),"index.server.js"];export{o as default};
@@ -0,0 +1 @@
1
+ import t from"fs";import i from"../../path_exists.js";const{readFile:s}=t.promises,o=async()=>{const e=".joystick/build/file_map.json";if(await i(e)){const a=await s(e,"utf-8");return a?JSON.parse(a):{}}return{}};var n=o;export{n as default};
@@ -0,0 +1 @@
1
+ import t from"../../build/copy_paths.js";const a=[{path:"api"},{path:"caches"},{path:"cronJobs"},{path:"cron_jobs"},{path:"email"},{path:"fixtures"},{path:"indexes"},{path:"lib"},{path:"queues"},{path:"routes"},{path:"ui"},{path:"uploaders"},{path:"websockets"},{path:"index.client.js"},{path:"index.server.js"},...t];var h=a;export{h as default};
@@ -0,0 +1 @@
1
+ const e=async(t="")=>(await(process.platform==="win32"?import(`file://${t}`):import(t)))?.default;var o=e;export{o as default};
@@ -0,0 +1 @@
1
+ import e from"crypto";const i=(a,n)=>{const t=e.randomBytes(16),c=e.createHash("sha256").update(n).digest("hex").substring(0,32),r=e.createCipheriv("aes256",c,t);return Buffer.concat([t,r.update(a),r.final()])};var s=i;export{s as default};
@@ -0,0 +1 @@
1
+ const r="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890".split(""),l=(a=16)=>{let t="",e=0;for(;e<a;)t+=r[Math.floor(Math.random()*(r.length-1))],e+=1;return t};var n=l;export{n as default};
@@ -0,0 +1 @@
1
+ import e from"fs";import{join as n}from"path";const{readdir:c,stat:f}=e.promises,s=async(i="./",r=[])=>{const o=(await c(i))?.map(t=>n(i,t));r.push(...o);for(let t=0;t<o?.length;t+=1){const a=o[t];(await f(a)).isDirectory()&&await s(a,r)}return r};var _=s;export{_ as default};
@@ -0,0 +1 @@
1
+ import t from"os";const e=(r="")=>t.platform()==="win32"?r.replace(/\//g,"\\"):r;var a=e;export{a as default};
@@ -0,0 +1,2 @@
1
+ import n from"child_process";import p from"util";const t=p.promisify(n.exec),i=async(e=0)=>process.platform==="win32"?t(`netstat -a -n -o | find "${e}"`).then(o=>{const s=o.stdout?.split(`
2
+ `);return s&&s[0]&&s[0]?.split(" ")?.filter(r=>r!=="")?.map(r=>r?.replace("\r",""))?.pop()||null}).catch(()=>null):(await t(`lsof -n -i:${e} | grep LISTEN | awk '{ print $2 }' | uniq`))?.stdout||null;var a=i;export{a as default};
@@ -0,0 +1 @@
1
+ const t=(r="")=>{try{return JSON.parse(r),!0}catch{return!1}};var e=t;export{e as default};
@@ -0,0 +1 @@
1
+ import s from"./get_process_id_from_port.js";import t from"./kill_process_id.js";const i=async(r=0)=>{const o=await s(r);o&&await t(o)};var c=i;export{c as default};
@@ -0,0 +1 @@
1
+ import t from"child_process";import e from"util";const s=e.promisify(t.exec),o=async(r=0)=>{const i=parseInt(r,10);if(i){if(process.platform==="win32"){await s(`taskkill /F /PID ${i}`);return}await s(`kill -9 ${i}`)}};var l=o;export{l as default};
@@ -0,0 +1 @@
1
+ import n from"fs";import r from"./cli_log.js";import c from"./is_valid_json_string.js";import a from"./path_exists.js";const{readFile:l}=n.promises,f=async(t=null)=>{const s=`${process.cwd()}/settings.${t}.json`;await a(s)||(r(`A settings file could not be found for this environment (${t}). Create a settings.${t}.json file at the root of your project and restart Joystick.`,{level:"danger",docs:"https://github.com/cheatcode/joystick#settings"}),process.exit(0));const e=await l(s,"utf-8"),o=c(e);o||(r(`Failed to parse settings file. Double-check the syntax in your settings.${t}.json file at the root of your project and restart Joystick.`,{level:"danger",docs:"https://github.com/cheatcode/joystick#settings",tools:[{title:"JSON Linter",url:"https://jsonlint.com/"}]}),process.exit(0));const i=o?e:"{}";return process.env.JOYSTICK_SETTINGS=i,JSON.parse(i)};var u=f;export{u as default};
@@ -1,82 +1,2 @@
1
- import chalk from "chalk";
2
- import readline from "readline";
3
- class Loader {
4
- constructor(options = {}) {
5
- this.message = options.defaultMessage;
6
- this.frame = 0;
7
- this.frames = [
8
- chalk.yellowBright((options.padding || "") + ">>-----"),
9
- chalk.yellowBright((options.padding || "") + "->>----"),
10
- chalk.yellowBright((options.padding || "") + "-->>---"),
11
- chalk.yellowBright((options.padding || "") + "--->>--"),
12
- chalk.yellowBright((options.padding || "") + "---->>-"),
13
- chalk.yellowBright((options.padding || "") + "----->>"),
14
- chalk.yellowBright((options.padding || "") + "----<<-"),
15
- chalk.yellowBright((options.padding || "") + "---<<--"),
16
- chalk.yellowBright((options.padding || "") + "--<<---"),
17
- chalk.yellowBright((options.padding || "") + "-<<----"),
18
- chalk.yellowBright((options.padding || "") + "<<-----")
19
- ];
20
- this.freezeFrames = {
21
- stable: chalk.yellowBright((options.padding || "") + "--->---"),
22
- error: chalk.redBright((options.padding || "") + "!!!")
23
- };
24
- }
25
- getFrame() {
26
- if (this.frame === this.frames.length - 1) {
27
- this.frame = 0;
28
- return this.frame;
29
- }
30
- this.frame += 1;
31
- return this.frame;
32
- }
33
- start(message = "") {
34
- if (message) {
35
- this.message = message;
36
- }
37
- this.interval = setInterval(() => {
38
- const frameToRender = this.getFrame();
39
- readline.cursorTo(process.stdout, 0);
40
- process.stdout.write(`${this.frames[frameToRender]} ${this.message}`);
41
- }, 80);
42
- }
43
- stop() {
44
- clearInterval(this.interval);
45
- readline.cursorTo(process.stdout, 0);
46
- readline.clearLine(process.stdout);
47
- this.message = "";
48
- this.interval = null;
49
- }
50
- text(message = "") {
51
- readline.clearLine(process.stdout);
52
- if (message) {
53
- this.message = message;
54
- }
55
- if (!this.interval) {
56
- this.start();
57
- }
58
- }
59
- pause(message = "", frame = "stable") {
60
- readline.clearLine(process.stdout);
61
- if (message) {
62
- this.message = message;
63
- }
64
- clearInterval(this.interval);
65
- this.interval = null;
66
- const freezeFrame = this.freezeFrames[frame];
67
- readline.cursorTo(process.stdout, 0);
68
- process.stdout.write(
69
- `${freezeFrame ? `${freezeFrame} ` : ""}${this.message}`
70
- );
71
- }
72
- stable(message = "") {
73
- this.pause(message);
74
- }
75
- error(message = "") {
76
- this.pause(message, "error");
77
- }
78
- }
79
- var loader_default = Loader;
80
- export {
81
- loader_default as default
82
- };
1
+ import r from"chalk";class s{constructor(t={}){this.message=t.default_message}print(t="",e=!1){t&&(this.message=t),process.stdout.write(`${r[e?"redBright":"yellowBright"](">")} ${this.message}
2
+ `)}error(t=""){this.print(t,!0)}}var a=s;export{a as default};
@@ -0,0 +1 @@
1
+ import r from"chalk";const l=()=>`${r.yellowBright("=")}${r.gray("=")}${r.yellowBright("=")}${r.gray("=")}${r.yellowBright("=")}${r.gray("=")}`;var t=l;export{t as default};
@@ -0,0 +1 @@
1
+ import a from"os";import{dirname as i}from"path";import{fileURLToPath as r}from"url";const _=r(import.meta.url),l=i(_),e=a.platform()==="win32",n={__package:l?.replace(e?"\\dist\\lib":"/dist/lib",e?"\\dist":"/dist"),__filename:(t="")=>r(t),__dirname:(t="")=>{const o=r(t);return i(o)}};var c=n;export{c as default};
@@ -0,0 +1 @@
1
+ const p=(c={})=>Object.entries(c).reduce((u,[l,e])=>(e&&e.value&&e.parent&&e.parent==="create"&&(u[l]=e.value),e&&e.value&&(!e.parent||e.parent!=="create")&&(u[l]=e.value.includes("-")?null:e.value),u),{});var r=p;export{r as default};
@@ -0,0 +1 @@
1
+ const c=(r={})=>Object.entries(r).reduce((u,[t,l])=>{if(l&&l.flags){const a=Object.values(l.flags);for(let s=0;s<a?.length;s+=1){const e=a[s];e&&e.value&&(u[t]=e.value&&![`${e.value}`.substring(0,1)].includes("-")?e.value:null)}}return u},{});var f=c;export{f as default};
@@ -0,0 +1 @@
1
+ import s from"fs";const r=(t="")=>new Promise(e=>{s.access(t,s.constants.F_OK,o=>{e(!o)})});var a=r;export{a as default};
@@ -0,0 +1 @@
1
+ import e from"chalk";const r=()=>`${e.red("=")}${e.green("=")}${e.blue("=")}${e.red("=")}${e.green("=")}${e.blue("=")}`;var $=r;export{$ as default};
@@ -0,0 +1 @@
1
+ import f from"fs";const{readdir:u,readFile:s,writeFile:d}=f.promises,h=(a="",t={})=>u(a,{recursive:!0}).then(async n=>{let r=n;if(t?.exclude?.length)for(let e=0;e<t?.exclude?.length;e+=1){const l=t?.exclude[e];r=r?.filter(c=>!c.match(new RegExp(l)))}r=r.filter(e=>t?.match?.length?t?.match?.some(l=>e.match(new RegExp(l))):!0);for(let e=0;e<r?.length;e+=1){const l=r[e],c=`${a}/${l}`,i=(await s(c,"utf-8"))?.replace(new RegExp(t.replace_regex),t.replace_with);await d(c,i)}}).catch(n=>{console.warn(n)});var g=h;export{g as default};
@@ -0,0 +1 @@
1
+ const t=[{path:"index.server.js",type:"file"},{path:"index.html",type:"file"},{path:"index.client.js",type:"file"},{path:"api",type:"directory"},{path:"email",type:"directory"},{path:"i18n",type:"directory"},{path:"lib",type:"directory"},{path:"private",type:"directory"},{path:"public",type:"directory"},{path:"ui",type:"directory"},{path:"ui/components",type:"directory"},{path:"ui/layouts",type:"directory"},{path:"ui/pages",type:"directory"}];var e=t;export{e as default};
@@ -0,0 +1 @@
1
+ const a=(e={})=>Object.entries(e).map(([r,t])=>`${r}=${t}`)?.join("&");var n=a;export{n as default};
package/dist/lib/types.js CHANGED
@@ -1,6 +1 @@
1
- const isObject = (value) => {
2
- return value !== null && !Array.isArray(value) && typeof value === "object";
3
- };
4
- export {
5
- isObject
6
- };
1
+ const n=r=>!!r,t=r=>!!Array.isArray(r),s=r=>r===!0||r===!1,e=r=>Number(r)===r&&r%1!==0,o=r=>typeof r=="function",i=r=>Number(r)===r&&r%1===0,c=r=>r===null,u=r=>Number(r)===r,f=r=>!!(r&&typeof r=="object"&&!Array.isArray(r)),y=r=>typeof r=="string",_=r=>typeof r>"u",b={is_any:n,is_array:t,is_boolean:s,is_float:e,is_function:o,is_integer:i,is_null:c,is_number:u,is_object:f,is_string:y,is_undefined:_};var p=b;export{p as default};
@@ -0,0 +1 @@
1
+ const r=(n=[])=>{const u=new Set,i=new WeakMap,t=[];for(let s=0;s<n.length;s++){const e=n[s];typeof e=="object"&&e!==null?i.has(e)||(i.set(e,!0),t.push(e)):u.has(e)||(u.add(e),t.push(e))}return t};var a=r;export{a as default};
@@ -0,0 +1,3 @@
1
+ import child_process from 'child_process';
2
+
3
+ child_process.execSync(`npm version prerelease --preid=canary`);
package/package.json CHANGED
@@ -1,55 +1,36 @@
1
1
  {
2
2
  "name": "@joystick.js/cli-canary",
3
- "version": "0.0.0-canary.162",
4
3
  "type": "module",
5
- "description": "CLI for the Joystick JavaScript framework.",
6
- "main": "development.js",
4
+ "version": "0.0.0-canary.1621",
5
+ "canary_version": "0.0.0-canary.1620",
6
+ "description": "The CLI for Joystick.",
7
+ "main": "dist/index.js",
7
8
  "bin": {
8
- "joystick": "./dist/index.js"
9
+ "joystick-canary": "./dist/index.js"
9
10
  },
10
11
  "scripts": {
11
- "build": "node .build/index.js",
12
- "canary:release": "export NODE_ENV=development && npm run build && node canary.js",
13
- "production:release": "export NODE_ENV=production && npm run build && node release.js",
14
- "win:development:release": "SET NODE_ENV=development&& npm run build && node release.js",
12
+ "build": "node ./.build/index.js",
13
+ "release": "node increment_version.js && npm run build && npm publish",
15
14
  "test": "echo \"Error: no test specified\" && exit 1"
16
15
  },
17
16
  "keywords": [],
18
17
  "author": "",
19
18
  "license": "ISC",
20
- "devDependencies": {
21
- "cross-env": "^7.0.3",
22
- "semver": "^7.3.5"
23
- },
24
19
  "dependencies": {
25
- "@babel/code-frame": "^7.15.8",
26
- "acorn": "^8.5.0",
20
+ "@babel/code-frame": "^7.23.5",
21
+ "acorn": "^8.11.2",
27
22
  "ascii-table": "^0.0.9",
28
- "ava": "^5.3.1",
29
- "chalk": "^4.1.2",
30
- "chokidar": "^3.5.2",
31
- "command-exists": "^1.2.9",
32
- "cross-port-killer": "^1.4.0",
33
- "currency-formatter": "^1.5.9",
34
- "esbuild": "^0.17.19",
23
+ "ava": "^6.0.1",
24
+ "chalk": "^5.3.0",
25
+ "chokidar": "^3.5.3",
26
+ "esbuild": "^0.19.9",
35
27
  "esbuild-plugin-svg": "^0.1.0",
36
28
  "form-data": "^4.0.0",
37
- "fs-extra": "^10.0.0",
38
- "inquirer": "^8.2.0",
39
- "kill-port-process": "^3.1.0",
40
- "lodash": "^4.17.21",
41
- "mongo-uri-tool": "^1.0.1",
42
- "mongodb": "^4.1.3",
43
- "netstats": "^0.0.6",
44
- "node-fetch": "^3.2.0",
45
- "node-watch": "^0.7.2",
46
- "pg": "^8.7.3",
47
- "port-pid": "^0.0.7",
48
- "ps-node": "^0.1.6",
49
- "replace-in-files": "^3.0.0",
50
- "selective-whitespace": "^1.0.4",
51
- "systeminformation": "^5.11.0",
52
- "ws": "^8.2.3",
53
- "xmlhttprequest": "^1.8.0"
29
+ "inquirer": "^9.2.12",
30
+ "mongodb": "^6.7.0",
31
+ "node-fetch": "^3.3.2",
32
+ "pg": "^8.11.3",
33
+ "query-string": "^8.1.0",
34
+ "ws": "^8.15.1"
54
35
  }
55
36
  }
package/src/cli.js CHANGED
@@ -1,97 +1,105 @@
1
1
  import chalk from 'chalk';
2
- import help from './lib/help.js';
3
- import functions from './functions/index.js';
4
- import getArgs from './lib/getArgs.js';
5
- import getOptions from './lib/getOptions.js';
2
+ import commands from './commands/index.js';
3
+ import parse_args from './lib/parse_args.js';
4
+ import parse_options from './lib/parse_options.js';
6
5
 
7
- const functionNames = Object.keys(functions);
8
- const functionsCalled = process.argv.filter((arg) => functionNames.includes(arg));
6
+ const command_names = Object.keys(commands);
7
+ const commands_called = process.argv.filter((arg) => command_names.includes(arg));
9
8
 
10
- const showHelp = process.argv.some((arg) => ['-h', '--help'].includes(arg));
9
+ const show_help = process.argv.some((arg) => ['-h', '--help'].includes(arg));
11
10
 
12
- if (showHelp || functionsCalled.length === 0) {
13
- help();
11
+ if (show_help || commands_called.length === 0) {
12
+ commands.help.command();
14
13
  process.exit(0);
15
14
  }
16
15
 
17
- if (functionsCalled.length > 1) {
18
- console.log(chalk.red('Only one function can be called at a time.'));
16
+ if (commands_called.length > 1) {
17
+ console.log(chalk.red('Only one command can be called at a time.'));
19
18
  process.exit(0);
20
19
  }
21
20
 
22
- if (functionsCalled.includes('build')) {
23
- const args = getArgs(functions.build.args);
24
- const options = getOptions(functions.build.options);
21
+ if (commands_called.includes('build')) {
22
+ const args = parse_args(commands.build.args);
23
+ const options = parse_options(commands.build.options);
25
24
 
26
- if (functions.build.function && typeof functions.build.function === 'function') {
27
- functions.build.function(args, options);
25
+ if (commands.build.command) {
26
+ commands.build.command(args, options);
28
27
  }
29
28
  }
30
29
 
31
- if (functionsCalled.includes('create')) {
32
- const args = getArgs(functions.create.args);
33
- const options = getOptions(functions.create.options);
30
+ if (commands_called.includes('create')) {
31
+ const args = parse_args(commands.create.args);
32
+ const options = parse_options(commands.create.options);
34
33
 
35
34
  if (!args.name) {
36
35
  console.log(chalk.red('Must pass a <name> for your app to joystick create. Run joystick --help for examples.'));
37
36
  process.exit(0);
38
37
  }
39
38
 
40
- if (functions.create.function && typeof functions.create.function === 'function') {
41
- functions.create.function(args, options);
39
+ if (commands.create.command) {
40
+ commands.create.command(args, options);
42
41
  }
43
42
  }
44
43
 
45
- if (functionsCalled.includes('logout')) {
46
- const args = getArgs(functions.logout.args);
47
- const options = getOptions(functions.logout.options);
44
+ if (commands_called.includes('help')) {
45
+ const args = parse_args(commands.help.args);
46
+ const options = parse_options(commands.help.options);
48
47
 
49
- if (functions.logout.function && typeof functions.logout.function === 'function') {
50
- functions.logout.function(args, options);
48
+ if (commands.help.command) {
49
+ commands.help.command(args, options);
51
50
  }
52
51
  }
53
52
 
54
- if (functionsCalled.includes('push')) {
55
- const args = getArgs(functions.push.args);
56
- const options = getOptions(functions.push.options);
53
+ if (commands_called.includes('logout')) {
54
+ const args = parse_args(commands.logout.args);
55
+ const options = parse_options(commands.logout.options);
57
56
 
58
- if (functions.push.function && typeof functions.push.function === 'function') {
59
- functions.push.function(args, options);
57
+ if (commands.logout.command) {
58
+ commands.logout.command(args, options);
60
59
  }
61
60
  }
62
61
 
63
- if (functionsCalled.includes('start')) {
64
- const args = getArgs(functions.start.args);
65
- const options = getOptions(functions.start.options);
62
+ if (commands_called.includes('push')) {
63
+ const args = parse_args(commands.push.args);
64
+ const options = parse_options(commands.push.options);
66
65
 
67
- if (functions.start.function && typeof functions.start.function === 'function') {
68
- functions.start.function(args, options);
66
+ if (commands.push.command) {
67
+ commands.push.command(args, options);
69
68
  }
70
69
  }
71
70
 
72
- if (functionsCalled.includes('test')) {
73
- const args = getArgs(functions.test.args);
74
- const options = getOptions(functions.test.options);
71
+ if (commands_called.includes('start')) {
72
+ const args = parse_args(commands.start.args);
73
+ const options = parse_options(commands.start.options);
75
74
 
76
- if (functions.test.function && typeof functions.test.function === 'function') {
77
- functions.test.function(args, options);
75
+ if (commands.start.command) {
76
+ commands.start.command(args, options);
78
77
  }
79
78
  }
80
79
 
81
- if (functionsCalled.includes('update')) {
82
- const args = getArgs(functions.update.args);
83
- const options = getOptions(functions.update.options);
80
+ if (commands_called.includes('test')) {
81
+ const args = parse_args(commands.test.args);
82
+ const options = parse_options(commands.test.options);
84
83
 
85
- if (functions.update.function && typeof functions.update.function === 'function') {
86
- functions.update.function(args, options);
84
+ if (commands.test.command) {
85
+ commands.test.command(args, options);
87
86
  }
88
87
  }
89
88
 
90
- if (functionsCalled.includes('use')) {
91
- const args = getArgs(functions.use.args);
92
- const options = getOptions(functions.use.options);
89
+ if (commands_called.includes('update')) {
90
+ const args = parse_args(commands.update.args);
91
+ const options = parse_options(commands.update.options);
93
92
 
94
- if (functions.use.function && typeof functions.use.function === 'function') {
95
- functions.use.function(args, options);
93
+ if (commands.update.command) {
94
+ commands.update.command(args, options);
95
+ }
96
+ }
97
+
98
+ if (commands_called.includes('use')) {
99
+ const args = parse_args(commands.use.args);
100
+ const options = parse_options(commands.use.options);
101
+
102
+ if (commands.use.command) {
103
+ commands.use.command(args, options);
96
104
  }
97
105
  }
@@ -0,0 +1,58 @@
1
+ import build from './index.js';
2
+
3
+ const [_node, _bin, ...raw_args] = process.argv;
4
+
5
+ const definition = {
6
+ description: 'Build an existing Joystick app.',
7
+ args: {},
8
+ options: {
9
+ environment: {
10
+ flags: {
11
+ '-e': {
12
+ set: !!raw_args.includes('-e'),
13
+ value: !!raw_args.includes('-e') && raw_args[raw_args.indexOf('-e') + 1],
14
+ parent: 'build',
15
+ },
16
+ '--environment': {
17
+ set: !!raw_args.includes('--environment'),
18
+ value: !!raw_args.includes('--environment') && raw_args[raw_args.indexOf('--environment') + 1],
19
+ parent: 'build',
20
+ },
21
+ },
22
+ description: 'The NODE_ENV you want to use for your build (default: production).',
23
+ },
24
+ outputPath: {
25
+ flags: {
26
+ '-o': {
27
+ set: !!raw_args.includes('-o'),
28
+ value: !!raw_args.includes('-o') && raw_args[raw_args.indexOf('-o') + 1],
29
+ parent: 'build',
30
+ },
31
+ '--outputPath': {
32
+ set: !!raw_args.includes('--outputPath'),
33
+ value: !!raw_args.includes('--outputPath') && raw_args[raw_args.indexOf('--outputPath') + 1],
34
+ parent: 'build',
35
+ },
36
+ },
37
+ description: 'The path you want to build the output to.',
38
+ },
39
+ type: {
40
+ flags: {
41
+ '-t': {
42
+ set: !!raw_args.includes('-t'),
43
+ value: !!raw_args.includes('-t') && raw_args[raw_args.indexOf('-t') + 1],
44
+ parent: 'build',
45
+ },
46
+ '--type': {
47
+ set: !!raw_args.includes('--type'),
48
+ value: !!raw_args.includes('--type') && raw_args[raw_args.indexOf('--type') + 1],
49
+ parent: 'build',
50
+ },
51
+ },
52
+ description: 'The type of build you want to generate (tar or folder).',
53
+ },
54
+ },
55
+ command: build,
56
+ };
57
+
58
+ export default definition;
@@ -0,0 +1,7 @@
1
+ import build_app from '../../lib/build/index.js';
2
+
3
+ const build = (_args = {}, options = {}) => {
4
+ build_app(options);
5
+ };
6
+
7
+ export default build;