@wavemaker/angular-codegen 11.1.0-next.24311 → 11.1.0-next.24314
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.
- angular-codegen/angular-app/build-scripts/post-build.js +30 -50
- angular-codegen/angular-app/package.json +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 +20263 -0
- angular-codegen/dependencies/pipe-provider.cjs.js +71744 -0
- angular-codegen/dependencies/transpilation-mobile.cjs.js +190 -59
- angular-codegen/dependencies/transpilation-web.cjs.js +190 -59
- angular-codegen/package.json +1 -1
- angular-codegen/src/codegen-cli.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/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
|
*/
|
@@ -289,26 +272,23 @@ const generateSha1 = (content) => {
|
|
289
272
|
const serviceWorkerEnabled = build['configurations']['production']['serviceWorker'];
|
290
273
|
const updatedFilenames = {}
|
291
274
|
const updatedFileHashes = {}
|
275
|
+
let wm_styles_path;
|
292
276
|
|
293
277
|
if (isMobileProject) {
|
294
278
|
await addMobileSpecificStyles(deployUrl);
|
295
279
|
} else {
|
296
280
|
if (isDevBuild) {
|
297
|
-
|
298
|
-
`<script> const WMStylesPath = "${deployUrl}/wm-styles.js" </script>`
|
299
|
-
)
|
281
|
+
wm_styles_path = `${deployUrl}/wm-styles.js`;
|
300
282
|
} else {
|
301
283
|
const fileName = 'wm-styles';
|
302
284
|
const hash = await generateHash(`${opPath}/${fileName}.css`);
|
303
285
|
copyCssFiles(hash, updatedFilenames);
|
304
286
|
const updatedFileName = `${fileName}.${hash}.css`
|
305
|
-
|
306
|
-
`<script> const WMStylesPath = "${deployUrl}/${updatedFileName}" </script>`
|
307
|
-
);
|
287
|
+
wm_styles_path = `${deployUrl}/${updatedFileName}`;
|
308
288
|
}
|
309
289
|
}
|
310
290
|
|
311
|
-
addScriptForWMStylesPath();
|
291
|
+
addScriptForWMStylesPath(wm_styles_path);
|
312
292
|
const htmlContent = $.html();
|
313
293
|
await writeFile(`./dist/index.html`, htmlContent);
|
314
294
|
|