@microsoft/teamsfx-core 3.0.13 → 3.0.14-alpha.1ba1d62e58.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/build/client/teamsGraphClient.d.ts +3 -0
- package/build/client/teamsGraphClient.d.ts.map +1 -1
- package/build/client/teamsGraphClient.js +17 -0
- package/build/client/teamsGraphClient.js.map +1 -1
- package/build/common/featureFlags.d.ts +12 -2
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +15 -3
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts +0 -2
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +1 -56
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/telemetry.d.ts +4 -15
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +5 -18
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +8 -2
- package/build/component/configManager/validator.d.ts.map +1 -1
- package/build/component/configManager/validator.js +2 -0
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +5 -1
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/driver/copilotAgent/interfaces/PublishArgs.d.ts +14 -0
- package/build/component/driver/copilotAgent/interfaces/PublishArgs.d.ts.map +1 -0
- package/build/component/driver/copilotAgent/interfaces/PublishArgs.js +5 -0
- package/build/component/driver/copilotAgent/interfaces/PublishArgs.js.map +1 -0
- package/build/component/driver/copilotAgent/publish.d.ts +16 -0
- package/build/component/driver/copilotAgent/publish.d.ts.map +1 -0
- package/build/component/driver/copilotAgent/publish.js +175 -0
- package/build/component/driver/copilotAgent/publish.js.map +1 -0
- package/build/component/driver/dcr/create.d.ts +10 -0
- package/build/component/driver/dcr/create.d.ts.map +1 -0
- package/build/component/driver/dcr/create.js +142 -0
- package/build/component/driver/dcr/create.js.map +1 -0
- package/build/component/driver/dcr/error/dcrNameTooLong.d.ts +5 -0
- package/build/component/driver/dcr/error/dcrNameTooLong.d.ts.map +1 -0
- package/build/component/driver/dcr/error/dcrNameTooLong.js +21 -0
- package/build/component/driver/dcr/error/dcrNameTooLong.js.map +1 -0
- package/build/component/driver/dcr/error/dcrWellKnownInvalid.d.ts +5 -0
- package/build/component/driver/dcr/error/dcrWellKnownInvalid.d.ts.map +1 -0
- package/build/component/driver/dcr/error/dcrWellKnownInvalid.js +21 -0
- package/build/component/driver/dcr/error/dcrWellKnownInvalid.js.map +1 -0
- package/build/component/driver/dcr/interface/createDcrArgs.d.ts +9 -0
- package/build/component/driver/dcr/interface/createDcrArgs.d.ts.map +1 -0
- package/build/component/driver/dcr/interface/createDcrArgs.js +5 -0
- package/build/component/driver/dcr/interface/createDcrArgs.js.map +1 -0
- package/build/component/driver/dcr/interface/createDcrOutputs.d.ts +7 -0
- package/build/component/driver/dcr/interface/createDcrOutputs.d.ts.map +1 -0
- package/build/component/driver/dcr/interface/createDcrOutputs.js +10 -0
- package/build/component/driver/dcr/interface/createDcrOutputs.js.map +1 -0
- package/build/component/driver/dcr/utility/constants.d.ts +7 -0
- package/build/component/driver/dcr/utility/constants.d.ts.map +1 -0
- package/build/component/driver/dcr/utility/constants.js +12 -0
- package/build/component/driver/dcr/utility/constants.js.map +1 -0
- package/build/component/driver/index.d.ts +2 -0
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +2 -0
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +1 -0
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +1 -0
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +2 -0
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +51 -6
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts +10 -0
- package/build/component/driver/teamsApp/interfaces/DcrRegistration.d.ts.map +1 -0
- package/build/component/driver/teamsApp/interfaces/DcrRegistration.js +5 -0
- package/build/component/driver/teamsApp/interfaces/DcrRegistration.js.map +1 -0
- package/build/component/driver/teamsApp/publishAppPackage.d.ts +0 -2
- package/build/component/driver/teamsApp/publishAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/publishAppPackage.js +2 -51
- package/build/component/driver/teamsApp/publishAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +10 -2
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/McpCertVerification.d.ts +13 -0
- package/build/component/driver/teamsApp/utils/McpCertVerification.d.ts.map +1 -0
- package/build/component/driver/teamsApp/utils/McpCertVerification.js +65 -0
- package/build/component/driver/teamsApp/utils/McpCertVerification.js.map +1 -0
- package/build/component/driver/teamsApp/validate.js +1 -1
- package/build/component/driver/teamsApp/validate.js.map +1 -1
- package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
- package/build/component/generator/declarativeAgent/generator.js +1 -2
- package/build/component/generator/declarativeAgent/generator.js.map +1 -1
- package/build/component/generator/defaultGenerator.d.ts.map +1 -1
- package/build/component/generator/defaultGenerator.js +14 -1
- package/build/component/generator/defaultGenerator.js.map +1 -1
- package/build/component/generator/error.d.ts +3 -0
- package/build/component/generator/error.d.ts.map +1 -1
- package/build/component/generator/error.js +7 -1
- package/build/component/generator/error.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts +8 -0
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +47 -0
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/openPlugin/authorParser.d.ts +8 -0
- package/build/component/generator/openPlugin/authorParser.d.ts.map +1 -0
- package/build/component/generator/openPlugin/authorParser.js +49 -0
- package/build/component/generator/openPlugin/authorParser.js.map +1 -0
- package/build/component/generator/openPlugin/deterministicId.d.ts +6 -0
- package/build/component/generator/openPlugin/deterministicId.d.ts.map +1 -0
- package/build/component/generator/openPlugin/deterministicId.js +31 -0
- package/build/component/generator/openPlugin/deterministicId.js.map +1 -0
- package/build/component/generator/openPlugin/exporter.d.ts +18 -0
- package/build/component/generator/openPlugin/exporter.d.ts.map +1 -0
- package/build/component/generator/openPlugin/exporter.js +233 -0
- package/build/component/generator/openPlugin/exporter.js.map +1 -0
- package/build/component/generator/openPlugin/iconStrategy.d.ts +8 -0
- package/build/component/generator/openPlugin/iconStrategy.d.ts.map +1 -0
- package/build/component/generator/openPlugin/iconStrategy.js +62 -0
- package/build/component/generator/openPlugin/iconStrategy.js.map +1 -0
- package/build/component/generator/openPlugin/importer.d.ts +25 -0
- package/build/component/generator/openPlugin/importer.d.ts.map +1 -0
- package/build/component/generator/openPlugin/importer.js +140 -0
- package/build/component/generator/openPlugin/importer.js.map +1 -0
- package/build/component/generator/openPlugin/mapper.d.ts +6 -0
- package/build/component/generator/openPlugin/mapper.d.ts.map +1 -0
- package/build/component/generator/openPlugin/mapper.js +141 -0
- package/build/component/generator/openPlugin/mapper.js.map +1 -0
- package/build/component/generator/openPlugin/parser.d.ts +3 -0
- package/build/component/generator/openPlugin/parser.d.ts.map +1 -0
- package/build/component/generator/openPlugin/parser.js +153 -0
- package/build/component/generator/openPlugin/parser.js.map +1 -0
- package/build/component/generator/openPlugin/placeholderPng.d.ts +6 -0
- package/build/component/generator/openPlugin/placeholderPng.d.ts.map +1 -0
- package/build/component/generator/openPlugin/placeholderPng.js +71 -0
- package/build/component/generator/openPlugin/placeholderPng.js.map +1 -0
- package/build/component/generator/openPlugin/textUtils.d.ts +12 -0
- package/build/component/generator/openPlugin/textUtils.d.ts.map +1 -0
- package/build/component/generator/openPlugin/textUtils.js +43 -0
- package/build/component/generator/openPlugin/textUtils.js.map +1 -0
- package/build/component/generator/openPlugin/types.d.ts +128 -0
- package/build/component/generator/openPlugin/types.d.ts.map +1 -0
- package/build/component/generator/openPlugin/types.js.map +1 -0
- package/build/component/generator/templates/templateNames.d.ts +2 -1
- package/build/component/generator/templates/templateNames.d.ts.map +1 -1
- package/build/component/generator/templates/templateNames.js +2 -0
- package/build/component/generator/templates/templateNames.js.map +1 -1
- package/build/component/generator/templates/templateReplaceMap.d.ts.map +1 -1
- package/build/component/generator/templates/templateReplaceMap.js +4 -1
- package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
- package/build/component/generator/v4TemplateBridge.d.ts +29 -0
- package/build/component/generator/v4TemplateBridge.d.ts.map +1 -0
- package/build/component/generator/v4TemplateBridge.js +114 -0
- package/build/component/generator/v4TemplateBridge.js.map +1 -0
- package/build/component/m365/packageService.d.ts +5 -0
- package/build/component/m365/packageService.d.ts.map +1 -1
- package/build/component/m365/packageService.js +23 -1
- package/build/component/m365/packageService.js.map +1 -1
- package/build/core/FxCore.d.ts +2 -4
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +3 -62
- package/build/core/FxCore.js.map +1 -1
- package/build/core/FxCore.openPlugin.d.ts +23 -0
- package/build/core/FxCore.openPlugin.d.ts.map +1 -0
- package/build/core/FxCore.openPlugin.js +131 -0
- package/build/core/FxCore.openPlugin.js.map +1 -0
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +0 -3
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/errorHandler.d.ts.map +1 -1
- package/build/core/middleware/errorHandler.js +9 -0
- package/build/core/middleware/errorHandler.js.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.d.ts +1 -34
- package/build/core/middleware/utils/v3MigrationUtils.d.ts.map +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js +6 -245
- package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +1 -6
- package/build/question/constants.js.map +1 -1
- package/build/question/inputs/ExportOpenPluginInputs.d.ts +10 -0
- package/build/question/inputs/ExportOpenPluginInputs.d.ts.map +1 -0
- package/build/question/inputs/ExportOpenPluginInputs.js +5 -0
- package/build/question/inputs/ExportOpenPluginInputs.js.map +1 -0
- package/build/question/inputs/ImportOpenPluginInputs.d.ts +28 -0
- package/build/question/inputs/ImportOpenPluginInputs.d.ts.map +1 -0
- package/build/question/inputs/ImportOpenPluginInputs.js +5 -0
- package/build/question/inputs/ImportOpenPluginInputs.js.map +1 -0
- package/build/question/inputs/index.d.ts +2 -0
- package/build/question/inputs/index.d.ts.map +1 -1
- package/build/question/inputs/index.js +2 -0
- package/build/question/inputs/index.js.map +1 -1
- package/build/question/options/ExportOpenPluginOptions.d.ts +4 -0
- package/build/question/options/ExportOpenPluginOptions.d.ts.map +1 -0
- package/build/question/options/ExportOpenPluginOptions.js +29 -0
- package/build/question/options/ExportOpenPluginOptions.js.map +1 -0
- package/build/question/options/ImportOpenPluginOptions.d.ts +4 -0
- package/build/question/options/ImportOpenPluginOptions.d.ts.map +1 -0
- package/build/question/options/ImportOpenPluginOptions.js +54 -0
- package/build/question/options/ImportOpenPluginOptions.js.map +1 -0
- package/build/question/options/index.d.ts +2 -0
- package/build/question/options/index.d.ts.map +1 -1
- package/build/question/options/index.js +2 -0
- package/build/question/options/index.js.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.js +1 -3
- package/build/question/scaffold/vsc/daProjectTypeNode.js.map +1 -1
- package/build/v4/distribution/bundledFloor.d.ts +12 -0
- package/build/v4/distribution/bundledFloor.d.ts.map +1 -0
- package/build/v4/distribution/bundledFloor.js +80 -0
- package/build/v4/distribution/bundledFloor.js.map +1 -0
- package/build/v4/distribution/templateConfig.d.ts +53 -0
- package/build/v4/distribution/templateConfig.d.ts.map +1 -0
- package/build/v4/distribution/templateConfig.js +43 -0
- package/build/v4/distribution/templateConfig.js.map +1 -0
- package/build/v4/distribution/templatePackage.d.ts +29 -0
- package/build/v4/distribution/templatePackage.d.ts.map +1 -0
- package/build/v4/distribution/templatePackage.js +82 -0
- package/build/v4/distribution/templatePackage.js.map +1 -0
- package/build/v4/distribution/templateSource.d.ts +67 -0
- package/build/v4/distribution/templateSource.d.ts.map +1 -0
- package/build/v4/distribution/templateSource.js +220 -0
- package/build/v4/distribution/templateSource.js.map +1 -0
- package/build/v4/distribution/templateSourcePort.d.ts +50 -0
- package/build/v4/distribution/templateSourcePort.d.ts.map +1 -0
- package/build/v4/distribution/templateSourcePort.js +207 -0
- package/build/v4/distribution/templateSourcePort.js.map +1 -0
- package/build/v4/index.d.ts +13 -0
- package/build/v4/index.d.ts.map +1 -0
- package/build/v4/index.js +18 -0
- package/build/v4/index.js.map +1 -0
- package/package.json +4 -4
- package/resource/package.nls.cs.json +9 -1
- package/resource/package.nls.de.json +10 -2
- package/resource/package.nls.es.json +9 -1
- package/resource/package.nls.fr.json +9 -1
- package/resource/package.nls.it.json +10 -2
- package/resource/package.nls.ja.json +9 -1
- package/resource/package.nls.json +10 -13
- package/resource/package.nls.ko.json +9 -1
- package/resource/package.nls.pl.json +10 -2
- package/resource/package.nls.pt-BR.json +9 -1
- package/resource/package.nls.ru.json +10 -2
- package/resource/package.nls.tr.json +11 -3
- package/resource/package.nls.zh-Hans.json +9 -1
- package/resource/package.nls.zh-Hant.json +9 -1
- package/resource/yaml-schema/v1.12/yaml.schema.json +2132 -0
- package/resource/yaml-schema/v1.13/yaml.schema.json +2193 -0
- package/resource/yaml-schema/yaml.schema.json +124 -2
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/templates/metadata.zip +0 -0
- package/templates/ui/tdpNode.json +1 -2
- package/templates/ui/wizardNode.json +1 -2
- package/templates/v4/floor.json +3 -0
- package/templates/v4/templates.zip +0 -0
- package/build/core/middleware/projectMigratorV3.d.ts +0 -39
- package/build/core/middleware/projectMigratorV3.d.ts.map +0 -1
- package/build/core/middleware/projectMigratorV3.js +0 -694
- package/build/core/middleware/projectMigratorV3.js.map +0 -1
- package/build/core/middleware/projectVersionChecker.d.ts +0 -3
- package/build/core/middleware/projectVersionChecker.d.ts.map +0 -1
- package/build/core/middleware/projectVersionChecker.js +0 -60
- package/build/core/middleware/projectVersionChecker.js.map +0 -1
- package/build/core/middleware/types.d.ts +0 -9
- package/build/core/middleware/types.d.ts.map +0 -1
- package/build/core/middleware/types.js.map +0 -1
- package/build/core/middleware/utils/MigrationUtils.d.ts +0 -13
- package/build/core/middleware/utils/MigrationUtils.d.ts.map +0 -1
- package/build/core/middleware/utils/MigrationUtils.js +0 -212
- package/build/core/middleware/utils/MigrationUtils.js.map +0 -1
- package/build/core/middleware/utils/appYmlGenerator.d.ts +0 -34
- package/build/core/middleware/utils/appYmlGenerator.d.ts.map +0 -1
- package/build/core/middleware/utils/appYmlGenerator.js +0 -158
- package/build/core/middleware/utils/appYmlGenerator.js.map +0 -1
- package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts +0 -65
- package/build/core/middleware/utils/debug/appLocalYmlGenerator.d.ts.map +0 -1
- package/build/core/middleware/utils/debug/appLocalYmlGenerator.js +0 -61
- package/build/core/middleware/utils/debug/appLocalYmlGenerator.js.map +0 -1
- package/build/core/middleware/utils/debug/constants.d.ts +0 -20
- package/build/core/middleware/utils/debug/constants.d.ts.map +0 -1
- package/build/core/middleware/utils/debug/constants.js +0 -28
- package/build/core/middleware/utils/debug/constants.js.map +0 -1
- package/build/core/middleware/utils/debug/debugMigrationContext.d.ts +0 -14
- package/build/core/middleware/utils/debug/debugMigrationContext.d.ts.map +0 -1
- package/build/core/middleware/utils/debug/debugMigrationContext.js +0 -23
- package/build/core/middleware/utils/debug/debugMigrationContext.js.map +0 -1
- package/build/core/middleware/utils/debug/debugV3MigrationUtils.d.ts +0 -37
- package/build/core/middleware/utils/debug/debugV3MigrationUtils.d.ts.map +0 -1
- package/build/core/middleware/utils/debug/debugV3MigrationUtils.js +0 -291
- package/build/core/middleware/utils/debug/debugV3MigrationUtils.js.map +0 -1
- package/build/core/middleware/utils/debug/taskMigrator.d.ts +0 -22
- package/build/core/middleware/utils/debug/taskMigrator.d.ts.map +0 -1
- package/build/core/middleware/utils/debug/taskMigrator.js +0 -935
- package/build/core/middleware/utils/debug/taskMigrator.js.map +0 -1
- package/build/core/middleware/utils/migrationContext.d.ts +0 -32
- package/build/core/middleware/utils/migrationContext.d.ts.map +0 -1
- package/build/core/middleware/utils/migrationContext.js +0 -104
- package/build/core/middleware/utils/migrationContext.js.map +0 -1
- /package/build/{core/middleware → component/generator/openPlugin}/types.js +0 -0
|
@@ -1,694 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// Copyright (c) Microsoft Corporation.
|
|
3
|
-
// Licensed under the MIT license.
|
|
4
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.ProjectMigratorMWV3 = exports.subMigrations = exports.moreInfoButton = exports.errorNames = exports.learnMoreLink = void 0;
|
|
6
|
-
exports.wrapRunMigration = wrapRunMigration;
|
|
7
|
-
exports.buildErrorMessage = buildErrorMessage;
|
|
8
|
-
exports.rollbackMigration = rollbackMigration;
|
|
9
|
-
exports.migrate = migrate;
|
|
10
|
-
exports.preMigration = preMigration;
|
|
11
|
-
exports.checkVersionForMigration = checkVersionForMigration;
|
|
12
|
-
exports.generateAppYml = generateAppYml;
|
|
13
|
-
exports.updateLaunchJson = updateLaunchJson;
|
|
14
|
-
exports.isSPFxProject = isSPFxProject;
|
|
15
|
-
exports.manifestsMigration = manifestsMigration;
|
|
16
|
-
exports.azureParameterMigration = azureParameterMigration;
|
|
17
|
-
exports.showNotification = showNotification;
|
|
18
|
-
exports.configsMigration = configsMigration;
|
|
19
|
-
exports.statesMigration = statesMigration;
|
|
20
|
-
exports.userdataMigration = userdataMigration;
|
|
21
|
-
exports.debugMigration = debugMigration;
|
|
22
|
-
exports.checkapimPluginExists = checkapimPluginExists;
|
|
23
|
-
exports.generateApimPluginEnvContent = generateApimPluginEnvContent;
|
|
24
|
-
exports.checkActiveResourcePlugins = checkActiveResourcePlugins;
|
|
25
|
-
exports.updateGitignore = updateGitignore;
|
|
26
|
-
const tslib_1 = require("tslib");
|
|
27
|
-
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
28
|
-
const commentJson = tslib_1.__importStar(require("comment-json"));
|
|
29
|
-
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
30
|
-
const os_1 = require("os");
|
|
31
|
-
const path = tslib_1.__importStar(require("path"));
|
|
32
|
-
const globalVars_1 = require("../../common/globalVars");
|
|
33
|
-
const localizeUtils_1 = require("../../common/localizeUtils");
|
|
34
|
-
const telemetry_1 = require("../../common/telemetry");
|
|
35
|
-
const versionMetadata_1 = require("../../common/versionMetadata");
|
|
36
|
-
const constants_1 = require("../../component/driver/teamsApp/constants");
|
|
37
|
-
const ManifestUtils_1 = require("../../component/driver/teamsApp/utils/ManifestUtils");
|
|
38
|
-
const error_1 = require("../../error");
|
|
39
|
-
const folder_1 = require("../../folder");
|
|
40
|
-
const projectSettingsLoader_1 = require("./projectSettingsLoader");
|
|
41
|
-
const MigrationUtils_1 = require("./utils/MigrationUtils");
|
|
42
|
-
const appYmlGenerator_1 = require("./utils/appYmlGenerator");
|
|
43
|
-
const appLocalYmlGenerator_1 = require("./utils/debug/appLocalYmlGenerator");
|
|
44
|
-
const constants_2 = require("./utils/debug/constants");
|
|
45
|
-
const debugMigrationContext_1 = require("./utils/debug/debugMigrationContext");
|
|
46
|
-
const debugV3MigrationUtils_1 = require("./utils/debug/debugV3MigrationUtils");
|
|
47
|
-
const taskMigrator_1 = require("./utils/debug/taskMigrator");
|
|
48
|
-
const migrationContext_1 = require("./utils/migrationContext");
|
|
49
|
-
const v3MigrationUtils_1 = require("./utils/v3MigrationUtils");
|
|
50
|
-
const Constants = {
|
|
51
|
-
vscodeProvisionBicepPath: "./templates/azure/provision.bicep",
|
|
52
|
-
launchJsonPath: ".vscode/launch.json",
|
|
53
|
-
tasksJsonPath: ".vscode/tasks.json",
|
|
54
|
-
reportName: "upgradeReport.md",
|
|
55
|
-
envWriteOption: {
|
|
56
|
-
// .env.{env} file might be already exist, use append mode (flag: a+)
|
|
57
|
-
encoding: "utf8",
|
|
58
|
-
flag: "a+",
|
|
59
|
-
},
|
|
60
|
-
envFilePrefix: ".env.",
|
|
61
|
-
};
|
|
62
|
-
const Parameters = {
|
|
63
|
-
skipUserConfirm: "skipUserConfirm",
|
|
64
|
-
isNonmodalMessage: "isNonmodalMessage",
|
|
65
|
-
confirmOnly: "confirmOnly",
|
|
66
|
-
};
|
|
67
|
-
const TelemetryPropertyKey = {
|
|
68
|
-
button: "button",
|
|
69
|
-
mode: "mode",
|
|
70
|
-
upgradeVersion: "upgrade-version",
|
|
71
|
-
projectId: "project-id",
|
|
72
|
-
reason: "reason",
|
|
73
|
-
};
|
|
74
|
-
const TelemetryPropertyValue = {
|
|
75
|
-
ok: "ok",
|
|
76
|
-
learnMore: "learn-more",
|
|
77
|
-
cancel: "cancel",
|
|
78
|
-
modal: "modal",
|
|
79
|
-
nonmodal: "nonmodal",
|
|
80
|
-
confirmOnly: "confirm-only",
|
|
81
|
-
skipUserConfirm: "skip-user-confirm",
|
|
82
|
-
upgradeVersion: "5.0",
|
|
83
|
-
};
|
|
84
|
-
exports.learnMoreLink = "https://aka.ms/teams-toolkit-5.0-upgrade";
|
|
85
|
-
// MigrationError provides learnMoreLink as helplink for user. Remember add related error message in learnMoreLink when adding new error.
|
|
86
|
-
exports.errorNames = {
|
|
87
|
-
manifestTemplateNotExist: "ManifestTemplateNotExist",
|
|
88
|
-
manifestTemplateInvalid: "ManifestTemplateInvalid",
|
|
89
|
-
aadManifestTemplateNotExist: "AadManifestTemplateNotExist",
|
|
90
|
-
};
|
|
91
|
-
const upgradeButton = () => (0, localizeUtils_1.getLocalizedString)("core.option.upgrade");
|
|
92
|
-
const moreInfoButton = () => (0, localizeUtils_1.getLocalizedString)("core.option.moreInfo");
|
|
93
|
-
exports.moreInfoButton = moreInfoButton;
|
|
94
|
-
const migrationMessageButtons = () => [upgradeButton(), (0, exports.moreInfoButton)()];
|
|
95
|
-
const telemetryProperties = {
|
|
96
|
-
[TelemetryPropertyKey.upgradeVersion]: TelemetryPropertyValue.upgradeVersion,
|
|
97
|
-
};
|
|
98
|
-
exports.subMigrations = [
|
|
99
|
-
preMigration,
|
|
100
|
-
manifestsMigration,
|
|
101
|
-
generateAppYml,
|
|
102
|
-
configsMigration,
|
|
103
|
-
statesMigration,
|
|
104
|
-
userdataMigration,
|
|
105
|
-
generateApimPluginEnvContent,
|
|
106
|
-
updateLaunchJson,
|
|
107
|
-
azureParameterMigration,
|
|
108
|
-
debugMigration,
|
|
109
|
-
updateGitignore,
|
|
110
|
-
];
|
|
111
|
-
const ProjectMigratorMWV3 = async (ctx, next) => {
|
|
112
|
-
await setTelemetryProjectId(ctx);
|
|
113
|
-
const versionForMigration = await checkVersionForMigration(ctx);
|
|
114
|
-
// abandoned v3 project which will not be supported. Show user the message to create new project.
|
|
115
|
-
if (versionForMigration.source === versionMetadata_1.VersionSource.settings) {
|
|
116
|
-
await globalVars_1.TOOLS?.ui.showMessage("warn", (0, localizeUtils_1.getLocalizedString)("core.migrationV3.abandonedProject"), true);
|
|
117
|
-
ctx.result = (0, teamsfx_api_1.err)(new error_1.AbandonedProjectError());
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
const projectPath = (0, v3MigrationUtils_1.getParameterFromCxt)(ctx, "projectPath", "");
|
|
121
|
-
const isValid = await checkActiveResourcePlugins(projectPath);
|
|
122
|
-
const isUpgradeable = isValid && versionForMigration.state === versionMetadata_1.VersionState.upgradeable;
|
|
123
|
-
if (isUpgradeable) {
|
|
124
|
-
// in cli non interactive scenario, migration will return an error instead of popup dialog.
|
|
125
|
-
const nonInteractive = (0, v3MigrationUtils_1.getParameterFromCxt)(ctx, "nonInteractive");
|
|
126
|
-
if (nonInteractive) {
|
|
127
|
-
ctx.result = (0, teamsfx_api_1.err)(new error_1.NotAllowedMigrationError());
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
const isRunMigration = await showNotification(ctx, versionForMigration);
|
|
131
|
-
if (isRunMigration) {
|
|
132
|
-
const isNonmodalMessage = (0, v3MigrationUtils_1.getParameterFromCxt)(ctx, Parameters.isNonmodalMessage);
|
|
133
|
-
if (isNonmodalMessage) {
|
|
134
|
-
const versionForMigration = await checkVersionForMigration(ctx);
|
|
135
|
-
if (versionForMigration.state !== versionMetadata_1.VersionState.upgradeable) {
|
|
136
|
-
ctx.result = (0, teamsfx_api_1.ok)(undefined);
|
|
137
|
-
return;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
const migrationContext = await migrationContext_1.MigrationContext.create(ctx);
|
|
141
|
-
await wrapRunMigration(migrationContext, migrate);
|
|
142
|
-
ctx.result = (0, teamsfx_api_1.ok)(undefined);
|
|
143
|
-
}
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
else {
|
|
147
|
-
// continue next step only when:
|
|
148
|
-
// 1. no need to upgrade the project;
|
|
149
|
-
// 2. no need to update Microsoft 365 Agents Toolkit version;
|
|
150
|
-
await next();
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
exports.ProjectMigratorMWV3 = ProjectMigratorMWV3;
|
|
154
|
-
async function wrapRunMigration(context, exec) {
|
|
155
|
-
try {
|
|
156
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorMigrateStart);
|
|
157
|
-
await exec(context);
|
|
158
|
-
await showSummaryReport(context);
|
|
159
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorMigrate, context.telemetryProperties);
|
|
160
|
-
}
|
|
161
|
-
catch (error) {
|
|
162
|
-
const errorMessage = buildErrorMessage(error, context.currentStep);
|
|
163
|
-
const fxError = (0, error_1.assembleError)(error, telemetry_1.Component.core);
|
|
164
|
-
fxError.message = errorMessage;
|
|
165
|
-
sendTelemetryErrorEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorError, fxError, context.telemetryProperties);
|
|
166
|
-
await rollbackMigration(context);
|
|
167
|
-
throw error;
|
|
168
|
-
}
|
|
169
|
-
await context.removeFxV2();
|
|
170
|
-
}
|
|
171
|
-
function buildErrorMessage(error, step) {
|
|
172
|
-
let message = error.message;
|
|
173
|
-
if (error.code === "ENOENT" && error.path) {
|
|
174
|
-
const fileName = path.basename(error.path);
|
|
175
|
-
message = `Missing file: ${fileName}\n${message}`;
|
|
176
|
-
}
|
|
177
|
-
if (step) {
|
|
178
|
-
message = `MigrationStep: ${step}\n${message}`;
|
|
179
|
-
}
|
|
180
|
-
return message;
|
|
181
|
-
}
|
|
182
|
-
async function rollbackMigration(context) {
|
|
183
|
-
await context.cleanModifiedPaths();
|
|
184
|
-
await context.restoreBackup();
|
|
185
|
-
await context.cleanBackup();
|
|
186
|
-
}
|
|
187
|
-
async function showSummaryReport(context) {
|
|
188
|
-
const summaryPath = path.join(context.backupPath, Constants.reportName);
|
|
189
|
-
const templatePath = path.join((0, folder_1.getTemplatesFolder)(), "core/v3Migration", Constants.reportName);
|
|
190
|
-
const content = await fs.readFile(templatePath);
|
|
191
|
-
await fs.writeFile(summaryPath, content);
|
|
192
|
-
await globalVars_1.TOOLS?.ui?.openFile?.(summaryPath);
|
|
193
|
-
}
|
|
194
|
-
async function migrate(context) {
|
|
195
|
-
for (const subMigration of exports.subMigrations) {
|
|
196
|
-
context.currentStep = subMigration.name;
|
|
197
|
-
await subMigration(context);
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
async function preMigration(context) {
|
|
201
|
-
await context.backup(versionMetadata_1.MetadataV2.configFolder);
|
|
202
|
-
}
|
|
203
|
-
async function checkVersionForMigration(ctx) {
|
|
204
|
-
const versionInfo = await (0, v3MigrationUtils_1.getProjectVersion)(ctx);
|
|
205
|
-
const versionState = (0, v3MigrationUtils_1.getVersionState)(versionInfo);
|
|
206
|
-
const platform = (0, v3MigrationUtils_1.getParameterFromCxt)(ctx, "platform", teamsfx_api_1.Platform.VSCode);
|
|
207
|
-
return {
|
|
208
|
-
currentVersion: versionInfo.version,
|
|
209
|
-
source: versionInfo.source,
|
|
210
|
-
state: versionState,
|
|
211
|
-
platform: platform,
|
|
212
|
-
};
|
|
213
|
-
}
|
|
214
|
-
async function generateAppYml(context) {
|
|
215
|
-
const bicepContent = await (0, v3MigrationUtils_1.readBicepContent)(context);
|
|
216
|
-
const oldProjectSettings = await loadProjectSettings(context.projectPath);
|
|
217
|
-
const appYmlGenerator = new appYmlGenerator_1.AppYmlGenerator(oldProjectSettings, bicepContent, context.projectPath);
|
|
218
|
-
const appYmlString = await appYmlGenerator.generateAppYml();
|
|
219
|
-
await context.fsWriteFile(versionMetadata_1.MetadataV4.configFile, appYmlString);
|
|
220
|
-
if (oldProjectSettings.programmingLanguage?.toLowerCase() === "csharp") {
|
|
221
|
-
const placeholderMappings = await (0, debugV3MigrationUtils_1.getPlaceholderMappings)(context);
|
|
222
|
-
const appLocalYmlString = await appYmlGenerator.generateAppLocalYml(placeholderMappings);
|
|
223
|
-
await context.fsWriteFile(versionMetadata_1.MetadataV4.localConfigFile, appLocalYmlString);
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
async function updateLaunchJson(context) {
|
|
227
|
-
const launchJsonPath = path.join(context.projectPath, Constants.launchJsonPath);
|
|
228
|
-
if (await fs.pathExists(launchJsonPath)) {
|
|
229
|
-
await context.backup(Constants.launchJsonPath);
|
|
230
|
-
let launchJsonContent = await fs.readFile(launchJsonPath, "utf8");
|
|
231
|
-
const oldProjectSettings = await loadProjectSettings(context.projectPath);
|
|
232
|
-
if (oldProjectSettings.isM365) {
|
|
233
|
-
const jsonObject = JSON.parse(launchJsonContent);
|
|
234
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.teams, constants_2.LaunchBrowser.edge, "Edge", constants_2.LaunchUrl.teamsRemote, 1));
|
|
235
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.teams, constants_2.LaunchBrowser.chrome, "Chrome", constants_2.LaunchUrl.teamsRemote, 1));
|
|
236
|
-
if (debugV3MigrationUtils_1.OldProjectSettingsHelper.includeTab(oldProjectSettings)) {
|
|
237
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.outlook, constants_2.LaunchBrowser.edge, "Edge", constants_2.LaunchUrl.outlookRemoteTab, 2));
|
|
238
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.outlook, constants_2.LaunchBrowser.chrome, "Chrome", constants_2.LaunchUrl.outlookRemoteTab, 2));
|
|
239
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.office, constants_2.LaunchBrowser.edge, "Edge", constants_2.LaunchUrl.officeRemoteTab, 3));
|
|
240
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.office, constants_2.LaunchBrowser.chrome, "Chrome", constants_2.LaunchUrl.officeRemoteTab, 3));
|
|
241
|
-
}
|
|
242
|
-
else if (debugV3MigrationUtils_1.OldProjectSettingsHelper.includeBot(oldProjectSettings)) {
|
|
243
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.outlook, constants_2.LaunchBrowser.edge, "Edge", constants_2.LaunchUrl.outlookRemoteBot, 2));
|
|
244
|
-
jsonObject.configurations.push((0, debugV3MigrationUtils_1.launchRemote)(constants_2.HubName.outlook, constants_2.LaunchBrowser.chrome, "Chrome", constants_2.LaunchUrl.outlookRemoteBot, 2));
|
|
245
|
-
}
|
|
246
|
-
launchJsonContent = JSON.stringify(jsonObject, null, 4);
|
|
247
|
-
}
|
|
248
|
-
const result = launchJsonContent
|
|
249
|
-
.replace(/\${teamsAppId}/g, "${{TEAMS_APP_ID}}")
|
|
250
|
-
.replace(/\${teamsAppInternalId}/g, "${{M365_APP_ID}}") // For M365 apps
|
|
251
|
-
.replace(/\${localTeamsAppId}/g, "${{local:TEAMS_APP_ID}}")
|
|
252
|
-
.replace(/\${localTeamsAppInternalId}/g, "${{local:M365_APP_ID}}"); // For M365 apps
|
|
253
|
-
await context.fsWriteFile(Constants.launchJsonPath, result);
|
|
254
|
-
}
|
|
255
|
-
}
|
|
256
|
-
async function loadProjectSettings(projectPath) {
|
|
257
|
-
const oldProjectSettings = await (0, projectSettingsLoader_1.loadProjectSettingsByProjectPathV2)(projectPath);
|
|
258
|
-
if (oldProjectSettings.isOk()) {
|
|
259
|
-
return oldProjectSettings.value;
|
|
260
|
-
}
|
|
261
|
-
else {
|
|
262
|
-
throw oldProjectSettings.error;
|
|
263
|
-
}
|
|
264
|
-
}
|
|
265
|
-
function isSPFxProject(projectSettings) {
|
|
266
|
-
const solutionSettings = projectSettings?.solutionSettings;
|
|
267
|
-
if (solutionSettings) {
|
|
268
|
-
const selectedPlugins = solutionSettings.activeResourcePlugins;
|
|
269
|
-
return selectedPlugins && selectedPlugins.indexOf("fx-resource-spfx") !== -1;
|
|
270
|
-
}
|
|
271
|
-
return false;
|
|
272
|
-
}
|
|
273
|
-
async function manifestsMigration(context) {
|
|
274
|
-
// Check manifest existing
|
|
275
|
-
const oldAppPackageFolderPath = path.join((0, v3MigrationUtils_1.getTemplateFolderPath)(context), teamsfx_api_1.AppPackageFolderName);
|
|
276
|
-
const oldManifestPath = path.join(oldAppPackageFolderPath, constants_1.MANIFEST_TEMPLATE_CONSOLIDATE);
|
|
277
|
-
const oldManifestAbsolutePath = path.join(context.projectPath, oldManifestPath);
|
|
278
|
-
const oldManifestExists = await fs.pathExists(oldManifestAbsolutePath);
|
|
279
|
-
if (!oldManifestExists) {
|
|
280
|
-
// templates/appPackage/manifest.template.json does not exist
|
|
281
|
-
throw new error_1.MigrationError(new Error((0, localizeUtils_1.getLocalizedString)("core.migrationV3.manifestNotExist")), exports.errorNames.manifestTemplateNotExist, exports.learnMoreLink);
|
|
282
|
-
}
|
|
283
|
-
// Validate manifest template
|
|
284
|
-
{
|
|
285
|
-
const res = await ManifestUtils_1.manifestUtils._readAppManifest(path.join(context.projectPath, oldManifestPath));
|
|
286
|
-
if (res.isErr()) {
|
|
287
|
-
throw new error_1.MigrationError(new Error((0, localizeUtils_1.getLocalizedString)("core.migrationV3.manifestInvalid")), exports.errorNames.manifestTemplateInvalid);
|
|
288
|
-
}
|
|
289
|
-
}
|
|
290
|
-
// Backup templates/appPackage
|
|
291
|
-
await context.backup(oldAppPackageFolderPath);
|
|
292
|
-
// Read Bicep
|
|
293
|
-
const bicepContent = await (0, v3MigrationUtils_1.readBicepContent)(context);
|
|
294
|
-
if ((0, v3MigrationUtils_1.isValidDomainForBotOutputKey)(bicepContent)) {
|
|
295
|
-
context.isBotValidDomain = true;
|
|
296
|
-
}
|
|
297
|
-
// Ensure appPackage
|
|
298
|
-
await context.fsEnsureDir(teamsfx_api_1.AppPackageFolderName);
|
|
299
|
-
// copy other files from old path to new except manifest.template.json and aad.template.json
|
|
300
|
-
const oldAppPackageFiles = await fs.readdir(path.join(context.projectPath, oldAppPackageFolderPath));
|
|
301
|
-
for (const file of oldAppPackageFiles) {
|
|
302
|
-
if (file !== constants_1.MANIFEST_TEMPLATE_CONSOLIDATE && file !== versionMetadata_1.MetadataV2.aadTemplateFileName) {
|
|
303
|
-
await context.fsCopy(path.join(oldAppPackageFolderPath, file), path.join(teamsfx_api_1.AppPackageFolderName, file));
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
// Read capability project settings
|
|
307
|
-
const projectSettings = await loadProjectSettings(context.projectPath);
|
|
308
|
-
const capabilities = (0, v3MigrationUtils_1.getCapabilityStatus)(projectSettings);
|
|
309
|
-
const appIdUri = (0, v3MigrationUtils_1.generateAppIdUri)(capabilities);
|
|
310
|
-
const isSpfx = isSPFxProject(projectSettings);
|
|
311
|
-
if (!isSpfx) {
|
|
312
|
-
await (0, v3MigrationUtils_1.addMissingValidDomainForManifest)(path.join(context.projectPath, oldManifestPath), capabilities.Tab, capabilities.BotSso, context.isBotValidDomain);
|
|
313
|
-
}
|
|
314
|
-
// Read Teams app manifest and save to templates/appPackage/manifest.json
|
|
315
|
-
const manifestPath = path.join(teamsfx_api_1.AppPackageFolderName, versionMetadata_1.MetadataV3.teamsManifestFileName);
|
|
316
|
-
let oldManifest = await fs.readFile(path.join(context.projectPath, oldManifestPath), "utf8");
|
|
317
|
-
oldManifest = (0, v3MigrationUtils_1.replaceAppIdUri)(oldManifest, appIdUri);
|
|
318
|
-
const manifest = (0, MigrationUtils_1.replacePlaceholdersForV3)(oldManifest, bicepContent);
|
|
319
|
-
if (isSpfx) {
|
|
320
|
-
await (0, v3MigrationUtils_1.updateAndSaveManifestForSpfx)(context, manifest);
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
await context.fsWriteFile(manifestPath, manifest);
|
|
324
|
-
}
|
|
325
|
-
// Read Microsoft Entra app manifest and save to ./aad.manifest.json
|
|
326
|
-
const oldAadManifestPath = path.join(oldAppPackageFolderPath, versionMetadata_1.MetadataV2.aadTemplateFileName);
|
|
327
|
-
const oldAadManifestExists = await fs.pathExists(path.join(context.projectPath, oldAadManifestPath));
|
|
328
|
-
const activeResourcePlugins = projectSettings.solutionSettings.activeResourcePlugins;
|
|
329
|
-
const component = projectSettings.components;
|
|
330
|
-
const aadRequired = (activeResourcePlugins && activeResourcePlugins.includes("fx-resource-aad-app-for-teams")) ||
|
|
331
|
-
(component &&
|
|
332
|
-
component.findIndex((component, index, obj) => {
|
|
333
|
-
return component.name == "aad-app";
|
|
334
|
-
}) >= 0);
|
|
335
|
-
if (oldAadManifestExists && aadRequired) {
|
|
336
|
-
let oldAadManifest = await fs.readFile(path.join(context.projectPath, oldAadManifestPath), "utf-8");
|
|
337
|
-
oldAadManifest = (0, v3MigrationUtils_1.replaceAppIdUri)(oldAadManifest, appIdUri);
|
|
338
|
-
const aadManifest = (0, MigrationUtils_1.replacePlaceholdersForV3)(oldAadManifest, bicepContent);
|
|
339
|
-
await context.fsWriteFile(versionMetadata_1.MetadataV3.aadManifestFileName, aadManifest);
|
|
340
|
-
}
|
|
341
|
-
else if (aadRequired && !oldAadManifestExists) {
|
|
342
|
-
throw new error_1.MigrationError(new Error((0, localizeUtils_1.getLocalizedString)("core.migrationV3.aadManifestNotExist")), exports.errorNames.aadManifestTemplateNotExist, exports.learnMoreLink);
|
|
343
|
-
}
|
|
344
|
-
await context.fsRemove(oldAppPackageFolderPath);
|
|
345
|
-
}
|
|
346
|
-
async function azureParameterMigration(context) {
|
|
347
|
-
// Ensure `.fx/configs` exists
|
|
348
|
-
const configFolderPath = path.join(".fx", "configs");
|
|
349
|
-
const configFolderPathExists = await context.fsPathExists(configFolderPath);
|
|
350
|
-
if (!configFolderPathExists) {
|
|
351
|
-
// Keep same practice now. Needs dicussion whether to throw error.
|
|
352
|
-
return;
|
|
353
|
-
}
|
|
354
|
-
// Read Bicep
|
|
355
|
-
const azureFolderPath = path.join((0, v3MigrationUtils_1.getTemplateFolderPath)(context), "azure");
|
|
356
|
-
const bicepContent = await (0, v3MigrationUtils_1.readBicepContent)(context);
|
|
357
|
-
const fileNames = (0, v3MigrationUtils_1.fsReadDirSync)(context, configFolderPath);
|
|
358
|
-
for (const fileName of fileNames) {
|
|
359
|
-
if (!fileName.startsWith("azure.parameters.")) {
|
|
360
|
-
continue;
|
|
361
|
-
}
|
|
362
|
-
const parameterPath = path.join(context.projectPath, configFolderPath, fileName);
|
|
363
|
-
// double confirm for file existence as fsReadDirSync may return deleted file names
|
|
364
|
-
if (!fs.pathExistsSync(parameterPath)) {
|
|
365
|
-
continue;
|
|
366
|
-
}
|
|
367
|
-
const content = await fs.readFile(parameterPath, "utf-8");
|
|
368
|
-
const newContent = (0, MigrationUtils_1.replacePlaceholdersForV3)(content, bicepContent);
|
|
369
|
-
await context.fsWriteFile(path.join(azureFolderPath, fileName), newContent);
|
|
370
|
-
}
|
|
371
|
-
}
|
|
372
|
-
async function showNotification(ctx, versionForMigration) {
|
|
373
|
-
const isNonmodalMessage = (0, v3MigrationUtils_1.getParameterFromCxt)(ctx, Parameters.isNonmodalMessage);
|
|
374
|
-
if (isNonmodalMessage) {
|
|
375
|
-
return await showNonmodalNotification(ctx, versionForMigration);
|
|
376
|
-
}
|
|
377
|
-
const confirmOnly = (0, v3MigrationUtils_1.getParameterFromCxt)(ctx, Parameters.confirmOnly);
|
|
378
|
-
if (confirmOnly) {
|
|
379
|
-
return await showConfirmOnlyNotification(ctx);
|
|
380
|
-
}
|
|
381
|
-
const skipUserConfirm = (0, v3MigrationUtils_1.getParameterFromCxt)(ctx, Parameters.skipUserConfirm);
|
|
382
|
-
if (skipUserConfirm) {
|
|
383
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
384
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.ok,
|
|
385
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.skipUserConfirm,
|
|
386
|
-
});
|
|
387
|
-
return true;
|
|
388
|
-
}
|
|
389
|
-
return await askUserConfirm(ctx, versionForMigration);
|
|
390
|
-
}
|
|
391
|
-
async function askUserConfirm(ctx, versionForMigration) {
|
|
392
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotificationStart);
|
|
393
|
-
let answer;
|
|
394
|
-
do {
|
|
395
|
-
answer = await popupMessageModal(versionForMigration);
|
|
396
|
-
if (answer === (0, exports.moreInfoButton)()) {
|
|
397
|
-
globalVars_1.TOOLS?.ui.openUrl(exports.learnMoreLink);
|
|
398
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
399
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.learnMore,
|
|
400
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.modal,
|
|
401
|
-
});
|
|
402
|
-
}
|
|
403
|
-
} while (answer === (0, exports.moreInfoButton)());
|
|
404
|
-
if (!answer || !migrationMessageButtons().includes(answer)) {
|
|
405
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
406
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.cancel,
|
|
407
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.modal,
|
|
408
|
-
});
|
|
409
|
-
ctx.result = (0, teamsfx_api_1.err)(new error_1.UpgradeV3CanceledError());
|
|
410
|
-
(0, v3MigrationUtils_1.outputCancelMessage)(versionForMigration.currentVersion, versionForMigration.platform);
|
|
411
|
-
return false;
|
|
412
|
-
}
|
|
413
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
414
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.ok,
|
|
415
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.modal,
|
|
416
|
-
});
|
|
417
|
-
return true;
|
|
418
|
-
}
|
|
419
|
-
async function showNonmodalNotification(ctx, versionForMigration) {
|
|
420
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotificationStart);
|
|
421
|
-
const answer = await popupMessageNonmodal(versionForMigration);
|
|
422
|
-
if (answer === (0, exports.moreInfoButton)()) {
|
|
423
|
-
globalVars_1.TOOLS?.ui.openUrl(exports.learnMoreLink);
|
|
424
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
425
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.learnMore,
|
|
426
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.nonmodal,
|
|
427
|
-
});
|
|
428
|
-
return false;
|
|
429
|
-
}
|
|
430
|
-
else if (answer === upgradeButton()) {
|
|
431
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
432
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.ok,
|
|
433
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.nonmodal,
|
|
434
|
-
});
|
|
435
|
-
return true;
|
|
436
|
-
}
|
|
437
|
-
return false;
|
|
438
|
-
}
|
|
439
|
-
async function showConfirmOnlyNotification(ctx) {
|
|
440
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotificationStart);
|
|
441
|
-
const res = await globalVars_1.TOOLS?.ui.showMessage("info", (0, localizeUtils_1.getLocalizedString)("core.migrationV3.confirmOnly.Message"), true, "OK");
|
|
442
|
-
if (res?.isOk() && res.value === "OK") {
|
|
443
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
444
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.ok,
|
|
445
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.confirmOnly,
|
|
446
|
-
});
|
|
447
|
-
return true;
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorNotification, {
|
|
451
|
-
[TelemetryPropertyKey.button]: TelemetryPropertyValue.cancel,
|
|
452
|
-
[TelemetryPropertyKey.mode]: TelemetryPropertyValue.confirmOnly,
|
|
453
|
-
});
|
|
454
|
-
return false;
|
|
455
|
-
}
|
|
456
|
-
}
|
|
457
|
-
async function popupMessageModal(versionForMigration) {
|
|
458
|
-
return await popupMessage(versionForMigration, true);
|
|
459
|
-
}
|
|
460
|
-
async function popupMessageNonmodal(versionForMigration) {
|
|
461
|
-
return await popupMessage(versionForMigration, false);
|
|
462
|
-
}
|
|
463
|
-
async function popupMessage(versionForMigration, isModal) {
|
|
464
|
-
const res = await globalVars_1.TOOLS?.ui.showMessage("warn", (0, v3MigrationUtils_1.migrationNotificationMessage)(versionForMigration), isModal, ...migrationMessageButtons());
|
|
465
|
-
return res?.isOk() ? res.value : undefined;
|
|
466
|
-
}
|
|
467
|
-
async function setTelemetryProjectId(context) {
|
|
468
|
-
const projectPath = (0, v3MigrationUtils_1.getParameterFromCxt)(context, "projectPath", "");
|
|
469
|
-
try {
|
|
470
|
-
const projectId = await (0, v3MigrationUtils_1.getTrackingIdFromPath)(projectPath);
|
|
471
|
-
telemetryProperties[TelemetryPropertyKey.projectId] = projectId;
|
|
472
|
-
}
|
|
473
|
-
catch (error) {
|
|
474
|
-
// do not set trackingId if error happens
|
|
475
|
-
}
|
|
476
|
-
}
|
|
477
|
-
async function configsMigration(context) {
|
|
478
|
-
// general
|
|
479
|
-
if (await context.fsPathExists(path.join(".fx", "configs"))) {
|
|
480
|
-
// if ./fx/states/ exists
|
|
481
|
-
const fileNames = (0, v3MigrationUtils_1.fsReadDirSync)(context, path.join(".fx", "configs")); // search all files, get file names
|
|
482
|
-
for (const fileName of fileNames)
|
|
483
|
-
if (fileName.startsWith("config.")) {
|
|
484
|
-
const fileRegex = new RegExp("(config\\.)([a-zA-Z0-9_-]*)(\\.json)$", "g"); // config.*.json
|
|
485
|
-
const fileNamesArray = fileRegex.exec(fileName);
|
|
486
|
-
if (fileNamesArray != null) {
|
|
487
|
-
// get envName
|
|
488
|
-
const envName = fileNamesArray[2];
|
|
489
|
-
// create .env.{env} file if not exist
|
|
490
|
-
await context.fsEnsureDir(versionMetadata_1.MetadataV3.defaultEnvironmentFolder);
|
|
491
|
-
if (!(await context.fsPathExists(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName)))) {
|
|
492
|
-
// create env file
|
|
493
|
-
await context.fsCreateFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName));
|
|
494
|
-
// add first line of comment
|
|
495
|
-
await context.fsWriteFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName), envName === "local" ? versionMetadata_1.MetadataV3.envFileLocalComment : versionMetadata_1.MetadataV3.envFileDevComment, Constants.envWriteOption);
|
|
496
|
-
}
|
|
497
|
-
const obj = await (0, v3MigrationUtils_1.readJsonFile)(context, path.join(".fx", "configs", "config." + envName + ".json"));
|
|
498
|
-
if (obj["manifest"]) {
|
|
499
|
-
const bicepContent = await (0, v3MigrationUtils_1.readBicepContent)(context);
|
|
500
|
-
const teamsfx_env = fs
|
|
501
|
-
.readFileSync(path.join(context.projectPath, versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName))
|
|
502
|
-
.toString()
|
|
503
|
-
.includes("TEAMSFX_ENV=")
|
|
504
|
-
? ""
|
|
505
|
-
: "TEAMSFX_ENV=" + envName + os_1.EOL + "APP_NAME_SUFFIX=" + envName + os_1.EOL;
|
|
506
|
-
// convert every name and add the env name at the first line
|
|
507
|
-
const envData = teamsfx_env +
|
|
508
|
-
(0, v3MigrationUtils_1.jsonObjectNamesConvertV3)(obj["manifest"], "manifest.", "", MigrationUtils_1.FileType.CONFIG, bicepContent);
|
|
509
|
-
await context.fsWriteFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName), envData, Constants.envWriteOption);
|
|
510
|
-
}
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
}
|
|
515
|
-
async function statesMigration(context) {
|
|
516
|
-
// general
|
|
517
|
-
if (await context.fsPathExists(path.join(".fx", "states"))) {
|
|
518
|
-
// if ./fx/states/ exists
|
|
519
|
-
const fileNames = (0, v3MigrationUtils_1.fsReadDirSync)(context, path.join(".fx", "states")); // search all files, get file names
|
|
520
|
-
for (const fileName of fileNames)
|
|
521
|
-
if (fileName.startsWith("state.")) {
|
|
522
|
-
const fileRegex = new RegExp("(state\\.)([a-zA-Z0-9_-]*)(\\.json)$", "g"); // state.*.json
|
|
523
|
-
const fileNamesArray = fileRegex.exec(fileName);
|
|
524
|
-
if (fileNamesArray != null) {
|
|
525
|
-
// get envName
|
|
526
|
-
const envName = fileNamesArray[2];
|
|
527
|
-
// create .env.{env} file if not exist
|
|
528
|
-
await context.fsEnsureDir(versionMetadata_1.MetadataV3.defaultEnvironmentFolder);
|
|
529
|
-
if (!(await context.fsPathExists(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName)))) {
|
|
530
|
-
// create env file
|
|
531
|
-
await context.fsCreateFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName));
|
|
532
|
-
// add first line of comment
|
|
533
|
-
await context.fsWriteFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName), envName === "local" ? versionMetadata_1.MetadataV3.envFileLocalComment : versionMetadata_1.MetadataV3.envFileDevComment, Constants.envWriteOption);
|
|
534
|
-
}
|
|
535
|
-
const obj = await (0, v3MigrationUtils_1.readJsonFile)(context, path.join(".fx", "states", "state." + envName + ".json"));
|
|
536
|
-
if (obj) {
|
|
537
|
-
const bicepContent = await (0, v3MigrationUtils_1.readBicepContent)(context);
|
|
538
|
-
// convert every name
|
|
539
|
-
const envData = (0, v3MigrationUtils_1.jsonObjectNamesConvertV3)(obj, "state.", "", MigrationUtils_1.FileType.STATE, bicepContent);
|
|
540
|
-
await context.fsWriteFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName), envData, Constants.envWriteOption);
|
|
541
|
-
}
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
async function userdataMigration(context) {
|
|
547
|
-
const stateFolder = path.join(versionMetadata_1.MetadataV2.configFolder, versionMetadata_1.MetadataV2.stateFolder);
|
|
548
|
-
if (!(await context.fsPathExists(stateFolder))) {
|
|
549
|
-
return;
|
|
550
|
-
}
|
|
551
|
-
await context.fsEnsureDir(versionMetadata_1.MetadataV3.defaultEnvironmentFolder);
|
|
552
|
-
const stateFiles = (0, v3MigrationUtils_1.fsReadDirSync)(context, stateFolder); // search all files, get file names
|
|
553
|
-
for (const stateFile of stateFiles) {
|
|
554
|
-
const envName = (0, v3MigrationUtils_1.tryExtractEnvFromUserdata)(stateFile);
|
|
555
|
-
if (envName) {
|
|
556
|
-
// get envName
|
|
557
|
-
const envFileName = (0, v3MigrationUtils_1.buildEnvUserFileName)(envName);
|
|
558
|
-
const bicepContent = await (0, v3MigrationUtils_1.readBicepContent)(context);
|
|
559
|
-
const envData = versionMetadata_1.MetadataV3.secretFileComment +
|
|
560
|
-
os_1.EOL +
|
|
561
|
-
versionMetadata_1.MetadataV3.secretComment +
|
|
562
|
-
(await (0, v3MigrationUtils_1.readAndConvertUserdata)(context, path.join(stateFolder, stateFile), bicepContent));
|
|
563
|
-
await context.fsWriteFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, envFileName), envData, Constants.envWriteOption);
|
|
564
|
-
}
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
async function debugMigration(context) {
|
|
568
|
-
// Backup vscode/tasks.json
|
|
569
|
-
await context.backup(Constants.tasksJsonPath);
|
|
570
|
-
// Read .vscode/tasks.json
|
|
571
|
-
const tasksJsonContent = await (0, debugV3MigrationUtils_1.readJsonCommentFile)(path.join(context.projectPath, Constants.tasksJsonPath));
|
|
572
|
-
if (!(0, debugV3MigrationUtils_1.isCommentObject)(tasksJsonContent) || !Array.isArray(tasksJsonContent["tasks"])) {
|
|
573
|
-
// Invalid tasks.json content
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
// Migrate .vscode/tasks.json
|
|
577
|
-
const migrateTaskFuncs = [
|
|
578
|
-
taskMigrator_1.migrateTransparentPrerequisite,
|
|
579
|
-
taskMigrator_1.migrateTransparentNpmInstall,
|
|
580
|
-
taskMigrator_1.migrateTransparentLocalTunnel,
|
|
581
|
-
taskMigrator_1.migrateSetUpTab,
|
|
582
|
-
taskMigrator_1.migrateSetUpBot,
|
|
583
|
-
taskMigrator_1.migrateSetUpSSO,
|
|
584
|
-
taskMigrator_1.migratePrepareManifest,
|
|
585
|
-
taskMigrator_1.migrateInstallAppInTeams,
|
|
586
|
-
taskMigrator_1.migrateValidateDependencies,
|
|
587
|
-
taskMigrator_1.migrateBackendExtensionsInstall,
|
|
588
|
-
taskMigrator_1.migrateFrontendStart,
|
|
589
|
-
taskMigrator_1.migrateAuthStart,
|
|
590
|
-
taskMigrator_1.migrateBotStart,
|
|
591
|
-
taskMigrator_1.migrateBackendWatch,
|
|
592
|
-
taskMigrator_1.migrateBackendStart,
|
|
593
|
-
taskMigrator_1.migratePreDebugCheck,
|
|
594
|
-
taskMigrator_1.migrateValidateLocalPrerequisites,
|
|
595
|
-
taskMigrator_1.migrateNgrokStartTask,
|
|
596
|
-
taskMigrator_1.migrateNgrokStartCommand,
|
|
597
|
-
taskMigrator_1.migrateGetFuncPathCommand,
|
|
598
|
-
];
|
|
599
|
-
const oldProjectSettings = await loadProjectSettings(context.projectPath);
|
|
600
|
-
const placeholderMappings = await (0, debugV3MigrationUtils_1.getPlaceholderMappings)(context);
|
|
601
|
-
const debugContext = new debugMigrationContext_1.DebugMigrationContext(context, tasksJsonContent["tasks"], oldProjectSettings, placeholderMappings);
|
|
602
|
-
for (const func of migrateTaskFuncs) {
|
|
603
|
-
await func(debugContext);
|
|
604
|
-
}
|
|
605
|
-
// Write .vscode/tasks.json
|
|
606
|
-
await context.fsWriteFile(Constants.tasksJsonPath, commentJson.stringify(tasksJsonContent, null, 4));
|
|
607
|
-
// Generate app.local.yml
|
|
608
|
-
const appYmlGenerator = new appLocalYmlGenerator_1.AppLocalYmlGenerator(oldProjectSettings, debugContext.appYmlConfig, placeholderMappings);
|
|
609
|
-
const appYmlString = await appYmlGenerator.generateAppYml();
|
|
610
|
-
await context.fsWriteFile(versionMetadata_1.MetadataV3.localConfigFile, appYmlString);
|
|
611
|
-
}
|
|
612
|
-
function checkapimPluginExists(pjSettings) {
|
|
613
|
-
if (pjSettings && pjSettings["components"]) {
|
|
614
|
-
for (const obj of pjSettings["components"])
|
|
615
|
-
if (Object.keys(obj).includes("name") && obj["name"] === "apim")
|
|
616
|
-
return true;
|
|
617
|
-
return false;
|
|
618
|
-
}
|
|
619
|
-
else {
|
|
620
|
-
return false;
|
|
621
|
-
}
|
|
622
|
-
}
|
|
623
|
-
async function generateApimPluginEnvContent(context) {
|
|
624
|
-
// general
|
|
625
|
-
if (await context.fsPathExists(path.join(".fx", "configs", "projectSettings.json"))) {
|
|
626
|
-
const projectSettingsContent = fs.readJsonSync(path.join(context.projectPath, ".fx", "configs", "projectSettings.json"));
|
|
627
|
-
// judge if apim plugin exists
|
|
628
|
-
if (checkapimPluginExists(projectSettingsContent)) {
|
|
629
|
-
const fileNames = (0, v3MigrationUtils_1.fsReadDirSync)(context, path.join(".fx", "configs"));
|
|
630
|
-
for (const fileName of fileNames)
|
|
631
|
-
if (fileName.startsWith("config.")) {
|
|
632
|
-
const fileRegex = new RegExp("(config.)([a-zA-Z0-9_-]*)(.json)$", "g"); // config.*.json
|
|
633
|
-
const fileNamesArray = fileRegex.exec(fileName);
|
|
634
|
-
if (fileNamesArray != null) {
|
|
635
|
-
// get envName
|
|
636
|
-
const envName = fileNamesArray[2];
|
|
637
|
-
if (envName != "local") {
|
|
638
|
-
await context.fsEnsureDir(versionMetadata_1.MetadataV3.defaultEnvironmentFolder);
|
|
639
|
-
if (!(await context.fsPathExists(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName))))
|
|
640
|
-
await context.fsCreateFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName));
|
|
641
|
-
const apimPluginAppendContent = "APIM__PUBLISHEREMAIL= # To protect your privacy, Microsoft 365 Agents Toolkit does not store your email address. Please enter your email address below before provisioning to avoid failures." +
|
|
642
|
-
os_1.EOL +
|
|
643
|
-
"APIM__PUBLISHERNAME= # To protect your privacy, Microsoft 365 Agents Toolkit does not store your name. Please enter your name below before provisioning to avoid failures." +
|
|
644
|
-
os_1.EOL;
|
|
645
|
-
await context.fsWriteFile(path.join(versionMetadata_1.MetadataV3.defaultEnvironmentFolder, Constants.envFilePrefix + envName), apimPluginAppendContent, Constants.envWriteOption);
|
|
646
|
-
}
|
|
647
|
-
}
|
|
648
|
-
}
|
|
649
|
-
}
|
|
650
|
-
}
|
|
651
|
-
}
|
|
652
|
-
async function checkActiveResourcePlugins(projectPath) {
|
|
653
|
-
try {
|
|
654
|
-
const projectSettings = await loadProjectSettings(projectPath);
|
|
655
|
-
const solutionSettings = projectSettings.solutionSettings;
|
|
656
|
-
if (projectSettings && solutionSettings && solutionSettings.activeResourcePlugins) {
|
|
657
|
-
return true;
|
|
658
|
-
}
|
|
659
|
-
else {
|
|
660
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorPrecheckFailed, {
|
|
661
|
-
[TelemetryPropertyKey.reason]: "solutionSettings invalid",
|
|
662
|
-
});
|
|
663
|
-
return false;
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
catch (error) {
|
|
667
|
-
sendTelemetryEventForUpgrade(telemetry_1.Component.core, telemetry_1.TelemetryEvent.ProjectMigratorPrecheckFailed, {
|
|
668
|
-
[TelemetryPropertyKey.reason]: error.message,
|
|
669
|
-
});
|
|
670
|
-
return false;
|
|
671
|
-
}
|
|
672
|
-
}
|
|
673
|
-
async function updateGitignore(context) {
|
|
674
|
-
const gitignoreFile = ".gitignore";
|
|
675
|
-
const ignoreFileExist = await context.backup(gitignoreFile);
|
|
676
|
-
if (!ignoreFileExist) {
|
|
677
|
-
await context.fsCreateFile(gitignoreFile);
|
|
678
|
-
}
|
|
679
|
-
let ignoreFileContent = await fs.readFile(path.join(context.projectPath, gitignoreFile), "utf8");
|
|
680
|
-
ignoreFileContent += os_1.EOL + `${versionMetadata_1.MetadataV3.defaultEnvironmentFolder}/${(0, v3MigrationUtils_1.buildEnvUserFileName)("*")}`;
|
|
681
|
-
ignoreFileContent += os_1.EOL + `${versionMetadata_1.MetadataV3.defaultEnvironmentFolder}/${(0, v3MigrationUtils_1.buildEnvFileName)("local")}`;
|
|
682
|
-
ignoreFileContent += os_1.EOL + `${migrationContext_1.backupFolder}/*`;
|
|
683
|
-
ignoreFileContent += os_1.EOL + debugV3MigrationUtils_1.ignoreDevToolsDir;
|
|
684
|
-
await context.fsWriteFile(gitignoreFile, ignoreFileContent);
|
|
685
|
-
}
|
|
686
|
-
function sendTelemetryEventForUpgrade(component, eventName, properties, measurements) {
|
|
687
|
-
const mergedProperties = { ...properties, ...telemetryProperties };
|
|
688
|
-
(0, telemetry_1.sendTelemetryEvent)(component, eventName, mergedProperties, measurements);
|
|
689
|
-
}
|
|
690
|
-
function sendTelemetryErrorEventForUpgrade(component, eventName, fxError, properties) {
|
|
691
|
-
const mergedProperties = { ...properties, ...telemetryProperties };
|
|
692
|
-
(0, telemetry_1.sendTelemetryErrorEvent)(component, eventName, fxError, mergedProperties);
|
|
693
|
-
}
|
|
694
|
-
//# sourceMappingURL=projectMigratorV3.js.map
|