@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.
- package/angular-app/build-scripts/post-build.js +4 -33
- package/angular-app/dependency-report.html +1 -1
- package/angular-app/npm-shrinkwrap.json +378 -402
- package/angular-app/package-lock.json +378 -402
- package/angular-app/package.json +6 -6
- package/dependencies/pipe-provider.cjs.js +8 -34
- package/dependencies/transpilation-web.cjs.js +4 -17
- package/npm-shrinkwrap.json +107 -113
- package/package-lock.json +107 -113
- package/package.json +2 -2
- package/src/codegen-args-cli.js +1 -1
- package/src/update-angular-json.js +1 -1
|
@@ -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(
|
|
149
|
-
fs.copyFileSync(
|
|
150
|
-
fs.copyFileSync(
|
|
151
|
-
fs.copyFileSync(
|
|
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);
|