@pithosai/pithosai 1.0.0 → 1.0.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.
@@ -0,0 +1,45 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Chalk 5 is ESM-only; Node's `require("chalk")` yields `{ default, Chalk, ... }`.
5
+ * Bundled CJS expects the default instance (`.underline`, `.hex`, etc.) as the export.
6
+ *
7
+ * Loaded via `require("../shims/chalk-cjs-shim.cjs")` from dist entry files.
8
+ */
9
+ const { createRequire } = require("node:module");
10
+ const path = require("node:path");
11
+
12
+ const pkgJson = path.join(__dirname, "..", "package.json");
13
+ const requireFromPkg = createRequire(pkgJson);
14
+ const real = requireFromPkg("chalk");
15
+ const chalk = typeof real.hex === "function" ? real : real.default;
16
+
17
+ if (!chalk || typeof chalk.underline !== "function") {
18
+ throw new Error(
19
+ "@pithosai/pithosai: chalk-cjs-shim could not resolve chalk instance (install chalk dependency).",
20
+ );
21
+ }
22
+
23
+ module.exports = chalk;
24
+ module.exports.default = chalk;
25
+ module.exports.Chalk = real.Chalk;
26
+
27
+ const passthrough = [
28
+ "chalkStderr",
29
+ "supportsColor",
30
+ "supportsColorStderr",
31
+ "modifierNames",
32
+ "foregroundColorNames",
33
+ "backgroundColorNames",
34
+ "colorNames",
35
+ "modifiers",
36
+ "foregroundColors",
37
+ "backgroundColors",
38
+ "colors",
39
+ ];
40
+
41
+ for (const k of passthrough) {
42
+ if (real[k] != null) {
43
+ module.exports[k] = real[k];
44
+ }
45
+ }
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Resolves the npm package install root (directory containing package.json and templates/).
5
+ * Parent of shims/ — keeps dist/*.cjs able to locate assets with `join(__dirname, "..", "shims", ...)` → `require(this)`.
6
+ */
7
+ const path = require("node:path");
8
+
9
+ module.exports = path.dirname(__dirname);