@microsoft/teamsfx-core 1.4.1-alpha.313131ea.0 → 1.4.1-alpha.8cd782b1e.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/common/local/constants.d.ts +0 -4
- package/build/common/local/constants.d.ts.map +1 -1
- package/build/common/local/constants.js +1 -5
- package/build/common/local/constants.js.map +1 -1
- package/build/common/local/portChecker.d.ts.map +1 -1
- package/build/common/local/portChecker.js +1 -8
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/local/projectSettingsHelper.d.ts +0 -1
- package/build/common/local/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/local/projectSettingsHelper.js +2 -5
- package/build/common/local/projectSettingsHelper.js.map +1 -1
- package/build/common/localSettingsProvider.d.ts +3 -3
- package/build/common/localSettingsProvider.d.ts.map +1 -1
- package/build/common/localSettingsProvider.js +11 -5
- package/build/common/localSettingsProvider.js.map +1 -1
- package/build/common/projectSettingsValidator.d.ts.map +1 -1
- package/build/common/projectSettingsValidator.js +4 -0
- package/build/common/projectSettingsValidator.js.map +1 -1
- package/build/common/samples-config.json +12 -2
- package/build/common/tools.d.ts +0 -4
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +1 -4
- package/build/common/tools.js.map +1 -1
- package/build/core/error.d.ts +0 -6
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +1 -25
- package/build/core/error.js.map +1 -1
- package/build/core/index.d.ts +3 -6
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +145 -202
- package/build/core/index.js.map +1 -1
- package/build/core/middleware/CommonErrorHandlerMW.d.ts.map +1 -1
- package/build/core/middleware/CommonErrorHandlerMW.js +7 -2
- package/build/core/middleware/CommonErrorHandlerMW.js.map +1 -1
- package/build/core/middleware/concurrentLocker.d.ts.map +1 -1
- package/build/core/middleware/concurrentLocker.js +1 -2
- package/build/core/middleware/concurrentLocker.js.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.d.ts +2 -0
- package/build/core/middleware/envInfoLoaderV3.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoaderV3.js +4 -1
- package/build/core/middleware/envInfoLoaderV3.js.map +1 -1
- package/build/core/middleware/index.d.ts +0 -2
- package/build/core/middleware/index.d.ts.map +1 -1
- package/build/core/middleware/index.js +0 -2
- package/build/core/middleware/index.js.map +1 -1
- package/build/core/middleware/localSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/localSettingsLoader.js +4 -4
- package/build/core/middleware/localSettingsLoader.js.map +1 -1
- package/build/core/middleware/localSettingsWriter.d.ts.map +1 -1
- package/build/core/middleware/localSettingsWriter.js +2 -1
- package/build/core/middleware/localSettingsWriter.js.map +1 -1
- package/build/core/middleware/projectMigrator.d.ts.map +1 -1
- package/build/core/middleware/projectMigrator.js +28 -35
- package/build/core/middleware/projectMigrator.js.map +1 -1
- package/build/core/middleware/questionModel.d.ts +0 -1
- package/build/core/middleware/questionModel.d.ts.map +1 -1
- package/build/core/middleware/questionModel.js +2 -39
- package/build/core/middleware/questionModel.js.map +1 -1
- package/build/core/question.d.ts +0 -1
- package/build/core/question.d.ts.map +1 -1
- package/build/core/question.js +1 -26
- package/build/core/question.js.map +1 -1
- package/build/core/tools.d.ts +0 -2
- package/build/core/tools.d.ts.map +1 -1
- package/build/core/tools.js +3 -63
- package/build/core/tools.js.map +1 -1
- package/build/core/utils.d.ts +1 -2
- package/build/core/utils.d.ts.map +1 -1
- package/build/core/utils.js +1 -5
- package/build/core/utils.js.map +1 -1
- package/build/plugins/resource/aad/v3/index.d.ts +3 -3
- package/build/plugins/resource/aad/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v3/index.js +6 -9
- package/build/plugins/resource/aad/v3/index.js.map +1 -1
- package/build/plugins/resource/apim/managers/questionManager.d.ts.map +1 -1
- package/build/plugins/resource/apim/managers/questionManager.js +8 -4
- package/build/plugins/resource/apim/managers/questionManager.js.map +1 -1
- package/build/plugins/resource/apim/v3/index.d.ts +5 -5
- package/build/plugins/resource/apim/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/apim/v3/index.js +12 -18
- package/build/plugins/resource/apim/v3/index.js.map +1 -1
- package/build/plugins/resource/appstudio/appStudio.js +1 -1
- package/build/plugins/resource/appstudio/appStudio.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.d.ts +0 -1
- package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +27 -31
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts +1 -0
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +22 -9
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts +2 -2
- package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.js +28 -5
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.d.ts +17 -4
- package/build/plugins/resource/appstudio/v3/plugin.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/plugin.js +124 -28
- package/build/plugins/resource/appstudio/v3/plugin.js.map +1 -1
- package/build/plugins/resource/bot/constants.d.ts +0 -4
- package/build/plugins/resource/bot/constants.d.ts.map +1 -1
- package/build/plugins/resource/bot/constants.js +0 -6
- package/build/plugins/resource/bot/constants.js.map +1 -1
- package/build/plugins/resource/bot/dotnet/plugin.d.ts +0 -3
- package/build/plugins/resource/bot/dotnet/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/dotnet/plugin.js +0 -9
- package/build/plugins/resource/bot/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/bot/errors.d.ts +0 -3
- package/build/plugins/resource/bot/errors.d.ts.map +1 -1
- package/build/plugins/resource/bot/errors.js +1 -9
- package/build/plugins/resource/bot/errors.js.map +1 -1
- package/build/plugins/resource/bot/index.d.ts +1 -2
- package/build/plugins/resource/bot/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/index.js +0 -7
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/bot/interface.d.ts +0 -1
- package/build/plugins/resource/bot/interface.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.d.ts +0 -1
- package/build/plugins/resource/bot/plugin.d.ts.map +1 -1
- package/build/plugins/resource/bot/plugin.js +46 -41
- package/build/plugins/resource/bot/plugin.js.map +1 -1
- package/build/plugins/resource/bot/resources/messages.d.ts +0 -3
- package/build/plugins/resource/bot/resources/messages.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/messages.js +0 -5
- package/build/plugins/resource/bot/resources/messages.js.map +1 -1
- package/build/plugins/resource/bot/resources/strings.d.ts +0 -1
- package/build/plugins/resource/bot/resources/strings.d.ts.map +1 -1
- package/build/plugins/resource/bot/resources/strings.js +0 -2
- package/build/plugins/resource/bot/resources/strings.js.map +1 -1
- package/build/plugins/resource/bot/v2/index.d.ts +3 -3
- package/build/plugins/resource/bot/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/v2/index.js +4 -4
- package/build/plugins/resource/bot/v2/index.js.map +1 -1
- package/build/plugins/resource/bot/v3/index.d.ts +6 -7
- package/build/plugins/resource/bot/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/bot/v3/index.js +18 -25
- package/build/plugins/resource/bot/v3/index.js.map +1 -1
- package/build/plugins/resource/frontend/constants.d.ts +1 -0
- package/build/plugins/resource/frontend/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/constants.js +1 -0
- package/build/plugins/resource/frontend/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.d.ts +21 -0
- package/build/plugins/resource/frontend/dotnet/constants.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/constants.js +23 -1
- package/build/plugins/resource/frontend/dotnet/constants.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts +1 -0
- package/build/plugins/resource/frontend/dotnet/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/plugin.js +59 -0
- package/build/plugins/resource/frontend/dotnet/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts +3 -0
- package/build/plugins/resource/frontend/dotnet/resources/errors.d.ts.map +1 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.js +10 -1
- package/build/plugins/resource/frontend/dotnet/resources/errors.js.map +1 -1
- package/build/plugins/resource/frontend/index.d.ts +1 -0
- package/build/plugins/resource/frontend/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/index.js +4 -0
- package/build/plugins/resource/frontend/index.js.map +1 -1
- package/build/plugins/resource/frontend/interface.d.ts +1 -0
- package/build/plugins/resource/frontend/interface.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.d.ts +1 -0
- package/build/plugins/resource/frontend/plugin.d.ts.map +1 -1
- package/build/plugins/resource/frontend/plugin.js +3 -0
- package/build/plugins/resource/frontend/plugin.js.map +1 -1
- package/build/plugins/resource/frontend/v2/index.d.ts +1 -0
- package/build/plugins/resource/frontend/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v2/index.js +3 -0
- package/build/plugins/resource/frontend/v2/index.js.map +1 -1
- package/build/plugins/resource/frontend/v3/index.d.ts +5 -5
- package/build/plugins/resource/frontend/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/v3/index.js +38 -39
- package/build/plugins/resource/frontend/v3/index.js.map +1 -1
- package/build/plugins/resource/function/v3/index.d.ts +6 -7
- package/build/plugins/resource/function/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/function/v3/index.js +17 -21
- package/build/plugins/resource/function/v3/index.js.map +1 -1
- package/build/plugins/resource/identity/v3/index.d.ts +4 -4
- package/build/plugins/resource/identity/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/identity/v3/index.js +9 -12
- package/build/plugins/resource/identity/v3/index.js.map +1 -1
- package/build/plugins/resource/keyvault/v3/index.d.ts +5 -6
- package/build/plugins/resource/keyvault/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/keyvault/v3/index.js +9 -15
- package/build/plugins/resource/keyvault/v3/index.js.map +1 -1
- package/build/plugins/resource/spfx/v3/index.d.ts +3 -3
- package/build/plugins/resource/spfx/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/spfx/v3/index.js +4 -5
- package/build/plugins/resource/spfx/v3/index.js.map +1 -1
- package/build/plugins/resource/sql/v3/index.d.ts +6 -6
- package/build/plugins/resource/sql/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/sql/v3/index.js +17 -16
- package/build/plugins/resource/sql/v3/index.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts +2 -2
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +36 -43
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts +15 -3
- package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/commonQuestions.js +14 -8
- package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +0 -2
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +0 -2
- package/build/plugins/solution/fx-solution/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js +47 -8
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts +2 -2
- package/build/plugins/solution/fx-solution/debug/scaffolding.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/scaffolding.js +12 -5
- package/build/plugins/solution/fx-solution/debug/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/question.d.ts +0 -2
- package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/question.js +1 -14
- package/build/plugins/solution/fx-solution/question.js.map +1 -1
- package/build/plugins/solution/fx-solution/solution.d.ts +0 -2
- package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/solution.js +4 -79
- package/build/plugins/solution/fx-solution/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/deploy.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/deploy.js +17 -0
- package/build/plugins/solution/fx-solution/v2/deploy.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/getQuestions.js +1 -6
- package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provision.js +4 -0
- package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts +0 -2
- package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js +1 -24
- package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/scaffolding.js +1 -7
- package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/utils.js +3 -4
- package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addFeature.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addFeature.js +106 -29
- package/build/plugins/solution/fx-solution/v3/addFeature.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.d.ts +0 -1
- package/build/plugins/solution/fx-solution/v3/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.js +2 -3
- package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/deploy.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.js +31 -25
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/solution.js +2 -2
- package/build/plugins/solution/fx-solution/v3/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/userTask.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/userTask.js +7 -3
- package/build/plugins/solution/fx-solution/v3/userTask.js.map +1 -1
- package/package.json +3 -3
- package/templates/plugins/resource/bot/bot-msgext.csharp.default.zip +0 -0
- package/templates/plugins/resource/bot/bot-msgext.js.default.zip +0 -0
- package/templates/plugins/resource/bot/bot-msgext.ts.default.zip +0 -0
- package/templates/plugins/resource/bot/bot.csharp.default.zip +0 -0
- package/templates/plugins/resource/bot/bot.js.default.zip +0 -0
- package/templates/plugins/resource/bot/bot.ts.default.zip +0 -0
- package/templates/plugins/resource/bot/msgext.js.default.zip +0 -0
- package/templates/plugins/resource/bot/msgext.ts.default.zip +0 -0
- package/templates/plugins/resource/dotnet/blazor-base.csharp.default.zip +0 -0
- package/templates/plugins/resource/frontend/tab.csharp.default.zip +0 -0
- package/templates/plugins/resource/frontend/tab.js.default.zip +0 -0
- package/templates/plugins/resource/frontend/tab.ts.default.zip +0 -0
- package/templates/plugins/resource/function/function-base.js.default.zip +0 -0
- package/templates/plugins/resource/function/function-base.ts.default.zip +0 -0
- package/templates/plugins/resource/function/function-triggers.js.HTTPTrigger.zip +0 -0
- package/templates/plugins/resource/function/function-triggers.ts.HTTPTrigger.zip +0 -0
- package/build/core/middleware/migrateConditionHandler.d.ts +0 -3
- package/build/core/middleware/migrateConditionHandler.d.ts.map +0 -1
- package/build/core/middleware/migrateConditionHandler.js +0 -23
- package/build/core/middleware/migrateConditionHandler.js.map +0 -1
- package/build/core/middleware/supportV1ConditionHandler.d.ts +0 -3
- package/build/core/middleware/supportV1ConditionHandler.d.ts.map +0 -1
- package/build/core/middleware/supportV1ConditionHandler.js +0 -23
- package/build/core/middleware/supportV1ConditionHandler.js.map +0 -1
- package/build/core/middleware/telemetrySender.d.ts +0 -6
- package/build/core/middleware/telemetrySender.d.ts.map +0 -1
- package/build/core/middleware/telemetrySender.js +0 -43
- package/build/core/middleware/telemetrySender.js.map +0 -1
package/build/core/index.js
CHANGED
|
@@ -34,14 +34,12 @@ const envInfoWriterV3_1 = require("./middleware/envInfoWriterV3");
|
|
|
34
34
|
const errorHandler_1 = require("./middleware/errorHandler");
|
|
35
35
|
const localSettingsLoader_1 = require("./middleware/localSettingsLoader");
|
|
36
36
|
const localSettingsWriter_1 = require("./middleware/localSettingsWriter");
|
|
37
|
-
const migrateConditionHandler_1 = require("./middleware/migrateConditionHandler");
|
|
38
37
|
const projectMigrator_1 = require("./middleware/projectMigrator");
|
|
39
38
|
const projectSettingsLoader_1 = require("./middleware/projectSettingsLoader");
|
|
40
39
|
const projectSettingsWriter_1 = require("./middleware/projectSettingsWriter");
|
|
41
40
|
const questionModel_1 = require("./middleware/questionModel");
|
|
42
41
|
const solutionLoader_1 = require("./middleware/solutionLoader");
|
|
43
42
|
const solutionLoaderV3_1 = require("./middleware/solutionLoaderV3");
|
|
44
|
-
const supportV1ConditionHandler_1 = require("./middleware/supportV1ConditionHandler");
|
|
45
43
|
const question_2 = require("./question");
|
|
46
44
|
const SolutionPluginContainer_1 = require("./SolutionPluginContainer");
|
|
47
45
|
const tools_2 = require("./tools");
|
|
@@ -83,7 +81,6 @@ class FxCore {
|
|
|
83
81
|
this._getQuestionsForCreateProjectV3 = questionModel_1.getQuestionsForCreateProjectV3;
|
|
84
82
|
this._getQuestionsForUserTask = questionModel_1.getQuestionsForUserTaskV2;
|
|
85
83
|
this._getQuestions = questionModel_1.getQuestionsV2;
|
|
86
|
-
this._getQuestionsForMigrateV1Project = questionModel_1.getQuestionsForMigrateV1Project;
|
|
87
84
|
//v3 questions
|
|
88
85
|
this._getQuestionsForAddFeature = questionModel_1.getQuestionsForAddFeature;
|
|
89
86
|
this._getQuestionsForProvision = questionModel_1.getQuestionsForProvision;
|
|
@@ -112,6 +109,7 @@ class FxCore {
|
|
|
112
109
|
}
|
|
113
110
|
}
|
|
114
111
|
async createProjectV2(inputs, ctx) {
|
|
112
|
+
var _a;
|
|
115
113
|
if (!ctx) {
|
|
116
114
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
|
|
117
115
|
}
|
|
@@ -170,11 +168,41 @@ class FxCore {
|
|
|
170
168
|
version: getProjectSettingsVersion(),
|
|
171
169
|
isFromSample: false,
|
|
172
170
|
};
|
|
173
|
-
if (
|
|
171
|
+
if ((_a = inputs.existingAppConfig) === null || _a === void 0 ? void 0 : _a.isCreatedFromExistingApp) {
|
|
174
172
|
// there is no solution settings if created from existing app
|
|
175
|
-
//
|
|
176
|
-
|
|
177
|
-
|
|
173
|
+
// create default env
|
|
174
|
+
ctx.projectSettings = projectSettings;
|
|
175
|
+
const newEnvConfig = __1.environmentManager.newEnvConfigData(appName, inputs.existingAppConfig);
|
|
176
|
+
const writeEnvResult = await __1.environmentManager.writeEnvConfig(projectPath, newEnvConfig, __1.environmentManager.getDefaultEnvName());
|
|
177
|
+
if (writeEnvResult.isErr()) {
|
|
178
|
+
return teamsfx_api_1.err(writeEnvResult.error);
|
|
179
|
+
}
|
|
180
|
+
// call App Studio V3 API to create manifest with placeholder
|
|
181
|
+
const appStudio = typedi_1.Container.get(constants_2.BuiltInFeaturePluginNames.appStudio);
|
|
182
|
+
const contextV2 = createV2Context(projectSettings);
|
|
183
|
+
const initRes = await appStudio.init(contextV2, inputs);
|
|
184
|
+
if (initRes.isErr())
|
|
185
|
+
return teamsfx_api_1.err(initRes.error);
|
|
186
|
+
const manifestCaps = [];
|
|
187
|
+
inputs.existingAppConfig.newAppTypes.forEach((t) => {
|
|
188
|
+
if (t === teamsfx_api_1.ExistingTeamsAppType.Bot)
|
|
189
|
+
manifestCaps.push({ name: "Bot", existingApp: true });
|
|
190
|
+
else if (t === teamsfx_api_1.ExistingTeamsAppType.StaticTab)
|
|
191
|
+
manifestCaps.push({ name: "staticTab", existingApp: true });
|
|
192
|
+
else if (t === teamsfx_api_1.ExistingTeamsAppType.ConfigurableTab)
|
|
193
|
+
manifestCaps.push({ name: "configurableTab", existingApp: true });
|
|
194
|
+
else if (t === teamsfx_api_1.ExistingTeamsAppType.MessageExtension)
|
|
195
|
+
manifestCaps.push({ name: "MessageExtension", existingApp: true });
|
|
196
|
+
});
|
|
197
|
+
const addCapabilitiesRes = await appStudio.addCapabilities(contextV2, inputs, manifestCaps);
|
|
198
|
+
if (addCapabilitiesRes.isErr())
|
|
199
|
+
return teamsfx_api_1.err(addCapabilitiesRes.error);
|
|
200
|
+
if (tools_1.isConfigUnifyEnabled()) {
|
|
201
|
+
const createLocalEnvResult = await this.createEnvWithName(__1.environmentManager.getLocalEnvName(), projectSettings, inputs);
|
|
202
|
+
if (createLocalEnvResult.isErr()) {
|
|
203
|
+
return teamsfx_api_1.err(createLocalEnvResult.error);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
178
206
|
}
|
|
179
207
|
else {
|
|
180
208
|
projectSettings.solutionSettings = {
|
|
@@ -226,6 +254,7 @@ class FxCore {
|
|
|
226
254
|
return teamsfx_api_1.ok(projectPath);
|
|
227
255
|
}
|
|
228
256
|
async createProjectV3(inputs, ctx) {
|
|
257
|
+
var _a;
|
|
229
258
|
if (!ctx) {
|
|
230
259
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
|
|
231
260
|
}
|
|
@@ -280,34 +309,37 @@ class FxCore {
|
|
|
280
309
|
if (initRes.isErr()) {
|
|
281
310
|
return teamsfx_api_1.err(initRes.error);
|
|
282
311
|
}
|
|
312
|
+
// persist projectSettings.json
|
|
283
313
|
ctx.projectSettings.programmingLanguage = inputs[question_2.CoreQuestionNames.ProgrammingLanguage];
|
|
284
314
|
ctx.projectSettings.isFromSample = false;
|
|
285
315
|
const projectSettingsPath = projectSettingsLoader_1.getProjectSettingsPath(projectPath);
|
|
286
|
-
await fs.writeFile(projectSettingsPath, JSON.stringify(ctx.projectSettings, null, 4));
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
if (inputs.platform === teamsfx_api_1.Platform.VS) {
|
|
293
|
-
features.push(constants_2.BuiltInFeaturePluginNames.dotnet);
|
|
294
|
-
}
|
|
295
|
-
else {
|
|
296
|
-
if (capabilities.includes(question_2.TabOptionItem.id)) {
|
|
297
|
-
features.push(constants_2.BuiltInFeaturePluginNames.frontend);
|
|
316
|
+
await fs.writeFile(projectSettingsPath, JSON.stringify(ctx.projectSettings, null, 4));
|
|
317
|
+
if (!((_a = inputs.existingAppConfig) === null || _a === void 0 ? void 0 : _a.isCreatedFromExistingApp)) {
|
|
318
|
+
// addFeature
|
|
319
|
+
const features = [];
|
|
320
|
+
if (!capabilities.includes(question_2.TabSPFxItem.id)) {
|
|
321
|
+
features.push(constants_2.BuiltInFeaturePluginNames.aad);
|
|
298
322
|
}
|
|
299
|
-
|
|
300
|
-
features.push(constants_2.BuiltInFeaturePluginNames.
|
|
323
|
+
if (inputs.platform === teamsfx_api_1.Platform.VS) {
|
|
324
|
+
features.push(constants_2.BuiltInFeaturePluginNames.dotnet);
|
|
301
325
|
}
|
|
302
|
-
|
|
303
|
-
capabilities.includes(
|
|
304
|
-
|
|
326
|
+
else {
|
|
327
|
+
if (capabilities.includes(question_2.TabOptionItem.id)) {
|
|
328
|
+
features.push(constants_2.BuiltInFeaturePluginNames.frontend);
|
|
329
|
+
}
|
|
330
|
+
else if (capabilities.includes(question_2.TabSPFxItem.id)) {
|
|
331
|
+
features.push(constants_2.BuiltInFeaturePluginNames.spfx);
|
|
332
|
+
}
|
|
333
|
+
if (capabilities.includes(question_2.BotOptionItem.id) ||
|
|
334
|
+
capabilities.includes(question_1.MessageExtensionItem.id)) {
|
|
335
|
+
features.push(constants_2.BuiltInFeaturePluginNames.bot);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
const addFeatureInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, features: features });
|
|
339
|
+
const addFeatureRes = await this.addFeature(addFeatureInputs);
|
|
340
|
+
if (addFeatureRes.isErr()) {
|
|
341
|
+
return teamsfx_api_1.err(addFeatureRes.error);
|
|
305
342
|
}
|
|
306
|
-
}
|
|
307
|
-
const addFeatureInputs = Object.assign(Object.assign({}, inputs), { projectPath: projectPath, features: features });
|
|
308
|
-
const addFeatureRes = await this.addFeature(addFeatureInputs);
|
|
309
|
-
if (addFeatureRes.isErr()) {
|
|
310
|
-
return teamsfx_api_1.err(addFeatureRes.error);
|
|
311
343
|
}
|
|
312
344
|
}
|
|
313
345
|
if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
|
|
@@ -316,91 +348,6 @@ class FxCore {
|
|
|
316
348
|
}
|
|
317
349
|
return teamsfx_api_1.ok(projectPath);
|
|
318
350
|
}
|
|
319
|
-
async migrateV1Project(inputs, ctx) {
|
|
320
|
-
var _a;
|
|
321
|
-
exports.currentStage = teamsfx_api_1.Stage.migrateV1;
|
|
322
|
-
inputs.stage = teamsfx_api_1.Stage.migrateV1;
|
|
323
|
-
const globalStateDescription = "openReadme";
|
|
324
|
-
const appName = ((_a = inputs[question_2.DefaultAppNameFunc.name]) !== null && _a !== void 0 ? _a : inputs[question_2.QuestionV1AppName.name]);
|
|
325
|
-
if (undefined === appName)
|
|
326
|
-
return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
|
|
327
|
-
const validateResult = jsonschema.validate(appName, {
|
|
328
|
-
pattern: question_2.ProjectNamePattern,
|
|
329
|
-
});
|
|
330
|
-
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
331
|
-
return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
|
|
332
|
-
}
|
|
333
|
-
const projectPath = inputs.projectPath;
|
|
334
|
-
if (!projectPath || !(await fs.pathExists(projectPath))) {
|
|
335
|
-
return teamsfx_api_1.err(error_1.ProjectFolderNotExistError(projectPath !== null && projectPath !== void 0 ? projectPath : ""));
|
|
336
|
-
}
|
|
337
|
-
const solution = await SolutionPluginContainer_1.getAllSolutionPlugins()[0];
|
|
338
|
-
const projectSettings = {
|
|
339
|
-
appName: appName,
|
|
340
|
-
projectId: uuid.v4(),
|
|
341
|
-
solutionSettings: {
|
|
342
|
-
name: solution.name,
|
|
343
|
-
version: "1.0.0",
|
|
344
|
-
migrateFromV1: true,
|
|
345
|
-
},
|
|
346
|
-
};
|
|
347
|
-
const solutionContext = Object.assign(Object.assign(Object.assign({ projectSettings: projectSettings, envInfo: tools_2.newEnvInfo(), root: projectPath }, this.tools), this.tools.tokenProvider), { answers: inputs, cryptoProvider: new crypto_1.LocalCrypto(projectSettings.projectId) });
|
|
348
|
-
const archiveResult = await this.archive(projectPath);
|
|
349
|
-
if (archiveResult.isErr()) {
|
|
350
|
-
return teamsfx_api_1.err(archiveResult.error);
|
|
351
|
-
}
|
|
352
|
-
await fs.ensureDir(projectPath);
|
|
353
|
-
await fs.ensureDir(path.join(projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
|
|
354
|
-
const createResult = await createBasicFolderStructure(inputs);
|
|
355
|
-
if (createResult.isErr()) {
|
|
356
|
-
return teamsfx_api_1.err(createResult.error);
|
|
357
|
-
}
|
|
358
|
-
if (!solution.migrate) {
|
|
359
|
-
return teamsfx_api_1.err(error_1.MigrateNotImplementError(projectPath));
|
|
360
|
-
}
|
|
361
|
-
const migrateV1Res = await solution.migrate(solutionContext);
|
|
362
|
-
if (migrateV1Res.isErr()) {
|
|
363
|
-
return migrateV1Res;
|
|
364
|
-
}
|
|
365
|
-
ctx.solution = solution;
|
|
366
|
-
ctx.solutionContext = solutionContext;
|
|
367
|
-
ctx.projectSettings = projectSettings;
|
|
368
|
-
if (inputs.platform === teamsfx_api_1.Platform.VSCode) {
|
|
369
|
-
await globalState_1.globalStateUpdate(globalStateDescription, true);
|
|
370
|
-
}
|
|
371
|
-
this._setEnvInfoV2(ctx);
|
|
372
|
-
return teamsfx_api_1.ok(projectPath);
|
|
373
|
-
}
|
|
374
|
-
async archive(projectPath) {
|
|
375
|
-
try {
|
|
376
|
-
const archiveFolderPath = path.join(projectPath, teamsfx_api_1.ArchiveFolderName);
|
|
377
|
-
await fs.ensureDir(archiveFolderPath);
|
|
378
|
-
const fileNames = await fs.readdir(projectPath);
|
|
379
|
-
const archiveLog = async (projectPath, message) => {
|
|
380
|
-
await fs.appendFile(path.join(projectPath, teamsfx_api_1.ArchiveLogFileName), `[${new Date().toISOString()}] ${message}\n`);
|
|
381
|
-
};
|
|
382
|
-
await archiveLog(projectPath, `Start to move files into '${teamsfx_api_1.ArchiveFolderName}' folder.`);
|
|
383
|
-
for (const fileName of fileNames) {
|
|
384
|
-
if (fileName === teamsfx_api_1.ArchiveFolderName || fileName === teamsfx_api_1.ArchiveLogFileName) {
|
|
385
|
-
continue;
|
|
386
|
-
}
|
|
387
|
-
try {
|
|
388
|
-
await fs.move(path.join(projectPath, fileName), path.join(archiveFolderPath, fileName), {
|
|
389
|
-
overwrite: true,
|
|
390
|
-
});
|
|
391
|
-
}
|
|
392
|
-
catch (e) {
|
|
393
|
-
await archiveLog(projectPath, `Failed to move '${fileName}'. ${e.message}`);
|
|
394
|
-
return teamsfx_api_1.err(error_1.ArchiveUserFileError(fileName, e.message));
|
|
395
|
-
}
|
|
396
|
-
await archiveLog(projectPath, `'${fileName}' has been moved to '${teamsfx_api_1.ArchiveFolderName}' folder.`);
|
|
397
|
-
}
|
|
398
|
-
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
399
|
-
}
|
|
400
|
-
catch (e) {
|
|
401
|
-
return teamsfx_api_1.err(error_1.ArchiveProjectError(e.message));
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
351
|
/**
|
|
405
352
|
* switch to different versions of provisionResources
|
|
406
353
|
*/
|
|
@@ -496,7 +443,7 @@ class FxCore {
|
|
|
496
443
|
async localDebug(inputs) {
|
|
497
444
|
inputs.env = __1.environmentManager.getLocalEnvName();
|
|
498
445
|
if (isV3())
|
|
499
|
-
return this.
|
|
446
|
+
return this.provisionResourcesV3(inputs);
|
|
500
447
|
else
|
|
501
448
|
return this.localDebugV2(inputs);
|
|
502
449
|
}
|
|
@@ -534,22 +481,6 @@ class FxCore {
|
|
|
534
481
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
535
482
|
}
|
|
536
483
|
}
|
|
537
|
-
async localDebugV3(inputs, ctx) {
|
|
538
|
-
exports.currentStage = teamsfx_api_1.Stage.debug;
|
|
539
|
-
inputs.stage = teamsfx_api_1.Stage.debug;
|
|
540
|
-
if (ctx &&
|
|
541
|
-
ctx.solutionV3 &&
|
|
542
|
-
ctx.contextV2 &&
|
|
543
|
-
ctx.envInfoV3 &&
|
|
544
|
-
ctx.solutionV3.provisionResources) {
|
|
545
|
-
const res = await ctx.solutionV3.provisionResources(ctx.contextV2, inputs, ctx.envInfoV3, exports.TOOLS.tokenProvider);
|
|
546
|
-
if (res.isOk()) {
|
|
547
|
-
ctx.localSettings = res.value;
|
|
548
|
-
}
|
|
549
|
-
return res;
|
|
550
|
-
}
|
|
551
|
-
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
552
|
-
}
|
|
553
484
|
_setEnvInfoV2(ctx) {
|
|
554
485
|
if (ctx && ctx.solutionContext) {
|
|
555
486
|
//workaround, compatible to api v2
|
|
@@ -682,6 +613,30 @@ class FxCore {
|
|
|
682
613
|
localSettings: (_b = ctx.solutionContext) === null || _b === void 0 ? void 0 : _b.localSettings,
|
|
683
614
|
});
|
|
684
615
|
}
|
|
616
|
+
async getProjectConfigV3(inputs, ctx) {
|
|
617
|
+
if (!ctx || !ctx.projectSettings)
|
|
618
|
+
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getProjectConfigV3 input stuff"));
|
|
619
|
+
if (!inputs.projectPath)
|
|
620
|
+
return teamsfx_api_1.ok(undefined);
|
|
621
|
+
inputs.stage = teamsfx_api_1.Stage.getProjectConfig;
|
|
622
|
+
exports.currentStage = teamsfx_api_1.Stage.getProjectConfig;
|
|
623
|
+
const config = {
|
|
624
|
+
projectSettings: ctx.projectSettings,
|
|
625
|
+
envInfos: {},
|
|
626
|
+
};
|
|
627
|
+
const envNamesRes = await __1.environmentManager.listAllEnvConfigs(inputs.projectPath);
|
|
628
|
+
if (envNamesRes.isErr()) {
|
|
629
|
+
return teamsfx_api_1.err(envNamesRes.error);
|
|
630
|
+
}
|
|
631
|
+
for (const env of envNamesRes.value) {
|
|
632
|
+
const result = await envInfoLoaderV3_1.loadEnvInfoV3(inputs, ctx.projectSettings, env, false);
|
|
633
|
+
if (result.isErr()) {
|
|
634
|
+
return teamsfx_api_1.err(result.error);
|
|
635
|
+
}
|
|
636
|
+
config.envInfos[env] = result.value;
|
|
637
|
+
}
|
|
638
|
+
return teamsfx_api_1.ok(config);
|
|
639
|
+
}
|
|
685
640
|
async grantPermission(inputs) {
|
|
686
641
|
if (isV3())
|
|
687
642
|
return this.grantPermissionV3(inputs);
|
|
@@ -868,9 +823,11 @@ class FxCore {
|
|
|
868
823
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
869
824
|
}
|
|
870
825
|
async _init(inputs, ctx) {
|
|
826
|
+
var _a;
|
|
871
827
|
if (!ctx) {
|
|
872
828
|
return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("ctx for createProject"));
|
|
873
829
|
}
|
|
830
|
+
// validate app name
|
|
874
831
|
const appName = inputs[question_2.QuestionAppName.name];
|
|
875
832
|
const validateResult = jsonschema.validate(appName, {
|
|
876
833
|
pattern: question_2.ProjectNamePattern,
|
|
@@ -878,29 +835,62 @@ class FxCore {
|
|
|
878
835
|
if (validateResult.errors && validateResult.errors.length > 0) {
|
|
879
836
|
return teamsfx_api_1.err(error_1.InvalidInputError("invalid app-name", inputs));
|
|
880
837
|
}
|
|
838
|
+
// create ProjectSettings
|
|
881
839
|
const projectSettings = newProjectSettings();
|
|
882
840
|
projectSettings.appName = appName;
|
|
883
841
|
ctx.projectSettings = projectSettings;
|
|
884
|
-
|
|
885
|
-
if (createEnvResult.isErr()) {
|
|
886
|
-
return teamsfx_api_1.err(createEnvResult.error);
|
|
887
|
-
}
|
|
888
|
-
if (tools_1.isConfigUnifyEnabled()) {
|
|
889
|
-
const createLocalEnvResult = await this.createEnvWithName(__1.environmentManager.getLocalEnvName(), projectSettings, inputs);
|
|
890
|
-
if (createLocalEnvResult.isErr()) {
|
|
891
|
-
return teamsfx_api_1.err(createLocalEnvResult.error);
|
|
892
|
-
}
|
|
893
|
-
}
|
|
842
|
+
// create folder structure
|
|
894
843
|
await fs.ensureDir(path.join(inputs.projectPath, `.${teamsfx_api_1.ConfigFolderName}`));
|
|
895
844
|
await fs.ensureDir(path.join(inputs.projectPath, "templates", `${teamsfx_api_1.AppPackageFolderName}`));
|
|
896
845
|
const basicFolderRes = await createBasicFolderStructure(inputs);
|
|
897
846
|
if (basicFolderRes.isErr()) {
|
|
898
847
|
return teamsfx_api_1.err(basicFolderRes.error);
|
|
899
848
|
}
|
|
849
|
+
// create contextV2
|
|
900
850
|
const context = createV2Context(projectSettings);
|
|
901
851
|
ctx.contextV2 = context;
|
|
902
852
|
const appStudioV3 = typedi_1.Container.get(constants_2.BuiltInFeaturePluginNames.appStudio);
|
|
903
|
-
|
|
853
|
+
// init manifest
|
|
854
|
+
const manifestInitRes = await appStudioV3.init(context, inputs);
|
|
855
|
+
if (manifestInitRes.isErr())
|
|
856
|
+
return teamsfx_api_1.err(manifestInitRes.error);
|
|
857
|
+
if ((_a = inputs.existingAppConfig) === null || _a === void 0 ? void 0 : _a.isCreatedFromExistingApp) {
|
|
858
|
+
const newEnvConfig = __1.environmentManager.newEnvConfigData(appName, inputs.existingAppConfig);
|
|
859
|
+
const writeEnvResult = await __1.environmentManager.writeEnvConfig(inputs.projectPath, newEnvConfig, __1.environmentManager.getDefaultEnvName());
|
|
860
|
+
if (writeEnvResult.isErr()) {
|
|
861
|
+
return teamsfx_api_1.err(writeEnvResult.error);
|
|
862
|
+
}
|
|
863
|
+
// call App Studio V3 API to create manifest with placeholder
|
|
864
|
+
const appStudio = typedi_1.Container.get(constants_2.BuiltInFeaturePluginNames.appStudio);
|
|
865
|
+
const contextV2 = createV2Context(projectSettings);
|
|
866
|
+
const initRes = await appStudio.init(contextV2, inputs);
|
|
867
|
+
if (initRes.isErr())
|
|
868
|
+
return teamsfx_api_1.err(initRes.error);
|
|
869
|
+
const manifestCaps = [];
|
|
870
|
+
inputs.existingAppConfig.newAppTypes.forEach((t) => {
|
|
871
|
+
if (t === teamsfx_api_1.ExistingTeamsAppType.Bot)
|
|
872
|
+
manifestCaps.push({ name: "Bot", existingApp: true });
|
|
873
|
+
else if (t === teamsfx_api_1.ExistingTeamsAppType.StaticTab)
|
|
874
|
+
manifestCaps.push({ name: "staticTab", existingApp: true });
|
|
875
|
+
else if (t === teamsfx_api_1.ExistingTeamsAppType.ConfigurableTab)
|
|
876
|
+
manifestCaps.push({ name: "configurableTab", existingApp: true });
|
|
877
|
+
else if (t === teamsfx_api_1.ExistingTeamsAppType.MessageExtension)
|
|
878
|
+
manifestCaps.push({ name: "MessageExtension", existingApp: true });
|
|
879
|
+
});
|
|
880
|
+
const addCapabilitiesRes = await appStudio.addCapabilities(contextV2, inputs, manifestCaps);
|
|
881
|
+
if (addCapabilitiesRes.isErr())
|
|
882
|
+
return teamsfx_api_1.err(addCapabilitiesRes.error);
|
|
883
|
+
}
|
|
884
|
+
else {
|
|
885
|
+
const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
|
|
886
|
+
if (createEnvResult.isErr()) {
|
|
887
|
+
return teamsfx_api_1.err(createEnvResult.error);
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
const createLocalEnvResult = await this.createEnvWithName(__1.environmentManager.getLocalEnvName(), projectSettings, inputs);
|
|
891
|
+
if (createLocalEnvResult.isErr()) {
|
|
892
|
+
return teamsfx_api_1.err(createLocalEnvResult.error);
|
|
893
|
+
}
|
|
904
894
|
return teamsfx_api_1.ok(teamsfx_api_1.Void);
|
|
905
895
|
}
|
|
906
896
|
async init(inputs, ctx) {
|
|
@@ -919,7 +909,6 @@ class FxCore {
|
|
|
919
909
|
tslib_1.__decorate([
|
|
920
910
|
hooks_1.hooks([
|
|
921
911
|
errorHandler_1.ErrorHandlerMW,
|
|
922
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
923
912
|
questionModel_1.QuestionModelMW,
|
|
924
913
|
contextInjector_1.ContextInjectorMW,
|
|
925
914
|
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
@@ -930,30 +919,15 @@ tslib_1.__decorate([
|
|
|
930
919
|
tslib_1.__metadata("design:returntype", Promise)
|
|
931
920
|
], FxCore.prototype, "createProjectV2", null);
|
|
932
921
|
tslib_1.__decorate([
|
|
933
|
-
hooks_1.hooks([errorHandler_1.ErrorHandlerMW,
|
|
922
|
+
hooks_1.hooks([errorHandler_1.ErrorHandlerMW, questionModel_1.QuestionModelMW, contextInjector_1.ContextInjectorMW]),
|
|
934
923
|
tslib_1.__metadata("design:type", Function),
|
|
935
924
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
936
925
|
tslib_1.__metadata("design:returntype", Promise)
|
|
937
926
|
], FxCore.prototype, "createProjectV3", null);
|
|
938
|
-
tslib_1.__decorate([
|
|
939
|
-
hooks_1.hooks([
|
|
940
|
-
errorHandler_1.ErrorHandlerMW,
|
|
941
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
942
|
-
migrateConditionHandler_1.MigrateConditionHandlerMW,
|
|
943
|
-
questionModel_1.QuestionModelMW,
|
|
944
|
-
contextInjector_1.ContextInjectorMW,
|
|
945
|
-
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
946
|
-
envInfoWriter_1.EnvInfoWriterMW(true),
|
|
947
|
-
]),
|
|
948
|
-
tslib_1.__metadata("design:type", Function),
|
|
949
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
950
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
951
|
-
], FxCore.prototype, "migrateV1Project", null);
|
|
952
927
|
tslib_1.__decorate([
|
|
953
928
|
hooks_1.hooks([
|
|
954
929
|
errorHandler_1.ErrorHandlerMW,
|
|
955
930
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
956
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
957
931
|
projectMigrator_1.ProjectMigratorMW,
|
|
958
932
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
959
933
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -971,7 +945,6 @@ tslib_1.__decorate([
|
|
|
971
945
|
hooks_1.hooks([
|
|
972
946
|
errorHandler_1.ErrorHandlerMW,
|
|
973
947
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
974
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
975
948
|
projectMigrator_1.ProjectMigratorMW,
|
|
976
949
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
977
950
|
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
@@ -989,7 +962,6 @@ tslib_1.__decorate([
|
|
|
989
962
|
hooks_1.hooks([
|
|
990
963
|
errorHandler_1.ErrorHandlerMW,
|
|
991
964
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
992
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
993
965
|
projectMigrator_1.ProjectMigratorMW,
|
|
994
966
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
995
967
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1007,7 +979,6 @@ tslib_1.__decorate([
|
|
|
1007
979
|
hooks_1.hooks([
|
|
1008
980
|
errorHandler_1.ErrorHandlerMW,
|
|
1009
981
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1010
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1011
982
|
projectMigrator_1.ProjectMigratorMW,
|
|
1012
983
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1013
984
|
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
@@ -1025,7 +996,6 @@ tslib_1.__decorate([
|
|
|
1025
996
|
hooks_1.hooks([
|
|
1026
997
|
errorHandler_1.ErrorHandlerMW,
|
|
1027
998
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1028
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1029
999
|
projectMigrator_1.ProjectMigratorMW,
|
|
1030
1000
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1031
1001
|
envInfoLoader_1.EnvInfoLoaderMW(!tools_1.isConfigUnifyEnabled()),
|
|
@@ -1045,25 +1015,6 @@ tslib_1.__decorate([
|
|
|
1045
1015
|
hooks_1.hooks([
|
|
1046
1016
|
errorHandler_1.ErrorHandlerMW,
|
|
1047
1017
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1048
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1049
|
-
projectMigrator_1.ProjectMigratorMW,
|
|
1050
|
-
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1051
|
-
localSettingsLoader_1.LocalSettingsLoaderMW,
|
|
1052
|
-
solutionLoaderV3_1.SolutionLoaderMW_V3,
|
|
1053
|
-
questionModel_1.QuestionModelMW,
|
|
1054
|
-
contextInjector_1.ContextInjectorMW,
|
|
1055
|
-
projectSettingsWriter_1.ProjectSettingsWriterMW,
|
|
1056
|
-
localSettingsWriter_1.LocalSettingsWriterMW,
|
|
1057
|
-
]),
|
|
1058
|
-
tslib_1.__metadata("design:type", Function),
|
|
1059
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1060
|
-
tslib_1.__metadata("design:returntype", Promise)
|
|
1061
|
-
], FxCore.prototype, "localDebugV3", null);
|
|
1062
|
-
tslib_1.__decorate([
|
|
1063
|
-
hooks_1.hooks([
|
|
1064
|
-
errorHandler_1.ErrorHandlerMW,
|
|
1065
|
-
concurrentLocker_1.ConcurrentLockerMW,
|
|
1066
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1067
1018
|
projectMigrator_1.ProjectMigratorMW,
|
|
1068
1019
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1069
1020
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1081,7 +1032,6 @@ tslib_1.__decorate([
|
|
|
1081
1032
|
hooks_1.hooks([
|
|
1082
1033
|
errorHandler_1.ErrorHandlerMW,
|
|
1083
1034
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1084
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1085
1035
|
projectMigrator_1.ProjectMigratorMW,
|
|
1086
1036
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1087
1037
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1099,7 +1049,6 @@ tslib_1.__decorate([
|
|
|
1099
1049
|
hooks_1.hooks([
|
|
1100
1050
|
errorHandler_1.ErrorHandlerMW,
|
|
1101
1051
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1102
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1103
1052
|
projectMigrator_1.ProjectMigratorMW,
|
|
1104
1053
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1105
1054
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1118,7 +1067,6 @@ tslib_1.__decorate([
|
|
|
1118
1067
|
hooks_1.hooks([
|
|
1119
1068
|
errorHandler_1.ErrorHandlerMW,
|
|
1120
1069
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1121
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1122
1070
|
projectMigrator_1.ProjectMigratorMW,
|
|
1123
1071
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1124
1072
|
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
@@ -1137,7 +1085,6 @@ tslib_1.__decorate([
|
|
|
1137
1085
|
hooks_1.hooks([
|
|
1138
1086
|
errorHandler_1.ErrorHandlerMW,
|
|
1139
1087
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1140
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1141
1088
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1142
1089
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
1143
1090
|
solutionLoader_1.SolutionLoaderMW,
|
|
@@ -1152,7 +1099,6 @@ tslib_1.__decorate([
|
|
|
1152
1099
|
hooks_1.hooks([
|
|
1153
1100
|
errorHandler_1.ErrorHandlerMW,
|
|
1154
1101
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1155
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1156
1102
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1157
1103
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
1158
1104
|
solutionLoader_1.SolutionLoaderMW,
|
|
@@ -1167,7 +1113,6 @@ tslib_1.__decorate([
|
|
|
1167
1113
|
hooks_1.hooks([
|
|
1168
1114
|
errorHandler_1.ErrorHandlerMW,
|
|
1169
1115
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1170
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1171
1116
|
projectMigrator_1.ProjectMigratorMW,
|
|
1172
1117
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1173
1118
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1178,11 +1123,16 @@ tslib_1.__decorate([
|
|
|
1178
1123
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1179
1124
|
tslib_1.__metadata("design:returntype", Promise)
|
|
1180
1125
|
], FxCore.prototype, "getProjectConfig", null);
|
|
1126
|
+
tslib_1.__decorate([
|
|
1127
|
+
hooks_1.hooks([errorHandler_1.ErrorHandlerMW, concurrentLocker_1.ConcurrentLockerMW, projectSettingsLoader_1.ProjectSettingsLoaderMW, contextInjector_1.ContextInjectorMW]),
|
|
1128
|
+
tslib_1.__metadata("design:type", Function),
|
|
1129
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
1130
|
+
tslib_1.__metadata("design:returntype", Promise)
|
|
1131
|
+
], FxCore.prototype, "getProjectConfigV3", null);
|
|
1181
1132
|
tslib_1.__decorate([
|
|
1182
1133
|
hooks_1.hooks([
|
|
1183
1134
|
errorHandler_1.ErrorHandlerMW,
|
|
1184
1135
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1185
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1186
1136
|
projectMigrator_1.ProjectMigratorMW,
|
|
1187
1137
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1188
1138
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1198,7 +1148,6 @@ tslib_1.__decorate([
|
|
|
1198
1148
|
hooks_1.hooks([
|
|
1199
1149
|
errorHandler_1.ErrorHandlerMW,
|
|
1200
1150
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1201
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1202
1151
|
projectMigrator_1.ProjectMigratorMW,
|
|
1203
1152
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1204
1153
|
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
@@ -1213,7 +1162,6 @@ tslib_1.__decorate([
|
|
|
1213
1162
|
hooks_1.hooks([
|
|
1214
1163
|
errorHandler_1.ErrorHandlerMW,
|
|
1215
1164
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1216
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1217
1165
|
projectMigrator_1.ProjectMigratorMW,
|
|
1218
1166
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1219
1167
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1229,7 +1177,6 @@ tslib_1.__decorate([
|
|
|
1229
1177
|
hooks_1.hooks([
|
|
1230
1178
|
errorHandler_1.ErrorHandlerMW,
|
|
1231
1179
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1232
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1233
1180
|
projectMigrator_1.ProjectMigratorMW,
|
|
1234
1181
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1235
1182
|
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
@@ -1243,7 +1190,6 @@ tslib_1.__decorate([
|
|
|
1243
1190
|
hooks_1.hooks([
|
|
1244
1191
|
errorHandler_1.ErrorHandlerMW,
|
|
1245
1192
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1246
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1247
1193
|
projectMigrator_1.ProjectMigratorMW,
|
|
1248
1194
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1249
1195
|
envInfoLoader_1.EnvInfoLoaderMW(false),
|
|
@@ -1259,7 +1205,6 @@ tslib_1.__decorate([
|
|
|
1259
1205
|
hooks_1.hooks([
|
|
1260
1206
|
errorHandler_1.ErrorHandlerMW,
|
|
1261
1207
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1262
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1263
1208
|
projectMigrator_1.ProjectMigratorMW,
|
|
1264
1209
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1265
1210
|
envInfoLoaderV3_1.EnvInfoLoaderMW_V3(false),
|
|
@@ -1285,7 +1230,6 @@ tslib_1.__decorate([
|
|
|
1285
1230
|
hooks_1.hooks([
|
|
1286
1231
|
errorHandler_1.ErrorHandlerMW,
|
|
1287
1232
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1288
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1289
1233
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1290
1234
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
1291
1235
|
contextInjector_1.ContextInjectorMW,
|
|
@@ -1298,7 +1242,6 @@ tslib_1.__decorate([
|
|
|
1298
1242
|
hooks_1.hooks([
|
|
1299
1243
|
errorHandler_1.ErrorHandlerMW,
|
|
1300
1244
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1301
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1302
1245
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1303
1246
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
1304
1247
|
contextInjector_1.ContextInjectorMW,
|
|
@@ -1311,7 +1254,6 @@ tslib_1.__decorate([
|
|
|
1311
1254
|
hooks_1.hooks([
|
|
1312
1255
|
errorHandler_1.ErrorHandlerMW,
|
|
1313
1256
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1314
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(false),
|
|
1315
1257
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1316
1258
|
solutionLoader_1.SolutionLoaderMW,
|
|
1317
1259
|
envInfoLoader_1.EnvInfoLoaderMW(true),
|
|
@@ -1325,7 +1267,6 @@ tslib_1.__decorate([
|
|
|
1325
1267
|
hooks_1.hooks([
|
|
1326
1268
|
errorHandler_1.ErrorHandlerMW,
|
|
1327
1269
|
concurrentLocker_1.ConcurrentLockerMW,
|
|
1328
|
-
supportV1ConditionHandler_1.SupportV1ConditionMW(true),
|
|
1329
1270
|
projectMigrator_1.ProjectMigratorMW,
|
|
1330
1271
|
projectSettingsLoader_1.ProjectSettingsLoaderMW,
|
|
1331
1272
|
solutionLoader_1.SolutionLoaderMW,
|
|
@@ -1385,17 +1326,19 @@ async function createBasicFolderStructure(inputs) {
|
|
|
1385
1326
|
license: "MIT",
|
|
1386
1327
|
}, null, 4));
|
|
1387
1328
|
}
|
|
1388
|
-
|
|
1329
|
+
const gitIgnoreContent = [
|
|
1389
1330
|
"node_modules",
|
|
1390
1331
|
`.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.InputConfigsFolderName}/${localSettingsProvider_1.localSettingsFileName}`,
|
|
1391
1332
|
`.${teamsfx_api_1.ConfigFolderName}/${teamsfx_api_1.StatesFolderName}/*.userdata`,
|
|
1392
1333
|
".DS_Store",
|
|
1393
|
-
`${teamsfx_api_1.ArchiveFolderName}`,
|
|
1394
|
-
`${teamsfx_api_1.ArchiveLogFileName}`,
|
|
1395
1334
|
".env.teamsfx.local",
|
|
1396
1335
|
"subscriptionInfo.json",
|
|
1397
1336
|
teamsfx_api_1.BuildFolderName,
|
|
1398
|
-
]
|
|
1337
|
+
];
|
|
1338
|
+
if (inputs.platform === teamsfx_api_1.Platform.VS) {
|
|
1339
|
+
gitIgnoreContent.push("appsettings.Development.json");
|
|
1340
|
+
}
|
|
1341
|
+
await fs.writeFile(path.join(inputs.projectPath, `.gitignore`), gitIgnoreContent.join("\n"));
|
|
1399
1342
|
}
|
|
1400
1343
|
catch (e) {
|
|
1401
1344
|
return teamsfx_api_1.err(error_1.WriteFileError(e));
|