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