@hediet/dbgjs 0.1.0-next.20260915.2

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 ADDED
@@ -0,0 +1,48 @@
1
+ # dbgjs
2
+
3
+ Native JavaScript debugger CLI and TUI, distributed through npm. Requires Node.js
4
+ 22 or newer. No Rust compiler or install-time build is needed.
5
+
6
+ Commands use `dbgjs`, environment variables use `DBGJS_*`, and the daemon uses
7
+ a fresh `dbgjs` state location. Existing prototype state is left untouched.
8
+ On Windows the new endpoint is
9
+ `%LOCALAPPDATA%\dbgjs\service.json`; `DBGJS_SERVICE_STATE` overrides it.
10
+
11
+ ## Install a release build
12
+
13
+ Download and extract `npm-stable-dbgjs` and `npm-stable-<platform>` from the
14
+ Release packages workflow. Each artifact contains one tarball. Install the
15
+ entry package and its matching native package in the same command, for example
16
+ on Windows x64:
17
+
18
+ ```sh
19
+ npm install -g ./hediet-dbgjs-win32-x64-0.1.0.tgz ./hediet-dbgjs-0.1.0.tgz
20
+ dbgjs --help
21
+ ```
22
+
23
+ For a project-local installation omit `-g` and use `npx --no-install dbgjs`.
24
+ Installing only the entry tarball will not supply an unpublished native
25
+ dependency.
26
+
27
+ Nightly artifacts are named `npm-nightly-dbgjs` and `npm-nightly-<platform>`.
28
+ Their versions are `X.Y.Z-next.<YYYYMMDD>.<index>`, for example
29
+ `0.1.0-next.20260915.2`. The date is the source CI run's UTC creation date;
30
+ the daily index starts at 1 and retries reuse the same version. Install both
31
+ matching nightly tarballs together. Release packages carry `publishConfig.tag`:
32
+ `next` for nightlies and `latest` for stable packages, for the external npm
33
+ publisher.
34
+
35
+ CI itself uploads private `.tar.gz` candidates for smoke testing, not publishable
36
+ `.tgz` releases. Only successful main builds are promoted to release artifacts.
37
+
38
+ Supported platforms: Windows x64, macOS ARM64, Linux GNU x64/ARM64.
39
+ Linux requires glibc 2.35 or newer and OpenSSL 3. Intel macOS, Musl/Alpine and
40
+ Windows ARM64 are not supported. Platform dependencies must not be omitted.
41
+
42
+ The package supplies Playwright's JavaScript library, but does not install a
43
+ browser. Browser debugging requires a separately installed browser. `DBGJS_NODE`
44
+ and `DBGJS_PLAYWRIGHT_PACKAGE` can override the runtime and Playwright module.
45
+
46
+ Each native package keeps `dbgjs`, `dbgjs-service`, and `dbgjs-tui` together.
47
+ Use `dbgjs service stop` for the appropriate service instance before replacing
48
+ an installed package on Windows; running executables cannot be overwritten.
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { launch } from "../lib/launch.mjs";
3
+ launch("dbgjs-tui");
package/bin/dbgjs.mjs ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { launch } from "../lib/launch.mjs";
3
+ launch("dbgjs");
package/lib/launch.mjs ADDED
@@ -0,0 +1,43 @@
1
+ import { spawnSync } from "node:child_process";
2
+ import { createRequire } from "node:module";
3
+ import { dirname, join } from "node:path";
4
+ import { platformKey } from "./platform.mjs";
5
+
6
+ const require = createRequire(import.meta.url);
7
+
8
+ export function launch(binary) {
9
+ try {
10
+ const key = platformKey(
11
+ process.platform,
12
+ process.arch,
13
+ process.platform === "linux" ? process.report.getReport().header.glibcVersionRuntime : undefined,
14
+ );
15
+ const packageName = `@hediet/dbgjs-${key}`;
16
+ let manifest;
17
+ try {
18
+ manifest = require.resolve(`${packageName}/package.json`);
19
+ } catch (error) {
20
+ if (error.code !== "MODULE_NOT_FOUND") throw error;
21
+ throw new Error(`Missing ${packageName}. Reinstall @hediet/dbgjs with optional dependencies enabled. For unpublished builds, install the matching platform .tgz alongside the entry-package .tgz.`, { cause: error });
22
+ }
23
+ const entryVersion = require("../package.json").version;
24
+ if (require(manifest).version !== entryVersion) {
25
+ throw new Error(`${packageName} must match @hediet/dbgjs version ${entryVersion}. Reinstall both packages together.`);
26
+ }
27
+ const executable = join(dirname(manifest), "bin", `${binary}${process.platform === "win32" ? ".exe" : ""}`);
28
+ const result = spawnSync(executable, process.argv.slice(2), {
29
+ stdio: "inherit",
30
+ env: {
31
+ ...process.env,
32
+ DBGJS_NODE: process.env.DBGJS_NODE ?? process.execPath,
33
+ DBGJS_PLAYWRIGHT_PACKAGE: process.env.DBGJS_PLAYWRIGHT_PACKAGE ?? join(dirname(require.resolve("playwright/package.json")), "index.mjs"),
34
+ },
35
+ });
36
+ if (result.error) throw result.error;
37
+ if (result.signal) process.kill(process.pid, result.signal);
38
+ process.exit(result.status ?? 1);
39
+ } catch (error) {
40
+ console.error(`dbgjs: ${error.message}`);
41
+ process.exitCode = 1;
42
+ }
43
+ }
@@ -0,0 +1,14 @@
1
+ export const platforms = {
2
+ "win32-x64": { os: "win32", cpu: "x64" },
3
+ "darwin-arm64": { os: "darwin", cpu: "arm64" },
4
+ "linux-x64-gnu": { os: "linux", cpu: "x64", libc: "glibc" },
5
+ "linux-arm64-gnu": { os: "linux", cpu: "arm64", libc: "glibc" },
6
+ };
7
+
8
+ export function platformKey(os, arch, glibc) {
9
+ const key = `${os}-${arch}${os === "linux" ? "-gnu" : ""}`;
10
+ if (!platforms[key] || (os === "linux" && !glibc)) {
11
+ throw new Error(`Unsupported dbgjs platform: ${os}/${arch}${os === "linux" && !glibc ? " (musl)" : ""}. Supported: ${Object.keys(platforms).join(", ")}.`);
12
+ }
13
+ return key;
14
+ }
package/package.json ADDED
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "@hediet/dbgjs",
3
+ "version": "0.1.0-next.20260915.2",
4
+ "description": "Native JavaScript debugger CLI",
5
+ "type": "module",
6
+ "license": "UNLICENSED",
7
+ "engines": {
8
+ "node": ">=22"
9
+ },
10
+ "bin": {
11
+ "dbgjs": "bin/dbgjs.mjs",
12
+ "dbgjs-tui": "bin/dbgjs-tui.mjs"
13
+ },
14
+ "files": [
15
+ "bin",
16
+ "lib",
17
+ "README.md"
18
+ ],
19
+ "dependencies": {
20
+ "playwright": "1.62.1"
21
+ },
22
+ "optionalDependencies": {
23
+ "@hediet/dbgjs-win32-x64": "0.1.0-next.20260915.2",
24
+ "@hediet/dbgjs-darwin-arm64": "0.1.0-next.20260915.2",
25
+ "@hediet/dbgjs-linux-x64-gnu": "0.1.0-next.20260915.2",
26
+ "@hediet/dbgjs-linux-arm64-gnu": "0.1.0-next.20260915.2"
27
+ },
28
+ "publishConfig": {
29
+ "tag": "next"
30
+ }
31
+ }