carrick 0.3.182 → 0.3.183

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": "carrick",
3
- "version": "0.3.182",
3
+ "version": "0.3.183",
4
4
  "carrickCache": {
5
5
  "cache_version": 22,
6
6
  "intent_cache_version": 2
@@ -111,11 +111,11 @@
111
111
  "zod": "^3.23.0"
112
112
  },
113
113
  "optionalDependencies": {
114
- "@carrick-tools/cli-darwin-arm64": "0.3.182",
115
- "@carrick-tools/cli-darwin-x64": "0.3.182",
116
- "@carrick-tools/cli-linux-arm64": "0.3.182",
117
- "@carrick-tools/cli-linux-x64": "0.3.182",
118
- "@carrick-tools/cli-win32-x64": "0.3.182"
114
+ "@carrick-tools/cli-darwin-arm64": "0.3.183",
115
+ "@carrick-tools/cli-darwin-x64": "0.3.183",
116
+ "@carrick-tools/cli-linux-arm64": "0.3.183",
117
+ "@carrick-tools/cli-linux-x64": "0.3.183",
118
+ "@carrick-tools/cli-win32-x64": "0.3.183"
119
119
  },
120
120
  "devDependencies": {
121
121
  "@types/node": "^24.13.3"
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "carrick",
3
3
  "description": "Claude Code plugin for Carrick, which indexes TypeScript codebases across service and repository boundaries. After each edit it adds the file's routes, calls, and cross-service type mismatches to the session, and it registers Carrick's language server. It pairs with the Carrick MCP server, which lets agents search functions by intent rather than name.",
4
- "version": "0.3.182",
4
+ "version": "0.3.183",
5
5
  "author": {
6
6
  "name": "Carrick",
7
7
  "email": "hello@carrick.tools"
@@ -141,6 +141,19 @@ deno_config() {
141
141
  fi
142
142
  }
143
143
 
144
+ # Whether a `deno.lock` covers a directory: its own, or one above it up to the
145
+ # repository root (a workspace member shares the root's lockfile). The walk
146
+ # stops at the first directory holding `.git`, or at the filesystem root.
147
+ deno_has_lockfile() {
148
+ local dir="$1"
149
+ while :; do
150
+ [ -f "$dir/deno.lock" ] && return 0
151
+ [ -e "$dir/.git" ] && return 1
152
+ [ "$dir" = "/" ] || [ "$dir" = "." ] && return 1
153
+ dir=$(dirname "$dir")
154
+ done
155
+ }
156
+
144
157
  # Every service root the scan will visit, absolute, one per line.
145
158
  #
146
159
  # The scan root leads, and is emitted whatever the scanner answers: a checkout
@@ -494,7 +507,7 @@ yarn_is_berry() {
494
507
  }
495
508
 
496
509
  cmd_install_one() {
497
- local root="$1" manager="$2" log status refusal strict_cmd="" no_retry="" snap="" before="" npm_error="" retry_error=""
510
+ local root="$1" manager="$2" log status refusal deno_form="" deno_lock_flag="" strict_cmd="" no_retry="" snap="" before="" npm_error="" retry_error=""
498
511
  if [ "$manager" != "deno" ] && { [ -f "$root/deno.json" ] || [ -f "$root/deno.jsonc" ]; }; then
499
512
  # Mixed roots need the global Deno cache AND the Node compiler's local
500
513
  # install. Neither preparation executes authorized project lifecycle code.
@@ -518,12 +531,23 @@ cmd_install_one() {
518
531
  # No retry: the pre-flight asks about a Deno service only when its config
519
532
  # sets `nodeModulesDir`, and no failing `deno install --frozen` has been seen.
520
533
  no_retry=1
521
- strict_cmd="deno install --frozen"
522
534
  # A project can authorize lifecycle scripts through allowScripts in its
523
535
  # config. Deno has no --ignore-scripts: disabling node_modules is what
524
536
  # prevents those scripts from running, even for an authorizing config.
525
- # Frozen mode also prevents rewriting the project's lockfile.
526
- run_install "$root" "$log" deno install --frozen --node-modules-dir=none
537
+ # With a lockfile, frozen mode prevents rewriting the project's lockfile.
538
+ # With none, `--frozen` refuses to create one and fails ("The lockfile is
539
+ # out of date"), so the install runs `--no-lock`: no lockfile is read or
540
+ # written, and the packages land in Deno's own cache. The sidecar's
541
+ # `deno info` makes the same choice (deno-project.ts, denoLockFlag).
542
+ if deno_has_lockfile "$root"; then
543
+ strict_cmd="deno install --frozen"
544
+ deno_lock_flag="--frozen"
545
+ else
546
+ strict_cmd="deno install --no-lock"
547
+ deno_lock_flag="--no-lock"
548
+ fi
549
+ deno_form="$strict_cmd --node-modules-dir=none"
550
+ run_install "$root" "$log" deno install "$deno_lock_flag" --node-modules-dir=none
527
551
  status=$?
528
552
  ;;
529
553
  npm)
@@ -594,7 +618,7 @@ cmd_install_one() {
594
618
  esac
595
619
 
596
620
  if [ $status -eq 0 ]; then
597
- echo "Installed $root dependencies with $manager (lifecycle scripts disabled)."
621
+ echo "Installed $root dependencies with ${deno_form:-$manager} (lifecycle scripts disabled)."
598
622
  [ -f "$log" ] && tail -n 3 "$log"
599
623
  [ -n "$before" ] && rm -f "$before"
600
624
  return 0
@@ -646,9 +670,9 @@ cmd_install_one() {
646
670
  rm -f "$before"
647
671
  fi
648
672
  if [ $status -eq 124 ] || [ $status -eq 137 ]; then
649
- warn "Carrick's dependency install ($manager) in $root hit the ${INSTALL_TIMEOUT_SECONDS}s limit; the scan will refuse that service rather than index \`any\` through its packages."
673
+ warn "Carrick's dependency install (${deno_form:-$manager}) in $root hit the ${INSTALL_TIMEOUT_SECONDS}s limit; the scan will refuse that service rather than index \`any\` through its packages."
650
674
  else
651
- warn "Carrick's dependency install ($manager) in $root failed (exit $status)${npm_error:+: $npm_error}; the scan will refuse that service rather than index \`any\` through its packages."
675
+ warn "Carrick's dependency install (${deno_form:-$manager}) in $root failed (exit $status)${npm_error:+: $npm_error}; the scan will refuse that service rather than index \`any\` through its packages."
652
676
  fi
653
677
  return 0
654
678
  }
@@ -18,6 +18,15 @@ export interface DenoConfig {
18
18
  export declare function resolveTypeRoots(types: string[], configPath: string, serviceRoot: string): string[];
19
19
  /** Explicit TS configs keep their existing behaviour, including mixed repos. */
20
20
  export declare function findDenoConfig(repoRoot: string, explicit?: string): DenoConfig | undefined;
21
+ /**
22
+ * `--frozen` when a `deno.lock` covers the project (the workspace root's, which
23
+ * members share, or the service folder's own): the scan reads it and never
24
+ * rewrites it. With none, `--frozen` refuses to create one and `deno info`
25
+ * fails on any `npm:` import, so the graph is read with `--no-lock`: no
26
+ * lockfile is read or written. The install step makes the same choice
27
+ * (scripts/install-scanned-deps.sh, deno_has_lockfile).
28
+ */
29
+ export declare function denoLockFlag(workspaceRoot: string, serviceRoot: string): '--frozen' | '--no-lock';
21
30
  /**
22
31
  * The npm package directories an untrusted scan may read (carrick#4076): the
23
32
  * real path of each package's `localPath`, kept only when strictly beneath the
@@ -119,6 +119,21 @@ export function findDenoConfig(repoRoot, explicit) {
119
119
  ...(nearest.config.exclude ?? []).map(p => path.resolve(path.dirname(nearest.file), p))],
120
120
  };
121
121
  }
122
+ /**
123
+ * `--frozen` when a `deno.lock` covers the project (the workspace root's, which
124
+ * members share, or the service folder's own): the scan reads it and never
125
+ * rewrites it. With none, `--frozen` refuses to create one and `deno info`
126
+ * fails on any `npm:` import, so the graph is read with `--no-lock`: no
127
+ * lockfile is read or written. The install step makes the same choice
128
+ * (scripts/install-scanned-deps.sh, deno_has_lockfile).
129
+ */
130
+ export function denoLockFlag(workspaceRoot, serviceRoot) {
131
+ for (const dir of [workspaceRoot, serviceRoot]) {
132
+ if (fs.existsSync(path.join(dir, 'deno.lock')))
133
+ return '--frozen';
134
+ }
135
+ return '--no-lock';
136
+ }
122
137
  function runDeno(args, cwd) {
123
138
  try {
124
139
  return execFileSync('deno', args, {
@@ -249,7 +264,7 @@ export class DenoProject {
249
264
  guard.writeFile(entry, roots.map(s => `import ${JSON.stringify(s)};`).join('\n'));
250
265
  let graph;
251
266
  try {
252
- graph = JSON.parse(runDeno(['info', '--json', '--frozen', '--node-modules-dir=none', '--config', config.configPath, entry], repoRoot));
267
+ graph = JSON.parse(runDeno(['info', '--json', denoLockFlag(config.workspaceRoot, repoRoot), '--node-modules-dir=none', '--config', config.configPath, entry], repoRoot));
253
268
  }
254
269
  finally {
255
270
  guard.remove(entry);
@@ -1 +1 @@
1
- {"inputs_sha256":"06c7fb38e05e1397054e506586d3aed6b2e5d1fdfb8fcab974d02fab45777e60"}
1
+ {"inputs_sha256":"fcaaf3ea05d2f5ec3779e60640b8a15e7d32539d45c631d46cc0a73d85c12e8a"}