@iservice-dev/is-wp-plugin-kit 1.7.6 → 1.7.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/vite/index.js +14 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iservice-dev/is-wp-plugin-kit",
3
- "version": "1.7.6",
3
+ "version": "1.7.9",
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,7 +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
+ "glob": "^13.0.6",
31
31
  "oxlint": "^1.20.0",
32
32
  "po2mo": "^2.0.7",
33
33
  "sass-embedded": "^1.92.0",
package/vite/index.js CHANGED
@@ -2,6 +2,7 @@ import { defineConfig } from "vite";
2
2
  import fg from "fast-glob";
3
3
  import path from "node:path";
4
4
  import { fileURLToPath } from "node:url";
5
+ import { writeFileSync } from "node:fs";
5
6
  import { viteStaticCopy } from "vite-plugin-static-copy";
6
7
 
7
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
@@ -103,7 +104,19 @@ export function wpPluginKitVite(userOptions = {}) {
103
104
 
104
105
  css: { postcss: "./postcss.config.cjs" },
105
106
 
106
- plugins: [viteStaticCopy({ targets: validTargets })],
107
+ plugins: [
108
+ {
109
+ name: 'generate-build-version',
110
+ buildStart() {
111
+ const buildVersion = Date.now().toString();
112
+ writeFileSync(
113
+ path.resolve(cwd, 'includes/build-version.php'),
114
+ `<?php\n// Auto-generated build version\nreturn '${buildVersion}';\n`
115
+ );
116
+ }
117
+ },
118
+ viteStaticCopy({ targets: validTargets })
119
+ ],
107
120
 
108
121
  ...userOptions,
109
122
  });