@wavemaker/angular-codegen 11.11.0-rc.6126 → 11.11.1-rc.6142

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);
@@ -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/27/2025, 9:23:34 AM</p>
72
+ <p class="timestamp">Generated on: 5/8/2025, 3:00:06 PM</p>
73
73
  </div>
74
74
 
75
75
  <div class="section">