Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/SPEC.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,8 @@ Sizes use **decimal SI units** (1 KB = 1000 B). `--min-size` uses the same conve
| `.parcel-cache` | cache | safe | Parcel cache |
| `coverage` | build | safe | Test coverage reports |
| `.svelte-kit` | build | safe | SvelteKit cache |
| `src/.umi`, `src/.umi-production`, `src/.umi-test` | build | safe | Umi temp dirs (generated entry, routes, webpack cache) |
| `.umi`, `.umi-production`, `.umi-test` | build | safe | Umi temp dirs at the project root (where Umi writes them when the project has no `src/`; also matched when `src/` exists) |

**pnpm-installed `node_modules`**: pnpm clones (macOS) or hard-links (Linux) pnpm store files into `node_modules` by default, so deleting it alone frees little; running `pnpm store prune` afterwards removes packages no project references. The result carries this note when `node_modules/.modules.yaml` (written by pnpm on install, JSON since pnpm 12; `pnpm-lock.yaml` alone does not prove pnpm populated the folder) names a `storeDir` that exists on the same volume. On macOS its `size` leaves out blocks shared with the store or other projects. A store on another volume forces pnpm to copy, so no note is given. `packageImportMethod: copy` is not recorded in `.modules.yaml`, so such installs still get the note.

Expand Down
9 changes: 9 additions & 0 deletions internal/scanner/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ var nodeWalkEcosystem = walkEcosystem{
{RelPath: ".parcel-cache", Category: model.CatCache, Safety: model.SafetySafe}, // Parcel cache
{RelPath: "coverage", Category: model.CatBuild, Safety: model.SafetySafe}, // Test coverage reports
{RelPath: ".svelte-kit", Category: model.CatBuild, Safety: model.SafetySafe}, // SvelteKit cache
// Umi temp dirs (generated entry, routes and webpack cache). Umi writes
// them under src/ when it exists, else at the project root; both
// locations match regardless of src/.
{RelPath: "src/.umi", Category: model.CatBuild, Safety: model.SafetySafe},
{RelPath: "src/.umi-production", Category: model.CatBuild, Safety: model.SafetySafe},
{RelPath: "src/.umi-test", Category: model.CatBuild, Safety: model.SafetySafe},
{RelPath: ".umi", Category: model.CatBuild, Safety: model.SafetySafe},
{RelPath: ".umi-production", Category: model.CatBuild, Safety: model.SafetySafe},
{RelPath: ".umi-test", Category: model.CatBuild, Safety: model.SafetySafe},
},
ExtraRules: nodeExtraRules,
}
Expand Down
19 changes: 19 additions & 0 deletions internal/scanner/node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,25 @@ func TestNodeWalk(t *testing.T) {
tree: []string{"app/package.json", "app/node_modules/pkg/package.json", "app/node_modules/pkg/node_modules/dep/index.js"},
want: []artifact{safe("app/node_modules", model.CatDeps)},
},
{
name: "umi temp dirs under src and at the root",
ecos: node,
tree: []string{
"crm/package.json", "crm/src/pages/index.tsx",
"crm/src/.umi/.cache/0.pack", "crm/src/.umi-production/umi.ts", "crm/src/.umi-test/umi.ts",
"crm/.umi/umi.ts",
"flat/package.json", "flat/.umi/umi.ts", "flat/.umi-production/umi.ts", "flat/.umi-test/umi.ts",
},
want: []artifact{
safe("crm/.umi", model.CatBuild),
safe("crm/src/.umi", model.CatBuild),
safe("crm/src/.umi-production", model.CatBuild),
safe("crm/src/.umi-test", model.CatBuild),
safe("flat/.umi", model.CatBuild),
safe("flat/.umi-production", model.CatBuild),
safe("flat/.umi-test", model.CatBuild),
},
},
{
name: "react native via ios/Podfile",
ecos: node,
Expand Down
Loading