@coboot/headless 0.2.2-rc.3 → 0.2.2-rc.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/README.md +25 -14
- package/cli.mjs +10 -10
- package/entry.mjs +270 -269
- package/launcher.mjs +4 -0
- package/package.json +4 -3
package/launcher.mjs
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import{spawnSync as u}from"child_process";import l from"fs";import o from"path";import e from"process";import{fileURLToPath as p}from"url";var i=18,f=20,d="node@22",m=p(import.meta.url);function h(r){return Number.parseInt(String(r).split(".")[0],10)}function g(r={}){let t=r.nodeVersion||e.versions.node,n=h(t);if(!Number.isInteger(n)||n<i)throw new Error(`Node.js >=${i} is required to launch Headless; current version is ${t}`);let s=r.cliFile||o.join(o.dirname(m),"cli.mjs"),a=r.args||e.argv.slice(2);return n>=f?{command:r.execPath||e.execPath,args:[s,...a],bootstrapped:!1}:{command:(r.platform||e.platform)==="win32"?"npx.cmd":"npx",args:["-y","-p",d,"node",s,...a],bootstrapped:!0}}function v(r={}){let t=g(r);t.bootstrapped&&e.stderr.write(`[Headless] Node.js ${r.nodeVersion||e.versions.node} detected; using isolated ${d}.
|
|
3
|
+
`);let n=(r.spawnSync||u)(t.command,t.args,{stdio:"inherit",env:r.env||e.env});if(n.error)throw n.error;return Number.isInteger(n.status)?n.status:1}function c(r){try{return l.realpathSync(r)}catch{return o.resolve(r)}}if(e.argv[1]&&c(e.argv[1])===c(m))try{e.exitCode=v()}catch(r){e.stderr.write(`headless launcher: ${r instanceof Error?r.message:String(r)}
|
|
4
|
+
`),e.exitCode=1}export{g as resolveHeadlessLaunchCommand,v as runHeadlessLauncher};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coboot/headless",
|
|
3
|
-
"version": "0.2.2-rc.
|
|
3
|
+
"version": "0.2.2-rc.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Coboot headless daemon client",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,9 +10,10 @@
|
|
|
10
10
|
"headlessBrowserRuntime": {"driver":"playwright-core","driverVersion":"1.58.2","browser":"system-or-guided-install"},
|
|
11
11
|
"headlessLinuxSandbox": {"backend":"bubblewrap","backendVersion":"0.10.0","architectures":["x64","arm64"]},
|
|
12
12
|
"bin": {
|
|
13
|
-
"coboot-headless": "
|
|
13
|
+
"coboot-headless": "launcher.mjs"
|
|
14
14
|
},
|
|
15
15
|
"files": [
|
|
16
|
+
"launcher.mjs",
|
|
16
17
|
"cli.mjs",
|
|
17
18
|
"daemon.mjs",
|
|
18
19
|
"entry.mjs",
|
|
@@ -22,7 +23,7 @@
|
|
|
22
23
|
"README.md"
|
|
23
24
|
],
|
|
24
25
|
"engines": {
|
|
25
|
-
"node": ">=
|
|
26
|
+
"node": ">=18"
|
|
26
27
|
},
|
|
27
28
|
"publishConfig": {
|
|
28
29
|
"access": "public",
|