@wavemaker/angular-app 12.0.0-next.25185 → 12.0.0-next.25480

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-app",
3
- "version": "12.0.0-next.25185",
3
+ "version": "12.0.0-next.25480",
4
4
  "scripts": {
5
5
  "ng": "ng",
6
6
  "start": "./node_modules/.bin/ng serve",
@@ -30,110 +30,100 @@
30
30
  "@angular/platform-browser-dynamic": "18.2.13",
31
31
  "@angular/router": "18.2.13",
32
32
  "@angular/service-worker": "18.2.13",
33
- "@babel/runtime": "7.14.8",
34
- "@fullcalendar/core": "6.1.15",
35
- "@fullcalendar/daygrid": "6.1.15",
36
- "@fullcalendar/interaction": "6.1.15",
37
- "@fullcalendar/list": "6.1.15",
38
- "@fullcalendar/timegrid": "6.1.15",
33
+ "@fullcalendar/core": "6.1.18",
34
+ "@fullcalendar/daygrid": "6.1.18",
35
+ "@fullcalendar/interaction": "6.1.18",
36
+ "@fullcalendar/list": "6.1.18",
37
+ "@fullcalendar/timegrid": "6.1.18",
39
38
  "@metrichor/jmespath": "0.3.1",
40
- "@wavemaker/custom-widgets-m3": "12.0.0-next.25185",
39
+ "@wavemaker/custom-widgets-m3": "12.0.0-next.25480",
41
40
  "@wavemaker/focus-trap": "1.0.1",
42
- "@wavemaker/foundation-css": "12.0.0-next.25185",
43
- "@wavemaker/nvd3": "1.8.12",
44
- "@wavemaker/variables": "12.0.0-next.25185",
41
+ "@wavemaker/foundation-css": "12.0.0-next.25480",
42
+ "@wavemaker/nvd3": "1.8.16",
43
+ "@wavemaker/variables": "12.0.0-next.25480",
45
44
  "@ztree/ztree_v3": "3.5.48",
46
- "angular-imask": "^7.6.1",
47
- "angular2-websocket": "0.9.7",
48
- "core-js": "3.35.1",
45
+ "acorn": "^8.15.0",
46
+ "angular-imask": "7.6.1",
47
+ "angular2-websocket": "0.9.8",
49
48
  "d3": "7.8.5",
50
- "esbuild-wasm": "^0.24.2",
51
- "hammerjs": "2.0.8",
52
49
  "iscroll": "5.2.0",
53
50
  "jquery": "3.7.1",
54
- "jquery-ui": "1.13.3",
55
- "js-cookie": "2.2.0",
56
- "jssha": "3.1.2",
57
- "lodash": "4.17.21",
51
+ "jquery-ui": "1.14.1",
52
+ "jssha": "3.3.1",
58
53
  "lodash-es": "4.17.21",
54
+ "moment": "2.30.1",
55
+ "moment-timezone": "^0.6.0",
59
56
  "ng-circle-progress": "1.7.1",
60
57
  "ngx-bootstrap": "9.0.0",
61
- "ngx-color-picker": "16.0.0",
62
- "ngx-toastr": "17.0.2",
63
- "rxjs": "6.6.0",
64
- "rxjs-compat": "6.4.0",
58
+ "ngx-color-picker": "20.1.1",
59
+ "ngx-toastr": "19.0.0",
60
+ "rxjs": "7.8.2",
65
61
  "summernote": "0.9.1",
66
- "ts-jest": "29.1.1",
67
- "tslib": "2.4.1",
62
+ "tslib": "2.8.1",
68
63
  "x2js": "3.4.4",
69
- "zone.js": "0.14.10",
70
- "@wavemaker/app-ng-runtime": "12.0.0-next.25185"
64
+ "zone.js": "0.15.1",
65
+ "@wavemaker/app-ng-runtime": "12.0.0-next.25480"
71
66
  },
