hextimator 0.14.2 → 0.14.3

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/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.14.3
2
+
3
+ ### Patch Changes
4
+
5
+ - [#182](https://github.com/fgrgic/hextimator/pull/182) [`b01e908`](https://github.com/fgrgic/hextimator/commit/b01e90847e747502bab743e61c14f9b9e47a6e9b) Thanks [@fgrgic](https://github.com/fgrgic)! - Fix the `hextimator` and `hextimate` CLI commands producing no output when invoked through `npx`.
6
+
7
+ - [#182](https://github.com/fgrgic/hextimator/pull/182) [`b01e908`](https://github.com/fgrgic/hextimator/commit/b01e90847e747502bab743e61c14f9b9e47a6e9b) Thanks [@fgrgic](https://github.com/fgrgic)! - Fix the `hextimator` and `hextimate` CLI commands producing no output when invoked through `npx`.
8
+
1
9
  ## 0.14.2
2
10
 
3
11
  ### Patch Changes
package/dist/cli.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // src/cli.ts
4
- import { readFileSync, writeFileSync } from "fs";
4
+ import { readFileSync, realpathSync, writeFileSync } from "fs";
5
5
  import { dirname, join } from "path";
6
6
  import { fileURLToPath } from "url";
7
7
  import { parseArgs } from "util";
@@ -2810,7 +2810,7 @@ function parseBaseLightnessRange(raw) {
2810
2810
  if (!Number.isFinite(lo) || !Number.isFinite(hi)) return void 0;
2811
2811
  return [lo, hi];
2812
2812
  }
2813
- function run() {
2813
+ function runCli() {
2814
2814
  const { values, positionals } = parseArgs({
2815
2815
  allowPositionals: true,
2816
2816
  options: {
@@ -3042,6 +3042,14 @@ function run() {
3042
3042
  console.log(output);
3043
3043
  }
3044
3044
  }
3045
+ function run() {
3046
+ try {
3047
+ runCli();
3048
+ } catch (err) {
3049
+ console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
3050
+ process.exit(1);
3051
+ }
3052
+ }
3045
3053
  function renderOutput(builder, formatOptions, themeFilter) {
3046
3054
  if (formatOptions.as === "json") formatOptions.as = "object";
3047
3055
  const result = builder.format(formatOptions);
@@ -3054,14 +3062,10 @@ function serialize(value) {
3054
3062
  if (typeof value === "string") return value;
3055
3063
  return JSON.stringify(value, null, 2);
3056
3064
  }
3057
- if (process.argv[1] === fileURLToPath(import.meta.url)) {
3058
- try {
3059
- run();
3060
- } catch (err) {
3061
- console.error(`Error: ${err instanceof Error ? err.message : String(err)}`);
3062
- process.exit(1);
3063
- }
3065
+ if (realpathSync(process.argv[1]) === fileURLToPath(import.meta.url)) {
3066
+ run();
3064
3067
  }
3065
3068
  export {
3066
- renderOutput
3069
+ renderOutput,
3070
+ run
3067
3071
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hextimator",
3
- "version": "0.14.2",
3
+ "version": "0.14.3",
4
4
  "description": "Runtime theming for multi-tenant apps.",
5
5
  "keywords": [
6
6
  "color-palette",