@wavemaker/angular-app 11.11.0-rc.6124 → 11.11.1-rc.210

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.
@@ -7,33 +7,6 @@ const exec = util.promisify(require('child_process').exec);
7
7
  const cheerio = require(`cheerio`);
8
8
  const crypto = require(`crypto`);
9
9
 
10
- const generateHashForScripts = (updatedFilenames) => {
11
- //from angular 12(IVY), scripts array in angular json, doesn't allow `@` symbol in the name/value
12
- //so removed `@` from wavemaker.com in the file name and adding it back in the post-build.js file
13
- const scriptsMap = {};
14
- return new Promise(resolve => {
15
- fs.readdir(global.opPath, (err, items) => {
16
- const promises = items.map(i => {
17
- const nohashIndex = i.indexOf('-NOHASH.js');
18
- if (nohashIndex > 0) {
19
- const key = i.substring(0, nohashIndex);
20
- const filename = `${key}-NOHASH.js`;
21
- const updatedFilename = `${key}.js`
22
- scriptsMap[`${key}.js`] = updatedFilename;
23
- updatedFilenames[filename] = updatedFilename;
24
- return Promise.all([
25
- copyFile(`${global.opPath}/${filename}`, `${global.opPath}/${updatedFilename}`),
26
- // copyFile(`${opPath}/${key}-NOHASH.br.js`, `${opPath}/${key}.${hash}.br.js`),
27
- // copyFile(`${opPath}/${key}-NOHASH.gzip.js`, `${opPath}/${key}.${hash}.gzip.js`)
28
- ]);
29
- }
30
- });
31
- Promise.all(promises).then(() => {
32
- return writeFile(`${global.opPath}/path_mapping.json`, JSON.stringify(scriptsMap, null, 2));
33
- }).then(resolve);
34
- });
35
- });
36
- };
37
10
  let isProdBuild;
38
11
  let isDevBuild;
39
12
  let $;
