UNPKG

@sap/generator-fiori

Version:

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

1 lines 3.83 kB
"use strict";exports.id=337,exports.ids=[337],exports.modules={10779:function(e,r,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0});const i=n(a(91170)),s=n(a(6465)),o=a(3464),l=a(54980),c=a(70832),p=a(72535),d=a(58012),g=a(98434),u=a(25272),f=a(56221),h=a(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,s.default.configureLogging(this.options.logger,this.rootGeneratorName(),this.log,this.options.vscode,this.options.logLevel),this.appWizard.setHeaderTitle(o.generatorTitle),this.prompts=new c.Prompts(o.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}),this.env.conflicter&&(this.env.conflicter.force=!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 s.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=>{s.default.logger.error((0,f.t)("error.telemetry",{error:e}))}))}catch(e){s.default.logger.error((0,f.t)("error.endPhase"))}}}r.default=default_1},19098:(e,r)=>{var a;Object.defineProperty(r,"__esModule",{value:!0}),r.EventName=void 0,function(e){e.LIB_REFERENCE_ADDED="LIB_REFERENCE_ADDED"}(a||(r.EventName=a={}))},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:function(e,r,a){var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(r,"__esModule",{value:!0}),r.t=r.initI18n=void 0;const i=n(a(66782)),s=n(a(62707)),o="ui5-library-reference-sub-generator";async function initI18n(){await i.default.init({lng:"en",fallbackLng:"en"},(()=>i.default.addResourceBundle("en",o,s.default)))}r.initI18n=initI18n,r.t=function t(e,r){return r?.ns||(r=Object.assign(r??{},{ns:o})),i.default.t(e,r)},initI18n().catch((()=>{}))},6465:(e,r,a)=>{Object.defineProperty(r,"__esModule",{value:!0});const n=a(58012);class ReferenceLibGenLogger{static _logger=n.DefaultLogger;static get logger(){return ReferenceLibGenLogger._logger}static set logger(e){ReferenceLibGenLogger._logger=e}static configureLogging(e,r,a,i,s){const o=new n.LogWrapper(r,a,s,e,i);ReferenceLibGenLogger.logger=o}}r.default=ReferenceLibGenLogger},62707:e=>{e.exports=JSON.parse('{"info":{"filesGenerated":"The files have been generated."},"error":{"endPhase":"Error in end phase in the reference library generator: {{- error}}","telemetry":"Error sending telemetry data: {{- error}}","updatingApp":"Error updating app with the library reference. Inspect the logs for full error."}}')}};