cachelint 0.1.0 → 0.1.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.
@@ -2,17 +2,17 @@ import {
2
2
  check,
3
3
  renderCheckHuman,
4
4
  renderCheckJson
5
- } from "./chunk-ZSEZQ422.js";
5
+ } from "./chunk-GLL4UN7R.js";
6
6
  import "./chunk-UUVSBJ62.js";
7
- import "./chunk-2JSY5BQA.js";
7
+ import "./chunk-V2DRU4YZ.js";
8
8
  import "./chunk-O7ZE6CFI.js";
9
9
  import "./chunk-GXASKZ4Z.js";
10
10
  import "./chunk-4LB5LF2P.js";
11
11
  import "./chunk-WKFGRNYK.js";
12
12
  import "./chunk-DYQPXD3G.js";
13
13
  import "./chunk-VWE5TDL5.js";
14
- import "./chunk-BUZCVKMZ.js";
15
- import "./chunk-MW7BXKPR.js";
14
+ import "./chunk-SWQJHM3N.js";
15
+ import "./chunk-52RLK7ML.js";
16
16
  import "./chunk-4GHSUBAY.js";
17
17
  import "./chunk-WPJYUQMU.js";
18
18
  import "./chunk-XKRPGMZT.js";
@@ -343,7 +343,7 @@ var SECRET_FILE_PATTERNS = [
343
343
  ];
344
344
  function resolveSources(input) {
345
345
  const root = input.projectRoot ?? process.cwd();
346
- const absRoot = pathResolve2(root);
346
+ const absRoot = realpathOrSelf(pathResolve2(root));
347
347
  const maxFileBytes = input.maxFileBytes ?? DEFAULT_MAX_FILE_BYTES;
348
348
  const maxTotalBytes = input.maxTotalBytes ?? DEFAULT_MAX_TOTAL_BYTES;
349
349
  const extraExclude = input.exclude ?? [];
@@ -485,6 +485,13 @@ function resolveSources(input) {
485
485
  }
486
486
  return { sources, warnings };
487
487
  }
488
+ function realpathOrSelf(p) {
489
+ try {
490
+ return realpathSync(p);
491
+ } catch {
492
+ return p;
493
+ }
494
+ }
488
495
  function expandPaths(paths, absRoot) {
489
496
  const all = /* @__PURE__ */ new Set();
490
497
  for (const p of paths) {
@@ -3,11 +3,11 @@ import {
3
3
  computeBundles,
4
4
  makeLockfile,
5
5
  writeLockfileAtomic
6
- } from "./chunk-BUZCVKMZ.js";
6
+ } from "./chunk-SWQJHM3N.js";
7
7
  import {
8
8
  resolveConfigArg,
9
9
  toPosixRelative
10
- } from "./chunk-MW7BXKPR.js";
10
+ } from "./chunk-52RLK7ML.js";
11
11
  import {
12
12
  CACHELINT_VERSION
13
13
  } from "./chunk-WPJYUQMU.js";
@@ -7,7 +7,7 @@ import {
7
7
  heuristicTokens,
8
8
  lint,
9
9
  usdPer1kCalls
10
- } from "./chunk-2JSY5BQA.js";
10
+ } from "./chunk-V2DRU4YZ.js";
11
11
  import {
12
12
  getModelPricing,
13
13
  referencePricing
@@ -36,12 +36,12 @@ import {
36
36
  computeBundles,
37
37
  makeLockfile,
38
38
  readLockfileIfExists
39
- } from "./chunk-BUZCVKMZ.js";
39
+ } from "./chunk-SWQJHM3N.js";
40
40
  import {
41
41
  resolveConfigArg,
42
42
  resolveSources,
43
43
  toPosixRelative
44
- } from "./chunk-MW7BXKPR.js";
44
+ } from "./chunk-52RLK7ML.js";
45
45
  import {
46
46
  CACHELINT_VERSION
47
47
  } from "./chunk-WPJYUQMU.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  bundleHash,
3
3
  resolveSources
