UNPKG

@sap/generator-fiori

Version:

Create an SAPUI5 application using SAP Fiori elements or a freestyle approach

1 lines 3.89 kB
"use strict";exports.id=8337,exports.ids=[8337],exports.modules={10779(e,r,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=a(n(91170)),o=a(n(6465)),s=n(3464),l=n(54980),c=n(73667),p=n(29338),d=n(58012),g=n(98434),u=n(25272),f=n(56221),h=n(19098);class default_1 extends i.default{answers={};prompts;appWizard;basePath;vscode;setPromptsCallback;constructor(e,r){super(e,r),this.appWizard=r.appWizard||c.AppWizard.create(r),this.vscode=r.vscode,o.default.configureLogging(this.options.logger,this.rootGeneratorName(),this.log,this.options.vscode,this.options.logLevel),this.appWizard.setHeaderTitle(s.generatorTitle),this.prompts=new c.Prompts(s.prompts),this.setPromptsCallback=e=>{this.prompts&&this.prompts.setCallback(e)}}async initializing(){await d.TelemetryHelper.initTelemetrySettings({consumerModule:{name:"@sap-ux/ui5-library-reference-sub-generator",version:this.rootGeneratorVersion()},internalFeature:(0,g.isInternalFeaturesSettingEnabled)(),watchTelemetrySettingStore:!1}),(0,d.setYeomanEnvConflicterForce)(this.env,!0)}async prompting(){let e;e=this.env?.adapter?.actualAdapter?this.env.adapter.actualAdapter:this.env?.adapter;const r=await(0,u.prompt)(l.workspace.workspaceFolders,e);Object.assign(this.answers,r)}async writing(){const e=[];if(this.answers.referenceLibraries)for(const r of this.answers.referenceLibraries)e.push({name:r.name,path:r.path,type:r.type,uri:r.uri});try{this.answers.targetProjectFolder&&await(0,p.generate)(this.answers.targetProjectFolder,e,this.fs)}catch(e){throw o.default.logger.error(e),new Error((0,f.t)("error.updatingApp"))}}end(){try{(0,d.isExtensionInstalled)(this.vscode,d.YUI_EXTENSION_ID,d.YUI_MIN_VER_FILES_GENERATED_MSG)&&this.appWizard?.showInformation((0,f.t)("info.filesGenerated"),c.MessageType.notification);const e=d.TelemetryHelper.createTelemetryData();e&&(0,d.sendTelemetry)(h.EventName.LIB_REFERENCE_ADDED,e,this.answers.targetProjectFolder).catch(e=>{o.default.logger.error((0,f.t)("error.telemetry",{error:e}))})}catch(e){o.default.logger.error((0,f.t)("error.endPhase"))}}}r.default=default_1},19098(e,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.EventName=void 0,function(e){e.LIB_REFERENCE_ADDED="LIB_REFERENCE_ADDED"}(n||(r.EventName=n={}))},3464(e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.prompts=r.generatorTitle=void 0,r.generatorTitle="SAP Fiori Reusable Library",r.prompts=[{name:"Create a Reference",description:"Add library reference to an SAP Fiori application"}]},56221(e,r,n){var a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.i18n=void 0,r.initI18n=initI18n,r.t=function t(e,n){n?.ns||(n=Object.assign(n??{},{ns:s}));return r.i18n.t(e,n)};const i=a(n(68801)),o=a(n(62707)),s="ui5-library-reference-sub-generator";async function initI18n(){await r.i18n.init({lng:"en",fallbackLng:"en",showSupportNotice:!1}),r.i18n.addResourceBundle("en",s,o.default)}r.i18n=i.default.createInstance(),initI18n().catch(()=>{})},6465(e,r,n){Object.defineProperty(r,"__esModule",{value:!0});const a=n(58012);class ReferenceLibGenLogger{static _logger=a.DefaultLogger;static get logger(){return ReferenceLibGenLogger._logger}static set logger(e){ReferenceLibGenLogger._logger=e}static configureLogging(e,r,n,i,o){const s=new a.LogWrapper(r,n,o,e,i);ReferenceLibGenLogger.logger=s}}r.default=ReferenceLibGenLogger},62707(e){e.exports=JSON.parse('{"info":{"filesGenerated":"The files have been generated."},"error":{"endPhase":"An error occurred in the end phase of the reference library generator: {{- error}}","telemetry":"An error occurred when sending telemetry data: {{- error}}","updatingApp":"An error occurred when updating the application with the library reference. For more information, view the logs."}}')}};