chokibasic 1.0.3 → 1.0.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.
- package/package.json +8 -3
- package/src/watcher.js +13 -1
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chokibasic",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Basic chokidar watcher + esbuild + sass + csso helpers",
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Basic chokidar watcher + pxpros + esbuild + sass + csso helpers",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
7
|
-
"files": [
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"index.d.ts",
|
|
10
|
+
"src/"
|
|
11
|
+
],
|
|
8
12
|
"scripts": {
|
|
9
13
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
10
14
|
},
|
|
@@ -30,6 +34,7 @@
|
|
|
30
34
|
"chokidar": "^5.0.0",
|
|
31
35
|
"csso": "^5.0.5",
|
|
32
36
|
"esbuild": "^0.27.3",
|
|
37
|
+
"pxpros": "^1.0.0",
|
|
33
38
|
"sass": "^1.97.3"
|
|
34
39
|
}
|
|
35
40
|
}
|
package/src/watcher.js
CHANGED
|
@@ -4,6 +4,7 @@ const path = require("path");
|
|
|
4
4
|
const esbuild = require("esbuild");
|
|
5
5
|
const sass = require("sass");
|
|
6
6
|
const csso = require("csso");
|
|
7
|
+
const pxpros = require("pxpros");
|
|
7
8
|
|
|
8
9
|
|
|
9
10
|
function toPosix(p) {
|
|
@@ -257,4 +258,15 @@ const buildJS = async (entry, outfile, options = {}) => {
|
|
|
257
258
|
}
|
|
258
259
|
|
|
259
260
|
|
|
260
|
-
|
|
261
|
+
const buildPHP = async (file) => {
|
|
262
|
+
const results = await pxpros.render(file);
|
|
263
|
+
if(results.success) {
|
|
264
|
+
results.files.forEach(file => console.log(`✅ HTML generated: ${file}`));
|
|
265
|
+
} else {
|
|
266
|
+
console.error("❌ pxpros render failed.");
|
|
267
|
+
console.error(results.error);
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
|
|
272
|
+
module.exports = { createWatchers, buildCSS, buildJS, buildPHP };
|