@microsoft/teamsfx-core 2.0.4-alpha.dc097d3df.0 → 2.0.4-alpha.e83c26af7.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/deps-checker/util/cpUtils.js +1 -1
- package/build/common/deps-checker/util/cpUtils.js.map +1 -1
- package/build/common/deps-checker/util/fileHelper.d.ts.map +1 -1
- package/build/common/deps-checker/util/fileHelper.js +2 -0
- package/build/common/deps-checker/util/fileHelper.js.map +1 -1
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +2 -1
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/jsonUtils.d.ts.map +1 -1
- package/build/common/jsonUtils.js +2 -0
- package/build/common/jsonUtils.js.map +1 -1
- package/build/common/samples-config-v3.json +2 -8
- package/build/common/samples.d.ts +1 -2
- package/build/common/samples.d.ts.map +1 -1
- package/build/common/samples.js +15 -6
- package/build/common/samples.js.map +1 -1
- package/build/common/spec-parser/constants.d.ts +12 -0
- package/build/common/spec-parser/constants.d.ts.map +1 -0
- package/build/common/spec-parser/constants.js +18 -0
- package/build/common/spec-parser/constants.js.map +1 -0
- package/build/common/spec-parser/interfaces.d.ts +75 -0
- package/build/common/spec-parser/interfaces.d.ts.map +1 -0
- package/build/common/spec-parser/interfaces.js +40 -0
- package/build/common/spec-parser/interfaces.js.map +1 -0
- package/build/common/spec-parser/specParser.d.ts +36 -0
- package/build/common/spec-parser/specParser.d.ts.map +1 -0
- package/build/common/spec-parser/specParser.js +168 -0
- package/build/common/spec-parser/specParser.js.map +1 -0
- package/build/common/spec-parser/specParserError.d.ts +6 -0
- package/build/common/spec-parser/specParserError.d.ts.map +1 -0
- package/build/common/spec-parser/specParserError.js +13 -0
- package/build/common/spec-parser/specParserError.js.map +1 -0
- package/build/common/tools.js +1 -1
- package/build/common/tools.js.map +1 -1
- package/build/component/configManager/constant.d.ts.map +1 -1
- package/build/component/configManager/constant.js +4 -2
- package/build/component/configManager/constant.js.map +1 -1
- package/build/component/configManager/diagnostic.d.ts.map +1 -1
- package/build/component/configManager/diagnostic.js +2 -0
- package/build/component/configManager/diagnostic.js.map +1 -1
- package/build/component/configManager/interface.d.ts.map +1 -1
- package/build/component/configManager/interface.js +2 -3
- package/build/component/configManager/interface.js.map +1 -1
- package/build/component/configManager/lifecycle.d.ts.map +1 -1
- package/build/component/configManager/lifecycle.js +5 -3
- package/build/component/configManager/lifecycle.js.map +1 -1
- package/build/component/configManager/parser.d.ts.map +1 -1
- package/build/component/configManager/parser.js +5 -3
- package/build/component/configManager/parser.js.map +1 -1
- package/build/component/configManager/validator.d.ts.map +1 -1
- package/build/component/configManager/validator.js +2 -0
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/constants.d.ts +0 -23
- package/build/component/constants.d.ts.map +1 -1
- package/build/component/constants.js +1 -24
- package/build/component/constants.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +10 -0
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/coordinator/summary.d.ts.map +1 -1
- package/build/component/coordinator/summary.js +2 -0
- package/build/component/coordinator/summary.js.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.d.ts +10 -3
- package/build/component/driver/aad/error/aadManifestError.d.ts.map +1 -1
- package/build/component/driver/aad/error/aadManifestError.js +39 -5
- package/build/component/driver/aad/error/aadManifestError.js.map +1 -1
- package/build/component/driver/aad/interface/AADApplication.js +1 -1
- package/build/component/driver/aad/interface/AADApplication.js.map +1 -1
- package/build/component/driver/aad/interface/AADManifest.js +1 -1
- package/build/component/driver/aad/interface/AADManifest.js.map +1 -1
- package/build/component/driver/aad/utility/aadManifestHelper.d.ts.map +1 -1
- package/build/component/driver/aad/utility/aadManifestHelper.js +14 -19
- package/build/component/driver/aad/utility/aadManifestHelper.js.map +1 -1
- package/build/component/driver/aad/utility/buildAadManifest.d.ts.map +1 -1
- package/build/component/driver/aad/utility/buildAadManifest.js +12 -2
- package/build/component/driver/aad/utility/buildAadManifest.js.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.d.ts.map +1 -1
- package/build/component/driver/arm/util/bicepChecker.js +2 -0
- package/build/component/driver/arm/util/bicepChecker.js.map +1 -1
- package/build/component/driver/interface/buildAndDeployArgs.d.ts +3 -6
- package/build/component/driver/interface/buildAndDeployArgs.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.d.ts.map +1 -1
- package/build/component/driver/script/scriptDriver.js +2 -0
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/clients/authSvcClient.d.ts +1 -1
- package/build/component/driver/teamsApp/clients/authSvcClient.js +1 -1
- package/build/component/driver/teamsApp/results.d.ts.map +1 -1
- package/build/component/driver/teamsApp/results.js +2 -0
- package/build/component/driver/teamsApp/results.js.map +1 -1
- package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validate.js +6 -0
- package/build/component/driver/teamsApp/validate.js.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +4 -5
- package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
- package/build/component/error/componentError.d.ts +0 -4
- package/build/component/error/componentError.d.ts.map +1 -1
- package/build/component/error/componentError.js +1 -10
- package/build/component/error/componentError.js.map +1 -1
- package/build/component/generator/copilotPlugin/generator.d.ts +5 -0
- package/build/component/generator/copilotPlugin/generator.d.ts.map +1 -0
- package/build/component/generator/copilotPlugin/generator.js +60 -0
- package/build/component/generator/copilotPlugin/generator.js.map +1 -0
- package/build/component/generator/copilotPlugin/helper.d.ts +30 -0
- package/build/component/generator/copilotPlugin/helper.d.ts.map +1 -0
- package/build/component/generator/copilotPlugin/helper.js +72 -0
- package/build/component/generator/copilotPlugin/helper.js.map +1 -0
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +5 -4
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/officeAddin/config/projectProperties.d.ts.map +1 -1
- package/build/component/generator/officeAddin/config/projectProperties.js +2 -0
- package/build/component/generator/officeAddin/config/projectProperties.js.map +1 -1
- package/build/component/generator/officeAddin/config/projectsJsonData.d.ts.map +1 -1
- package/build/component/generator/officeAddin/config/projectsJsonData.js +2 -0
- package/build/component/generator/officeAddin/config/projectsJsonData.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +8 -8
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +2 -0
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/spfx/error.d.ts +2 -0
- package/build/component/generator/spfx/error.d.ts.map +1 -1
- package/build/component/generator/spfx/error.js +21 -1
- package/build/component/generator/spfx/error.js.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts +4 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.js +128 -106
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
- package/build/component/generator/spfx/utils/constants.d.ts.map +1 -1
- package/build/component/generator/spfx/utils/constants.js +1 -0
- package/build/component/generator/spfx/utils/constants.js.map +1 -1
- package/build/component/generator/spfx/utils/telemetryEvents.d.ts +2 -1
- package/build/component/generator/spfx/utils/telemetryEvents.d.ts.map +1 -1
- package/build/component/generator/spfx/utils/telemetryEvents.js +1 -0
- package/build/component/generator/spfx/utils/telemetryEvents.js.map +1 -1
- package/build/component/generator/utils.d.ts +0 -1
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +1 -6
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/migrate.d.ts.map +1 -1
- package/build/component/migrate.js +2 -0
- package/build/component/migrate.js.map +1 -1
- package/build/component/registerService.d.ts +0 -1
- package/build/component/registerService.d.ts.map +1 -1
- package/build/component/registerService.js +0 -1
- package/build/component/registerService.js.map +1 -1
- package/build/component/utils/charsetUtils.d.ts.map +1 -1
- package/build/component/utils/charsetUtils.js +2 -0
- package/build/component/utils/charsetUtils.js.map +1 -1
- package/build/component/utils/common.js +1 -1
- package/build/component/utils/common.js.map +1 -1
- package/build/component/utils/depsChecker/common.d.ts.map +1 -1
- package/build/component/utils/depsChecker/common.js +1 -1
- package/build/component/utils/depsChecker/common.js.map +1 -1
- package/build/component/utils/depsChecker/cpUtils.d.ts.map +1 -1
- package/build/component/utils/depsChecker/cpUtils.js +1 -1
- package/build/component/utils/depsChecker/cpUtils.js.map +1 -1
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/component/utils/envUtil.js +2 -0
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/metadataUtil.d.ts.map +1 -1
- package/build/component/utils/metadataUtil.js +2 -0
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/component/utils/pathUtils.d.ts.map +1 -1
- package/build/component/utils/pathUtils.js +2 -0
- package/build/component/utils/pathUtils.js.map +1 -1
- package/build/core/FxCore.d.ts +1 -0
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +3 -0
- package/build/core/FxCore.js.map +1 -1
- package/build/core/FxCoreImplementV3.d.ts +1 -0
- package/build/core/FxCoreImplementV3.d.ts.map +1 -1
- package/build/core/FxCoreImplementV3.js +10 -0
- package/build/core/FxCoreImplementV3.js.map +1 -1
- package/build/core/index.js +1 -0
- package/build/core/index.js.map +1 -1
- package/build/error/arm.d.ts.map +1 -1
- package/build/error/arm.js +2 -0
- package/build/error/arm.js.map +1 -1
- package/build/error/azure.d.ts.map +1 -1
- package/build/error/azure.js +2 -0
- package/build/error/azure.js.map +1 -1
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +2 -0
- package/build/error/common.js.map +1 -1
- package/build/error/deploy.d.ts.map +1 -1
- package/build/error/deploy.js +10 -8
- package/build/error/deploy.js.map +1 -1
- package/build/error/index.d.ts.map +1 -1
- package/build/error/index.js +2 -0
- package/build/error/index.js.map +1 -1
- package/build/error/m365.d.ts.map +1 -1
- package/build/error/m365.js +2 -0
- package/build/error/m365.js.map +1 -1
- package/build/error/script.d.ts.map +1 -1
- package/build/error/script.js +2 -0
- package/build/error/script.js.map +1 -1
- package/build/error/upgrade.d.ts.map +1 -1
- package/build/error/upgrade.js +2 -0
- package/build/error/upgrade.js.map +1 -1
- package/build/error/yml.d.ts.map +1 -1
- package/build/error/yml.js +2 -0
- package/build/error/yml.js.map +1 -1
- package/build/failpoint/index.d.ts.map +1 -1
- package/build/failpoint/index.js +2 -0
- package/build/failpoint/index.js.map +1 -1
- package/build/failpoint/marker.d.ts.map +1 -1
- package/build/failpoint/marker.js +2 -0
- package/build/failpoint/marker.js.map +1 -1
- package/build/failpoint/runtime.d.ts.map +1 -1
- package/build/failpoint/runtime.js +3 -4
- package/build/failpoint/runtime.js.map +1 -1
- package/build/question/create.d.ts +3 -2
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +40 -45
- package/build/question/create.js.map +1 -1
- package/build/question/index.d.ts +2 -0
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +8 -0
- package/build/question/index.js.map +1 -1
- package/build/question/other.d.ts +1 -0
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +14 -1
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +0 -1
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +2 -1
- package/build/question/questionNames.js.map +1 -1
- package/build/question/util.d.ts +1 -1
- package/build/question/util.d.ts.map +1 -1
- package/build/question/util.js +7 -5
- package/build/question/util.js.map +1 -1
- package/package.json +7 -5
- package/resource/package.nls.cs.json +30 -56
- package/resource/package.nls.de.json +30 -56
- package/resource/package.nls.es.json +30 -56
- package/resource/package.nls.fr.json +30 -56
- package/resource/package.nls.it.json +30 -56
- package/resource/package.nls.ja.json +30 -56
- package/resource/package.nls.json +2 -2
- package/resource/package.nls.ko.json +30 -56
- package/resource/package.nls.pl.json +30 -56
- package/resource/package.nls.pt-BR.json +31 -57
- package/resource/package.nls.ru.json +34 -60
- package/resource/package.nls.tr.json +31 -57
- package/resource/package.nls.zh-Hans.json +31 -57
- package/resource/package.nls.zh-Hant.json +30 -56
- package/resource/package.nls.zh-cn.json +232 -712
- package/resource/package.nls.zh-tw.json +230 -710
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/build/component/generator/officeAddin/question.d.ts +0 -10
- package/build/component/generator/officeAddin/question.d.ts.map +0 -1
- package/build/component/generator/officeAddin/question.js +0 -118
- package/build/component/generator/officeAddin/question.js.map +0 -1
- package/templates/plugins/resource/apim/README.md +0 -92
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projectsJsonData.js","sourceRoot":"","sources":["../../../../../src/component/generator/officeAddin/config/projectsJsonData.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"projectsJsonData.js","sourceRoot":"","sources":["../../../../../src/component/generator/officeAddin/config/projectsJsonData.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAElC,4DAAuB;AACvB,2DAAwD;AAExD,MAAqB,gBAAgB;IAInC;QACE,IAAI,CAAC,eAAe,GAAG,qCAAiB,CAAC;IAC3C,CAAC;IAED,qBAAqB,CAAC,WAAmB;QACvC,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,gBAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC;IAC/E,CAAC;IAED,iBAAiB,CAAC,WAAmB;QACnC,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,gBAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC;IAC1E,CAAC;IAED,wBAAwB;QACtB,OAAO,IAAI,CAAC,eAAe,C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O,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,QAAQ,CAAC,SAAS,CAAC,MAAM,CAAC;iBACpE;qBAAM;oBACL,IAAI,UAAU,EAAE;wBACd,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,UAAU,CAAC;qBAChF;yBAAM;wBACL,OAAO,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC;qBAC5E;iBACF;aACF;SACF;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,uBAAuB,CACrB,cAAsB,EACtB,UAAkB,EAClB,UAAmB;QAEnB,UAAU,GAAG,UAAU,KAAK,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC;QACvE,MAAM,cAAc,GAA6D;YAC/E,IAAI,EAAoB,IAAK;YAC7B,MAAM,EAAoB,IAAK;SAChC,CAAC;QAEF,cAAc,CAAC,IAAI,GAAG,IAAI,CAAC,4BAA4B,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;QACpF,cAAc,CAAC,MAAM,GAAG,cAAc,CAAC,IAAI;YACzC,CAAC,CAAC,IAAI,CAAC,4BAA4B,CAAC,cAAc,EAAE,UAAU,EAAE,UAAU,CAAC;YAC3E,CAAC,CAAC,SAAS,CAAC;QAEd,OAAO,cAAc,CAAC;IACxB,CAAC;CACF;AAjID,mCAiIC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/generator.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EAKN,OAAO,EACR,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/generator.ts"],"names":[],"mappings":"AAGA;;GAEG;AAEH,OAAO,EACL,OAAO,EACP,MAAM,EACN,MAAM,EAKN,OAAO,EACR,MAAM,wBAAwB,CAAC;AAoBhC,qBAAa,oBAAoB;WASlB,QAAQ,CACnB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;WAoBlB,gBAAgB,CAAC,OAAO,EAAE,MAAM;;;;WAIhC,aAAa,CAC/B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;CAyDvC"}
|
|
@@ -9,7 +9,6 @@ const tslib_1 = require("tslib");
|
|
|
9
9
|
*/
|
|
10
10
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
11
11
|
const path_1 = require("path");
|
|
12
|
-
const question_1 = require("./question");
|
|
13
12
|
const helperMethods_1 = require("./helperMethods");
|
|
14
13
|
const office_addin_manifest_1 = require("office-addin-manifest");
|
|
15
14
|
const projectsJsonData_1 = tslib_1.__importDefault(require("./config/projectsJsonData"));
|
|
@@ -22,6 +21,7 @@ const actionExecutionMW_1 = require("../../middleware/actionExecutionMW");
|
|
|
22
21
|
const generator_1 = require("../generator");
|
|
23
22
|
const office_addin_project_1 = require("office-addin-project");
|
|
24
23
|
const questionNames_1 = require("../../../question/questionNames");
|
|
24
|
+
const create_1 = require("../../../question/create");
|
|
25
25
|
const componentName = "office-addin";
|
|
26
26
|
const telemetryEvent = "generate";
|
|
27
27
|
const templateName = "office-addin";
|
|
@@ -32,7 +32,7 @@ class OfficeAddinGenerator {
|
|
|
32
32
|
return teamsfx_api_1.err(result.error);
|
|
33
33
|
}
|
|
34
34
|
// If lang is undefined, it means the project is created from a folder.
|
|
35
|
-
const lang = inputs[
|
|
35
|
+
const lang = inputs[questionNames_1.QuestionNames.ProgrammingLanguage];
|
|
36
36
|
const templateRes = await generator_1.Generator.generateTemplate(context, destinationPath, templateName, lang ? (lang === "TypeScript" ? "ts" : "js") : undefined);
|
|
37
37
|
if (templateRes.isErr())
|
|
38
38
|
return teamsfx_api_1.err(templateRes.error);
|
|
@@ -42,12 +42,12 @@ class OfficeAddinGenerator {
|
|
|
42
42
|
return util_1.promisify(childProcess.exec)(cmdLine);
|
|
43
43
|
}
|
|
44
44
|
static async doScaffolding(context, inputs, destinationPath) {
|
|
45
|
-
const template =
|
|
45
|
+
const template = create_1.getTemplate(inputs);
|
|
46
46
|
const name = inputs[questionNames_1.QuestionNames.AppName];
|
|
47
47
|
const addinRoot = destinationPath;
|
|
48
|
-
const fromFolder = inputs[
|
|
49
|
-
const language = inputs[
|
|
50
|
-
const host = inputs[
|
|
48
|
+
const fromFolder = inputs[questionNames_1.QuestionNames.OfficeAddinFolder];
|
|
49
|
+
const language = inputs[questionNames_1.QuestionNames.ProgrammingLanguage];
|
|
50
|
+
const host = inputs[questionNames_1.QuestionNames.OfficeAddinHost];
|
|
51
51
|
const workingDir = process.cwd();
|
|
52
52
|
process.chdir(addinRoot);
|
|
53
53
|
try {
|
|
@@ -70,14 +70,14 @@ class OfficeAddinGenerator {
|
|
|
70
70
|
else {
|
|
71
71
|
// from existing project
|
|
72
72
|
helperMethods_1.HelperMethods.copyAddinFiles(fromFolder, addinRoot);
|
|
73
|
-
const sourceManifestFile = inputs[
|
|
73
|
+
const sourceManifestFile = inputs[questionNames_1.QuestionNames.OfficeAddinManifest];
|
|
74
74
|
let manifestFile = sourceManifestFile.replace(fromFolder, addinRoot);
|
|
75
75
|
if (manifestFile.endsWith(".xml")) {
|
|
76
76
|
// Need to convert to json project first
|
|
77
77
|
await office_addin_project_1.convertProject(manifestFile);
|
|
78
78
|
manifestFile = manifestFile.replace(/\.xml$/, ".json");
|
|
79
79
|
}
|
|
80
|
-
inputs[
|
|
80
|
+
inputs[questionNames_1.QuestionNames.OfficeAddinHost] = await getHost(manifestFile);
|
|
81
81
|
helperMethods_1.HelperMethods.updateManifest(destinationPath, manifestFile);
|
|
82
82
|
}
|
|
83
83
|
process.chdir(workingDir);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,wDASgC;AAChC,+BAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/generator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AAEH,wDASgC;AAChC,+BAA4B;AAC5B,mDAAgD;AAChD,iEAA4D;AAC5D,yFAAyD;AACzD,oEAA8C;AAC9C,+BAAiC;AACjC,+CAAoD;AACpD,4DAAuB;AACvB,+CAA8C;AAC9C,0EAAuE;AACvE,4CAAyC;AACzC,+DAAsD;AACtD,mEAAgE;AAChE,qDAAuD;AAEvD,MAAM,aAAa,GAAG,cAAc,CAAC;AACrC,MAAM,cAAc,GAAG,UAAU,CAAC;AAClC,MAAM,YAAY,GAAG,cAAc,CAAC;AAEpC,MAAa,oBAAoB;IAS/B,MAAM,CAAC,KAAK,CAAC,QAAQ,CACnB,OAAgB,EAChB,MAAc,EACd,eAAuB;QAEvB,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,eAAe,CAAC,CAAC;QAC1F,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE;YAClB,OAAO,iBAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;SAC1B;QAED,uEAAuE;QACvE,MAAM,IAAI,GAAG,MAAM,CAAC,6BAAa,CAAC,mBAAmB,CAAC,CAAC;QAEvD,MAAM,WAAW,GAAG,MAAM,qBAAS,CAAC,gBAAgB,CAClD,OAAO,EACP,e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AAU,CAAC,CAAC;YAC1B,OAAO,gBAAE,CAAC,SAAS,CAAC,CAAC;SACtB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;YAC1B,OAAO,iBAAG,CAAC,qBAAa,CAAC,CAAU,CAAC,CAAC,CAAC;SACvC;IACH,CAAC;CACF;AAzFC;IARC,WAAK,CAAC;QACL,qCAAiB,CAAC;YAChB,eAAe,EAAE,IAAI;YACrB,sBAAsB,EAAE,aAAa;YACrC,kBAAkB,EAAE,cAAc;YAClC,WAAW,EAAE,aAAa;SAC3B,CAAC;KACH,CAAC;;;;0CAuBD;AA/BH,oDAkGC;AAKD,KAAK,UAAU,OAAO,CAAC,iBAAyB;;IAC9C,4BAA4B;IAC5B,MAAM,aAAa,GAAgC,MAAM,0BAAY,CAAC,YAAY,CAChF,iBAAiB,CAClB,CAAC;IACF,IAAI,IAAI,GAAe,SAAS,CAAC;IACjC,QAAQ,MAAA,MAAA,MAAA,aAAa,CAAC,UAAU,0CAAG,CAAC,EAAE,YAAY,0CAAE,MAAM,0CAAG,CAAC,CAAC,EAAE;QAC/D,mBAAmB;QACnB,mBAAmB;QACnB,KAAK,MAAM;YACT,IAAI,GAAG,SAAS,CAAC;QACnB,mBAAmB;QACnB,sBAAsB;QACtB,uBAAuB;QACvB,yBAAyB;QACzB,kBAAkB;QAClB,sBAAsB;QACtB,mBAAmB;QACnB,oBAAoB;KACrB;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helperMethods.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/helperMethods.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helperMethods.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/helperMethods.ts"],"names":[],"mappings":"AAgBA,qBAAa,aAAa;WACX,8BAA8B,CACzC,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,aAAa,CAAC,EAAE,MAAM,GACrB,OAAO,CAAC,IAAI,CAAC;WA0BH,oBAAoB,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvE,MAAM,CAAC,iBAAiB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI;IAoBrD,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;WAMpD,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;WAqB7E,oBAAoB,CAC/B,WAAW,EAAE,MAAM,EACnB,oBAAoB,EAAE,MAAM,GAC3B,OAAO,CAAC,IAAI,CAAC;CA2CjB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helperMethods.js","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/helperMethods.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"helperMethods.js","sourceRoot":"","sources":["../../../../src/component/generator/officeAddin/helperMethods.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC;;GAEG;AACH,0DAA0B;AAC1B,oDAAoB;AACpB,sDAAgC;AAChC,mDAA6B;AAC7B,wDAAkC;AAClC,wDAAkE;AAClE,6EAA0E;AAE1E,MAAM,OAAO,GAAG,aAAa,CAAC;AAE9B,MAAa,aAAa;IACxB,MAAM,CAAC,KAAK,CAAC,8BAA8B,CACzC,aAAqB,EACrB,WAAmB,EACnB,aAAsB;QAEtB,MAAM,sBAAsB,GAAG,GAAG,WAAW,YAAY,aAAa,MAAM,CAAC;QAC7E,OAAO,eAAK;aACT,GAAG,CAAC,sBAAsB,EAAE;YAC3B,YAAY,EAAE,QAAQ;SACvB,CAAC;aACD,IAAI,CAAC,CAAC,QAAQ,EAAE,EAAE;YACjB,OAAO,IAAI,OAAO,CAAO,CAAC,OAAO,EA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gBAC1D,MAAM,SAAS,GAAG,aAAa,CAAC;gBAChC,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,qBAAqB,CAAC,CAAC;gBAE/D,MAAM,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;aACrC;SACF;IACH,CAAC;CACF;AA5ID,sCA4IC"}
|
|
@@ -5,7 +5,9 @@ export declare function DependencyValidateError(dependency: string): SystemError
|
|
|
5
5
|
export declare function DevEnvironmentSetupError(): UserError;
|
|
6
6
|
export declare function LatestPackageInstallError(): SystemError;
|
|
7
7
|
export declare function YoGeneratorScaffoldError(): UserError;
|
|
8
|
+
export declare function CopyExistingSPFxSolutionError(e: Error): UserError;
|
|
8
9
|
export declare function RetrieveSPFxInfoError(): UserError;
|
|
10
|
+
export declare function UpdateSPFxTemplateError(e: Error): UserError;
|
|
9
11
|
export declare function ImportSPFxSolutionError(e: Error): UserError;
|
|
10
12
|
export declare function PathAlreadyExistsError(path: string): UserError;
|
|
11
13
|
//# sourceMappingURL=error.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/spfx/error.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIhE,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,WAAW,CAUnE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAOzD;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAOvE;AAED,wBAAgB,wBAAwB,IAAI,SAAS,CAQpD;AAED,wBAAgB,yBAAyB,IAAI,WAAW,CAgBvD;AAED,wBAAgB,wBAAwB,IAAI,SAAS,CAcpD;AAED,wBAAgB,qBAAqB,IAAI,SAAS,CAQjD;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,CAQ3D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAO9D"}
|
|
1
|
+
{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/spfx/error.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AAIhE,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,GAAG,WAAW,CAUnE;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,WAAW,CAOzD;AAED,wBAAgB,uBAAuB,CAAC,UAAU,EAAE,MAAM,GAAG,WAAW,CAOvE;AAED,wBAAgB,wBAAwB,IAAI,SAAS,CAQpD;AAED,wBAAgB,yBAAyB,IAAI,WAAW,CAgBvD;AAED,wBAAgB,wBAAwB,IAAI,SAAS,CAcpD;AAED,wBAAgB,6BAA6B,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,CAQjE;AAED,wBAAgB,qBAAqB,IAAI,SAAS,CAQjD;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,CAQ3D;AAED,wBAAgB,uBAAuB,CAAC,CAAC,EAAE,KAAK,GAAG,SAAS,CAQ3D;AAED,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAO9D"}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT license.
|
|
3
3
|
"use strict";
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.PathAlreadyExistsError = exports.ImportSPFxSolutionError = exports.RetrieveSPFxInfoError = exports.YoGeneratorScaffoldError = exports.LatestPackageInstallError = exports.DevEnvironmentSetupError = exports.DependencyValidateError = exports.NpmInstallError = exports.ScaffoldError = void 0;
|
|
5
|
+
exports.PathAlreadyExistsError = exports.ImportSPFxSolutionError = exports.UpdateSPFxTemplateError = exports.RetrieveSPFxInfoError = exports.CopyExistingSPFxSolutionError = exports.YoGeneratorScaffoldError = exports.LatestPackageInstallError = exports.DevEnvironmentSetupError = exports.DependencyValidateError = exports.NpmInstallError = exports.ScaffoldError = void 0;
|
|
6
6
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
7
7
|
const constants_1 = require("./utils/constants");
|
|
8
8
|
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
@@ -52,6 +52,16 @@ function YoGeneratorScaffoldError() {
|
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
exports.YoGeneratorScaffoldError = YoGeneratorScaffoldError;
|
|
55
|
+
function CopyExistingSPFxSolutionError(e) {
|
|
56
|
+
return new teamsfx_api_1.UserError({
|
|
57
|
+
source: constants_1.Constants.PLUGIN_NAME,
|
|
58
|
+
name: "CopyExistingSPFxSolutioinFailed",
|
|
59
|
+
message: localizeUtils_1.getDefaultString("plugins.spfx.error.import.copySPFxSolution", e.message),
|
|
60
|
+
displayMessage: localizeUtils_1.getLocalizedString("plugins.spfx.error.import.copySPFxSolution", e.message),
|
|
61
|
+
helpLink: constants_1.Constants.IMPORT_HELP_LINK,
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
exports.CopyExistingSPFxSolutionError = CopyExistingSPFxSolutionError;
|
|
55
65
|
function RetrieveSPFxInfoError() {
|
|
56
66
|
return new teamsfx_api_1.UserError({
|
|
57
67
|
source: constants_1.Constants.PLUGIN_NAME,
|
|
@@ -62,6 +72,16 @@ function RetrieveSPFxInfoError() {
|
|
|
62
72
|
});
|
|
63
73
|
}
|
|
64
74
|
exports.RetrieveSPFxInfoError = RetrieveSPFxInfoError;
|
|
75
|
+
function UpdateSPFxTemplateError(e) {
|
|
76
|
+
return new teamsfx_api_1.UserError({
|
|
77
|
+
source: constants_1.Constants.PLUGIN_NAME,
|
|
78
|
+
name: "UpdateSPFxTemplateFailed",
|
|
79
|
+
message: localizeUtils_1.getDefaultString("plugins.spfx.error.import.updateSPFxTemplate", e.message),
|
|
80
|
+
displayMessage: localizeUtils_1.getLocalizedString("plugins.spfx.error.import.updateSPFxTemplate", e.message),
|
|
81
|
+
helpLink: constants_1.Constants.IMPORT_HELP_LINK,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
exports.UpdateSPFxTemplateError = UpdateSPFxTemplateError;
|
|
65
85
|
function ImportSPFxSolutionError(e) {
|
|
66
86
|
return new teamsfx_api_1.UserError({
|
|
67
87
|
source: constants_1.Constants.PLUGIN_NAME,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error.js","sourceRoot":"","sources":["../../../../src/component/generator/spfx/error.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,YAAY,CAAC;;;AAEb,wDAAgE;AAChE,iDAA8C;AAC9C,iEAAqF;AAErF,SAAgB,aAAa,CAAC,KAAY;IACxC,IAAI,KAAK,YAAY,uBAAS,IAAI,KAAK,YAAY,yBAAW,EAAE;QAC9D,OAAO,KAAK,CAAC;KACd;SAAM;QACL,OAAO,IAAI,yBAAW,CAAC;YACrB,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,qBAAS,CAAC,WAAW;YAC7B,IAAI,EAAE,mBAAmB;SAC1B,CAAC,CAAC;KACJ;AACH,CAAC;AAVD,sCAUC;AAED,SAAgB,eAAe,CAAC,KAAY;IAC1C,OAAO,IAAI,yBAAW,CACpB,qBAAS,CAAC,WAAW,EACrB,kBAAkB,EAClB,gCAAgB,CAAC,qCAAqC,EAAE,KAAK,CAAC,OAAO,CAAC,EACtE,kCAAkB,CAAC,qCAAqC,EAAE,KAAK,CAAC,OAAO,CAAC,CACzE,CAAC;AACJ,CAAC;AAPD,0CAOC;AAED,SAAgB,uBAAuB,CAAC,UAAkB;IACxD,OAAO,IAAI,yBAAW,CACpB,qBAAS,CAAC,WAAW,EACrB,mBAAmB,EACnB,gCAAgB,CAAC,sCAAsC,EAAE,UAAU,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,CAAC,WAAW;QAC7B,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,gCAAgB,CAAC,kCAAkC,EAAE,CAAC,CAAC,OAAO,CAAC;QACxE,cAAc,EAAE,kCAAkB,CAAC,kCAAkC,EAAE,CAAC,CAAC,OAAO,CAAC;QACjF,QAAQ,EAAE,qBAAS,CAAC,gBAAgB;KACrC,CAAC,CAAC;AACL,CAAC;AARD,0DAQC;AAED,SAAgB,sBAAsB,CAAC,IAAY;IACjD,OAAO,IAAI,uBAAS,CAAC;QACnB,MAAM,EAAE,qBAAS,CAAC,WAAW;QAC7B,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,gCAAgB,CAAC,2CAA2C,EAAE,IAAI,CAAC;QAC5E,cAAc,EAAE,kCAAkB,CAAC,2CAA2C,EAAE,IAAI,CAAC;KACtF,CAAC,CAAC;AACL,CAAC;AAPD,wDAOC"}
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Context, FxError, Inputs, Result } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { ActionContext } from "../../middleware/actionExecutionMW";
|
|
2
3
|
export declare class SPFxGenerator {
|
|
3
|
-
static generate(context: Context, inputs: Inputs, destinationPath: string): Promise<Result<undefined, FxError>>;
|
|
4
|
+
static generate(context: Context, inputs: Inputs, destinationPath: string, actionContext?: ActionContext): Promise<Result<undefined, FxError>>;
|
|
4
5
|
private static newSPFxProject;
|
|
5
6
|
private static importSPFxProject;
|
|
6
7
|
static doYeomanScaffold(context: Context, inputs: Inputs, destinationPath: string): Promise<Result<string, FxError>>;
|
|
7
8
|
static getSolutionName(spfxFolder: string): Promise<string | undefined>;
|
|
9
|
+
private static copySPFxSolution;
|
|
8
10
|
private static getWebpartManifest;
|
|
11
|
+
private static updateSPFxTemplate;
|
|
9
12
|
}
|
|
10
13
|
//# sourceMappingURL=spfxGenerator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"spfxGenerator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/spfx/spfxGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,OAAO,EAEP,OAAO,EACP,MAAM,EAIN,MAAM,EAIP,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"spfxGenerator.d.ts","sourceRoot":"","sources":["../../../../src/component/generator/spfx/spfxGenerator.ts"],"names":[],"mappings":"AAIA,OAAO,EAEL,OAAO,EAEP,OAAO,EACP,MAAM,EAIN,MAAM,EAIP,MAAM,wBAAwB,CAAC;AAahC,OAAO,EAAE,aAAa,EAAqB,MAAM,oCAAoC,CAAC;AAoBtF,qBAAa,aAAa;WASJ,QAAQ,CAC1B,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,EACvB,aAAa,CAAC,EAAE,aAAa,GAC5B,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;mBAajB,cAAc;mBAmBd,iBAAiB;WA8GlB,gBAAgB,CAClC,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,MAAM,GACtB,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;WA8Kf,eAAe,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;mBAa/D,gBAAgB;mBAehB,kBAAkB;mBAoClB,kBAAkB;CA4JxC"}
|
|
@@ -11,6 +11,7 @@ const lodash_1 = require("lodash");
|
|
|
11
11
|
const os_1 = require("os");
|
|
12
12
|
const path = tslib_1.__importStar(require("path"));
|
|
13
13
|
const util = tslib_1.__importStar(require("util"));
|
|
14
|
+
const lodash_2 = require("lodash");
|
|
14
15
|
const deps_checker_1 = require("../../../common/deps-checker");
|
|
15
16
|
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
16
17
|
const error_1 = require("../../../error");
|
|
@@ -29,12 +30,16 @@ const create_1 = require("../../../question/create");
|
|
|
29
30
|
const telemetryEvents_1 = require("./utils/telemetryEvents");
|
|
30
31
|
const utils_1 = require("./utils/utils");
|
|
31
32
|
class SPFxGenerator {
|
|
32
|
-
static async generate(context, inputs, destinationPath) {
|
|
33
|
-
|
|
33
|
+
static async generate(context, inputs, destinationPath, actionContext) {
|
|
34
|
+
const spfxSolution = inputs[questionNames_1.QuestionNames.SPFxSolution];
|
|
35
|
+
lodash_2.merge(actionContext === null || actionContext === void 0 ? void 0 : actionContext.telemetryProps, {
|
|
36
|
+
[telemetryEvents_1.TelemetryProperty.SPFxSolution]: spfxSolution,
|
|
37
|
+
});
|
|
38
|
+
if (spfxSolution === "new") {
|
|
34
39
|
return await this.newSPFxProject(context, inputs, destinationPath);
|
|
35
40
|
}
|
|
36
41
|
else {
|
|
37
|
-
return await this.importSPFxProject(context, inputs, destinationPath);
|
|
42
|
+
return await this.importSPFxProject(context, inputs, destinationPath, actionContext);
|
|
38
43
|
}
|
|
39
44
|
}
|
|
40
45
|
static async newSPFxProject(context, inputs, destinationPath) {
|
|
@@ -46,8 +51,8 @@ class SPFxGenerator {
|
|
|
46
51
|
return teamsfx_api_1.err(templateRes.error);
|
|
47
52
|
return teamsfx_api_1.ok(undefined);
|
|
48
53
|
}
|
|
49
|
-
static async importSPFxProject(context, inputs, destinationPath) {
|
|
50
|
-
var _a, _b, _c, _d
|
|
54
|
+
static async importSPFxProject(context, inputs, destinationPath, actionContext) {
|
|
55
|
+
var _a, _b, _c, _d;
|
|
51
56
|
const importProgress = context.userInteraction.createProgressBar(localizeUtils_1.getLocalizedString("plugins.spfx.import.title"), 3);
|
|
52
57
|
importProgress.start();
|
|
53
58
|
const importDetails = [];
|
|
@@ -58,14 +63,7 @@ class SPFxGenerator {
|
|
|
58
63
|
const destSpfxFolder = path.join(destinationPath, "src");
|
|
59
64
|
importDetails.push(os_1.EOL +
|
|
60
65
|
`(.) Processing: Copying existing SPFx solution from ${spfxFolder} to ${destSpfxFolder}...`);
|
|
61
|
-
await
|
|
62
|
-
await fs_extra_1.default.copy(spfxFolder, destSpfxFolder, {
|
|
63
|
-
overwrite: true,
|
|
64
|
-
recursive: true,
|
|
65
|
-
filter: (file) => {
|
|
66
|
-
return file.indexOf("node_modules") < 0;
|
|
67
|
-
},
|
|
68
|
-
});
|
|
66
|
+
await this.copySPFxSolution(spfxFolder, destSpfxFolder);
|
|
69
67
|
importDetails.push(`(√) Done: Succeeded to copy existing SPFx solution.`);
|
|
70
68
|
// Retrieve solution info to generate template
|
|
71
69
|
await importProgress.next(localizeUtils_1.getLocalizedString("plugins.spfx.import.generateSPFxTemplates"));
|
|
@@ -97,109 +95,22 @@ class SPFxGenerator {
|
|
|
97
95
|
importDetails.push(`(√) Done: Succeeded to generate SPFx project templates.`);
|
|
98
96
|
// Update manifest and related files
|
|
99
97
|
await importProgress.next(localizeUtils_1.getLocalizedString("plugins.spfx.import.updateTemplates"));
|
|
100
|
-
|
|
101
|
-
const localManifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.local.json"));
|
|
102
|
-
if (localManifestRes.isErr())
|
|
103
|
-
throw localManifestRes.error;
|
|
104
|
-
const localManifest = localManifestRes.value;
|
|
105
|
-
importDetails.push(`(√) Done: Succeeded to load manifest.local.json.`);
|
|
106
|
-
importDetails.push(`(.) Processing: Loading manifest.json...`);
|
|
107
|
-
const remoteManifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.json"));
|
|
108
|
-
if (remoteManifestRes.isErr())
|
|
109
|
-
throw remoteManifestRes.error;
|
|
110
|
-
let remoteManifest = remoteManifestRes.value;
|
|
111
|
-
importDetails.push(`(√) Done: Succeeded to load manifest.json.`);
|
|
112
|
-
const webpartsDir = path.join(spfxFolder, "src", "webparts");
|
|
113
|
-
const webparts = (await fs_extra_1.default.readdir(webpartsDir)).filter(async (file) => fs_extra_1.default.statSync(path.join(webpartsDir, file)).isDirectory());
|
|
114
|
-
if (webparts.length > 1) {
|
|
115
|
-
importDetails.push(`(.) Processing: There're multiple web parts in the SPFx solution, exposing each of them in Teams manifest...`);
|
|
116
|
-
for (let i = 1; i < webparts.length; i++) {
|
|
117
|
-
const webpart = webparts[i];
|
|
118
|
-
const webpartManifestPath = path.join(webpartsDir, webpart, `${webpart.split(path.sep).pop()}WebPart.manifest.json`);
|
|
119
|
-
if (!(await fs_extra_1.default.pathExists(webpartManifestPath))) {
|
|
120
|
-
importDetails.push(` [${i}] Web part manifest doesn't exist at ${webpartManifestPath}, skip...`);
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
const matchHashComment = new RegExp(/(\/\/ .*)/, "gi");
|
|
124
|
-
const webpartManifest = JSON.parse((await fs_extra_1.default.readFile(webpartManifestPath, "utf8"))
|
|
125
|
-
.toString()
|
|
126
|
-
.replace(matchHashComment, "")
|
|
127
|
-
.trim());
|
|
128
|
-
importDetails.push(` [${i}] Adding web part to Teams manifest with component id: ${webpartManifest["id"]}, web part name: ${webpartManifest["preconfiguredEntries"][0].title.default}...`);
|
|
129
|
-
const componentId = webpartManifest["id"];
|
|
130
|
-
const webpartName = webpartManifest["preconfiguredEntries"][0].title.default;
|
|
131
|
-
const remoteStaticSnippet = {
|
|
132
|
-
entityId: componentId,
|
|
133
|
-
name: webpartName,
|
|
134
|
-
contentUrl: util.format(constants_2.ManifestTemplate.REMOTE_CONTENT_URL, componentId),
|
|
135
|
-
websiteUrl: constants_2.ManifestTemplate.WEBSITE_URL,
|
|
136
|
-
scopes: ["personal"],
|
|
137
|
-
};
|
|
138
|
-
const localStaticSnippet = {
|
|
139
|
-
entityId: componentId,
|
|
140
|
-
name: webpartName,
|
|
141
|
-
contentUrl: util.format(constants_2.ManifestTemplate.LOCAL_CONTENT_URL, componentId),
|
|
142
|
-
websiteUrl: constants_2.ManifestTemplate.WEBSITE_URL,
|
|
143
|
-
scopes: ["personal"],
|
|
144
|
-
};
|
|
145
|
-
(_a = localManifest.staticTabs) === null || _a === void 0 ? void 0 : _a.push(localStaticSnippet);
|
|
146
|
-
(_b = remoteManifest.staticTabs) === null || _b === void 0 ? void 0 : _b.push(remoteStaticSnippet);
|
|
147
|
-
}
|
|
148
|
-
importDetails.push(`(√) Done: Succeeded to expose additional web parts in Teams manifest.`);
|
|
149
|
-
}
|
|
150
|
-
if (await fs_extra_1.default.pathExists(path.join(spfxFolder, "teams", "manifest.json"))) {
|
|
151
|
-
importDetails.push(`(.) Processing: There's existing Teams manifest under ${path.join(spfxFolder, "teams", "manifest.json")}, updating default template...`);
|
|
152
|
-
const existingManifest = await fs_extra_1.default.readJson(path.join(spfxFolder, "teams", "manifest.json"));
|
|
153
|
-
importDetails.push(`(.) Processing: Writing existing app id in manifest.json to TEAMS_APP_ID in env.dev...`);
|
|
154
|
-
await envUtil_1.envUtil.writeEnv(destinationPath, "dev", { TEAMS_APP_ID: existingManifest.id });
|
|
155
|
-
importDetails.push(`(√) Done: Succeeded to write existing app id to env.dev.`);
|
|
156
|
-
importDetails.push(`(.) Processing: Updating default manifest with existing one...`);
|
|
157
|
-
existingManifest.$schema = remoteManifest.$schema;
|
|
158
|
-
existingManifest.manifestVersion = remoteManifest.manifestVersion;
|
|
159
|
-
existingManifest.id = remoteManifest.id;
|
|
160
|
-
existingManifest.icons = remoteManifest.icons;
|
|
161
|
-
existingManifest.staticTabs = remoteManifest.staticTabs;
|
|
162
|
-
existingManifest.configurableTabs = remoteManifest.configurableTabs;
|
|
163
|
-
remoteManifest = existingManifest;
|
|
164
|
-
}
|
|
165
|
-
importDetails.push(`(.) Processing: Writing to save changes to manifest.local.json...`);
|
|
166
|
-
await ManifestUtils_1.manifestUtils._writeAppManifest(localManifest, path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.local.json"));
|
|
167
|
-
importDetails.push(`(√) Done: Succeeded to write manifest.local.json.`);
|
|
168
|
-
importDetails.push(`(.) Processing: Writing to save changes to manifest.json...`);
|
|
169
|
-
await ManifestUtils_1.manifestUtils._writeAppManifest(remoteManifest, path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.json"));
|
|
170
|
-
importDetails.push(`(√) Done: Succeeded to write manifest.json.`);
|
|
171
|
-
let colorUpdated = false, outlineUpdated = false;
|
|
172
|
-
if (await fs_extra_1.default.pathExists(path.join(spfxFolder, "teams"))) {
|
|
173
|
-
for (const file of await fs_extra_1.default.readdir(path.join(spfxFolder, "teams"))) {
|
|
174
|
-
if (file.endsWith("color.png") && !colorUpdated) {
|
|
175
|
-
importDetails.push(`(.) Processing: Updating color.png with existing ${path.join(spfxFolder, "teams", file)}`);
|
|
176
|
-
await fs_extra_1.default.copyFile(path.join(spfxFolder, "teams", file), path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "color.png"));
|
|
177
|
-
colorUpdated = true;
|
|
178
|
-
importDetails.push(`(√) Done: Succeeded to update color.png.`);
|
|
179
|
-
}
|
|
180
|
-
if (file.endsWith("outline.png") && !outlineUpdated) {
|
|
181
|
-
importDetails.push(`(.) Processing: Updating outline.png with existing ${path.join(spfxFolder, "teams", file)}`);
|
|
182
|
-
await fs_extra_1.default.copyFile(path.join(spfxFolder, "teams", file), path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "outline.png"));
|
|
183
|
-
outlineUpdated = true;
|
|
184
|
-
importDetails.push(`(√) Done: Succeeded to update outline.png.`);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
|
-
}
|
|
98
|
+
await this.updateSPFxTemplate(spfxFolder, destinationPath, importDetails);
|
|
188
99
|
}
|
|
189
100
|
catch (error) {
|
|
190
101
|
await importProgress.end(false);
|
|
191
|
-
importDetails.push(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.fail", (
|
|
102
|
+
importDetails.push(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.fail", (_a = context.logProvider) === null || _a === void 0 ? void 0 : _a.getLogFilePath()));
|
|
192
103
|
context.logProvider.info(importDetails.join(os_1.EOL), true);
|
|
193
|
-
context.logProvider.error(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.fail", (
|
|
104
|
+
context.logProvider.error(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.fail", (_b = context.logProvider) === null || _b === void 0 ? void 0 : _b.getLogFilePath()));
|
|
194
105
|
if (error instanceof teamsfx_api_1.UserError || error instanceof teamsfx_api_1.SystemError) {
|
|
195
106
|
return teamsfx_api_1.err(error);
|
|
196
107
|
}
|
|
197
108
|
return teamsfx_api_1.err(error_2.ImportSPFxSolutionError(error));
|
|
198
109
|
}
|
|
199
110
|
await importProgress.end(true);
|
|
200
|
-
importDetails.push(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.success", (
|
|
111
|
+
importDetails.push(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.success", (_c = context.logProvider) === null || _c === void 0 ? void 0 : _c.getLogFilePath()));
|
|
201
112
|
context.logProvider.info(importDetails.join(os_1.EOL), true);
|
|
202
|
-
context.logProvider.info(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.success", (
|
|
113
|
+
context.logProvider.info(localizeUtils_1.getLocalizedString("plugins.spfx.import.log.success", (_d = context.logProvider) === null || _d === void 0 ? void 0 : _d.getLogFilePath()));
|
|
203
114
|
context.userInteraction.showMessage("info", localizeUtils_1.getLocalizedString("plugins.spfx.import.success", destinationPath), false);
|
|
204
115
|
return teamsfx_api_1.ok(undefined);
|
|
205
116
|
}
|
|
@@ -347,6 +258,21 @@ class SPFxGenerator {
|
|
|
347
258
|
}
|
|
348
259
|
return undefined;
|
|
349
260
|
}
|
|
261
|
+
static async copySPFxSolution(src, dest) {
|
|
262
|
+
try {
|
|
263
|
+
await fs_extra_1.default.ensureDir(dest);
|
|
264
|
+
await fs_extra_1.default.copy(src, dest, {
|
|
265
|
+
overwrite: true,
|
|
266
|
+
recursive: true,
|
|
267
|
+
filter: (file) => {
|
|
268
|
+
return file.indexOf("node_modules") < 0;
|
|
269
|
+
},
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
catch (e) {
|
|
273
|
+
throw error_2.CopyExistingSPFxSolutionError(e);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
350
276
|
static async getWebpartManifest(spfxFolder) {
|
|
351
277
|
const webpartsDir = path.join(spfxFolder, "src", "webparts");
|
|
352
278
|
if (await fs_extra_1.default.pathExists(webpartsDir)) {
|
|
@@ -368,6 +294,102 @@ class SPFxGenerator {
|
|
|
368
294
|
}
|
|
369
295
|
return undefined;
|
|
370
296
|
}
|
|
297
|
+
static async updateSPFxTemplate(spfxFolder, destinationPath, importDetails) {
|
|
298
|
+
var _a, _b;
|
|
299
|
+
try {
|
|
300
|
+
importDetails.push(`(.) Processing: Loading manifest.local.json...`);
|
|
301
|
+
const localManifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.local.json"));
|
|
302
|
+
if (localManifestRes.isErr())
|
|
303
|
+
throw localManifestRes.error;
|
|
304
|
+
const localManifest = localManifestRes.value;
|
|
305
|
+
importDetails.push(`(√) Done: Succeeded to load manifest.local.json.`);
|
|
306
|
+
importDetails.push(`(.) Processing: Loading manifest.json...`);
|
|
307
|
+
const remoteManifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.json"));
|
|
308
|
+
if (remoteManifestRes.isErr())
|
|
309
|
+
throw remoteManifestRes.error;
|
|
310
|
+
let remoteManifest = remoteManifestRes.value;
|
|
311
|
+
importDetails.push(`(√) Done: Succeeded to load manifest.json.`);
|
|
312
|
+
const webpartsDir = path.join(spfxFolder, "src", "webparts");
|
|
313
|
+
const webparts = (await fs_extra_1.default.readdir(webpartsDir)).filter(async (file) => fs_extra_1.default.statSync(path.join(webpartsDir, file)).isDirectory());
|
|
314
|
+
if (webparts.length > 1) {
|
|
315
|
+
importDetails.push(`(.) Processing: There're multiple web parts in the SPFx solution, exposing each of them in Teams manifest...`);
|
|
316
|
+
for (let i = 1; i < webparts.length; i++) {
|
|
317
|
+
const webpart = webparts[i];
|
|
318
|
+
const webpartManifestPath = path.join(webpartsDir, webpart, `${webpart.split(path.sep).pop()}WebPart.manifest.json`);
|
|
319
|
+
if (!(await fs_extra_1.default.pathExists(webpartManifestPath))) {
|
|
320
|
+
importDetails.push(` [${i}] Web part manifest doesn't exist at ${webpartManifestPath}, skip...`);
|
|
321
|
+
continue;
|
|
322
|
+
}
|
|
323
|
+
const matchHashComment = new RegExp(/(\/\/ .*)/, "gi");
|
|
324
|
+
const webpartManifest = JSON.parse((await fs_extra_1.default.readFile(webpartManifestPath, "utf8"))
|
|
325
|
+
.toString()
|
|
326
|
+
.replace(matchHashComment, "")
|
|
327
|
+
.trim());
|
|
328
|
+
importDetails.push(` [${i}] Adding web part to Teams manifest with component id: ${webpartManifest["id"]}, web part name: ${webpartManifest["preconfiguredEntries"][0].title.default}...`);
|
|
329
|
+
const componentId = webpartManifest["id"];
|
|
330
|
+
const webpartName = webpartManifest["preconfiguredEntries"][0].title.default;
|
|
331
|
+
const remoteStaticSnippet = {
|
|
332
|
+
entityId: componentId,
|
|
333
|
+
name: webpartName,
|
|
334
|
+
contentUrl: util.format(constants_2.ManifestTemplate.REMOTE_CONTENT_URL, componentId),
|
|
335
|
+
websiteUrl: constants_2.ManifestTemplate.WEBSITE_URL,
|
|
336
|
+
scopes: ["personal"],
|
|
337
|
+
};
|
|
338
|
+
const localStaticSnippet = {
|
|
339
|
+
entityId: componentId,
|
|
340
|
+
name: webpartName,
|
|
341
|
+
contentUrl: util.format(constants_2.ManifestTemplate.LOCAL_CONTENT_URL, componentId),
|
|
342
|
+
websiteUrl: constants_2.ManifestTemplate.WEBSITE_URL,
|
|
343
|
+
scopes: ["personal"],
|
|
344
|
+
};
|
|
345
|
+
(_a = localManifest.staticTabs) === null || _a === void 0 ? void 0 : _a.push(localStaticSnippet);
|
|
346
|
+
(_b = remoteManifest.staticTabs) === null || _b === void 0 ? void 0 : _b.push(remoteStaticSnippet);
|
|
347
|
+
}
|
|
348
|
+
importDetails.push(`(√) Done: Succeeded to expose additional web parts in Teams manifest.`);
|
|
349
|
+
}
|
|
350
|
+
if (await fs_extra_1.default.pathExists(path.join(spfxFolder, "teams", "manifest.json"))) {
|
|
351
|
+
importDetails.push(`(.) Processing: There's existing Teams manifest under ${path.join(spfxFolder, "teams", "manifest.json")}, updating default template...`);
|
|
352
|
+
const existingManifest = await fs_extra_1.default.readJson(path.join(spfxFolder, "teams", "manifest.json"));
|
|
353
|
+
importDetails.push(`(.) Processing: Writing existing app id in manifest.json to TEAMS_APP_ID in env.dev...`);
|
|
354
|
+
await envUtil_1.envUtil.writeEnv(destinationPath, "dev", { TEAMS_APP_ID: existingManifest.id });
|
|
355
|
+
importDetails.push(`(√) Done: Succeeded to write existing app id to env.dev.`);
|
|
356
|
+
importDetails.push(`(.) Processing: Updating default manifest with existing one...`);
|
|
357
|
+
existingManifest.$schema = remoteManifest.$schema;
|
|
358
|
+
existingManifest.manifestVersion = remoteManifest.manifestVersion;
|
|
359
|
+
existingManifest.id = remoteManifest.id;
|
|
360
|
+
existingManifest.icons = remoteManifest.icons;
|
|
361
|
+
existingManifest.staticTabs = remoteManifest.staticTabs;
|
|
362
|
+
existingManifest.configurableTabs = remoteManifest.configurableTabs;
|
|
363
|
+
remoteManifest = existingManifest;
|
|
364
|
+
}
|
|
365
|
+
importDetails.push(`(.) Processing: Writing to save changes to manifest.local.json...`);
|
|
366
|
+
await ManifestUtils_1.manifestUtils._writeAppManifest(localManifest, path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.local.json"));
|
|
367
|
+
importDetails.push(`(√) Done: Succeeded to write manifest.local.json.`);
|
|
368
|
+
importDetails.push(`(.) Processing: Writing to save changes to manifest.json...`);
|
|
369
|
+
await ManifestUtils_1.manifestUtils._writeAppManifest(remoteManifest, path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "manifest.json"));
|
|
370
|
+
importDetails.push(`(√) Done: Succeeded to write manifest.json.`);
|
|
371
|
+
let colorUpdated = false, outlineUpdated = false;
|
|
372
|
+
if (await fs_extra_1.default.pathExists(path.join(spfxFolder, "teams"))) {
|
|
373
|
+
for (const file of await fs_extra_1.default.readdir(path.join(spfxFolder, "teams"))) {
|
|
374
|
+
if (file.endsWith("color.png") && !colorUpdated) {
|
|
375
|
+
importDetails.push(`(.) Processing: Updating color.png with existing ${path.join(spfxFolder, "teams", file)}`);
|
|
376
|
+
await fs_extra_1.default.copyFile(path.join(spfxFolder, "teams", file), path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "color.png"));
|
|
377
|
+
colorUpdated = true;
|
|
378
|
+
importDetails.push(`(√) Done: Succeeded to update color.png.`);
|
|
379
|
+
}
|
|
380
|
+
if (file.endsWith("outline.png") && !outlineUpdated) {
|
|
381
|
+
importDetails.push(`(.) Processing: Updating outline.png with existing ${path.join(spfxFolder, "teams", file)}`);
|
|
382
|
+
await fs_extra_1.default.copyFile(path.join(spfxFolder, "teams", file), path.join(destinationPath, teamsfx_api_1.AppPackageFolderName, "outline.png"));
|
|
383
|
+
outlineUpdated = true;
|
|
384
|
+
importDetails.push(`(√) Done: Succeeded to update outline.png.`);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
catch (e) {
|
|
390
|
+
throw error_2.UpdateSPFxTemplateError(e);
|
|
391
|
+
}
|
|
392
|
+
}
|
|
371
393
|
}
|
|
372
394
|
tslib_1.__decorate([
|
|
373
395
|
lib_1.hooks([
|
|
@@ -379,7 +401,7 @@ tslib_1.__decorate([
|
|
|
379
401
|
}),
|
|
380
402
|
]),
|
|
381
403
|
tslib_1.__metadata("design:type", Function),
|
|
382
|
-
tslib_1.__metadata("design:paramtypes", [Object, Object, String]),
|
|
404
|
+
tslib_1.__metadata("design:paramtypes", [Object, Object, String, Object]),
|
|
383
405
|
tslib_1.__metadata("design:returntype", Promise)
|
|
384
406
|
], SPFxGenerator, "generate", null);
|
|
385
407
|
exports.SPFxGenerator = SPFxGenerator;
|