sdc-build-wp 5.6.8 → 5.6.9

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/.phpcs.xml CHANGED
@@ -34,7 +34,7 @@
34
34
  <rule ref="Generic.Formatting.DisallowMultipleStatements"/>
35
35
  <rule ref="Generic.Functions.OpeningFunctionBraceKernighanRitchie">
36
36
  <properties>
37
- <property name="checkFunctions" value="false" />
37
+ <property name="checkFunctions" value="true" />
38
38
  <property name="checkClosures" value="true" />
39
39
  </properties>
40
40
  </rule>
@@ -81,22 +81,23 @@ export default class PHPComponent extends BaseComponent {
81
81
  cwd: this.path.resolve(this.path.dirname(fileURLToPath(import.meta.url)), '../../')
82
82
  }); // returns an error if any violations are found, so we can't rely on the try/catch as usual
83
83
  } catch (error) {
84
- if (error.stderr?.length && error.stderr.includes('No fixable errors were found')) {
85
- // No fixable errors were found, but there may still be warnings
86
- if (error.stdout?.length) {
87
- this.log(null, error.stdout);
88
- }
84
+ // Filter out Time: and Memory: lines from error output
85
+ const filterLines = str => str
86
+ ? str.split('\n').filter(line => !line.trim().startsWith('Time:') && !line.trim().startsWith('Memory:')).join('\n')
87
+ : str;
88
+ if (filterLines(error.stderr)?.length && error.stderr.includes('No fixable errors were found')) {
89
+ // No fixable errors were found
89
90
  } else if (
90
- error.stderr?.length ||
91
+ (filterLines(error.stderr)?.length && !error.stderr.trim().startsWith('Time:')) ||
91
92
  (
92
- error.stdout?.length &&
93
+ filterLines(error.stdout)?.length &&
93
94
  (
94
95
  error.stdout.startsWith('ERROR:') ||
95
96
  error.stdout.includes('FAILED TO FIX')
96
97
  )
97
98
  )
98
99
  ) {
99
- this.log(null, error.stderr?.length ? error.stderr : error.stdout);
100
+ this.log(null, filterLines(error.stderr)?.length ? filterLines(error.stderr) : filterLines(error.stdout));
100
101
  this.log('error', `Failed linting ${entryLabel.replace(this.project.path, '')} - See above error.`);
101
102
  return false;
102
103
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sdc-build-wp",
3
- "version": "5.6.8",
3
+ "version": "5.6.9",
4
4
  "description": "Custom WordPress build process.",
5
5
  "engines": {
6
6
  "node": ">=22"