72
67
  "devDependencies": {
73
68
  "@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
74
69
  "@angular-builders/custom-webpack": "18.0.0",
75
- "@angular-devkit/build-angular": "18.2.12",
76
- "@angular-eslint/builder": "16.2.0",
77
- "@angular-eslint/eslint-plugin": "16.2.0",
78
- "@angular-eslint/eslint-plugin-template": "16.2.0",
79
- "@angular-eslint/schematics": "16.2.0",
80
- "@angular-eslint/template-parser": "16.2.0",
70
+ "@angular-devkit/build-angular": "18.2.20",
71
+ "@angular-eslint/builder": "20.1.1",
72
+ "@angular-eslint/eslint-plugin": "20.1.1",
73
+ "@angular-eslint/eslint-plugin-template": "20.1.1",
74
+ "@angular-eslint/schematics": "20.1.1",
75
+ "@angular-eslint/template-parser": "20.1.1",
81
76
  "@angular/cli": "18.2.12",
82
77
  "@angular/compiler-cli": "18.2.13",
83
78
  "@angular/language-service": "18.2.13",
84
- "@babel/plugin-transform-runtime": "^7.14.5",
85
- "@compodoc/compodoc": "^1.1.25",
86
- "@rollup/plugin-alias": "4.0.2",
87
- "@rollup/plugin-commonjs": "24.0.0",
88
- "@rollup/plugin-multi-entry": "6.0.0",
89
- "@rollup/plugin-node-resolve": "15.0.1",
90
- "@rollup/plugin-typescript": "^8.3.3",
91
- "@types/jest": "^29.5.12",
92
- "@types/jquery": "3.3.22",
79
+ "@compodoc/compodoc": "^1.1.26",
80
+ "@rollup/plugin-alias": "5.1.1",
81
+ "@rollup/plugin-commonjs": "28.0.6",
82
+ "@rollup/plugin-multi-entry": "6.0.1",
83
+ "@rollup/plugin-node-resolve": "16.0.1",
84
+ "@rollup/plugin-typescript": "^12.1.4",
85
+ "@types/jest": "^30.0.0",
86
+ "@types/jquery": "^3.5.32",
93
87
  "@types/lodash-es": "4.17.12",
94
- "@types/node": "12.11.1",
95
- "@types/sizzle": "^2.3.3",
96
- "@typescript-eslint/eslint-plugin": "6.15.0",
97
- "@typescript-eslint/parser": "6.15.0",
98
- "acorn": "8.14.0",
99
- "babel-loader": "^9.1.2",
100
- "cheerio": "1.0.0-rc.12",
101
- "codelyzer": "5.1.2",
102
- "compression-webpack-plugin": "10.0.0",
103
- "dependency-cruiser": "16.8.0",
88
+ "@types/node": "^24.2.0",
89
+ "@typescript-eslint/eslint-plugin": "8.39.0",
90
+ "@typescript-eslint/parser": "8.39.0",
91
+ "cheerio": "1.1.2",
92
+ "compression-webpack-plugin": "11.1.0",
93
+ "core-js": "3.45.0",
104
94
  "eslint": "^8.45.0",
105
95
  "fs": "0.0.1-security",
106
- "fs-extra": "7.0.1",
107
- "jest": "^29.7.0",
96
+ "fs-extra": "11.3.1",
97
+ "jest": "^30.0.5",
108
98
  "jest-canvas-mock": "^2.5.2",
109
- "jest-preset-angular": "^14.1.0",
99
+ "jest-environment-jsdom": "^30.0.5",
100
+ "jest-preset-angular": "^15.0.0",
110
101
  "license-checker": "25.0.1",
111
- "moment": "2.29.4",
112
102
  "moment-locales-webpack-plugin": "^1.2.0",
113
- "moment-timezone": "^0.5.34",
114
103
  "ng-packagr": "17.3.0",
115
- "npm-run-all": "4.1.5",
116
- "owasp-dependency-check": "0.0.23",
117
- "rimraf": "2.6.3",
118
- "rollup": "4.28.1",
119
- "rollup-plugin-includepaths": "0.2.3",
120
- "sonarqube-scanner": "4.2.6",
121
- "terser": "^5.15.1",
122
- "ts-node": "7.0.1",
123
- "tslint": "~6.1.0",
124
- "typescript": "5.4.5",
125
- "util": "0.11.1",
126
- "yargs": "^17.3.1"
104
+ "owasp-dependency-check": "0.8.1",
105
+ "rimraf": "6.0.1",
106
+ "rollup": "4.46.2",
107
+ "sonarqube-scanner": "3.5.0",
108
+ "terser": "^5.43.1",
109
+ "typescript": "5.5.4",
110
+ "util": "0.12.5",
111
+ "yargs": "^18.0.0"
127
112
  },
