@wavemaker/angular-codegen 12.0.0-next.45032 → 12.0.0-next.45501
Sign up to get free protection for your applications and to get access to all the features.
- angular-codegen/angular-app/angular.json +0 -2
- angular-codegen/angular-app/build-scripts/update-version.js +24 -0
- angular-codegen/angular-app/package-lock.json +394 -4111
- angular-codegen/angular-app/package.json +8 -11
- angular-codegen/angular-app/src/setup-jest.js +1 -0
- angular-codegen/angular-app/tsconfig.json +0 -3
- angular-codegen/dependencies/pipe-provider.cjs.js +12028 -8
- angular-codegen/dependencies/transpilation-mobile.cjs.js +1174 -465
- angular-codegen/dependencies/transpilation-web.cjs.js +6419 -465
- angular-codegen/package-lock.json +1 -1
- angular-codegen/package.json +2 -2
- angular-codegen/src/gen-index-html.js +1 -1
- angular-codegen/src/update-angular-json.js +1 -1
angular-codegen/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@wavemaker/angular-codegen",
|
3
|
-
"version": "12.0.0-next.
|
3
|
+
"version": "12.0.0-next.45501",
|
4
4
|
"description": "",
|
5
5
|
"main": "index.js",
|
6
6
|
"scripts": {
|
@@ -11,7 +11,7 @@
|
|
11
11
|
"author": "",
|
12
12
|
"license": "ISC",
|
13
13
|
"dependencies": {
|
14
|
-
"cheerio": "
|
14
|
+
"cheerio": "1.0.0-rc.12",
|
15
15
|
"decode-uri-component": "^0.2.0",
|
16
16
|
"express": "^4.16.4",
|
17
17
|
"fast-xml-parser": "^3.19.0",
|
@@ -1 +1 @@
|
|
1
|
-
const{getIndexHtmlPath:getIndexHtmlPath,readFile:readFile,writeFile:writeFile,isMobileProject:isMobileProject,createDir:createDir}=require("./wm-utils"),{addToScripts:addToScripts}=require("./update-angular-json"),cheerio=require("cheerio"),prettier=require("prettier"),isResourceJS=e=>/^resources\/./.test(e),generateIndexHtml=async(e,r,t,i,s)=>{const n=await readFile(getIndexHtmlPath(e),"utf8"),o=cheerio.load(n);let a=[],c=[],l=!1,m=0,p=[];const d=["application/ld+json"];await createDir(r+"/resources/wm-inline",{recursive:!0}),o("script").each((e,r)=>{p.push(r)});for(const e of p){let t=o(e).attr("src");if(t)!l&&t.includes("wm-libs.min.js")&&(l=!0),isResourceJS(t)&&(l?c.push(t):a.push(t),o(e).remove());else if(!d.includes(o(e).attr("type"))){t=`resources/wm-inline/wm-inline-${++m}.js`;try{await writeFile(`${r}/${t}`,o(e).html()),l?c.push(t):a.push(t),o(e).remove()}catch(e){console.log(`WM-CODEGEN | Error in inline script generation | ${e}`)}}}await addToScripts(e,r,a,c),o('script[src$="/wm-loader.min.js"]').remove(),o('script[src$="/wm-libs.min.js"]').remove(),o('script[src$="/wm-mobileloader.min.js"]').remove(),o("body").append(o('script[src$="/wmProperties.js"]'));const h=o('meta[name="description"]');h.attr("content")||h.attr("content","App built on wavemaker"),i&&i.endsWith("/")&&(i=i.substr(0,i.length-1)),isMobileProject(t)&&o("body").append(o('script[src="cordova.js"]')),o('link[href$="/wm-style.css"]').remove(),o('link[href="print.css"]').remove(),o('link[theme="wmtheme"]').remove(),o('link[href$="wm-responsive.css"]').remove(),o('link[href^="themes"][href$="style.css"]').remove(),o('link[href="app.css"]').remove(),o(
|
1
|
+
const{getIndexHtmlPath:getIndexHtmlPath,readFile:readFile,writeFile:writeFile,isMobileProject:isMobileProject,createDir:createDir}=require("./wm-utils"),{addToScripts:addToScripts}=require("./update-angular-json"),cheerio=require("cheerio"),prettier=require("prettier"),isResourceJS=e=>/^resources\/./.test(e),generateIndexHtml=async(e,r,t,i,s)=>{const n=await readFile(getIndexHtmlPath(e),"utf8"),o=cheerio.load(n);let a=[],c=[],l=!1,m=0,p=[];const d=["application/ld+json"];await createDir(r+"/resources/wm-inline",{recursive:!0}),o("script").each((e,r)=>{p.push(r)});for(const e of p){let t=o(e).attr("src");if(t)!l&&t.includes("wm-libs.min.js")&&(l=!0),isResourceJS(t)&&(l?c.push(t):a.push(t),o(e).remove());else if(!d.includes(o(e).attr("type"))){t=`resources/wm-inline/wm-inline-${++m}.js`;try{await writeFile(`${r}/${t}`,o(e).html()),l?c.push(t):a.push(t),o(e).remove()}catch(e){console.log(`WM-CODEGEN | Error in inline script generation | ${e}`)}}}await addToScripts(e,r,a,c),o('script[src$="/wm-loader.min.js"]').remove(),o('script[src$="/wm-libs.min.js"]').remove(),o('script[src$="/wm-mobileloader.min.js"]').remove(),o("body").append(o('script[src$="/wmProperties.js"]'));const h=o('meta[name="description"]');h.attr("content")||h.attr("content","App built on wavemaker"),i&&i.endsWith("/")&&(i=i.substr(0,i.length-1)),isMobileProject(t)&&o("body").append(o('script[src="cordova.js"]')),o('link[href$="/wm-style.css"]').remove(),o('link[href="print.css"]').remove(),o('link[theme="wmtheme"]').remove(),o('link[href$="wm-responsive.css"]').remove(),o('link[href^="themes"][href$="style.css"]').remove(),o('link[href="app.css"]').remove(),o("*").contents().each(function(){8===this.nodeType&&o(this).remove()});process.env.APPMETRICS_ENABLED,process.env.APPMETRICS_SERVER_URL;i?o('meta[name="cdnUrl"]').attr("content",i+"/"):o('meta[name="cdnUrl"]').remove(),o('link[href^="favicon."]').attr("rel","icon"),s&&(o("head").append('<meta name="theme-color" content="#2c3049" />'),o("head").append('<link rel="manifest" href="manifest.json">'),o("head").append('<link rel="apple-touch-icon" href="ng-bundle/assets/icons/icon-192x192.png">')),await writeFile(`${r}/src/index.html`,prettier.format(o.html(),{htmlWhitespaceSensitivity:"ignore",parser:"html",tabWidth:4}))};module.exports={generateIndexHtml:generateIndexHtml};
|
@@ -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/dist/d3.min.js","./node_modules/@wavemaker/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,"-").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
|
1
|
+
const cheerio=require("cheerio"),{writeFile:writeFile,readFileSync:readFileSync,readDir:readDir,isMobileProject:isMobileProject}=require("./wm-utils"),markScriptsAsLazy=e=>{const s=["./node_modules/d3/dist/d3.min.js","./node_modules/@wavemaker/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,"-").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 g=p.configurations.production;if(g.aot=!1!==r.aot,g.buildOptimizer=!1!==r.buildOptimizer,c){const e=p.options.assets;e.push("src/manifest.json"),e.push("src/wmsw-worker.js"),g.serviceWorker=!0,g.ngswConfigPath="ngsw-config.json",delete p.options.customWebpackConfig}await writeFile(d,JSON.stringify(u,null,4))};module.exports={updateAngularJSON:updateAngularJSON,addToScripts:addToScripts};
|