firebase-tools-with-isolate 14.10.1-1 → 14.16.0
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/lib/api.js +5 -1
- package/lib/apphosting/backend.js +40 -15
- package/lib/apptesting/ensureProjectConfigured.js +56 -0
- package/lib/apptesting/invokeTests.js +40 -0
- package/lib/apptesting/parseTestFiles.js +75 -0
- package/lib/apptesting/types.js +18 -0
- package/lib/auth.js +37 -2
- package/lib/command.js +24 -5
- package/lib/commands/apphosting-backends-create.js +8 -5
- package/lib/commands/apptesting-execute.js +101 -0
- package/lib/commands/dataconnect-sdk-generate.js +28 -26
- package/lib/commands/dataconnect-services-list.js +1 -1
- package/lib/commands/dataconnect-sql-diff.js +2 -2
- package/lib/commands/dataconnect-sql-grant.js +7 -2
- package/lib/commands/dataconnect-sql-migrate.js +2 -2
- package/lib/commands/dataconnect-sql-setup.js +3 -5
- package/lib/commands/dataconnect-sql-shell.js +2 -2
- package/lib/commands/ext-export.js +1 -1
- package/lib/commands/firestore-bulkdelete.js +73 -0
- package/lib/commands/firestore-databases-create.js +11 -0
- package/lib/commands/firestore-operations-cancel.js +44 -0
- package/lib/commands/firestore-operations-describe.js +29 -0
- package/lib/commands/firestore-operations-list.js +29 -0
- package/lib/commands/firestore-utils.js +15 -0
- package/lib/commands/functions-config-clone.js +2 -0
- package/lib/commands/functions-config-export.js +5 -2
- package/lib/commands/functions-config-get.js +2 -0
- package/lib/commands/functions-config-set.js +2 -0
- package/lib/commands/functions-config-unset.js +2 -0
- package/lib/commands/index.js +9 -0
- package/lib/commands/init.js +24 -4
- package/lib/commands/internaltesting-functions-discover.js +20 -5
- package/lib/commands/login.js +13 -9
- package/lib/commands/use.js +5 -0
- package/lib/config.js +16 -4
- package/lib/crashlytics/addNote.js +27 -0
- package/lib/crashlytics/buildToolsJarHelper.js +1 -2
- package/lib/crashlytics/deleteNote.js +23 -0
- package/lib/crashlytics/getIssueDetails.js +26 -0
- package/lib/crashlytics/getSampleCrash.js +34 -0
- package/lib/crashlytics/listNotes.js +29 -0
- package/lib/crashlytics/listTopDevices.js +33 -0
- package/lib/crashlytics/listTopIssues.js +8 -23
- package/lib/crashlytics/listTopOperatingSystems.js +32 -0
- package/lib/crashlytics/listTopVersions.js +32 -0
- package/lib/crashlytics/updateIssue.js +35 -0
- package/lib/crashlytics/utils.js +38 -0
- package/lib/dataconnect/appFinder.js +102 -0
- package/lib/dataconnect/client.js +23 -15
- package/lib/dataconnect/ensureApis.js +6 -9
- package/lib/dataconnect/errors.js +7 -1
- package/lib/dataconnect/freeTrial.js +16 -38
- package/lib/dataconnect/load.js +105 -6
- package/lib/dataconnect/provisionCloudSql.js +67 -70
- package/lib/dataconnect/schemaMigration.js +219 -169
- package/lib/deploy/dataconnect/deploy.js +7 -9
- package/lib/deploy/dataconnect/prepare.js +7 -12
- package/lib/deploy/dataconnect/release.js +43 -31
- package/lib/deploy/firestore/deploy.js +10 -0
- package/lib/deploy/functions/backend.js +7 -1
- package/lib/deploy/functions/build.js +28 -14
- package/lib/deploy/functions/deploy.js +3 -2
- package/lib/deploy/functions/ensure.js +1 -1
- package/lib/deploy/functions/functionsDeployHelper.js +8 -1
- package/lib/deploy/functions/params.js +4 -0
- package/lib/deploy/functions/prepare.js +25 -13
- package/lib/deploy/functions/pricing.js +12 -5
- package/lib/deploy/functions/release/fabricator.js +25 -3
- package/lib/deploy/functions/release/reporter.js +1 -0
- package/lib/deploy/functions/runtimes/discovery/index.js +52 -5
- package/lib/deploy/functions/runtimes/node/index.js +83 -51
- package/lib/emulator/auth/operations.js +10 -1
- package/lib/emulator/commandUtils.js +7 -1
- package/lib/emulator/controller.js +22 -34
- package/lib/emulator/dataconnectEmulator.js +27 -24
- package/lib/emulator/downloadableEmulatorInfo.json +18 -18
- package/lib/emulator/env.js +2 -1
- package/lib/emulator/functionsEmulator.js +12 -2
- package/lib/emulator/hub.js +11 -8
- package/lib/emulator/tasksEmulator.js +1 -1
- package/lib/emulator/ui.js +3 -1
- package/lib/env.js +18 -0
- package/lib/experiments.js +20 -0
- package/lib/extensions/extensionsHelper.js +4 -15
- package/lib/extensions/runtimes/common.js +3 -2
- package/lib/extensions/utils.js +1 -12
- package/lib/firestore/api-sort.js +96 -3
- package/lib/firestore/api-types.js +20 -1
- package/lib/firestore/api.js +144 -15
- package/lib/firestore/pretty-print.js +35 -1
- package/lib/firestore/validator.js +1 -1
- package/lib/functional.js +7 -1
- package/lib/functions/deprecationWarnings.js +21 -0
- package/lib/functions/env.js +31 -16
- package/lib/functions/projectConfig.js +87 -8
- package/lib/functions/secrets.js +3 -0
- package/lib/gcp/cloudfunctions.js +1 -6
- package/lib/gcp/cloudfunctionsv2.js +3 -39
- package/lib/gcp/cloudscheduler.js +1 -1
- package/lib/gcp/cloudsql/cloudsqladmin.js +4 -16
- package/lib/gcp/cloudsql/connect.js +4 -3
- package/lib/gcp/cloudsql/permissionsSetup.js +23 -16
- package/lib/gcp/k8s.js +32 -0
- package/lib/gcp/runv2.js +181 -0
- package/lib/gemini/fdcExperience.js +5 -3
- package/lib/init/features/aitools/claude.js +43 -0
- package/lib/init/features/aitools/cursor.js +61 -0
- package/lib/init/features/aitools/gemini.js +58 -0
- package/lib/init/features/aitools/index.js +28 -0
- package/lib/init/features/aitools/promptUpdater.js +111 -0
- package/lib/init/features/aitools/studio.js +17 -0
- package/lib/init/features/aitools/types.js +2 -0
- package/lib/init/features/aitools.js +83 -0
- package/lib/init/features/apptesting/index.js +34 -0
- package/lib/init/features/dataconnect/create_app.js +53 -0
- package/lib/init/features/dataconnect/index.js +280 -186
- package/lib/init/features/dataconnect/sdk.js +232 -144
- package/lib/init/features/index.js +8 -3
- package/lib/init/features/project.js +4 -0
- package/lib/init/index.js +18 -2
- package/lib/management/apps.js +3 -3
- package/lib/management/studio.js +120 -0
- package/lib/mcp/errors.js +5 -7
- package/lib/mcp/index.js +179 -61
- package/lib/mcp/logging-transport.js +23 -0
- package/lib/mcp/prompt.js +10 -0
- package/lib/mcp/prompts/core/deploy.js +101 -0
- package/lib/mcp/prompts/core/index.js +5 -0
- package/lib/mcp/prompts/crashlytics/connect.js +114 -0
- package/lib/mcp/prompts/crashlytics/index.js +5 -0
- package/lib/mcp/prompts/dataconnect/index.js +9 -0
- package/lib/mcp/prompts/dataconnect/schema.js +67 -0
- package/lib/mcp/prompts/index.js +47 -0
- package/lib/mcp/tools/apphosting/fetch_logs.js +22 -22
- package/lib/mcp/tools/apphosting/list_backends.js +10 -10
- package/lib/mcp/tools/auth/disable_user.js +7 -7
- package/lib/mcp/tools/auth/get_user.js +13 -6
- package/lib/mcp/tools/auth/index.js +10 -10
- package/lib/mcp/tools/auth/list_users.js +6 -6
- package/lib/mcp/tools/auth/set_claims.js +7 -7
- package/lib/mcp/tools/auth/set_sms_region_policy.js +6 -6
- package/lib/mcp/tools/core/consult_assistant.js +13 -8
- package/lib/mcp/tools/core/create_android_sha.js +9 -9
- package/lib/mcp/tools/core/create_app.js +7 -7
- package/lib/mcp/tools/core/create_project.js +13 -13
- package/lib/mcp/tools/core/get_admin_sdk_config.js +7 -7
- package/lib/mcp/tools/core/get_environment.js +8 -8
- package/lib/mcp/tools/core/get_project.js +5 -5
- package/lib/mcp/tools/core/get_sdk_config.js +19 -9
- package/lib/mcp/tools/core/index.js +28 -24
- package/lib/mcp/tools/core/init.js +39 -16
- package/lib/mcp/tools/core/list_apps.js +6 -6
- package/lib/mcp/tools/core/list_projects.js +6 -6
- package/lib/mcp/tools/core/login.js +46 -0
- package/lib/mcp/tools/core/logout.js +62 -0
- package/lib/mcp/tools/core/update_environment.js +10 -10
- package/lib/mcp/tools/crashlytics/add_note.js +32 -0
- package/lib/mcp/tools/crashlytics/constants.js +11 -0
- package/lib/mcp/tools/crashlytics/delete_note.js +35 -0
- package/lib/mcp/tools/crashlytics/get_issue_details.js +31 -0
- package/lib/mcp/tools/crashlytics/get_sample_crash.js +43 -0
- package/lib/mcp/tools/crashlytics/index.js +22 -2
- package/lib/mcp/tools/crashlytics/list_notes.js +37 -0
- package/lib/mcp/tools/crashlytics/list_top_devices.js +33 -0
- package/lib/mcp/tools/crashlytics/list_top_issues.js +12 -13
- package/lib/mcp/tools/crashlytics/list_top_operating_systems.js +33 -0
- package/lib/mcp/tools/crashlytics/list_top_versions.js +33 -0
- package/lib/mcp/tools/crashlytics/update_issue.js +37 -0
- package/lib/mcp/tools/database/get_data.js +49 -0
- package/lib/mcp/tools/database/get_rules.js +39 -0
- package/lib/mcp/tools/database/index.js +8 -0
- package/lib/mcp/tools/database/set_data.js +57 -0
- package/lib/mcp/tools/database/validate_rules.js +41 -0
- package/lib/mcp/tools/dataconnect/compile.js +43 -0
- package/lib/mcp/tools/dataconnect/execute.js +71 -0
- package/lib/mcp/tools/dataconnect/generate_operation.js +8 -8
- package/lib/mcp/tools/dataconnect/generate_schema.js +6 -6
- package/lib/mcp/tools/dataconnect/index.js +10 -18
- package/lib/mcp/tools/dataconnect/list_services.js +107 -11
- package/lib/mcp/tools/firestore/delete_document.js +13 -13
- package/lib/mcp/tools/firestore/get_documents.js +13 -13
- package/lib/mcp/tools/firestore/list_collections.js +7 -10
- package/lib/mcp/tools/firestore/query_collection.js +13 -13
- package/lib/mcp/tools/index.js +24 -18
- package/lib/mcp/tools/messaging/index.js +2 -2
- package/lib/mcp/tools/messaging/send_message.js +7 -7
- package/lib/mcp/tools/remoteconfig/get_template.js +5 -5
- package/lib/mcp/tools/remoteconfig/index.js +4 -4
- package/lib/mcp/tools/remoteconfig/publish_template.js +7 -7
- package/lib/mcp/tools/remoteconfig/rollback_template.js +6 -6
- package/lib/mcp/tools/rules/get_rules.js +8 -8
- package/lib/mcp/tools/rules/validate_rules.js +10 -10
- package/lib/mcp/tools/storage/get_download_url.js +8 -8
- package/lib/mcp/tools/storage/get_rules.js +8 -8
- package/lib/mcp/types.js +2 -0
- package/lib/mcp/util/dataconnect/compile.js +20 -0
- package/lib/mcp/util/dataconnect/content.js +655 -0
- package/lib/mcp/util/dataconnect/emulator.js +16 -0
- package/lib/mcp/util.js +5 -18
- package/lib/requireAuth.js +14 -4
- package/lib/rtdb.js +10 -6
- package/lib/scopes.js +2 -1
- package/lib/serve/functions.js +4 -3
- package/lib/timeout.js +21 -0
- package/lib/track.js +18 -1
- package/lib/unzip.js +13 -0
- package/lib/utils.js +76 -2
- package/package.json +6 -4
- package/prompts/FIREBASE.md +121 -0
- package/prompts/FIREBASE_FUNCTIONS.md +221 -0
- package/schema/apptesting-yaml.json +64 -0
- package/schema/firebase-config.json +163 -53
- package/templates/init/aitools/cursor-rules-header.txt +8 -0
- package/templates/init/aitools/gemini-extension.json +11 -0
- package/templates/init/apptesting/smoke_test.yaml +6 -0
- package/templates/init/dataconnect/connector.yaml +0 -16
- package/templates/init/dataconnect/dataconnect.yaml +2 -1
- package/templates/init/dataconnect/mutations.gql +29 -29
- package/templates/init/dataconnect/queries.gql +73 -73
- package/templates/init/dataconnect/schema.gql +48 -48
- package/templates/init/firestore/firestore.indexes.json +26 -1
- package/lib/dataconnect/fileUtils.js +0 -168
- package/lib/emulator/adminSdkConfig.test.js +0 -16
- package/lib/extensions/resolveSource.js +0 -23
- package/lib/firestore/api-sort.test.js +0 -74
- package/lib/firestore/backupUtils.test.js +0 -18
- package/lib/firestore/pretty-print.test.js +0 -61
- package/lib/firestore/util.test.js +0 -42
- package/lib/mcp/tools/dataconnect/emulator.js +0 -16
- package/lib/mcp/tools/dataconnect/execute_graphql.js +0 -48
- package/lib/mcp/tools/dataconnect/execute_graphql_read.js +0 -48
- package/lib/mcp/tools/dataconnect/execute_mutation.js +0 -62
- package/lib/mcp/tools/dataconnect/execute_query.js +0 -62
- package/lib/mcp/tools/dataconnect/get_connector.js +0 -31
- package/lib/mcp/tools/dataconnect/get_schema.js +0 -31
- /package/lib/mcp/{tools → util}/dataconnect/converter.js +0 -0
|
@@ -1,97 +1,198 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.actuate = exports.
|
|
3
|
+
exports.addSdkGenerateToConnectorYaml = exports.actuate = exports.askQuestions = exports.FDC_SDK_PLATFORM_ENV = exports.FDC_SDK_FRAMEWORKS_ENV = exports.FDC_APP_FOLDER = void 0;
|
|
4
4
|
const yaml = require("yaml");
|
|
5
5
|
const clc = require("colorette");
|
|
6
6
|
const path = require("path");
|
|
7
|
-
const
|
|
7
|
+
const cwd = process.cwd();
|
|
8
8
|
const prompt_1 = require("../../../prompt");
|
|
9
|
-
const
|
|
9
|
+
const appFinder_1 = require("../../../dataconnect/appFinder");
|
|
10
10
|
const load_1 = require("../../../dataconnect/load");
|
|
11
11
|
const types_1 = require("../../../dataconnect/types");
|
|
12
|
-
const dataconnectEmulator_1 = require("../../../emulator/dataconnectEmulator");
|
|
13
12
|
const error_1 = require("../../../error");
|
|
14
13
|
const lodash_1 = require("lodash");
|
|
15
14
|
const utils_1 = require("../../../utils");
|
|
15
|
+
const dataconnectEmulator_1 = require("../../../emulator/dataconnectEmulator");
|
|
16
16
|
const auth_1 = require("../../../auth");
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
17
|
+
const create_app_1 = require("./create_app");
|
|
18
|
+
const track_1 = require("../../../track");
|
|
19
|
+
const fsutils_1 = require("../../../fsutils");
|
|
20
|
+
exports.FDC_APP_FOLDER = "FDC_APP_FOLDER";
|
|
21
|
+
exports.FDC_SDK_FRAMEWORKS_ENV = "FDC_SDK_FRAMEWORKS";
|
|
22
|
+
exports.FDC_SDK_PLATFORM_ENV = "FDC_SDK_PLATFORM";
|
|
23
|
+
async function askQuestions(setup) {
|
|
24
|
+
const info = {
|
|
25
|
+
apps: [],
|
|
26
|
+
};
|
|
27
|
+
info.apps = await chooseApp();
|
|
28
|
+
if (!info.apps.length) {
|
|
29
|
+
const npxMissingWarning = (0, utils_1.commandExistsSync)("npx")
|
|
30
|
+
? ""
|
|
31
|
+
: clc.yellow(" (you need to install Node.js first)");
|
|
32
|
+
const flutterMissingWarning = (0, utils_1.commandExistsSync)("flutter")
|
|
33
|
+
? ""
|
|
34
|
+
: clc.yellow(" (you need to install Flutter first)");
|
|
35
|
+
const choice = await (0, prompt_1.select)({
|
|
36
|
+
message: `Do you want to create an app template?`,
|
|
37
|
+
choices: [
|
|
38
|
+
{ name: `React${npxMissingWarning}`, value: "react" },
|
|
39
|
+
{ name: `Next.JS${npxMissingWarning}`, value: "next" },
|
|
40
|
+
{ name: `Flutter${flutterMissingWarning}`, value: "flutter" },
|
|
41
|
+
{ name: "no", value: "no" },
|
|
42
|
+
],
|
|
43
|
+
});
|
|
44
|
+
switch (choice) {
|
|
45
|
+
case "react":
|
|
46
|
+
await (0, create_app_1.createReactApp)((0, utils_1.newUniqueId)("web-app", (0, fsutils_1.listFiles)(cwd)));
|
|
47
|
+
break;
|
|
48
|
+
case "next":
|
|
49
|
+
await (0, create_app_1.createNextApp)((0, utils_1.newUniqueId)("web-app", (0, fsutils_1.listFiles)(cwd)));
|
|
50
|
+
break;
|
|
51
|
+
case "flutter":
|
|
52
|
+
await (0, create_app_1.createFlutterApp)((0, utils_1.newUniqueId)("flutter_app", (0, fsutils_1.listFiles)(cwd)));
|
|
53
|
+
break;
|
|
54
|
+
case "no":
|
|
55
|
+
break;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
setup.featureInfo = setup.featureInfo || {};
|
|
59
|
+
setup.featureInfo.dataconnectSdk = info;
|
|
22
60
|
}
|
|
23
|
-
exports.
|
|
24
|
-
async function
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
61
|
+
exports.askQuestions = askQuestions;
|
|
62
|
+
async function chooseApp() {
|
|
63
|
+
let apps = await (0, appFinder_1.detectApps)(cwd);
|
|
64
|
+
if (apps.length) {
|
|
65
|
+
(0, utils_1.logLabeledSuccess)("dataconnect", `Detected existing apps ${apps.map((a) => (0, appFinder_1.appDescription)(a)).join(", ")}`);
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
(0, utils_1.logLabeledWarning)("dataconnect", "No app exists in the current directory.");
|
|
69
|
+
}
|
|
70
|
+
const envAppFolder = (0, utils_1.envOverride)(exports.FDC_APP_FOLDER, "");
|
|
71
|
+
const envPlatform = (0, utils_1.envOverride)(exports.FDC_SDK_PLATFORM_ENV, types_1.Platform.NONE);
|
|
72
|
+
const envFrameworks = (0, utils_1.envOverride)(exports.FDC_SDK_FRAMEWORKS_ENV, "")
|
|
73
|
+
.split(",")
|
|
74
|
+
.map((f) => f);
|
|
75
|
+
if (envAppFolder && envPlatform !== types_1.Platform.NONE) {
|
|
76
|
+
const envAppRelDir = path.relative(cwd, path.resolve(cwd, envAppFolder));
|
|
77
|
+
const matchedApps = apps.filter((app) => app.directory === envAppRelDir && (!app.platform || app.platform === envPlatform));
|
|
78
|
+
if (matchedApps.length) {
|
|
79
|
+
for (const a of matchedApps) {
|
|
80
|
+
a.frameworks = [...(a.frameworks || []), ...envFrameworks];
|
|
81
|
+
}
|
|
82
|
+
return matchedApps;
|
|
83
|
+
}
|
|
84
|
+
return [
|
|
85
|
+
{
|
|
86
|
+
platform: envPlatform,
|
|
87
|
+
directory: envAppRelDir,
|
|
88
|
+
frameworks: envFrameworks,
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
}
|
|
92
|
+
if (apps.length >= 2) {
|
|
93
|
+
const choices = apps.map((a) => {
|
|
30
94
|
return {
|
|
31
|
-
name:
|
|
32
|
-
value:
|
|
95
|
+
name: (0, appFinder_1.appDescription)(a),
|
|
96
|
+
value: a,
|
|
97
|
+
checked: a.directory === ".",
|
|
33
98
|
};
|
|
34
99
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
throw new error_1.FirebaseError(`Your config has no connectors to set up SDKs for. Run ${clc.bold("firebase init dataconnect")} to set up a service and connectors.`);
|
|
39
|
-
}
|
|
40
|
-
let appDir = process.env[exports.FDC_APP_FOLDER] || process.cwd();
|
|
41
|
-
let targetPlatform = await (0, fileUtils_1.getPlatformFromFolder)(appDir);
|
|
42
|
-
if (targetPlatform === types_1.Platform.NONE && !process.env[exports.FDC_APP_FOLDER]?.length) {
|
|
43
|
-
appDir = await (0, utils_1.promptForDirectory)({
|
|
44
|
-
config,
|
|
45
|
-
message: "Where is your app directory? Leave blank to set up a generated SDK in your current directory.",
|
|
100
|
+
const pickedApps = await (0, prompt_1.checkbox)({
|
|
101
|
+
message: "Which apps do you want to set up Data Connect SDKs in?",
|
|
102
|
+
choices,
|
|
46
103
|
});
|
|
47
|
-
|
|
104
|
+
if (!pickedApps.length) {
|
|
105
|
+
throw new error_1.FirebaseError("Command Aborted. Please choose at least one app.");
|
|
106
|
+
}
|
|
107
|
+
apps = pickedApps;
|
|
108
|
+
}
|
|
109
|
+
return apps;
|
|
110
|
+
}
|
|
111
|
+
async function actuate(setup, config) {
|
|
112
|
+
const fdcInfo = setup.featureInfo?.dataconnect;
|
|
113
|
+
const sdkInfo = setup.featureInfo?.dataconnectSdk;
|
|
114
|
+
if (!sdkInfo) {
|
|
115
|
+
throw new Error("Data Connect SDK feature RequiredInfo is not provided");
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
await actuateWithInfo(setup, config, sdkInfo);
|
|
48
119
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
120
|
+
finally {
|
|
121
|
+
let flow = "no_app";
|
|
122
|
+
if (sdkInfo.apps.length) {
|
|
123
|
+
const platforms = sdkInfo.apps.map((a) => a.platform.toLowerCase()).sort();
|
|
124
|
+
flow = `${platforms.join("_")}_app`;
|
|
125
|
+
}
|
|
126
|
+
if (fdcInfo) {
|
|
127
|
+
fdcInfo.analyticsFlow += `_${flow}`;
|
|
52
128
|
}
|
|
53
129
|
else {
|
|
54
|
-
(0,
|
|
130
|
+
void (0, track_1.trackGA4)("dataconnect_init", {
|
|
131
|
+
project_status: setup.projectId ? (setup.isBillingEnabled ? "blaze" : "spark") : "missing",
|
|
132
|
+
flow: `cli_sdk_${flow}`,
|
|
133
|
+
});
|
|
55
134
|
}
|
|
56
|
-
const platforms = [
|
|
57
|
-
{ name: "iOS (Swift)", value: types_1.Platform.IOS },
|
|
58
|
-
{ name: "Web (JavaScript)", value: types_1.Platform.WEB },
|
|
59
|
-
{ name: "Android (Kotlin)", value: types_1.Platform.ANDROID },
|
|
60
|
-
{ name: "Flutter (Dart)", value: types_1.Platform.FLUTTER },
|
|
61
|
-
];
|
|
62
|
-
targetPlatform = await (0, prompt_1.select)({
|
|
63
|
-
message: "Which platform do you want to set up a generated SDK for?",
|
|
64
|
-
choices: platforms,
|
|
65
|
-
});
|
|
66
135
|
}
|
|
67
|
-
|
|
68
|
-
|
|
136
|
+
}
|
|
137
|
+
exports.actuate = actuate;
|
|
138
|
+
async function actuateWithInfo(setup, config, info) {
|
|
139
|
+
if (!info.apps.length) {
|
|
140
|
+
info.apps = await (0, appFinder_1.detectApps)(cwd);
|
|
141
|
+
if (!info.apps.length) {
|
|
142
|
+
(0, utils_1.logLabeledBullet)("dataconnect", "No apps to setup Data Connect Generated SDKs");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
69
145
|
}
|
|
70
|
-
const
|
|
146
|
+
const apps = info.apps;
|
|
147
|
+
const connectorInfo = await chooseExistingConnector(setup, config);
|
|
71
148
|
const connectorYaml = JSON.parse(JSON.stringify(connectorInfo.connectorYaml));
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
if (unusedFrameworks.length > 0) {
|
|
76
|
-
const additionalFrameworks = await (0, prompt_1.checkbox)({
|
|
77
|
-
message: "Which frameworks would you like to generate SDKs for? " +
|
|
78
|
-
"Press Space to select features, then Enter to confirm your choices.",
|
|
79
|
-
choices: fileUtils_1.SUPPORTED_FRAMEWORKS.map((frameworkStr) => ({
|
|
80
|
-
value: frameworkStr,
|
|
81
|
-
checked: newConnectorYaml?.generate?.javascriptSdk?.[frameworkStr],
|
|
82
|
-
})),
|
|
83
|
-
});
|
|
84
|
-
for (const framework of additionalFrameworks) {
|
|
85
|
-
newConnectorYaml.generate.javascriptSdk[framework] = true;
|
|
86
|
-
}
|
|
149
|
+
for (const app of apps) {
|
|
150
|
+
if (!(0, fsutils_1.dirExistsSync)(app.directory)) {
|
|
151
|
+
(0, utils_1.logLabeledWarning)("dataconnect", `App directory ${app.directory} does not exist`);
|
|
87
152
|
}
|
|
153
|
+
addSdkGenerateToConnectorYaml(connectorInfo, connectorYaml, app);
|
|
154
|
+
}
|
|
155
|
+
const connectorYamlContents = yaml.stringify(connectorYaml);
|
|
156
|
+
connectorInfo.connectorYaml = connectorYaml;
|
|
157
|
+
const connectorYamlPath = `${connectorInfo.directory}/connector.yaml`;
|
|
158
|
+
config.writeProjectFile(path.relative(config.projectDir, connectorYamlPath), connectorYamlContents);
|
|
159
|
+
(0, utils_1.logLabeledBullet)("dataconnect", `Installing the generated SDKs ...`);
|
|
160
|
+
const account = (0, auth_1.getGlobalDefaultAccount)();
|
|
161
|
+
try {
|
|
162
|
+
await dataconnectEmulator_1.DataConnectEmulator.generate({
|
|
163
|
+
configDir: connectorInfo.directory,
|
|
164
|
+
account,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
catch (e) {
|
|
168
|
+
(0, utils_1.logLabeledError)("dataconnect", `Failed to generate Data Connect SDKs\n${e?.message}`);
|
|
169
|
+
}
|
|
170
|
+
(0, utils_1.logLabeledSuccess)("dataconnect", `Installed generated SDKs for ${clc.bold(apps.map((a) => (0, appFinder_1.appDescription)(a)).join(", "))}`);
|
|
171
|
+
if (apps.some((a) => a.platform === types_1.Platform.IOS)) {
|
|
172
|
+
(0, utils_1.logBullet)(clc.bold("Please follow the instructions here to add your generated sdk to your XCode project:\n\thttps://firebase.google.com/docs/data-connect/ios-sdk#set-client"));
|
|
173
|
+
}
|
|
174
|
+
if (apps.some((a) => a.frameworks?.includes("react"))) {
|
|
175
|
+
(0, utils_1.logBullet)("Visit https://firebase.google.com/docs/data-connect/web-sdk#react for more information on how to set up React Generated SDKs for Firebase Data Connect");
|
|
176
|
+
}
|
|
177
|
+
if (apps.some((a) => a.frameworks?.includes("angular"))) {
|
|
178
|
+
(0, utils_1.logBullet)("Run `ng add @angular/fire` to install angular sdk dependencies.\nVisit https://github.com/invertase/tanstack-query-firebase/tree/main/packages/angular for more information on how to set up Angular Generated SDKs for Firebase Data Connect");
|
|
88
179
|
}
|
|
89
|
-
const connectorYamlContents = yaml.stringify(newConnectorYaml);
|
|
90
|
-
connectorInfo.connectorYaml = newConnectorYaml;
|
|
91
|
-
const displayIOSWarning = targetPlatform === types_1.Platform.IOS;
|
|
92
|
-
return { connectorYamlContents, connectorInfo, displayIOSWarning };
|
|
93
180
|
}
|
|
94
|
-
async function chooseExistingConnector(
|
|
181
|
+
async function chooseExistingConnector(setup, config) {
|
|
182
|
+
const serviceInfos = await (0, load_1.loadAll)(setup.projectId || "", config);
|
|
183
|
+
const choices = serviceInfos
|
|
184
|
+
.map((si) => {
|
|
185
|
+
return si.connectorInfo.map((ci) => {
|
|
186
|
+
return {
|
|
187
|
+
name: `${si.dataConnectYaml.location}/${si.dataConnectYaml.serviceId}/${ci.connectorYaml.connectorId}`,
|
|
188
|
+
value: ci,
|
|
189
|
+
};
|
|
190
|
+
});
|
|
191
|
+
})
|
|
192
|
+
.flat();
|
|
193
|
+
if (!choices.length) {
|
|
194
|
+
throw new error_1.FirebaseError(`No Firebase Data Connect workspace found. Run ${clc.bold("firebase init dataconnect")} to set up a service and connector.`);
|
|
195
|
+
}
|
|
95
196
|
if (choices.length === 1) {
|
|
96
197
|
return choices[0].value;
|
|
97
198
|
}
|
|
@@ -104,92 +205,79 @@ async function chooseExistingConnector(choices) {
|
|
|
104
205
|
}
|
|
105
206
|
(0, utils_1.logWarning)(`Unable to pick up an existing connector based on FDC_CONNECTOR=${connectorEnvVar}.`);
|
|
106
207
|
}
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
choices: choices,
|
|
110
|
-
});
|
|
208
|
+
(0, utils_1.logWarning)(`Pick up the first connector ${clc.bold(connectorEnvVar)}. Use FDC_CONNECTOR to override it`);
|
|
209
|
+
return choices[0].value;
|
|
111
210
|
}
|
|
112
|
-
|
|
211
|
+
function addSdkGenerateToConnectorYaml(connectorInfo, connectorYaml, app) {
|
|
212
|
+
const connectorDir = connectorInfo.directory;
|
|
213
|
+
const appDir = app.directory;
|
|
113
214
|
if (!connectorYaml.generate) {
|
|
114
215
|
connectorYaml.generate = {};
|
|
115
216
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
for (const framework of frameworksUsed) {
|
|
135
|
-
(0, utils_1.logBullet)(`Detected ${framework} app. Enabling ${framework} generated SDKs.`);
|
|
136
|
-
javascriptSdk[framework] = true;
|
|
217
|
+
const generate = connectorYaml.generate;
|
|
218
|
+
switch (app.platform) {
|
|
219
|
+
case types_1.Platform.WEB: {
|
|
220
|
+
const javascriptSdk = {
|
|
221
|
+
outputDir: path.relative(connectorDir, path.join(appDir, `src/dataconnect-generated`)),
|
|
222
|
+
package: `@dataconnect/generated`,
|
|
223
|
+
packageJsonDir: path.relative(connectorDir, appDir),
|
|
224
|
+
react: false,
|
|
225
|
+
angular: false,
|
|
226
|
+
};
|
|
227
|
+
for (const f of app.frameworks || []) {
|
|
228
|
+
javascriptSdk[f] = true;
|
|
229
|
+
}
|
|
230
|
+
if (!(0, lodash_1.isArray)(generate?.javascriptSdk)) {
|
|
231
|
+
generate.javascriptSdk = generate.javascriptSdk ? [generate.javascriptSdk] : [];
|
|
232
|
+
}
|
|
233
|
+
if (!generate.javascriptSdk.some((s) => s.outputDir === javascriptSdk.outputDir)) {
|
|
234
|
+
generate.javascriptSdk.push(javascriptSdk);
|
|
137
235
|
}
|
|
236
|
+
break;
|
|
138
237
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
if (targetPlatform === types_1.Platform.ANDROID) {
|
|
150
|
-
const kotlinSdk = {
|
|
151
|
-
outputDir: path.relative(connectorDir, path.join(appDir, `dataconnect-generated/kotlin`)),
|
|
152
|
-
package: `connectors.${(0, lodash_1.snakeCase)(connectorYaml.connectorId)}`,
|
|
153
|
-
};
|
|
154
|
-
for (const candidateSubdir of ["app/src/main/java", "app/src/main/kotlin"]) {
|
|
155
|
-
const candidateDir = path.join(appDir, candidateSubdir);
|
|
156
|
-
if ((0, fsutils_1.dirExistsSync)(candidateDir)) {
|
|
157
|
-
kotlinSdk.outputDir = path.relative(connectorDir, candidateDir);
|
|
238
|
+
case types_1.Platform.FLUTTER: {
|
|
239
|
+
const dartSdk = {
|
|
240
|
+
outputDir: path.relative(connectorDir, path.join(appDir, `lib/dataconnect_generated`)),
|
|
241
|
+
package: "dataconnect_generated",
|
|
242
|
+
};
|
|
243
|
+
if (!(0, lodash_1.isArray)(generate?.dartSdk)) {
|
|
244
|
+
generate.dartSdk = generate.dartSdk ? [generate.dartSdk] : [];
|
|
245
|
+
}
|
|
246
|
+
if (!generate.dartSdk.some((s) => s.outputDir === dartSdk.outputDir)) {
|
|
247
|
+
generate.dartSdk.push(dartSdk);
|
|
158
248
|
}
|
|
249
|
+
break;
|
|
159
250
|
}
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
await dataconnectEmulator_1.DataConnectEmulator.generate({
|
|
171
|
-
configDir: sdkInfo.connectorInfo.directory,
|
|
172
|
-
connectorId: sdkInfo.connectorInfo.connectorYaml.connectorId,
|
|
173
|
-
account,
|
|
174
|
-
});
|
|
175
|
-
(0, utils_1.logBullet)(`Generated SDK code for ${sdkInfo.connectorInfo.connectorYaml.connectorId}`);
|
|
176
|
-
if (sdkInfo.connectorInfo.connectorYaml.generate?.swiftSdk && sdkInfo.displayIOSWarning) {
|
|
177
|
-
(0, utils_1.logBullet)(clc.bold("Please follow the instructions here to add your generated sdk to your XCode project:\n\thttps://firebase.google.com/docs/data-connect/ios-sdk#set-client"));
|
|
178
|
-
}
|
|
179
|
-
if (sdkInfo.connectorInfo.connectorYaml.generate?.javascriptSdk) {
|
|
180
|
-
for (const framework of fileUtils_1.SUPPORTED_FRAMEWORKS) {
|
|
181
|
-
if (sdkInfo.connectorInfo.connectorYaml.generate.javascriptSdk[framework]) {
|
|
182
|
-
logInfoForFramework(framework);
|
|
251
|
+
case types_1.Platform.ANDROID: {
|
|
252
|
+
const kotlinSdk = {
|
|
253
|
+
outputDir: path.relative(connectorDir, path.join(appDir, `src/main/kotlin`)),
|
|
254
|
+
package: `com.google.firebase.dataconnect.generated`,
|
|
255
|
+
};
|
|
256
|
+
if (!(0, lodash_1.isArray)(generate?.kotlinSdk)) {
|
|
257
|
+
generate.kotlinSdk = generate.kotlinSdk ? [generate.kotlinSdk] : [];
|
|
258
|
+
}
|
|
259
|
+
if (!generate.kotlinSdk.some((s) => s.outputDir === kotlinSdk.outputDir)) {
|
|
260
|
+
generate.kotlinSdk.push(kotlinSdk);
|
|
183
261
|
}
|
|
262
|
+
break;
|
|
184
263
|
}
|
|
264
|
+
case types_1.Platform.IOS: {
|
|
265
|
+
const swiftSdk = {
|
|
266
|
+
outputDir: path.relative(connectorDir, path.join(app.directory, `../FirebaseDataConnectGenerated`)),
|
|
267
|
+
package: "DataConnectGenerated",
|
|
268
|
+
};
|
|
269
|
+
if (!(0, lodash_1.isArray)(generate?.swiftSdk)) {
|
|
270
|
+
generate.swiftSdk = generate.swiftSdk ? [generate.swiftSdk] : [];
|
|
271
|
+
}
|
|
272
|
+
if (!generate.swiftSdk.some((s) => s.outputDir === swiftSdk.outputDir)) {
|
|
273
|
+
generate.swiftSdk.push(swiftSdk);
|
|
274
|
+
}
|
|
275
|
+
break;
|
|
276
|
+
}
|
|
277
|
+
default:
|
|
278
|
+
throw new error_1.FirebaseError(`Unsupported platform ${app.platform} for Data Connect SDK generation. Supported platforms are: ${Object.values(types_1.Platform)
|
|
279
|
+
.filter((p) => p !== types_1.Platform.NONE && p !== types_1.Platform.MULTIPLE)
|
|
280
|
+
.join(", ")}\n${JSON.stringify(app)}`);
|
|
185
281
|
}
|
|
186
282
|
}
|
|
187
|
-
exports.
|
|
188
|
-
function logInfoForFramework(framework) {
|
|
189
|
-
if (framework === "react") {
|
|
190
|
-
(0, utils_1.logBullet)("Visit https://firebase.google.com/docs/data-connect/web-sdk#react for more information on how to set up React Generated SDKs for Firebase Data Connect");
|
|
191
|
-
}
|
|
192
|
-
else if (framework === "angular") {
|
|
193
|
-
(0, utils_1.logBullet)("Run `npm i --save @angular/fire @tanstack-query-firebase/angular @tanstack/angular-query-experimental` to install angular sdk dependencies.\nVisit https://github.com/invertase/tanstack-query-firebase/tree/main/packages/angular for more information on how to set up Angular Generated SDKs for Firebase Data Connect");
|
|
194
|
-
}
|
|
195
|
-
}
|
|
283
|
+
exports.addSdkGenerateToConnectorYaml = addSdkGenerateToConnectorYaml;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.genkit = exports.apphosting = exports.
|
|
3
|
+
exports.aitools = exports.apptestingAcutate = exports.apptestingAskQuestions = exports.genkit = exports.apphosting = exports.dataconnectSdkActuate = exports.dataconnectSdkAskQuestions = exports.dataconnectActuate = exports.dataconnectAskQuestions = exports.hostingGithub = exports.remoteconfig = exports.project = exports.extensions = exports.emulators = exports.storageActuate = exports.storageAskQuestions = exports.hosting = exports.functions = exports.firestoreActuate = exports.firestoreAskQuestions = exports.databaseActuate = exports.databaseAskQuestions = exports.account = void 0;
|
|
4
4
|
var account_1 = require("./account");
|
|
5
5
|
Object.defineProperty(exports, "account", { enumerable: true, get: function () { return account_1.doSetup; } });
|
|
6
6
|
var database_1 = require("./database");
|
|
@@ -29,10 +29,15 @@ Object.defineProperty(exports, "hostingGithub", { enumerable: true, get: functio
|
|
|
29
29
|
var dataconnect_1 = require("./dataconnect");
|
|
30
30
|
Object.defineProperty(exports, "dataconnectAskQuestions", { enumerable: true, get: function () { return dataconnect_1.askQuestions; } });
|
|
31
31
|
Object.defineProperty(exports, "dataconnectActuate", { enumerable: true, get: function () { return dataconnect_1.actuate; } });
|
|
32
|
-
Object.defineProperty(exports, "dataconnectPostSetup", { enumerable: true, get: function () { return dataconnect_1.postSetup; } });
|
|
33
32
|
var sdk_1 = require("./dataconnect/sdk");
|
|
34
|
-
Object.defineProperty(exports, "
|
|
33
|
+
Object.defineProperty(exports, "dataconnectSdkAskQuestions", { enumerable: true, get: function () { return sdk_1.askQuestions; } });
|
|
34
|
+
Object.defineProperty(exports, "dataconnectSdkActuate", { enumerable: true, get: function () { return sdk_1.actuate; } });
|
|
35
35
|
var apphosting_1 = require("./apphosting");
|
|
36
36
|
Object.defineProperty(exports, "apphosting", { enumerable: true, get: function () { return apphosting_1.doSetup; } });
|
|
37
37
|
var genkit_1 = require("./genkit");
|
|
38
38
|
Object.defineProperty(exports, "genkit", { enumerable: true, get: function () { return genkit_1.doSetup; } });
|
|
39
|
+
var apptesting_1 = require("./apptesting");
|
|
40
|
+
Object.defineProperty(exports, "apptestingAskQuestions", { enumerable: true, get: function () { return apptesting_1.askQuestions; } });
|
|
41
|
+
Object.defineProperty(exports, "apptestingAcutate", { enumerable: true, get: function () { return apptesting_1.actuate; } });
|
|
42
|
+
var aitools_1 = require("./aitools");
|
|
43
|
+
Object.defineProperty(exports, "aitools", { enumerable: true, get: function () { return aitools_1.doSetup; } });
|
|
@@ -81,6 +81,10 @@ async function doSetup(setup, config, options) {
|
|
|
81
81
|
projectMetaData = await (0, projects_1.getFirebaseProject)(projectEnvVar);
|
|
82
82
|
}
|
|
83
83
|
else {
|
|
84
|
+
if (options.nonInteractive) {
|
|
85
|
+
logger_1.logger.info("No default project found. Continuing without a project in non interactive mode.");
|
|
86
|
+
return;
|
|
87
|
+
}
|
|
84
88
|
projectMetaData = await projectChoicePrompt(options);
|
|
85
89
|
if (!projectMetaData) {
|
|
86
90
|
return;
|
package/lib/init/index.js
CHANGED
|
@@ -6,6 +6,7 @@ const clc = require("colorette");
|
|
|
6
6
|
const error_1 = require("../error");
|
|
7
7
|
const logger_1 = require("../logger");
|
|
8
8
|
const features = require("./features");
|
|
9
|
+
const track_1 = require("../track");
|
|
9
10
|
const featuresList = [
|
|
10
11
|
{ name: "account", doSetup: features.account },
|
|
11
12
|
{
|
|
@@ -22,9 +23,12 @@ const featuresList = [
|
|
|
22
23
|
name: "dataconnect",
|
|
23
24
|
askQuestions: features.dataconnectAskQuestions,
|
|
24
25
|
actuate: features.dataconnectActuate,
|
|
25
|
-
postSetup: features.dataconnectPostSetup,
|
|
26
26
|
},
|
|
27
|
-
{
|
|
27
|
+
{
|
|
28
|
+
name: "dataconnect:sdk",
|
|
29
|
+
askQuestions: features.dataconnectSdkAskQuestions,
|
|
30
|
+
actuate: features.dataconnectSdkActuate,
|
|
31
|
+
},
|
|
28
32
|
{ name: "functions", doSetup: features.functions },
|
|
29
33
|
{ name: "hosting", doSetup: features.hosting },
|
|
30
34
|
{
|
|
@@ -39,11 +43,18 @@ const featuresList = [
|
|
|
39
43
|
{ name: "hosting:github", doSetup: features.hostingGithub },
|
|
40
44
|
{ name: "genkit", doSetup: features.genkit },
|
|
41
45
|
{ name: "apphosting", displayName: "App Hosting", doSetup: features.apphosting },
|
|
46
|
+
{
|
|
47
|
+
name: "apptesting",
|
|
48
|
+
askQuestions: features.apptestingAskQuestions,
|
|
49
|
+
actuate: features.apptestingAcutate,
|
|
50
|
+
},
|
|
51
|
+
{ name: "aitools", displayName: "AI Tools", doSetup: features.aitools },
|
|
42
52
|
];
|
|
43
53
|
const featureMap = new Map(featuresList.map((feature) => [feature.name, feature]));
|
|
44
54
|
async function init(setup, config, options) {
|
|
45
55
|
const nextFeature = setup.features?.shift();
|
|
46
56
|
if (nextFeature) {
|
|
57
|
+
const start = process.uptime();
|
|
47
58
|
const f = featureMap.get(nextFeature);
|
|
48
59
|
if (!f) {
|
|
49
60
|
const availableFeatures = Object.keys(features)
|
|
@@ -66,6 +77,8 @@ async function init(setup, config, options) {
|
|
|
66
77
|
if (f.postSetup) {
|
|
67
78
|
await f.postSetup(setup, config, options);
|
|
68
79
|
}
|
|
80
|
+
const duration = Math.floor((process.uptime() - start) * 1000);
|
|
81
|
+
await (0, track_1.trackGA4)("product_init", { feature: nextFeature }, duration);
|
|
69
82
|
return init(setup, config, options);
|
|
70
83
|
}
|
|
71
84
|
}
|
|
@@ -73,6 +86,7 @@ exports.init = init;
|
|
|
73
86
|
async function actuate(setup, config, options) {
|
|
74
87
|
const nextFeature = setup.features?.shift();
|
|
75
88
|
if (nextFeature) {
|
|
89
|
+
const start = process.uptime();
|
|
76
90
|
const f = lookupFeature(nextFeature);
|
|
77
91
|
logger_1.logger.info(clc.bold(`\n${clc.white("===")} ${(0, lodash_1.capitalize)(nextFeature)} Setup Actuation`));
|
|
78
92
|
if (f.doSetup) {
|
|
@@ -83,6 +97,8 @@ async function actuate(setup, config, options) {
|
|
|
83
97
|
await f.actuate(setup, config, options);
|
|
84
98
|
}
|
|
85
99
|
}
|
|
100
|
+
const duration = Math.floor((process.uptime() - start) * 1000);
|
|
101
|
+
await (0, track_1.trackGA4)("product_init_mcp", { feature: nextFeature }, duration);
|
|
86
102
|
return actuate(setup, config, options);
|
|
87
103
|
}
|
|
88
104
|
}
|
package/lib/management/apps.js
CHANGED
|
@@ -13,7 +13,7 @@ const types_1 = require("../dataconnect/types");
|
|
|
13
13
|
const projectUtils_1 = require("../projectUtils");
|
|
14
14
|
const prompt = require("../prompt");
|
|
15
15
|
const projects_1 = require("./projects");
|
|
16
|
-
const
|
|
16
|
+
const appFinder_1 = require("../dataconnect/appFinder");
|
|
17
17
|
const utils_1 = require("../utils");
|
|
18
18
|
const TIMEOUT_MILLIS = 30000;
|
|
19
19
|
exports.APP_LIST_PAGE_SIZE = 100;
|
|
@@ -22,14 +22,14 @@ async function getDisplayName() {
|
|
|
22
22
|
return await prompt.input("What would you like to call your app?");
|
|
23
23
|
}
|
|
24
24
|
async function getPlatform(appDir, config) {
|
|
25
|
-
let targetPlatform = await (0,
|
|
25
|
+
let targetPlatform = await (0, appFinder_1.getPlatformFromFolder)(appDir);
|
|
26
26
|
if (targetPlatform === types_1.Platform.NONE) {
|
|
27
27
|
appDir = await (0, utils_1.promptForDirectory)({
|
|
28
28
|
config,
|
|
29
29
|
relativeTo: appDir,
|
|
30
30
|
message: "We couldn't determine what kind of app you're using. Where is your app directory?",
|
|
31
31
|
});
|
|
32
|
-
targetPlatform = await (0,
|
|
32
|
+
targetPlatform = await (0, appFinder_1.getPlatformFromFolder)(appDir);
|
|
33
33
|
}
|
|
34
34
|
if (targetPlatform === types_1.Platform.NONE || targetPlatform === types_1.Platform.MULTIPLE) {
|
|
35
35
|
if (targetPlatform === types_1.Platform.NONE) {
|