@capsulescodes/browser-php 0.6.5 → 0.6.7

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
@@ -107,7 +107,7 @@ npm run composer
107
107
  > / /___/ /_/ / / / / / / /_/ / /_/ (__ ) __/ /
108
108
  > \____/\____/_/ /_/ /_/ .___/\____/____/\___/_/
109
109
  > /_/
110
- > Composer version 2.9.2 2025-11-19 21:57:25
110
+ > Composer version 2.9.3 2025-12-30 13:40:17
111
111
  ```
112
112
 
113
113
  <br>
@@ -120,7 +120,7 @@ The scripts can be configured with environment variables
120
120
  - `BROWSER_PHP_VERSION` : The PHP version you need | default : `8.4`
121
121
  - `BROWSER_PHP_CLI` : The CLI output mode | default : `xterm`
122
122
 
123
- - `BROWSER_PHP_COMPOSER_VERSION` : The Composer executable version | default : `2.9.2`
123
+ - `BROWSER_PHP_COMPOSER_VERSION` : The Composer executable version | default : `2.9.3`
124
124
  - `BROWSER_PHP_COMPOSER_PATH` : The Composer executable path | default : `vendor/bin`
125
125
  - `BROWSER_PHP_COMPOSER_NAME` : The Composer executable name | default : `composer`
126
126
 
package/bin/cli.js CHANGED
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env node
2
- import { PHP as p } from "@php-wasm/universal";
3
- import { loadNodeRuntime as n, createNodeFsMountHandler as c } from "@php-wasm/node";
2
+ import { PHP as n, sandboxedSpawnHandlerFactory as p } from "@php-wasm/universal";
3
+ import { loadNodeRuntime as a, createNodeFsMountHandler as c } from "@php-wasm/node";
4
4
  import s from "../dist/env.js";
5
- const r = new p(await n(s.php.version, { emscriptenOptions: { ENV: { TERM: s.php.cli } } }));
5
+ const r = new n(await a(s.php.version, { emscriptenOptions: { ENV: { TERM: s.php.cli } } }));
6
6
  r.mkdir(process.cwd());
7
7
  r.mount(process.cwd(), c(process.cwd()));
8
8
  r.chdir(process.cwd());
9
+ await r.setSpawnHandler(p(async () => ({ php: r, reap: () => {
10
+ } })));
9
11
  let d = process.argv.slice(2);
10
12
  const t = await r.cli(["php", ...d]);
11
13
  t.stderr.pipeTo(new WritableStream({ write(e) {
@@ -15,7 +17,7 @@ t.stdout.pipeTo(new WritableStream({ write(e) {
15
17
  process.stdout.write(e);
16
18
  } }));
17
19
  t.exitCode.finally(() => setTimeout(() => process.exit(0), 100));
18
- const a = process.stderr.write;
19
- process.stderr.write = function(e, i, o) {
20
- return typeof e == "string" && (e.includes("Program terminated with exit(0)") || e.includes("ErrorEvent")) ? !0 : a.call(process.stderr, e, i, o);
20
+ const w = process.stderr.write;
21
+ process.stderr.write = function(e, o, i) {
22
+ return typeof e == "string" && (e.includes("Program terminated with exit(0)") || e.includes("ErrorEvent")) ? !0 : w.call(process.stderr, e, o, i);
21
23
  };
package/dist/env.js CHANGED
@@ -4,7 +4,7 @@ import qn from "fs";
4
4
  import no from "dotenv";
5
5
  import ct from "child_process";
6
6
  import ro from "os";
7
- const so = "1.51.1", oo = "@dotenvx/dotenvx", io = "a secure dotenv–from the creator of `dotenv`", co = {
7
+ const so = "1.51.4", oo = "@dotenvx/dotenvx", io = "a secure dotenv–from the creator of `dotenv`", co = {
8
8
  version: so,
9
9
  name: oo,
10
10
  description: io
@@ -7308,6 +7308,7 @@ ${$}`;
7308
7308
  "#/------------------!DOTENV_PRIVATE_KEYS!-------------------/",
7309
7309
  "#/ private decryption keys. DO NOT commit to source control /",
7310
7310
  "#/ [how it works](https://dotenvx.com/encryption) /",
7311
+ "#/ backup with: `dotenvx ops backup` /",
7311
7312
  "#/----------------------------------------------------------/"
