@wavemaker/angular-codegen 12.0.0-next.1417157 → 12.0.0-next.1417163

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.
@@ -28,6 +28,7 @@
28
28
  "tsConfig": "src/tsconfig.app.json",
29
29
  "assets": [
30
30
  "src/favicon.ico",
31
+ "src/favicon.png",
31
32
  "src/assets",
32
33
  {
33
34
  "glob": "print.css",
@@ -193,6 +194,7 @@
193
194
  "tsConfig": "src/tsconfig.app.json",
194
195
  "assets": [
195
196
  "src/favicon.ico",
197
+ "src/favicon.png",
196
198
  "src/assets",
197
199
  {
198
200
  "glob": "print.css",
@@ -294,6 +294,8 @@ const generateSha1 = (content) => {
294
294
 
295
295
  //this is required to download all the assets
296
296
  $('head').append(`<meta name="deployUrl" content=${deployUrl} />`);
297
+ $('script[src$="services/application/wmProperties.js"]').remove();
298
+ $('link[href$="favicon.png"]').attr('href', './ng-bundle/favicon.png');
297
299
 
298
300
  const htmlContent = $.html();
299
301
  await writeFile(`./dist/index.html`, htmlContent);
@@ -36,7 +36,7 @@
36
36
  "@metrichor/jmespath": "0.3.1",
37
37
  "@wavemaker/focus-trap": "1.0.1",
38
38
  "@wavemaker/nvd3": "1.8.12",
39
- "@wavemaker/variables": "12.0.0-next.1417157",
39
+ "@wavemaker/variables": "12.0.0-next.1417163",
40
40
  "@ztree/ztree_v3": "3.5.48",
41
41
  "angular-imask": "^7.6.1",
42
42
  "angular2-websocket": "0.9.7",
@@ -7577,9 +7577,9 @@
7577
7577
  }
7578
7578
  },
7579
7579
  "node_modules/@wavemaker/variables": {
7580
- "version": "12.0.0-next.1417157",
7581
- "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-12.0.0-next.1417157.tgz",
7582
- "integrity": "sha512-nEQbJQJhXhHdcUOz5c9ew+Qj6TquoVPtUn12Trpm/ZJcsq7I4cKEwGnpalXKLK2ZL5sXe3kXT+rx6mMZ5zCQzg==",
7580
+ "version": "12.0.0-next.1417163",
7581
+ "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-12.0.0-next.1417163.tgz",
7582
+ "integrity": "sha512-tpft6hqpFmj+kd9JKYt9+YWPjdVip0vIpgM5i5imQvDTgAqleuFmtsdVSRdVsXgdFm68tQMiXr68dHyTOy2LWQ==",
7583
7583
  "dependencies": {
7584
7584
  "@metrichor/jmespath": "^0.3.1",
7585
7585
  "he": "^1.2.0",
@@ -45,7 +45,7 @@
45
45
  "@metrichor/jmespath": "0.3.1",
46
46
  "@wavemaker/focus-trap": "1.0.1",
47
47
  "@wavemaker/nvd3": "1.8.12",
48
- "@wavemaker/variables": "12.0.0-next.1417157",
48
+ "@wavemaker/variables": "12.0.0-next.1417163",
49
49
  "@ztree/ztree_v3": "3.5.48",
50
50
  "angular-imask": "^7.6.1",
51
51
  "angular2-websocket": "0.9.7",
@@ -70,7 +70,7 @@
70
70
  "tslib": "2.4.1",
71
71
  "x2js": "3.4.4",
72
72
  "zone.js": "0.14.7",
73
- "@wavemaker/app-ng-runtime": "12.0.0-next.1417157"
73
+ "@wavemaker/app-ng-runtime": "12.0.0-next.1417163"
74
74
  },
75
75
  "devDependencies": {
76
76
  "@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
@@ -39,41 +39,9 @@ let formatAcceptHeader = (languages: any) => {
39
39
  return result.join(',');
40
40
  }
41
41
  WMAppProperties['preferredLanguage'] = formatAcceptHeader(navigator.languages);
42
- WMAppProperties[fontConfig] = fontConfig;
42
+ WMAppProperties['fontConfig'] = fontConfig;
43
43
 
44
44
 
45
- let formatAcceptHeader = (languages: any) => {
46
- let result: string[] = [];
47
- let addedLanguages = new Set<string>(); // To track already added languages
48
- let qValue = 1.0;
49
-
50
- languages.forEach((lang: any) => {
51
- if (!addedLanguages.has(lang)) {
52
- // Add the full language (e.g., en-US or en) if not already added
53
- result.push(`${lang}${qValue === 1.0 ? '' : `;q=${qValue.toFixed(1)}`}`);
54
- addedLanguages.add(lang);
55
- // Decrease qValue for the next language
56
- qValue = Math.max(0.1, qValue - 0.1); // Decrease qValue, minimum is 0.1
57
- }
58
-
59
- // If language has a region code (e.g., en-US), also add the base language (e.g., en)
60
- if (lang.includes('-')) {
61
- const baseLang = lang.split('-')[0];
62
- if (!addedLanguages.has(baseLang)) {
63
- result.push(`${baseLang};q=${qValue.toFixed(1)}`);
64
- addedLanguages.add(baseLang);
65
-
66
- // Decrease qValue for the next language
67
- qValue = Math.max(0.1, qValue - 0.1);
68
- }
69
- }
70
- });
71
-
72
- return result.join(',');
73
- }
74
-
75
- WMAppProperties['preferredLanguage'] = formatAcceptHeader(navigator.languages);
76
-
77
45
  (window as any)._WM_APP_PROPERTIES = WMAppProperties
78
46
  initWmProjectProperties();
79
47
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "12.0.0-next.1417157",
3
+ "version": "12.0.0-next.1417163",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -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 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};
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"];if("string"==typeof e){let t=e.replace(/^(\.\/)/,"").replace(/\//g,"-").replace(/@/g,"");if(t=t.substring(0,t.lastIndexOf(".")),t+="-NOHASH",s.includes(e))return{input:e,inject:!1,bundleName:t}}return 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 r=o.projects["angular-app"].architect.build;let a=r.options.scripts;const l=`${s+"/src/app/extensions"}`,c=await readDir(l);c.length&&i.push("./src/app/extensions/"+c[0]),r.options.scripts=[...t,...a,...i],await writeFile(n,JSON.stringify(o,null,4))},updateAngularJSON=async(e,s,t,i,n,o,r,a,l,c)=>{const d=`${s}/angular.json`;let u=readFileSync(d,!0);const p=u.projects["angular-app"].architect.build;r&&r.trim().length>0&&(p.options.deployUrl=r);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!==a.aot,g.buildOptimizer=!1!==a.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};