@microsoft/teamsfx-core 0.8.0 → 0.8.1-alpha.249dee5b.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.
Files changed (230) hide show
  1. package/build/common/index.d.ts +1 -0
  2. package/build/common/index.d.ts.map +1 -1
  3. package/build/common/index.js +1 -0
  4. package/build/common/index.js.map +1 -1
  5. package/build/common/permissionInterface.d.ts +20 -0
  6. package/build/common/permissionInterface.d.ts.map +1 -1
  7. package/build/common/permissionInterface.js +8 -0
  8. package/build/common/permissionInterface.js.map +1 -1
  9. package/build/common/tools.d.ts +3 -1
  10. package/build/common/tools.d.ts.map +1 -1
  11. package/build/common/tools.js +14 -1
  12. package/build/common/tools.js.map +1 -1
  13. package/build/core/environment.d.ts +1 -0
  14. package/build/core/environment.d.ts.map +1 -1
  15. package/build/core/environment.js +13 -2
  16. package/build/core/environment.js.map +1 -1
  17. package/build/core/error.d.ts +4 -2
  18. package/build/core/error.d.ts.map +1 -1
  19. package/build/core/error.js +5 -3
  20. package/build/core/error.js.map +1 -1
  21. package/build/core/index.d.ts +6 -10
  22. package/build/core/index.d.ts.map +1 -1
  23. package/build/core/index.js +121 -98
  24. package/build/core/index.js.map +1 -1
  25. package/build/core/middleware/envInfoLoader.d.ts +1 -2
  26. package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
  27. package/build/core/middleware/envInfoLoader.js +77 -60
  28. package/build/core/middleware/envInfoLoader.js.map +1 -1
  29. package/build/core/middleware/envInfoWriter.d.ts +1 -1
  30. package/build/core/middleware/envInfoWriter.d.ts.map +1 -1
  31. package/build/core/middleware/envInfoWriter.js +5 -5
  32. package/build/core/middleware/envInfoWriter.js.map +1 -1
  33. package/build/core/middleware/errorHandler.d.ts.map +1 -1
  34. package/build/core/middleware/errorHandler.js +2 -1
  35. package/build/core/middleware/errorHandler.js.map +1 -1
  36. package/build/core/middleware/projectMigrator.d.ts.map +1 -1
  37. package/build/core/middleware/projectMigrator.js +30 -3
  38. package/build/core/middleware/projectMigrator.js.map +1 -1
  39. package/build/core/middleware/projectSettingsLoader.js +1 -1
  40. package/build/core/middleware/projectSettingsLoader.js.map +1 -1
  41. package/build/core/middleware/questionModel.d.ts.map +1 -1
  42. package/build/core/middleware/questionModel.js +10 -10
  43. package/build/core/middleware/questionModel.js.map +1 -1
  44. package/build/plugins/resource/aad/index.d.ts +2 -2
  45. package/build/plugins/resource/aad/index.d.ts.map +1 -1
  46. package/build/plugins/resource/aad/index.js +4 -4
  47. package/build/plugins/resource/aad/index.js.map +1 -1
  48. package/build/plugins/resource/aad/plugin.d.ts +3 -2
  49. package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
  50. package/build/plugins/resource/aad/plugin.js +4 -4
  51. package/build/plugins/resource/aad/plugin.js.map +1 -1
  52. package/build/plugins/resource/aad/utils/configs.d.ts +0 -1
  53. package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
  54. package/build/plugins/resource/aad/utils/configs.js +1 -11
  55. package/build/plugins/resource/aad/utils/configs.js.map +1 -1
  56. package/build/plugins/resource/aad/utils/tokenProvider.d.ts.map +1 -1
  57. package/build/plugins/resource/aad/utils/tokenProvider.js +1 -1
  58. package/build/plugins/resource/aad/utils/tokenProvider.js.map +1 -1
  59. package/build/plugins/resource/aad/v2/index.d.ts +1 -1
  60. package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
  61. package/build/plugins/resource/aad/v2/index.js +2 -2
  62. package/build/plugins/resource/aad/v2/index.js.map +1 -1
  63. package/build/plugins/resource/apim/v2/index.d.ts +4 -2
  64. package/build/plugins/resource/apim/v2/index.d.ts.map +1 -1
  65. package/build/plugins/resource/apim/v2/index.js +21 -23
  66. package/build/plugins/resource/apim/v2/index.js.map +1 -1
  67. package/build/plugins/resource/appstudio/errors.d.ts +1 -1
  68. package/build/plugins/resource/appstudio/errors.d.ts.map +1 -1
  69. package/build/plugins/resource/appstudio/errors.js +5 -1
  70. package/build/plugins/resource/appstudio/errors.js.map +1 -1
  71. package/build/plugins/resource/appstudio/index.d.ts +2 -2
  72. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  73. package/build/plugins/resource/appstudio/index.js +6 -5
  74. package/build/plugins/resource/appstudio/index.js.map +1 -1
  75. package/build/plugins/resource/appstudio/interfaces/IAppDefinition.d.ts +1 -0
  76. package/build/plugins/resource/appstudio/interfaces/IAppDefinition.d.ts.map +1 -1
  77. package/build/plugins/resource/appstudio/plugin.d.ts +3 -3
  78. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  79. package/build/plugins/resource/appstudio/plugin.js +21 -45
  80. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  81. package/build/plugins/resource/appstudio/utils/telemetry.d.ts +2 -1
  82. package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
  83. package/build/plugins/resource/appstudio/utils/telemetry.js +1 -0
  84. package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
  85. package/build/plugins/resource/appstudio/v2/index.d.ts +5 -5
  86. package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
  87. package/build/plugins/resource/appstudio/v2/index.js +17 -17
  88. package/build/plugins/resource/appstudio/v2/index.js.map +1 -1
  89. package/build/plugins/resource/bot/v2/index.d.ts +2 -2
  90. package/build/plugins/resource/bot/v2/index.d.ts.map +1 -1
  91. package/build/plugins/resource/bot/v2/index.js +3 -3
  92. package/build/plugins/resource/bot/v2/index.js.map +1 -1
  93. package/build/plugins/resource/frontend/v2/index.d.ts +2 -1
  94. package/build/plugins/resource/frontend/v2/index.d.ts.map +1 -1
  95. package/build/plugins/resource/frontend/v2/index.js +3 -0
  96. package/build/plugins/resource/frontend/v2/index.js.map +1 -1
  97. package/build/plugins/resource/function/v2/index.d.ts +4 -3
  98. package/build/plugins/resource/function/v2/index.d.ts.map +1 -1
  99. package/build/plugins/resource/function/v2/index.js +5 -13
  100. package/build/plugins/resource/function/v2/index.js.map +1 -1
  101. package/build/plugins/resource/identity/index.d.ts +2 -0
  102. package/build/plugins/resource/identity/index.d.ts.map +1 -1
  103. package/build/plugins/resource/identity/index.js +14 -6
  104. package/build/plugins/resource/identity/index.js.map +1 -1
  105. package/build/plugins/resource/identity/utils/contextUtils.d.ts +1 -3
  106. package/build/plugins/resource/identity/utils/contextUtils.d.ts.map +1 -1
  107. package/build/plugins/resource/identity/utils/contextUtils.js +2 -5
  108. package/build/plugins/resource/identity/utils/contextUtils.js.map +1 -1
  109. package/build/plugins/resource/localdebug/constants.d.ts +4 -0
  110. package/build/plugins/resource/localdebug/constants.d.ts.map +1 -1
  111. package/build/plugins/resource/localdebug/constants.js +6 -1
  112. package/build/plugins/resource/localdebug/constants.js.map +1 -1
  113. package/build/plugins/resource/localdebug/index.d.ts.map +1 -1
  114. package/build/plugins/resource/localdebug/index.js +8 -5
  115. package/build/plugins/resource/localdebug/index.js.map +1 -1
  116. package/build/plugins/resource/localdebug/v2/index.d.ts +2 -2
  117. package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
  118. package/build/plugins/resource/localdebug/v2/index.js +2 -2
  119. package/build/plugins/resource/localdebug/v2/index.js.map +1 -1
  120. package/build/plugins/resource/sql/config.d.ts +1 -0
  121. package/build/plugins/resource/sql/config.d.ts.map +1 -1
  122. package/build/plugins/resource/sql/config.js +1 -0
  123. package/build/plugins/resource/sql/config.js.map +1 -1
  124. package/build/plugins/resource/sql/constants.d.ts +3 -0
  125. package/build/plugins/resource/sql/constants.d.ts.map +1 -1
  126. package/build/plugins/resource/sql/constants.js +3 -0
  127. package/build/plugins/resource/sql/constants.js.map +1 -1
  128. package/build/plugins/resource/sql/errors.d.ts +4 -0
  129. package/build/plugins/resource/sql/errors.d.ts.map +1 -1
  130. package/build/plugins/resource/sql/errors.js +4 -0
  131. package/build/plugins/resource/sql/errors.js.map +1 -1
  132. package/build/plugins/resource/sql/plugin.d.ts +4 -1
  133. package/build/plugins/resource/sql/plugin.d.ts.map +1 -1
  134. package/build/plugins/resource/sql/plugin.js +62 -16
  135. package/build/plugins/resource/sql/plugin.js.map +1 -1
  136. package/build/plugins/resource/sql/utils/contextUtils.d.ts +1 -3
  137. package/build/plugins/resource/sql/utils/contextUtils.d.ts.map +1 -1
  138. package/build/plugins/resource/sql/utils/contextUtils.js +2 -5
  139. package/build/plugins/resource/sql/utils/contextUtils.js.map +1 -1
  140. package/build/plugins/resource/sql/v2/index.d.ts +3 -2
  141. package/build/plugins/resource/sql/v2/index.d.ts.map +1 -1
  142. package/build/plugins/resource/sql/v2/index.js +14 -12
  143. package/build/plugins/resource/sql/v2/index.js.map +1 -1
  144. package/build/plugins/resource/utils4v2.d.ts +5 -3
  145. package/build/plugins/resource/utils4v2.d.ts.map +1 -1
  146. package/build/plugins/resource/utils4v2.js +38 -7
  147. package/build/plugins/resource/utils4v2.js.map +1 -1
  148. package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts.map +1 -1
  149. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js +4 -2
  150. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js.map +1 -1
  151. package/build/plugins/solution/fx-solution/arm.d.ts +0 -1
  152. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  153. package/build/plugins/solution/fx-solution/arm.js +2 -6
  154. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  155. package/build/plugins/solution/fx-solution/commonQuestions.d.ts +2 -2
  156. package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
  157. package/build/plugins/solution/fx-solution/commonQuestions.js +46 -29
  158. package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
  159. package/build/plugins/solution/fx-solution/constants.d.ts +3 -6
  160. package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
  161. package/build/plugins/solution/fx-solution/constants.js +3 -6
  162. package/build/plugins/solution/fx-solution/constants.js.map +1 -1
  163. package/build/plugins/solution/fx-solution/executor.d.ts.map +1 -1
  164. package/build/plugins/solution/fx-solution/executor.js +39 -21
  165. package/build/plugins/solution/fx-solution/executor.js.map +1 -1
  166. package/build/plugins/solution/fx-solution/index.d.ts +1 -0
  167. package/build/plugins/solution/fx-solution/index.d.ts.map +1 -1
  168. package/build/plugins/solution/fx-solution/index.js +1 -0
  169. package/build/plugins/solution/fx-solution/index.js.map +1 -1
  170. package/build/plugins/solution/fx-solution/solution.d.ts +6 -5
  171. package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
  172. package/build/plugins/solution/fx-solution/solution.js +226 -119
  173. package/build/plugins/solution/fx-solution/solution.js.map +1 -1
  174. package/build/plugins/solution/fx-solution/v2/createEnv.d.ts.map +1 -1
  175. package/build/plugins/solution/fx-solution/v2/createEnv.js +11 -1
  176. package/build/plugins/solution/fx-solution/v2/createEnv.js.map +1 -1
  177. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts +2 -2
  178. package/build/plugins/solution/fx-solution/v2/executeUserTask.d.ts.map +1 -1
  179. package/build/plugins/solution/fx-solution/v2/executeUserTask.js +23 -10
  180. package/build/plugins/solution/fx-solution/v2/executeUserTask.js.map +1 -1
  181. package/build/plugins/solution/fx-solution/v2/executor.d.ts.map +1 -1
  182. package/build/plugins/solution/fx-solution/v2/executor.js +9 -1
  183. package/build/plugins/solution/fx-solution/v2/executor.js.map +1 -1
  184. package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.d.ts.map +1 -1
  185. package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.js +8 -2
  186. package/build/plugins/solution/fx-solution/v2/generateResourceTemplate.js.map +1 -1
  187. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts +5 -1
  188. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  189. package/build/plugins/solution/fx-solution/v2/getQuestions.js +287 -1
  190. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  191. package/build/plugins/solution/fx-solution/v2/package.d.ts.map +1 -1
  192. package/build/plugins/solution/fx-solution/v2/package.js +2 -1
  193. package/build/plugins/solution/fx-solution/v2/package.js.map +1 -1
  194. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  195. package/build/plugins/solution/fx-solution/v2/provision.js +4 -12
  196. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  197. package/build/plugins/solution/fx-solution/v2/provisionLocal.d.ts.map +1 -1
  198. package/build/plugins/solution/fx-solution/v2/provisionLocal.js +2 -1
  199. package/build/plugins/solution/fx-solution/v2/provisionLocal.js.map +1 -1
  200. package/build/plugins/solution/fx-solution/v2/publish.d.ts +2 -2
  201. package/build/plugins/solution/fx-solution/v2/publish.d.ts.map +1 -1
  202. package/build/plugins/solution/fx-solution/v2/publish.js +9 -9
  203. package/build/plugins/solution/fx-solution/v2/publish.js.map +1 -1
  204. package/build/plugins/solution/fx-solution/v2/scaffolding.d.ts.map +1 -1
  205. package/build/plugins/solution/fx-solution/v2/scaffolding.js +4 -0
  206. package/build/plugins/solution/fx-solution/v2/scaffolding.js.map +1 -1
  207. package/build/plugins/solution/fx-solution/v2/solution.d.ts +6 -4
  208. package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
  209. package/build/plugins/solution/fx-solution/v2/solution.js +2 -0
  210. package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
  211. package/build/plugins/solution/fx-solution/v2/utils.d.ts +1 -0
  212. package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
  213. package/build/plugins/solution/fx-solution/v2/utils.js +5 -1
  214. package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
  215. package/package.json +3 -3
  216. package/resource/strings.json +2 -2
  217. package/templates/plugins/resource/bot/bot-msgext.js.default.zip +0 -0
  218. package/templates/plugins/resource/bot/bot-msgext.ts.default.zip +0 -0
  219. package/templates/plugins/resource/bot/bot.js.default.zip +0 -0
  220. package/templates/plugins/resource/bot/bot.ts.default.zip +0 -0
  221. package/templates/plugins/resource/bot/msgext.js.default.zip +0 -0
  222. package/templates/plugins/resource/bot/msgext.ts.default.zip +0 -0
  223. package/templates/plugins/resource/frontend/tab.js.default.zip +0 -0
  224. package/templates/plugins/resource/frontend/tab.ts.default.zip +0 -0
  225. package/templates/plugins/resource/function/function-base.js.default.zip +0 -0
  226. package/templates/plugins/resource/function/function-base.ts.default.zip +0 -0
  227. package/templates/plugins/resource/function/function-triggers.js.HTTPTrigger.zip +0 -0
  228. package/templates/plugins/resource/function/function-triggers.ts.HTTPTrigger.zip +0 -0
  229. package/templates/plugins/resource/sql/bicep/output.template.bicep +1 -0
  230. package/templates/plugins/resource/sql/bicep/sql.template.bicep +3 -2
