@iservice-dev/is-wp-plugin-kit 1.7.3 → 1.7.5

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,22 @@
1
1
  import { execSync } from 'node:child_process';
2
2
 
3
- export function runBuild() {
4
- execSync('oxlint assets/src/ts', { stdio: 'inherit' });
5
- execSync('stylelint "assets/src/scss/**/*.scss" --fix', { stdio: 'inherit' });
3
+ export async function runBuild() {
4
+ const { globSync } = await import('glob');
5
+
6
+ const tsFiles = globSync('assets/src/ts/**/*.ts');
7
+ if (tsFiles.length > 0) {
8
+ execSync('oxlint assets/src/ts', { stdio: 'inherit' });
9
+ } else {
10
+ console.log('↺ No TypeScript files found, skipping oxlint');
11
+ }
12
+
13
+ const scssFiles = globSync('assets/src/scss/**/*.scss');
14
+ if (scssFiles.length > 0) {
15
+ execSync('stylelint "assets/src/scss/**/*.scss" --fix', { stdio: 'inherit' });
16
+ } else {
17
+ console.log('↺ No SCSS files found, skipping stylelint');
18
+ }
19
+
6
20
  execSync('vite build', { stdio: 'inherit' });
7
21
  execSync('is-wp-plugin-kit compile-mo', { stdio: 'inherit' });
8
22
 
@@ -1,13 +1,23 @@
1
1
  import { execSync } from 'node:child_process';
2
2
 
3
- 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
- );
3
+ export async function runDev() {
4
+ const { globSync } = await import('glob');
5
+
6
+ const commands = ['"vite"'];
7
+
8
+ const tsFiles = globSync('assets/src/ts/**/*.ts');
9
+ if (tsFiles.length > 0) {
10
+ commands.push("\"chokidar 'assets/src/ts/**/*.ts' -c 'oxlint assets/src/ts'\"");
11
+ }
12
+
13
+ const scssFiles = globSync('assets/src/scss/**/*.scss');
14
+ if (scssFiles.length > 0) {
15
+ commands.push(
16
+ '"chokidar \'assets/src/scss/**/*.scss\' -c \'stylelint \\"assets/src/scss/**/*.scss\\" --fix\'"'
17
+ );
18
+ }
19
+ commands.push("\"chokidar 'assets/src/l10n/**/*.po' -c 'is-wp-plugin-kit compile-mo'\"");
20
+
21
+ execSync(`concurrently -k ${commands.join(' ')}`, { stdio: 'inherit' });
12
22
  process.exit(0);
13
23
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservice-dev/is-wp-plugin-kit",
3
- "version": "1.7.3",
3
+ "version": "1.7.5",
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",