@@ -145,10 +118,10 @@ const updatePwaAssets = (deployUrl, updatedFileNames, updatedFileHashes) => {
145
118
  deployUrl = deployUrl === "_cdnUrl_" ? 'ng-bundle/' : deployUrl;
146
119
 
147
120
  // copy service worker and its config to root directory
148
- fs.copyFileSync('./dist/ng-bundle/ngsw-worker.js', './dist/ngsw-worker.js');
149
- fs.copyFileSync('./dist/ng-bundle/wmsw-worker.js', './dist/wmsw-worker.js');
150
- fs.copyFileSync('./dist/ng-bundle/ngsw.json', ngswPath);
151
- fs.copyFileSync('./dist/ng-bundle/manifest.json', manifestPath);
121
+ fs.copyFileSync(`./dist/ng-bundle/${global.randomHash}/ngsw-worker.js`, './dist/ngsw-worker.js');
122
+ fs.copyFileSync(`./dist/ng-bundle/${global.randomHash}/wmsw-worker.js`, './dist/wmsw-worker.js');
123
+ fs.copyFileSync(`./dist/ng-bundle/${global.randomHash}/ngsw.json`, ngswPath);
124
+ fs.copyFileSync(`./dist/ng-bundle/${global.randomHash}/manifest.json`, manifestPath);
152
125
 
153
126
  // update the icons url in manifest.json
154
127
  const manifest = JSON.parse(fs.readFileSync(manifestPath).toString());
@@ -233,8 +206,6 @@ const generateSha1 = (content) => {
233
206
  const htmlContent = $.html();
234
207
  await writeFile(`./dist/index.html`, htmlContent);
235
208
 
236
- await generateHashForScripts(updatedFilenames);
237
-
238
209
  if (serviceWorkerEnabled) {
239
210
  // re-generate hash for index.html since its been modified
240
211
  updatedFileHashes['index.html'] = generateSha1(htmlContent);
@@ -161574,24 +161574,12 @@ let ScriptLoaderService$1 = class ScriptLoaderService {
161574
161574
  }
161575
161575
  load(...scripts) {
161576
161576
  if (scripts && scripts.length) {
161577
- return Promise.resolve()
161578
- .then(() => this.pathMappings || this.loadPathMappings())
161579
- .then(() => {
161580
- return Promise.all(scripts.map(s => {
161581
- return this.loadScript(s);
161582
- }));
161583
- });
161577
+ return Promise.all(scripts.map(s => {
161578
+ return this.loadScript(s);
161579
+ }));
161584
161580
  }
161585
161581
  return Promise.resolve();
161586
161582
  }
161587
- loadPathMappings() {
161588
- const path = (_WM_APP_PROJECT$1.cdnUrl || _WM_APP_PROJECT$1.ngDest) + 'path_mapping.json';
161589
- return this.http.get(path).toPromise().then((data) => {
161590
- this.pathMappings = data;
161591
- }, () => {
161592
- this.pathMappings = {};
161593
- });
161594
- }
161595
161583
  loadScript(name) {
161596
161584
  return new Promise((resolve, reject) => {
161597
161585
  if (this.scripts[name] && this.scripts[name].loaded) {
@@ -161608,8 +161596,7 @@ let ScriptLoaderService$1 = class ScriptLoaderService {
161608
161596
  let script = document.createElement('script');
161609
161597
  script.type = 'text/javascript';
161610
161598
  script.async = false;
161611
- let src = this.scripts[name].src;
161612
- src = this.pathMappings[src] || src;
161599
+ const src = this.scripts[name].src;
161613
161600
  if (src.startsWith("http")) {
161614
161601
  script.src = src;
161615
161602
  }
@@ -228795,24 +228782,12 @@ class ScriptLoaderService {
228795
228782
  }
228796
228783
  load(...scripts) {
228797
228784
  if (scripts && scripts.length) {
228798
- return Promise.resolve()
228799
- .then(() => this.pathMappings || this.loadPathMappings())
228800
- .then(() => {
228801
- return Promise.all(scripts.map(s => {
228802
- return this.loadScript(s);
228803
- }));
228804
- });
228785
+ return Promise.all(scripts.map(s => {
228786
+ return this.loadScript(s);
228787
+ }));
228805
228788
  }
228806
228789
  return Promise.resolve();
228807
228790
  }
228808
- loadPathMappings() {
228809
- const path = (_WM_APP_PROJECT.cdnUrl || _WM_APP_PROJECT.ngDest) + 'path_mapping.json';
228810
- return this.http.get(path).toPromise().then((data) => {
228811
- this.pathMappings = data;
228812
- }, () => {
228813
- this.pathMappings = {};
228814
- });
228815
- }
228816
228791
  loadScript(name) {
228817
228792
  return new Promise((resolve, reject) => {
228818
228793
  if (this.scripts[name] && this.scripts[name].loaded) {
@@ -228829,8 +228804,7 @@ class ScriptLoaderService {
228829
228804
  let script = document.createElement('script');
228830
228805
  script.type = 'text/javascript';
228831
228806
  script.async = false;
228832
- let src = this.scripts[name].src;
228833
- src = this.pathMappings[src] || src;
228807
+ const src = this.scripts[name].src;
228834
228808
  if (src.startsWith("http")) {
228835
228809
  script.src = src;
228836
228810
  }
@@ -113354,24 +113354,12 @@ class ScriptLoaderService {
113354
113354
  }
113355
113355
  load(...scripts) {
113356
113356
  if (scripts && scripts.length) {
113357
- return Promise.resolve()
113358
- .then(() => this.pathMappings || this.loadPathMappings())
113359
- .then(() => {
113360
- return Promise.all(scripts.map(s => {
113361
- return this.loadScript(s);
113362
- }));
113363
- });
113357
+ return Promise.all(scripts.map(s => {
113358
+ return this.loadScript(s);
113359
+ }));
113364
113360
  }
113365
113361
  return Promise.resolve();
113366
113362
  }
113367
- loadPathMappings() {
113368
- const path = (_WM_APP_PROJECT.cdnUrl || _WM_APP_PROJECT.ngDest) + 'path_mapping.json';
113369
- return this.http.get(path).toPromise().then((data) => {
113370
- this.pathMappings = data;
113371
- }, () => {
113372
- this.pathMappings = {};
113373
- });
113374
- }
113375
113363
  loadScript(name) {
113376
113364
  return new Promise((resolve, reject) => {
113377
113365
  if (this.scripts[name] && this.scripts[name].loaded) {
@@ -113388,8 +113376,7 @@ class ScriptLoaderService {
113388
113376
  let script = document.createElement('script');
113389
113377
  script.type = 'text/javascript';
113390
113378
  script.async = false;
113391
- let src = this.scripts[name].src;
113392
- src = this.pathMappings[src] || src;
113379
+ const src = this.scripts[name].src;
113393
113380
  if (src.startsWith("http")) {
113394
113381
  script.src = src;
113395
113382
  }
@@ -69,7 +69,7 @@
69
69
  <body>
70
70
  <div class="header">
71
71
  <h1>Angular Project Dependencies Report</h1>
72
- <p class="timestamp">Generated on: 4/25/2025, 10:18:21 AM</p>
72
+ <p class="timestamp">Generated on: 5/11/2025, 11:30:00 AM</p>
73
73
  </div>
74
74
 
75
75
  <div class="section">