@wavemaker/angular-codegen 11.10.1-rc.6054 → 11.10.2-rc.203

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,26 +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 copyCssFiles = (hash, updatedFilenames) => {
11
- const filename = 'wm-styles.css';
12
- const updatedFilename = `wm-styles.${hash}.css`
13
- copyFile(`${global.opPath}/${filename}`, `${global.opPath}/${updatedFilename}`);
14
- updatedFilenames[filename] = updatedFilename;
15
- // copyFile(`${opPath}/wm-styles.br.css`,`${opPath}/wm-styles.${hash}.br.css`);
16
- // copyFile(`${opPath}/wm-styles.gzip.css`,`${opPath}/wm-styles.${hash}.gzip.css`);
17
- };
18
- const copyMobileCssFiles = (hash, fileName) => {
19
- // const name = filePath.split('.css')[0];
20
- copyFile(`${global.opPath}/${fileName}.css`, `${global.opPath}/${fileName}.${hash}.css`);
21
- // copyFile(`${opPath}/wm-styles.br.css`,`${opPath}/wm-styles.${hash}.br.css`);
22
- // copyFile(`${opPath}/wm-styles.gzip.css`,`${opPath}/wm-styles.${hash}.gzip.css`);
23
- };
24
- const generateHash = async (filepath) => {
25
- const cssContent = await readFile(filepath);
26
- let hash = crypto.createHash('md5');
27
- hash.update(cssContent);
28
- return hash.digest('hex');
29
- };
30
10
  const generateHashForScripts = (updatedFilenames) => {
31
11
  //from angular 12(IVY), scripts array in angular json, doesn't allow `@` symbol in the name/value
32
12
  //so removed `@` from wavemaker.com in the file name and adding it back in the post-build.js file
@@ -37,17 +17,15 @@ const generateHashForScripts = (updatedFilenames) => {
37
17
  const nohashIndex = i.indexOf('-NOHASH.js');
38
18
  if (nohashIndex > 0) {
39
19
  const key = i.substring(0, nohashIndex);
40
- return generateHash(`${global.opPath}/${i}`).then(hash => {
41
- const filename = `${key}-NOHASH.js`;
42
- const updatedFilename = `${key}.${hash}.js`
43
- scriptsMap[`${key}.js`] = updatedFilename;
44
- updatedFilenames[filename] = updatedFilename;
45
- return Promise.all([
46
- copyFile(`${global.opPath}/${filename}`, `${global.opPath}/${updatedFilename}`),
47
- // copyFile(`${opPath}/${key}-NOHASH.br.js`, `${opPath}/${key}.${hash}.br.js`),
48
- // copyFile(`${opPath}/${key}-NOHASH.gzip.js`, `${opPath}/${key}.${hash}.gzip.js`)
49
- ]);
50
- });
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
+ ]);
51
29
  }
52
30
  });
53
31
  Promise.all(promises).then(() => {
@@ -81,15 +59,11 @@ const addMobileSpecificStyles = async (deployUrl) => {
81
59
  }
82
60
 
83
61
  if (isProdBuild) {
84
- let hash = await generateHash(`${global.opPath}/wm-android-styles.css`);
85
- copyMobileCssFiles(hash, 'wm-android-styles');
86
62
  $("head").append(
87
- `<link rel="stylesheet" theme="wmtheme" href="${deployUrl}wm-android-styles.${hash}.css" >`
63
+ `<link rel="stylesheet" theme="wmtheme" href="${deployUrl}wm-android-styles.css" >`
88
64
  );
89
- hash = await generateHash(`${global.opPath}/wm-ios-styles.css`);
90
- copyMobileCssFiles(hash, 'wm-ios-styles');
91
65
  $("head").append(
92
- `<link rel="stylesheet" theme="wmtheme" href="${deployUrl}wm-ios-styles.${hash}.css" >`
66
+ `<link rel="stylesheet" theme="wmtheme" href="${deployUrl}wm-ios-styles.css" >`
93
67
  );
94
68
  }
95
69
  }
@@ -283,9 +257,7 @@ const generateSha1 = (content) => {
283
257
  wm_styles_path = `${deployUrl}wm-styles.js`;
284
258
  } else {
285
259
  const fileName = 'wm-styles';
286
- const hash = await generateHash(`${global.opPath}/${fileName}.css`);
287
- copyCssFiles(hash, updatedFilenames);
288
- const updatedFileName = `${fileName}.${hash}.css`
260
+ const updatedFileName = `${fileName}.css`
289
261
  wm_styles_path = `${deployUrl}${updatedFileName}`;
290
262
  }
291
263
  }
@@ -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: 2/6/2025, 1:43:33 AM</p>
72
+ <p class="timestamp">Generated on: 2/18/2025, 11:07:25 PM</p>
73
73
  </div>
74
74
 
75
75
  <div class="section">