@datamitsu/datamitsu-darwin-arm64 0.0.3-alpha-3 → 0.0.3-alpha-4

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.
Files changed (3) hide show
  1. package/README.md +74 -0
  2. package/datamitsu +0 -0
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -52,6 +52,80 @@ A library that wraps datamitsu passes its config via `--before-config`. The proj
52
52
  library-base.ts → project/datamitsu.config.ts → final Config
53
53
  ```
54
54
 
55
+ ## Global Cache Structure
56
+
57
+ datamitsu stores all cached data under `~/.cache/datamitsu/` (or `$XDG_CACHE_HOME/datamitsu/`):
58
+
59
+ ```text
60
+ ~/.cache/datamitsu/
61
+ ├── .bin/ # Downloaded binaries
62
+ ├── .runtimes/ # Runtime binaries (UV, FNM, JVM)
63
+ ├── .apps/ # Runtime-managed applications
64
+ ├── .pnpm-store/ # Shared PNPM content-addressable store
65
+ └── projects/ # Per-project caches
66
+ └── {blake2b(gitRoot)}/ # Project directory (keyed by BLAKE2b hash)
67
+ ├── toolstate.msgpack # Lint/fix results cache
68
+ └── cache/ # Tool-specific caches
69
+ └── ... # e.g., tsbuildinfo for tsc
70
+ ```
71
+
72
+ Each project gets its own directory under `projects/`, keyed by a BLAKE2b-256 hash of the git root path. This directory contains both the lint/fix results cache and a `cache/` subdirectory for tool-specific caches.
73
+
74
+ ## Cache Management
75
+
76
+ ```bash
77
+ # Clear cache for the current project (lint/fix results + tool caches)
78
+ datamitsu cache clear
79
+
80
+ # Clear cache for all projects
81
+ datamitsu cache clear --all
82
+
83
+ # Preview what would be deleted (dry-run)
84
+ datamitsu cache clear --dry-run
85
+
86
+ # Show the global cache directory path
87
+ datamitsu cache path
88
+
89
+ # Show the current project's cache directory path
90
+ datamitsu cache path project
91
+ ```
92
+
93
+ By default, `cache clear` clears only the current project's cache, which includes:
94
+
95
+ - Lint/fix results (`projects/{hash}/toolstate.msgpack`)
96
+ - Tool-specific caches (`projects/{hash}/cache/`)
97
+
98
+ Use `--all` to clear caches for all projects. Use `--dry-run` to preview what would be deleted without actually deleting anything.
99
+
100
+ ## Using Project Cache in Configurations
101
+
102
+ Tools that maintain their own cache (e.g., `tsc` with `--incremental`) can use `facts().projectCachePath` to store cache files in the correct location:
103
+
104
+ ```ts
105
+ tsc: {
106
+ name: "Tsc",
107
+ operations: {
108
+ lint: {
109
+ args: [
110
+ "--noEmit",
111
+ "--incremental",
112
+ "--tsBuildInfoFile",
113
+ tools.Path.join(facts().projectCachePath, "tsbuildinfo"),
114
+ ],
115
+ command: "tsc",
116
+ globs: ["**/*.ts", "**/*.tsx"],
117
+ scope: "per-project",
118
+ },
119
+ },
120
+ },
121
+ ```
122
+
123
+ This ensures that:
124
+
125
+ 1. Tool caches are stored in a dedicated location (`~/.cache/datamitsu/projects/{hash}/cache/`)
126
+ 2. `cache clear` correctly cleans up tool caches alongside lint/fix results
127
+ 3. Tool caches don't pollute `node_modules` or other project directories
128
+
55
129
  ## Examples
56
130
 
57
131
  Usage examples for runtime-managed apps (multi-version isolation, UV isolation, PNPM plugins) are in [examples/](examples/).
package/datamitsu CHANGED
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datamitsu/datamitsu-darwin-arm64",
3
- "version": "0.0.3-alpha-3",
3
+ "version": "0.0.3-alpha-4",
4
4
  "description": "The macOS ARM64 binary for datamitsu, configuration management and binary distribution tool",
5
5
  "repository": {
6
6
  "type": "git",