@wavemaker/angular-codegen 11.7.0-rc.5526 → 11.7.0-rc.5531

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,11 +4,11 @@ const path = require('path');
4
4
  let processArgs = process.argv;
5
5
  if (processArgs.findIndex(arg => arg.startsWith('--max-old-space-size')) !== -1) {
6
6
  process.env.NODE_OPTIONS = processArgs.pop();
7
+ console.log("Setting node options: ", process.env.NODE_OPTIONS);
7
8
  }
8
9
  const args = processArgs.slice(2);
9
10
  const ngBuildArgs = ['build', ...args];
10
- console.log("Build params - ", ngBuildArgs);
11
- console.log("Setting node options - ", process.env.NODE_OPTIONS);
11
+ console.log("\x1b[33m", "Angular build params: ", ngBuildArgs);
12
12
 
13
13
  //Trigger angular build with the passed params
14
14
  const ngPath = path.resolve(process.cwd(), 'node_modules', '.bin', "ng");
@@ -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.11",
39
- "@wavemaker/variables": "11.7.0-rc.5526",
39
+ "@wavemaker/variables": "11.7.0-rc.5531",
40
40
  "@ztree/ztree_v3": "^3.5.48",
41
41
  "angular-imask": "7.4.0",
42
42
  "angular2-websocket": "0.9.7",
@@ -55,7 +55,6 @@
55
55
  "ngx-bootstrap": "9.0.0",
56
56
  "ngx-color-picker": "16.0.0",
57
57
  "ngx-toastr": "17.0.2",
58
- "nvd3": "^1.8.6",
59
58
  "rxjs": "6.6.0",
60
59
  "rxjs-compat": "6.4.0",
61
60
  "summernote": "0.8.18",
@@ -5690,9 +5689,9 @@
5690
5689
  }
5691
5690
  },
5692
5691
  "node_modules/@wavemaker/variables": {
5693
- "version": "11.7.0-rc.5526",
5694
- "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.7.0-rc.5526.tgz",
5695
- "integrity": "sha512-ivIYGyQisK4lNeuN/mzbjchMR8h2EkHK7hbfnZhEcR+YGF6XFHCZUn14feGXkf/TQgW//QSsiXuYPkfp/4csnQ==",
5692
+ "version": "11.7.0-rc.5531",
5693
+ "resolved": "https://registry.npmjs.org/@wavemaker/variables/-/variables-11.7.0-rc.5531.tgz",
5694
+ "integrity": "sha512-nfjn/5NsM7SZ+KGrcOD6kAVXwS4NS8w45DNSHm3vxIs0ooaCM6/6FdSuFGD5fDNHmI6ECLM51wRrYSLduPr8nQ==",
5696
5695
  "dependencies": {
5697
5696
  "@metrichor/jmespath": "^0.3.1",
5698
5697
  "he": "^1.2.0",
@@ -17642,14 +17641,6 @@
17642
17641
  "node": ">=0.10.0"
17643
17642
  }
17644
17643
  },
17645
- "node_modules/nvd3": {
17646
- "version": "1.8.6",
17647
- "resolved": "https://registry.npmjs.org/nvd3/-/nvd3-1.8.6.tgz",
17648
- "integrity": "sha512-YGQ9hAQHuQCF0JmYkT2GhNMHb5pA+vDfQj6C2GdpQPzdRPj/srPG3mh/3fZzUFt+at1NusLk/RqICUWkxm4viQ==",
17649
- "peerDependencies": {
17650
- "d3": "^3.4.4"
17651
- }
17652
- },
17653
17644
  "node_modules/nwsapi": {
17654
17645
  "version": "2.2.7",
17655
17646
  "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.2.7.tgz",
@@ -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.11",
50
- "@wavemaker/variables": "11.7.0-rc.5526",
50
+ "@wavemaker/variables": "11.7.0-rc.5531",
51
51
  "@ztree/ztree_v3": "^3.5.48",
52
52
  "angular-imask": "7.4.0",
53
53
  "angular2-websocket": "0.9.7",
@@ -66,14 +66,13 @@
66
66
  "ngx-bootstrap": "9.0.0",
67
67
  "ngx-color-picker": "16.0.0",
68
68
  "ngx-toastr": "17.0.2",
69
- "nvd3": "^1.8.6",
70
69
  "rxjs": "6.6.0",
71
70
  "rxjs-compat": "6.4.0",
72
71
  "summernote": "0.8.18",
73
72
  "tslib": "2.4.1",
74
73
  "x2js": "^3.4.4",
75
74
  "zone.js": "~0.13.3",
76
- "@wavemaker/app-ng-runtime": "11.7.0-rc.5526"
75
+ "@wavemaker/app-ng-runtime": "11.7.0-rc.5531"
77
76
  },
