firebase-tools-with-isolate 12.9.1-1
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/LICENSE +21 -0
- package/README.md +48 -0
- package/lib/accountExporter.js +207 -0
- package/lib/accountImporter.js +305 -0
- package/lib/api.js +84 -0
- package/lib/apiv2.js +353 -0
- package/lib/appdistribution/client.js +193 -0
- package/lib/appdistribution/distribution.js +51 -0
- package/lib/appdistribution/options-parser-util.js +51 -0
- package/lib/archiveDirectory.js +120 -0
- package/lib/auth.js +535 -0
- package/lib/bin/firebase.js +132 -0
- package/lib/checkMinRequiredVersion.js +14 -0
- package/lib/checkValidTargetFilters.js +46 -0
- package/lib/command.js +250 -0
- package/lib/commands/appdistribution-distribute.js +121 -0
- package/lib/commands/appdistribution-group-create.js +19 -0
- package/lib/commands/appdistribution-group-delete.js +24 -0
- package/lib/commands/appdistribution-testers-add.js +24 -0
- package/lib/commands/appdistribution-testers-remove.js +40 -0
- package/lib/commands/apps-android-sha-create.js +29 -0
- package/lib/commands/apps-android-sha-delete.js +16 -0
- package/lib/commands/apps-android-sha-list.js +42 -0
- package/lib/commands/apps-create.js +166 -0
- package/lib/commands/apps-list.js +53 -0
- package/lib/commands/apps-sdkconfig.js +103 -0
- package/lib/commands/auth-export.js +44 -0
- package/lib/commands/auth-import.js +114 -0
- package/lib/commands/crashlytics-mappingfile-generateid.js +26 -0
- package/lib/commands/crashlytics-mappingfile-upload.js +46 -0
- package/lib/commands/crashlytics-symbols-upload.js +78 -0
- package/lib/commands/database-get.js +122 -0
- package/lib/commands/database-import.js +85 -0
- package/lib/commands/database-instances-create.js +29 -0
- package/lib/commands/database-instances-list.js +53 -0
- package/lib/commands/database-profile.js +46 -0
- package/lib/commands/database-push.js +63 -0
- package/lib/commands/database-remove.js +42 -0
- package/lib/commands/database-rules-canary.js +24 -0
- package/lib/commands/database-rules-get.js +22 -0
- package/lib/commands/database-rules-list.js +36 -0
- package/lib/commands/database-rules-release.js +24 -0
- package/lib/commands/database-rules-stage.js +26 -0
- package/lib/commands/database-set.js +68 -0
- package/lib/commands/database-settings-get.js +44 -0
- package/lib/commands/database-settings-set.js +46 -0
- package/lib/commands/database-update.js +69 -0
- package/lib/commands/deploy.js +101 -0
- package/lib/commands/emulators-exec.js +19 -0
- package/lib/commands/emulators-export.js +14 -0
- package/lib/commands/emulators-start.js +115 -0
- package/lib/commands/experimental-functions-shell.js +13 -0
- package/lib/commands/experiments-describe.js +31 -0
- package/lib/commands/experiments-disable.js +28 -0
- package/lib/commands/experiments-enable.js +28 -0
- package/lib/commands/experiments-list.js +29 -0
- package/lib/commands/ext-configure.js +110 -0
- package/lib/commands/ext-dev-deprecate.js +68 -0
- package/lib/commands/ext-dev-init.js +148 -0
- package/lib/commands/ext-dev-list.js +47 -0
- package/lib/commands/ext-dev-publish.js +32 -0
- package/lib/commands/ext-dev-register.js +50 -0
- package/lib/commands/ext-dev-undeprecate.js +57 -0
- package/lib/commands/ext-dev-upload.js +88 -0
- package/lib/commands/ext-dev-usage.js +141 -0
- package/lib/commands/ext-export.js +68 -0
- package/lib/commands/ext-info.js +118 -0
- package/lib/commands/ext-install.js +167 -0
- package/lib/commands/ext-list.js +18 -0
- package/lib/commands/ext-uninstall.js +29 -0
- package/lib/commands/ext-update.js +105 -0
- package/lib/commands/ext.js +41 -0
- package/lib/commands/firestore-databases-create.js +55 -0
- package/lib/commands/firestore-databases-delete.js +39 -0
- package/lib/commands/firestore-databases-get.js +25 -0
- package/lib/commands/firestore-databases-list.js +24 -0
- package/lib/commands/firestore-databases-update.js +59 -0
- package/lib/commands/firestore-delete.js +88 -0
- package/lib/commands/firestore-indexes-list.js +38 -0
- package/lib/commands/firestore-locations.js +24 -0
- package/lib/commands/frameworks-backends-create.js +14 -0
- package/lib/commands/frameworks-backends-delete.js +98 -0
- package/lib/commands/frameworks-backends-get.js +80 -0
- package/lib/commands/frameworks-backends-list.js +68 -0
- package/lib/commands/functions-config-clone.js +53 -0
- package/lib/commands/functions-config-export.js +118 -0
- package/lib/commands/functions-config-get.js +35 -0
- package/lib/commands/functions-config-set.js +43 -0
- package/lib/commands/functions-config-unset.js +42 -0
- package/lib/commands/functions-delete.js +95 -0
- package/lib/commands/functions-deletegcfartifacts.js +44 -0
- package/lib/commands/functions-list.js +47 -0
- package/lib/commands/functions-log.js +34 -0
- package/lib/commands/functions-secrets-access.js +22 -0
- package/lib/commands/functions-secrets-destroy.js +64 -0
- package/lib/commands/functions-secrets-get.js +28 -0
- package/lib/commands/functions-secrets-prune.js +57 -0
- package/lib/commands/functions-secrets-set.js +108 -0
- package/lib/commands/functions-shell.js +15 -0
- package/lib/commands/help.js +27 -0
- package/lib/commands/hosting-channel-create.js +78 -0
- package/lib/commands/hosting-channel-delete.js +47 -0
- package/lib/commands/hosting-channel-deploy.js +146 -0
- package/lib/commands/hosting-channel-list.js +40 -0
- package/lib/commands/hosting-channel-open.js +48 -0
- package/lib/commands/hosting-clone.js +103 -0
- package/lib/commands/hosting-disable.js +31 -0
- package/lib/commands/hosting-sites-create.js +34 -0
- package/lib/commands/hosting-sites-delete.js +39 -0
- package/lib/commands/hosting-sites-get.js +27 -0
- package/lib/commands/hosting-sites-list.js +28 -0
- package/lib/commands/index.js +191 -0
- package/lib/commands/init.js +195 -0
- package/lib/commands/internaltesting-frameworks-compose.js +22 -0
- package/lib/commands/internaltesting-functions-discover.js +25 -0
- package/lib/commands/login-add.js +32 -0
- package/lib/commands/login-ci.js +25 -0
- package/lib/commands/login-list.js +28 -0
- package/lib/commands/login-use.js +24 -0
- package/lib/commands/login.js +57 -0
- package/lib/commands/logout.js +76 -0
- package/lib/commands/open.js +100 -0
- package/lib/commands/projects-addfirebase.js +19 -0
- package/lib/commands/projects-create.js +37 -0
- package/lib/commands/projects-list.js +61 -0
- package/lib/commands/remoteconfig-get.js +68 -0
- package/lib/commands/remoteconfig-rollback.js +48 -0
- package/lib/commands/remoteconfig-versions-list.js +34 -0
- package/lib/commands/serve.js +60 -0
- package/lib/commands/setup-emulators-database.js +12 -0
- package/lib/commands/setup-emulators-firestore.js +12 -0
- package/lib/commands/setup-emulators-pubsub.js +12 -0
- package/lib/commands/setup-emulators-storage.js +12 -0
- package/lib/commands/setup-emulators-ui.js +12 -0
- package/lib/commands/target-apply.js +24 -0
- package/lib/commands/target-clear.js +20 -0
- package/lib/commands/target-remove.js +20 -0
- package/lib/commands/target.js +34 -0
- package/lib/commands/use.js +162 -0
- package/lib/config.js +227 -0
- package/lib/configstore.js +6 -0
- package/lib/crashlytics/buildToolsJarHelper.js +51 -0
- package/lib/database/api.js +19 -0
- package/lib/database/import.js +218 -0
- package/lib/database/listRemote.js +37 -0
- package/lib/database/metadata.js +67 -0
- package/lib/database/remove.js +88 -0
- package/lib/database/removeRemote.js +51 -0
- package/lib/database/rulesConfig.js +79 -0
- package/lib/database/settings.js +62 -0
- package/lib/defaultCredentials.js +80 -0
- package/lib/deploy/database/deploy.js +5 -0
- package/lib/deploy/database/index.js +9 -0
- package/lib/deploy/database/prepare.js +54 -0
- package/lib/deploy/database/release.js +30 -0
- package/lib/deploy/extensions/args.js +2 -0
- package/lib/deploy/extensions/deploy.js +49 -0
- package/lib/deploy/extensions/deploymentSummary.js +56 -0
- package/lib/deploy/extensions/errors.js +31 -0
- package/lib/deploy/extensions/index.js +9 -0
- package/lib/deploy/extensions/planner.js +157 -0
- package/lib/deploy/extensions/prepare.js +110 -0
- package/lib/deploy/extensions/release.js +57 -0
- package/lib/deploy/extensions/secrets.js +150 -0
- package/lib/deploy/extensions/tasks.js +156 -0
- package/lib/deploy/extensions/v2FunctionHelper.js +53 -0
- package/lib/deploy/extensions/validate.js +17 -0
- package/lib/deploy/firestore/deploy.js +44 -0
- package/lib/deploy/firestore/index.js +9 -0
- package/lib/deploy/firestore/prepare.js +59 -0
- package/lib/deploy/firestore/release.js +22 -0
- package/lib/deploy/functions/args.js +2 -0
- package/lib/deploy/functions/backend.js +316 -0
- package/lib/deploy/functions/build.js +311 -0
- package/lib/deploy/functions/cache/applyHash.js +22 -0
- package/lib/deploy/functions/cache/hash.js +30 -0
- package/lib/deploy/functions/cel.js +365 -0
- package/lib/deploy/functions/checkIam.js +183 -0
- package/lib/deploy/functions/containerCleaner.js +305 -0
- package/lib/deploy/functions/deploy.js +108 -0
- package/lib/deploy/functions/ensure.js +105 -0
- package/lib/deploy/functions/ensureCloudBuildEnabled.js +1 -0
- package/lib/deploy/functions/functionsDeployHelper.js +134 -0
- package/lib/deploy/functions/index.js +9 -0
- package/lib/deploy/functions/params.js +517 -0
- package/lib/deploy/functions/prepare.js +304 -0
- package/lib/deploy/functions/prepareFunctionsUpload.js +113 -0
- package/lib/deploy/functions/pricing.js +171 -0
- package/lib/deploy/functions/prompts.js +157 -0
- package/lib/deploy/functions/release/executor.js +51 -0
- package/lib/deploy/functions/release/fabricator.js +584 -0
- package/lib/deploy/functions/release/index.js +93 -0
- package/lib/deploy/functions/release/planner.js +205 -0
- package/lib/deploy/functions/release/reporter.js +196 -0
- package/lib/deploy/functions/release/sourceTokenScraper.js +67 -0
- package/lib/deploy/functions/release/timer.js +14 -0
- package/lib/deploy/functions/runtimes/discovery/index.js +85 -0
- package/lib/deploy/functions/runtimes/discovery/mockDiscoveryServer.js +14 -0
- package/lib/deploy/functions/runtimes/discovery/parsing.js +95 -0
- package/lib/deploy/functions/runtimes/discovery/v1alpha1.js +296 -0
- package/lib/deploy/functions/runtimes/index.js +59 -0
- package/lib/deploy/functions/runtimes/node/extractTriggers.js +23 -0
- package/lib/deploy/functions/runtimes/node/index.js +173 -0
- package/lib/deploy/functions/runtimes/node/parseRuntimeAndValidateSDK.js +57 -0
- package/lib/deploy/functions/runtimes/node/parseTriggers.js +332 -0
- package/lib/deploy/functions/runtimes/node/triggerParser.js +72 -0
- package/lib/deploy/functions/runtimes/node/validate.js +34 -0
- package/lib/deploy/functions/runtimes/node/versioning.js +95 -0
- package/lib/deploy/functions/runtimes/python/index.js +154 -0
- package/lib/deploy/functions/services/auth.js +95 -0
- package/lib/deploy/functions/services/database.js +14 -0
- package/lib/deploy/functions/services/firebaseAlerts.js +14 -0
- package/lib/deploy/functions/services/firestore.js +17 -0
- package/lib/deploy/functions/services/index.js +117 -0
- package/lib/deploy/functions/services/remoteConfig.js +14 -0
- package/lib/deploy/functions/services/storage.js +44 -0
- package/lib/deploy/functions/services/testLab.js +14 -0
- package/lib/deploy/functions/triggerRegionHelper.js +16 -0
- package/lib/deploy/functions/validate.js +198 -0
- package/lib/deploy/hosting/args.js +2 -0
- package/lib/deploy/hosting/context.js +2 -0
- package/lib/deploy/hosting/convertConfig.js +181 -0
- package/lib/deploy/hosting/deploy.js +85 -0
- package/lib/deploy/hosting/hashcache.js +48 -0
- package/lib/deploy/hosting/index.js +9 -0
- package/lib/deploy/hosting/prepare.js +162 -0
- package/lib/deploy/hosting/release.js +40 -0
- package/lib/deploy/hosting/uploader.js +207 -0
- package/lib/deploy/index.js +127 -0
- package/lib/deploy/lifecycleHooks.js +151 -0
- package/lib/deploy/remoteconfig/deploy.js +4 -0
- package/lib/deploy/remoteconfig/functions.js +69 -0
- package/lib/deploy/remoteconfig/index.js +9 -0
- package/lib/deploy/remoteconfig/prepare.js +23 -0
- package/lib/deploy/remoteconfig/release.js +14 -0
- package/lib/deploy/storage/deploy.js +12 -0
- package/lib/deploy/storage/index.js +9 -0
- package/lib/deploy/storage/prepare.js +52 -0
- package/lib/deploy/storage/release.js +27 -0
- package/lib/deploymentTool.js +22 -0
- package/lib/detectProjectRoot.js +28 -0
- package/lib/downloadUtils.js +37 -0
- package/lib/dynamicImport.js +22 -0
- package/lib/emulator/ExpressBasedEmulator.js +92 -0
- package/lib/emulator/adminSdkConfig.js +65 -0
- package/lib/emulator/auth/apiSpec.js +8138 -0
- package/lib/emulator/auth/cloudFunctions.js +70 -0
- package/lib/emulator/auth/errors.js +77 -0
- package/lib/emulator/auth/handlers.js +281 -0
- package/lib/emulator/auth/index.js +146 -0
- package/lib/emulator/auth/operations.js +2145 -0
- package/lib/emulator/auth/schema.js +2 -0
- package/lib/emulator/auth/server.js +474 -0
- package/lib/emulator/auth/state.js +668 -0
- package/lib/emulator/auth/types.js +2 -0
- package/lib/emulator/auth/utils.js +84 -0
- package/lib/emulator/auth/widget_ui.js +620 -0
- package/lib/emulator/commandUtils.js +380 -0
- package/lib/emulator/constants.js +111 -0
- package/lib/emulator/controller.js +654 -0
- package/lib/emulator/databaseEmulator.js +172 -0
- package/lib/emulator/dns.js +49 -0
- package/lib/emulator/download.js +88 -0
- package/lib/emulator/downloadableEmulators.js +384 -0
- package/lib/emulator/emulatorLogger.js +237 -0
- package/lib/emulator/env.js +37 -0
- package/lib/emulator/eventarcEmulator.js +143 -0
- package/lib/emulator/eventarcEmulatorUtils.js +62 -0
- package/lib/emulator/events/types.js +28 -0
- package/lib/emulator/extensions/postinstall.js +41 -0
- package/lib/emulator/extensions/validation.js +72 -0
- package/lib/emulator/extensionsEmulator.js +254 -0
- package/lib/emulator/firestoreEmulator.js +96 -0
- package/lib/emulator/functionsEmulator.js +1038 -0
- package/lib/emulator/functionsEmulatorRuntime.js +730 -0
- package/lib/emulator/functionsEmulatorShared.js +322 -0
- package/lib/emulator/functionsEmulatorShell.js +88 -0
- package/lib/emulator/functionsEmulatorUtils.js +91 -0
- package/lib/emulator/functionsRuntimeWorker.js +314 -0
- package/lib/emulator/hostingEmulator.js +40 -0
- package/lib/emulator/hub.js +162 -0
- package/lib/emulator/hubClient.js +53 -0
- package/lib/emulator/hubExport.js +208 -0
- package/lib/emulator/loggingEmulator.js +118 -0
- package/lib/emulator/portUtils.js +323 -0
- package/lib/emulator/pubsubEmulator.js +186 -0
- package/lib/emulator/registry.js +122 -0
- package/lib/emulator/shared/request.js +19 -0
- package/lib/emulator/storage/apis/firebase.js +500 -0
- package/lib/emulator/storage/apis/gcloud.js +405 -0
- package/lib/emulator/storage/apis/shared.js +44 -0
- package/lib/emulator/storage/cloudFunctions.js +88 -0
- package/lib/emulator/storage/crc.js +33 -0
- package/lib/emulator/storage/errors.js +9 -0
- package/lib/emulator/storage/files.js +410 -0
- package/lib/emulator/storage/index.js +98 -0
- package/lib/emulator/storage/metadata.js +349 -0
- package/lib/emulator/storage/multipart.js +63 -0
- package/lib/emulator/storage/persistence.js +92 -0
- package/lib/emulator/storage/rules/config.js +53 -0
- package/lib/emulator/storage/rules/expressionValue.js +2 -0
- package/lib/emulator/storage/rules/manager.js +88 -0
- package/lib/emulator/storage/rules/runtime.js +363 -0
- package/lib/emulator/storage/rules/types.js +19 -0
- package/lib/emulator/storage/rules/utils.js +60 -0
- package/lib/emulator/storage/server.js +113 -0
- package/lib/emulator/storage/upload.js +143 -0
- package/lib/emulator/types.js +200 -0
- package/lib/emulator/ui.js +52 -0
- package/lib/emulator/workQueue.js +114 -0
- package/lib/ensureApiEnabled.js +110 -0
- package/lib/ensureCloudResourceLocation.js +12 -0
- package/lib/error.js +29 -0
- package/lib/errorOut.js +23 -0
- package/lib/experiments.js +153 -0
- package/lib/extensions/askUserForEventsConfig.js +97 -0
- package/lib/extensions/askUserForParam.js +338 -0
- package/lib/extensions/billingMigrationHelper.js +61 -0
- package/lib/extensions/change-log.js +95 -0
- package/lib/extensions/checkProjectBilling.js +82 -0
- package/lib/extensions/diagnose.js +56 -0
- package/lib/extensions/displayExtensionInfo.js +175 -0
- package/lib/extensions/emulator/optionsHelper.js +73 -0
- package/lib/extensions/emulator/specHelper.js +102 -0
- package/lib/extensions/emulator/triggerHelper.js +105 -0
- package/lib/extensions/etags.js +28 -0
- package/lib/extensions/export.js +64 -0
- package/lib/extensions/extensionsApi.js +361 -0
- package/lib/extensions/extensionsHelper.js +862 -0
- package/lib/extensions/listExtensions.js +53 -0
- package/lib/extensions/localHelper.js +67 -0
- package/lib/extensions/manifest.js +205 -0
- package/lib/extensions/metricsTypeDef.js +2 -0
- package/lib/extensions/metricsUtils.js +98 -0
- package/lib/extensions/paramHelper.js +140 -0
- package/lib/extensions/provisioningHelper.js +109 -0
- package/lib/extensions/publishHelpers.js +8 -0
- package/lib/extensions/publisherApi.js +214 -0
- package/lib/extensions/refs.js +67 -0
- package/lib/extensions/resolveSource.js +24 -0
- package/lib/extensions/secretsUtils.js +60 -0
- package/lib/extensions/tos.js +90 -0
- package/lib/extensions/types.js +25 -0
- package/lib/extensions/updateHelper.js +127 -0
- package/lib/extensions/utils.js +63 -0
- package/lib/extensions/versionHelper.js +14 -0
- package/lib/extensions/warnings.js +44 -0
- package/lib/fetchMOTD.js +46 -0
- package/lib/fetchWebSetup.js +75 -0
- package/lib/filterTargets.js +34 -0
- package/lib/firebaseConfig.js +2 -0
- package/lib/firebaseConfigValidate.js +29 -0
- package/lib/firestore/api-sort.js +118 -0
- package/lib/firestore/api-spec.js +2 -0
- package/lib/firestore/api-types.js +60 -0
- package/lib/firestore/api.js +566 -0
- package/lib/firestore/checkDatabaseType.js +18 -0
- package/lib/firestore/delete.js +347 -0
- package/lib/firestore/encodeFirestoreValue.js +59 -0
- package/lib/firestore/fsConfig.js +74 -0
- package/lib/firestore/options.js +2 -0
- package/lib/firestore/util.js +39 -0
- package/lib/firestore/validator.js +38 -0
- package/lib/frameworks/angular/index.js +193 -0
- package/lib/frameworks/angular/interfaces.js +2 -0
- package/lib/frameworks/angular/utils.js +431 -0
- package/lib/frameworks/astro/index.js +73 -0
- package/lib/frameworks/astro/utils.js +40 -0
- package/lib/frameworks/compose/discover/filesystem.js +52 -0
- package/lib/frameworks/compose/discover/frameworkMatcher.js +76 -0
- package/lib/frameworks/compose/discover/frameworkSpec.js +39 -0
- package/lib/frameworks/compose/discover/index.js +32 -0
- package/lib/frameworks/compose/discover/runtime/node.js +149 -0
- package/lib/frameworks/compose/discover/types.js +2 -0
- package/lib/frameworks/compose/driver/docker.js +187 -0
- package/lib/frameworks/compose/driver/hooks.js +22 -0
- package/lib/frameworks/compose/driver/index.js +16 -0
- package/lib/frameworks/compose/driver/local.js +51 -0
- package/lib/frameworks/compose/index.js +31 -0
- package/lib/frameworks/compose/interfaces.js +21 -0
- package/lib/frameworks/constants.js +40 -0
- package/lib/frameworks/docs/index.js +2 -0
- package/lib/frameworks/express/index.js +102 -0
- package/lib/frameworks/flutter/constants.js +72 -0
- package/lib/frameworks/flutter/index.js +58 -0
- package/lib/frameworks/flutter/utils.js +11 -0
- package/lib/frameworks/frameworks.js +31 -0
- package/lib/frameworks/index.js +421 -0
- package/lib/frameworks/interfaces.js +2 -0
- package/lib/frameworks/lit/index.js +23 -0
- package/lib/frameworks/next/constants.js +12 -0
- package/lib/frameworks/next/index.js +403 -0
- package/lib/frameworks/next/interfaces.js +2 -0
- package/lib/frameworks/next/utils.js +197 -0
- package/lib/frameworks/nuxt/index.js +92 -0
- package/lib/frameworks/nuxt/interfaces.js +2 -0
- package/lib/frameworks/nuxt/utils.js +23 -0
- package/lib/frameworks/nuxt2/index.js +79 -0
- package/lib/frameworks/preact/index.js +23 -0
- package/lib/frameworks/react/index.js +23 -0
- package/lib/frameworks/svelte/index.js +23 -0
- package/lib/frameworks/sveltekit/index.js +54 -0
- package/lib/frameworks/sveltekit/interfaces.js +2 -0
- package/lib/frameworks/utils.js +260 -0
- package/lib/frameworks/vite/index.js +99 -0
- package/lib/fsAsync.js +43 -0
- package/lib/fsutils.js +35 -0
- package/lib/functional.js +87 -0
- package/lib/functions/constants.js +14 -0
- package/lib/functions/ensureTargeted.js +21 -0
- package/lib/functions/env.js +246 -0
- package/lib/functions/events/index.js +7 -0
- package/lib/functions/events/v1.js +6 -0
- package/lib/functions/events/v2.js +25 -0
- package/lib/functions/functionslog.js +35 -0
- package/lib/functions/projectConfig.js +68 -0
- package/lib/functions/python.js +23 -0
- package/lib/functions/runtimeConfigExport.js +141 -0
- package/lib/functions/secrets.js +239 -0
- package/lib/functionsConfig.js +157 -0
- package/lib/functionsConfigClone.js +68 -0
- package/lib/functionsShellCommandAction.js +112 -0
- package/lib/gcp/artifactregistry.js +16 -0
- package/lib/gcp/auth.js +16 -0
- package/lib/gcp/cloudbilling.js +25 -0
- package/lib/gcp/cloudbuild.js +50 -0
- package/lib/gcp/cloudfunctions.js +351 -0
- package/lib/gcp/cloudfunctionsv2.js +389 -0
- package/lib/gcp/cloudlogging.js +25 -0
- package/lib/gcp/cloudmonitoring.js +77 -0
- package/lib/gcp/cloudscheduler.js +155 -0
- package/lib/gcp/cloudtasks.js +162 -0
- package/lib/gcp/docker.js +80 -0
- package/lib/gcp/eventarc.js +42 -0
- package/lib/gcp/firestore.js +47 -0
- package/lib/gcp/frameworks.js +40 -0
- package/lib/gcp/iam.js +76 -0
- package/lib/gcp/identityPlatform.js +44 -0
- package/lib/gcp/index.js +11 -0
- package/lib/gcp/location.js +44 -0
- package/lib/gcp/proto.js +130 -0
- package/lib/gcp/pubsub.js +34 -0
- package/lib/gcp/resourceManager.js +74 -0
- package/lib/gcp/rules.js +156 -0
- package/lib/gcp/run.js +157 -0
- package/lib/gcp/runtimeconfig.js +127 -0
- package/lib/gcp/secretManager.js +207 -0
- package/lib/gcp/serviceusage.js +24 -0
- package/lib/gcp/storage.js +111 -0
- package/lib/getDefaultDatabaseInstance.js +10 -0
- package/lib/getDefaultHostingSite.js +32 -0
- package/lib/getProjectNumber.js +15 -0
- package/lib/handlePreviewToggles.js +38 -0
- package/lib/hosting/api.js +289 -0
- package/lib/hosting/cloudRunProxy.js +52 -0
- package/lib/hosting/config.js +189 -0
- package/lib/hosting/expireUtils.js +33 -0
- package/lib/hosting/functionsProxy.js +42 -0
- package/lib/hosting/implicitInit.js +58 -0
- package/lib/hosting/initMiddleware.js +63 -0
- package/lib/hosting/interactive.js +75 -0
- package/lib/hosting/options.js +3 -0
- package/lib/hosting/proxy.js +143 -0
- package/lib/hosting/runTags.js +114 -0
- package/lib/index.js +71 -0
- package/lib/init/features/account.js +62 -0
- package/lib/init/features/database.js +133 -0
- package/lib/init/features/emulators.js +102 -0
- package/lib/init/features/extensions/index.js +16 -0
- package/lib/init/features/firestore/index.js +36 -0
- package/lib/init/features/firestore/indexes.js +71 -0
- package/lib/init/features/firestore/rules.js +80 -0
- package/lib/init/features/frameworks/constants.js +7 -0
- package/lib/init/features/frameworks/index.js +116 -0
- package/lib/init/features/frameworks/repo.js +125 -0
- package/lib/init/features/functions/index.js +165 -0
- package/lib/init/features/functions/javascript.js +46 -0
- package/lib/init/features/functions/npm-dependencies.js +37 -0
- package/lib/init/features/functions/python.js +48 -0
- package/lib/init/features/functions/typescript.js +61 -0
- package/lib/init/features/hosting/github.js +397 -0
- package/lib/init/features/hosting/index.js +183 -0
- package/lib/init/features/index.js +27 -0
- package/lib/init/features/project.js +101 -0
- package/lib/init/features/remoteconfig.js +32 -0
- package/lib/init/features/storage.js +27 -0
- package/lib/init/index.js +45 -0
- package/lib/listFiles.js +15 -0
- package/lib/loadCJSON.js +17 -0
- package/lib/localFunction.js +222 -0
- package/lib/logError.js +29 -0
- package/lib/logger.js +31 -0
- package/lib/management/apps.js +280 -0
- package/lib/management/database.js +184 -0
- package/lib/management/projects.js +312 -0
- package/lib/metaprogramming.js +2 -0
- package/lib/monospace/index.js +82 -0
- package/lib/monospace/interfaces.js +2 -0
- package/lib/operation-poller.js +59 -0
- package/lib/options.js +2 -0
- package/lib/parseBoltRules.js +29 -0
- package/lib/profileReport.js +577 -0
- package/lib/profiler.js +99 -0
- package/lib/projectPath.js +16 -0
- package/lib/projectUtils.js +59 -0
- package/lib/prompt.js +50 -0
- package/lib/rc.js +165 -0
- package/lib/remoteconfig/get.js +49 -0
- package/lib/remoteconfig/interfaces.js +17 -0
- package/lib/remoteconfig/rollback.js +22 -0
- package/lib/remoteconfig/versionslist.js +33 -0
- package/lib/requireAuth.js +81 -0
- package/lib/requireConfig.js +13 -0
- package/lib/requireDatabaseInstance.js +26 -0
- package/lib/requireHostingSite.js +12 -0
- package/lib/requireInteractive.js +12 -0
- package/lib/requirePermissions.js +30 -0
- package/lib/responseToError.js +58 -0
- package/lib/rtdb.js +35 -0
- package/lib/rulesDeploy.js +180 -0
- package/lib/scopes.js +10 -0
- package/lib/serve/functions.js +64 -0
- package/lib/serve/hosting.js +115 -0
- package/lib/serve/index.js +53 -0
- package/lib/shortenUrl.js +29 -0
- package/lib/throttler/errors/retries-exhausted-error.js +11 -0
- package/lib/throttler/errors/task-error.js +9 -0
- package/lib/throttler/errors/timeout-error.js +9 -0
- package/lib/throttler/queue.js +23 -0
- package/lib/throttler/stack.js +28 -0
- package/lib/throttler/throttler.js +230 -0
- package/lib/track.js +196 -0
- package/lib/unzip.js +126 -0
- package/lib/utils.js +488 -0
- package/package.json +239 -0
- package/schema/extension-yaml.json +432 -0
- package/schema/firebase-config.json +2619 -0
- package/standalone/check.js +6 -0
- package/standalone/config.template.js +19 -0
- package/standalone/firepit.js +1074 -0
- package/standalone/package-lock.json +7019 -0
- package/standalone/package.json +36 -0
- package/standalone/runtime.js +122 -0
- package/standalone/welcome.js +178 -0
- package/templates/_gitignore +66 -0
- package/templates/banner.txt +6 -0
- package/templates/emulators/default_storage.rules +8 -0
- package/templates/extensions/CL-template.md +2 -0
- package/templates/extensions/POSTINSTALL.md +29 -0
- package/templates/extensions/PREINSTALL.md +22 -0
- package/templates/extensions/extension.yaml +61 -0
- package/templates/extensions/integration-test.env +2 -0
- package/templates/extensions/integration-test.json +14 -0
- package/templates/extensions/javascript/WELCOME.md +18 -0
- package/templates/extensions/javascript/_gitignore +1 -0
- package/templates/extensions/javascript/index.js +25 -0
- package/templates/extensions/javascript/integration-test.js +13 -0
- package/templates/extensions/javascript/package.lint.json +25 -0
- package/templates/extensions/javascript/package.nolint.json +19 -0
- package/templates/extensions/typescript/WELCOME.md +22 -0
- package/templates/extensions/typescript/_gitignore +8 -0
- package/templates/extensions/typescript/_mocharc +10 -0
- package/templates/extensions/typescript/index.ts +26 -0
- package/templates/extensions/typescript/integration-test.ts +13 -0
- package/templates/extensions/typescript/package.lint.json +31 -0
- package/templates/extensions/typescript/package.nolint.json +24 -0
- package/templates/extensions/typescript/tsconfig.dev.json +5 -0
- package/templates/extensions/typescript/tsconfig.json +15 -0
- package/templates/firebase.json +9 -0
- package/templates/hosting/init.js +36 -0
- package/templates/init/firestore/firestore.indexes.json +26 -0
- package/templates/init/firestore/firestore.rules +16 -0
- package/templates/init/functions/javascript/_eslintrc +28 -0
- package/templates/init/functions/javascript/_gitignore +1 -0
- package/templates/init/functions/javascript/index.js +19 -0
- package/templates/init/functions/javascript/package.lint.json +26 -0
- package/templates/init/functions/javascript/package.nolint.json +23 -0
- package/templates/init/functions/python/_gitignore +0 -0
- package/templates/init/functions/python/main.py +13 -0
- package/templates/init/functions/python/requirements.txt +1 -0
- package/templates/init/functions/typescript/_eslintrc +32 -0
- package/templates/init/functions/typescript/_gitignore +9 -0
- package/templates/init/functions/typescript/index.ts +19 -0
- package/templates/init/functions/typescript/package.lint.json +31 -0
- package/templates/init/functions/typescript/package.nolint.json +25 -0
- package/templates/init/functions/typescript/tsconfig.dev.json +5 -0
- package/templates/init/functions/typescript/tsconfig.json +15 -0
- package/templates/init/hosting/404.html +33 -0
- package/templates/init/hosting/index.html +89 -0
- package/templates/init/storage/storage.rules +12 -0
- package/templates/loginFailure.html +34 -0
- package/templates/loginSuccess.html +32 -0
- package/templates/loginSuccessGithub.html +32 -0
- package/templates/setup/web.js +5 -0
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
|
+
const ora = require("ora");
|
|
6
|
+
const command_1 = require("../command");
|
|
7
|
+
const error_1 = require("../error");
|
|
8
|
+
const api_1 = require("../hosting/api");
|
|
9
|
+
const utils = require("../utils");
|
|
10
|
+
const requireAuth_1 = require("../requireAuth");
|
|
11
|
+
const marked_1 = require("marked");
|
|
12
|
+
const logger_1 = require("../logger");
|
|
13
|
+
exports.command = new command_1.Command("hosting:clone <source> <targetChannel>")
|
|
14
|
+
.description("clone a version from one site to another")
|
|
15
|
+
.help(`<source> and <targetChannel> accept the following format: <siteId>:<channelId>
|
|
16
|
+
|
|
17
|
+
For example, to copy the content for a site \`my-site\` from a preview channel \`staging\` to a \`live\` channel, the command would look be:
|
|
18
|
+
|
|
19
|
+
firebase hosting:clone my-site:foo my-site:live`)
|
|
20
|
+
.before(requireAuth_1.requireAuth)
|
|
21
|
+
.action(async (source = "", targetChannel = "") => {
|
|
22
|
+
var _a, _b, _c, _d;
|
|
23
|
+
let sourceVersionName;
|
|
24
|
+
let sourceVersion;
|
|
25
|
+
let [sourceSiteId, sourceChannelId] = source.split(":");
|
|
26
|
+
let [targetSiteId, targetChannelId] = targetChannel.split(":");
|
|
27
|
+
if (!sourceSiteId || !sourceChannelId) {
|
|
28
|
+
[sourceSiteId, sourceVersion] = source.split("@");
|
|
29
|
+
if (!sourceSiteId || !sourceVersion) {
|
|
30
|
+
throw new error_1.FirebaseError(`"${source}" is not a valid source. Must be in the form "<site>:<channel>" or "<site>@<version>"`);
|
|
31
|
+
}
|
|
32
|
+
sourceVersionName = `sites/${sourceSiteId}/versions/${sourceVersion}`;
|
|
33
|
+
}
|
|
34
|
+
if (!targetSiteId || !targetChannelId) {
|
|
35
|
+
throw new error_1.FirebaseError(`"${targetChannel}" is not a valid target channel. Must be in the form "<site>:<channel>" (to clone to the active website, use "live" as the channel).`);
|
|
36
|
+
}
|
|
37
|
+
targetChannelId = (0, api_1.normalizeName)(targetChannelId);
|
|
38
|
+
if (sourceChannelId) {
|
|
39
|
+
sourceChannelId = (0, api_1.normalizeName)(sourceChannelId);
|
|
40
|
+
}
|
|
41
|
+
const equalSiteIds = sourceSiteId === targetSiteId;
|
|
42
|
+
const equalChannelIds = sourceChannelId === targetChannelId;
|
|
43
|
+
if (equalSiteIds && equalChannelIds) {
|
|
44
|
+
throw new error_1.FirebaseError(`Source and destination cannot be equal. Please pick a different source or desination.`);
|
|
45
|
+
}
|
|
46
|
+
if (!sourceVersionName) {
|
|
47
|
+
const sChannel = await (0, api_1.getChannel)("-", sourceSiteId, sourceChannelId);
|
|
48
|
+
if (!sChannel) {
|
|
49
|
+
throw new error_1.FirebaseError(`Could not find the channel ${(0, colorette_1.bold)(sourceChannelId)} for site ${(0, colorette_1.bold)(sourceSiteId)}.`);
|
|
50
|
+
}
|
|
51
|
+
sourceVersionName = (_b = (_a = sChannel.release) === null || _a === void 0 ? void 0 : _a.version) === null || _b === void 0 ? void 0 : _b.name;
|
|
52
|
+
if (!sourceVersionName) {
|
|
53
|
+
throw new error_1.FirebaseError(`Could not find a version on the channel ${(0, colorette_1.bold)(sourceChannelId)} for site ${(0, colorette_1.bold)(sourceSiteId)}.`);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
let tChannel = await (0, api_1.getChannel)("-", targetSiteId, targetChannelId);
|
|
57
|
+
if (!tChannel) {
|
|
58
|
+
utils.logBullet(`could not find channel ${(0, colorette_1.bold)(targetChannelId)} in site ${(0, colorette_1.bold)(targetSiteId)}, creating it...`);
|
|
59
|
+
try {
|
|
60
|
+
tChannel = await (0, api_1.createChannel)("-", targetSiteId, targetChannelId);
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
throw new error_1.FirebaseError(`Could not create the channel ${(0, colorette_1.bold)(targetChannelId)} for site ${(0, colorette_1.bold)(targetSiteId)}.`, { original: e });
|
|
64
|
+
}
|
|
65
|
+
utils.logSuccess(`Created new channel ${targetChannelId}`);
|
|
66
|
+
try {
|
|
67
|
+
const tProjectId = parseProjectId(tChannel.name);
|
|
68
|
+
await (0, api_1.addAuthDomains)(tProjectId, [tChannel.url]);
|
|
69
|
+
}
|
|
70
|
+
catch (e) {
|
|
71
|
+
utils.logLabeledWarning("hosting:clone", (0, marked_1.marked)(`Unable to add channel domain to Firebase Auth. Visit the Firebase Console at ${utils.consoleUrl(targetSiteId, "/authentication/providers")}`));
|
|
72
|
+
logger_1.logger.debug("[hosting] unable to add auth domain", e);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
const currentTargetVersionName = (_d = (_c = tChannel.release) === null || _c === void 0 ? void 0 : _c.version) === null || _d === void 0 ? void 0 : _d.name;
|
|
76
|
+
if (equalSiteIds && sourceVersionName === currentTargetVersionName) {
|
|
77
|
+
utils.logSuccess(`Channels ${(0, colorette_1.bold)(sourceChannelId)} and ${(0, colorette_1.bold)(targetChannel)} are serving identical versions. No need to clone.`);
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
let targetVersionName = sourceVersionName;
|
|
81
|
+
const spinner = ora("Cloning site content...").start();
|
|
82
|
+
try {
|
|
83
|
+
if (!equalSiteIds) {
|
|
84
|
+
const targetVersion = await (0, api_1.cloneVersion)(targetSiteId, sourceVersionName, true);
|
|
85
|
+
if (!targetVersion) {
|
|
86
|
+
throw new error_1.FirebaseError(`Could not clone the version ${(0, colorette_1.bold)(sourceVersion)} for site ${(0, colorette_1.bold)(targetSiteId)}.`);
|
|
87
|
+
}
|
|
88
|
+
targetVersionName = targetVersion.name;
|
|
89
|
+
}
|
|
90
|
+
await (0, api_1.createRelease)(targetSiteId, targetChannelId, targetVersionName);
|
|
91
|
+
}
|
|
92
|
+
catch (err) {
|
|
93
|
+
spinner.fail();
|
|
94
|
+
throw err;
|
|
95
|
+
}
|
|
96
|
+
spinner.succeed();
|
|
97
|
+
utils.logSuccess(`Site ${(0, colorette_1.bold)(sourceSiteId)} ${sourceChannelId ? "channel" : "version"} ${(0, colorette_1.bold)(sourceChannelId || sourceVersion)} has been cloned to site ${(0, colorette_1.bold)(targetSiteId)} channel ${(0, colorette_1.bold)(targetChannelId)}.`);
|
|
98
|
+
utils.logSuccess(`Channel URL (${targetChannelId}): ${tChannel.url}`);
|
|
99
|
+
});
|
|
100
|
+
function parseProjectId(name) {
|
|
101
|
+
const matches = name.match(`^projects/([^/]+)`);
|
|
102
|
+
return matches ? matches[1] || "" : "";
|
|
103
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const apiv2_1 = require("../apiv2");
|
|
6
|
+
const command_1 = require("../command");
|
|
7
|
+
const api_1 = require("../api");
|
|
8
|
+
const prompt_1 = require("../prompt");
|
|
9
|
+
const requireHostingSite_1 = require("../requireHostingSite");
|
|
10
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
11
|
+
const utils = require("../utils");
|
|
12
|
+
exports.command = new command_1.Command("hosting:disable")
|
|
13
|
+
.description("stop serving web traffic to your Firebase Hosting site")
|
|
14
|
+
.option("-f, --force", "skip confirmation")
|
|
15
|
+
.option("-s, --site <siteName>", "the site to disable")
|
|
16
|
+
.before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.update"])
|
|
17
|
+
.before(requireHostingSite_1.requireHostingSite)
|
|
18
|
+
.action(async (options) => {
|
|
19
|
+
const siteToDisable = options.site;
|
|
20
|
+
const confirm = await (0, prompt_1.promptOnce)({
|
|
21
|
+
type: "confirm",
|
|
22
|
+
name: "force",
|
|
23
|
+
message: `Are you sure you want to disable Firebase Hosting for the site ${clc.underline(siteToDisable)}\n${clc.underline("This will immediately make your site inaccessible!")}`,
|
|
24
|
+
}, options);
|
|
25
|
+
if (!confirm) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
const c = new apiv2_1.Client({ urlPrefix: api_1.hostingApiOrigin, apiVersion: "v1beta1", auth: true });
|
|
29
|
+
await c.post(`/sites/${siteToDisable}/releases`, { type: "SITE_DISABLE" });
|
|
30
|
+
utils.logSuccess(`Hosting has been disabled for ${clc.bold(siteToDisable)}. Deploy a new version to re-enable.`);
|
|
31
|
+
});
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const interactive_1 = require("../hosting/interactive");
|
|
7
|
+
const utils_1 = require("../utils");
|
|
8
|
+
const logger_1 = require("../logger");
|
|
9
|
+
const projectUtils_1 = require("../projectUtils");
|
|
10
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
11
|
+
const error_1 = require("../error");
|
|
12
|
+
const LOG_TAG = "hosting:sites";
|
|
13
|
+
exports.command = new command_1.Command("hosting:sites:create [siteId]")
|
|
14
|
+
.description("create a Firebase Hosting site")
|
|
15
|
+
.option("--app <appId>", "specify an existing Firebase Web App ID")
|
|
16
|
+
.before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.update"])
|
|
17
|
+
.action(async (siteId, options) => {
|
|
18
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
19
|
+
const appId = options.app;
|
|
20
|
+
if (options.nonInteractive && !siteId) {
|
|
21
|
+
throw new error_1.FirebaseError(`${(0, colorette_1.bold)(siteId)} is required in a non-interactive environment`);
|
|
22
|
+
}
|
|
23
|
+
const site = await (0, interactive_1.interactiveCreateHostingSite)(siteId, appId, options);
|
|
24
|
+
siteId = (0, utils_1.last)(site.name.split("/"));
|
|
25
|
+
logger_1.logger.info();
|
|
26
|
+
(0, utils_1.logLabeledSuccess)(LOG_TAG, `Site ${(0, colorette_1.bold)(siteId)} has been created in project ${(0, colorette_1.bold)(projectId)}.`);
|
|
27
|
+
if (appId) {
|
|
28
|
+
(0, utils_1.logLabeledSuccess)(LOG_TAG, `Site ${(0, colorette_1.bold)(siteId)} has been linked to web app ${(0, colorette_1.bold)(appId)}`);
|
|
29
|
+
}
|
|
30
|
+
(0, utils_1.logLabeledSuccess)(LOG_TAG, `Site URL: ${site.defaultUrl}`);
|
|
31
|
+
logger_1.logger.info();
|
|
32
|
+
logger_1.logger.info(`To deploy to this site, follow the guide at https://firebase.google.com/docs/hosting/multisites.`);
|
|
33
|
+
return site;
|
|
34
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const api_1 = require("../hosting/api");
|
|
8
|
+
const prompt_1 = require("../prompt");
|
|
9
|
+
const error_1 = require("../error");
|
|
10
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
11
|
+
const projectUtils_1 = require("../projectUtils");
|
|
12
|
+
const requireConfig_1 = require("../requireConfig");
|
|
13
|
+
const logger_1 = require("../logger");
|
|
14
|
+
const LOG_TAG = "hosting:sites";
|
|
15
|
+
exports.command = new command_1.Command("hosting:sites:delete <siteId>")
|
|
16
|
+
.description("delete a Firebase Hosting site")
|
|
17
|
+
.withForce()
|
|
18
|
+
.before(requireConfig_1.requireConfig)
|
|
19
|
+
.before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.delete"])
|
|
20
|
+
.action(async (siteId, options) => {
|
|
21
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
22
|
+
if (!siteId) {
|
|
23
|
+
throw new error_1.FirebaseError("siteId is required");
|
|
24
|
+
}
|
|
25
|
+
logger_1.logger.info(`Deleting a site is a permanent action. If you delete a site, Firebase doesn't maintain records of deployed files or deployment history, and the site ${(0, colorette_1.underline)(siteId)} cannot be reactivated by you or anyone else.`);
|
|
26
|
+
logger_1.logger.info();
|
|
27
|
+
const confirmed = await (0, prompt_1.promptOnce)({
|
|
28
|
+
name: "force",
|
|
29
|
+
type: "confirm",
|
|
30
|
+
message: `Are you sure you want to delete the Hosting site ${(0, colorette_1.underline)(siteId)} for project ${(0, colorette_1.underline)(projectId)}? `,
|
|
31
|
+
default: false,
|
|
32
|
+
}, options);
|
|
33
|
+
if (!confirmed) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
await (0, api_1.getSite)(projectId, siteId);
|
|
37
|
+
await (0, api_1.deleteSite)(projectId, siteId);
|
|
38
|
+
(0, utils_1.logLabeledSuccess)(LOG_TAG, `Successfully deleted site ${(0, colorette_1.bold)(siteId)} from project ${(0, colorette_1.bold)(projectId)}`);
|
|
39
|
+
});
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const Table = require("cli-table");
|
|
5
|
+
const command_1 = require("../command");
|
|
6
|
+
const api_1 = require("../hosting/api");
|
|
7
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
8
|
+
const projectUtils_1 = require("../projectUtils");
|
|
9
|
+
const logger_1 = require("../logger");
|
|
10
|
+
const error_1 = require("../error");
|
|
11
|
+
exports.command = new command_1.Command("hosting:sites:get <siteId>")
|
|
12
|
+
.description("print info about a Firebase Hosting site")
|
|
13
|
+
.before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.get"])
|
|
14
|
+
.action(async (siteId, options) => {
|
|
15
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
16
|
+
if (!siteId) {
|
|
17
|
+
throw new error_1.FirebaseError("<siteId> must be specified");
|
|
18
|
+
}
|
|
19
|
+
const site = await (0, api_1.getSite)(projectId, siteId);
|
|
20
|
+
const table = new Table();
|
|
21
|
+
table.push(["Site ID:", site.name.split("/").pop()]);
|
|
22
|
+
table.push(["Default URL:", site.defaultUrl]);
|
|
23
|
+
table.push(["App ID:", site.appId || ""]);
|
|
24
|
+
logger_1.logger.info();
|
|
25
|
+
logger_1.logger.info(table.toString());
|
|
26
|
+
return site;
|
|
27
|
+
});
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.command = void 0;
|
|
4
|
+
const colorette_1 = require("colorette");
|
|
5
|
+
const Table = require("cli-table");
|
|
6
|
+
const command_1 = require("../command");
|
|
7
|
+
const api_1 = require("../hosting/api");
|
|
8
|
+
const requirePermissions_1 = require("../requirePermissions");
|
|
9
|
+
const projectUtils_1 = require("../projectUtils");
|
|
10
|
+
const logger_1 = require("../logger");
|
|
11
|
+
const TABLE_HEAD = ["Site ID", "Default URL", "App ID (if set)"];
|
|
12
|
+
exports.command = new command_1.Command("hosting:sites:list")
|
|
13
|
+
.description("list Firebase Hosting sites")
|
|
14
|
+
.before(requirePermissions_1.requirePermissions, ["firebasehosting.sites.get"])
|
|
15
|
+
.action(async (options) => {
|
|
16
|
+
const projectId = (0, projectUtils_1.needProjectId)(options);
|
|
17
|
+
const sites = await (0, api_1.listSites)(projectId);
|
|
18
|
+
const table = new Table({ head: TABLE_HEAD, style: { head: ["green"] } });
|
|
19
|
+
for (const site of sites) {
|
|
20
|
+
const siteId = site.name.split("/").pop();
|
|
21
|
+
table.push([siteId, site.defaultUrl, site.appId || "--"]);
|
|
22
|
+
}
|
|
23
|
+
logger_1.logger.info();
|
|
24
|
+
logger_1.logger.info(`Sites for project ${(0, colorette_1.bold)(projectId)}`);
|
|
25
|
+
logger_1.logger.info();
|
|
26
|
+
logger_1.logger.info(table.toString());
|
|
27
|
+
return { sites };
|
|
28
|
+
});
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.load = void 0;
|
|
4
|
+
const experiments = require("../experiments");
|
|
5
|
+
function load(client) {
|
|
6
|
+
function loadCommand(name) {
|
|
7
|
+
const t0 = process.hrtime.bigint();
|
|
8
|
+
const { command: cmd } = require(`./${name}`);
|
|
9
|
+
cmd.register(client);
|
|
10
|
+
const t1 = process.hrtime.bigint();
|
|
11
|
+
const diffMS = (t1 - t0) / BigInt(1e6);
|
|
12
|
+
if (diffMS > 75) {
|
|
13
|
+
}
|
|
14
|
+
return cmd.runner();
|
|
15
|
+
}
|
|
16
|
+
const t0 = process.hrtime.bigint();
|
|
17
|
+
client.appdistribution = {};
|
|
18
|
+
client.appdistribution.distribute = loadCommand("appdistribution-distribute");
|
|
19
|
+
client.appdistribution.testers = {};
|
|
20
|
+
client.appdistribution.testers.add = loadCommand("appdistribution-testers-add");
|
|
21
|
+
client.appdistribution.testers.delete = loadCommand("appdistribution-testers-remove");
|
|
22
|
+
client.appdistribution.group = {};
|
|
23
|
+
client.appdistribution.group.create = loadCommand("appdistribution-group-create");
|
|
24
|
+
client.appdistribution.group.delete = loadCommand("appdistribution-group-delete");
|
|
25
|
+
client.apps = {};
|
|
26
|
+
client.apps.create = loadCommand("apps-create");
|
|
27
|
+
client.apps.list = loadCommand("apps-list");
|
|
28
|
+
client.apps.sdkconfig = loadCommand("apps-sdkconfig");
|
|
29
|
+
client.apps.android = {};
|
|
30
|
+
client.apps.android.sha = {};
|
|
31
|
+
client.apps.android.sha.list = loadCommand("apps-android-sha-list");
|
|
32
|
+
client.apps.android.sha.create = loadCommand("apps-android-sha-create");
|
|
33
|
+
client.apps.android.sha.delete = loadCommand("apps-android-sha-delete");
|
|
34
|
+
client.auth = {};
|
|
35
|
+
client.auth.export = loadCommand("auth-export");
|
|
36
|
+
client.auth.upload = loadCommand("auth-import");
|
|
37
|
+
client.crashlytics = {};
|
|
38
|
+
client.crashlytics.symbols = {};
|
|
39
|
+
client.crashlytics.symbols.upload = loadCommand("crashlytics-symbols-upload");
|
|
40
|
+
client.crashlytics.mappingfile = {};
|
|
41
|
+
client.crashlytics.mappingfile.generateid = loadCommand("crashlytics-mappingfile-generateid");
|
|
42
|
+
client.crashlytics.mappingfile.upload = loadCommand("crashlytics-mappingfile-upload");
|
|
43
|
+
client.database = {};
|
|
44
|
+
client.database.get = loadCommand("database-get");
|
|
45
|
+
client.database.import = loadCommand("database-import");
|
|
46
|
+
client.database.instances = {};
|
|
47
|
+
client.database.instances.create = loadCommand("database-instances-create");
|
|
48
|
+
client.database.instances.list = loadCommand("database-instances-list");
|
|
49
|
+
client.database.profile = loadCommand("database-profile");
|
|
50
|
+
client.database.push = loadCommand("database-push");
|
|
51
|
+
client.database.remove = loadCommand("database-remove");
|
|
52
|
+
if (experiments.isEnabled("rtdbrules")) {
|
|
53
|
+
client.database.rules = {};
|
|
54
|
+
client.database.rules.get = loadCommand("database-rules-get");
|
|
55
|
+
client.database.rules.list = loadCommand("database-rules-list");
|
|
56
|
+
client.database.rules.stage = loadCommand("database-rules-stage");
|
|
57
|
+
client.database.rules.canary = loadCommand("database-rules-canary");
|
|
58
|
+
client.database.rules.release = loadCommand("database-rules-release");
|
|
59
|
+
}
|
|
60
|
+
client.database.set = loadCommand("database-set");
|
|
61
|
+
client.database.settings = {};
|
|
62
|
+
client.database.settings.get = loadCommand("database-settings-get");
|
|
63
|
+
client.database.settings.set = loadCommand("database-settings-set");
|
|
64
|
+
client.database.update = loadCommand("database-update");
|
|
65
|
+
client.deploy = loadCommand("deploy");
|
|
66
|
+
client.emulators = {};
|
|
67
|
+
client.emulators.exec = loadCommand("emulators-exec");
|
|
68
|
+
client.emulators.export = loadCommand("emulators-export");
|
|
69
|
+
client.emulators.start = loadCommand("emulators-start");
|
|
70
|
+
client.experimental = {};
|
|
71
|
+
client.experimental.functions = {};
|
|
72
|
+
client.experimental.functions.shell = loadCommand("experimental-functions-shell");
|
|
73
|
+
client.experiments = {};
|
|
74
|
+
client.experiments.list = loadCommand("experiments-list");
|
|
75
|
+
client.experiments.describe = loadCommand("experiments-describe");
|
|
76
|
+
client.experiments.enable = loadCommand("experiments-enable");
|
|
77
|
+
client.experiments.disable = loadCommand("experiments-disable");
|
|
78
|
+
client.ext = loadCommand("ext");
|
|
79
|
+
client.ext.configure = loadCommand("ext-configure");
|
|
80
|
+
client.ext.info = loadCommand("ext-info");
|
|
81
|
+
client.ext.export = loadCommand("ext-export");
|
|
82
|
+
client.ext.install = loadCommand("ext-install");
|
|
83
|
+
client.ext.list = loadCommand("ext-list");
|
|
84
|
+
client.ext.uninstall = loadCommand("ext-uninstall");
|
|
85
|
+
client.ext.update = loadCommand("ext-update");
|
|
86
|
+
client.ext.dev = {};
|
|
87
|
+
client.ext.dev.init = loadCommand("ext-dev-init");
|
|
88
|
+
client.ext.dev.list = loadCommand("ext-dev-list");
|
|
89
|
+
client.ext.dev.register = loadCommand("ext-dev-register");
|
|
90
|
+
client.ext.dev.deprecate = loadCommand("ext-dev-deprecate");
|
|
91
|
+
client.ext.dev.undeprecate = loadCommand("ext-dev-undeprecate");
|
|
92
|
+
client.ext.dev.upload = loadCommand("ext-dev-upload");
|
|
93
|
+
client.ext.dev.publish = loadCommand("ext-dev-publish");
|
|
94
|
+
client.ext.dev.usage = loadCommand("ext-dev-usage");
|
|
95
|
+
client.firestore = {};
|
|
96
|
+
client.firestore.delete = loadCommand("firestore-delete");
|
|
97
|
+
client.firestore.indexes = loadCommand("firestore-indexes-list");
|
|
98
|
+
client.firestore.locations = loadCommand("firestore-locations");
|
|
99
|
+
client.firestore.databases = {};
|
|
100
|
+
client.firestore.databases.list = loadCommand("firestore-databases-list");
|
|
101
|
+
client.firestore.databases.get = loadCommand("firestore-databases-get");
|
|
102
|
+
client.firestore.databases.create = loadCommand("firestore-databases-create");
|
|
103
|
+
client.firestore.databases.update = loadCommand("firestore-databases-update");
|
|
104
|
+
client.firestore.databases.delete = loadCommand("firestore-databases-delete");
|
|
105
|
+
client.functions = {};
|
|
106
|
+
client.functions.config = {};
|
|
107
|
+
client.functions.config.clone = loadCommand("functions-config-clone");
|
|
108
|
+
client.functions.config.export = loadCommand("functions-config-export");
|
|
109
|
+
client.functions.config.get = loadCommand("functions-config-get");
|
|
110
|
+
client.functions.config.set = loadCommand("functions-config-set");
|
|
111
|
+
client.functions.config.unset = loadCommand("functions-config-unset");
|
|
112
|
+
client.functions.delete = loadCommand("functions-delete");
|
|
113
|
+
client.functions.log = loadCommand("functions-log");
|
|
114
|
+
client.functions.shell = loadCommand("functions-shell");
|
|
115
|
+
client.functions.list = loadCommand("functions-list");
|
|
116
|
+
if (experiments.isEnabled("deletegcfartifacts")) {
|
|
117
|
+
client.functions.deletegcfartifacts = loadCommand("functions-deletegcfartifacts");
|
|
118
|
+
}
|
|
119
|
+
client.functions.secrets = {};
|
|
120
|
+
client.functions.secrets.access = loadCommand("functions-secrets-access");
|
|
121
|
+
client.functions.secrets.destroy = loadCommand("functions-secrets-destroy");
|
|
122
|
+
client.functions.secrets.get = loadCommand("functions-secrets-get");
|
|
123
|
+
client.functions.secrets.prune = loadCommand("functions-secrets-prune");
|
|
124
|
+
client.functions.secrets.set = loadCommand("functions-secrets-set");
|
|
125
|
+
client.help = loadCommand("help");
|
|
126
|
+
client.hosting = {};
|
|
127
|
+
client.hosting.channel = {};
|
|
128
|
+
client.hosting.channel.create = loadCommand("hosting-channel-create");
|
|
129
|
+
client.hosting.channel.delete = loadCommand("hosting-channel-delete");
|
|
130
|
+
client.hosting.channel.deploy = loadCommand("hosting-channel-deploy");
|
|
131
|
+
client.hosting.channel.list = loadCommand("hosting-channel-list");
|
|
132
|
+
client.hosting.channel.open = loadCommand("hosting-channel-open");
|
|
133
|
+
client.hosting.clone = loadCommand("hosting-clone");
|
|
134
|
+
client.hosting.disable = loadCommand("hosting-disable");
|
|
135
|
+
client.hosting.sites = {};
|
|
136
|
+
client.hosting.sites.create = loadCommand("hosting-sites-create");
|
|
137
|
+
client.hosting.sites.delete = loadCommand("hosting-sites-delete");
|
|
138
|
+
client.hosting.sites.get = loadCommand("hosting-sites-get");
|
|
139
|
+
client.hosting.sites.list = loadCommand("hosting-sites-list");
|
|
140
|
+
client.init = loadCommand("init");
|
|
141
|
+
if (experiments.isEnabled("internaltesting")) {
|
|
142
|
+
client.internaltesting = {};
|
|
143
|
+
client.internaltesting.frameworks = {};
|
|
144
|
+
client.internaltesting.frameworks.compose = loadCommand("internaltesting-frameworks-compose");
|
|
145
|
+
client.internaltesting.functions = {};
|
|
146
|
+
client.internaltesting.functions.discover = loadCommand("internaltesting-functions-discover");
|
|
147
|
+
}
|
|
148
|
+
if (experiments.isEnabled("internalframeworks")) {
|
|
149
|
+
client.frameworks = {};
|
|
150
|
+
client.frameworks.backends = {};
|
|
151
|
+
client.frameworks.backends.list = loadCommand("frameworks-backends-list");
|
|
152
|
+
client.frameworks.backends.create = loadCommand("frameworks-backends-create");
|
|
153
|
+
client.frameworks.backends.get = loadCommand("frameworks-backends-get");
|
|
154
|
+
client.frameworks.backends.delete = loadCommand("frameworks-backends-delete");
|
|
155
|
+
}
|
|
156
|
+
client.login = loadCommand("login");
|
|
157
|
+
client.login.add = loadCommand("login-add");
|
|
158
|
+
client.login.ci = loadCommand("login-ci");
|
|
159
|
+
client.login.list = loadCommand("login-list");
|
|
160
|
+
client.login.use = loadCommand("login-use");
|
|
161
|
+
client.logout = loadCommand("logout");
|
|
162
|
+
client.open = loadCommand("open");
|
|
163
|
+
client.projects = {};
|
|
164
|
+
client.projects.addfirebase = loadCommand("projects-addfirebase");
|
|
165
|
+
client.projects.create = loadCommand("projects-create");
|
|
166
|
+
client.projects.list = loadCommand("projects-list");
|
|
167
|
+
client.remoteconfig = {};
|
|
168
|
+
client.remoteconfig.get = loadCommand("remoteconfig-get");
|
|
169
|
+
client.remoteconfig.rollback = loadCommand("remoteconfig-rollback");
|
|
170
|
+
client.remoteconfig.versions = {};
|
|
171
|
+
client.remoteconfig.versions.list = loadCommand("remoteconfig-versions-list");
|
|
172
|
+
client.serve = loadCommand("serve");
|
|
173
|
+
client.setup = {};
|
|
174
|
+
client.setup.emulators = {};
|
|
175
|
+
client.setup.emulators.database = loadCommand("setup-emulators-database");
|
|
176
|
+
client.setup.emulators.firestore = loadCommand("setup-emulators-firestore");
|
|
177
|
+
client.setup.emulators.pubsub = loadCommand("setup-emulators-pubsub");
|
|
178
|
+
client.setup.emulators.storage = loadCommand("setup-emulators-storage");
|
|
179
|
+
client.setup.emulators.ui = loadCommand("setup-emulators-ui");
|
|
180
|
+
client.target = loadCommand("target");
|
|
181
|
+
client.target.apply = loadCommand("target-apply");
|
|
182
|
+
client.target.clear = loadCommand("target-clear");
|
|
183
|
+
client.target.remove = loadCommand("target-remove");
|
|
184
|
+
client.use = loadCommand("use");
|
|
185
|
+
const t1 = process.hrtime.bigint();
|
|
186
|
+
const diffMS = (t1 - t0) / BigInt(1e6);
|
|
187
|
+
if (diffMS > 100) {
|
|
188
|
+
}
|
|
189
|
+
return client;
|
|
190
|
+
}
|
|
191
|
+
exports.load = load;
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.initAction = exports.command = void 0;
|
|
4
|
+
const clc = require("colorette");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
const os = require("os");
|
|
7
|
+
const path = require("path");
|
|
8
|
+
const command_1 = require("../command");
|
|
9
|
+
const config_1 = require("../config");
|
|
10
|
+
const auth_1 = require("../auth");
|
|
11
|
+
const init_1 = require("../init");
|
|
12
|
+
const logger_1 = require("../logger");
|
|
13
|
+
const prompt_1 = require("../prompt");
|
|
14
|
+
const requireAuth_1 = require("../requireAuth");
|
|
15
|
+
const fsutils = require("../fsutils");
|
|
16
|
+
const utils = require("../utils");
|
|
17
|
+
const experiments_1 = require("../experiments");
|
|
18
|
+
const homeDir = os.homedir();
|
|
19
|
+
const TEMPLATE_ROOT = path.resolve(__dirname, "../../templates/");
|
|
20
|
+
const BANNER_TEXT = fs.readFileSync(path.join(TEMPLATE_ROOT, "banner.txt"), "utf8");
|
|
21
|
+
const GITIGNORE_TEMPLATE = fs.readFileSync(path.join(TEMPLATE_ROOT, "_gitignore"), "utf8");
|
|
22
|
+
function isOutside(from, to) {
|
|
23
|
+
return !!/^\.\./.exec(path.relative(from, to));
|
|
24
|
+
}
|
|
25
|
+
const choices = [
|
|
26
|
+
{
|
|
27
|
+
value: "database",
|
|
28
|
+
name: "Realtime Database: Configure a security rules file for Realtime Database and (optionally) provision default instance",
|
|
29
|
+
checked: false,
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
value: "firestore",
|
|
33
|
+
name: "Firestore: Configure security rules and indexes files for Firestore",
|
|
34
|
+
checked: false,
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
value: "functions",
|
|
38
|
+
name: "Functions: Configure a Cloud Functions directory and its files",
|
|
39
|
+
checked: false,
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
value: "hosting",
|
|
43
|
+
name: "Hosting: Configure files for Firebase Hosting and (optionally) set up GitHub Action deploys",
|
|
44
|
+
checked: false,
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
value: "hosting:github",
|
|
48
|
+
name: "Hosting: Set up GitHub Action deploys",
|
|
49
|
+
checked: false,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
value: "storage",
|
|
53
|
+
name: "Storage: Configure a security rules file for Cloud Storage",
|
|
54
|
+
checked: false,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
value: "emulators",
|
|
58
|
+
name: "Emulators: Set up local emulators for Firebase products",
|
|
59
|
+
checked: false,
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
value: "remoteconfig",
|
|
63
|
+
name: "Remote Config: Configure a template file for Remote Config",
|
|
64
|
+
checked: false,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
value: "extensions",
|
|
68
|
+
name: "Extensions: Set up an empty Extensions manifest",
|
|
69
|
+
checked: false,
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
if ((0, experiments_1.isEnabled)("internalframeworks")) {
|
|
73
|
+
choices.push({
|
|
74
|
+
value: "internalframeworks",
|
|
75
|
+
name: "Frameworks: Get started with Frameworks projects.",
|
|
76
|
+
checked: false,
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
const featureNames = choices.map((choice) => choice.value);
|
|
80
|
+
const DESCRIPTION = `Interactively configure the current directory as a Firebase project or initialize new features in an already configured Firebase project directory.
|
|
81
|
+
|
|
82
|
+
This command will create or update 'firebase.json' and '.firebaserc' configuration files in the current directory.
|
|
83
|
+
|
|
84
|
+
To initialize a specific Firebase feature, run 'firebase init [feature]'. Valid features are:
|
|
85
|
+
${[...featureNames]
|
|
86
|
+
.sort()
|
|
87
|
+
.map((n) => `\n - ${n}`)
|
|
88
|
+
.join("")}`;
|
|
89
|
+
exports.command = new command_1.Command("init [feature]")
|
|
90
|
+
.description(DESCRIPTION)
|
|
91
|
+
.before(requireAuth_1.requireAuth)
|
|
92
|
+
.action(initAction);
|
|
93
|
+
function initAction(feature, options) {
|
|
94
|
+
if (feature && !featureNames.includes(feature)) {
|
|
95
|
+
return utils.reject(clc.bold(feature) +
|
|
96
|
+
" is not a supported feature; must be one of " +
|
|
97
|
+
featureNames.join(", ") +
|
|
98
|
+
".");
|
|
99
|
+
}
|
|
100
|
+
const cwd = options.cwd || process.cwd();
|
|
101
|
+
const warnings = [];
|
|
102
|
+
let warningText = "";
|
|
103
|
+
if (isOutside(homeDir, cwd)) {
|
|
104
|
+
warnings.push("You are currently outside your home directory");
|
|
105
|
+
}
|
|
106
|
+
if (cwd === homeDir) {
|
|
107
|
+
warnings.push("You are initializing your home directory as a Firebase project directory");
|
|
108
|
+
}
|
|
109
|
+
const existingConfig = config_1.Config.load(options, true);
|
|
110
|
+
if (existingConfig) {
|
|
111
|
+
warnings.push("You are initializing within an existing Firebase project directory");
|
|
112
|
+
}
|
|
113
|
+
const config = existingConfig !== null ? existingConfig : new config_1.Config({}, { projectDir: cwd, cwd: cwd });
|
|
114
|
+
if (warnings.length) {
|
|
115
|
+
warningText =
|
|
116
|
+
"\nBefore we get started, keep in mind:\n\n " +
|
|
117
|
+
clc.yellow(clc.bold("* ")) +
|
|
118
|
+
warnings.join("\n " + clc.yellow(clc.bold("* "))) +
|
|
119
|
+
"\n";
|
|
120
|
+
}
|
|
121
|
+
logger_1.logger.info(clc.yellow(clc.bold(BANNER_TEXT)) +
|
|
122
|
+
"\nYou're about to initialize a Firebase project in this directory:\n\n " +
|
|
123
|
+
clc.bold(config.projectDir) +
|
|
124
|
+
"\n" +
|
|
125
|
+
warningText);
|
|
126
|
+
const setup = {
|
|
127
|
+
config: config.src,
|
|
128
|
+
rcfile: config.readProjectFile(".firebaserc", {
|
|
129
|
+
json: true,
|
|
130
|
+
fallback: {},
|
|
131
|
+
}),
|
|
132
|
+
};
|
|
133
|
+
let next;
|
|
134
|
+
if (process.platform === "win32") {
|
|
135
|
+
next = (0, prompt_1.promptOnce)({
|
|
136
|
+
type: "confirm",
|
|
137
|
+
message: "Are you ready to proceed?",
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
next = Promise.resolve(true);
|
|
142
|
+
}
|
|
143
|
+
return next
|
|
144
|
+
.then((proceed) => {
|
|
145
|
+
if (!proceed) {
|
|
146
|
+
return utils.reject("Aborted by user.", { exit: 1 });
|
|
147
|
+
}
|
|
148
|
+
if (feature) {
|
|
149
|
+
setup.featureArg = true;
|
|
150
|
+
setup.features = [feature];
|
|
151
|
+
return undefined;
|
|
152
|
+
}
|
|
153
|
+
return (0, prompt_1.prompt)(setup, [
|
|
154
|
+
{
|
|
155
|
+
type: "checkbox",
|
|
156
|
+
name: "features",
|
|
157
|
+
message: "Which Firebase features do you want to set up for this directory? " +
|
|
158
|
+
"Press Space to select features, then Enter to confirm your choices.",
|
|
159
|
+
choices: choices,
|
|
160
|
+
},
|
|
161
|
+
]);
|
|
162
|
+
})
|
|
163
|
+
.then(() => {
|
|
164
|
+
var _a;
|
|
165
|
+
if (!setup.features || ((_a = setup.features) === null || _a === void 0 ? void 0 : _a.length) === 0) {
|
|
166
|
+
return utils.reject("Must select at least one feature. Use " +
|
|
167
|
+
clc.bold(clc.underline("SPACEBAR")) +
|
|
168
|
+
" to select features, or specify a feature by running " +
|
|
169
|
+
clc.bold("firebase init [feature_name]"));
|
|
170
|
+
}
|
|
171
|
+
setup.features.unshift("project");
|
|
172
|
+
const allAccounts = (0, auth_1.getAllAccounts)();
|
|
173
|
+
if (allAccounts.length > 1) {
|
|
174
|
+
setup.features.unshift("account");
|
|
175
|
+
}
|
|
176
|
+
if (setup.features.includes("hosting") && setup.features.includes("hosting:github")) {
|
|
177
|
+
setup.features = setup.features.filter((f) => f !== "hosting:github");
|
|
178
|
+
}
|
|
179
|
+
return (0, init_1.init)(setup, config, options);
|
|
180
|
+
})
|
|
181
|
+
.then(() => {
|
|
182
|
+
logger_1.logger.info();
|
|
183
|
+
utils.logBullet("Writing configuration info to " + clc.bold("firebase.json") + "...");
|
|
184
|
+
config.writeProjectFile("firebase.json", setup.config);
|
|
185
|
+
utils.logBullet("Writing project information to " + clc.bold(".firebaserc") + "...");
|
|
186
|
+
config.writeProjectFile(".firebaserc", setup.rcfile);
|
|
187
|
+
if (!fsutils.fileExistsSync(config.path(".gitignore"))) {
|
|
188
|
+
utils.logBullet("Writing gitignore file to " + clc.bold(".gitignore") + "...");
|
|
189
|
+
config.writeProjectFile(".gitignore", GITIGNORE_TEMPLATE);
|
|
190
|
+
}
|
|
191
|
+
logger_1.logger.info();
|
|
192
|
+
utils.logSuccess("Firebase initialization complete!");
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
exports.initAction = initAction;
|