@wavemaker/angular-codegen 11.10.0-next.24980 → 11.10.0-next.25079
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 → package}/angular-app/angular.json +35 -9
- {angular-codegen → package}/angular-app/build-scripts/post-build.js +2 -0
- package/angular-app/dependency-report.html +124 -0
- package/angular-app/generate-dependency-report.js +240 -0
- package/angular-app/npm-shrinkwrap.json +25409 -0
- {angular-codegen → package}/angular-app/package-lock.json +11609 -9972
- {angular-codegen → package}/angular-app/package.json +35 -25
- {angular-codegen → package}/angular-app/src/assets/styles/css/wm-style.css +1 -1
- package/angular-app/src/framework/services/customwidget-config-provider.service.ts +13 -0
- package/angular-app/src/framework/util/page-util.ts +7 -0
- package/angular-app/src/main.ts +67 -0
- {angular-codegen → package}/angular-app/tsconfig.json +37 -44
- package/build-angular-app.js +123 -0
- package/dependencies/custom-widgets-bundle.cjs.js +415 -0
- {angular-codegen → package}/dependencies/expression-parser.cjs.js +13909 -17363
- {angular-codegen → package}/dependencies/pipe-provider.cjs.js +38215 -37593
- {angular-codegen → package}/dependencies/transpilation-mobile.cjs.js +23855 -23466
- {angular-codegen → package}/dependencies/transpilation-web.cjs.js +23872 -23482
- {angular-codegen → package}/download-packages.js +13 -1
- package/npm-shrinkwrap.json +8046 -0
- package/package-lock.json +8046 -0
- {angular-codegen → package}/package.json +7 -1
- package/src/codegen-cli.js +1 -0
- package/src/codegen.js +1 -0
- package/src/copy-utils.js +1 -0
- package/src/gen-app-skeleton.js +1 -0
- package/src/gen-components.js +1 -0
- package/src/gen-customwidget-config.js +1 -0
- package/src/gen-index-html.js +1 -0
- package/src/handlebar-helpers.js +1 -0
- package/src/pages-util.js +1 -0
- package/src/update-angular-json.js +1 -0
- package/src/wm-utils.js +1 -0
- {angular-codegen → package}/templates/app.module.ts.hbs +5 -1
- package/templates/component.config.ts.hbs +1 -0
- package/templates/customwidget/customwidget-config.ts.hbs +6 -0
- package/templates/customwidget/customwidget.component.script.js.hbs +3 -0
- package/templates/customwidget/customwidget.component.ts.hbs +43 -0
- {angular-codegen → package}/templates/page/page.module.ts.hbs +11 -0
- angular-codegen/angular-app/src/framework/util/page-util.ts +0 -5
- angular-codegen/angular-app/src/main.ts +0 -30
- angular-codegen/build-angular-app.js +0 -79
- angular-codegen/package-lock.json +0 -6059
- angular-codegen/src/codegen-cli.js +0 -1
- angular-codegen/src/codegen.js +0 -1
- angular-codegen/src/gen-app-skeleton.js +0 -1
- angular-codegen/src/gen-components.js +0 -1
- angular-codegen/src/gen-index-html.js +0 -1
- angular-codegen/src/handlebar-helpers.js +0 -1
- angular-codegen/src/pages-util.js +0 -1
- angular-codegen/src/update-angular-json.js +0 -1
- angular-codegen/src/wm-utils.js +0 -1
- {angular-codegen → package}/.npmrc +0 -0
- {angular-codegen → package}/angular-app/.npmrc +0 -0
- {angular-codegen → package}/angular-app/build-scripts/build.js +0 -0
- {angular-codegen → package}/angular-app/build-scripts/index-html-transform.js +0 -0
- {angular-codegen → package}/angular-app/build-scripts/optimize-css.gulpfile.js +0 -0
- {angular-codegen → package}/angular-app/build-scripts/update-version.js +0 -0
- {angular-codegen → package}/angular-app/src/.browserslistrc +0 -0
- {angular-codegen → package}/angular-app/src/app/app-codegen.module.ts +0 -0
- {angular-codegen → package}/angular-app/src/app/app.component.css +0 -0
- {angular-codegen → package}/angular-app/src/app/app.component.script.js +0 -0
- {angular-codegen → package}/angular-app/src/app/app.component.variables.ts +0 -0
- {angular-codegen → package}/angular-app/src/app/app.routes.ts +0 -0
- {angular-codegen → package}/angular-app/src/app/lazy-load-scripts.resolve.ts +0 -0
- {angular-codegen → package}/angular-app/src/app/prefabs/prefab-config.js +0 -0
- {angular-codegen → package}/angular-app/src/app/wm-project-properties.ts +0 -0
- {angular-codegen → package}/angular-app/src/assets/.gitkeep +0 -0
- {angular-codegen → package}/angular-app/src/assets/print.css +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/bootstrap.css.map +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/font/summernote.eot +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/font/summernote.ttf +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/font/summernote.woff +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_222222_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_2e83ff_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_444444_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_454545_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_555555_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_777620_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_777777_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_888888_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_cc0000_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_cd0a0a_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/images/ui-icons_ffffff_256x240.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/css/wm-responsive.css +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/FontAwesome.otf +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/fontawesome-webfont.eot +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/fontawesome-webfont.svg +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/fontawesome-webfont.ttf +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/fontawesome-webfont.woff +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/fontawesome-webfont.woff2 +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/glyphicons-halflings-regular.eot +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/glyphicons-halflings-regular.svg +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/glyphicons-halflings-regular.ttf +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/glyphicons-halflings-regular.woff +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/glyphicons-halflings-regular.woff2 +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wavicon.eot +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wavicon.ttf +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wavicon.woff +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wm-streamline-light-icon.eot +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wm-streamline-light-icon.ttf +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wm-streamline-light-icon.woff +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wm-streamline-regular-icon.eot +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wm-streamline-regular-icon.ttf +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/fonts/wm-streamline-regular-icon.woff +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/images/live-sync-icon.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/images/live-sync-touch-icon.png +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/images/loader.gif +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/images/spinner-small.gif +0 -0
- {angular-codegen → package}/angular-app/src/assets/styles/images/ui-icons.png +0 -0
- {angular-codegen → package}/angular-app/src/environments/environment.dev.ts +0 -0
- {angular-codegen → package}/angular-app/src/environments/environment.prod.ts +0 -0
- {angular-codegen → package}/angular-app/src/environments/environment.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/angular1.polyfills.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/services/app-extension.service.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/services/app-js-provider.service.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/services/app-variables-provider.service.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/services/component-ref-provider.service.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/services/lazy-component-ref-provider.service.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/services/prefab-config-provider.service.ts +0 -0
- {angular-codegen → package}/angular-app/src/framework/util/lazy-module-routes.ts +0 -0
- {angular-codegen → package}/angular-app/src/index.html +0 -0
- {angular-codegen → package}/angular-app/src/polyfills.ts +0 -0
- {angular-codegen → package}/angular-app/src/setup-jest.js +0 -0
- {angular-codegen → package}/angular-app/src/styles.css +0 -0
- {angular-codegen → package}/angular-app/src/tsconfig.app.json +0 -0
- {angular-codegen → package}/angular-app/src/tslint.json +0 -0
- {angular-codegen → package}/angular-app/tsconfig.web-app.json +0 -0
- {angular-codegen → package}/angular-app/wm-custom-webpack.config.js +0 -0
- {angular-codegen → package}/build-util.js +0 -0
- {angular-codegen → package}/dependencies/app.component.html +0 -0
- {angular-codegen → package}/generate-angular-app.js +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-128x128.png +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-144x144.png +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-152x152.png +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-192x192.png +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-384x384.png +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-512x512.png +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-72x72.png +0 -0
- {angular-codegen → package}/pwa-assets/icons/icon-96x96.png +0 -0
- {angular-codegen → package}/pwa-assets/manifest.json +0 -0
- {angular-codegen → package}/pwa-assets/ngsw-config.json +0 -0
- {angular-codegen → package}/pwa-assets/wmsw-worker.js +0 -0
- {angular-codegen → package}/src/codegen-args-cli.js +0 -0
- {angular-codegen → package}/src/expr-parser-utils.js +0 -0
- {angular-codegen → package}/src/gen-app-codegen-module.js +0 -0
- {angular-codegen → package}/src/gen-app-js.js +0 -0
- {angular-codegen → package}/src/gen-app-prefabs-module.js +0 -0
- {angular-codegen → package}/src/gen-app-routes.js +0 -0
- {angular-codegen → package}/src/gen-app-variables.js +0 -0
- {angular-codegen → package}/src/gen-layouts.js +0 -0
- {angular-codegen → package}/src/gen-lazy-module-routes.js +0 -0
- {angular-codegen → package}/src/gen-prefabs.js +0 -0
- {angular-codegen → package}/src/gen-pwa-files.js +0 -0
- {angular-codegen → package}/src/gen-tsconfig.js +0 -0
- {angular-codegen → package}/src/gen-wm-project-properties.js +0 -0
- {angular-codegen → package}/src/project-meta.js +0 -0
- {angular-codegen → package}/templates/app-codegen.module.ts.hbs +0 -0
- {angular-codegen → package}/templates/app-prefabs.module.ts.hbs +0 -0
- {angular-codegen → package}/templates/app-routes.ts.hbs +0 -0
- {angular-codegen → package}/templates/app.component.script.js.hbs +0 -0
- {angular-codegen → package}/templates/component.expressions.ts.hbs +0 -0
- {angular-codegen → package}/templates/component.variables.ts.hbs +0 -0
- {angular-codegen → package}/templates/expr-vs-fn.hbs +0 -0
- {angular-codegen → package}/templates/layout/layout.component.ts.hbs +0 -0
- {angular-codegen → package}/templates/layout/layout.module.ts.hbs +0 -0
- {angular-codegen → package}/templates/lazy-module-routes.ts.hbs +0 -0
- {angular-codegen → package}/templates/page/page.component.script.js.hbs +0 -0
- {angular-codegen → package}/templates/page/page.component.ts.hbs +0 -0
- {angular-codegen → package}/templates/partial/partial.component.script.js.hbs +0 -0
- {angular-codegen → package}/templates/partial/partial.component.ts.hbs +0 -0
- {angular-codegen → package}/templates/partial/partial.module.ts.hbs +0 -0
- {angular-codegen → package}/templates/prefab/prefab-config.ts.hbs +0 -0
- {angular-codegen → package}/templates/prefab/prefab.component.script.js.hbs +0 -0
- {angular-codegen → package}/templates/prefab/prefab.component.ts.hbs +0 -0
- {angular-codegen → package}/templates/prefab/prefab.module.ts.hbs +0 -0
- {angular-codegen → package}/templates/wm-project-properties.ts.hbs +0 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
|
|
3
|
+
import { CustomwidgetConfigProvider } from '@wm/runtime/base';
|
|
4
|
+
|
|
5
|
+
import { getCustomWidgetConfig } from '../util/page-util';
|
|
6
|
+
|
|
7
|
+
@Injectable()
|
|
8
|
+
export class CustomwidgetConfigProviderService extends CustomwidgetConfigProvider {
|
|
9
|
+
|
|
10
|
+
public getConfig(widgetname: string): Promise<any> {
|
|
11
|
+
return Promise.resolve(getCustomWidgetConfig(widgetname));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const prefabConfigs = new Map<string, any>();
|
|
2
|
+
const customWidgetConfigs = new Map<string, any>();
|
|
3
|
+
|
|
4
|
+
export const registerPrefabConfig = (prefabName: string, config: any) => prefabConfigs.set(prefabName, config);
|
|
5
|
+
export const getPrefabConfig = prefabName => prefabConfigs.get(prefabName);
|
|
6
|
+
export const registerCustomWidgetConfig = (customWidget: string, config: any) => customWidgetConfigs.set(customWidget, config);
|
|
7
|
+
export const getCustomWidgetConfig = customWidget => customWidgetConfigs.get(customWidget);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ApplicationRef, enableProdMode, NgModuleRef } from '@angular/core';
|
|
2
|
+
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
|
|
3
|
+
|
|
4
|
+
import { AppModule } from './app/app.module';
|
|
5
|
+
import { environment } from './environments/environment';
|
|
6
|
+
|
|
7
|
+
import initWmProjectProperties from './app/wm-project-properties';
|
|
8
|
+
import { WMAppProperties } from './app/wmProperties';
|
|
9
|
+
import * as fontConfig from './font.config';
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
let formatAcceptHeader = (languages: any) => {
|
|
13
|
+
let result: string[] = [];
|
|
14
|
+
let addedLanguages = new Set<string>(); // To track already added languages
|
|
15
|
+
let qValue = 1.0;
|
|
16
|
+
|
|
17
|
+
languages.forEach((lang: any) => {
|
|
18
|
+
if (!addedLanguages.has(lang)) {
|
|
19
|
+
// Add the full language (e.g., en-US or en) if not already added
|
|
20
|
+
result.push(`${lang}${qValue === 1.0 ? '' : `;q=${qValue.toFixed(1)}`}`);
|
|
21
|
+
addedLanguages.add(lang);
|
|
22
|
+
// Decrease qValue for the next language
|
|
23
|
+
qValue = Math.max(0.1, qValue - 0.1); // Decrease qValue, minimum is 0.1
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// If language has a region code (e.g., en-US), also add the base language (e.g., en)
|
|
27
|
+
if (lang.includes('-')) {
|
|
28
|
+
const baseLang = lang.split('-')[0];
|
|
29
|
+
if (!addedLanguages.has(baseLang)) {
|
|
30
|
+
result.push(`${baseLang};q=${qValue.toFixed(1)}`);
|
|
31
|
+
addedLanguages.add(baseLang);
|
|
32
|
+
|
|
33
|
+
// Decrease qValue for the next language
|
|
34
|
+
qValue = Math.max(0.1, qValue - 0.1);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
return result.join(',');
|
|
40
|
+
}
|
|
41
|
+
WMAppProperties['preferredLanguage'] = formatAcceptHeader(navigator.languages);
|
|
42
|
+
WMAppProperties['fontConfig'] = fontConfig;
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
(window as any)._WM_APP_PROPERTIES = WMAppProperties
|
|
46
|
+
initWmProjectProperties();
|
|
47
|
+
|
|
48
|
+
if (environment.production) {
|
|
49
|
+
enableProdMode();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
document.addEventListener('DOMContentLoaded', () => {
|
|
53
|
+
new Promise<Event | void>( resolve => {
|
|
54
|
+
if (window['cordova']) {
|
|
55
|
+
document.addEventListener('deviceready', resolve);
|
|
56
|
+
} else {
|
|
57
|
+
resolve();
|
|
58
|
+
}
|
|
59
|
+
}).then(() => platformBrowserDynamic().bootstrapModule(AppModule))
|
|
60
|
+
.then((appModuleRef: NgModuleRef<AppModule>) => {
|
|
61
|
+
const applicationRef = appModuleRef.injector.get(ApplicationRef);
|
|
62
|
+
window.addEventListener('unload', () => {
|
|
63
|
+
applicationRef.components.map(c => c && c.destroy());
|
|
64
|
+
});
|
|
65
|
+
console.timeEnd('bootstrap'), err => console.log(err);
|
|
66
|
+
}, err => console.log(err));
|
|
67
|
+
});
|
|
@@ -2,19 +2,23 @@
|
|
|
2
2
|
"compileOnSave": false,
|
|
3
3
|
"compilerOptions": {
|
|
4
4
|
"baseUrl": "./",
|
|
5
|
-
"outDir": "./dist/out-tsc",
|
|
6
5
|
"downlevelIteration": true,
|
|
7
|
-
"
|
|
6
|
+
"outDir": "./dist/out-tsc",
|
|
8
7
|
"sourceMap": true,
|
|
8
|
+
"declaration": false,
|
|
9
|
+
"target": "es2022",
|
|
10
|
+
"module": "es2020",
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"esModuleInterop": true,
|
|
9
13
|
"emitDecoratorMetadata": true,
|
|
10
14
|
"experimentalDecorators": true,
|
|
11
|
-
"esModuleInterop": true,
|
|
12
|
-
"moduleResolution": "node",
|
|
13
|
-
"target": "ES2022",
|
|
14
|
-
"module": "ES2022",
|
|
15
15
|
"typeRoots": [
|
|
16
16
|
"node_modules/@types"
|
|
17
17
|
],
|
|
18
|
+
"lib": [
|
|
19
|
+
"es2018",
|
|
20
|
+
"dom"
|
|
21
|
+
],
|
|
18
22
|
"paths": {
|
|
19
23
|
"rxjs/observable/throw": [
|
|
20
24
|
"node_modules/rxjs-compat/_esm2015/observable/throw"
|
|
@@ -32,31 +36,34 @@
|
|
|
32
36
|
"node_modules/@wavemaker/app-ng-runtime/mobile-build-task"
|
|
33
37
|
],
|
|
34
38
|
"@wm/core": [
|
|
35
|
-
"node_modules/@wavemaker/app-ng-runtime/core
|
|
39
|
+
"node_modules/@wavemaker/app-ng-runtime/core"
|
|
36
40
|
],
|
|
37
41
|
"@wavemaker/variables": [
|
|
38
42
|
"node_modules/@wavemaker/variables/"
|
|
39
43
|
],
|
|
44
|
+
"@wavemaker/custom-widgets-m3": [
|
|
45
|
+
"node_modules/@wavemaker/custom-widgets-m3/"
|
|
46
|
+
],
|
|
40
47
|
"@wm/components/base": [
|
|
41
|
-
"node_modules/@wavemaker/app-ng-runtime/components/base
|
|
48
|
+
"node_modules/@wavemaker/app-ng-runtime/components/base"
|
|
42
49
|
],
|
|
43
50
|
"@wm/components/basic": [
|
|
44
|
-
"node_modules/@wavemaker/app-ng-runtime/components/basic/default
|
|
51
|
+
"node_modules/@wavemaker/app-ng-runtime/components/basic/default"
|
|
45
52
|
],
|
|
46
53
|
"@wm/components/input": [
|
|
47
|
-
"node_modules/@wavemaker/app-ng-runtime/components/input/default
|
|
54
|
+
"node_modules/@wavemaker/app-ng-runtime/components/input/default"
|
|
48
55
|
],
|
|
49
56
|
"@wm/components/page": [
|
|
50
|
-
"node_modules/@wavemaker/app-ng-runtime/components/page/default
|
|
57
|
+
"node_modules/@wavemaker/app-ng-runtime/components/page/default"
|
|
51
58
|
],
|
|
52
59
|
"@wm/mobile/components/basic": [
|
|
53
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components/basic/default
|
|
60
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/components/basic/default"
|
|
54
61
|
],
|
|
55
62
|
"@wm/mobile/components/page": [
|
|
56
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components/page/default
|
|
63
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/components/page/default"
|
|
57
64
|
],
|
|
58
65
|
"@wm/components/dialogs": [
|
|
59
|
-
"node_modules/@wavemaker/app-ng-runtime/components/dialogs/default
|
|
66
|
+
"node_modules/@wavemaker/app-ng-runtime/components/dialogs/default"
|
|
60
67
|
],
|
|
61
68
|
"@wm/mobile/components/*": [
|
|
62
69
|
"node_modules/@wavemaker/app-ng-runtime/mobile/components/*"
|
|
@@ -65,67 +72,53 @@
|
|
|
65
72
|
"node_modules/@wavemaker/app-ng-runtime/components/*"
|
|
66
73
|
],
|
|
67
74
|
"@wm/transpiler": [
|
|
68
|
-
"node_modules/@wavemaker/app-ng-runtime/transpiler
|
|
75
|
+
"node_modules/@wavemaker/app-ng-runtime/transpiler"
|
|
69
76
|
],
|
|
70
77
|
"@wm/security": [
|
|
71
|
-
"node_modules/@wavemaker/app-ng-runtime/security
|
|
78
|
+
"node_modules/@wavemaker/app-ng-runtime/security"
|
|
72
79
|
],
|
|
73
80
|
"@swipey": [
|
|
74
|
-
"node_modules/@wavemaker/app-ng-runtime/swipey
|
|
81
|
+
"node_modules/@wavemaker/app-ng-runtime/swipey"
|
|
75
82
|
],
|
|
76
83
|
"@wm/http": [
|
|
77
|
-
"node_modules/@wavemaker/app-ng-runtime/http
|
|
84
|
+
"node_modules/@wavemaker/app-ng-runtime/http"
|
|
78
85
|
],
|
|
79
86
|
"@wm/oAuth": [
|
|
80
|
-
"node_modules/@wavemaker/app-ng-runtime/oAuth
|
|
87
|
+
"node_modules/@wavemaker/app-ng-runtime/oAuth"
|
|
81
88
|
],
|
|
82
89
|
"@wm/variables": [
|
|
83
|
-
"node_modules/@wavemaker/app-ng-runtime/variables
|
|
90
|
+
"node_modules/@wavemaker/app-ng-runtime/variables"
|
|
84
91
|
],
|
|
85
92
|
"@wm/mobile/core": [
|
|
86
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/core
|
|
93
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/core"
|
|
87
94
|
],
|
|
88
95
|
"@wm/mobile/components": [
|
|
89
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/components
|
|
96
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/components"
|
|
90
97
|
],
|
|
91
98
|
"@wm/mobile/offline": [
|
|
92
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/offline
|
|
99
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/offline"
|
|
93
100
|
],
|
|
94
101
|
"@wm/mobile/variables": [
|
|
95
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/variables
|
|
102
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/variables"
|
|
96
103
|
],
|
|
97
104
|
"@wm/runtime/base": [
|
|
98
|
-
"node_modules/@wavemaker/app-ng-runtime/runtime/base
|
|
105
|
+
"node_modules/@wavemaker/app-ng-runtime/runtime/base"
|
|
99
106
|
],
|
|
100
107
|
"@wm/runtime/dynamic": [
|
|
101
|
-
"node_modules/@wavemaker/app-ng-runtime/runtime/dynamic
|
|
108
|
+
"node_modules/@wavemaker/app-ng-runtime/runtime/dynamic"
|
|
102
109
|
],
|
|
103
110
|
"@wm/mobile/runtime": [
|
|
104
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/runtime
|
|
111
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/runtime"
|
|
105
112
|
],
|
|
106
113
|
"@wm/mobile/runtime/dynamic": [
|
|
107
|
-
"node_modules/@wavemaker/app-ng-runtime/mobile/runtime-dynamic
|
|
114
|
+
"node_modules/@wavemaker/app-ng-runtime/mobile/runtime-dynamic"
|
|
108
115
|
]
|
|
109
116
|
},
|
|
110
|
-
"
|
|
111
|
-
"es2020",
|
|
112
|
-
"dom"
|
|
113
|
-
],
|
|
114
|
-
"useDefineForClassFields": false,
|
|
115
|
-
"resolveJsonModule": true
|
|
117
|
+
"useDefineForClassFields": false
|
|
116
118
|
},
|
|
117
119
|
"angularCompilerOptions": {
|
|
118
120
|
"compilationMode": "full",
|
|
119
121
|
"strictMetadataEmit": false,
|
|
120
|
-
"fullTemplateTypeCheck": false
|
|
121
|
-
"extendedDiagnostics": {
|
|
122
|
-
"checks": {
|
|
123
|
-
"optionalChainNotNullable": "suppress"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"enableI18nLegacyMessageIdFormat": false,
|
|
127
|
-
"strictInjectionParameters": false,
|
|
128
|
-
"strictInputAccessModifiers": false,
|
|
129
|
-
"trace": true
|
|
122
|
+
"fullTemplateTypeCheck": false
|
|
130
123
|
}
|
|
131
124
|
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
|
|
2
|
+
/**
|
|
3
|
+
* Download and install the app-ng-runtime package
|
|
4
|
+
* Run the build and post build for the generated angular app.
|
|
5
|
+
*
|
|
6
|
+
* CONSOLE ARGUMENTS:-
|
|
7
|
+
* nodeVMArgs:String: Node environment params (Eg: '--max-old-space-size=2040')
|
|
8
|
+
* ngBuildParams:String: Anglar build params (Eg: '--prod=true --source-map=false')
|
|
9
|
+
* runtimeUIVersion:String: Runtime version (Eg: 10.6.6-next.10243)
|
|
10
|
+
* appSrc:String: Source folder to generate the angular app (current directory Eg: '.')
|
|
11
|
+
* appTarget:String: Target folder to save the generated app (Eg: 'target/ui-build/generated-app')
|
|
12
|
+
* codegenPath:String: Input to the codegen-CLI --> Codegen installation path to copy the angular-template-app
|
|
13
|
+
* optimizeUIBuild : By default this flag will be true. If it's windows platform we are making the flag to false, it means no optimisation for windows.
|
|
14
|
+
*/
|
|
15
|
+
const fs = require('fs');
|
|
16
|
+
const { downloadNPMPackage } = require('./download-packages');
|
|
17
|
+
const archiver = require('archiver');
|
|
18
|
+
const path = require("path");
|
|
19
|
+
const { executeSyncCmd, MSG_NG_RUNTIME_LOG, MSG_NG_RUNTIME_SUCCESS } = require('./build-util');
|
|
20
|
+
const os = require("os");
|
|
21
|
+
|
|
22
|
+
const NPM_PACKAGE_SCOPE = '@wavemaker';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* @TODO: This is a temporary workaround to extract deploy-url from 'ngBuildParams', need to be replaced in future.
|
|
26
|
+
*/
|
|
27
|
+
const updateDeployUrl = (args) => {
|
|
28
|
+
let buildArgs = args.ngBuildParams.split(' ');
|
|
29
|
+
const deployParam = buildArgs.find(i => i.startsWith("--deploy-url="));
|
|
30
|
+
if(!deployParam) {
|
|
31
|
+
buildArgs.push("--deploy-url=ng-bundle/");
|
|
32
|
+
} else {
|
|
33
|
+
buildArgs.filter((param, index) => {
|
|
34
|
+
if (param.includes('--deploy-url=_cdnUrl_')) {
|
|
35
|
+
buildArgs[index] = "--deploy-url=_cdnUrl_/ng-bundle/"
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
buildArgs.push(args.nodeVMArgs);
|
|
41
|
+
return buildArgs.join(" ");
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Download the app runtime package
|
|
46
|
+
* Symlink to reuse the existing node modules (If windows optimizeUIBuild will be false and install all node modules every build )
|
|
47
|
+
* Run the ng build and post build for the project
|
|
48
|
+
*/
|
|
49
|
+
const buildAngularApp = (args) => {
|
|
50
|
+
const HOME_DIR = os.homedir(), ANGULAR_APP_TEMPLATE_NAME = "angular-app";
|
|
51
|
+
const TARBALL_DOWNLOAD_PATH = (HOME_DIR + '/.wm/node_modules') + '/' + ANGULAR_APP_TEMPLATE_NAME + '/' + args.runtimeUIVersion;
|
|
52
|
+
const PACKAGE_NAME = NPM_PACKAGE_SCOPE + '/' + ANGULAR_APP_TEMPLATE_NAME + '@' + args.runtimeUIVersion;
|
|
53
|
+
const TARBALL_NAME = 'wavemaker' + '-' + ANGULAR_APP_TEMPLATE_NAME + '-' + args.runtimeUIVersion + '.tgz';
|
|
54
|
+
|
|
55
|
+
fs.mkdirSync(TARBALL_DOWNLOAD_PATH, { recursive: true });
|
|
56
|
+
//npm pack will download the given package as a tar file
|
|
57
|
+
executeSyncCmd('cd ' + TARBALL_DOWNLOAD_PATH + ` && npm pack ${PACKAGE_NAME}`, null, `Downloading tarball - ${PACKAGE_NAME} to the location - ${TARBALL_DOWNLOAD_PATH}`);
|
|
58
|
+
executeSyncCmd('cd ' + TARBALL_DOWNLOAD_PATH + ` && tar -xvf ${TARBALL_NAME}`, null, `Unzipping the tarball - ${TARBALL_NAME}`);
|
|
59
|
+
|
|
60
|
+
let packageInfo = {
|
|
61
|
+
scope: NPM_PACKAGE_SCOPE,
|
|
62
|
+
name: ANGULAR_APP_TEMPLATE_NAME,
|
|
63
|
+
version: args.runtimeUIVersion,
|
|
64
|
+
packageJsonFile: `${TARBALL_DOWNLOAD_PATH}/package/package.json`,
|
|
65
|
+
packageJsonLockFile: `${TARBALL_DOWNLOAD_PATH}/package/package-lock.json`,
|
|
66
|
+
successMsg: MSG_NG_RUNTIME_SUCCESS,
|
|
67
|
+
infoMsg: MSG_NG_RUNTIME_LOG
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
try {
|
|
71
|
+
if (args.optimizeUIBuild) {
|
|
72
|
+
fs.copyFileSync(TARBALL_DOWNLOAD_PATH + `/package/package.json`, TARBALL_DOWNLOAD_PATH + '/package.json');
|
|
73
|
+
fs.copyFileSync(TARBALL_DOWNLOAD_PATH + `/package/package-lock.json`, TARBALL_DOWNLOAD_PATH + '/package-lock.json');
|
|
74
|
+
fs.copyFileSync(TARBALL_DOWNLOAD_PATH + `/package/.npmrc`, TARBALL_DOWNLOAD_PATH + '/.npmrc');
|
|
75
|
+
|
|
76
|
+
// Download angular-app node_modules
|
|
77
|
+
executeSyncCmd('cd ' + TARBALL_DOWNLOAD_PATH + ' && npm install --prefix ' + TARBALL_DOWNLOAD_PATH, null, "Installing app dependencies...");
|
|
78
|
+
|
|
79
|
+
// Symlink to reuse the existing node_modules
|
|
80
|
+
fs.symlinkSync(TARBALL_DOWNLOAD_PATH + `/node_modules`, args.appTarget + '/node_modules', 'dir');
|
|
81
|
+
} else {
|
|
82
|
+
fs.copyFileSync(TARBALL_DOWNLOAD_PATH + `/package/package/package.json`, args.appTarget + '/package.json');
|
|
83
|
+
fs.copyFileSync(TARBALL_DOWNLOAD_PATH + `/package/package-lock.json`, args.appTarget + '/package-lock.json');
|
|
84
|
+
fs.copyFileSync(TARBALL_DOWNLOAD_PATH + `/package/.npmrc`, args.appTarget + '/.npmrc');
|
|
85
|
+
executeSyncCmd('cd ' + args.appTarget + ` && npm install `, null, MSG_NG_RUNTIME_LOG);
|
|
86
|
+
}
|
|
87
|
+
} catch (err) {
|
|
88
|
+
console.log(MSG_NG_RUNTIME_LOG + 'FAILED the symlink for the node_modules', err);
|
|
89
|
+
process.exit(err.code || err.pid);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
let ngBuildParams = updateDeployUrl(args);
|
|
93
|
+
const NG_BUILD_MSG = 'NG BUILD MIGHT HAVE FAILED WITH HEAP OUT OF MEMORY, RE-EXECUTE THE BUILD BY INCREASING THE MAX-OLD-SPACE-SIZE ARGUMENT VALUE FOR BUILD.UI.NODE.ARGS PROPERTY IN DEPLOYMENT PROFILE';
|
|
94
|
+
// Generating the angular build and post build process.
|
|
95
|
+
executeSyncCmd('cd ' + args.appTarget + ' && node ./build-scripts/build.js ' + ngBuildParams, null, MSG_NG_RUNTIME_LOG, false, NG_BUILD_MSG);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
const generateUiZip = async( sourceDir ) => {
|
|
99
|
+
return new Promise((resolve, reject) => {
|
|
100
|
+
const distDir = path.resolve(sourceDir + '/target/ui-build/output-files');
|
|
101
|
+
const zipFile = path.resolve(sourceDir + '/target/ui-artifact.zip');
|
|
102
|
+
|
|
103
|
+
const output = fs.createWriteStream(zipFile);
|
|
104
|
+
const archive = archiver('zip', {
|
|
105
|
+
zlib: {level: 9}
|
|
106
|
+
});
|
|
107
|
+
output.on('close', () => {
|
|
108
|
+
console.log(`✅ ui-artifact.zip created successfully: ${zipFile}`);
|
|
109
|
+
resolve();
|
|
110
|
+
});
|
|
111
|
+
archive.on('error', (err) => {
|
|
112
|
+
reject(err);
|
|
113
|
+
});
|
|
114
|
+
archive.pipe(output);
|
|
115
|
+
archive.directory(distDir, false);
|
|
116
|
+
archive.finalize();
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
module.exports = {
|
|
121
|
+
buildAngularApp,
|
|
122
|
+
generateUiZip
|
|
123
|
+
}
|