128
113
  "optionalDependencies": {
129
- "@rollup/rollup-darwin-arm64": "4.9.5",
130
- "@rollup/rollup-linux-x64-gnu": "4.9.5",
131
- "@rollup/rollup-win32-x64": "4.9.5",
132
- "@lmdb/lmdb-linux-x64": "3.0.13"
114
+ "@lmdb/lmdb-linux-x64": "3.4.2",
115
+ "@rollup/rollup-darwin-arm64": "4.46.2",
116
+ "@rollup/rollup-linux-x64-gnu": "4.46.2",
117
+ "@rollup/rollup-win32-x64": "4.9.5"
133
118
  },
134
119
  "engines": {
135
- "node": "~22.11.0",
136
- "npm": "~10.9.0"
120
+ "node": "22.18.0",
121
+ "npm": "10.9.3"
122
+ },
123
+ "overrides": {
124
+ "ng-packagr": {
125
+ "@rollup/wasm-node": "4.40.2"
126
+ }
137
127
  },
138
128
  "engineStrict": true
139
129
  }
package/proxy.conf.js ADDED
@@ -0,0 +1,14 @@
1
+ module.exports = {
2
+ "/services": {
3
+ target: "https://<your-deployed-app-url>/",
4
+ secure: true,
5
+ changeOrigin: true
6
+ },
7
+ "/j_spring_security_check": {
8
+ target: "https://<your-deployed-app-url>/",
9
+ secure: true,
10
+ changeOrigin: true,
11
+ cookiePathRewrite: "/",
12
+ cookieDomainRewrite: "localhost"
13
+ }
14
+ };
@@ -32,6 +32,10 @@ export class ComponentRefProviderService extends ComponentRefProvider {
32
32
  return Promise.resolve(partialRef);
33
33
  }
34
34
  }
35
+ // Guard against undefined value
36
+ if (!value) {
37
+ return Promise.resolve(null);
38
+ }
35
39
  if (!value.componentFactory) {
36
40
  value.componentFactory = this.componentFactoryResolver.resolveComponentFactory(value.ref);
37
41
  }
@@ -1,16 +1,8 @@
1
- import {
2
- Injectable,
3
- NgModuleRef,
4
- Type,
5
- Injector,
6
- Compiler,
7
- NgModuleFactory,
8
- } from '@angular/core';
1
+ import { Injectable, ComponentFactoryResolver } from '@angular/core';
9
2
  import { PartialRefProvider } from '@wm/core';
10
3
  import { ComponentType } from '@wm/runtime/base';
11
4
  import { partialLazyModules, prefabLazyModules, prefabPartialLazyModules } from '../util/lazy-module-routes';
12
5
 
13
- type ModuleWithRoot = Type<any> & { rootComponent: Type<any> };
14
6
  type Options = {
15
7
  prefab: string
16
8
  };
@@ -19,15 +11,15 @@ type Options = {
19
11
  providedIn: 'root'
20
12
  })
