@iservice-dev/is-wp-plugin-kit 1.7.2 → 1.7.4

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,8 +1,18 @@
1
1
  import { execSync } from 'node:child_process';
2
+ import { globSync } from 'glob';
2
3
 
3
4
  export function runBuild() {
4
- execSync('oxlint assets/src/ts', { stdio: 'inherit' });
5
- execSync('stylelint "assets/src/scss/**/*.scss" --fix', { stdio: 'inherit' });
5
+
6
+ const tsFiles = globSync('assets/src/ts/**/*.ts');
7
+ if (tsFiles.length > 0) {
8
+ execSync('oxlint assets/src/ts', { stdio: 'inherit' });
9
+ }
10
+
11
+ const scssFiles = globSync('assets/src/scss/**/*.scss');
12
+ if (scssFiles.length > 0) {
13
+ execSync('stylelint "assets/src/scss/**/*.scss" --fix', { stdio: 'inherit' });
14
+ }
15
+
6
16
  execSync('vite build', { stdio: 'inherit' });
7
17
  execSync('is-wp-plugin-kit compile-mo', { stdio: 'inherit' });
8
18
 
@@ -1,13 +1,20 @@
1
1
  import { execSync } from 'node:child_process';
2
+ import { globSync } from 'glob';
2
3
 
3
4
  export function runDev() {
4
- execSync(
5
- 'concurrently -k ' +
6
- '"vite" ' +
7
- "\"chokidar 'assets/src/ts/**/*.ts' -c 'oxlint assets/src/ts'\" " +
8
- "\"chokidar 'assets/src/scss/**/*.scss' -c 'stylelint \\\"assets/src/scss/**/*.scss\\\" --fix'\" " +
9
- "\"chokidar 'assets/src/l10n/**/*.po' -c 'is-wp-plugin-kit compile-mo'\"",
10
- { stdio: 'inherit' }
11
- );
5
+ const commands = ['"vite"'];
6
+
7
+ const tsFiles = globSync('assets/src/ts/**/*.ts');
8
+ if (tsFiles.length > 0) {
9
+ commands.push("\"chokidar 'assets/src/ts/**/*.ts' -c 'oxlint assets/src/ts'\"");
10
+ }
11
+
12
+ const scssFiles = globSync('assets/src/scss/**/*.scss');
13
+ if (scssFiles.length > 0) {
14
+ commands.push("\"chokidar 'assets/src/scss/**/*.scss' -c 'stylelint \\\"assets/src/scss/**/*.scss\\\" --fix'\"");
15
+ }
16
+ commands.push("\"chokidar 'assets/src/l10n/**/*.po' -c 'is-wp-plugin-kit compile-mo'\"");
17
+
18
+ execSync(`concurrently -k ${commands.join(' ')}`, { stdio: 'inherit' });
12
19
  process.exit(0);
13
20
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "ignore": [
2
+ "ignorePatterns": [
3
3
  "assets/src/legacy/**/*"
4
4
  ],
5
5
  "rules": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservice-dev/is-wp-plugin-kit",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "description": "A toolkit for WordPress plugin development with Vite, TypeScript, and modern build tools",
5
5
  "type": "module",
6
6
  "main": "vite/index.js",
@@ -27,6 +27,7 @@
27
27
  "autoprefixer": "^10.4.21",
28
28
  "chokidar-cli": "^3.0.0",
29
29
  "fast-glob": "^3.3.3",
30
+ "glob": "^11.0.0",
30
31
  "oxlint": "^1.20.0",
31
32
  "po2mo": "^2.0.7",
32
33
  "sass-embedded": "^1.92.0",