7312
7313
  ].join(`
7313
7314
  `), C = [
@@ -7680,7 +7681,7 @@ function fi() {
7680
7681
  }
7681
7682
  const o = "", f = " ", h = "\\", v = /^\s+$/, r = /(?:[^\\]|^)\\$/, c = /^\\!/, p = /^\\#/, A = /\r?\n/g, K = /^\.*\/|^\.+$/, H = "/";
7682
7683
  let N = "node-ignore";
7683
- typeof Symbol < "u" && (N = Symbol.for("node-ignore"));
7684
+ typeof Symbol < "u" && (N = /* @__PURE__ */ Symbol.for("node-ignore"));
7684
7685
  const _ = N, R = (b, l, i) => Object.defineProperty(b, l, { value: i }), m = /([0-z])-([0-z])/g, S = () => !1, w = (b) => b.replace(
7685
7686
  m,
7686
7687
  (l, i, g) => i.charCodeAt(0) <= g.charCodeAt(0) ? l : o
@@ -8068,7 +8069,7 @@ function hi() {
8068
8069
  v.verbose(`setting for ${y.envFilepath}`), y.error ? y.error.code === "MISSING_ENV_FILE" ? (v.warn(y.error.message), v.help(`? add one with [echo "HELLO=World" > ${y.envFilepath}] and re-run [dotenvx set]`)) : (v.warn(y.error.message), y.error.help && v.help(y.error.help)) : (T.writeFileX(y.filepath, y.envSrc), v.verbose(`${y.key} set${g} (${y.envFilepath})`), v.debug(`${y.key} set${g} to ${y.value} (${y.envFilepath})`));
8069
8070
  l.length > 0 ? v.success(`✔ set ${V}${g} (${l.join(",")})`) : i.length > 0 && v.info(`no changes (${i})`);
8070
8071
  for (const y of b)
8071
- y.privateKeyAdded && (v.success(`✔ key added to ${y.envKeysFilepath} (${y.privateKeyName})`), M() || v.help("⮕ next run [dotenvx ext gitignore --pattern .env.keys] to gitignore .env.keys"), v.help(`⮕ next run [${y.privateKeyName}='${y.privateKey}' dotenvx get ${V}] to test decryption locally`));
8072
+ y.privateKeyAdded && (v.success(`✔ key added to ${y.envKeysFilepath} (${y.privateKeyName})`), v.help("⮕ optional: [dotenvx ops backup] to securely backup private key"), M() || v.help("⮕ next run: [dotenvx ext gitignore --pattern .env.keys] to gitignore .env.keys"), v.help(`⮕ next run: [${y.privateKeyName}='${y.privateKey}' dotenvx get ${V}] to test decryption locally`));
8072
8073
  return {
8073
8074
  processedEnvs: b,
8074
8075
  changedFilepaths: l,
@@ -8125,7 +8126,7 @@ const _i = {
8125
8126
  },
8126
8127
  composer: {
8127
8128
  name: process.env.BROWSER_PHP_COMPOSER_NAME ?? "composer",
8128
- version: process.env.BROWSER_PHP_COMPOSER_VERSION ?? "2.9.2",
8129
+ version: process.env.BROWSER_PHP_COMPOSER_VERSION ?? "2.9.3",
8129
8130
  path: process.env.BROWSER_PHP_COMPOSER_PATH ?? "vendor/bin"
8130
8131
  },
8131
8132
  server: {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name" : "@capsulescodes/browser-php",
3
3
  "description" : "PHP CLI and Web server on browser",
4
- "version" : "0.6.5",
4
+ "version" : "0.6.7",
5
5
  "keywords" : [
6
6
  "node",
7
7
  "browser",
@@ -33,19 +33,19 @@
33
33
  "php-cli" : "bin/cli.js"
34
34
  },
35
35
  "dependencies" : {
36
- "@php-wasm/node" : "^3.0.22",
37
- "@php-wasm/universal" : "^3.0.22",
38
- "@dotenvx/dotenvx" : "^1.51.1",
39
- "vite" : "^7.2.6"
36
+ "@php-wasm/node" : "^3.0.35",
37
+ "@php-wasm/universal" : "^3.0.35",
38
+ "@dotenvx/dotenvx" : "^1.51.4",
39
+ "vite" : "^7.3.0"
40
40
  },
41
41
  "devDependencies" : {
42
42
  "@stylistic/eslint-plugin" : "^5.6.1",
43
- "@types/node" : "^24.10.1",
44
- "eslint" : "^9.39.1",
43
+ "@types/node" : "^25.0.3",
44
+ "eslint" : "^9.39.2",
45
45
  "tsx" : "^4.21.0",
46
46
  "typescript" : "^5.9.3",
47
- "typescript-eslint" : "^8.48.0",
48
- "vitest" : "^4.0.14"
47
+ "typescript-eslint" : "^8.51.0",
48
+ "vitest" : "^4.0.16"
49
49
  },
50
50
  "type" : "module"
51
51
  }