@@ -11,11 +11,15 @@ const fs = tslib_1.__importStar(require("fs-extra"));
11
11
  const jsonschema = tslib_1.__importStar(require("jsonschema"));
12
12
  const path = tslib_1.__importStar(require("path"));
13
13
  const uuid = tslib_1.__importStar(require("uuid"));
14
+ const __1 = require("..");
15
+ const constants_1 = require("../common/constants");
14
16
  const globalState_1 = require("../common/globalState");
17
+ const localSettingsProvider_1 = require("../common/localSettingsProvider");
15
18
  const telemetry_1 = require("../common/telemetry");
16
19
  const tools_1 = require("../common/tools");
17
- const question_1 = require("../plugins/solution/fx-solution/question");
18
- const projectMigrator_1 = require("./middleware/projectMigrator");
20
+ const plugins_1 = require("../plugins");
21
+ const ResourcePluginContainer_1 = require("../plugins/solution/fx-solution/ResourcePluginContainer");
22
+ const callback_1 = require("./callback");
19
23
  const error_1 = require("./error");
20
24
  const concurrentLocker_1 = require("./middleware/concurrentLocker");
21
25
  const contextInjector_1 = require("./middleware/contextInjector");
@@ -25,18 +29,15 @@ const errorHandler_1 = require("./middleware/errorHandler");
25
29
  const localSettingsLoader_1 = require("./middleware/localSettingsLoader");
