@wavemaker/angular-codegen 11.4.0-next.28701 → 11.4.0-rc.121

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.
@@ -15,6 +15,12 @@
15
15
  <div wmConfirmDialog name="_app-confirm-dialog" title.bind="title" message.bind="message" oktext.bind="oktext"
16
16
  canceltext.bind="canceltext" closable="false" iconclass.bind="iconclass"
17
17
  escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>
18
+ <div *ngIf="!isApplicationType" wmConfirmDialog name="PrefabConfirmDialog" title.bind="title" message.bind="text" oktext.bind="okButtonText"
19
+ canceltext.bind="cancelButtonText" closable="false" iconclass.bind="iconclass"
20
+ escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>
21
+ <div *ngIf="!isApplicationType" wmAlertDialog name="PrefabAlertDialog" title.bind="title" message.bind="text" oktext.bind="okButtonText"
22
+ canceltext.bind="cancelButtonText" closable="false" iconclass.bind="iconclass"
23
+ escape.event="onEscape()" ok.event="onOk()" cancel.event="onCancel()" close.event="onClose()" opened.event="onOpen()"></div>
18
24
  <div wmAppExt></div>
19
25
  <i id="wm-mobile-display"></i>
20
26
  </ng-container>
@@ -45676,8 +45676,16 @@ const isIpad = () => {
45676
45676
  return REGEX.IPAD.test(userAgent) || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2 && REGEX.MAC.test(window.navigator.platform));
45677
45677
  };
45678
45678
  const isIos = () => isIphone() || isIpod() || isIpad();
45679
- const isLargeTabletLandscape = () => window.matchMedia("only screen and (min-device-width : 1366px) and (max-device-width : 1366px) and (min-device-height : 1024px) and (max-device-height : 1024px) and (min-width: 1366px) and (max-width: 1366px)").matches;
45680
- const isLargeTabletPortrait = () => window.matchMedia("only screen and (min-device-width : 1024px) and (max-device-width : 1024px) and (min-device-height : 1366px) and (max-device-height : 1366px) and (min-width: 1024px) and (max-width: 1024px)").matches;
45679
+ const isLargeTabletLandscape = (landScapeWidth, landScapeHeight) => {
45680
+ const width = landScapeWidth || '1366px';
45681
+ const height = landScapeHeight || '1024px';
45682
+ return window.matchMedia("only screen and (min-device-width : " + width + ") and (max-device-width : " + width + ") and (min-device-height : " + height + ") and (max-device-height : " + height + ") and (min-width: " + width + ") and (max-width: " + width + ")").matches;
45683
+ };
45684
+ const isLargeTabletPortrait = (landScapeWidth, landScapeHeight) => {
45685
+ const height = landScapeWidth || '1366px';
45686
+ const width = landScapeHeight || '1024px';
45687
+ return window.matchMedia("only screen and (min-device-width : " + width + ") and (max-device-width : " + width + ") and (min-device-height : " + height + ") and (max-device-height : " + height + ") and (min-width: " + width + ") and (max-width: " + width + ")").matches;
45688
+ };
45681
45689
  const isMobile = () => isAndroid() || isIos() || isAndroidTablet() || $('#wm-mobile-display:visible').length > 0;
45682
45690
  const isTablet = () => {
45683
45691
  const scope = document.querySelector('.app-page').widget;
@@ -47221,8 +47229,8 @@ class EventNotifier {
47221
47229
  }
47222
47230
  }
47223
47231
 
47224
- const MINIMUM_MOBILE_WIDTH = 480;
47225
- const MINIMUM_TAB_WIDTH = 768;
47232
+ let MINIMUM_MOBILE_WIDTH = 480;
47233
+ let MINIMUM_TAB_WIDTH = 768;
47226
47234
  class Viewport {
47227
47235
  constructor() {
47228
47236
  this.orientation = {
@@ -47287,6 +47295,8 @@ class Viewport {
47287
47295
  }
47288
47296
  }
47289
47297
  else {
47298
+ MINIMUM_MOBILE_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--screen-xs')) || 480;
47299
+ MINIMUM_TAB_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--screen-sm')) || 768;
47290
47300
  // Tablet specification: min >= 480 max >= 768
47291
47301
  if (minValue >= MINIMUM_MOBILE_WIDTH && maxValue >= MINIMUM_TAB_WIDTH) {
47292
47302
  this.type = 1 /* TABLET */;
@@ -41754,8 +41754,16 @@ const isIpad = () => {
41754
41754
  return REGEX.IPAD.test(userAgent) || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2 && REGEX.MAC.test(window.navigator.platform));
41755
41755
  };
41756
41756
  const isIos = () => isIphone() || isIpod() || isIpad();
41757
- const isLargeTabletLandscape = () => window.matchMedia("only screen and (min-device-width : 1366px) and (max-device-width : 1366px) and (min-device-height : 1024px) and (max-device-height : 1024px) and (min-width: 1366px) and (max-width: 1366px)").matches;
41758
- const isLargeTabletPortrait = () => window.matchMedia("only screen and (min-device-width : 1024px) and (max-device-width : 1024px) and (min-device-height : 1366px) and (max-device-height : 1366px) and (min-width: 1024px) and (max-width: 1024px)").matches;
41757
+ const isLargeTabletLandscape = (landScapeWidth, landScapeHeight) => {
41758
+ const width = landScapeWidth || '1366px';
41759
+ const height = landScapeHeight || '1024px';
41760
+ return window.matchMedia("only screen and (min-device-width : " + width + ") and (max-device-width : " + width + ") and (min-device-height : " + height + ") and (max-device-height : " + height + ") and (min-width: " + width + ") and (max-width: " + width + ")").matches;
41761
+ };
41762
+ const isLargeTabletPortrait = (landScapeWidth, landScapeHeight) => {
41763
+ const height = landScapeWidth || '1366px';
41764
+ const width = landScapeHeight || '1024px';
41765
+ return window.matchMedia("only screen and (min-device-width : " + width + ") and (max-device-width : " + width + ") and (min-device-height : " + height + ") and (max-device-height : " + height + ") and (min-width: " + width + ") and (max-width: " + width + ")").matches;
41766
+ };
41759
41767
  const isMobile = () => isAndroid() || isIos() || isAndroidTablet() || $('#wm-mobile-display:visible').length > 0;
41760
41768
  const isTablet = () => {
41761
41769
  const scope = document.querySelector('.app-page').widget;
@@ -43299,8 +43307,8 @@ class EventNotifier {
43299
43307
  }
43300
43308
  }
43301
43309
 
43302
- const MINIMUM_MOBILE_WIDTH = 480;
43303
- const MINIMUM_TAB_WIDTH = 768;
43310
+ let MINIMUM_MOBILE_WIDTH = 480;
43311
+ let MINIMUM_TAB_WIDTH = 768;
43304
43312
  class Viewport {
43305
43313
  constructor() {
43306
43314
  this.orientation = {
@@ -43365,6 +43373,8 @@ class Viewport {
43365
43373
  }
43366
43374
  }
43367
43375
  else {
43376
+ MINIMUM_MOBILE_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--screen-xs')) || 480;
43377
+ MINIMUM_TAB_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--screen-sm')) || 768;
43368
43378
  // Tablet specification: min >= 480 max >= 768
43369
43379
  if (minValue >= MINIMUM_MOBILE_WIDTH && maxValue >= MINIMUM_TAB_WIDTH) {
43370
43380
  this.type = 1 /* TABLET */;
@@ -45319,18 +45329,16 @@ var search_build$1 = /*#__PURE__*/Object.freeze({
45319
45329
  'default': search_build
45320
45330
  });
45321
45331
 
45322
- const tagName$1o = 'div';
45332
+ const tagName$1o = 'ul';
45323
45333
  register('wm-tree', () => {
45324
45334
  return {
45325
- pre: attrs => `<${tagName$1o} wmTree ${getAttrMarkup(attrs)}>`,
45335
+ pre: attrs => `<${tagName$1o} wmTree class="ztree" ${getAttrMarkup(attrs)}>`,
45326
45336
  post: () => `</${tagName$1o}>`
45327
45337
  };
45328
45338
  });
45329
- var tree_build = () => { };
45330
45339
 
45331
- var tree_build$1 = /*#__PURE__*/Object.freeze({
45332
- __proto__: null,
45333
- 'default': tree_build
45340
+ var tree_build = /*#__PURE__*/Object.freeze({
45341
+ __proto__: null
45334
45342
  });
45335
45343
 
45336
45344
  const tagName$1n = 'div';
@@ -46880,7 +46888,7 @@ register('wm-popover', () => {
46880
46888
  }
46881
46889
  let markup = `<${tagName$q} wmPopover ${getAttrMarkup(attrs)}>`;
46882
46890
  const contextAttrs = table ? `let-row="row"` : ``;
46883
- markup += `<ng-template ${contextAttrs}><button class="popover-start"></button>`;
46891
+ markup += `<ng-template ${contextAttrs}><div tabindex="0" class="popover-start sr-only" aria-label="">popover content start</div>`;
46884
46892
  // todo keyboard navigation - tab
46885
46893
  if (popoverTemplate) {
46886
46894
  markup += `${popoverTemplate ? popoverTemplate : ''}`;
@@ -46892,7 +46900,7 @@ register('wm-popover', () => {
46892
46900
  if (shared.get('hasPopoverContent')) {
46893
46901
  markup += `</div>`;
46894
46902
  }
46895
- return `${markup}<button class="popover-end"></button></ng-template></${tagName$q}>`;
46903
+ return `${markup}<div tabindex="0" class="popover-end sr-only" aria-label="">popover content ended</div></ng-template></${tagName$q}>`;
46896
46904
  }
46897
46905
  };
46898
46906
  });
@@ -47941,7 +47949,7 @@ exports.textBuild = text_build$1;
47941
47949
  exports.tileBuild = tile_build$1;
47942
47950
  exports.timeBuild = time_build$1;
47943
47951
  exports.topNavBuild = topNav_build$1;
47944
- exports.treeBuild = tree_build$1;
47952
+ exports.treeBuild = tree_build;
47945
47953
  exports.videoBuild = video_build$1;
47946
47954
  exports.wizardBuild = wizard_build$1;
47947
47955
  exports.wizardStepBuild = wizardStep_build$1;
@@ -41754,8 +41754,16 @@ const isIpad = () => {
41754
41754
  return REGEX.IPAD.test(userAgent) || (window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2 && REGEX.MAC.test(window.navigator.platform));
41755
41755
  };
41756
41756
  const isIos = () => isIphone() || isIpod() || isIpad();
41757
- const isLargeTabletLandscape = () => window.matchMedia("only screen and (min-device-width : 1366px) and (max-device-width : 1366px) and (min-device-height : 1024px) and (max-device-height : 1024px) and (min-width: 1366px) and (max-width: 1366px)").matches;
41758
- const isLargeTabletPortrait = () => window.matchMedia("only screen and (min-device-width : 1024px) and (max-device-width : 1024px) and (min-device-height : 1366px) and (max-device-height : 1366px) and (min-width: 1024px) and (max-width: 1024px)").matches;
41757
+ const isLargeTabletLandscape = (landScapeWidth, landScapeHeight) => {
41758
+ const width = landScapeWidth || '1366px';
41759
+ const height = landScapeHeight || '1024px';
41760
+ return window.matchMedia("only screen and (min-device-width : " + width + ") and (max-device-width : " + width + ") and (min-device-height : " + height + ") and (max-device-height : " + height + ") and (min-width: " + width + ") and (max-width: " + width + ")").matches;
41761
+ };
41762
+ const isLargeTabletPortrait = (landScapeWidth, landScapeHeight) => {
41763
+ const height = landScapeWidth || '1366px';
41764
+ const width = landScapeHeight || '1024px';
41765
+ return window.matchMedia("only screen and (min-device-width : " + width + ") and (max-device-width : " + width + ") and (min-device-height : " + height + ") and (max-device-height : " + height + ") and (min-width: " + width + ") and (max-width: " + width + ")").matches;
41766
+ };
41759
41767
  const isMobile = () => isAndroid() || isIos() || isAndroidTablet() || $('#wm-mobile-display:visible').length > 0;
41760
41768
  const isTablet = () => {
41761
41769
  const scope = document.querySelector('.app-page').widget;
@@ -43299,8 +43307,8 @@ class EventNotifier {
43299
43307
  }
43300
43308
  }
43301
43309
 
43302
- const MINIMUM_MOBILE_WIDTH = 480;
43303
- const MINIMUM_TAB_WIDTH = 768;
43310
+ let MINIMUM_MOBILE_WIDTH = 480;
43311
+ let MINIMUM_TAB_WIDTH = 768;
43304
43312
  class Viewport {
43305
43313
  constructor() {
43306
43314
  this.orientation = {
@@ -43365,6 +43373,8 @@ class Viewport {
43365
43373
  }
43366
43374
  }
43367
43375
  else {
43376
+ MINIMUM_MOBILE_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--screen-xs')) || 480;
43377
+ MINIMUM_TAB_WIDTH = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--screen-sm')) || 768;
43368
43378
  // Tablet specification: min >= 480 max >= 768
43369
43379
  if (minValue >= MINIMUM_MOBILE_WIDTH && maxValue >= MINIMUM_TAB_WIDTH) {
43370
43380
  this.type = 1 /* TABLET */;
@@ -45319,18 +45329,16 @@ var search_build$1 = /*#__PURE__*/Object.freeze({
45319
45329
  'default': search_build
45320
45330
  });
45321
45331
 
45322
- const tagName$1o = 'div';
45332
+ const tagName$1o = 'ul';
45323
45333
  register('wm-tree', () => {
45324
45334
  return {
45325
- pre: attrs => `<${tagName$1o} wmTree ${getAttrMarkup(attrs)}>`,
45335
+ pre: attrs => `<${tagName$1o} wmTree class="ztree" ${getAttrMarkup(attrs)}>`,
45326
45336
  post: () => `</${tagName$1o}>`
45327
45337
  };
45328
45338
  });
45329
- var tree_build = () => { };
45330
45339
 
45331
- var tree_build$1 = /*#__PURE__*/Object.freeze({
45332
- __proto__: null,
45333
- 'default': tree_build
45340
+ var tree_build = /*#__PURE__*/Object.freeze({
45341
+ __proto__: null
45334
45342
  });
45335
45343
 
45336
45344
  const tagName$1n = 'div';
@@ -46880,7 +46888,7 @@ register('wm-popover', () => {
46880
46888
  }
46881
46889
  let markup = `<${tagName$q} wmPopover ${getAttrMarkup(attrs)}>`;
46882
46890
  const contextAttrs = table ? `let-row="row"` : ``;
46883
- markup += `<ng-template ${contextAttrs}><button class="popover-start"></button>`;
46891
+ markup += `<ng-template ${contextAttrs}><div tabindex="0" class="popover-start sr-only" aria-label="">popover content start</div>`;
46884
46892
  // todo keyboard navigation - tab
46885
46893
  if (popoverTemplate) {
46886
46894
  markup += `${popoverTemplate ? popoverTemplate : ''}`;
@@ -46892,7 +46900,7 @@ register('wm-popover', () => {
46892
46900
  if (shared.get('hasPopoverContent')) {
46893
46901
  markup += `</div>`;
46894
46902
  }
46895
- return `${markup}<button class="popover-end"></button></ng-template></${tagName$q}>`;
46903
+ return `${markup}<div tabindex="0" class="popover-end sr-only" aria-label="">popover content ended</div></ng-template></${tagName$q}>`;
46896
46904
  }
46897
46905
  };
46898
46906
  });
@@ -47941,7 +47949,7 @@ exports.textBuild = text_build$1;
47941
47949
  exports.tileBuild = tile_build$1;
47942
47950
  exports.timeBuild = time_build$1;
47943
47951
  exports.topNavBuild = topNav_build$1;
47944
- exports.treeBuild = tree_build$1;
47952
+ exports.treeBuild = tree_build;
47945
47953
  exports.videoBuild = video_build$1;
47946
47954
  exports.wizardBuild = wizard_build$1;
47947
47955
  exports.wizardStepBuild = wizardStep_build$1;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.4.0-next.28701",
3
+ "version": "11.4.0-rc.121",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -1 +1 @@
1
- global._WM_APP_PROPERTIES={},global._WM_PACKAGE_PATH="./libraries",global.$=require("jquery"),global._=require("lodash");const cheerio=require("cheerio"),{deleteResource:deleteResource,getIndexHtmlPath:getIndexHtmlPath,getPagesDirPath:getPagesDirPath,readFile:readFile,searchFileByName:searchFileByName,writeFile:writeFile,readFileSync:readFileSync}=require("./wm-utils"),{createAppSkeleton:createApp}=require("./gen-app-skeleton"),{generateAppModule:generateAppModule,generateCodeGenModule:generateCodeGenModule}=require("./gen-app-codegen-module"),{generatePrefabConfigFile:generatePrefabConfigFile}=require("./gen-prefabs"),{generateAppRoutes:generateAppRoutes}=require("./gen-app-routes"),{generateAppJS:generateAppJS}=require("./gen-app-js"),{generateAppVariables:generateAppVariables}=require("./gen-app-variables"),{getWmProjectProperties:getWmProjectProperties,getSecurityConfig:getSecurityConfig,getLayoutsConfig:getLayoutsConfig,getPagesConfig:getPagesConfig,getPrefabConfigsUsedInApp:getPrefabConfigsUsedInApp,getPrefabPartialsConfig:getPrefabPartialsConfig}=require("./project-meta"),{generateTSConfig:generateTSConfig}=require("./gen-tsconfig"),{generateComponents:generateComponents,generatePagePartialComponent:generatePagePartialComponent}=require("./gen-components"),{generateWmProjectProperties:generateWmProjectProperties}=require("./gen-wm-project-properties"),{generateIndexHtml:generateIndexHtml}=require("./gen-index-html"),{updateAngularJSON:updateAngularJSON}=require("./update-angular-json"),{generatePwaFiles:generatePwaFiles}=require("./gen-pwa-files"),{generateLazyModuleRoutes:generateLazyModuleRoutes}=require("./gen-lazy-module-routes"),{createIntermediateAppSkeleton:createIntermediateAppSkeleton,generateLayoutsAndPages:generateLayoutsAndPages}=require("./gen-layouts"),getMarkupFiles=async e=>{const a=[];return searchFileByName(e+"/src/app",/\.html$/,e=>{a.push(e)}),a},isDynamicComponentUsedInMarkup=async e=>{const a=await readFile(e,"utf8");return cheerio.load(a)("form[wmForm][metadata],form[wmForm][metadata\\.bind],div[wmTable]:not(:has(*))").length>0},isDynamicComponentUsedInApp=async e=>{const a=await getMarkupFiles(e);return(await Promise.all(a.map(e=>isDynamicComponentUsedInMarkup(e)))).find(e=>e)},cleanPackageJSON=async(e,a)=>{const t=`${e}/package.json`;let r=readFileSync(t,!0);["@ampproject/rollup-plugin-closure-compiler","rollup","rollup-plugin-alias","rollup-plugin-commonjs","rollup-plugin-includepaths","rollup-plugin-multi-entry","rollup-plugin-node-resolve"].forEach(e=>{delete r.devDependencies[e]}),a||delete r.dependencies["@angular/service-worker"],await writeFile(t,JSON.stringify(r,null,4))},generateIntermediateApp=async(e,a)=>{console.time("create-intermediate-app"),await createIntermediateAppSkeleton(e,a),await generateLayoutsAndPages(a),console.timeEnd("create-intermediate-app")},generateSources=async(e,a,t,r,n,o)=>{console.time("generate app-sources"),await Promise.all([deleteResource(`${a}/src/app/layouts`),deleteResource(`${a}/src/app/pages`),deleteResource(`${a}/src/app/partials`),deleteResource(`${a}/src/app/prefabs`)]);const i=readFileSync(`${a}/angular.json`);global._WM_PACKAGE_PATH=i.includes("./node_modules/@wavemaker/app-ng-runtime/")?"./node_modules/@wavemaker/app-ng-runtime":"./libraries";const g=await getWmProjectProperties(e),p=await getSecurityConfig(e);let s;o&&(s=await getLayoutsConfig(e));const l=await getPagesConfig(e),u=await getPrefabConfigsUsedInApp(g,e);let c={};for(const a of u.keys())c[a]=await getPrefabPartialsConfig(e,a);t&&!t.endsWith("/")&&(t+="/"),await Promise.all([generateIndexHtml(e,a,g,t,r),generateWmProjectProperties(g,a),generateAppRoutes(e,g,s,l,p,a,o),generateLazyModuleRoutes(l,u,c,a),generatePrefabConfigFile(u,a),generateCodeGenModule(g,l,u,p,a),generateTSConfig(g,a),generateAppJS(e,a),generateAppVariables(e,a,n),generateComponents(e,g,s,l,p,u,a,c,n,o)]);const d=await isDynamicComponentUsedInApp(a),m={aot:!d,buildOptimizer:!d};await generateAppModule(g,a,d,r),await updateAngularJSON(e,a,g,l,u,t,m,c,r),await cleanPackageJSON(a,r),r&&await generatePwaFiles(e,a,g),console.timeEnd("generate app-sources")},createAppSkeleton=async(e,a,t)=>{console.time("create-angular-app"),await createApp(e,a,t),console.timeEnd("create-angular-app")},generatePage=async(e,a,t,r)=>{console.time("generate page",t);const n=getPagesDirPath(e),o=await getWmProjectProperties(e),i=await getPagesConfig(e),g=_.find(i,{name:t}),p="PAGE"===g.type?"pages":"partials";await deleteResource(`${a}/src/app/${p}/${t}`),await generatePagePartialComponent(n,o,g.name,g.type,a,void 0,void 0,r),console.timeEnd("generate page",t)};module.exports={generateIntermediateApp:generateIntermediateApp,generateSources:generateSources,createAppSkeleton:createAppSkeleton,generatePage:generatePage};
1
+ global._WM_APP_PROPERTIES={},global._WM_PACKAGE_PATH="./libraries",global.$=require("jquery"),global._=require("lodash");const cheerio=require("cheerio"),{deleteResource:deleteResource,getIndexHtmlPath:getIndexHtmlPath,getPagesDirPath:getPagesDirPath,readFile:readFile,searchFileByName:searchFileByName,writeFile:writeFile,readFileSync:readFileSync}=require("./wm-utils"),{createAppSkeleton:createApp}=require("./gen-app-skeleton"),{generateAppModule:generateAppModule,generateCodeGenModule:generateCodeGenModule}=require("./gen-app-codegen-module"),{generatePrefabConfigFile:generatePrefabConfigFile}=require("./gen-prefabs"),{generateAppRoutes:generateAppRoutes}=require("./gen-app-routes"),{generateAppJS:generateAppJS}=require("./gen-app-js"),{generateAppVariables:generateAppVariables}=require("./gen-app-variables"),{getWmProjectProperties:getWmProjectProperties,getThemesConfigProperties:getThemesConfigProperties,getSecurityConfig:getSecurityConfig,getLayoutsConfig:getLayoutsConfig,getPagesConfig:getPagesConfig,getPrefabConfigsUsedInApp:getPrefabConfigsUsedInApp,getPrefabPartialsConfig:getPrefabPartialsConfig}=require("./project-meta"),{generateTSConfig:generateTSConfig}=require("./gen-tsconfig"),{generateComponents:generateComponents,generatePagePartialComponent:generatePagePartialComponent}=require("./gen-components"),{generateWmProjectProperties:generateWmProjectProperties}=require("./gen-wm-project-properties"),{generateIndexHtml:generateIndexHtml}=require("./gen-index-html"),{updateAngularJSON:updateAngularJSON}=require("./update-angular-json"),{generatePwaFiles:generatePwaFiles}=require("./gen-pwa-files"),{generateLazyModuleRoutes:generateLazyModuleRoutes}=require("./gen-lazy-module-routes"),{createIntermediateAppSkeleton:createIntermediateAppSkeleton,generateLayoutsAndPages:generateLayoutsAndPages}=require("./gen-layouts"),getMarkupFiles=async e=>{const a=[];return searchFileByName(e+"/src/app",/\.html$/,e=>{a.push(e)}),a},isDynamicComponentUsedInMarkup=async e=>{const a=await readFile(e,"utf8");return cheerio.load(a)("form[wmForm][metadata],form[wmForm][metadata\\.bind],div[wmTable]:not(:has(*))").length>0},isDynamicComponentUsedInApp=async e=>{const a=await getMarkupFiles(e);return(await Promise.all(a.map(e=>isDynamicComponentUsedInMarkup(e)))).find(e=>e)},cleanPackageJSON=async(e,a)=>{const t=`${e}/package.json`;let r=readFileSync(t,!0);["@ampproject/rollup-plugin-closure-compiler","rollup","rollup-plugin-alias","rollup-plugin-commonjs","rollup-plugin-includepaths","rollup-plugin-multi-entry","rollup-plugin-node-resolve"].forEach(e=>{delete r.devDependencies[e]}),a||delete r.dependencies["@angular/service-worker"],await writeFile(t,JSON.stringify(r,null,4))},generateIntermediateApp=async(e,a)=>{console.time("create-intermediate-app"),await createIntermediateAppSkeleton(e,a),await generateLayoutsAndPages(a),console.timeEnd("create-intermediate-app")},generateSources=async(e,a,t,r,n,o)=>{console.time("generate app-sources"),await Promise.all([deleteResource(`${a}/src/app/layouts`),deleteResource(`${a}/src/app/pages`),deleteResource(`${a}/src/app/partials`),deleteResource(`${a}/src/app/prefabs`)]);const i=readFileSync(`${a}/angular.json`);global._WM_PACKAGE_PATH=i.includes("./node_modules/@wavemaker/app-ng-runtime/")?"./node_modules/@wavemaker/app-ng-runtime":"./libraries";const g=await getWmProjectProperties(e),p=await getThemesConfigProperties(e),s=await getSecurityConfig(e);let l;o&&(l=await getLayoutsConfig(e));const u=await getPagesConfig(e),c=await getPrefabConfigsUsedInApp(g,e);let d={};for(const a of c.keys())d[a]=await getPrefabPartialsConfig(e,a);t&&!t.endsWith("/")&&(t+="/"),await Promise.all([generateIndexHtml(e,a,g,t,r),generateWmProjectProperties(g,a),generateAppRoutes(e,g,l,u,s,a,o),generateLazyModuleRoutes(u,c,d,a),generatePrefabConfigFile(c,a),generateCodeGenModule(g,u,c,s,a),generateTSConfig(g,a),generateAppJS(e,a),generateAppVariables(e,a,n),generateComponents(e,g,l,u,s,c,a,d,n,o)]);const m=await isDynamicComponentUsedInApp(a),P={aot:!m,buildOptimizer:!m};await generateAppModule(g,a,m,r),await updateAngularJSON(e,a,g,p,u,c,t,P,d,r),await cleanPackageJSON(a,r),r&&await generatePwaFiles(e,a,g),console.timeEnd("generate app-sources")},createAppSkeleton=async(e,a,t)=>{console.time("create-angular-app"),await createApp(e,a,t),console.timeEnd("create-angular-app")},generatePage=async(e,a,t,r)=>{console.time("generate page",t);const n=getPagesDirPath(e),o=await getWmProjectProperties(e),i=await getPagesConfig(e),g=_.find(i,{name:t}),p="PAGE"===g.type?"pages":"partials";await deleteResource(`${a}/src/app/${p}/${t}`),await generatePagePartialComponent(n,o,g.name,g.type,a,void 0,void 0,r),console.timeEnd("generate page",t)};module.exports={generateIntermediateApp:generateIntermediateApp,generateSources:generateSources,createAppSkeleton:createAppSkeleton,generatePage:generatePage};
@@ -1 +1 @@
1
- const parser=require("fast-xml-parser"),{readFile:readFile,readDir:readDir,stat:stat,isPrefabProject:isPrefabProject,getWmProjectPropertiesFilePath:getWmProjectPropertiesFilePath,getAuthInfoFilePath:getAuthInfoFilePath,getSecurityConfigPath:getSecurityConfigPath,getLayoutsConfigPath:getLayoutsConfigPath,getPagesConfigPath:getPagesConfigPath,getPrefabsDirPath:getPrefabsDirPath,getPrefabPagesDirPath:getPrefabPagesDirPath,getPrefabConfigPath:getPrefabConfigPath}=require("./wm-utils"),{join:join}=require("path"),getWmProjectProperties=async e=>{let t=await readFile(getWmProjectPropertiesFilePath(e),"utf8");const a={};return parser.parse(t,{textNodeName:"text",ignoreAttributes:!1,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,trimValues:!0,parseTrueNumberOnly:!1,arrayMode:!1,stopNodes:["parse-me-as-string"]},!0).properties.entry.forEach(e=>a[e["@_key"]]=e.text?e.text:""),a},getSecurityConfig=async e=>stat(getAuthInfoFilePath(e)).then(()=>new Promise(async(t,a)=>{let r=null;JSON.parse(await readFile(getAuthInfoFilePath(e))).enforceSecurity&&(r=JSON.parse(await readFile(getSecurityConfigPath(e),"utf8"))),t(r)}),()=>Promise.resolve(null)),getLayoutsConfig=async e=>{let t=await readFile(getLayoutsConfigPath(e),"utf8");return t=JSON.parse(t)},getPagesConfig=async e=>{let t=await readFile(getPagesConfigPath(e),"utf8");return t=JSON.parse(t)},getPrefabPartialsConfig=async(e,t)=>{let a=await readFile(`${getPrefabPagesDirPath(e,t)}/pages-config.json`,"utf8");return a=JSON.parse(a).filter(e=>"partial"===e.type.toLowerCase()||"template"===e.type.toLowerCase()).map(e=>({...e,prefabName:t}))},getPrefabConfigsUsedInApp=async(e,t)=>{const a=new Map,r=getPrefabsDirPath(t);return stat(r).then(()=>new Promise(async(i,s)=>{for(const e of await readDir(r))(await stat(join(r,e))).isDirectory()&&a.set(e,await readFile(getPrefabConfigPath(t,e)));isPrefabProject(e)&&a.set("__self__",await readFile(`${t}/src/main/webapp/config.json`)),i(a)}),()=>Promise.resolve(a))};module.exports={getWmProjectProperties:getWmProjectProperties,getSecurityConfig:getSecurityConfig,getLayoutsConfig:getLayoutsConfig,getPagesConfig:getPagesConfig,getPrefabConfigsUsedInApp:getPrefabConfigsUsedInApp,getPrefabPartialsConfig:getPrefabPartialsConfig};
1
+ const parser=require("fast-xml-parser"),{readFile:readFile,readDir:readDir,stat:stat,isPrefabProject:isPrefabProject,getWmProjectPropertiesFilePath:getWmProjectPropertiesFilePath,getThemesConfigPropertiesFilePath:getThemesConfigPropertiesFilePath,getAuthInfoFilePath:getAuthInfoFilePath,getSecurityConfigPath:getSecurityConfigPath,getLayoutsConfigPath:getLayoutsConfigPath,getPagesConfigPath:getPagesConfigPath,getPrefabsDirPath:getPrefabsDirPath,getPrefabPagesDirPath:getPrefabPagesDirPath,getPrefabConfigPath:getPrefabConfigPath}=require("./wm-utils"),{join:join}=require("path"),getWmProjectProperties=async e=>{let t=await readFile(getWmProjectPropertiesFilePath(e),"utf8");const a={};return parser.parse(t,{textNodeName:"text",ignoreAttributes:!1,ignoreNameSpace:!1,allowBooleanAttributes:!1,parseNodeValue:!0,parseAttributeValue:!1,trimValues:!0,parseTrueNumberOnly:!1,arrayMode:!1,stopNodes:["parse-me-as-string"]},!0).properties.entry.forEach(e=>a[e["@_key"]]=e.text?e.text:""),a},getThemesConfigProperties=async e=>{const t=await readFile(getThemesConfigPropertiesFilePath(e),"utf8");return JSON.parse(t)},getSecurityConfig=async e=>stat(getAuthInfoFilePath(e)).then(()=>new Promise(async(t,a)=>{let r=null;JSON.parse(await readFile(getAuthInfoFilePath(e))).enforceSecurity&&(r=JSON.parse(await readFile(getSecurityConfigPath(e),"utf8"))),t(r)}),()=>Promise.resolve(null)),getLayoutsConfig=async e=>{let t=await readFile(getLayoutsConfigPath(e),"utf8");return t=JSON.parse(t)},getPagesConfig=async e=>{let t=await readFile(getPagesConfigPath(e),"utf8");return t=JSON.parse(t)},getPrefabPartialsConfig=async(e,t)=>{let a=await readFile(`${getPrefabPagesDirPath(e,t)}/pages-config.json`,"utf8");return a=JSON.parse(a).filter(e=>"partial"===e.type.toLowerCase()||"template"===e.type.toLowerCase()).map(e=>({...e,prefabName:t}))},getPrefabConfigsUsedInApp=async(e,t)=>{const a=new Map,r=getPrefabsDirPath(t);return stat(r).then(()=>new Promise(async(i,s)=>{for(const e of await readDir(r))(await stat(join(r,e))).isDirectory()&&a.set(e,await readFile(getPrefabConfigPath(t,e)));isPrefabProject(e)&&a.set("__self__",await readFile(`${t}/src/main/webapp/config.json`)),i(a)}),()=>Promise.resolve(a))};module.exports={getWmProjectProperties:getWmProjectProperties,getThemesConfigProperties:getThemesConfigProperties,getSecurityConfig:getSecurityConfig,getLayoutsConfig:getLayoutsConfig,getPagesConfig:getPagesConfig,getPrefabConfigsUsedInApp:getPrefabConfigsUsedInApp,getPrefabPartialsConfig:getPrefabPartialsConfig};
@@ -1 +1 @@
1
- const cheerio=require("cheerio"),{writeFile:writeFile,readFileSync:readFileSync,readDir:readDir,isMobileProject:isMobileProject}=require("./wm-utils"),markScriptsAsLazy=e=>{const s=["./node_modules/d3/d3.min.js","./node_modules/@wavemaker.com/nvd3/build/nv.d3.min.js","./node_modules/fullcalendar/main.min.js","./node_modules/summernote/dist/summernote-lite.min.js",global._WM_PACKAGE_PATH+"/scripts/datatable/datatable.js","./node_modules/jquery-ui/ui/widgets/sortable.js","./node_modules/jquery-ui/ui/widgets/droppable.js","./node_modules/jquery-ui/ui/widgets/resizable.js","./node_modules/hammerjs/hammer.min.js","./node_modules/iscroll/build/iscroll.js"];let t=e.replace(/^(\.\/)/,"").replace(/\//g,"-");return t=t.substring(0,t.lastIndexOf(".")),t+="-NOHASH",s.includes(e)?{input:e,inject:!1,bundleName:t}:e},setBuildCustomizations=async e=>{const s=e.projects["angular-app"].architect.build,t=s.options.scripts;s.options.scripts=t.map(e=>markScriptsAsLazy(e))},addToScripts=async(e,s,t=[],i=[])=>{const n=`${s}/angular.json`;let o=readFileSync(n,!0);const a=o.projects["angular-app"].architect.build;let r=a.options.scripts;const l=`${s+"/src/app/extensions"}`,c=await readDir(l);c.length&&i.push("./src/app/extensions/"+c[0]),a.options.scripts=[...t,...r,...i],await writeFile(n,JSON.stringify(o,null,4))},updateAngularJSON=async(e,s,t,i,n,o,a,r,l)=>{const c=`${s}/angular.json`;let d=readFileSync(c,!0);const u=d.projects["angular-app"].architect.build;o&&o.trim().length>0&&(u.options.deployUrl=o);const p=u.options.styles;if(isMobileProject(t)){const e=p.findIndex(e=>{let s="object"==typeof e;if(s){return(s?e.input:e).includes("themes")}return!1}),s=p[e].input;p[e].bundleName="wm-android-styles",p[e].input=p[e].input.replace(new RegExp("/[a-z]*/style.css$"),`/${t.activeTheme}/android/style.css`);const i=Object.assign({},p[e]);i.input=s.replace(new RegExp("/[a-z]*/style.css$"),`/${t.activeTheme}/ios/style.css`),i.bundleName="wm-ios-styles",p.push(i);const n=p.findIndex(e=>{let s="object"==typeof e;if(s){return"src/assets/app.css"===(s?e.input:e)}return!1});p[n].bundleName="wm-android-styles";const o=Object.assign({},p[n]);o.bundleName="wm-ios-styles",p.push(o)}p.forEach((e,s)=>{let i="object"==typeof e,n=i?e.input:e;!n.includes("themes")||n.includes("/android/")||n.includes("/ios/")||(i?p[s].input=n.replace(new RegExp("/[a-z]*/style.css$"),`/${t.activeTheme}/style.css`):p[s]=n.replace(new RegExp("/[a-z]*/style.css$"),`/${t.activeTheme}/style.css`))}),await setBuildCustomizations(d);const m=u.configurations.production;if(m.aot=!1!==a.aot,m.buildOptimizer=!1!==a.buildOptimizer,l){const e=u.options.assets;e.push("src/manifest.json"),e.push("src/wmsw-worker.js"),m.serviceWorker=!0,m.ngswConfigPath="ngsw-config.json",delete u.options.customWebpackConfig}await writeFile(c,JSON.stringify(d,null,4))};module.exports={updateAngularJSON:updateAngularJSON,addToScripts:addToScripts};
1
+ const cheerio=require("cheerio"),{writeFile:writeFile,readFileSync:readFileSync,readDir:readDir,isMobileProject:isMobileProject}=require("./wm-utils"),markScriptsAsLazy=e=>{const s=["./node_modules/d3/d3.min.js","./node_modules/@wavemaker.com/nvd3/build/nv.d3.min.js","./node_modules/fullcalendar/main.min.js","./node_modules/summernote/dist/summernote-lite.min.js",global._WM_PACKAGE_PATH+"/scripts/datatable/datatable.js","./node_modules/jquery-ui/ui/widgets/sortable.js","./node_modules/jquery-ui/ui/widgets/droppable.js","./node_modules/jquery-ui/ui/widgets/resizable.js","./node_modules/hammerjs/hammer.min.js","./node_modules/iscroll/build/iscroll.js"];let t=e.replace(/^(\.\/)/,"").replace(/\//g,"-");return t=t.substring(0,t.lastIndexOf(".")),t+="-NOHASH",s.includes(e)?{input:e,inject:!1,bundleName:t}:e},setBuildCustomizations=async e=>{const s=e.projects["angular-app"].architect.build,t=s.options.scripts;s.options.scripts=t.map(e=>markScriptsAsLazy(e))},addToScripts=async(e,s,t=[],i=[])=>{const n=`${s}/angular.json`;let o=readFileSync(n,!0);const a=o.projects["angular-app"].architect.build;let r=a.options.scripts;const l=`${s+"/src/app/extensions"}`,c=await readDir(l);c.length&&i.push("./src/app/extensions/"+c[0]),a.options.scripts=[...t,...r,...i],await writeFile(n,JSON.stringify(o,null,4))},updateAngularJSON=async(e,s,t,i,n,o,a,r,l,c)=>{const d=`${s}/angular.json`;let u=readFileSync(d,!0);const p=u.projects["angular-app"].architect.build;a&&a.trim().length>0&&(p.options.deployUrl=a);const m=p.options.styles;if(isMobileProject(t)){const e=m.findIndex(e=>{let s="object"==typeof e;if(s){return(s?e.input:e).includes("themes")}return!1}),s=m[e].input;m[e].bundleName="wm-android-styles",m[e].input=m[e].input.replace(new RegExp("/[a-z]*/style.css$"),`/${i.activeTheme}/android/style.css`);const t=Object.assign({},m[e]);t.input=s.replace(new RegExp("/[a-z]*/style.css$"),`/${i.activeTheme}/ios/style.css`),t.bundleName="wm-ios-styles",m.push(t);const n=m.findIndex(e=>{let s="object"==typeof e;if(s){return"src/assets/app.css"===(s?e.input:e)}return!1});m[n].bundleName="wm-android-styles";const o=Object.assign({},m[n]);o.bundleName="wm-ios-styles",m.push(o)}m.forEach((e,s)=>{let t="object"==typeof e,n=t?e.input:e;!n.includes("themes")||n.includes("/android/")||n.includes("/ios/")||(t?m[s].input=n.replace(new RegExp("/[a-z]*/style.css$"),`/${i.activeTheme}/style.css`):m[s]=n.replace(new RegExp("/[a-z]*/style.css$"),`/${i.activeTheme}/style.css`))}),await setBuildCustomizations(u);const j=p.configurations.production;if(j.aot=!1!==r.aot,j.buildOptimizer=!1!==r.buildOptimizer,c){const e=p.options.assets;e.push("src/manifest.json"),e.push("src/wmsw-worker.js"),j.serviceWorker=!0,j.ngswConfigPath="ngsw-config.json",delete p.options.customWebpackConfig}await writeFile(d,JSON.stringify(u,null,4))};module.exports={updateAngularJSON:updateAngularJSON,addToScripts:addToScripts};
@@ -1 +1 @@
1
- const util=require("util"),fs=require("fs"),rimraf=require("rimraf"),decodeUriComponent=require("decode-uri-component"),upperFirst=require("lodash/upperFirst"),tar=require("tar-fs"),prettier=require("prettier"),js_beautify=require("js-beautify"),html_beautify=require("js-beautify").html,path=require("path"),stat=util.promisify(fs.stat),createDir=util.promisify(fs.mkdir),createReadStream=util.promisify(fs.createReadStream),readFile=util.promisify(fs.readFile),writeFile=util.promisify(fs.writeFile),readDir=util.promisify(fs.readdir),rename=util.promisify(fs.rename),searchFileByName=(e,t,r)=>{if(!fs.existsSync(e))return;fs.readdirSync(e).forEach(a=>{const i=path.join(e,a);fs.lstatSync(i).isDirectory()?searchFileByName(i,t,r):t.test(i)&&r(i)})},deleteResource=async e=>stat(e).then(()=>new Promise((t,r)=>{rimraf(e,()=>t())}),()=>Promise.resolve()),getComponentName=e=>`${upperFirst(e)}Component`,getComponentModuleName=e=>`${upperFirst(e)}Module`,decodeURIComponent=e=>decodeUriComponent(e.replace(/\+/g," ")),createTar=(e,t)=>new Promise((r,a)=>{tar.pack(e).pipe(fs.createWriteStream(t)).on("finish",r)}),extractTar=(e,t)=>new Promise((r,a)=>{fs.createReadStream(e).pipe(tar.extract(t)).on("finish",r)}),getWebAppPath=e=>`${e}/src/main/webapp`,getLayoutsConfigPath=e=>`${getWebAppPath(e)}/layouts/layouts-config.json`,getLayoutsDirPath=e=>`${getWebAppPath(e)}/layouts`,getPagesDirPath=e=>`${getWebAppPath(e)}/pages`,getPagesConfigPath=e=>`${getWebAppPath(e)}/pages/pages-config.json`,getPrefabsDirPath=e=>`${getWebAppPath(e)}/WEB-INF/prefabs`,getPrefabConfigPath=(e,t)=>`${getPrefabsDirPath(e)}/${t}/webapp/config.json`,getPrefabPagesDirPath=(e,t)=>`${getPrefabsDirPath(e)}/${t}/webapp/pages`,getSecurityConfigPath=e=>`${e}/services/securityService/designtime/intercept-urls.json`,getRolesConfigPath=e=>`${e}/services/securityService/designtime/roles.json`,getAuthInfoFilePath=e=>`${e}/services/securityService/designtime/auth-info.json`,getAppJsFilePath=e=>`${getWebAppPath(e)}/app.js`,getAppVariablesFilePath=e=>`${getWebAppPath(e)}/app.variables.json`,getWmProjectPropertiesFilePath=e=>`${e}/.wmproject.properties`,getIndexHtmlPath=e=>`${getWebAppPath(e)}/index.html`;let codegenPath="./node_modules/@wavemaker/angular-codegen";const setCodegenPath=e=>{e&&(codegenPath=e)},getCodegenPath=()=>codegenPath,formatContents=(e="",t)=>"javascript"===t?js_beautify(e,{}):prettier.format(e,{semi:!1,parser:"typescript",tabWidth:4}),formatMarkup=(e="")=>html_beautify(e),isMobileProject=e=>"MOBILE"===e.platformType,isPrefabProject=e=>"PREFAB"===e.type,readFileSync=(e,t)=>{let r=fs.readFileSync(e);return t?JSON.parse(r):r},initExpressionParser=()=>{const e=require("../dependencies/expression-parser.cjs"),t=require("../dependencies/pipe-provider.cjs");e.setPipeProvider(new t.PipeProvider({},{get:()=>{}},{}))};module.exports={stat:stat,createDir:createDir,createReadStream:createReadStream,readFile:readFile,writeFile:writeFile,deleteResource:deleteResource,getComponentName:getComponentName,getComponentModuleName:getComponentModuleName,decodeURIComponent:decodeURIComponent,createTar:createTar,extractTar:extractTar,readDir:readDir,rename:rename,searchFileByName:searchFileByName,getWebAppPath:getWebAppPath,getLayoutsConfigPath:getLayoutsConfigPath,getLayoutsDirPath:getLayoutsDirPath,getPagesDirPath:getPagesDirPath,getPagesConfigPath:getPagesConfigPath,getPrefabsDirPath:getPrefabsDirPath,getPrefabConfigPath:getPrefabConfigPath,getPrefabPagesDirPath:getPrefabPagesDirPath,getSecurityConfigPath:getSecurityConfigPath,getRolesConfigPath:getRolesConfigPath,getAuthInfoFilePath:getAuthInfoFilePath,getAppJsFilePath:getAppJsFilePath,getAppVariablesFilePath:getAppVariablesFilePath,getWmProjectPropertiesFilePath:getWmProjectPropertiesFilePath,getIndexHtmlPath:getIndexHtmlPath,formatContents:formatContents,formatMarkup:formatMarkup,isMobileProject:isMobileProject,isPrefabProject:isPrefabProject,readFileSync:readFileSync,getCodegenPath:getCodegenPath,setCodegenPath:setCodegenPath,initExpressionParser:initExpressionParser};
1
+ const util=require("util"),fs=require("fs"),rimraf=require("rimraf"),decodeUriComponent=require("decode-uri-component"),upperFirst=require("lodash/upperFirst"),tar=require("tar-fs"),prettier=require("prettier"),js_beautify=require("js-beautify"),html_beautify=require("js-beautify").html,path=require("path"),stat=util.promisify(fs.stat),createDir=util.promisify(fs.mkdir),createReadStream=util.promisify(fs.createReadStream),readFile=util.promisify(fs.readFile),writeFile=util.promisify(fs.writeFile),readDir=util.promisify(fs.readdir),rename=util.promisify(fs.rename),searchFileByName=(e,t,r)=>{if(!fs.existsSync(e))return;fs.readdirSync(e).forEach(a=>{const i=path.join(e,a);fs.lstatSync(i).isDirectory()?searchFileByName(i,t,r):t.test(i)&&r(i)})},deleteResource=async e=>stat(e).then(()=>new Promise((t,r)=>{rimraf(e,()=>t())}),()=>Promise.resolve()),getComponentName=e=>`${upperFirst(e)}Component`,getComponentModuleName=e=>`${upperFirst(e)}Module`,decodeURIComponent=e=>decodeUriComponent(e.replace(/\+/g," ")),createTar=(e,t)=>new Promise((r,a)=>{tar.pack(e).pipe(fs.createWriteStream(t)).on("finish",r)}),extractTar=(e,t)=>new Promise((r,a)=>{fs.createReadStream(e).pipe(tar.extract(t)).on("finish",r)}),getWebAppPath=e=>`${e}/src/main/webapp`,getLayoutsConfigPath=e=>`${getWebAppPath(e)}/layouts/layouts-config.json`,getLayoutsDirPath=e=>`${getWebAppPath(e)}/layouts`,getPagesDirPath=e=>`${getWebAppPath(e)}/pages`,getPagesConfigPath=e=>`${getWebAppPath(e)}/pages/pages-config.json`,getPrefabsDirPath=e=>`${getWebAppPath(e)}/WEB-INF/prefabs`,getPrefabConfigPath=(e,t)=>`${getPrefabsDirPath(e)}/${t}/webapp/config.json`,getPrefabPagesDirPath=(e,t)=>`${getPrefabsDirPath(e)}/${t}/webapp/pages`,getSecurityConfigPath=e=>`${e}/services/securityService/designtime/intercept-urls.json`,getRolesConfigPath=e=>`${e}/services/securityService/designtime/roles.json`,getAuthInfoFilePath=e=>`${e}/services/securityService/designtime/auth-info.json`,getAppJsFilePath=e=>`${getWebAppPath(e)}/app.js`,getAppVariablesFilePath=e=>`${getWebAppPath(e)}/app.variables.json`,getThemesConfigPropertiesFilePath=e=>`${getWebAppPath(e)}/themes/themes-config.json`,getWmProjectPropertiesFilePath=e=>`${e}/.wmproject.properties`,getIndexHtmlPath=e=>`${getWebAppPath(e)}/index.html`;let codegenPath="./node_modules/@wavemaker/angular-codegen";const setCodegenPath=e=>{e&&(codegenPath=e)},getCodegenPath=()=>codegenPath,formatContents=(e="",t)=>"javascript"===t?js_beautify(e,{}):prettier.format(e,{semi:!1,parser:"typescript",tabWidth:4}),formatMarkup=(e="")=>html_beautify(e),isMobileProject=e=>"MOBILE"===e.platformType,isPrefabProject=e=>"PREFAB"===e.type,readFileSync=(e,t)=>{let r=fs.readFileSync(e);return t?JSON.parse(r):r},initExpressionParser=()=>{const e=require("../dependencies/expression-parser.cjs"),t=require("../dependencies/pipe-provider.cjs");e.setPipeProvider(new t.PipeProvider({},{get:()=>{}},{}))};module.exports={stat:stat,createDir:createDir,createReadStream:createReadStream,readFile:readFile,writeFile:writeFile,deleteResource:deleteResource,getComponentName:getComponentName,getComponentModuleName:getComponentModuleName,decodeURIComponent:decodeURIComponent,createTar:createTar,extractTar:extractTar,readDir:readDir,rename:rename,searchFileByName:searchFileByName,getWebAppPath:getWebAppPath,getLayoutsConfigPath:getLayoutsConfigPath,getLayoutsDirPath:getLayoutsDirPath,getPagesDirPath:getPagesDirPath,getPagesConfigPath:getPagesConfigPath,getPrefabsDirPath:getPrefabsDirPath,getPrefabConfigPath:getPrefabConfigPath,getPrefabPagesDirPath:getPrefabPagesDirPath,getSecurityConfigPath:getSecurityConfigPath,getRolesConfigPath:getRolesConfigPath,getAuthInfoFilePath:getAuthInfoFilePath,getAppJsFilePath:getAppJsFilePath,getAppVariablesFilePath:getAppVariablesFilePath,getWmProjectPropertiesFilePath:getWmProjectPropertiesFilePath,getThemesConfigPropertiesFilePath:getThemesConfigPropertiesFilePath,getIndexHtmlPath:getIndexHtmlPath,formatContents:formatContents,formatMarkup:formatMarkup,isMobileProject:isMobileProject,isPrefabProject:isPrefabProject,readFileSync:readFileSync,getCodegenPath:getCodegenPath,setCodegenPath:setCodegenPath,initExpressionParser:initExpressionParser};