4
- } from "./chunk-MW7BXKPR.js";
4
+ } from "./chunk-52RLK7ML.js";
5
5
  import {
6
6
  CACHELINT_VERSION,
7
7
  NORMALIZATION_POLICY_VERSION,
@@ -24,7 +24,7 @@ import {
24
24
  resolveConfigArg,
25
25
  resolveSources,
26
26
  toPosixRelative
27
- } from "./chunk-MW7BXKPR.js";
27
+ } from "./chunk-52RLK7ML.js";
28
28
  import {
29
29
  DEFAULT_RULE_VOLATILITY,
30
30
  isRuleId
package/dist/cli.js CHANGED
@@ -42,7 +42,7 @@ program.command("lint [paths...]").description(
42
42
  json: opts.json === true,
43
43
  cost: costEnabled
44
44
  };
45
- const { lint, renderLintHuman, renderLintJson } = await import("./lint-PQHIDWOY.js");
45
+ const { lint, renderLintHuman, renderLintJson } = await import("./lint-2AYSH2DO.js");
46
46
  const result = lint({
47
47
  paths,
48
48
  ...opts.config !== void 0 ? { config: opts.config } : {},
@@ -70,7 +70,7 @@ program.command("lint [paths...]").description(
70
70
  if (result.exitCode !== EXIT_OK) process.exitCode = result.exitCode;
71
71
  });
72
72
  program.command("hash [paths...]").description("Compute and write cachelint.lock for declared bundles").option("-c, --config <file>", "Path to cachelint.config.{json,yaml,yml}").option("-o, --out <file>", "Output lockfile path (default: cachelint.lock)").option("--json", "Emit the written bundles as JSON on stdout").action(async (paths, opts) => {
73
- const { hash, renderHashHuman, renderHashJson } = await import("./hash-XUTGK6SB.js");
73
+ const { hash, renderHashHuman, renderHashJson } = await import("./hash-VALCF7B4.js");
74
74
  const r = hash({
75
75
  paths,
76
76
  ...opts.config !== void 0 ? { config: opts.config } : {},
@@ -94,7 +94,7 @@ program.command("check [paths...]").description(
94
94
  json: opts.json === true,
95
95
  cost: costEnabled
96
96
  };
97
- const { check, renderCheckHuman, renderCheckJson } = await import("./check-2ONJCYKP.js");
97
+ const { check, renderCheckHuman, renderCheckJson } = await import("./check-7I5OMP2Q.js");
98
98
  const r = await check({
99
99
  paths,
100
100
  ...opts.config !== void 0 ? { config: opts.config } : {},
@@ -2,9 +2,9 @@ import {
2
2
  hash,
3
3
  renderHashHuman,
4
4
  renderHashJson
5
- } from "./chunk-SQ4IAMTX.js";
6
- import "./chunk-BUZCVKMZ.js";
7
- import "./chunk-MW7BXKPR.js";
5
+ } from "./chunk-ANH5DBRG.js";
6
+ import "./chunk-SWQJHM3N.js";
7
+ import "./chunk-52RLK7ML.js";
8
8
  import "./chunk-4GHSUBAY.js";
9
9
  import "./chunk-WPJYUQMU.js";
10
10
  import "./chunk-XKRPGMZT.js";
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  check,
3
3
  renderCheckHuman,
4
4
  renderCheckJson
5
- } from "./chunk-ZSEZQ422.js";
5
+ } from "./chunk-GLL4UN7R.js";
6
6
  import {
7
7
  activate,
8
8
  deactivate,
@@ -17,7 +17,7 @@ import {
17
17
  renderLintHuman,
18
18
  renderLintJson,
19
19
  usdPer1kCalls
20
- } from "./chunk-2JSY5BQA.js";
20
+ } from "./chunk-V2DRU4YZ.js";
21
21
  import {
22
22
  PRICING_AS_OF,
23
23
  PRICING_TABLE_VERSION,
@@ -63,14 +63,14 @@ import {
63
63
  hash,
64
64
  renderHashHuman,
65
65
  renderHashJson
66
- } from "./chunk-SQ4IAMTX.js";
66
+ } from "./chunk-ANH5DBRG.js";
67
67
  import {
68
68
  DEFAULT_LOCKFILE_NAME,
69
69
  LOCKFILE_FORMAT_VERSION,
70
70
  canonicalJsonStringify,
71
71
  parseLockfile,
72
72
  serializeLockfile
73
- } from "./chunk-BUZCVKMZ.js";
73
+ } from "./chunk-SWQJHM3N.js";
74
74
  import {
75
75
  CONFIG_FILENAMES,
76
76
  configJsonSchema,
@@ -79,7 +79,7 @@ import {
79
79
  loadConfig,
80
80
  parseConfig,
81
81
  resolveConfigArg
82
- } from "./chunk-MW7BXKPR.js";
82
+ } from "./chunk-52RLK7ML.js";
83
83
  import {
84
84
  DEFAULT_RULE_SEVERITY,
85
85
  DEFAULT_RULE_VOLATILITY,
@@ -2,13 +2,13 @@ import {
2
2
  lint,
3
3
  renderLintHuman,
4
4
  renderLintJson
5
- } from "./chunk-2JSY5BQA.js";
5
+ } from "./chunk-V2DRU4YZ.js";
6
6
  import "./chunk-O7ZE6CFI.js";
7
7
  import "./chunk-GXASKZ4Z.js";
8
8
  import "./chunk-4LB5LF2P.js";
9
9
  import "./chunk-WKFGRNYK.js";
10
10
  import "./chunk-VWE5TDL5.js";
11
- import "./chunk-MW7BXKPR.js";
11
+ import "./chunk-52RLK7ML.js";
12
12
  import "./chunk-4GHSUBAY.js";
13
13
  import "./chunk-WPJYUQMU.js";
14
14
  import "./chunk-XKRPGMZT.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cachelint",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "A linter + CI gate for LLM prompt-cache regressions. Catches the silent-invalidator class (interpolated timestamps, unsorted JSON, BOM, mixed line endings) and fails PRs when a committed prompt's stable-prefix hash moves.",
5
5
  "license": "MIT",
6
6
  "author": "cachelint contributors",