26
30
  const localSettingsWriter_1 = require("./middleware/localSettingsWriter");
27
31
  const migrateConditionHandler_1 = require("./middleware/migrateConditionHandler");
28
- const __1 = require("..");
29
- const tools_2 = require("./tools");
30
- const question_2 = require("./question");
31
- const SolutionPluginContainer_1 = require("./SolutionPluginContainer");
32
- const questionModel_1 = require("./middleware/questionModel");
33
- const projectSettingsWriter_1 = require("./middleware/projectSettingsWriter");
32
+ const projectMigrator_1 = require("./middleware/projectMigrator");
34
33
  const projectSettingsLoader_1 = require("./middleware/projectSettingsLoader");
35
- const solutionLoader_1 = require("./middleware/solutionLoader");
34
+ const projectSettingsWriter_1 = require("./middleware/projectSettingsWriter");
36
35
  const projectUpgrader_1 = require("./middleware/projectUpgrader");
37
- const constants_1 = require("../common/constants");
38
- const localSettingsProvider_1 = require("../common/localSettingsProvider");
39
- const callback_1 = require("./callback");
36
+ const questionModel_1 = require("./middleware/questionModel");
37
+ const solutionLoader_1 = require("./middleware/solutionLoader");
38
+ const question_1 = require("./question");
39
+ const SolutionPluginContainer_1 = require("./SolutionPluginContainer");
40
+ const tools_2 = require("./tools");
40
41
  // API V2 feature flag
41
42
  function isV2() {
42
43
  const flag = process.env[constants_1.FeatureFlagName.APIV2];
@@ -67,12 +68,12 @@ class FxCore {
67
68
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("CoreHookContext"));
68
69
  }
69
70
  exports.currentStage = teamsfx_api_1.Stage.create;
