@caweb/cli 1.15.21 → 1.16.0

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.
@@ -77,7 +77,7 @@ export default async function webpack({
77
77
  }
78
78
 
79
79
  let unknown = false;
80
- let unkownArgs = [];
80
+ let unknownArgs = [];
81
81
 
82
82
  // we have to filter out unknown args to avoid webpack errors
83
83
  webPackArgs = webPackArgs.filter( (e) => {
@@ -88,7 +88,7 @@ export default async function webpack({
88
88
 
89
89
  // save unknown flag
90
90
  if( unknown ){
91
- unkownArgs.push(e);
91
+ unknownArgs.push(e);
92
92
  }
93
93
 
94
94
  // return if known flag
@@ -96,7 +96,7 @@ export default async function webpack({
96
96
  }else{
97
97
  // save unknown args
98
98
  if( unknown ){
99
- unkownArgs.push(e);
99
+ unknownArgs.push(e);
100
100
  }
101
101
 
102
102
  // if flag was known return the value, else false
@@ -114,7 +114,7 @@ export default async function webpack({
114
114
  ],
115
115
  {
116
116
  stdio: 'inherit',
117
- argv0: unkownArgs.join(' ')
117
+ unknownArgs
118
118
  }
119
119
  );
120
120
  };
@@ -36,7 +36,7 @@ let patterns = fs.readdirSync(path.join(templatePath, 'patterns'), { withFileTyp
36
36
  .map( ( dirent ) => {
37
37
 
38
38
  let fileTemplate = path.join( dirent.parentPath, dirent.name );
39
- let filename = fileTemplate.replace(path.join(templatePath, 'patterns'), '').replace(/\\/g, '');
39
+ let filename = fileTemplate.replace(path.join(templatePath, 'patterns'), '').replace(/^[\\\/]/, '');
40
40
 
41
41
  // we ignore the default and blank patterns since those are used as templates and not actual pages
42
42
  // if there is no Google Search Id we ignore the search pattern since that is only used for the Search Results page
@@ -63,7 +63,7 @@ let additionalPages = ! fs.existsSync( basePageDir ) ? [] :
63
63
  .map( ( dirent ) => {
64
64
 
65
65
  let fileTemplate = path.join( dirent.parentPath, dirent.name );
66
- let filename = fileTemplate.replace(basePageDir, '').replace(/\\/, '');
66
+ let filename = fileTemplate.replace(basePageDir, '').replace(/^[\\\/]/, '');
67
67
 
68
68
  // if additionl pages match a pattern page we remove ours
69
69
  let override = patterns.find( (p) => p.filename === filename );
@@ -103,7 +103,7 @@ export default {
103
103
 
104
104
  let data = {
105
105
  ...caweb.site,
106
- scheme
106
+ scheme,
107
107
  };
108
108
 
109
109
  let compiler = Handlebars.compile( content );
@@ -118,7 +118,7 @@ export default {
118
118
  partial: compiledContent,
119
119
  },
120
120
  })
121
- }) ,
121
+ }).filter( Boolean ) ,
122
122
 
123
123
  // Sitemap Generation
124
124
  ( ! flagExists('sitemap') || (flagExists('sitemap') && getArgVal('sitemap'))) && new SitemapWebpackPlugin.default({
package/lib/helpers.js CHANGED
@@ -7,7 +7,6 @@ import spawn from 'cross-spawn';
7
7
  import { fileURLToPath } from 'url';
8
8
  import { sync as resolveBin } from 'resolve-bin';
9
9
  import * as dockerCompose from 'docker-compose';
10
- import { promisify } from 'util';
11
10
  import crypto from 'crypto';
12
11
 
13
12
  /**
@@ -62,7 +61,26 @@ async function runCmd(cmd, args,opts = { stdio: 'pipe' }){
62
61
  break;
63
62
  }
64
63
 
65
- return spawn.sync( cmd, args, {...opts, env: process.env});
64
+ // on Mac we can't pass unknown flags to the NODE_OPTIONS so instead we pass it to CAWEB_NODE_OPTIONS
65
+ // we always make sure the CAWEB_NODE_OPTIONS has a value even if its just blank
66
+ process.env.CAWEB_NODE_OPTIONS = process.env.CAWEB_NODE_OPTIONS ?? '';
67
+
68
+ // unknownArgs get appened to the CAWEB_NODE_OPTIONS
69
+ let uArgs = '';
70
+
71
+ if( opts.unknownArgs ){
72
+ uArgs = opts.unknownArgs.join(' ');
73
+ delete opts.unknownArgs;
74
+
75
+ process.env.CAWEB_NODE_OPTIONS += ' ' + uArgs;
76
+
77
+ }
78
+
79
+
80
+ return spawn.sync( cmd, args, {
81
+ ...opts,
82
+ env: process.env
83
+ });
66
84
  }
67
85
 
68
86
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@caweb/cli",
3
- "version": "1.15.21",
3
+ "version": "1.16.0",
4
4
  "description": "CAWebPublishing Command Line Interface.",
5
5
  "exports": "./lib/env.js",
6
6
  "type": "module",
@@ -40,11 +40,11 @@
40
40
  "access": "public"
41
41
  },
42
42
  "config": {
43
- "WP_VER": "6.9",
43
+ "WP_VER": "6.9.1",
44
44
  "PHP_VER": "8.4",
45
45
  "CAWEB_VER": "1.13.3",
46
- "DIVI_VER": "4.27.4",
47
- "QUERY_MONITOR": "3.20.0",
46
+ "DIVI_VER": "4.27.5",
47
+ "QUERY_MONITOR": "3.20.2",
48
48
  "DEFAULTS": {
49
49
  "FS_METHOD": "direct",
50
50
  "WP_DEBUG": true,
@@ -64,14 +64,15 @@
64
64
  }
65
65
  },
66
66
  "dependencies": {
67
- "@caweb/a11y-webpack-plugin": "^2.1.4",
68
- "@caweb/css-audit-webpack-plugin": "^2.1.3",
69
- "@caweb/html-webpack-plugin": "^2.1.7",
70
- "@caweb/jshint-webpack-plugin": "^2.1.3",
71
- "@caweb/webpack": "^1.6.8",
72
- "@inquirer/prompts": "^8.2.0",
73
- "@wordpress/create-block": "^4.82.0",
74
- "@wordpress/env": "^10.39.0",
67
+ "@caweb/a11y-webpack-plugin": "^2.1.5",
68
+ "@caweb/css-audit-webpack-plugin": "^2.1.4",
69
+ "@caweb/html-webpack-plugin": "^2.1.8",
70
+ "@caweb/jshint-webpack-plugin": "^2.1.4",
71
+ "@caweb/webpack": "^1.6.9",
72
+ "@inquirer/prompts": "^8.2.1",
73
+ "@noble/hashes": "^1.8.0",
74
+ "@wordpress/create-block": "^4.83.0",
75
+ "@wordpress/env": "^11.0.0",
75
76
  "axios": "^1.13.5",
76
77
  "axios-retry": "^4.5.0",
77
78
  "chalk": "^5.6.2",
@@ -80,15 +81,15 @@
80
81
  "crypto": "^1.0.1",
81
82
  "deepmerge": "^4.3.1",
82
83
  "docker-compose": "^1.3.1",
83
- "fast-xml-parser": "^5.3.5",
84
+ "fast-xml-parser": "^5.3.6",
84
85
  "fs-extra": "^11.3.3",
85
86
  "html-to-json-parser": "^2.0.1",
86
87
  "inquirer-select-pro": "^1.0.0-alpha.9",
87
- "jsdom": "^28.0.0",
88
+ "jsdom": "^28.1.0",
88
89
  "node-html-parser": "^7.0.2",
89
90
  "ora": "^9.3.0",
90
91
  "resolve-bin": "^1.0.1",
91
- "rimraf": "^6.1.2",
92
+ "rimraf": "^6.1.3",
92
93
  "sitemap-webpack-plugin": "^1.1.1",
93
94
  "terminal-link": "^5.0.0"
94
95
  }