@wavemaker/angular-codegen 11.4.0-next.140413 → 11.4.0-next.140415

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.
@@ -5960,9 +5960,9 @@
5960
5960
  }
5961
5961
  },
5962
5962
  "@wavemaker/variables": {
5963
- "version": "11.4.0-next.140413",
5964
- "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.4.0-next.140413.tgz",
5965
- "integrity": "sha512-k4Px298ZHMCHKG5bUkcDRTWRFlMjLt5oytAWTaQXvspHczqQT6Ps2V89MFg2x8/oL8TdxQDJKa7/Q0TFiKhJaQ==",
5963
+ "version": "11.4.0-next.140415",
5964
+ "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.4.0-next.140415.tgz",
5965
+ "integrity": "sha512-GfCVzEezqtzO9Zfv0egvGHATGN7dq9Ph1yZ2CLyubgsZopTrN2P8d84BWBAQw7vktVm+rPTHvg9FG1ciy/Gvmg==",
5966
5966
  "requires": {
5967
5967
  "@metrichor/jmespath": "^0.3.1",
5968
5968
  "he": "^1.2.0",
@@ -6181,9 +6181,9 @@
6181
6181
  }
6182
6182
  },
6183
6183
  "@xmldom/xmldom": {
6184
- "version": "0.8.8",
6185
- "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.8.tgz",
6186
- "integrity": "sha512-0LNz4EY8B/8xXY86wMrQ4tz6zEHZv9ehFMJPm8u2gq5lQ71cfRKdaKyxfJAx5aUoyzx0qzgURblTisPGgz3d+Q=="
6184
+ "version": "0.8.9",
6185
+ "resolved": "https://registry.npmjs.org/@xmldom/xmldom/-/xmldom-0.8.9.tgz",
6186
+ "integrity": "sha512-4VSbbcMoxc4KLjb1gs96SRmi7w4h1SF+fCoiK0XaQX62buCc1G5d0DC5bJ9xJBNPDSVCmIrcl8BiYxzjrqaaJA=="
6187
6187
  },
6188
6188
  "@xtuc/ieee754": {
6189
6189
  "version": "1.2.0",
@@ -20386,9 +20386,9 @@
20386
20386
  "dev": true
20387
20387
  },
20388
20388
  "tabbable": {
20389
- "version": "6.2.0",
20390
- "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.2.0.tgz",
20391
- "integrity": "sha512-Cat63mxsVJlzYvN51JmVXIgNoUokrIaT2zLclCXjRd8boZ0004U4KCs/sToJ75C6sdlByWxpYnb5Boif1VSFew=="
20389
+ "version": "6.1.2",
20390
+ "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.1.2.tgz",
20391
+ "integrity": "sha512-qCN98uP7i9z0fIS4amQ5zbGBOq+OSigYeGvPy7NDk8Y9yncqDZ9pRPgfsc2PJIVM9RrJj7GIfuRgmjoUU9zTHQ=="
20392
20392
  },
20393
20393
  "tapable": {
20394
20394
  "version": "2.2.1",
@@ -47,7 +47,7 @@
47
47
  "@metrichor/jmespath": "^0.3.1",
48
48
  "@wavemaker.com/nvd3": "1.0.0",
49
49
  "@wavemaker/focus-trap": "^1.0.0",
50
- "@wavemaker/variables": "11.4.0-next.140413",
50
+ "@wavemaker/variables": "11.4.0-next.140415",
51
51
  "angular-imask": "6.0.4",
52
52
  "angular2-websocket": "0.9.7",
53
53
  "core-js": "2.5.4",
@@ -71,7 +71,7 @@
71
71
  "tslib": "^2.0.0",
72
72
  "x2js": "3.2.6",
73
73
  "zone.js": "~0.11.4",
74
- "@wavemaker/app-ng-runtime": "11.4.0-next.140413"
74
+ "@wavemaker/app-ng-runtime": "11.4.0-next.140415"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@ampproject/rollup-plugin-closure-compiler": "0.8.5",
@@ -48022,7 +48022,13 @@ class PaginationService {
48022
48022
  fieldDefs = [];
48023
48023
  parent.gridOptions.setCurrentPage(1);
48024
48024
  }
48025
- let currentPage = parent.currentPage;
48025
+ let currentPage;
48026
+ if (parent.widgetType === 'wm-table') {
48027
+ currentPage = parent.gridOptions.showviewlessbutton && (parent.gridOptions.mode === 'viewless') ? parent.gridOptions.getCurrentPage() : parent.currentPage;
48028
+ }
48029
+ else {
48030
+ currentPage = parent.currentPage;
48031
+ }
48026
48032
  const dataNavigator = parent.dataNavigator;
48027
48033
  const pagesize = parent.pagesize;
48028
48034
  if (!isDefined$1(fieldDefs) || dataNavigator.isFirstPage()) {
@@ -44100,7 +44100,13 @@ class PaginationService {
44100
44100
  fieldDefs = [];
44101
44101
  parent.gridOptions.setCurrentPage(1);
44102
44102
  }
44103
- let currentPage = parent.currentPage;
44103
+ let currentPage;
44104
+ if (parent.widgetType === 'wm-table') {
44105
+ currentPage = parent.gridOptions.showviewlessbutton && (parent.gridOptions.mode === 'viewless') ? parent.gridOptions.getCurrentPage() : parent.currentPage;
44106
+ }
44107
+ else {
44108
+ currentPage = parent.currentPage;
44109
+ }
44104
44110
  const dataNavigator = parent.dataNavigator;
44105
44111
  const pagesize = parent.pagesize;
44106
44112
  if (!isDefined$1(fieldDefs) || dataNavigator.isFirstPage()) {
@@ -46057,7 +46063,7 @@ const registerFormField = (isFormField) => {
46057
46063
  const eventsTmpl = widgetType === FormWidgetType.UPLOAD ? '' : getEventsTemplate(attrs);
46058
46064
  const controlLayout = isMobileApp() ? 'col-xs-12' : 'col-sm-12';
46059
46065
  const isInList = pCounter === (parentList && parentList.get('parent_form_reference'));
46060
- attrs.set('__errormsg', formFieldErrorMsgId);
46066
+ attrs.set('__validationId', formFieldErrorMsgId);
46061
46067
  attrs.set('__widgetType', widgetType);
46062
46068
  attrs.delete('widget');
46063
46069
  shared.set('counter', counter);
@@ -44100,7 +44100,13 @@ class PaginationService {
44100
44100
  fieldDefs = [];
44101
44101
  parent.gridOptions.setCurrentPage(1);
44102
44102
  }
44103
- let currentPage = parent.currentPage;
44103
+ let currentPage;
44104
+ if (parent.widgetType === 'wm-table') {
44105
+ currentPage = parent.gridOptions.showviewlessbutton && (parent.gridOptions.mode === 'viewless') ? parent.gridOptions.getCurrentPage() : parent.currentPage;
44106
+ }
44107
+ else {
44108
+ currentPage = parent.currentPage;
44109
+ }
44104
44110
  const dataNavigator = parent.dataNavigator;
44105
44111
  const pagesize = parent.pagesize;
44106
44112
  if (!isDefined$1(fieldDefs) || dataNavigator.isFirstPage()) {
@@ -46057,7 +46063,7 @@ const registerFormField = (isFormField) => {
46057
46063
  const eventsTmpl = widgetType === FormWidgetType.UPLOAD ? '' : getEventsTemplate(attrs);
46058
46064
  const controlLayout = isMobileApp() ? 'col-xs-12' : 'col-sm-12';
46059
46065
  const isInList = pCounter === (parentList && parentList.get('parent_form_reference'));
46060
- attrs.set('__errormsg', formFieldErrorMsgId);
46066
+ attrs.set('__validationId', formFieldErrorMsgId);
46061
46067
  attrs.set('__widgetType', widgetType);
46062
46068
  attrs.delete('widget');
46063
46069
  shared.set('counter', counter);
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.4.0-next.140413",
3
+ "version": "11.4.0-next.140415",
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};