70
- const folder = inputs[question_2.QuestionRootFolder.name];
71
- const scratch = inputs[question_2.CoreQuestionNames.CreateFromScratch];
71
+ const folder = inputs[question_1.QuestionRootFolder.name];
72
+ const scratch = inputs[question_1.CoreQuestionNames.CreateFromScratch];
72
73
  let projectPath;
73
74
  let globalStateDescription = "openReadme";
74
75
  const multiEnv = tools_1.isMultiEnvEnabled();
75
- if (scratch === question_2.ScratchOptionNo.id) {
76
+ if (scratch === question_1.ScratchOptionNo.id) {
76
77
  // create from sample
77
78
  const downloadRes = await downloadSample(this, inputs);
78
79
  if (downloadRes.isErr()) {
@@ -83,11 +84,11 @@ class FxCore {
83
84
  }
84
85
  else {
85
86
  // create from new
86
- const appName = inputs[question_2.QuestionAppName.name];
87
+ const appName = inputs[question_1.QuestionAppName.name];
87
88
  if (undefined === appName)
88
89
  return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
89
90
  const validateResult = jsonschema.validate(appName, {
90
- pattern: question_2.ProjectNamePattern,
91
+ pattern: question_1.ProjectNamePattern,
91
92
  });
92
93
  if (validateResult.errors && validateResult.errors.length > 0) {
93
94
  return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
@@ -115,6 +116,7 @@ class FxCore {
115
116
  version: "1.0.0",
116
117
  activeEnvironment: multiEnv ? __1.environmentManager.getDefaultEnvName() : "default",
117
118
  };
119
+ ctx.projectSettings = projectSettings;
118
120
  if (multiEnv) {
119
121
  const createEnvResult = await this.createEnvWithName(__1.environmentManager.getDefaultEnvName(), projectSettings, inputs);
120
122
  if (createEnvResult.isErr()) {
@@ -122,7 +124,7 @@ class FxCore {
122
124
  }
123
125
  }
124
126
  if (isV2()) {
125
- const solution = await SolutionPluginContainer_1.getSolutionPluginV2ByName(inputs[question_2.CoreQuestionNames.Solution]);
127
+ const solution = await SolutionPluginContainer_1.getSolutionPluginV2ByName(inputs[question_1.CoreQuestionNames.Solution]);
126
128
  if (!solution) {
127
129
  return teamsfx_api_1.err(new error_1.LoadSolutionError());
128
130
  }
@@ -139,7 +141,7 @@ class FxCore {
139
141
  if (generateResourceTemplateRes.isErr()) {
140
142
  return teamsfx_api_1.err(generateResourceTemplateRes.error);
141
143
  }
142
- ctx.provisionInputConfig = generateResourceTemplateRes.value;
144
+ // ctx.provisionInputConfig = generateResourceTemplateRes.value;
143
145
  if (multiEnv) {
144
146
  if (solution.createEnv) {
145
147
  inputs.copy = false;
@@ -149,16 +151,28 @@ class FxCore {
149
151
  }
150
152
  }
151
153
  }
154
+ else {
155
+ //TODO lagacy env.default.json
156
+ const profile = { solution: {} };
157
+ for (const plugin of ResourcePluginContainer_1.getAllV2ResourcePlugins()) {
158
+ profile[plugin.name] = {};
159
+ }
160
+ profile[plugins_1.PluginNames.LDEBUG]["trustDevCert"] = "true";
161
+ ctx.envInfoV2 = {
162
+ envName: __1.environmentManager.getDefaultEnvName(),
163
+ config: {},
164
+ profile: profile,
165
+ };
166
+ }
152
167
  }
153
168
  else {
154
- const solution = await SolutionPluginContainer_1.getSolutionPluginByName(inputs[question_2.CoreQuestionNames.Solution]);
169
+ const solution = await SolutionPluginContainer_1.getSolutionPluginByName(inputs[question_1.CoreQuestionNames.Solution]);
155
170
  if (!solution) {
156
171
  return teamsfx_api_1.err(new error_1.LoadSolutionError());
157
172
  }
158
173
  ctx.solution = solution;
159
174
  projectSettings.solutionSettings.name = solution.name;
160
175
  const solutionContext = Object.assign(Object.assign(Object.assign({ projectSettings: projectSettings, envInfo: tools_2.newEnvInfo(), root: projectPath }, this.tools), this.tools.tokenProvider), { answers: inputs });
161
- ctx.projectSettings = projectSettings;
162
176
  ctx.solutionContext = solutionContext;
163
177
  const createRes = await solution.create(solutionContext);
164
178
  if (createRes.isErr()) {
@@ -188,11 +202,11 @@ class FxCore {
188
202
  var _a;
189
203
  exports.currentStage = teamsfx_api_1.Stage.migrateV1;
190
204
  const globalStateDescription = "openReadme";
191
- const appName = ((_a = inputs[question_2.DefaultAppNameFunc.name]) !== null && _a !== void 0 ? _a : inputs[question_2.QuestionV1AppName.name]);
205
+ const appName = ((_a = inputs[question_1.DefaultAppNameFunc.name]) !== null && _a !== void 0 ? _a : inputs[question_1.QuestionV1AppName.name]);
192
206
  if (undefined === appName)
193
207
  return teamsfx_api_1.err(error_1.InvalidInputError(`App Name is empty`, inputs));
194
208
  const validateResult = jsonschema.validate(appName, {
195
- pattern: question_2.ProjectNamePattern,
209
+ pattern: question_1.ProjectNamePattern,
196
210
  });
197
211
  if (validateResult.errors && validateResult.errors.length > 0) {
198
212
  return teamsfx_api_1.err(error_1.InvalidInputError(`${validateResult.errors[0].message}`, inputs));
@@ -201,9 +215,6 @@ class FxCore {
201
215
  if (!projectPath || !(await fs.pathExists(projectPath))) {
202
216
  return teamsfx_api_1.err(error_1.ProjectFolderNotExistError(projectPath !== null && projectPath !== void 0 ? projectPath : ""));
203
217
  }
204
- if (isV2()) {
205
- return teamsfx_api_1.err(new error_1.NotImplementedError("migrateV1Project"));
206
- }
207
218
  const solution = await SolutionPluginContainer_1.getAllSolutionPlugins()[0];
208
219
  const projectSettings = {
209
220
  appName: appName,
@@ -294,10 +305,10 @@ class FxCore {
294
305
  async deployArtifacts(inputs, ctx) {
295
306
  exports.currentStage = teamsfx_api_1.Stage.deploy;
296
307
  if (isV2()) {
297
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.provisionOutputs)
308
+ if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2)
298
309
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("Deploy input stuff"));
299
310
  if (ctx.solutionV2.deploy)
300
- return await ctx.solutionV2.deploy(ctx.contextV2, inputs, ctx.provisionOutputs, this.tools.tokenProvider.azureAccountProvider);
311
+ return await ctx.solutionV2.deploy(ctx.contextV2, inputs, ctx.envInfoV2.profile, this.tools.tokenProvider.azureAccountProvider);
301
312
  else
302
313
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
303
314
  }
@@ -310,8 +321,10 @@ class FxCore {
310
321
  async localDebug(inputs, ctx) {
311
322
  exports.currentStage = teamsfx_api_1.Stage.debug;
312
323
  if (isV2()) {
313
- if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.localSettings)
324
+ if (!ctx || !ctx.solutionV2 || !ctx.contextV2)
314
325
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("localDebug input stuff"));
326
+ if (!ctx.localSettings)
327
+ ctx.localSettings = {};
315
328
  if (ctx.solutionV2.provisionLocalResource) {
316
329
  const res = await ctx.solutionV2.provisionLocalResource(ctx.contextV2, inputs, ctx.localSettings, this.tools.tokenProvider);
317
330
  if (res.kind === "success") {
@@ -340,13 +353,9 @@ class FxCore {
340
353
  async publishApplication(inputs, ctx) {
341
354
  exports.currentStage = teamsfx_api_1.Stage.publish;
342
355
  if (isV2()) {
343
- if (!ctx ||
344
- !ctx.solutionV2 ||
345
- !ctx.contextV2 ||
346
- !ctx.provisionOutputs ||
347
- !ctx.provisionInputConfig)
356
+ if (!ctx || !ctx.solutionV2 || !ctx.contextV2 || !ctx.envInfoV2)
348
357
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("publish input stuff"));
349
- return await ctx.solutionV2.publishApplication(ctx.contextV2, inputs, ctx.provisionInputConfig, ctx.provisionOutputs, this.tools.tokenProvider.appStudioToken);
358
+ return await ctx.solutionV2.publishApplication(ctx.contextV2, inputs, ctx.envInfoV2, this.tools.tokenProvider.appStudioToken);
350
359
  }
351
360
  else {
352
361
  if (!ctx || !ctx.solution || !ctx.solutionContext)
@@ -360,12 +369,14 @@ class FxCore {
360
369
  const array = namespace ? namespace.split("/") : [];
361
370
  if ("" !== namespace && array.length > 0) {
362
371
  if (isV2()) {
363
- if (!ctx || !ctx.solutionV2)
372
+ if (!ctx || !ctx.solutionV2 || !ctx.envInfoV2)
364
373
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("executeUserTask input stuff"));
365
374
  if (!ctx.contextV2)
366
375
  ctx.contextV2 = createV2Context(this, newProjectSettings());
367
- if (ctx.solutionV2.executeUserTask)
368
- return await ctx.solutionV2.executeUserTask(ctx.contextV2, inputs, func, this.tools.tokenProvider);
376
+ if (ctx.solutionV2.executeUserTask) {
377
+ const res = await ctx.solutionV2.executeUserTask(ctx.contextV2, inputs, func, ctx.envInfoV2, this.tools.tokenProvider);
378
+ return res;
379
+ }
369
380
  else
370
381
  return teamsfx_api_1.err(error_1.FunctionRouterError(func));
371
382
  }
@@ -382,10 +393,10 @@ class FxCore {
382
393
  }
383
394
  return teamsfx_api_1.err(error_1.FunctionRouterError(func));
384
395
  }
385
- async getQuestions(task, inputs, ctx) {
396
+ async getQuestions(stage, inputs, ctx) {
386
397
  if (!ctx)
387
398
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getQuestions input stuff"));
388
- if (task === teamsfx_api_1.Stage.create) {
399
+ if (stage === teamsfx_api_1.Stage.create) {
389
400
  delete inputs.projectPath;
390
401
  return await this._getQuestionsForCreateProject(inputs);
391
402
  }
@@ -395,26 +406,39 @@ class FxCore {
395
406
  ? ctx.contextV2
396
407
  : createV2Context(this, newProjectSettings());
397
408
  const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
398
- return await this._getQuestions(contextV2, solutionV2, task, inputs);
409
+ const envInfoV2 = ctx.envInfoV2
410
+ ? ctx.envInfoV2
411
+ : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, profile: {} };
412
+ inputs.stage = stage;
413
+ return await this._getQuestions(contextV2, solutionV2, stage, inputs, envInfoV2);
399
414
  }
400
415
  else {
401
416
  const solutionContext = ctx.solutionContext
402
417
  ? ctx.solutionContext
403
418
  : await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
404
419
  const solution = ctx.solution ? ctx.solution : SolutionPluginContainer_1.getAllSolutionPlugins()[0];
405
- return await this._getQuestions(solutionContext, solution, task, inputs);
420
+ return await this._getQuestions(solutionContext, solution, stage, inputs);
406
421
  }
407
422
  }
408
423
  }
409
424
  async getQuestionsForUserTask(func, inputs, ctx) {
425
+ if (!ctx)
426
+ return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("getQuestionsForUserTask input stuff"));
410
427
  if (isV2()) {
411
- return teamsfx_api_1.err(new error_1.NotImplementedError("getQuestionsForUserTask"));
428
+ const contextV2 = ctx.contextV2 ? ctx.contextV2 : createV2Context(this, newProjectSettings());
429
+ const solutionV2 = ctx.solutionV2 ? ctx.solutionV2 : await SolutionPluginContainer_1.getAllSolutionPluginsV2()[0];
430
+ const envInfoV2 = ctx.envInfoV2
431
+ ? ctx.envInfoV2
432
+ : { envName: __1.environmentManager.getDefaultEnvName(), config: {}, profile: {} };
433
+ return await this._getQuestionsForUserTask(contextV2, solutionV2, func, inputs, envInfoV2);
434
+ }
435
+ else {
436
+ const solutionContext = ctx.solutionContext
437
+ ? ctx.solutionContext
438
+ : await projectSettingsLoader_1.newSolutionContext(this.tools, inputs);
439
+ const solution = ctx.solution ? ctx.solution : SolutionPluginContainer_1.getAllSolutionPlugins()[0];
440
+ return await this._getQuestionsForUserTask(solutionContext, solution, func, inputs);
412
441
  }
413
- const solutionContext = ctx.solutionContext === undefined
414
- ? await projectSettingsLoader_1.newSolutionContext(this.tools, inputs)
415
- : ctx.solutionContext;
416
- const solution = ctx.solution === undefined ? await SolutionPluginContainer_1.getAllSolutionPlugins()[0] : ctx.solution;
417
- return await this._getQuestionsForUserTask(solutionContext, solution, func, inputs);
418
442
  }
419
443
  async getProjectConfig(inputs, ctx) {
420
444
  var _a, _b;
@@ -445,12 +469,23 @@ class FxCore {
445
469
  exports.currentStage = teamsfx_api_1.Stage.listCollaborator;
446
470
  return await ctx.solution.listCollaborator(ctx.solutionContext);
447
471
  }
448
- async _getQuestionsForUserTask(ctx, solution, func, inputs) {
472
+ async _getQuestionsForUserTask(ctx, solution, func, inputs, envInfo) {
449
473
  const namespace = func.namespace;
450
474
  const array = namespace ? namespace.split("/") : [];
451
- if (namespace && "" !== namespace && array.length > 0 && solution.getQuestionsForUserTask) {
452
- ctx.answers = inputs;
453
- const res = await solution.getQuestionsForUserTask(func, ctx);
475
+ if (namespace && "" !== namespace && array.length > 0) {
476
+ let res = teamsfx_api_1.ok(undefined);
477
+ if (isV2()) {
478
+ const solutionV2 = solution;
479
+ if (solutionV2.getQuestionsForUserTask) {
480
+ res = await solutionV2.getQuestionsForUserTask(ctx, inputs, func, envInfo, this.tools.tokenProvider);
481
+ }
482
+ }
483
+ else {
484
+ const solutionv1 = solution;
485
+ if (solutionv1.getQuestionsForUserTask) {
486
+ res = await solutionv1.getQuestionsForUserTask(func, ctx);
487
+ }
488
+ }
454
489
  if (res.isOk()) {
455
490
  if (res.value) {
456
491
  const node = res.value.trim();
@@ -478,22 +513,22 @@ class FxCore {
478
513
  }
479
514
  }
480
515
  }
481
- const defaultAppNameFunc = new teamsfx_api_1.QTreeNode(question_2.DefaultAppNameFunc);
516
+ const defaultAppNameFunc = new teamsfx_api_1.QTreeNode(question_1.DefaultAppNameFunc);
482
517
  node.addChild(defaultAppNameFunc);
483
- const appNameQuestion = new teamsfx_api_1.QTreeNode(question_2.QuestionV1AppName);
518
+ const appNameQuestion = new teamsfx_api_1.QTreeNode(question_1.QuestionV1AppName);
484
519
  appNameQuestion.condition = {
485
520
  validFunc: (input) => (!input ? undefined : "App name is auto generated."),
486
521
  };
487
522
  defaultAppNameFunc.addChild(appNameQuestion);
488
523
  return teamsfx_api_1.ok(node.trim());
489
524
  }
490
- async _getQuestions(ctx, solution, stage, inputs) {
525
+ async _getQuestions(ctx, solution, stage, inputs, envInfo) {
491
526
  if (stage !== teamsfx_api_1.Stage.create) {
492
527
  let res = teamsfx_api_1.ok(undefined);
493
528
  if (isV2()) {
494
529
  const solutionV2 = solution;
495
530
  if (solutionV2.getQuestions) {
496
- res = await solutionV2.getQuestions(ctx, inputs);
531
+ res = await solutionV2.getQuestions(ctx, inputs, envInfo, this.tools.tokenProvider);
497
532
  }
498
533
  }
499
534
  else {
@@ -517,7 +552,7 @@ class FxCore {
517
552
  return ctx.solutionContext.cryptoProvider.decrypt(ciphertext);
518
553
  }
519
554
  async buildArtifacts(inputs) {
520
- throw error_1.TaskNotSupportError(teamsfx_api_1.Stage.build);
555
+ throw new error_1.TaskNotSupportError(teamsfx_api_1.Stage.build);
521
556
  }
522
557
  async createEnv(inputs, ctx) {
523
558
  if (!ctx)
@@ -533,7 +568,7 @@ class FxCore {
533
568
  !createEnvCopyInput.sourceEnvName) {
534
569
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
535
570
  }
536
- const createEnvResult = await this.createEnvCopy(createEnvCopyInput.targetEnvName, createEnvCopyInput.sourceEnvName, projectSettings, inputs, core);
571
+ const createEnvResult = await this.createEnvCopy(createEnvCopyInput.targetEnvName, createEnvCopyInput.sourceEnvName, inputs, core);
537
572
  if (createEnvResult.isErr()) {
538
573
  return createEnvResult;
539
574
  }
@@ -567,7 +602,7 @@ class FxCore {
567
602
  this.tools.logProvider.debug(`[core] persist ${targetEnvName} env profile to path ${writeEnvResult.value}: ${JSON.stringify(newEnvConfig)}`);
568
603
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
569
604
  }
570
- async createEnvCopy(targetEnvName, sourceEnvName, projectSettings, inputs, core) {
605
+ async createEnvCopy(targetEnvName, sourceEnvName, inputs, core) {
571
606
  // copy env config file
572
607
  const targetEnvConfigFilePath = __1.environmentManager.getEnvConfigPath(targetEnvName, inputs.projectPath);
573
608
  const sourceEnvConfigFilePath = __1.environmentManager.getEnvConfigPath(sourceEnvName, inputs.projectPath);
@@ -613,16 +648,16 @@ class FxCore {
613
648
  return teamsfx_api_1.ok(teamsfx_api_1.Void);
614
649
  }
615
650
  async _getQuestionsForCreateProject(inputs) {
616
- const node = new teamsfx_api_1.QTreeNode(question_2.getCreateNewOrFromSampleQuestion(inputs.platform));
651
+ const node = new teamsfx_api_1.QTreeNode(question_1.getCreateNewOrFromSampleQuestion(inputs.platform));
617
652
  // create new
618
653
  const createNew = new teamsfx_api_1.QTreeNode({ type: "group" });
619
654
  node.addChild(createNew);
620
- createNew.condition = { equals: question_2.ScratchOptionYes.id };
655
+ createNew.condition = { equals: question_1.ScratchOptionYes.id };
621
656
  const globalSolutions = isV2()
622
657
  ? await SolutionPluginContainer_1.getAllSolutionPluginsV2()
623
658
  : await SolutionPluginContainer_1.getAllSolutionPlugins();
624
659
  const solutionNames = globalSolutions.map((s) => s.name);
625
- const selectSolution = question_2.QuestionSelectSolution;
660
+ const selectSolution = question_1.QuestionSelectSolution;
626
661
  selectSolution.staticOptions = solutionNames;
627
662
  const solutionSelectNode = new teamsfx_api_1.QTreeNode(selectSolution);
628
663
  createNew.addChild(solutionSelectNode);
@@ -652,21 +687,15 @@ class FxCore {
652
687
  solutionSelectNode.addChild(solutionNode);
653
688
  }
654
689
  }
655
- createNew.addChild(new teamsfx_api_1.QTreeNode(question_2.QuestionRootFolder));
656
- createNew.addChild(new teamsfx_api_1.QTreeNode(question_2.QuestionAppName));
690
+ createNew.addChild(new teamsfx_api_1.QTreeNode(question_1.QuestionRootFolder));
691
+ createNew.addChild(new teamsfx_api_1.QTreeNode(question_1.QuestionAppName));
657
692
  // create from sample
658
- const sampleNode = new teamsfx_api_1.QTreeNode(question_2.SampleSelect);
693
+ const sampleNode = new teamsfx_api_1.QTreeNode(question_1.SampleSelect);
659
694
  node.addChild(sampleNode);
660
- sampleNode.condition = { equals: question_2.ScratchOptionNo.id };
661
- sampleNode.addChild(new teamsfx_api_1.QTreeNode(question_2.QuestionRootFolder));
695
+ sampleNode.condition = { equals: question_1.ScratchOptionNo.id };
696
+ sampleNode.addChild(new teamsfx_api_1.QTreeNode(question_1.QuestionRootFolder));
662
697
  return teamsfx_api_1.ok(node.trim());
663
698
  }
664
- async removeEnv(inputs) {
665
- throw error_1.TaskNotSupportError(teamsfx_api_1.Stage.removeEnv);
666
- }
667
- async switchEnv(inputs) {
668
- throw error_1.TaskNotSupportError(teamsfx_api_1.Stage.switchEnv);
669
- }
670
699
  }
671
700
  tslib_1.__decorate([
672
701
  hooks_1.hooks([
@@ -674,7 +703,7 @@ tslib_1.__decorate([
674
703
  questionModel_1.QuestionModelMW,
675
704
  contextInjector_1.ContextInjectorMW,
676
705
  projectSettingsWriter_1.ProjectSettingsWriterMW,
677
- envInfoWriter_1.EnvInfoWriterMW(tools_1.isMultiEnvEnabled()),
706
+ envInfoWriter_1.EnvInfoWriterMW(true),
678
707
  ]),
679
708
  tslib_1.__metadata("design:type", Function),
680
709
  tslib_1.__metadata("design:paramtypes", [Object, Object]),
@@ -699,7 +728,7 @@ tslib_1.__decorate([
699
728
  concurrentLocker_1.ConcurrentLockerMW,
700
729
  projectMigrator_1.ProjectMigratorMW,
701
730
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
702
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
731
+ envInfoLoader_1.EnvInfoLoaderMW(false),
703
732
  solutionLoader_1.SolutionLoaderMW(),
704
733
  questionModel_1.QuestionModelMW,
705
734
  contextInjector_1.ContextInjectorMW,
@@ -716,7 +745,7 @@ tslib_1.__decorate([
716
745
  concurrentLocker_1.ConcurrentLockerMW,
717
746
  projectMigrator_1.ProjectMigratorMW,
718
747
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
719
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
748
+ envInfoLoader_1.EnvInfoLoaderMW(false),
720
749
  solutionLoader_1.SolutionLoaderMW(),
721
750
  questionModel_1.QuestionModelMW,
722
751
  contextInjector_1.ContextInjectorMW,
@@ -734,7 +763,7 @@ tslib_1.__decorate([
734
763
  projectMigrator_1.ProjectMigratorMW,
735
764
  projectUpgrader_1.ProjectUpgraderMW,
736
765
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
737
- envInfoLoader_1.EnvInfoLoaderMW(false),
766
+ envInfoLoader_1.EnvInfoLoaderMW(true),
738
767
  localSettingsLoader_1.LocalSettingsLoaderMW,
739
768
  solutionLoader_1.SolutionLoaderMW(),
740
769
  questionModel_1.QuestionModelMW,
@@ -753,7 +782,7 @@ tslib_1.__decorate([
753
782
  concurrentLocker_1.ConcurrentLockerMW,
754
783
  projectMigrator_1.ProjectMigratorMW,
755
784
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
756
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
785
+ envInfoLoader_1.EnvInfoLoaderMW(false),
757
786
  solutionLoader_1.SolutionLoaderMW(),
758
787
  questionModel_1.QuestionModelMW,
759
788
  contextInjector_1.ContextInjectorMW,
@@ -770,7 +799,7 @@ tslib_1.__decorate([
770
799
  concurrentLocker_1.ConcurrentLockerMW,
771
800
  projectMigrator_1.ProjectMigratorMW,
772
801
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
773
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
802
+ envInfoLoader_1.EnvInfoLoaderMW(false),
774
803
  localSettingsLoader_1.LocalSettingsLoaderMW,
775
804
  solutionLoader_1.SolutionLoaderMW(),
776
805
  questionModel_1.QuestionModelMW,
@@ -786,9 +815,8 @@ tslib_1.__decorate([
786
815
  tslib_1.__decorate([
787
816
  hooks_1.hooks([
788
817
  errorHandler_1.ErrorHandlerMW,
789
- projectMigrator_1.ProjectMigratorMW,
790
818
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
791
- envInfoLoader_1.EnvInfoLoaderMW(false),
819
+ envInfoLoader_1.EnvInfoLoaderMW(true),
792
820
  solutionLoader_1.SolutionLoaderMW(),
793
821
  contextInjector_1.ContextInjectorMW,
794
822
  envInfoWriter_1.EnvInfoWriterMW(),
@@ -800,9 +828,8 @@ tslib_1.__decorate([
800
828
  tslib_1.__decorate([
801
829
  hooks_1.hooks([
802
830
  errorHandler_1.ErrorHandlerMW,
803
- projectMigrator_1.ProjectMigratorMW,
804
831
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
805
- envInfoLoader_1.EnvInfoLoaderMW(false),
832
+ envInfoLoader_1.EnvInfoLoaderMW(true),
806
833
  solutionLoader_1.SolutionLoaderMW(),
807
834
  contextInjector_1.ContextInjectorMW,
808
835
  envInfoWriter_1.EnvInfoWriterMW(),
@@ -817,7 +844,7 @@ tslib_1.__decorate([
817
844
  concurrentLocker_1.ConcurrentLockerMW,
818
845
  projectMigrator_1.ProjectMigratorMW,
819
846
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
820
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
847
+ envInfoLoader_1.EnvInfoLoaderMW(false),
821
848
  localSettingsLoader_1.LocalSettingsLoaderMW,
822
849
  contextInjector_1.ContextInjectorMW,
823
850
  ]),
@@ -830,7 +857,7 @@ tslib_1.__decorate([
830
857
  errorHandler_1.ErrorHandlerMW,
831
858
  projectMigrator_1.ProjectMigratorMW,
832
859
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
833
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
860
+ envInfoLoader_1.EnvInfoLoaderMW(false),
834
861
  solutionLoader_1.SolutionLoaderMW(),
835
862
  questionModel_1.QuestionModelMW,
836
863
  contextInjector_1.ContextInjectorMW,
@@ -844,7 +871,7 @@ tslib_1.__decorate([
844
871
  errorHandler_1.ErrorHandlerMW,
845
872
  projectMigrator_1.ProjectMigratorMW,
846
873
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
847
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
874
+ envInfoLoader_1.EnvInfoLoaderMW(false),
848
875
  solutionLoader_1.SolutionLoaderMW(),
849
876
  questionModel_1.QuestionModelMW,
850
877
  contextInjector_1.ContextInjectorMW,
@@ -858,7 +885,7 @@ tslib_1.__decorate([
858
885
  errorHandler_1.ErrorHandlerMW,
859
886
  projectMigrator_1.ProjectMigratorMW,
860
887
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
861
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
888
+ envInfoLoader_1.EnvInfoLoaderMW(false),
862
889
  solutionLoader_1.SolutionLoaderMW(),
863
890
  questionModel_1.QuestionModelMW,
864
891
  contextInjector_1.ContextInjectorMW,
@@ -871,7 +898,7 @@ tslib_1.__decorate([
871
898
  hooks_1.hooks([
872
899
  errorHandler_1.ErrorHandlerMW,
873
900
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
874
- envInfoLoader_1.EnvInfoLoaderMW(false),
901
+ envInfoLoader_1.EnvInfoLoaderMW(true),
875
902
  contextInjector_1.ContextInjectorMW,
876
903
  envInfoWriter_1.EnvInfoWriterMW(),
877
904
  ]),
@@ -883,7 +910,7 @@ tslib_1.__decorate([
883
910
  hooks_1.hooks([
884
911
  errorHandler_1.ErrorHandlerMW,
885
912
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
886
- envInfoLoader_1.EnvInfoLoaderMW(false),
913
+ envInfoLoader_1.EnvInfoLoaderMW(true),
887
914
  contextInjector_1.ContextInjectorMW,
888
915
  envInfoWriter_1.EnvInfoWriterMW(),
889
916
  ]),
@@ -896,7 +923,7 @@ tslib_1.__decorate([
896
923
  errorHandler_1.ErrorHandlerMW,
897
924
  projectSettingsLoader_1.ProjectSettingsLoaderMW,
898
925
  solutionLoader_1.SolutionLoaderMW(),
899
- envInfoLoader_1.EnvInfoLoaderMW(tools_1.isMultiEnvEnabled()),
926
+ envInfoLoader_1.EnvInfoLoaderMW(true),
900
927
  contextInjector_1.ContextInjectorMW,
901
928
  ]),
902
929
  tslib_1.__metadata("design:type", Function),
@@ -917,16 +944,12 @@ tslib_1.__decorate([
917
944
  tslib_1.__metadata("design:returntype", Promise)
918
945
  ], FxCore.prototype, "activateEnv", null);
919
946
  exports.FxCore = FxCore;
920
- function isAzureProject(solutionSettings) {
921
- const settings = solutionSettings;
922
- return (settings === null || settings === void 0 ? void 0 : settings.hostType) === question_1.HostTypeOptionAzure.id;
923
- }
924
947
  async function createBasicFolderStructure(inputs) {
925
948
  if (!inputs.projectPath) {
926
949
  return teamsfx_api_1.err(new error_1.ObjectIsUndefinedError("projectPath"));
927
950
  }
928
951
  try {
929
- const appName = inputs[question_2.QuestionAppName.name];
952
+ const appName = inputs[question_1.QuestionAppName.name];
930
953
  await fs.writeFile(path.join(inputs.projectPath, `package.json`), JSON.stringify({
931
954
  name: appName,
932
955
  version: "0.0.1",
@@ -958,8 +981,8 @@ async function createBasicFolderStructure(inputs) {
958
981
  }
959
982
  exports.createBasicFolderStructure = createBasicFolderStructure;
960
983
  async function downloadSample(fxcore, inputs) {
961
- const folder = inputs[question_2.QuestionRootFolder.name];
962
- const sample = inputs[question_2.CoreQuestionNames.Samples];
984
+ const folder = inputs[question_1.QuestionRootFolder.name];
985
+ const sample = inputs[question_1.CoreQuestionNames.Samples];
963
986
  if (sample && sample.data && folder) {
964
987
  const url = sample.data;
965
988
  const sampleId = sample.id;
@@ -1028,7 +1051,7 @@ async function downloadSample(fxcore, inputs) {
1028
1051
  return teamsfx_api_1.err(runRes.error);
1029
1052
  }
1030
1053
  }
1031
- return teamsfx_api_1.err(error_1.InvalidInputError(`invalid answer for '${question_2.CoreQuestionNames.Samples}'`, inputs));
1054
+ return teamsfx_api_1.err(error_1.InvalidInputError(`invalid answer for '${question_1.CoreQuestionNames.Samples}'`, inputs));
1032
1055
  }
1033
1056
  exports.downloadSample = downloadSample;
1034
1057
  function newProjectSettings() {