@wavemaker/angular-codegen 11.0.1-next.138731 → 11.0.1-next.138734
Sign up to get free protection for your applications and to get access to all the features.
- angular-codegen/angular-app/build-scripts/post-build.js +30 -50
- angular-codegen/angular-app/package-lock.json +252 -24494
- angular-codegen/angular-app/package.json +1 -1
- angular-codegen/angular-app/src/assets/styles/css/wm-responsive.css +1 -1
- angular-codegen/angular-app/src/assets/styles/css/wm-style.css +1 -1
- angular-codegen/dependencies/app.component.html +22 -0
- angular-codegen/dependencies/expression-parser.cjs.js +17809 -0
- angular-codegen/dependencies/pipe-provider.cjs.js +69090 -0
- angular-codegen/dependencies/transpilation-mobile.cjs.js +195 -63
- angular-codegen/dependencies/transpilation-web.cjs.js +195 -63
- angular-codegen/package-lock.json +18 -5488
- angular-codegen/package.json +1 -1
- angular-codegen/src/codegen-args-cli.js +1 -1
- angular-codegen/src/codegen-cli.js +1 -1
- angular-codegen/src/codegen.js +1 -1
- angular-codegen/src/expr-parser-utils.js +1 -0
- angular-codegen/src/gen-app-variables.js +1 -1
- angular-codegen/src/gen-components.js +1 -1
- angular-codegen/src/gen-layouts.js +1 -1
- angular-codegen/src/handlebar-helpers.js +1 -1
- angular-codegen/src/pages-util.js +1 -1
- angular-codegen/src/wm-utils.js +1 -1
- angular-codegen/templates/app.component.script.js.hbs +6 -1
- angular-codegen/templates/component.expressions.ts.hbs +3 -0
- angular-codegen/templates/expr-vs-fn.hbs +3 -0
- angular-codegen/templates/page/page.component.ts.hbs +7 -1
- angular-codegen/templates/partial/partial.component.ts.hbs +6 -0
- angular-codegen/templates/prefab/prefab.component.ts.hbs +6 -0
@@ -74,8 +74,8 @@ const setMobileProjectType = (angularJson) => {
|
|
74
74
|
const addMobileSpecificStyles = async (deployUrl) => {
|
75
75
|
if (isDevBuild) {
|
76
76
|
$("body").append(
|
77
|
-
`<script
|
78
|
-
)
|
77
|
+
`<script type="text/javascript" defer="true" src="${deployUrl}/wm-android-styles.js"></script>`
|
78
|
+
);
|
79
79
|
}
|
80
80
|
|
81
81
|
if (isProdBuild) {
|
@@ -92,40 +92,23 @@ const addMobileSpecificStyles = async (deployUrl) => {
|
|
92
92
|
}
|
93
93
|
}
|
94
94
|
|
95
|
-
const addScriptForWMStylesPath = () => {
|
96
|
-
//
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
styleNode.defer = true;
|
113
|
-
}
|
114
|
-
|
115
|
-
styleNode && document
|
116
|
-
.getElementsByTagName("head")[0]
|
117
|
-
.appendChild(styleNode);
|
118
|
-
}
|
119
|
-
})()
|
120
|
-
window.onload = function() {
|
121
|
-
var printCssNode = document.createElement('link');
|
122
|
-
printCssNode.type = 'text/css';
|
123
|
-
printCssNode.rel = 'stylesheet';
|
124
|
-
printCssNode.href = 'print.css';
|
125
|
-
printCssNode.media = 'print';
|
126
|
-
document.getElementsByTagName("head")[0].appendChild(printCssNode);
|
127
|
-
}
|
128
|
-
</script>`);
|
95
|
+
const addScriptForWMStylesPath = (wm_styles_path) => {
|
96
|
+
// wm_styles_path will not be present for mobile apps
|
97
|
+
if (wm_styles_path) {
|
98
|
+
let styleType = wm_styles_path.split(".").pop();
|
99
|
+
if(styleType==="css"){
|
100
|
+
$("head").append(
|
101
|
+
`<link rel="stylesheet" type="text/css" href="${wm_styles_path}"/>`
|
102
|
+
);
|
103
|
+
} else {
|
104
|
+
$("body").append(
|
105
|
+
`<script type="text/javascript" defer="true" src="${wm_styles_path}"></script>`
|
106
|
+
);
|
107
|
+
}
|
108
|
+
}
|
109
|
+
$("head").append(
|
110
|
+
`<link rel="stylesheet" type="text/css" media="print" href="print.css"/>`
|
111
|
+
);
|
129
112
|
}
|
130
113
|
|
131
114
|
/**
|
@@ -155,9 +138,9 @@ const SKIP_UPDATE = ['index.html', 'manifest.json'];
|
|
155
138
|
/**
|
156
139
|
* Checks if a file's name has been changed during the build process
|
157
140
|
* and if changed, returns an updated file path.
|
158
|
-
*
|
141
|
+
*
|
159
142
|
* @param {string} deployUrl deployment url
|
160
|
-
* @param {string} url an absolute url to check if its filename has changed
|
143
|
+
* @param {string} url an absolute url to check if its filename has changed
|
161
144
|
* @param {object} updatedFileNames a map from old filenames to new filenames
|
162
145
|
* @returns {string} an updated file path
|
163
146
|
*/
|
@@ -176,8 +159,8 @@ const getUpdatedFileName = (deployUrl, url, updatedFileNames) => {
|
|
176
159
|
/**
|
177
160
|
* Checks if a file's content has been changed during the build process
|
178
161
|
* and if changed, returns a new hash to be updated in ngsw.json
|
179
|
-
*
|
180
|
-
* @param {string} url an absolute url to check if its filename has changed
|
162
|
+
*
|
163
|
+
* @param {string} url an absolute url to check if its filename has changed
|
181
164
|
* @param {object} updatedFileHashes a map from filenames to file hashes
|
182
165
|
* @returns {string} an updated file hash
|
183
166
|
*/
|
@@ -191,7 +174,7 @@ const getUpdatedFileHashes = (url, oldHash, updatedFileHashes) => {
|
|
191
174
|
|
192
175
|
/**
|
193
176
|
* Get the path of the icon without '/ng-bundle'
|
194
|
-
*
|
177
|
+
*
|
195
178
|
* @param {string} iconPath path with '/ng-bundle'
|
196
179
|
* @returns {string} path of the icon without '/ng-bundle'
|
197
180
|
*/
|
@@ -202,7 +185,7 @@ const getIconPath = (iconPath) => {
|
|
202
185
|
|
203
186
|
/**
|
204
187
|
* Updates name, location and content of PWA related assets.
|
205
|
-
*
|
188
|
+
*
|
206
189
|
* @param {string} deployUrl deployment url
|
207
190
|
* @param {object} updatedFileNames a map from old filenames to new filenames
|
208
191
|
* @returns {void}
|
@@ -245,7 +228,7 @@ const updatePwaAssets = (deployUrl, updatedFileNames, updatedFileHashes) => {
|
|
245
228
|
|
246
229
|
/**
|
247
230
|
* Generated sha1 hash for the content supplied.
|
248
|
-
*
|
231
|
+
*
|
249
232
|
* @param {string} content the content to be hashed
|
250
233
|
* @returns {string} the hash value
|
251
234
|
*/
|
@@ -291,26 +274,23 @@ const generateSha1 = (content) => {
|
|
291
274
|
const serviceWorkerEnabled = build['configurations']['production']['serviceWorker'];
|
292
275
|
const updatedFilenames = {}
|
293
276
|
const updatedFileHashes = {}
|
277
|
+
let wm_styles_path;
|
294
278
|
|
295
279
|
if (isMobileProject) {
|
296
280
|
await addMobileSpecificStyles(deployUrl);
|
297
281
|
} else {
|
298
282
|
if (isDevBuild) {
|
299
|
-
|
300
|
-
`<script> const WMStylesPath = "${deployUrl}/wm-styles.js" </script>`
|
301
|
-
)
|
283
|
+
wm_styles_path = `${deployUrl}/wm-styles.js`;
|
302
284
|
} else {
|
303
285
|
const fileName = 'wm-styles';
|
304
286
|
const hash = await generateHash(`${opPath}/${fileName}.css`);
|
305
287
|
copyCssFiles(hash, updatedFilenames);
|
306
288
|
const updatedFileName = `${fileName}.${hash}.css`
|
307
|
-
|
308
|
-
`<script> const WMStylesPath = "${deployUrl}/${updatedFileName}" </script>`
|
309
|
-
);
|
289
|
+
wm_styles_path = `${deployUrl}/${updatedFileName}`;
|
310
290
|
}
|
311
291
|
}
|
312
292
|
|
313
|
-
addScriptForWMStylesPath();
|
293
|
+
addScriptForWMStylesPath(wm_styles_path);
|
314
294
|
const htmlContent = $.html();
|
315
295
|
await writeFile(`./dist/index.html`, htmlContent);
|
316
296
|
|