vite-plugin-php 1.0.9 → 1.0.11

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/README.md CHANGED
@@ -15,6 +15,9 @@ export default defineConfig({
15
15
  });
16
16
  ```
17
17
 
18
+ Check out the starter repo for an easy and convenient start:
19
+ <a href="https://github.com/nititech/php-vite-starter" target="_blank"><img src="https://nititech.de/kosmo-starter-button.png" alt="Starter Repo"></a>
20
+
18
21
  ## Write some PHP code in your `index.php`
19
22
 
20
23
  ```php
@@ -94,6 +97,27 @@ If you encounter any other bugs or need some other features feel free to open an
94
97
  Love open source? Enjoying my project?\
95
98
  Your support can keep the momentum going! Consider a donation to fuel the creation of more innovative open source software.
96
99
 
97
- | via Ko-Fi | Buy me a coffee | via PayPal |
98
- | --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
99
- | [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/Y8Y2ALMG) | <a href="https://www.buymeacoffee.com/donnikitos" target="_blank"><img src="https://nititech.de/donate-buymeacoffee.png" alt="Buy Me A Coffee" width="174"></a> | <a href="https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW" target="_blank"><img src="https://nititech.de/donate-paypal.png" alt="PayPal" width="174"></a> |
100
+ <table>
101
+ <tr>
102
+ <td>
103
+ via Ko-Fi
104
+ </td>
105
+ <td>
106
+ Buy me a coffee
107
+ </td>
108
+ <td>
109
+ via PayPal
110
+ </td>
111
+ </tr>
112
+ <tr>
113
+ <td>
114
+ <a href="https://ko-fi.com/Y8Y2ALMG" target="_blank"><img src="https://ko-fi.com/img/githubbutton_sm.svg" alt="Ko-Fi" width="174"></a>
115
+ </td>
116
+ <td>
117
+ <a href="https://www.buymeacoffee.com/donnikitos" target="_blank"><img src="https://nititech.de/donate-buymeacoffee.png" alt="Buy Me A Coffee" width="174"></a>
118
+ </td>
119
+ <td>
120
+ <a href="https://www.paypal.com/donate/?hosted_button_id=EPXZPRTR7JHDW" target="_blank"><img src="https://nititech.de/donate-paypal.png" alt="PayPal" width="174"></a>
121
+ </td>
122
+ </tr>
123
+ </table>
package/dist/index.cjs CHANGED
@@ -4,6 +4,7 @@ const require$$0 = require('fs');
4
4
  const require$$0$1 = require('path');
5
5
  const http = require('http');
6
6
  const child_process = require('child_process');
7
+ const url = require('url');
7
8
  const require$$0$2 = require('os');
8
9
  const require$$0$3 = require('util');
9
10
  const require$$0$4 = require('stream');
@@ -70,7 +71,7 @@ function start(root) {
70
71
  "localhost:" + phpServer.port,
71
72
  "-t",
72
73
  root,
73
- decodeURI(routerFileUrl.pathname)
74
+ url.fileURLToPath(routerFileUrl)
74
75
  ]).once("spawn", () => {
75
76
  console.log(
76
77
  `PHP development server started (PID: ${globalThis.php?.pid})`
@@ -6913,6 +6914,7 @@ function usePHP(cfg = {}) {
6913
6914
  url.pathname = tempFile;
6914
6915
  const phpResult = await new Promise(
6915
6916
  (resolve2, reject) => {
6917
+ const chunks = [];
6916
6918
  http__default.request(
6917
6919
  url.toString(),
6918
6920
  {
@@ -6920,7 +6922,16 @@ function usePHP(cfg = {}) {
6920
6922
  headers: req.headers
6921
6923
  },
6922
6924
  (msg) => {
6923
- msg.on("data", resolve2);
6925
+ msg.on(
6926
+ "data",
6927
+ (data) => chunks.push(data)
6928
+ );
6929
+ msg.on("end", () => {
6930
+ const result = Buffer.concat(
6931
+ chunks
6932
+ ).toString("utf8");
6933
+ resolve2(result);
6934
+ });
6924
6935
  }
6925
6936
  ).on("error", reject).end();
6926
6937
  }
package/dist/index.mjs CHANGED
@@ -2,6 +2,7 @@ import require$$0$4, { mkdirSync, writeFileSync, readFileSync, existsSync, rmSyn
2
2
  import require$$0$1, { dirname, resolve } from 'path';
3
3
  import http from 'http';
4
4
  import { spawn } from 'child_process';
5
+ import { fileURLToPath } from 'url';
5
6
  import require$$0 from 'os';
6
7
  import require$$0$2 from 'util';
7
8
  import require$$0$3 from 'stream';
@@ -57,7 +58,7 @@ function start(root) {
57
58
  "localhost:" + phpServer.port,
58
59
  "-t",
59
60
  root,
60
- decodeURI(routerFileUrl.pathname)
61
+ fileURLToPath(routerFileUrl)
61
62
  ]).once("spawn", () => {
62
63
  console.log(
63
64
  `PHP development server started (PID: ${globalThis.php?.pid})`
@@ -6900,6 +6901,7 @@ function usePHP(cfg = {}) {
6900
6901
  url.pathname = tempFile;
6901
6902
  const phpResult = await new Promise(
6902
6903
  (resolve2, reject) => {
6904
+ const chunks = [];
6903
6905
  http.request(
6904
6906
  url.toString(),
6905
6907
  {
@@ -6907,7 +6909,16 @@ function usePHP(cfg = {}) {
6907
6909
  headers: req.headers
6908
6910
  },
6909
6911
  (msg) => {
6910
- msg.on("data", resolve2);
6912
+ msg.on(
6913
+ "data",
6914
+ (data) => chunks.push(data)
6915
+ );
6916
+ msg.on("end", () => {
6917
+ const result = Buffer.concat(
6918
+ chunks
6919
+ ).toString("utf8");
6920
+ resolve2(result);
6921
+ });
6911
6922
  }
6912
6923
  ).on("error", reject).end();
6913
6924
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vite-plugin-php",
3
- "version": "1.0.9",
3
+ "version": "1.0.11",
4
4
  "description": "Precompile PHP-files with the speed of Vite",
5
5
  "keywords": [
6
6
  "vite",
@@ -51,10 +51,10 @@
51
51
  },
52
52
  "dependencies": {},
53
53
  "devDependencies": {
54
- "@types/node": "^20.11.5",
54
+ "@types/node": "^20.12.7",
55
55
  "fast-glob": "^3.3.2",
56
- "typescript": "^5.3.3",
56
+ "typescript": "^5.4.5",
57
57
  "unbuild": "^2.0.0",
58
- "vite": "^5.1.3"
58
+ "vite": "^5.2.8"
59
59
  }
60
60
  }