@wavemaker/angular-app 11.8.0-rc.5868 → 11.10.0-next.27705
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.json +36 -10
- package/build-scripts/build.js +1 -0
- package/build-scripts/post-build.js +18 -15
- package/dependencies/custom-widgets-bundle.cjs.js +415 -0
- package/dependencies/expression-parser.cjs.js +13909 -17363
- package/dependencies/pipe-provider.cjs.js +38215 -37593
- package/dependencies/transpilation-mobile.cjs.js +23857 -23468
- package/dependencies/transpilation-web.cjs.js +23874 -23484
- package/dependency-report.html +124 -0
- package/generate-dependency-report.js +240 -0
- package/npm-shrinkwrap.json +25427 -0
- package/package-lock.json +10802 -7280
- package/package.json +32 -23
- package/src/framework/services/customwidget-config-provider.service.ts +13 -0
- package/src/framework/util/page-util.ts +3 -1
- package/src/main.ts +37 -0
- package/src/setup-jest.js +4 -1
- package/tsconfig.json +37 -44
package/angular.json
CHANGED
|
@@ -21,19 +21,15 @@
|
|
|
21
21
|
"outputPath": "dist/ng-bundle",
|
|
22
22
|
"index": {
|
|
23
23
|
"input": "src/index.html",
|
|
24
|
-
"output": "
|
|
24
|
+
"output": "../../index.html"
|
|
25
25
|
},
|
|
26
26
|
"main": "src/main.ts",
|
|
27
27
|
"polyfills": "src/polyfills.ts",
|
|
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
|
-
"glob": "print.css",
|
|
34
|
-
"input": "src/assets/",
|
|
35
|
-
"output": "."
|
|
36
|
-
},
|
|
37
33
|
{
|
|
38
34
|
"glob": "**/*",
|
|
39
35
|
"input": "libraries/locales/",
|
|
@@ -43,6 +39,19 @@
|
|
|
43
39
|
"glob": "**/*",
|
|
44
40
|
"input": "node_modules/@wavemaker/app-ng-runtime/locales/",
|
|
45
41
|
"output": "/locales/"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"glob": "**/*",
|
|
45
|
+
"input": "src/servicedefs",
|
|
46
|
+
"output": "/servicedefs/"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"glob": "**/*",
|
|
50
|
+
"input": "resources",
|
|
51
|
+
"output": "/resources/",
|
|
52
|
+
"ignore": [
|
|
53
|
+
"**/*.txt"
|
|
54
|
+
]
|
|
46
55
|
}
|
|
47
56
|
],
|
|
48
57
|
"styles": [
|
|
@@ -58,6 +67,11 @@
|
|
|
58
67
|
"input": "src/assets/app.css",
|
|
59
68
|
"inject": false,
|
|
60
69
|
"bundleName": "wm-styles"
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
"input": "src/assets/print.css",
|
|
73
|
+
"inject": false,
|
|
74
|
+
"bundleName": "print"
|
|
61
75
|
}
|
|
62
76
|
],
|
|
63
77
|
"scripts": [
|
|
@@ -65,6 +79,7 @@
|
|
|
65
79
|
"./node_modules/d3/dist/d3.min.js",
|
|
66
80
|
"./node_modules/@wavemaker/nvd3/build/nv.d3.min.js",
|
|
67
81
|
"./node_modules/jquery/dist/jquery.min.js",
|
|
82
|
+
"./node_modules/lodash/lodash.min.js",
|
|
68
83
|
"./node_modules/jquery-ui/ui/disable-selection.js",
|
|
69
84
|
"./node_modules/jquery-ui/ui/version.js",
|
|
70
85
|
"./node_modules/jquery-ui/ui/widget.js",
|
|
@@ -188,18 +203,29 @@
|
|
|
188
203
|
"tsConfig": "src/tsconfig.app.json",
|
|
189
204
|
"assets": [
|
|
190
205
|
"src/favicon.ico",
|
|
206
|
+
"src/favicon.png",
|
|
191
207
|
"src/assets",
|
|
192
208
|
{
|
|
193
|
-
"glob": "
|
|
194
|
-
"input": "src/
|
|
195
|
-
"output": "
|
|
209
|
+
"glob": "**/*",
|
|
210
|
+
"input": "src/servicedefs",
|
|
211
|
+
"output": "/servicedefs/"
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"glob": "**/*",
|
|
215
|
+
"input": "src/resources",
|
|
216
|
+
"output": "/resources/"
|
|
196
217
|
}
|
|
197
218
|
],
|
|
198
219
|
"styles": [
|
|
199
220
|
"src/styles.css",
|
|
200
221
|
"src/assets/styles/css/wm-style.css",
|
|
201
222
|
"src/assets/themes/material/style.css",
|
|
202
|
-
"src/assets/app.css"
|
|
223
|
+
"src/assets/app.css",
|
|
224
|
+
{
|
|
225
|
+
"input": "src/assets/print.css",
|
|
226
|
+
"inject": false,
|
|
227
|
+
"bundleName": "print"
|
|
228
|
+
}
|
|
203
229
|
],
|
|
204
230
|
"scripts": [
|
|
205
231
|
"./node_modules/x2js/x2js.js",
|
package/build-scripts/build.js
CHANGED
|
@@ -6,6 +6,7 @@ if (processArgs.findIndex(arg => arg.startsWith('--max-old-space-size')) !== -1)
|
|
|
6
6
|
process.env.NODE_OPTIONS = processArgs.pop();
|
|
7
7
|
console.log("Setting node options: ", process.env.NODE_OPTIONS);
|
|
8
8
|
}
|
|
9
|
+
|
|
9
10
|
const args = processArgs.slice(2);
|
|
10
11
|
const ngBuildArgs = ['build', ...args];
|
|
11
12
|
console.log("\x1b[33m", "Angular build params: ", ngBuildArgs);
|
|
@@ -6,18 +6,18 @@ const copyFile = util.promisify(fs.copyFile);
|
|
|
6
6
|
const exec = util.promisify(require('child_process').exec);
|
|
7
7
|
const cheerio = require(`cheerio`);
|
|
8
8
|
const crypto = require(`crypto`);
|
|
9
|
-
|
|
9
|
+
|
|
10
10
|
const copyCssFiles = (hash, updatedFilenames) => {
|
|
11
11
|
const filename = 'wm-styles.css';
|
|
12
12
|
const updatedFilename = `wm-styles.${hash}.css`
|
|
13
|
-
copyFile(`${opPath}/${filename}`, `${opPath}/${updatedFilename}`);
|
|
13
|
+
copyFile(`${global.opPath}/${filename}`, `${global.opPath}/${updatedFilename}`);
|
|
14
14
|
updatedFilenames[filename] = updatedFilename;
|
|
15
15
|
// copyFile(`${opPath}/wm-styles.br.css`,`${opPath}/wm-styles.${hash}.br.css`);
|
|
16
16
|
// copyFile(`${opPath}/wm-styles.gzip.css`,`${opPath}/wm-styles.${hash}.gzip.css`);
|
|
17
17
|
};
|
|
18
18
|
const copyMobileCssFiles = (hash, fileName) => {
|
|
19
19
|
// const name = filePath.split('.css')[0];
|
|
20
|
-
copyFile(`${opPath}/${fileName}.css`, `${opPath}/${fileName}.${hash}.css`);
|
|
20
|
+
copyFile(`${global.opPath}/${fileName}.css`, `${global.opPath}/${fileName}.${hash}.css`);
|
|
21
21
|
// copyFile(`${opPath}/wm-styles.br.css`,`${opPath}/wm-styles.${hash}.br.css`);
|
|
22
22
|
// copyFile(`${opPath}/wm-styles.gzip.css`,`${opPath}/wm-styles.${hash}.gzip.css`);
|
|
23
23
|
};
|
|
@@ -32,18 +32,18 @@ const generateHashForScripts = (updatedFilenames) => {
|
|
|
32
32
|
//so removed `@` from wavemaker.com in the file name and adding it back in the post-build.js file
|
|
33
33
|
const scriptsMap = {};
|
|
34
34
|
return new Promise(resolve => {
|
|
35
|
-
fs.readdir(opPath, (err, items) => {
|
|
35
|
+
fs.readdir(global.opPath, (err, items) => {
|
|
36
36
|
const promises = items.map(i => {
|
|
37
37
|
const nohashIndex = i.indexOf('-NOHASH.js');
|
|
38
38
|
if (nohashIndex > 0) {
|
|
39
39
|
const key = i.substring(0, nohashIndex);
|
|
40
|
-
return generateHash(`${opPath}/${i}`).then(hash => {
|
|
40
|
+
return generateHash(`${global.opPath}/${i}`).then(hash => {
|
|
41
41
|
const filename = `${key}-NOHASH.js`;
|
|
42
42
|
const updatedFilename = `${key}.${hash}.js`
|
|
43
43
|
scriptsMap[`${key}.js`] = updatedFilename;
|
|
44
44
|
updatedFilenames[filename] = updatedFilename;
|
|
45
45
|
return Promise.all([
|
|
46
|
-
copyFile(`${opPath}/${filename}`, `${opPath}/${updatedFilename}`),
|
|
46
|
+
copyFile(`${global.opPath}/${filename}`, `${global.opPath}/${updatedFilename}`),
|
|
47
47
|
// copyFile(`${opPath}/${key}-NOHASH.br.js`, `${opPath}/${key}.${hash}.br.js`),
|
|
48
48
|
// copyFile(`${opPath}/${key}-NOHASH.gzip.js`, `${opPath}/${key}.${hash}.gzip.js`)
|
|
49
49
|
]);
|
|
@@ -51,7 +51,7 @@ const generateHashForScripts = (updatedFilenames) => {
|
|
|
51
51
|
}
|
|
52
52
|
});
|
|
53
53
|
Promise.all(promises).then(() => {
|
|
54
|
-
return writeFile(`${opPath}/path_mapping.json`, JSON.stringify(scriptsMap, null, 2));
|
|
54
|
+
return writeFile(`${global.opPath}/path_mapping.json`, JSON.stringify(scriptsMap, null, 2));
|
|
55
55
|
}).then(resolve);
|
|
56
56
|
});
|
|
57
57
|
});
|
|
@@ -81,12 +81,12 @@ const addMobileSpecificStyles = async (deployUrl) => {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
if (isProdBuild) {
|
|
84
|
-
let hash = await generateHash(`${opPath}/wm-android-styles.css`);
|
|
84
|
+
let hash = await generateHash(`${global.opPath}/wm-android-styles.css`);
|
|
85
85
|
copyMobileCssFiles(hash, 'wm-android-styles');
|
|
86
86
|
$("head").append(
|
|
87
87
|
`<link rel="stylesheet" theme="wmtheme" href="${deployUrl}wm-android-styles.${hash}.css" >`
|
|
88
88
|
);
|
|
89
|
-
hash = await generateHash(`${opPath}/wm-ios-styles.css`);
|
|
89
|
+
hash = await generateHash(`${global.opPath}/wm-ios-styles.css`);
|
|
90
90
|
copyMobileCssFiles(hash, 'wm-ios-styles');
|
|
91
91
|
$("head").append(
|
|
92
92
|
`<link rel="stylesheet" theme="wmtheme" href="${deployUrl}wm-ios-styles.${hash}.css" >`
|
|
@@ -248,16 +248,17 @@ const generateSha1 = (content) => {
|
|
|
248
248
|
const angularJson = require(`${process.cwd()}/angular.json`);
|
|
249
249
|
const build = angularJson['projects']['angular-app']['architect']['build'];
|
|
250
250
|
let deployUrl = args['deploy-url'] || build['options']['deployUrl'];
|
|
251
|
-
|
|
251
|
+
global.randomHash = deployUrl.split('/')[1];
|
|
252
|
+
let outputPath = global.opPath = args['output-path'] || build['options']['outputPath']
|
|
252
253
|
const contents = await readFile(`./dist/index.html`, `utf8`);
|
|
253
254
|
$ = cheerio.load(contents);
|
|
254
255
|
setMobileProjectType(angularJson);
|
|
255
256
|
if (!isMobileProject) {
|
|
256
|
-
isProdBuild = fs.existsSync(`${process.cwd()}/
|
|
257
|
-
isDevBuild = fs.existsSync(`${process.cwd()}/
|
|
257
|
+
isProdBuild = fs.existsSync(`${process.cwd()}/${outputPath}/wm-styles.css`);
|
|
258
|
+
isDevBuild = fs.existsSync(`${process.cwd()}/${outputPath}/wm-styles.js`);
|
|
258
259
|
} else {
|
|
259
|
-
isDevBuild = fs.existsSync(`${process.cwd()}/
|
|
260
|
-
isProdBuild = fs.existsSync(`${process.cwd()}/
|
|
260
|
+
isDevBuild = fs.existsSync(`${process.cwd()}/${outputPath}/wm-android-styles.js`);
|
|
261
|
+
isProdBuild = fs.existsSync(`${process.cwd()}/${outputPath}/wm-android-styles.css`);
|
|
261
262
|
}
|
|
262
263
|
|
|
263
264
|
if (isProdBuild) {
|
|
@@ -282,7 +283,7 @@ const generateSha1 = (content) => {
|
|
|
282
283
|
wm_styles_path = `${deployUrl}wm-styles.js`;
|
|
283
284
|
} else {
|
|
284
285
|
const fileName = 'wm-styles';
|
|
285
|
-
const hash = await generateHash(`${opPath}/${fileName}.css`);
|
|
286
|
+
const hash = await generateHash(`${global.opPath}/${fileName}.css`);
|
|
286
287
|
copyCssFiles(hash, updatedFilenames);
|
|
287
288
|
const updatedFileName = `${fileName}.${hash}.css`
|
|
288
289
|
wm_styles_path = `${deployUrl}${updatedFileName}`;
|
|
@@ -294,6 +295,8 @@ const generateSha1 = (content) => {
|
|
|
294
295
|
|
|
295
296
|
//this is required to download all the assets
|
|
296
297
|
$('head').append(`<meta name="deployUrl" content=${deployUrl} />`);
|
|
298
|
+
$('script[src$="services/application/wmProperties.js"]').remove();
|
|
299
|
+
$('link[href$="favicon.png"]').attr('href', `${deployUrl}favicon.png`);
|
|
297
300
|
|
|
298
301
|
const htmlContent = $.html();
|
|
299
302
|
await writeFile(`./dist/index.html`, htmlContent);
|