Skip to content

Commit 276116b

Browse files
nam-hleclaude
andauthored
feat: use node_modules/.cache/nadle as default cache directory (#546)
## Summary - Change default cache directory from `.nadle/` to `node_modules/.cache/nadle/` to align with JS ecosystem conventions (Turborepo, Nx, ESLint, Vite, Babel, Webpack) - Already gitignored via `node_modules/`, cleaned on fresh install, less project root clutter - `--cache-dir` CLI flag and `configure({ cacheDir })` override continue to work as before Closes #500 ## Test plan - [ ] CI passes on all platforms (Ubuntu, macOS, Windows) - [ ] `cache-dir`, `clean-cache`, and `no-cache` tests verify the new default path - [ ] Snapshots updated for `--show-config` and `--help` output reflecting new default 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 425b9a6 commit 276116b

21 files changed

+33
-23
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ nadle.iml
1717
__temp__
1818
.docusaurus
1919
.vercel
20+
# legacy cache directory (before v0.6)
2021
.nadle*
2122

2223
# generated docs

packages/docs/docs/getting-started/features.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ tasks.register("deploy", async ({ context }) => {
142142
Nadle caches task results based on declared inputs and outputs. When inputs haven't changed since the last run, the task is skipped and outputs are restored from cache.
143143

144144
- Declare file and directory inputs/outputs
145-
- Cache stored in `.nadle/` directory
145+
- Cache stored in `node_modules/.cache/nadle/` directory
146146
- Skip with `--no-cache` flag
147147

148148
```typescript

packages/nadle/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"build": "nadle build",
99
"start": "tsc -p tsconfig.build.json --watch --noEmit false",
1010
"test": "nadle test",
11+
"update": "vitest -u",
1112
"bench": "vitest bench"
1213
},
1314
"files": [

packages/nadle/src/core/options/cli-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export const CLIOptions = {
102102
key: "cache-dir",
103103
options: {
104104
type: "string",
105-
defaultDescription: "<projectDir>/.nadle",
105+
defaultDescription: "<projectDir>/node_modules/.cache/nadle",
106106
description: "Directory to store task cache results"
107107
}
108108
},

packages/nadle/src/core/utilities/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ export const LINES = {
2222
VERTICAL_RIGHT: "├"
2323
};
2424

25-
export const DEFAULT_CACHE_DIR_NAME = ".nadle";
25+
export const DEFAULT_CACHE_DIR_NAME = "node_modules/.cache/nadle";

packages/nadle/test/__snapshots__/builtin-tasks/delete-task.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer deleteJsonFiles --log-level
130130
"packageManager": "npm",
131131
"currentWorkspaceId": "root"
132132
},
133-
"cacheDir": "/ROOT/test/__fixtures__/delete-task/__temp__/__{hash}__/.nadle",
133+
"cacheDir": "/ROOT/test/__fixtures__/delete-task/__temp__/__{hash}__/node_modules/.cache/nadle",
134134
"minWorkers": 1
135135
}
136136
[info] Detected environments: { CI: false, TEST: true }

packages/nadle/test/__snapshots__/builtin-tasks/node-task.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer pass --log-level info
5858
"packageManager": "npm",
5959
"currentWorkspaceId": "root"
6060
},
61-
"cacheDir": "/ROOT/test/__fixtures__/node-task/.nadle",
61+
"cacheDir": "/ROOT/test/__fixtures__/node-task/node_modules/.cache/nadle",
6262
"minWorkers": 1
6363
}
6464
[info] Detected environments: { CI: false, TEST: true }

packages/nadle/test/__snapshots__/builtin-tasks/npm-task.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer pass --log-level info
5858
"packageManager": "npm",
5959
"currentWorkspaceId": "root"
6060
},
61-
"cacheDir": "/ROOT/test/__fixtures__/npm-task/.nadle",
61+
"cacheDir": "/ROOT/test/__fixtures__/npm-task/node_modules/.cache/nadle",
6262
"minWorkers": 1
6363
}
6464
[info] Detected environments: { CI: false, TEST: true }

packages/nadle/test/__snapshots__/builtin-tasks/npx-task.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer pass --log-level info
5858
"packageManager": "npm",
5959
"currentWorkspaceId": "root"
6060
},
61-
"cacheDir": "/ROOT/test/__fixtures__/npx-task/.nadle",
61+
"cacheDir": "/ROOT/test/__fixtures__/npx-task/node_modules/.cache/nadle",
6262
"minWorkers": 1
6363
}
6464
[info] Detected environments: { CI: false, TEST: true }

packages/nadle/test/__snapshots__/builtin-tasks/pnpm-task.test.ts.snap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Command: /ROOT/nadle.mjs --max-workers 1 --no-footer pass --log-level info
5858
"packageManager": "npm",
5959
"currentWorkspaceId": "root"
6060
},
61-
"cacheDir": "/ROOT/test/__fixtures__/pnpm-task/.nadle",
61+
"cacheDir": "/ROOT/test/__fixtures__/pnpm-task/node_modules/.cache/nadle",
6262
"minWorkers": 1
6363
}
6464
[info] Detected environments: { CI: false, TEST: true }

0 commit comments

Comments
 (0)