78
77
  "devDependencies": {
79
78
  "@ampproject/rollup-plugin-closure-compiler": "^0.27.0",
@@ -1,5 +1,64 @@
1
1
  const CompressionPlugin = require(`compression-webpack-plugin`);
2
2
  const path = require(`path`);
3
+ const {ConcatSource} = require("webpack-sources");
4
+
5
+ class ModifyCssAssetUrlsPlugin {
6
+ apply(compiler) {
7
+ compiler.hooks.compilation.tap('ModifyCssAssetUrlsPlugin', compilation => {
8
+ compilation.hooks.optimizeAssets.tapAsync('ModifyCssAssetUrlsPlugin', (assets, callback) => {
9
+ let publicPath = compilation.options.output.publicPath;
10
+ let isResourceWithDeployUrl = false;
11
+ for (const assetName in assets) {
12
+ if (!assets.hasOwnProperty(assetName)) continue;
13
+
14
+ const asset = assets[assetName];
15
+ if (asset.sourceAndMap) {
16
+ const sourceAndMap = asset.sourceAndMap();
17
+ let updatedSource = sourceAndMap.source;
18
+ // Handle potential non-string source (e.g., convert to string)
19
+ if (typeof updatedSource !== 'string') {
20
+ updatedSource = updatedSource.toString('utf-8');
21
+ }
22
+ let modifiedSource = updatedSource.replace(/url\((.*?)\)/g, (match, url) => {
23
+ isResourceWithDeployUrl = true;
24
+
25
+ let qUrl = url.slice(1, -1);
26
+
27
+ if (!qUrl.startsWith(publicPath)) {
28
+ return match;
29
+ } else {
30
+ const newUrl = this.modifyUrl(publicPath, qUrl);
31
+ let urlString = `url('${newUrl}')`;
32
+ return urlString;
33
+ }
34
+
35
+ });
36
+ if (isResourceWithDeployUrl) {
37
+ isResourceWithDeployUrl = false;
38
+ assets[assetName] = new ConcatSource(modifiedSource);
39
+ }
40
+ }
41
+ }
42
+ callback(null, assets);
43
+ });
44
+ });
45
+ }
46
+
47
+ modifyUrl(publicPath, url) {
48
+ let qUrl = url;
49
+ let resourceName = qUrl;
50
+ try {
51
+ const parsedUrl = new URL(qUrl);
52
+ resourceName = parsedUrl.pathname.split('/').pop();
53
+ } catch (e) {
54
+ //this is relative url
55
+ let parts = qUrl.split('/');
56
+ resourceName = parts[parts.length - 1];
57
+ }
58
+ let newUrl = `ng-bundle/${resourceName}`;
59
+ return newUrl;
60
+ }
61
+ };
3
62
 
4
63
  module.exports = {
5
64
  resolve:{
@@ -8,6 +67,7 @@ module.exports = {
8
67
  }
9
68
  },
10
69
  plugins:[
70
+ new ModifyCssAssetUrlsPlugin(),
11
71
  new CompressionPlugin({
12
72
  test: /\.(js|css|html|svg|txt|eot|otf|ttf|gif)$/,
13
73
  filename: "[name].gzip[ext]",
@@ -25,9 +25,16 @@ const updateDeployUrl = (args) => {
25
25
  const deployParam = buildArgs.find(i => i.startsWith("--deploy-url="));
26
26
  if(!deployParam) {
27
27
  buildArgs.push("--deploy-url=ng-bundle/");
28
+ } else {
29
+ buildArgs.filter((param, index) => {
30
+ if (param.includes('--deploy-url=_cdnUrl_')) {
31
+ buildArgs[index] = "--deploy-url=_cdnUrl_/ng-bundle/"
32
+ return true;
33
+ }
34
+ });
28
35
  }
29
36
  buildArgs.push(args.nodeVMArgs);
30
- return ngBuildParams = buildArgs.join(" ");
37
+ return buildArgs.join(" ");
31
38
  };
32
39
 
33
40
  /**
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wavemaker/angular-codegen",
3
- "version": "11.7.0-rc.5526",
3
+ "version": "11.7.0-rc.5531",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {