ompchamber 3.3.0 → 3.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ompchamber",
3
- "version": "3.3.0",
3
+ "version": "3.3.1",
4
4
  "description": "Developer web console and diagnostic chamber for AI Oh-My-Pi — Elysia + Preact on Bun.",
5
5
  "license": "UNLICENSED",
6
6
  "author": "Wijanarko Putra Rajeb <wijanarko.rajeb@gmail.com>",
@@ -35,9 +35,7 @@
35
35
  import { describe, expect, test } from 'bun:test';
36
36
  import { readFileSync } from 'node:fs';
37
37
  import { builtinModules } from 'node:module';
38
- import { join } from 'node:path';
39
-
40
- import { packageRoot } from '@/server/lib/assets/fonts.server';
38
+ import { join, resolve } from 'node:path';
41
39
 
42
40
  /** Files whose imports are not part of any runtime path. */
43
41
  const EXCLUDED = /\.test\.|\.test-util\.|test-util\./;
@@ -51,11 +49,23 @@ function packageName(specifier: string): string {
51
49
  const BUILTINS = new Set(builtinModules);
52
50
 
53
51
  /**
54
- * Resolved from the running module, not the cwd — the same helper the bundler
55
- * plugin uses, so this test answers the same question whether it is run from the
56
- * repo root, from `dist/client`, or through `bun test <path>` elsewhere.
52
+ * The package root, derived from this file's own location (`src/server/lib/
53
+ * bundler` → four levels up) rather than the cwd.
54
+ *
55
+ * `packageRoot()` from `lib/assets/fonts.server.ts` is deliberately NOT used
56
+ * here: it answers "where are the dependencies installed", which is the first
57
+ * directory up from the module that holds `node_modules`. In a published
58
+ * install the package has no `node_modules` of its own — its dependencies are
59
+ * hoisted to the consumer's root — so that helper returns the CONSUMER's
60
+ * project, and the manifest it reads is the consumer's `package.json`, not
61
+ * this package's. Measured: run from an installed copy it resolved
62
+ * `/private/tmp/npmcheck/tsconfig.json` and died with `ENOENT`.
63
+ *
64
+ * The path depth is the same fact `lib/updates/install.ts` encodes in its
65
+ * `DEFAULT_PKG_ROOT`, for the same reason: `src/server/lib/<domain>/<file>`
66
+ * is always four levels below the package.
57
67
  */
58
- const ROOT = packageRoot();
68
+ const ROOT = resolve(import.meta.dir, '..', '..', '..', '..');
59
69
 
60
70
  const pkg = (await Bun.file(join(ROOT, 'package.json')).json()) as {
61
71
  dependencies?: Record<string, string>;
@@ -69,6 +79,10 @@ const DEV = new Set(Object.keys(pkg.devDependencies ?? {}));
69
79
  * Bun's transpiler is the parser here, so the answer matches what the bundler
70
80
  * itself sees: `@/` aliases, relative paths and `node:`/`bun:` prefixes are
71
81
  * filtered below, and a type-only import never appears at all.
82
+ *
83
+ * `tsconfig.json` ships in the published tarball (it is in `files`, and Bun
84
+ * resolves the `@/` alias from the package's own copy), so it is always
85
+ * readable here.
72
86
  */
73
87
  const transpiler = new Bun.Transpiler({
74
88
  loader: 'tsx',