@gjsify/console 0.4.34 → 0.4.36

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.
Files changed (2) hide show
  1. package/globals.mjs +13 -9
  2. package/package.json +16 -6
package/globals.mjs CHANGED
@@ -1,13 +1,17 @@
1
1
  /**
2
- * Re-exports native `node:console` for use in Node.js builds.
2
+ * Cross-runtime re-export of the native `console` global for use in Node.js
3
+ * AND browser builds.
3
4
  *
4
- * On Node, `node:console` is built into the runtime so a Node-target
5
- * bundle that imports `@gjsify/console` is routed here by the
6
- * resolver's `gjsify.runtimes.node === "native"` rule. This avoids dragging
7
- * the GJS polyfill into Node bundles entirely.
5
+ * `globalThis.console` exists on both runtimesdirect re-export avoids
6
+ * dragging in the GJS polyfill (`./lib/esm/index.js`) for either target.
7
+ * GJS bundles do NOT consult this file; the GJS-target alias layer routes
8
+ * `@gjsify/console` to the polyfill at `lib/esm/index.js`.
8
9
  *
9
- * GJS bundles do NOT consult this file; they route to `@gjsify/console`'s
10
- * own `lib/esm/index.js` (the polyfill).
10
+ * IMPORTANT: this file MUST NOT reference `node:console` (or any other
11
+ * `node:` specifier) — the audit-runtimes `--strict` probe rejects re-exports
12
+ * from `node:*` for a slot declared cross-runtime, and `node:console`
13
+ * fails to resolve in a browser bundle.
11
14
  */
12
- export * from 'node:console';
13
- export { default } from 'node:console';
15
+ export const console = globalThis.console;
16
+ export const Console = globalThis.console.constructor;
17
+ export default globalThis.console;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gjsify/console",
3
- "version": "0.4.34",
3
+ "version": "0.4.36",
4
4
  "description": "Node.js console module for Gjs",
5
5
  "module": "lib/esm/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -35,16 +35,26 @@
35
35
  "console"
36
36
  ],
37
37
  "devDependencies": {
38
- "@gjsify/cli": "^0.4.34",
39
- "@gjsify/unit": "^0.4.34",
38
+ "@gjsify/cli": "^0.4.36",
39
+ "@gjsify/unit": "^0.4.36",
40
40
  "@types/node": "^25.9.1",
41
- "typescript": "^6.0.3"
41
+ "typescript": "^5.9.3"
42
42
  },
43
43
  "gjsify": {
44
44
  "runtimes": {
45
45
  "gjs": "polyfill",
46
46
  "node": "native",
47
- "browser": "polyfill"
47
+ "browser": "native"
48
48
  }
49
- }
49
+ },
50
+ "license": "MIT",
51
+ "repository": {
52
+ "type": "git",
53
+ "url": "git+https://github.com/gjsify/gjsify.git",
54
+ "directory": "packages/node/console"
55
+ },
56
+ "bugs": {
57
+ "url": "https://github.com/gjsify/gjsify/issues"
58
+ },
59
+ "homepage": "https://github.com/gjsify/gjsify/tree/main/packages/node/console#readme"
50
60
  }