21
13
  export class LazyComponentRefProviderService extends PartialRefProvider {
22
- private moduleRef: NgModuleRef<any>;
23
-
24
- constructor(private injector: Injector, private compiler: Compiler) {
14
+ constructor(
15
+ private componentFactoryResolver: ComponentFactoryResolver
16
+ ) {
25
17
  super();
26
18
  }
27
19
 
28
20
  private getLazyModule(componentName: string, componentType: ComponentType, options?: Options) {
29
21
  if (componentType === ComponentType.PARTIAL && options && options.prefab) {
30
- return prefabPartialLazyModules[`${options.prefab}_${componentName}`];
22
+ return prefabPartialLazyModules[`${options.prefab}_${componentName}`];
31
23
  }
32
24
  if (componentType === ComponentType.PARTIAL) {
33
25
  return partialLazyModules[componentName];
@@ -37,27 +29,27 @@ export class LazyComponentRefProviderService extends PartialRefProvider {
37
29
  }
38
30
  }
39
31
 
40
- private async getModuleFactory(moduleOrFactory: NgModuleFactory<any> | Type<any>): Promise<NgModuleFactory<any>> {
41
- if (moduleOrFactory instanceof NgModuleFactory) {
42
- return moduleOrFactory;
43
- } else {
44
- return this.compiler.compileModuleAsync(moduleOrFactory);
45
- }
46
- }
47
-
48
32
  public async getComponentFactoryRef(componentName: string, componentType: ComponentType, options?: Options) {
49
33
  try {
50
- const moduleOrFactory = await this.getLazyModule(componentName, componentType, options).loadChildren();
51
- const moduleFactory = await this.getModuleFactory(moduleOrFactory);
34
+ const lazyModule = this.getLazyModule(componentName, componentType, options);
35
+
36
+ if (!lazyModule) {
37
+ console.error(`No lazy module found for ${componentName}`);
38
+ return null;
39
+ }
40
+
41
+ // Load the component
42
+ const loadedComponent = await lazyModule.loadComponent();
43
+
44
+ if (!loadedComponent) {
45
+ console.error(`Failed to load component ${componentName}`);
46
+ return null;
47
+ }
52
48
 
53
- this.moduleRef = moduleFactory.create(this.injector);
54
- const rootComponent = (moduleFactory.moduleType as ModuleWithRoot)
55
- .rootComponent;
56
- return this.moduleRef.componentFactoryResolver.resolveComponentFactory(
57
- rootComponent
58
- );
49
+ // For standalone components, create a component factory
50
+ return this.componentFactoryResolver.resolveComponentFactory(loadedComponent);
59
51
  } catch (e) {
60
- console.error(e);
52
+ console.error('Error in getComponentFactoryRef:', e);
61
53
  return null;
62
54
  }
63
55
  }
package/src/index.html CHANGED
@@ -11,8 +11,7 @@
11
11
  <link rel="icon" type="image/x-icon" href="favicon.ico">
12
12
 
13
13
  </head>
14
- <body class="wm-app">
15
- <bootstrap-wrapper></bootstrap-wrapper>
14
+ <body class="wm-app">
16
15
  <app-root></app-root>
17
16
  </body>
18
17
  </html>
package/src/main.ts CHANGED
@@ -6,7 +6,6 @@ import { WMAppProperties } from './app/wmProperties';
6
6
  import * as fontConfig from './font.config';
7
7
  import { appConfig } from './app/app.config';
8
8
  import { AppComponent } from '@wm/runtime/base';
9
- import { BootstrapWrapperComponent } from './app/bootstrap-wrapper.component';
10
9
 
11
10
  // Format Accept-Language header
12
11
  const formatAcceptHeader = (languages: string[]): string => {
@@ -49,15 +48,23 @@ if (environment.production) {
49
48
  enableProdMode();
50
49
  }
51
50
 
52
- document.addEventListener('DOMContentLoaded', () => {
51
+ // MEMORY LEAK FIX: Store event listener references for cleanup (though these are one-time bootstrap events)
52
+ const boundDOMContentLoadedHandler = () => {
53
53
  new Promise<Event | void>(resolve => {
54
- resolve();
54
+ resolve();
55
55
  }).then(() => bootstrapApplication(AppComponent, appConfig))
56
56
  .then((appRef: ApplicationRef) => {
57
- appRef.bootstrap(BootstrapWrapperComponent);
58
- window.addEventListener('unload', () => {
57
+ // MEMORY LEAK FIX: Store unload handler reference
58
+ const boundUnloadHandler = () => {
59
59
  appRef.components.map(c => c?.destroy());
60
- });
60
+ // MEMORY LEAK FIX: Remove unload listener after cleanup (though unload is typically final)
61
+ window.removeEventListener('unload', boundUnloadHandler);
62
+ };
63
+ window.addEventListener('unload', boundUnloadHandler);
61
64
  })
62
65
  .catch(err => console.error('Error bootstrapping app:', err));
63
- });
66
+ // MEMORY LEAK FIX: Remove DOMContentLoaded listener after execution (one-time event)
67
+ document.removeEventListener('DOMContentLoaded', boundDOMContentLoadedHandler);
68
+ };
69
+
70
+ document.addEventListener('DOMContentLoaded', boundDOMContentLoadedHandler);
package/src/setup-jest.js CHANGED
@@ -1,3 +1,4 @@
1
+
1
2
  // This file is automatically loaded when running `jest` commands
2
3
  import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
3
4
  import { ToastrModule } from 'ngx-toastr';
@@ -70,7 +71,6 @@ import "jquery-ui/ui/widgets/draggable.js";
70
71
  import "jquery-ui/ui/widgets/droppable.js";
71
72
  import "libraries/scripts/jquery.ui.touch-punch/jquery.ui.touch-punch.min.js";
72
73
  import "moment-timezone/builds/moment-timezone.min.js";
73
- import "hammerjs/hammer.min.js";
74
74
  import "iscroll/build/iscroll.js";
75
75
  import "tabbable/dist/index.umd.min.js";
76
76
  import "@wavemaker/focus-trap/dist/focus-trap.umd.min.js";
@@ -84,16 +84,11 @@ beforeEach(() => {
84
84
  ToastrModule.forRoot(),
85
85
  ],
86
86
  })
87
- Object.defineProperties(window, {
88
- location: {
89
- writable: true,
90
- value: {
91
- reload: jest.fn(),
92
- },
93
- },
94
- });
95
87
  });
96
88
 
89
+ // Mock window.location for tests
90
+ // We'll use a simpler approach that doesn't try to redefine read-only properties
91
+ // The tests will handle their own window.location mocking as needed
97
92
  // jest.setup.js
98
93
  Object.defineProperty(global.HTMLMediaElement.prototype, 'load', {
99
94
  configurable: true,
@@ -122,3 +117,5 @@ Object.defineProperty(global.HTMLMediaElement.prototype, 'addTextTrack', {
122
117
  writable: true,
123
118
  value: jest.fn(),
124
119
  });
120
+
121
+
package/tsconfig.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "sourceMap": true,
8
8
  "declaration": false,
9
9
  "target": "es2022",
10
- "module": "es2020",
10
+ "module": "es2022",
11
11
  "moduleResolution": "node",
12
12
  "esModuleInterop": true,
13
13
  "emitDecoratorMetadata": true,
@@ -16,7 +16,7 @@
16
16
  "node_modules/@types"
17
17
  ],
18
18
  "lib": [
19
- "es2018",
19
+ "es2022",
20
20
  "dom"
21
21
  ],
22
22
  "paths": {
@@ -44,11 +44,11 @@
44
44
  "@wm/components/base": [
45
45
  "node_modules/@wavemaker/app-ng-runtime/components/base"
46
46
  ],
47
- "@wm/components/basic": [
48
- "node_modules/@wavemaker/app-ng-runtime/components/basic/default"
47
+ "@wm/components/basic/*": [
48
+ "node_modules/@wavemaker/app-ng-runtime/components/basic/*"
49
49
  ],
50
- "@wm/components/input": [
51
- "node_modules/@wavemaker/app-ng-runtime/components/input/default"
50
+ "@wm/components/input/*": [
51
+ "node_modules/@wavemaker/app-ng-runtime/components/input/*"
52
52
  ],
53
53
  "@wm/components/page": [
54
54
  "node_modules/@wavemaker/app-ng-runtime/components/page/default"
@@ -34,8 +34,8 @@
34
34
  "@wm/core": [
35
35
  "node_modules/@wavemaker/app-ng-runtime/core"
36
36
  ],
37
- "@wm/components/basic": [
38
- "node_modules/@wavemaker/app-ng-runtime/components/basic/default"
37
+ "@wm/components/basic/*": [
38
+ "node_modules/@wavemaker/app-ng-runtime/components/basic/*"
39
39
  ],
40
40
  "@wm/components/input": [
41
41
  "node_modules/@wavemaker/app-ng-runtime/components/input/default"
@@ -1,7 +1,5 @@
1
1
  const CompressionPlugin = require(`compression-webpack-plugin`);
2
2
  const path = require(`path`);
3
- const {ConcatSource} = require("webpack-sources");
4
-
5
3
  const MomentLocalesPlugin = require('moment-locales-webpack-plugin');
6
4
 
7
5
  const wmPropertiesPath = path.join(__dirname, '/src/app/wmProperties.js');
@@ -12,65 +10,7 @@ const localesToKeep = Object.values(WMAppProperties.supportedLanguages)
12
10
  .map(lang => lang.moment)
13
11
  .filter(locale => locale !== null);
14
12
 
15
- const includeMomentPlugin = WMAppProperties.languageBundleSources === "STATIC";
16
-
17
- class ModifyCssAssetUrlsPlugin {
18
- apply(compiler) {
19
- compiler.hooks.compilation.tap('ModifyCssAssetUrlsPlugin', compilation => {
20
- compilation.hooks.optimizeAssets.tapAsync('ModifyCssAssetUrlsPlugin', (assets, callback) => {
21
- let publicPath = compilation.options.output.publicPath;
22
- let isResourceWithDeployUrl = false;
23
- for (const assetName in assets) {
24
- if (!assets.hasOwnProperty(assetName)) continue;
25
-
26
- const asset = assets[assetName];
27
- if (asset.sourceAndMap) {
28
- const sourceAndMap = asset.sourceAndMap();
29
- let updatedSource = sourceAndMap.source;
30
- // Handle potential non-string source (e.g., convert to string)
31
- if (typeof updatedSource !== 'string') {
32
- updatedSource = updatedSource.toString('utf-8');
33
- }
34
- let modifiedSource = updatedSource.replace(/url\((.*?)\)/g, (match, url) => {
35
- isResourceWithDeployUrl = true;
36
-
37
- let qUrl = url.slice(1, -1);
38
-
39
- if (!qUrl.startsWith(publicPath)) {
40
- return match;
41
- } else {
42
- const newUrl = this.modifyUrl(publicPath, qUrl);
43
- let urlString = `url('${newUrl}')`;
44
- return urlString;
45
- }
46
-
47
- });
48
- if (isResourceWithDeployUrl) {
49
- isResourceWithDeployUrl = false;
50
- assets[assetName] = new ConcatSource(modifiedSource);
51
- }
52
- }
53
- }
54
- callback(null, assets);
55
- });
56
- });
57
- }
58
-
59
- modifyUrl(publicPath, url) {
60
- let qUrl = url;
61
- let resourceName = qUrl;
62
- try {
63
- const parsedUrl = new URL(qUrl);
64
- resourceName = parsedUrl.pathname.split('/').pop();
65
- } catch (e) {
66
- //this is relative url
67
- let parts = qUrl.split('/');
68
- resourceName = parts[parts.length - 1];
69
- }
70
- let newUrl = `ng-bundle/${resourceName}`;
71
- return newUrl;
72
- }
73
- };
13
+ const includeMomentPlugin = WMAppProperties.languageBundleSources === "STATIC";
74
14
 
75
15
  module.exports = {
76
16
  resolve:{
@@ -79,7 +19,6 @@ module.exports = {
79
19
  }
80
20
  },
81
21
  plugins:[
82
- new ModifyCssAssetUrlsPlugin(),
83
22
  new CompressionPlugin({
84
23
  test: /\.(js|css|html|svg|txt|eot|otf|ttf|gif)$/,
85
24
  filename: "[name].gzip[ext]",
@@ -91,7 +30,7 @@ module.exports = {
91
30
  algorithm: "brotliCompress"
92
31
  }),
93
32
  // On STATIC WMAppProperties.languageBundleSources, required moment locales are included in the bundle
94
-
33
+
95
34
  /**
96
35
  * MomentLocalesPlugin is used to include only the required moment locales in the bundle.
97
36
  */
@@ -1,10 +0,0 @@
1
- import { Component } from "@angular/core";
2
- import { CommonModule } from "@angular/common";
3
-
4
- @Component({
5
- standalone: true,
6
- template: `<ng-content></ng-content>`,
7
- imports: [CommonModule],
8
- selector: 'bootstrap-wrapper',
9
- })
10
- export class BootstrapWrapperComponent { }