@joystick.js/cli-canary 0.0.0-canary.66 → 0.0.0-canary.661
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.build/getFilesToBuild.js +1 -1
- package/.build/index.js +3 -3
- package/dist/cli.js +1 -69
- package/dist/commands/build/definition.js +1 -0
- package/dist/commands/build/index.js +1 -0
- package/dist/commands/create/build_package_json.js +1 -0
- package/dist/commands/create/definition.js +1 -0
- package/dist/commands/create/index.js +2 -0
- package/dist/commands/create/template/api/index.js +6 -0
- package/dist/commands/create/template/email/base.css +1 -0
- package/dist/commands/create/template/email/base.html +1 -0
- package/dist/commands/create/template/email/reset_password.js +20 -0
- package/dist/commands/create/template/i18n/en-US.js +14 -0
- package/dist/commands/create/template/index.client.js +1 -0
- package/dist/commands/create/template/index.css +34 -0
- package/dist/{functions/create/templates → commands/create/template}/index.html +2 -3
- package/dist/{functions/create/templates → commands/create/template}/index.server.js +6 -6
- package/dist/commands/create/template/public/apple-touch-icon-152x152.png +0 -0
- package/dist/commands/create/template/public/favicon.ico +0 -0
- package/dist/commands/create/template/public/joystick_logo.webp +0 -0
- package/dist/{functions/create/templates → commands/create/template}/public/manifest.json +4 -4
- package/dist/commands/create/template/public/splash-screen-1024x1024.png +0 -0
- package/{src/functions/create/templates → dist/commands/create/template}/ui/components/button/index.js +14 -6
- package/{src/functions/create/templates → dist/commands/create/template}/ui/layouts/app/index.js +2 -2
- package/dist/commands/create/template/ui/pages/error/index.js +50 -0
- package/dist/commands/create/template/ui/pages/index/index.js +121 -0
- package/dist/commands/help/definition.js +1 -0
- package/dist/commands/help/index.js +19 -0
- package/dist/commands/index.js +1 -0
- package/dist/commands/logout/definition.js +1 -0
- package/dist/commands/logout/index.js +3 -0
- package/dist/commands/push/cdn_mirrors.js +1 -0
- package/dist/commands/push/check_if_settings_valid.js +1 -0
- package/dist/commands/push/create_version.js +1 -0
- package/dist/commands/push/definition.js +1 -0
- package/dist/commands/push/get_app_domain.js +1 -0
- package/dist/commands/push/get_deployment.js +1 -0
- package/dist/commands/push/get_provision_domain.js +1 -0
- package/dist/commands/push/get_session_token.js +1 -0
- package/dist/commands/push/get_settings_file.js +1 -0
- package/dist/commands/push/handle_initial_deployment.js +1 -0
- package/dist/commands/push/handle_version_deployment.js +1 -0
- package/dist/commands/push/index.js +8 -0
- package/dist/commands/push/prompts/confirm_deployment.js +17 -0
- package/dist/commands/push/prompts/session_token.js +5 -0
- package/dist/commands/push/upload_build_to_cdn.js +1 -0
- package/dist/commands/push/validate_deployment.js +1 -0
- package/dist/commands/push/validate_push_config.js +1 -0
- package/dist/commands/start/definition.js +1 -0
- package/dist/commands/start/index.js +1 -0
- package/dist/commands/test/definition.js +1 -0
- package/dist/commands/test/index.js +1 -0
- package/dist/commands/update/definition.js +1 -0
- package/dist/commands/update/index.js +1 -0
- package/dist/commands/use/definition.js +1 -0
- package/dist/commands/use/index.js +1 -0
- package/dist/index.js +1 -7
- package/dist/lib/build/browser_path_exclusions.js +1 -0
- package/dist/lib/build/browser_paths.js +1 -0
- package/dist/lib/build/build_files.js +3 -0
- package/dist/lib/build/copy_paths.js +1 -0
- package/dist/lib/build/get_code_frame.js +1 -0
- package/dist/lib/build/get_file_operation.js +1 -0
- package/dist/lib/build/get_files_to_build.js +1 -0
- package/dist/lib/build/get_path_platform.js +1 -0
- package/dist/lib/build/get_platform_safe_path.js +1 -0
- package/dist/lib/build/get_tar_ignore_list.js +2 -0
- package/dist/lib/build/index.js +3 -0
- package/dist/lib/build/master_ignore_list.js +1 -0
- package/dist/lib/build/minify_file.js +1 -0
- package/dist/lib/build/node_paths.js +1 -0
- package/dist/lib/build/on_warn.js +10 -0
- package/dist/lib/build/plugins/bootstrap_component.js +33 -0
- package/dist/lib/build/plugins/generate_file_dependency_map.js +1 -0
- package/dist/lib/build/plugins/index.js +1 -0
- package/dist/lib/build/plugins/set_component_id.js +2 -0
- package/dist/lib/build/plugins/update_file_map.js +1 -0
- package/dist/lib/build/plugins/warn_node_environment.js +3 -0
- package/dist/lib/cli_log.js +13 -0
- package/dist/lib/color_log.js +1 -0
- package/dist/lib/command_exists.js +1 -0
- package/dist/lib/constants.js +1 -4
- package/dist/lib/debounce.js +1 -0
- package/dist/lib/decrypt_buffer.js +1 -0
- package/dist/lib/development_server/ava_config.js +1 -0
- package/dist/lib/development_server/check_if_port_occupied.js +1 -0
- package/dist/lib/development_server/cleanup.js +1 -0
- package/dist/lib/development_server/databases/mongodb/available_query_parameters.js +1 -0
- package/dist/lib/development_server/databases/mongodb/build_connection_string.js +1 -0
- package/dist/lib/development_server/databases/mongodb/build_query_parameters.js +1 -0
- package/dist/lib/development_server/databases/mongodb/check_connection.js +2 -0
- package/dist/lib/development_server/databases/mongodb/connect.js +1 -0
- package/dist/lib/development_server/databases/mongodb/index.js +5 -0
- package/dist/lib/development_server/databases/postgresql/check_connection.js +2 -0
- package/dist/lib/development_server/databases/postgresql/connect.js +1 -0
- package/dist/lib/development_server/databases/postgresql/index.js +2 -0
- package/dist/lib/development_server/databases/provider_map.js +1 -0
- package/dist/lib/development_server/get_database_process_ids.js +1 -0
- package/dist/lib/development_server/get_translations.js +1 -0
- package/dist/lib/development_server/hmr_server.js +1 -0
- package/dist/lib/development_server/index.js +10 -0
- package/dist/lib/development_server/kill_process_ids.js +1 -0
- package/dist/lib/development_server/run_tests.js +2 -0
- package/dist/lib/development_server/start_app_server.js +1 -0
- package/dist/lib/development_server/start_databases.js +1 -0
- package/dist/lib/development_server/start_hmr_server.js +1 -0
- package/dist/lib/development_server/watch_for_changes/browser_path_exclusions.js +1 -0
- package/dist/lib/development_server/watch_for_changes/browser_paths.js +1 -0
- package/dist/lib/development_server/watch_for_changes/get_after_run_tasks.js +1 -0
- package/dist/lib/development_server/watch_for_changes/get_file_codependencies.js +1 -0
- package/dist/lib/development_server/watch_for_changes/get_platform_safe_path.js +1 -0
- package/dist/lib/development_server/watch_for_changes/index.js +1 -0
- package/dist/lib/development_server/watch_for_changes/node_paths.js +1 -0
- package/dist/lib/development_server/watch_for_changes/read_file_dependency_map.js +1 -0
- package/dist/lib/development_server/watch_for_changes/watch_paths.js +1 -0
- package/dist/lib/dynamic_import.js +1 -0
- package/dist/lib/encrypt_buffer.js +1 -0
- package/dist/lib/generate_id.js +1 -0
- package/dist/lib/get_files_in_path.js +1 -0
- package/dist/lib/get_platform_safe_path.js +1 -0
- package/dist/lib/get_process_id_from_port.js +2 -0
- package/dist/lib/is_valid_json_string.js +1 -0
- package/dist/lib/kill_port_process.js +1 -0
- package/dist/lib/kill_process_id.js +1 -0
- package/dist/lib/load_settings.js +1 -0
- package/dist/lib/loader.js +2 -82
- package/dist/lib/log_bars.js +1 -0
- package/dist/lib/node_path_polyfills.js +1 -0
- package/dist/lib/parse_args.js +1 -0
- package/dist/lib/parse_options.js +1 -0
- package/dist/lib/path_exists.js +1 -0
- package/dist/lib/rainbow_road.js +1 -0
- package/dist/lib/replace_in_files.js +1 -0
- package/dist/lib/required_files.js +1 -0
- package/dist/lib/serialize_query_parameters.js +1 -0
- package/dist/lib/types.js +1 -6
- package/increment_version.js +3 -0
- package/package.json +18 -37
- package/src/cli.js +63 -46
- package/src/commands/build/definition.js +58 -0
- package/src/commands/build/index.js +7 -0
- package/src/commands/create/build_package_json.js +20 -0
- package/src/commands/create/definition.js +35 -0
- package/src/commands/create/index.js +71 -0
- package/src/commands/create/template/api/index.js +6 -0
- package/src/commands/create/template/email/base.css +1 -0
- package/src/commands/create/template/email/base.html +1 -0
- package/src/commands/create/template/email/reset_password.js +20 -0
- package/src/commands/create/template/i18n/en-US.js +14 -0
- package/src/commands/create/template/index.client.js +1 -0
- package/src/commands/create/template/index.css +34 -0
- package/src/{functions/create/templates → commands/create/template}/index.html +2 -3
- package/src/{functions/create/templates → commands/create/template}/index.server.js +6 -6
- package/src/commands/create/template/public/apple-touch-icon-152x152.png +0 -0
- package/src/commands/create/template/public/favicon.ico +0 -0
- package/src/commands/create/template/public/joystick_logo.webp +0 -0
- package/src/{functions/create/templates → commands/create/template}/public/manifest.json +4 -4
- package/src/commands/create/template/public/splash-screen-1024x1024.png +0 -0
- package/{dist/functions/create/templates → src/commands/create/template}/ui/components/button/index.js +14 -6
- package/{dist/functions/create/templates → src/commands/create/template}/ui/layouts/app/index.js +2 -2
- package/src/commands/create/template/ui/pages/error/index.js +50 -0
- package/src/commands/create/template/ui/pages/index/index.js +121 -0
- package/src/commands/help/definition.js +12 -0
- package/src/commands/help/index.js +48 -0
- package/src/commands/index.js +23 -0
- package/src/commands/logout/definition.js +10 -0
- package/src/commands/logout/index.js +20 -0
- package/src/commands/push/cdn_mirrors.js +7 -0
- package/src/commands/push/check_if_settings_valid.js +10 -0
- package/src/commands/push/create_version.js +20 -0
- package/src/commands/push/definition.js +43 -0
- package/src/commands/push/get_app_domain.js +11 -0
- package/src/commands/push/get_deployment.js +19 -0
- package/src/commands/push/get_provision_domain.js +9 -0
- package/src/commands/push/get_session_token.js +31 -0
- package/src/commands/push/get_settings_file.js +47 -0
- package/src/commands/push/handle_initial_deployment.js +24 -0
- package/src/commands/push/handle_version_deployment.js +23 -0
- package/src/commands/push/index.js +190 -0
- package/src/commands/push/prompts/confirm_deployment.js +73 -0
- package/src/commands/push/prompts/session_token.js +11 -0
- package/src/commands/push/upload_build_to_cdn.js +59 -0
- package/src/commands/push/validate_deployment.js +19 -0
- package/src/commands/push/validate_push_config.js +18 -0
- package/src/commands/start/definition.js +58 -0
- package/src/commands/start/index.js +11 -0
- package/src/commands/test/definition.js +28 -0
- package/src/commands/test/index.js +12 -0
- package/src/commands/update/definition.js +28 -0
- package/src/commands/update/index.js +29 -0
- package/src/commands/use/definition.js +19 -0
- package/src/commands/use/index.js +54 -0
- package/src/index.js +0 -0
- package/src/lib/build/browser_path_exclusions.js +8 -0
- package/src/lib/build/browser_paths.js +11 -0
- package/src/lib/build/build_files.js +161 -0
- package/src/{functions/start/filesToCopy.js → lib/build/copy_paths.js} +3 -1
- package/src/lib/build/get_code_frame.js +11 -0
- package/src/lib/build/get_file_operation.js +25 -0
- package/src/lib/build/get_files_to_build.js +36 -0
- package/src/lib/build/get_path_platform.js +32 -0
- package/src/lib/build/get_platform_safe_path.js +6 -0
- package/src/lib/build/get_tar_ignore_list.js +41 -0
- package/src/lib/build/index.js +101 -0
- package/src/lib/build/master_ignore_list.js +14 -0
- package/src/lib/build/minify_file.js +15 -0
- package/src/lib/build/node_paths.js +17 -0
- package/src/lib/build/on_warn.js +70 -0
- package/src/lib/build/plugins/bootstrap_component.js +191 -0
- package/src/lib/build/plugins/generate_file_dependency_map.js +20 -0
- package/src/lib/build/plugins/index.js +26 -0
- package/src/lib/build/plugins/set_component_id.js +89 -0
- package/src/lib/build/plugins/update_file_map.js +98 -0
- package/src/lib/build/plugins/warn_node_environment.js +20 -0
- package/src/lib/{CLILog.js → cli_log.js} +12 -8
- package/src/lib/color_log.js +7 -0
- package/src/lib/command_exists.js +16 -0
- package/src/lib/constants.js +11 -1
- package/src/lib/debounce.js +9 -0
- package/src/lib/decrypt_buffer.js +12 -0
- package/src/lib/development_server/ava_config.js +14 -0
- package/src/lib/development_server/check_if_port_occupied.js +31 -0
- package/src/lib/development_server/cleanup.js +15 -0
- package/src/lib/{dev/databases/mongodb/availableQueryParameters.js → development_server/databases/mongodb/available_query_parameters.js} +3 -1
- package/src/lib/development_server/databases/mongodb/build_connection_string.js +31 -0
- package/src/lib/development_server/databases/mongodb/build_query_parameters.js +17 -0
- package/src/lib/development_server/databases/mongodb/check_connection.js +41 -0
- package/src/lib/development_server/databases/mongodb/connect.js +27 -0
- package/src/lib/development_server/databases/mongodb/index.js +118 -0
- package/src/lib/development_server/databases/postgresql/check_connection.js +56 -0
- package/src/lib/development_server/databases/postgresql/connect.js +33 -0
- package/src/lib/development_server/databases/postgresql/index.js +126 -0
- package/src/lib/development_server/databases/provider_map.js +15 -0
- package/src/lib/development_server/get_database_process_ids.js +28 -0
- package/src/lib/development_server/get_translations.js +85 -0
- package/src/lib/development_server/hmr_server.js +94 -0
- package/src/lib/development_server/index.js +394 -0
- package/src/lib/development_server/kill_process_ids.js +8 -0
- package/src/lib/development_server/run_tests.js +84 -0
- package/src/lib/development_server/start_app_server.js +55 -0
- package/src/lib/development_server/start_databases.js +108 -0
- package/src/lib/development_server/start_hmr_server.js +36 -0
- package/src/lib/development_server/watch_for_changes/browser_path_exclusions.js +8 -0
- package/src/lib/development_server/watch_for_changes/browser_paths.js +11 -0
- package/src/lib/development_server/watch_for_changes/get_after_run_tasks.js +31 -0
- package/src/lib/development_server/watch_for_changes/get_file_codependencies.js +48 -0
- package/src/lib/development_server/watch_for_changes/get_platform_safe_path.js +6 -0
- package/src/lib/development_server/watch_for_changes/index.js +216 -0
- package/src/lib/development_server/watch_for_changes/node_paths.js +16 -0
- package/src/lib/development_server/watch_for_changes/read_file_dependency_map.js +18 -0
- package/src/lib/development_server/watch_for_changes/watch_paths.js +21 -0
- package/src/lib/dynamic_import.js +6 -0
- package/src/lib/encrypt_buffer.js +10 -0
- package/src/lib/generate_id.js +15 -0
- package/src/lib/get_files_in_path.js +25 -0
- package/src/lib/get_platform_safe_path.js +8 -0
- package/src/lib/get_process_id_from_port.js +26 -0
- package/src/lib/is_valid_json_string.js +10 -0
- package/src/lib/kill_port_process.js +12 -0
- package/src/lib/kill_process_id.js +19 -0
- package/src/lib/load_settings.js +43 -0
- package/src/lib/loader.js +4 -77
- package/src/lib/log_bars.js +7 -0
- package/src/lib/node_path_polyfills.js +23 -0
- package/src/lib/parse_args.js +16 -0
- package/src/lib/parse_options.js +16 -0
- package/src/lib/path_exists.js +11 -0
- package/src/lib/{rainbowRoad.js → rainbow_road.js} +4 -2
- package/src/lib/replace_in_files.js +40 -0
- package/src/lib/{dev/requiredFiles.js → required_files.js} +3 -1
- package/src/lib/serialize_query_parameters.js +7 -0
- package/src/lib/types.js +59 -2
- package/HMRNOTES.txt +0 -23
- package/README.md +0 -7
- package/_package.json +0 -55
- package/canary.js +0 -12
- package/dist/functions/build/getTarIgnoreList.js +0 -25
- package/dist/functions/build/index.js +0 -54
- package/dist/functions/create/buildPackageJSON.js +0 -20
- package/dist/functions/create/index.js +0 -193
- package/dist/functions/create/templates/api/index.js +0 -4
- package/dist/functions/create/templates/i18n/en-US.js +0 -4
- package/dist/functions/create/templates/index.client.js +0 -7
- package/dist/functions/create/templates/index.css +0 -20
- package/dist/functions/create/templates/public/apple-touch-icon-152x152.png +0 -0
- package/dist/functions/create/templates/public/favicon.ico +0 -0
- package/dist/functions/create/templates/public/splash-screen-1024x1024.png +0 -0
- package/dist/functions/create/templates/ui/pages/error/index.js +0 -31
- package/dist/functions/create/templates/ui/pages/index/index.js +0 -94
- package/dist/functions/index.js +0 -243
- package/dist/functions/logout/index.js +0 -20
- package/dist/functions/push/checkIfProvisionAvailable.js +0 -19
- package/dist/functions/push/deploy/index.js +0 -173
- package/dist/functions/push/deploy/initial.js +0 -100
- package/dist/functions/push/deploy/version.js +0 -100
- package/dist/functions/push/domains.js +0 -23
- package/dist/functions/push/getAvailableCDN.js +0 -23
- package/dist/functions/push/getDeployment.js +0 -41
- package/dist/functions/push/getDeploymentSummary.js +0 -38
- package/dist/functions/push/getInstanceSizeRegions.js +0 -37
- package/dist/functions/push/getInstanceSizesForRegion.js +0 -34
- package/dist/functions/push/getProviderInstanceSizes.js +0 -34
- package/dist/functions/push/getProviderRegions.js +0 -36
- package/dist/functions/push/getProvidersWithConnectionStatus.js +0 -20
- package/dist/functions/push/getSessionToken.js +0 -23
- package/dist/functions/push/getUserFromSessionToken.js +0 -37
- package/dist/functions/push/index.js +0 -210
- package/dist/functions/push/loginToCheatCode.js +0 -33
- package/dist/functions/push/pingProvisionAPI.js +0 -31
- package/dist/functions/push/prompts.js +0 -332
- package/dist/functions/push/providerMap.js +0 -11
- package/dist/functions/push/providers.js +0 -9
- package/dist/functions/reset/index.js +0 -0
- package/dist/functions/reset/reset.js +0 -127
- package/dist/functions/start/bootstrapLayoutComponent.js +0 -54
- package/dist/functions/start/bootstrapPageComponent.js +0 -51
- package/dist/functions/start/buildFile.js +0 -85
- package/dist/functions/start/buildFiles.js +0 -76
- package/dist/functions/start/buildPlugins.js +0 -183
- package/dist/functions/start/checkIfPortAvailable.js +0 -18
- package/dist/functions/start/cleanup/index.js +0 -18
- package/dist/functions/start/databases/mongodb/availableQueryParameters.js +0 -42
- package/dist/functions/start/databases/mongodb/buildConnectionString.js +0 -22
- package/dist/functions/start/databases/mongodb/buildQueryParameters.js +0 -14
- package/dist/functions/start/databases/mongodb/checkConnection.js +0 -35
- package/dist/functions/start/databases/mongodb/connect.js +0 -25
- package/dist/functions/start/databases/mongodb/index.js +0 -93
- package/dist/functions/start/databases/postgresql/checkConnection.js +0 -41
- package/dist/functions/start/databases/postgresql/connect.js +0 -27
- package/dist/functions/start/databases/postgresql/index.js +0 -106
- package/dist/functions/start/databases/redis.js +0 -0
- package/dist/functions/start/databases/startProvider.js +0 -16
- package/dist/functions/start/fileDependencyMapper.js +0 -22
- package/dist/functions/start/filesToCopy.js +0 -18
- package/dist/functions/start/generateId.js +0 -74
- package/dist/functions/start/getCodependenciesForFile.js +0 -64
- package/dist/functions/start/getFilesToBuild.js +0 -39
- package/dist/functions/start/getProcessIdFromPort.js +0 -60
- package/dist/functions/start/hmrServer.js +0 -66
- package/dist/functions/start/index.js +0 -31
- package/dist/functions/start/isWindows.js +0 -5
- package/dist/functions/start/minifyFile.js +0 -12
- package/dist/functions/start/onWarn.js +0 -63
- package/dist/functions/start/readFileDependencyMap.js +0 -16
- package/dist/functions/start/removeDeletedDependenciesFromMap.js +0 -18
- package/dist/functions/start/setComponentId.js +0 -46
- package/dist/functions/start/updateFileMap.js +0 -67
- package/dist/functions/test/index.js +0 -30
- package/dist/functions/update/index.js +0 -21
- package/dist/functions/use/index.js +0 -61
- package/dist/lib/CLILog.js +0 -49
- package/dist/lib/build/browserPathExclusions.js +0 -7
- package/dist/lib/build/browserPaths.js +0 -11
- package/dist/lib/build/buildFile.js +0 -84
- package/dist/lib/build/buildFiles.js +0 -238
- package/dist/lib/build/buildPlugins.js +0 -186
- package/dist/lib/build/getCodeFrame.js +0 -9
- package/dist/lib/build/minifyFile.js +0 -12
- package/dist/lib/build/nodePathExclusions.js +0 -7
- package/dist/lib/build/nodePaths.js +0 -11
- package/dist/lib/build/onWarn.js +0 -63
- package/dist/lib/build/removeDeletedDependenciesFromMap.js +0 -18
- package/dist/lib/build/setComponentId.js +0 -46
- package/dist/lib/build/updateFileMap.js +0 -67
- package/dist/lib/buildResolvePlugin.js +0 -21
- package/dist/lib/checkIfValidJSON.js +0 -11
- package/dist/lib/colorLog.js +0 -7
- package/dist/lib/dev/cleanup.js +0 -30
- package/dist/lib/dev/databases/mongodb/availableQueryParameters.js +0 -42
- package/dist/lib/dev/databases/mongodb/buildConnectionString.js +0 -22
- package/dist/lib/dev/databases/mongodb/buildQueryParameters.js +0 -14
- package/dist/lib/dev/databases/mongodb/checkConnection.js +0 -38
- package/dist/lib/dev/databases/mongodb/connect.js +0 -25
- package/dist/lib/dev/databases/mongodb/index.js +0 -93
- package/dist/lib/dev/databases/postgresql/checkConnection.js +0 -41
- package/dist/lib/dev/databases/postgresql/connect.js +0 -27
- package/dist/lib/dev/databases/postgresql/index.js +0 -106
- package/dist/lib/dev/databases/providerMap.js +0 -15
- package/dist/lib/dev/getCodependenciesForFile.js +0 -64
- package/dist/lib/dev/getFilesToBuild.js +0 -38
- package/dist/lib/dev/index.js +0 -452
- package/dist/lib/dev/isWindows.js +0 -5
- package/dist/lib/dev/loadSettings.js +0 -79
- package/dist/lib/dev/readFileDependencyMap.js +0 -16
- package/dist/lib/dev/requiredFiles.js +0 -18
- package/dist/lib/dev/runBuild.js +0 -30
- package/dist/lib/dev/runTests.js +0 -30
- package/dist/lib/dev/startApp.js +0 -79
- package/dist/lib/dev/startDatabases.js +0 -109
- package/dist/lib/dev/startHMR.js +0 -55
- package/dist/lib/dev/updateFileMap.js +0 -67
- package/dist/lib/dev/validateProject.js +0 -0
- package/dist/lib/dev/watchlist.js +0 -15
- package/dist/lib/filesToCopy.js +0 -18
- package/dist/lib/generateId.js +0 -74
- package/dist/lib/getArgs.js +0 -14
- package/dist/lib/getOptions.js +0 -15
- package/dist/lib/getPlatformSafePath.js +0 -7
- package/dist/lib/getProcessIdFromPort.js +0 -60
- package/dist/lib/getProvider.js +0 -8
- package/dist/lib/help.js +0 -56
- package/dist/lib/isObject.js +0 -6
- package/dist/lib/isValidJSONString.js +0 -11
- package/dist/lib/isWindows.js +0 -5
- package/dist/lib/killProcesses.js +0 -0
- package/dist/lib/loadSettings.js +0 -33
- package/dist/lib/masterIgnoreList.js +0 -16
- package/dist/lib/nodeEnvironment.js +0 -9
- package/dist/lib/nodeEnvironments.js +0 -8
- package/dist/lib/parseCookiesFromLogin.js +0 -18
- package/dist/lib/rainbowRoad.js +0 -7
- package/dist/lib/readDirectorySync.js +0 -14
- package/dist/lib/regexes.js +0 -14
- package/dist/lib/replaceBackslashesWithForwardSlashes.js +0 -8
- package/dist/lib/replaceFileProtocol.js +0 -8
- package/dist/lib/serializeQueryParameters.js +0 -8
- package/dist/lib/settings.js +0 -4
- package/dist/lib/validateDatabasesFromSettings.js +0 -34
- package/dist/lib/wait.js +0 -8
- package/release.js +0 -40
- package/src/functions/build/getTarIgnoreList.js +0 -30
- package/src/functions/build/index.js +0 -63
- package/src/functions/create/buildPackageJSON.js +0 -18
- package/src/functions/create/index.js +0 -209
- package/src/functions/create/templates/api/index.js +0 -4
- package/src/functions/create/templates/i18n/en-US.js +0 -4
- package/src/functions/create/templates/index.client.js +0 -7
- package/src/functions/create/templates/index.css +0 -20
- package/src/functions/create/templates/public/apple-touch-icon-152x152.png +0 -0
- package/src/functions/create/templates/public/favicon.ico +0 -0
- package/src/functions/create/templates/public/splash-screen-1024x1024.png +0 -0
- package/src/functions/create/templates/ui/pages/error/index.js +0 -31
- package/src/functions/create/templates/ui/pages/index/index.js +0 -94
- package/src/functions/index.js +0 -243
- package/src/functions/logout/index.js +0 -20
- package/src/functions/push/checkIfProvisionAvailable.js +0 -20
- package/src/functions/push/deploy/index.js +0 -199
- package/src/functions/push/deploy/initial.js +0 -108
- package/src/functions/push/deploy/version.js +0 -108
- package/src/functions/push/domains.js +0 -23
- package/src/functions/push/getAvailableCDN.js +0 -27
- package/src/functions/push/getDeployment.js +0 -43
- package/src/functions/push/getDeploymentSummary.js +0 -39
- package/src/functions/push/getInstanceSizeRegions.js +0 -40
- package/src/functions/push/getInstanceSizesForRegion.js +0 -35
- package/src/functions/push/getProviderInstanceSizes.js +0 -35
- package/src/functions/push/getProviderRegions.js +0 -39
- package/src/functions/push/getProvidersWithConnectionStatus.js +0 -25
- package/src/functions/push/getSessionToken.js +0 -26
- package/src/functions/push/getUserFromSessionToken.js +0 -39
- package/src/functions/push/index.js +0 -245
- package/src/functions/push/loginToCheatCode.js +0 -34
- package/src/functions/push/pingProvisionAPI.js +0 -33
- package/src/functions/push/prompts.js +0 -276
- package/src/functions/push/providerMap.js +0 -8
- package/src/functions/push/providers.js +0 -6
- package/src/functions/reset/index.js +0 -0
- package/src/functions/reset/reset.js +0 -163
- package/src/functions/start/bootstrapLayoutComponent.js +0 -57
- package/src/functions/start/bootstrapPageComponent.js +0 -54
- package/src/functions/start/buildFile.js +0 -97
- package/src/functions/start/buildFiles.js +0 -101
- package/src/functions/start/buildPlugins.js +0 -215
- package/src/functions/start/checkIfPortAvailable.js +0 -21
- package/src/functions/start/cleanup/index.js +0 -23
- package/src/functions/start/databases/mongodb/availableQueryParameters.js +0 -39
- package/src/functions/start/databases/mongodb/buildConnectionString.js +0 -28
- package/src/functions/start/databases/mongodb/buildQueryParameters.js +0 -15
- package/src/functions/start/databases/mongodb/checkConnection.js +0 -36
- package/src/functions/start/databases/mongodb/connect.js +0 -25
- package/src/functions/start/databases/mongodb/index.js +0 -108
- package/src/functions/start/databases/postgresql/checkConnection.js +0 -43
- package/src/functions/start/databases/postgresql/connect.js +0 -27
- package/src/functions/start/databases/postgresql/index.js +0 -127
- package/src/functions/start/databases/redis.js +0 -0
- package/src/functions/start/databases/startProvider.js +0 -15
- package/src/functions/start/fileDependencyMapper.js +0 -24
- package/src/functions/start/generateId.js +0 -73
- package/src/functions/start/getCodependenciesForFile.js +0 -84
- package/src/functions/start/getFilesToBuild.js +0 -49
- package/src/functions/start/getProcessIdFromPort.js +0 -92
- package/src/functions/start/hmrServer.js +0 -78
- package/src/functions/start/index.js +0 -701
- package/src/functions/start/isWindows.js +0 -3
- package/src/functions/start/minifyFile.js +0 -10
- package/src/functions/start/onWarn.js +0 -68
- package/src/functions/start/readFileDependencyMap.js +0 -19
- package/src/functions/start/removeDeletedDependenciesFromMap.js +0 -19
- package/src/functions/start/setComponentId.js +0 -58
- package/src/functions/start/updateFileMap.js +0 -100
- package/src/functions/test/index.js +0 -34
- package/src/functions/update/index.js +0 -20
- package/src/functions/use/index.js +0 -62
- package/src/lib/build/browserPathExclusions.js +0 -5
- package/src/lib/build/browserPaths.js +0 -9
- package/src/lib/build/buildFile.js +0 -91
- package/src/lib/build/buildFiles.js +0 -270
- package/src/lib/build/buildPlugins.js +0 -222
- package/src/lib/build/getCodeFrame.js +0 -7
- package/src/lib/build/minifyFile.js +0 -10
- package/src/lib/build/nodePathExclusions.js +0 -5
- package/src/lib/build/nodePaths.js +0 -9
- package/src/lib/build/onWarn.js +0 -68
- package/src/lib/build/removeDeletedDependenciesFromMap.js +0 -19
- package/src/lib/build/setComponentId.js +0 -58
- package/src/lib/build/updateFileMap.js +0 -100
- package/src/lib/buildResolvePlugin.js +0 -32
- package/src/lib/checkIfValidJSON.js +0 -8
- package/src/lib/colorLog.js +0 -5
- package/src/lib/dev/cleanup.js +0 -34
- package/src/lib/dev/databases/mongodb/buildConnectionString.js +0 -28
- package/src/lib/dev/databases/mongodb/buildQueryParameters.js +0 -15
- package/src/lib/dev/databases/mongodb/checkConnection.js +0 -40
- package/src/lib/dev/databases/mongodb/connect.js +0 -25
- package/src/lib/dev/databases/mongodb/index.js +0 -108
- package/src/lib/dev/databases/postgresql/checkConnection.js +0 -43
- package/src/lib/dev/databases/postgresql/connect.js +0 -27
- package/src/lib/dev/databases/postgresql/index.js +0 -127
- package/src/lib/dev/databases/providerMap.js +0 -13
- package/src/lib/dev/getCodependenciesForFile.js +0 -84
- package/src/lib/dev/getFilesToBuild.js +0 -47
- package/src/lib/dev/index.js +0 -560
- package/src/lib/dev/isWindows.js +0 -3
- package/src/lib/dev/loadSettings.js +0 -90
- package/src/lib/dev/readFileDependencyMap.js +0 -19
- package/src/lib/dev/runBuild.js +0 -33
- package/src/lib/dev/runTests.js +0 -33
- package/src/lib/dev/startApp.js +0 -89
- package/src/lib/dev/startDatabases.js +0 -131
- package/src/lib/dev/startHMR.js +0 -62
- package/src/lib/dev/updateFileMap.js +0 -100
- package/src/lib/dev/validateProject.js +0 -0
- package/src/lib/dev/watchlist.js +0 -13
- package/src/lib/filesToCopy.js +0 -15
- package/src/lib/generateId.js +0 -73
- package/src/lib/getArgs.js +0 -14
- package/src/lib/getOptions.js +0 -12
- package/src/lib/getProcessIdFromPort.js +0 -92
- package/src/lib/getProvider.js +0 -5
- package/src/lib/help.js +0 -56
- package/src/lib/isObject.js +0 -3
- package/src/lib/isValidJSONString.js +0 -8
- package/src/lib/killProcesses.js +0 -5
- package/src/lib/loadSettings.js +0 -40
- package/src/lib/masterIgnoreList.js +0 -13
- package/src/lib/nodeEnvironment.js +0 -6
- package/src/lib/nodeEnvironments.js +0 -8
- package/src/lib/parseCookiesFromLogin.js +0 -21
- package/src/lib/readDirectorySync.js +0 -13
- package/src/lib/regexes.js +0 -7
- package/src/lib/replaceBackslashesWithForwardSlashes.js +0 -8
- package/src/lib/replaceFileProtocol.js +0 -8
- package/src/lib/serializeQueryParameters.js +0 -5
- package/src/lib/settings.js +0 -1
- package/src/lib/validateDatabasesFromSettings.js +0 -37
- package/src/lib/wait.js +0 -5
- package/storage/.verdaccio-db.json +0 -1
- /package/{src/lib → .build}/getPlatformSafePath.js +0 -0
- /package/{src/lib → .build}/isWindows.js +0 -0
- /package/dist/{functions/create/templates → commands/create/template}/public/service-worker.js +0 -0
- /package/dist/{functions/create/templates → commands/create/template}/settings.development.json +0 -0
- /package/src/{functions/create/templates → commands/create/template}/public/service-worker.js +0 -0
- /package/src/{functions/create/templates → commands/create/template}/settings.development.json +0 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import e from"chalk";const o=()=>[{name:"session_token",type:"text",prefix:"",message:`
|
|
2
|
+
${e.yellowBright(">")} To login to Push, paste your session token below:
|
|
3
|
+
`,suffix:` ${e.yellowBright("Find your session token here:")} https://push.cheatcode.co/account/profile
|
|
4
|
+
|
|
5
|
+
`}];var t=o;export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"node-fetch";import i from"form-data";import d from"fs";import m from"lodash";import c from"./cdn_mirrors.js";const{readFile:l}=d.promises,p=async()=>{const a=(await Promise.allSettled(c?.map(async t=>{const o=new AbortController;setTimeout(()=>o.abort(),2e3);const e=await n(`${t}/api/ping`,{signal:o.signal}).catch(r=>({status:503}));return{mirror:t,status:e.status}})))?.map(t=>t.value);return m.orderBy(a,["status","mirror"])[0]},u=async(a="",t={},o="")=>{const e=await p(),r=new i;return r.append("version_tar",await l(".build/build.encrypted.tar.gz"),`${a}.tar.gz`),r.append("build_timestamp",a),r.append("domain",t?.domain),r.append("deployment_id",t?._id),n(`${e?.mirror}/api/versions`,{method:"POST",headers:{...r.getHeaders(),"x-push-session-token":o},body:r}).then(async s=>(await s.json())?.data).catch(s=>{console.warn(s)})};var y=u;export{y as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"node-fetch";const t=(a={})=>n(`${a?.push_provision_domain}/api/deployments/${a?.push_config?.domain}/validate`,{method:"POST",headers:{"Content-Type":"application/json","x-push-session-token":a?.session_token},body:JSON.stringify(a?.push_config)})?.then(async e=>(await e.json())?.data).catch(e=>{console.warn(e)});var i=t;export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"node-fetch";const o=(t={})=>n(`${t?.push_provision_domain}/api/validate/config`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t?.push_config)})?.then(async a=>(await a.json())?.data).catch(a=>{console.warn(a)});var c=o;export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"./index.js";const[r,i,...e]=process.argv,t={description:"Start an existing Joystick app.",args:{},options:{environment:{flags:{"-e":{set:!!e.includes("-e"),value:!!e.includes("-e")&&e[e.indexOf("-e")+1],parent:"start"},"--environment":{set:!!e.includes("--environment"),value:!!e.includes("--environment")&&e[e.indexOf("--environment")+1],parent:"start"}},description:"Environment to set for process.env.NODE_ENV."},port:{flags:{"-p":{set:!!e.includes("-p"),value:!!e.includes("-p")&&parseInt(e[e.indexOf("-p")+1],10),parent:"start"},"--port":{set:!!e.includes("--port"),value:!!e.includes("--port")&&parseInt(e[e.indexOf("--port")+1],10),parent:"start"}},description:"Port number to run the app on."},debug:{flags:{"-d":{set:!!e.includes("-d"),value:!!e.includes("-d"),parent:"start"},"--debug":{set:!!e.includes("--debug"),value:!!e.includes("--debug"),parent:"start"}},description:"Run the Joystick app's Node.js process in debug mode with --inspect."}},command:n};var o=t;export{o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"../../lib/development_server/index.js";const t=async(n={},e={})=>{await r({environment:e?.environment||"development",port:e?.port||2600,debug:!!e?.debug})};var m=t;export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import s from"./index.js";const[a,i,...t]=process.argv,e={description:"Start an existing Joystick app and run its tests.",args:{},options:{watch:{flags:{"-w":{set:!!t.includes("-w"),value:!!t.includes("-w"),parent:"test"},"--watch":{set:!!t.includes("--watch"),value:!!t.includes("--watch"),parent:"test"}},description:"Run joystick test in watch mode."}},command:s};var c=e;export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"../../lib/development_server/index.js";const r=async(o={},t={})=>{await e({environment:"test",process,port:1977,watch:t?.watch})};var a=r;export{a as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"./index.js";const[t,o,...e]=process.argv,a={description:"Update all Joystick packages to their latest version.",args:{},options:{release:{flags:{"-r":{set:!!e.includes("-r"),value:!!e.includes("-r")&&e[e.indexOf("-r")+1],parent:"create"},"--release":{set:!!e.includes("--release"),value:!!e.includes("--release")&&e[e.indexOf("--release")+1],parent:"create"}},description:"The release of Joystick to update (production or canary)."}},command:r};var i=a;export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"chalk";import e from"child_process";import s from"util";import c from"../../lib/color_log.js";import t from"../../lib/loader.js";const r=s.promisify(e.exec),i=async(n={},a={})=>{process.loader=new t,process.loader.print("Updating Joystick dependencies..."),process.loader.print(`Updating @joystick.js/node${a?.relase==="canary"?"-canary":""}...`),await r(`npm i @joystick.js/node${a?.relase==="canary"?"-canary":""}@latest`),process.loader.print(`Updating @joystick.js/test${a?.relase==="canary"?"-canary":""}...`),await r(`npm i @joystick.js/test${a?.relase==="canary"?"-canary":""}@latest`),process.loader.print(`Updating @joystick.js/ui${a?.relase==="canary"?"-canary":""}...`),await r(`npm i @joystick.js/ui${a?.relase==="canary"?"-canary":""}@latest`),process.loader.print(`Updating @joystick.js/cli${a?.relase==="canary"?"-canary":""}...`),await r(`npm i -g @joystick.js/cli${a?.relase==="canary"?"-canary":""}@latest`),c("\u2714 Joystick updated!","green"),process.exit(0)};var m=i;export{m as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import s from"./index.js";const[r,n,...e]=process.argv,o={description:"Decides which release of Joystick to use (production or canary).",args:{release:{set:!!e.includes("use")&&!!e[e.indexOf("use")+1],parent:"use",value:!!e.includes("use")&&e[e.indexOf("use")+1],description:"The release of Joystick to use (production or canary)."}},options:{},command:s};var t=o;export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c from"child_process";import o from"util";import n from"../../lib/loader.js";import e from"../../lib/replace_in_files.js";const s=o.promisify(c.exec),t=async(a={},r={})=>{const i=new n;a?.release==="canary"&&(await e(process.cwd(),{match:[/\.js$/],exclude:[/node_modules/],replace_regex:/(@joystick\.js\/node)(?!-)/g,replace_with:"@joystick.js/node-canary"}),await e(process.cwd(),{match:[/\.js$/],exclude:[/node_modules/],replace_regex:/(@joystick\.js\/ui)(?!-)/g,replace_with:"@joystick.js/ui-canary"}),i.print("Swapping production packages for canary versions..."),await s("npm uninstall @joystick.js/node && npm i @joystick.js/node-canary"),await s("npm uninstall @joystick.js/ui && npm i @joystick.js/ui-canary")),a?.release==="production"&&(await e(process.cwd(),{match:[/\.js$/],exclude:[/node_modules/],replace_regex:/(@joystick\.js\/node-canary)/g,replace_with:"@joystick.js/node"}),await e(process.cwd(),{match:[/\.js$/],exclude:[/node_modules/],replace_regex:/(@joystick.js\/ui-canary)/g,replace_with:"@joystick.js/ui"}),i.print("Swapping canary packages for production versions..."),await s("npm uninstall @joystick.js/node-canary && npm i @joystick.js/node"),await s("npm uninstall @joystick.js/ui-canary && npm i @joystick.js/ui"))};var y=t;export{y as default};
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
import { fileURLToPath } from "url";
|
|
4
|
-
import { dirname } from "path";
|
|
5
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
-
const __dirname = dirname(__filename);
|
|
7
|
-
const args = process.argv.slice(2, process.argv.length);
|
|
8
|
-
spawn("node", ["--no-warnings", `${__dirname}/cli.js`, ...args], { stdio: "inherit" });
|
|
2
|
+
import{spawn as r}from"child_process";import{fileURLToPath as o}from"url";import{dirname as n}from"path";const i=o(import.meta.url),e=n(i),s=process.argv.slice(2,process.argv.length);r("node",["--no-warnings",`${e}/cli.js`,...s],{stdio:"inherit"});
|
|
@@ -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,3 @@
|
|
|
1
|
+
import u from"esbuild";import d from"esbuild-plugin-svg";import s from"./plugins/index.js";import f from"./get_code_frame.js";import p from"../build/minify_file.js";import h from"./on_warn.js";import b from"../path_exists.js";const w=async(r={},e="")=>{const n=r?.errors&&r?.errors[0],o=await b(e)?await f(e,{line:n?.location?.line,column:n?.location?.column}):null;return await h({file:e,stack:r?.stack,line:n?.location?.line,column:n?.location?.column,snippet:o,lineWithError:n?.location?.lineText?.trim(),message:n?.text}),o},v=(r={})=>{const e=r?.message?.split(":");return e[2]&&e[2]?.includes("No loader")?e[3]&&e[3]?.replace(`
|
|
2
|
+
`,"")||"":e[1]&&e[1]?.replace(`
|
|
3
|
+
`,"")||""},c=async(r={})=>{const e=v(r),n=await w(r,e);return{success:!1,path:e,error:{stack:r?.stack,snippet:n}}},g=(r=[],e={})=>u.build({allowOverwrite:!0,platform:"node",format:"esm",bundle:!1,entryPoints:r?.map(n=>n.path),entryNames:"[dir]/[name]",outdir:e?.output_path||"./.joystick/build",outbase:"./",define:{"process.env.NODE_ENV":`'${e?.environment||"development"}'`},logLevel:"silent",plugins:[s.warn_node_environment,s.generate_file_dependency_map]}),y=(r=[],e={})=>u.build({allowOverwrite:!0,target:"es2020",platform:"browser",format:"esm",bundle:!0,entryPoints:r?.map(n=>n.path),entryNames:"[dir]/[name]",outbase:"./",outdir:e?.output_path||"./.joystick/build",define:{"process.env.NODE_ENV":`'${e?.environment||"development"}'`},logLevel:"silent",loader:{".svg":"text"},plugins:[s.warn_node_environment,s.generate_file_dependency_map,s.bootstrap_component,d()]}),N=async r=>{const e=[".DS_Store"],n=r?.files?.filter(t=>!e?.some(a=>t?.path?.includes(a)))?.filter(t=>t?.platform==="node"),o=r?.files?.filter(t=>!e?.some(a=>t?.path?.includes(a)))?.filter(t=>t?.platform==="browser");let l=[],i=[];n?.length>0&&(l=[await g(n,r).then(()=>({success:!0})).catch(t=>c(t))]),o?.length>0&&(i=[await y(o,r).then(()=>({success:!0})).catch(t=>c(t))]);const m=l?.some(t=>!t?.success),_=i?.some(t=>!t?.success);return m||_?Promise.reject([...l,...i]):(process.env.NODE_ENV!=="development"&&await Promise.all([...o,...n].map(t=>p(`${r?.output_path||"./.joystick/build"}/${t.path}`))),[...l,...i])};var x=N;export{x as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=[{path:"css",regex:new RegExp(/^css\//)},{path:"i18n",regex:new RegExp(/^i18n\//)},{path:"public",regex:new RegExp(/^public\//)},{path:"private",regex:new RegExp(/^private\//)},{path:"index.html",regex:new RegExp(/^index.html/)},{path:"index.css",regex:new RegExp(/^index.css/)},{path:"package.json",regex:new RegExp(/^package.json/)},{path:"package-lock.json",regex:new RegExp(/^package-lock.json/)},{path:"settings.development.json",regex:new RegExp(/^settings.development.json/)},{path:"settings.staging.json",regex:new RegExp(/^settings.staging.json/)},{path:"settings.test.json",regex:new RegExp(/^settings.test.json/)},{path:"settings.production.json",regex:new RegExp(/^settings.production.json/)},{path:".html",regex:new RegExp(/^([0-9a-zA-Z-._])+.html/)}];var t=e;export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"fs";import{codeFrameColumns as s}from"@babel/code-frame";const{readFile:a}=r.promises,m=async(t="",e={})=>{const o=await a(t,"utf-8");return s(o,{start:e})};var i=m;export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import s from"./copy_paths.js";const r=(t="")=>s.some(e=>e.regex.test(t)),c=(t="")=>t==="js",_=(t="")=>{const e=t?.split(".")?.pop(),i=c(e),o=r(t);return!i||i&&o?"copy_file":"build_file"};var p=_;export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import s from"fs";import f from"../get_files_in_path.js";import i from"./master_ignore_list.js";const{stat:p}=s.promises,c=async(l=[],r=null)=>{const n=await f("./",[]),o=r&&r==="start"?i?.filter(e=>!e.includes("settings")):i;return n.filter(e=>!l.some(t=>e.includes(t))).filter(e=>!o.some(t=>e.includes(t))).filter(e=>!s.lstatSync(e).isDirectory())};var g=c;export{g as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"./browser_path_exclusions.js";import s from"./browser_paths.js";import n from"./node_paths.js";const _=(r="")=>n.some(e=>r.includes(e)),c=(r="")=>s.some(e=>r.includes(e))&&!t.some(e=>r.includes(e)),i=(r="")=>{const e=c(r),o=_(r);if(e)return"browser";if(o)return"node"};var f=i;export{f 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,2 @@
|
|
|
1
|
+
import r from"fs";import o from"./master_ignore_list.js";const s=(e=[])=>`{${[...((r.existsSync(".gitignore")?r.readFileSync(".gitignore","utf-8"):"")?.split(`
|
|
2
|
+
`)?.filter(t=>!t?.includes("#")&&t?.trim()!=="")||[])?.map(t=>`^${t}`),...(e||[])?.map(t=>`^${t}`),...(o||[])?.map(t=>`^${t}`),"*.tar","*.tar.gz","*.tar.xz"].filter((t,i,n)=>n.indexOf(t)===i)?.map(t=>`"${t}"`).join(",")}}`;var c=s;export{c as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import u from"chalk";import b from"child_process";import g from"fs";import{dirname as h}from"path";import w from"util";import y from"./build_files.js";import $ from"./get_files_to_build.js";import x from"./get_file_operation.js";import z from"./get_path_platform.js";import k from"./get_tar_ignore_list.js";import v from"../load_settings.js";import F from"../loader.js";import _ from"../path_exists.js";import j from"../../lib/encrypt_buffer.js";const{mkdir:B,copyFile:P,readFile:A,writeFile:L}=g.promises,l=w.promisify(b.exec),q=(r=[])=>r?.map(e=>({path:e,operation:x(e),platform:z(e)})),C=async(r={})=>{const e=new F,o=r?.type||"tar",n=r?.environment||"production";e.print(`Building app to ${o} for ${n}...`);const c=await v(n),f=c?.config?.build?.excluded_paths||c?.config?.build?.excludedPaths,s=await $(f),i=o==="tar"?".build/.tar":".build",p=q(s);await _(".build")&&await l("rm -rf .build");const d=p?.filter(t=>t?.operation==="copy_file"),m=p?.filter(t=>t?.operation==="build_file");for(let t=0;t<d?.length;t+=1){const a=d[t];await B(h(`${i}/${a?.path}`),{recursive:!0}),await P(a?.path,`${i}/${a?.path}`)}if(await y({files:m,environment:n,output_path:i}).catch(t=>{console.warn(t)}),o==="tar"){const t=k(c?.config?.build?.excludedPaths);await l(`cd ${i} && tar --exclude=${t} -czf ../build.tar.gz .`),await l(`rm -rf ${i}`)}if(o==="tar"&&r?.encrypt_build){const t=i?.replace("/.tar","/build.tar.gz"),a=j(await A(t),r?.encryption_key);await L(".build/build.encrypted.tar.gz",a)}r?.silence_confirmation||console.log(u.greenBright(`
|
|
2
|
+
\u2714 App built as ${o} to ${o==="tar"?i?.replace("/.tar","/build.tar.gz"):i}!
|
|
3
|
+
`)),await _(".build/component_id_cache.json")&&await l("rm -rf .build/component_id_cache.json")};var U=C;export{U as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t=[".build",".DS_Store",".git",".joystick/build",".joystick/data",".push","node_modules","settings.development.json","settings.staging.json","settings.production.json"];var s=t;export{s as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"fs";import f from"esbuild";import r from"../path_exists.js";const{readFile:s,writeFile:a}=o.promises,m=async(i="")=>{if(await r(i)){const t=await s(i,"utf-8"),e=await f.transform(t,{minify:!0});await a(i,e.code)}};var d=m;export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./get_platform_safe_path.js";const s=[e("api/"),e("cronJobs/"),e("cron_jobs/"),e("fixtures/"),e("lib/node"),e("queues/"),e("routes/"),e("tests/"),e("uploaders/"),e("websockets/"),"index.server.js"];var t=s;export{t as default};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import l from"chalk";import s from"../constants.js";import c from"./get_code_frame.js";import t from"../rainbow_road.js";const n=(o="")=>o.replace(s.OBJECT_REGEX,""),i=(o={})=>{const e=o?.snippet?.split(`
|
|
2
|
+
`);console.log(`
|
|
3
|
+
`),console.log(`${t()}
|
|
4
|
+
`),o.file&&console.log(l.yellowBright(`Build Error in ${o?.file}:
|
|
5
|
+
`)),e&&e.length>0&&e.forEach(r=>r.includes(`> ${o.line} |`)?console.log(` ${l.red(r)}`):console.log(` ${l.gray(r)}`)),o?.stack&&(console.log(l.magentaBright(`
|
|
6
|
+
Stack Trace:
|
|
7
|
+
`)),console.log(l.yellow(` ${n(o?.stack)}
|
|
8
|
+
`))),process.loader.error("Build error. Fix the error above to continue building your app."),console.log(`
|
|
9
|
+
`),console.log(`${t()}
|
|
10
|
+
`)},a=async(o={},e="")=>e&&e==="BUILD_ERROR"?{file:o?.file,snippet:o?.snippet?await c(o.file,{line:o?.line,column:o?.column}):"",stack:o?.stack,line:o?.line,character:o?.column,message:o?.message}:null,f=async o=>{const e=await a(o,"BUILD_ERROR");return e&&i(e),e};var d=f;export{d as default};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import"chalk";import k from"fs";import r from"../../get_platform_safe_path.js";import c from"../../constants.js";import j from"./set_component_id.js";import E from"../../path_exists.js";const{readFile:f,writeFile:g}=k.promises,x=(t="",o=[])=>{for(let _=0;_<o?.length;_+=1){const n=o[_];t=t.replace(`%example:${_}%`,n)}},$=(t="",o="",_="")=>t.replace(`${o};`,`if (
|
|
2
|
+
typeof window !== 'undefined' &&
|
|
3
|
+
window.__joystick_should_auto_mount__ === true &&
|
|
4
|
+
!window.__joystick_layout_url__ &&
|
|
5
|
+
window.__joystick_page_url__ &&
|
|
6
|
+
!window.__joystick_hmr_update__ &&
|
|
7
|
+
joystick &&
|
|
8
|
+
joystick.mount
|
|
9
|
+
) {
|
|
10
|
+
joystick.mount(${_}, window.__joystick_ssr_props__ || {}, document.getElementById('app'));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export default ${_};
|
|
14
|
+
`),O=(t="",o="",_="")=>t.replace(`${o};`,`if (
|
|
15
|
+
typeof window !== 'undefined' &&
|
|
16
|
+
window.__joystick_should_auto_mount__ === true &&
|
|
17
|
+
window.__joystick_layout_url__ &&
|
|
18
|
+
window.__joystick_page_url__ &&
|
|
19
|
+
!window.__joystick_hmr_update__ &&
|
|
20
|
+
joystick &&
|
|
21
|
+
joystick.mount
|
|
22
|
+
) {
|
|
23
|
+
(async () => {
|
|
24
|
+
const layout_component_file = await import(window.__joystick_layout_url__);
|
|
25
|
+
const page_component_file = await import(window.window.__joystick_page_url__);
|
|
26
|
+
const layout = layout_component_file.default;
|
|
27
|
+
const page = page_component_file.default;
|
|
28
|
+
joystick.mount(layout, Object.assign({ ...window.__joystick_ssr_props__ }, { page }), document.getElementById('app'));
|
|
29
|
+
})();
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export default ${_};
|
|
33
|
+
`),X=(t="")=>t.replace(c.JOYSTICK_COMMENT_REGEX,""),y=(t="")=>{let o=0;return t.replace(c.EXAMPLE_CODE_REGEX,()=>`%example:${o++}%`)},w=(t="")=>t.match(c.EXAMPLE_CODE_REGEX)||[],P=(t=null)=>(t&&t.split(" ")||[])?.pop(),R=(t=!1,o=null)=>t&&!!o,C=(t="")=>{const o=t.match(c.EXPORT_DEFAULT_REGEX)||[];return o&&o[0]},h=(t="")=>{const o=t.match(c.JOYSTICK_UI_REGEX)||[];return!!o&&!!o[0]},u=(t="",o={})=>[r(t)].some(_=>o.path.includes(_)),G=(t="")=>[r("ui/"),r("email/")].some(o=>t.includes(o)),I=(t={})=>{t.onLoad({filter:/\.js$/},async(o={})=>{const _=u("ui/layouts",o),n=u("ui/pages",o),p=u("email/",o);if(_||n||p){let e=await f(r(o.path),"utf-8");const l=h(e),i=C(e),s=R(l,i),m=w(e),a=P(i);return e=y(e),e=X(e),e=a&&_?O(e,i,a):e,e=a&&n?$(e,i,a):e,x(e,m),{contents:e,loader:"js"}}}),t.onEnd(()=>new Promise(async o=>{for(let _=0;_<t?.initialOptions?.entryPoints?.length;_+=1){const n=t?.initialOptions?.entryPoints[_],p=G(n),d=await E(`${t?.initialOptions?.outdir}/${n}`);if(p&&d){let e=await f(`${t?.initialOptions?.outdir}/${n}`,"utf-8");const l=h(e),i=w(e);if(e=y(e),l){e=await j(e);for(let s=0;s<i?.length;s+=1){const m=i[s];e=e.replace(`%example:${s}%`,m)}await g(`${t?.initialOptions?.outdir}/${n}`,e)}}}o()}))};var B=I;export{B as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import p from"fs";import o from"../../get_platform_safe_path.js";import m from"./update_file_map.js";const{readFile:n}=p.promises,s=(a={})=>{a.onLoad({filter:/\.js$/},async e=>{if(!["node_modules",".joystick","?","commonjsHelpers.js"].some(t=>o(e.path).includes(t))){const t=await n(o(e.path),"utf-8");await m(o(e.path),t)}})};var c=s;export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import n from"./bootstrap_component.js";import o from"./generate_file_dependency_map.js";import t from"./warn_node_environment.js";const p={bootstrap_component:{name:"bootstrap_component",setup(e){n(e)}},generate_file_dependency_map:{name:"generate_file_dependency_map",setup(e){o(e)}},warn_node_environment:{name:"warn_node_environment",setup(e){t(e)}}};var a=p;export{a as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import _ from"fs";import a from"../../generate_id.js";import r from"../../path_exists.js";const{readFile:p,writeFile:m}=_.promises,d=async(t=[],n={},o="")=>{for(let e=0;e<t.length;e+=1){const c=t[e];n[c.path]=c.component_id,await m(o,JSON.stringify(n))}},u=(t=[],n="")=>{let o=n;for(let e=0;e<t.length;e+=1){const c=t[e],i=c.source.replace(/\.component\(\{+(?!\n + _componentId)/g,()=>`.component({
|
|
2
|
+
_componentId: '${c.component_id}',`);o=o.replace(c.source,i)}return o},h=(t="",n=[],o={})=>n?.map((e,c)=>{const i=n[c+1],s=e.path.replace("// ","");return{path:s,component_id:o[s]||a(16),index:e.index,source:t.substring(e.index,i?i.index:t.length)}}),l=(t="")=>[...t?.matchAll(/\/\/ ui+.*/gi),...t?.matchAll(/\/\/ email+.*/gi)].map(n=>({path:n[0],index:n.index})),g=async(t="")=>{if(await r(t)){const o=await p(t,"utf-8");return JSON.parse(o)}return{}},x=()=>["development","test"].includes(process.env.NODE_ENV)?"./.joystick/build/component_id_cache.json":"./.build/component_id_cache.json",f=async(t="")=>{const n=x(),o=await g(n),e=l(t),c=h(t,e,o),i=u(c,t);return await d(c,o,n),i};var j=f;export{j as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import i from"fs";import l,{dirname as u}from"path";import*as d from"acorn";import f from"../../path_exists.js";const{readFile:S,writeFile:D}=i.promises,y=(r="",t={})=>(t?.body?.filter(e=>{const s=e&&e.type,n=e&&e.declarations||[],o=s==="VariableDeclaration",p=n.some(c=>{const _=c.type==="VariableDeclarator",m=c?.init?.callee?.name;return _&&m==="require"});return o&&p})).map(e=>{const s=e.declarations,n=s&&s[0],o=n?.init?.arguments[0]&&n.init.arguments[0]?.value;return{absolute_path:o?l.resolve(u(r),o):null}}),b=(r="",t={})=>(t?.body?.filter(({type:e})=>e==="ImportDeclaration")||[]).map(e=>({path:e?.source?.value,absolute_path:l.resolve(u(r),e?.source?.value)})),v=(r="",t={})=>{const a=b(r,t),e=y(r,t);return{imports:a,requires:e}},q=(r="")=>d.parse(r,{ecmaVersion:"latest",sourceType:"module"}),g=async()=>{const r=".joystick/build/file_map.json";if(await f(r)){const t=i.readFileSync(r,"utf-8");return t?JSON.parse(t):{}}return{}},h=async(r="",t="")=>{try{const a=await g(),e=q(t),s=e?v(r,e):[];a[r]=s,i.writeFileSync(".joystick/build/file_map.json",JSON.stringify(a,null,2))}catch{}};var V=h;export{V as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import n from"fs";import t from"chalk";const{readFile:r}=n.promises,a=(e={})=>{e.onLoad({filter:/\.js$/},async(o={})=>{(await r(o.path,"utf-8"))?.match(/process.env.NODE_ENV\s+=\s/gi)?.length&&console.warn(t.yellowBright(`
|
|
2
|
+
[WARNING] process.env.NODE_ENV should only be set via a CLI flag in development or via external environment variables in production.
|
|
3
|
+
`))})};var c=a;export{c as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import e from"chalk";import n from"./log_bars.js";const t=(g="",l={})=>{const d={info:"blue",success:"green",warning:"yellowBright",danger:"red"},r={info:"\u2771 Info",success:"\u2771 Ok",warning:"\u2771 Warning",danger:"\u2771 Error"},a=l.level?d[l.level]:"gray",$=l.level?r[l.level]:"Log",s=l.docs||"https://docs.cheatcode.co/joystick";if(console.log(`
|
|
2
|
+
${l.padding||""}${n()}
|
|
3
|
+
`),console.log(`${l.padding||""}${e[a](`${$}:`)}
|
|
4
|
+
`),console.log(`${l.padding||""}${e.white(g)}
|
|
5
|
+
`),console.log(`${l.padding||""}${e.grey("---")}
|
|
6
|
+
`),console.log(`${l.padding||""}${e.white("Relevant Documentation:")}
|
|
7
|
+
`),console.log(`${l.padding||""}${e.blue(s)}
|
|
8
|
+
`),console.log(`${l.padding||""}${e.white("Stuck? Ask a Question:")}
|
|
9
|
+
`),console.log(`${l.padding||""}${e.blue("http://discord.cheatcode.co")}
|
|
10
|
+
`),l.tools&&Array.isArray(l.tools)){console.log(`${l.padding||""}${e.white("Helpful Tools:")}
|
|
11
|
+
`);for(let o=0;o<l?.tools?.length;o+=1){const c=l?.tools[o];console.log(`${l.padding||""}${e.blue(`${c.title} \u2014 ${c.url}`)}
|
|
12
|
+
`)}}console.log(`${l.padding||""}${n()}
|
|
13
|
+
`)};var h=t;export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import r from"chalk";const t=(o="",l="blueBright")=>console.log(r[l](o));var c=t;export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import t from"child_process";import c from"util";const s=c.promisify(t.exec),n=(e="")=>{const r=process.platform==="win32"?"where":"whereis";return s(`${r} ${e}`).then(()=>!0).catch(o=>(console.warn(o),!1))};var a=n;export{a as default};
|
package/dist/lib/constants.js
CHANGED
|
@@ -1,4 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
constants_default as default
|
|
4
|
-
};
|
|
1
|
+
const E={EXAMPLE_CODE_REGEX:new RegExp(/\<example\>[^%]+\<\/example\>/g),EXPORT_DEFAULT_REGEX:new RegExp(/export default [a-zA-Z0-9]+/g),JOYSTICK_COMMENT_REGEX:new RegExp(/\<\!\-\-(.|\n|\r)*?-->/g),JOYSTICK_COMPONENT_REGEX:new RegExp(/\.component\(\{/g),JOYSTICK_UI_REGEX:new RegExp(/joystick-ui-test|joystick.js\/ui-canary|joystick.js\/ui/g),OBJECT_REGEX:new RegExp(/{([^;]*)}/g),SETTINGS_FILE_NAME_REGEX:new RegExp(/settings\.+[a-z]+\.json/g)};var e=E;export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=(()=>{let e=0;return(t,o)=>{clearTimeout(e),e=setTimeout(t,o)}})();var u=r;export{u as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c from"crypto";const a=(e,r)=>{const i=e.slice(0,16),s=e.slice(16),o=c.createHash("sha256").update(r).digest("hex").substring(0,32),t=c.createDecipheriv("aes256",o,i);return Buffer.concat([t.update(s),t.final()])};var p=a;export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e={files:["tests/**/*.test.js"],ignoredByWatcher:[".joystick","./uploads"],concurrency:1,cache:!1};var c=e;export{c as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import c from"net";const t=(e={})=>{e.end(),e.destroy(),e.unref()},r=(e=2600)=>new Promise(o=>{const n=new c.Socket;n.once("connect",()=>{t(n),o(!0)}),n.once("error",()=>{t(n),o(!1)}),n.connect({port:e,host:"127.0.0.1"},function(){})});var f=r;export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import o from"./kill_process_ids.js";process.title="joystick_cleanup",process.on("message",async s=>{const e=JSON.parse(s)?.process_ids;o(e),process.exit()});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=["replicaSet","tls","ssl","tlsCertificateKeyFile","tlsCertificateKeyFilePassword","tlsCAFile","tlsAllowInvalidCertificates","tlsAllowInvalidHostnames","tlsInsecure","connectTimeoutMS","socketTimeoutMS","compressors","zlibCompressionLevel","maxPoolSize","minPoolSize","maxIdleTimeMS","waitQueueMultiple","waitQueueTimeoutMS","w","wtimeoutMS","journal","readConcernLevel","readPreference","maxStalenessSeconds","readPreferenceTags","authSource","authMechanism","authMechanismProperties","gssapiServiceName","localThresholdMS","serverSelectionTimeoutMS","serverSelectionTryOnce","heartbeatFrequencyMS","appName","retryReads","retryWrites","uuidRepresentation"];var t=e;export{t as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import m from"./build_query_parameters.js";import p from"../../../serialize_query_parameters.js";import $ from"../../../types.js";const u=(r={})=>{let s="mongodb://";r&&(r.username||r.password)&&(s=`${s}${r.username||r.password?`${r.username||""}${r.username&&r.password?":":""}${r.password||""}@`:""}`),r&&r.hosts&&$.is_array(r.hosts)&&(s=`${s}${r.hosts.map(e=>`${e.hostname}:${e.port}`).join(",")}`),r&&r.database&&(s=`${s}/${r.database}`);const a=m(r);return Object.keys(a)?.length>0&&(s=`${s}?${p(a)}`),s};var f=u;export{f as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import l from"./available_query_parameters.js";const u=(r={})=>{const t={};for(let e=0;e<l.length;e+=1){const a=l[e];r&&r[a]&&(t[a]=r[a])}return t};var m=u;export{m as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{MongoClient as t}from"mongodb";import i from"fs";import r from"./build_connection_string.js";import s from"../../../color_log.js";const{readFile:a}=i.promises,l=async(e={},n={})=>{const c=r(e);try{const o={connectTimeoutMS:3e3,socketTimeoutMS:3e3,useNewUrlParser:!0,useUnifiedTopology:!0,ssl:!1,...n||{}};return n?.ca&&(o.ca=await a(n?.ca)),(await t.connect(c,o)).close(),!0}catch(o){console.warn(o),s(`
|
|
2
|
+
\u2716 Failed to connect to MongoDB. Please double-check connection settings and try again.`,"yellow"),process.exit(1)}};var d=l;export{d as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./check_connection.js";import a from"./index.js";const t=async(n={},c=2610)=>{const o=n.connection&&Object.keys(n.connection).length>0;return o&&await e(n.connection,n.options),{pid:o?null:await a(c),connection:o?n.connection:{hosts:[{hostname:"127.0.0.1",port:c}],database:"app",username:"",password:""}}};var m=t;export{m as default};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import e from"child_process";import m from"fs";import _ from"../../../cli_log.js";import g from"../../../command_exists.js";import p from"../../../get_platform_safe_path.js";import l from"../../../get_process_id_from_port.js";import f from"../../../kill_port_process.js";import a from"../../../path_exists.js";const{rename:u,readdir:w,mkdir:y}=m.promises,b=()=>{_(` MongoDB is not installed on this computer.
|
|
2
|
+
|
|
3
|
+
Download MongoDB at https://www.mongodb.com/try/download/community
|
|
4
|
+
|
|
5
|
+
After you've installed MongoDB, run joystick start again, or, remove MongoDB from your config.databases array in your settings.development.json file to skip starting it up.`,{level:"danger",docs:"https://github.com/cheatcode/joystick#databases"})},h=async()=>{if(process.platform==="win32"){const o=await i();return o&&o.length>0}return g("mongod")},i=async()=>await w("C:\\Program Files\\MongoDB\\Server\\"),k=(o=[])=>process.platform==="win32"&&["6.0","7.0","8.0","9.0","10.0"].some(t=>o.includes(t))?"mongosh":"mongo",v=(o=2610,s=[])=>new Promise(t=>{const n=["--port",o,"--dbpath",p(`./.joystick/data/mongodb_${o}`),"--quiet","--replSet",`joystick_${o}`];e.spawn("mongod",n.filter(r=>!!r)).stdout.on("data",async r=>{if((r?.toString()).includes("Waiting for connections")){const c=k(s);e.exec(`${c} --eval "rs.initiate()" --verbose --port ${o}`,async(B,M,S)=>{const d=await l(o);return t(parseInt(d,10))})}})}),x=async(o=2610)=>{const s=await a(".joystick/data/mongodb"),t=await a(`.joystick/data/mongodb_${o}`);return s&&!t&&await u(".joystick/data/mongodb",`.joystick/data/mongodb_${o}`),t||await y(`.joystick/data/mongodb_${o}`,{recursive:!0}),t},j=async(o=2610)=>{const s=await h(),t=process.platform==="win32"?await i():null;s||(b(),process.exit(1)),await x(o);try{return await f(o),await v(o,t)}catch(n){console.warn(n),process.exit(1)}};var E=j;export{E as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import a from"fs";import c from"pg";import n from"../../../color_log.js";const{Client:l}=c,{readFile:i}=a.promises,p=(s={})=>new Promise((t,e)=>{s.query("SELECT NOW()",o=>{o?e():t(),s.end()})}),d=async(s={},t={})=>{try{const e=s?.hosts&&s?.hosts[0],o={user:s?.username,host:e?.hostname,database:s?.database,password:s?.password,port:e?.port};t?.ssl?.ca&&(o.ssl={ca:await i(t?.ssl?.ca)});const r=new l(o);return r.connect(),await p(r),!0}catch(e){console.warn(e),n(`
|
|
2
|
+
\u2716 Failed to connect to PostgreSQL. Please double-check connection settings and try again.`,"yellow"),process.exit(1)}};var h=d;export{h as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"os";import t from"./check_connection.js";import a from"./index.js";const r=async(o={},c=2610)=>{try{const n=o.connection&&Object.keys(o.connection).length>0;return n&&await t(o.connection,o.options),{pid:n?null:await a(c),connection:n?o.connection:{hosts:[{hostname:"127.0.0.1",port:c}],database:"app",username:(e.userInfo()||{}).username||"",password:""}}}catch(n){console.warn(n)}};var m=r;export{m as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import g from"child_process";import w from"fs";import h from"util";import m from"../../../cli_log.js";import y from"../../../command_exists.js";import x from"../../../get_platform_safe_path.js";import f from"../../../get_process_id_from_port.js";import"../../../kill_port_process.js";import u from"../../../path_exists.js";const c=h.promisify(g.exec),{rename:q}=w.promises,k=async(t=2610)=>{const n=await u(".joystick/data/postgresql");let s=await u(`.joystick/data/postgresql_${t}`);return n&&!s&&(await q(".joystick/data/postgresql",`.joystick/data/postgresql_${t}`),s=!0),s},j=()=>{m("PostgreSQL is not installed on this computer. You can download PostgreSQL at https://www.postgresql.org/download. After you've installed PostgreSQL, run joystick start again, or, remove PostgreSQL from your databases list in your settings.development.json file to skip startup.",{level:"danger",docs:"https://cheatcode.co/docs/joystick/cli#databases"})},b=()=>y("psql"),P=()=>y("pg_ctl"),L=async(t=2610)=>{await b()||(j(),process.exit(1));const s=await P();s||m("PostgreSQL is installed on this computer, but pg_ctl (what Joystick uses to start and manage PostgreSQL) is not in your command line's PATH variable. Add pg_ctl to your command line's PATH, restart your command line, and try again.",{level:"danger",docs:"https://cheatcode.co/docs/joystick/postgresql#path"});try{!await k(t)&&s&&await c(`pg_ctl init -D .joystick/data/postgresql_${t}`);const o=t,l=parseInt(await f(o),10);l&&await c(`pg_ctl kill KILL ${l}`);const d=g.spawn("pg_ctl",["-o",`"-p ${o}"`,"-D",x(`.joystick/data/postgresql_${t}`),"start"].filter(e=>!!e));return new Promise(e=>{d.stderr.on("data",async r=>{const i=r?.toString();i?.includes("another server might be running")||console.warn(i)}),d.stdout.on("data",async r=>{if((r?.toString()).includes("database system is ready to accept connections")){const _=(await f(o))?.replace(`
|
|
2
|
+
`,"");c(`createdb -h 127.0.0.1 -p ${o} app`).then(a=>{e(parseInt(_,10))}).catch(({stderr:a})=>{a&&a.includes('database "app" already exists')?e(parseInt(_,10)):console.log(a)})}})})}catch(p){console.warn(p),process.exit(1)}};var K=L;export{K 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 E from"fs";import"os";import w,{dirname as O}from"path";import{fileURLToPath as k}from"url";import b from"util";import g 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 u from"../kill_port_process.js";import h from"../load_settings.js";import x from"../loader.js";import _ from"../path_exists.js";import y from"../required_files.js";import j from"./start_app_server.js";import $ from"./start_databases.js";import D from"./start_hmr_server.js";import T from"./watch_for_changes/index.js";import R from"../constants.js";import I from"./kill_process_ids.js";import H from"./run_tests.js";const{stat:C}=E.promises,M=b.promisify(m.exec),d=parseInt(process?.version?.split(".")[0]?.replace("v",""),10),A=k(import.meta.url),f=O(A),l=[],P=async(s=!1)=>{const e=p();await H({watch:s,__dirname:f,process_ids:[...l,...e],cleanup_process:process.cleanup_process})},V=(s=[],e=0,t="")=>{const r=["--no-warnings"];e<19&&r.push("--experimental-specifier-resolution=node");const o=m.fork(w.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()})},L=async(s=[])=>{const e=s?.find(a=>a?.path?.match(R.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")),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}))},q=(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,v(s,e,t))})},G=()=>{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"})})},J=(s=0,e="",t=!1,r={})=>{process.hmr_server_process=D(s,e),l.push(process.hmr_server_process?.pid),G(),q(s,t,r)},U=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},v=async(s=0,e=!1,t=null)=>{if(await U(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"}),I([process.hmr_server_process?.pid,process.app_server_process?.pid,...o]),process.exit(0)}else await u(process.env.PORT),N(s,e)},F=(s=!1)=>{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"&&P(s)}),process.app_server_process.stderr.on("data",e=>{n(e.toString(),{level:"danger",docs:"https://cheatcode.co/docs/joystick"})})},N=(s=0,e=!1)=>{process.app_server_process=j(s,e),l.push(process.app_server_process?.pid),F(e),process.app_server_restarting=!1},B=(s={},e=2600)=>{process.title=s?.environment==="test"?"joystick_test":"joystick",process.loader=new x,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},z=(s=2600)=>{n(`Port ${s} is already occupied. To start Joystick on this port, clear it and try again.`,{level:"danger"}),process.exit(0)},X=(s=2600)=>parseInt(s||2600,10),K=async()=>{const s=S(`${process.cwd()}/.joystick/build`);await _(s)&&await M(`${process.platform==="win32"?"rmdir /s /q":"rm -rf"} ${s}`)},Q=async()=>{const s=[];for(let e=0;e<y?.length;e+=1){const t=y[e],r=await _(`${process.cwd()}/${t.path}`),o=r&&await C(`${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)}},W=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))},Y=async(s={})=>{await W(),await Q(),await K();const e=X(s?.port),t=await g(e),r=await g(e+1);t&&z(e),r&&u(e),B(s,e);const o=await h(process.env.NODE_ENV);await $({environment:process.env.NODE_ENV,port:e,settings:o}),T({hot_module_reload:(c=[])=>L(c),restart_app_server:(c=[])=>v(d,s?.watch,o),start_app_server:()=>N(d,s?.watch),start_hmr_server:s?.environment!=="test"?()=>J(d,f,s?.watch,o):null},{custom_copy_paths:o?.config?.build?.copy_paths?.map(c=>({path:c}))||[]}),V(l,d,f)};var Os=Y;export{Os 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 c from"../../constants.js";import e from"../../get_platform_safe_path.js";const l=(s="")=>{const t=s==="index.html",_=s==="index.client.js",i=s.includes(e("lib/"))&&!s.includes(e("lib/node")),n=s.includes("i18n"),r=s.match(c.SETTINGS_FILE_NAME_REGEX)?.length>0,o=s.includes(e("ui/"))||s==="index.css"||t||_||i;return process.hmr_server_process&&process.hmr_server_process.has_connections&&(o||n||r)||!1?["hot_module_reload"]:["restart_app_server"]};var p=l;export{p as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import m from"./read_file_dependency_map.js";import u from"../../path_exists.js";import _ from"../../get_platform_safe_path.js";const c=(t="",a={})=>Object.entries(a).filter(([s,r])=>{const i=r&&r.imports&&r.imports.some(e=>e.absolute_path.includes(t)),o=r&&r.requires&&r.requires.some(e=>e.absolute_path.includes(t));return i||o}).map(([s])=>s.replace(_(`${process.cwd()}/`),"")),l=async(t="")=>{const a=await m(),s=c(t,a);return Promise.all(s.filter(r=>u(r)))};var h=l;export{h 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 g from"../../debounce.js";import c from"./get_after_run_tasks.js";import k from"./get_file_codependencies.js";import p from"../../build/get_file_operation.js";import v 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,n=async(e={},a={})=>{const s=process.initial_build_complete?await k(e?.path):[];if(a?.is_build_file&&await y({files:[{path:e?.path,platform:v(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")}),s?.length>0)for(let r=0;r<s?.length;r+=1){const t=s[r];await n({path:t},a)}return Promise.resolve()},D=async(e={})=>{switch(e?.operation){case"add_directory":return l(`.joystick/build/${e?.path}`,{recursive:!0});case"build_file":return n(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}`),n(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}),n(e,{is_build_file:!1});default:return!0}},O=(e={})=>({operation:e?.event,path:e?.path,after_run_tasks:process.initial_build_complete?c(e?.path):["start_app_server","start_hmr_server"]}),$=(e={})=>({operation:e?.event,path:e?.path,after_run_tasks:process.initial_build_complete?c(e?.path):["start_app_server","start_hmr_server"]}),E=(e={})=>({operation:e?.event,path:e?.path,after_run_tasks:process.initial_build_complete?c(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?c(e?.path):["start_app_server","start_hmr_server"]}),I=(e={})=>({operation:e?.is_custom_copy_path?"copy_file":p(e?.path),path:e?.path,after_run_tasks:process.initial_build_complete?c(e?.path):["start_app_server","start_hmr_server"]}),L=(e={})=>{switch(e?.event){case"add_file":return I(e);case"change_file":return B(e);case"delete_file":return E(e);case"add_directory":return $(e);case"delete_directory":return O(e)}},S=async(e=[],a={})=>{try{const s=new Set([]);for(let t=0;t<e?.length;t+=1){const i=e[t],_=L(i);if(await D(_),_?.after_run_tasks)for(let o=0;o<_?.after_run_tasks?.length;o+=1){const d=_?.after_run_tasks[o];s.add(d)}}const r=Array.from(s);for(let t=0;t<r?.length;t+=1){const i=r[t];w.is_function(a[i])&&await a[i](e)}}catch{}},U=(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"}},x=(e={},a={})=>{const s=f.watch([...R,...a?.custom_copy_paths||[]].map(({path:t})=>t),{ignored:".joystick"});let r=[];process.initial_build_complete=!1,s.on("error",t=>console.error(t)),s.on("all",(t,i)=>{r.push({event:U(t),path:i,is_custom_copy_path:a?.custom_copy_paths?.length?a?.custom_copy_paths.some(_=>i.includes(_?.path)):!1}),g(async()=>{await S(r,e),process.initial_build_complete=!0,r=[]},100)})};var M=x;export{M as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import e from"./get_platform_safe_path.js";var o=[e("api/"),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:"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 e=a;export{e as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const a=async(t="")=>(await import(t))?.default;var i=a;export{i 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};
|
package/dist/lib/loader.js
CHANGED
|
@@ -1,82 +1,2 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
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};
|