@wavemaker/angular-codegen 11.6.2-next.26324 → 11.6.2-next.26326

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.
@@ -1,18 +1,23 @@
1
1
  const { spawnSync } = require('child_process');
2
2
  const path = require('path');
3
3
 
4
- const args = process.argv.slice(2);
5
-
4
+ let processArgs = process.argv;
5
+ if (processArgs.findIndex(arg => arg.startsWith('--max-old-space-size')) !== -1) {
6
+ process.env.NODE_OPTIONS = processArgs.pop();
7
+ }
8
+ const args = processArgs.slice(2);
6
9
  const ngBuildArgs = ['build', ...args];
7
10
  console.log("Build params - ", ngBuildArgs);
11
+ console.log("Setting node options - ", process.env.NODE_OPTIONS);
8
12
 
9
13
  //Trigger angular build with the passed params
10
14
  const ngPath = path.resolve(process.cwd(), 'node_modules', '.bin', "ng");
11
- const ngBuildProcess = spawnSync(ngPath, ngBuildArgs, { stdio: 'inherit', shell: true });
15
+ const ngBuildProcess = spawnSync(ngPath, ngBuildArgs, {stdio: 'inherit', shell: true});
12
16
 
13
17
  if (ngBuildProcess.status === 0) {
14
18
  console.log('ng build completed successfully!');
15
19
  } else {
20
+ // TODO: JS heap out of memory error handling
16
21
  console.error('Error during ng build:', ngBuildProcess.error || ngBuildProcess.stderr);
17
22
  process.exit(1);
18
23
  }
@@ -36,7 +36,7 @@
36
36
  "@metrichor/jmespath": "^0.3.1",
37
37
  "@wavemaker/focus-trap": "^1.0.0",
38
38
  "@wavemaker/nvd3": "1.8.9",
39
- "@wavemaker/variables": "11.6.2-next.26324",
39
+ "@wavemaker/variables": "11.6.2-next.26326",
40
40
  "@ztree/ztree_v3": "^3.5.48",
41
41
  "angular-imask": "6.3.0",
42
42
  "angular2-websocket": "0.9.7",
@@ -5947,9 +5947,9 @@
5947
5947
  }
5948
5948
  },
5949
5949
  "node_modules/@wavemaker/variables": {
5950
- "version": "11.6.2-next.26324",
5951
- "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.6.2-next.26324.tgz",
5952
- "integrity": "sha512-C822Pdm1NSxLYw3Q0BJitYBtUn0U6RAgv6KDso7+lzCvXctx5yhIMqxAa0CbQuHvIhQMwvbLMlmMV3GbkKiwoQ==",
5950
+ "version": "11.6.2-next.26326",
5951
+ "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.6.2-next.26326.tgz",
5952
+ "integrity": "sha512-py3ZE8t7b4B1sFeGIbD0exmDZY5BpHHBhromUVm0MowE8ydk7Fw3msd6bor6DVduXkokA2AwpdUFHlNfmRFEIw==",
5953
5953
  "dependencies": {
5954
5954
  "@metrichor/jmespath": "^0.3.1",
5955
5955
  "he": "^1.2.0",
@@ -47,7 +47,7 @@
47
47
  "@metrichor/jmespath": "^0.3.1",
48
48
  "@wavemaker/focus-trap": "^1.0.0",
49
49
  "@wavemaker/nvd3": "1.8.9",
50
- "@wavemaker/variables": "11.6.2-next.26324",
50
+ "@wavemaker/variables": "11.6.2-next.26326",
51
51
  "@ztree/ztree_v3": "^3.5.48",
52
52
  "angular-imask": "6.3.0",
53
53
  "angular2-websocket": "0.9.7",
@@ -72,7 +72,7 @@
72
72
  "tslib": "2.4.1",
73
73
  "x2js": "^3.4.4",
74
74
  "zone.js": "~0.11.4",
75
- "@wavemaker/app-ng-runtime": "11.6.2-next.26324"
75
+ "@wavemaker/app-ng-runtime": "11.6.2-next.26326"
76
76
  },
77
77
  "devDependencies": {
78
78
  "@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
@@ -20,12 +20,13 @@ const { executeSyncCmd, MSG_NG_RUNTIME_LOG, MSG_NG_RUNTIME_SUCCESS } = require(
20
20
  /**
21
21
  * @TODO: This is a temporary workaround to extract deploy-url from 'ngBuildParams', need to be replaced in future.
22
22
  */
23
- const updateDeployUrl = (ngBuildParams) => {
24
- let buildArgs = ngBuildParams.split(' ');
23
+ const updateDeployUrl = (args) => {
24
+ let buildArgs = args.ngBuildParams.split(' ');
25
25
  const deployParam = buildArgs.find(i => i.startsWith("--deploy-url="));
26
26
  if(!deployParam) {
27
27
  buildArgs.push("--deploy-url=ng-bundle/");
28
28
  }
29
+ buildArgs.push(args.nodeVMArgs);
29
30
  return ngBuildParams = buildArgs.join(" ");
30
31
  };
31
32
 
@@ -59,10 +60,10 @@ const buildAngularApp = (args) => {
59
60
  process.exit(err.code || err.pid);
60
61
  }
61
62
 
62
- let ngBuildParams = updateDeployUrl(args.ngBuildParams);
63
+ let ngBuildParams = updateDeployUrl(args);
63
64
  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';
64
65
  // Generating the angular build and post build process.
65
- executeSyncCmd('cd ' + args.appTarget + ' && node ' + args.nodeVMArgs.trim() + ' ./build-scripts/build.js ' + ngBuildParams , null, MSG_NG_RUNTIME_LOG, false, NG_BUILD_MSG);
66
+ executeSyncCmd('cd ' + args.appTarget + ' && node ./build-scripts/build.js ' + ngBuildParams, null, MSG_NG_RUNTIME_LOG, false, NG_BUILD_MSG);
66
67
  }
67
68
 
68
69
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.6.2-next.26324",
3
+ "version": "11.6.2-next.26326",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {