Skip to content

feat(cli): Add ui5 cache clean command - #1455

Open
d3xter666 wants to merge 48 commits into
mainfrom
feat/clean-cache-command
Open

feat(cli): Add ui5 cache clean command#1455
d3xter666 wants to merge 48 commits into
mainfrom
feat/clean-cache-command

Conversation

@d3xter666

@d3xter666 d3xter666 commented Jul 17, 2026

Copy link
Copy Markdown
Member

This PR adds a new ui5 cache clean command to provide a safe, first-class cache cleanup workflow.

Why
Manual cache directory deletion is error-prone and inconvenient for CI/scripted usage.

What changed

  • Added ui5 cache clean with interactive confirmation by default.
  • Added non-interactive mode via --force.
  • Added detailed grouped preview/result output via --verbose.
  • Added stale cache recovery for:
    • interrupted framework cleanup directories
    • deferred build-cache vacuum cleanup

Output behavior

  • Non-verbose: silent when nothing to clean; warning + confirmation when cache is found; fully silent with --force.
  • Verbose: shows cache path, grouped Active/Stale preview, and grouped cleanup result.

JIRA: CPOUI5FOUNDATION-891

@d3xter666
d3xter666 requested a review from a team July 17, 2026 06:34
@d3xter666
d3xter666 marked this pull request as draft July 17, 2026 06:34
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch from 2195d0e to 979a629 Compare July 20, 2026 07:13
@d3xter666
d3xter666 changed the base branch from main to refactor/resolve-ui5-data-dir July 20, 2026 07:14
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch 2 times, most recently from f332519 to 89e915f Compare July 21, 2026 13:34
@d3xter666
d3xter666 changed the base branch from refactor/resolve-ui5-data-dir to main July 21, 2026 13:35
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch 2 times, most recently from e35f673 to af2b848 Compare July 22, 2026 09:23
@d3xter666
d3xter666 marked this pull request as ready for review July 22, 2026 11:20
@d3xter666
d3xter666 removed the request for review from a team July 22, 2026 11:20
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch 2 times, most recently from db2912e to c4e20b3 Compare July 22, 2026 11:32
@d3xter666
d3xter666 marked this pull request as draft July 22, 2026 11:41
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch 2 times, most recently from 5c27a35 to bcaa7fa Compare July 23, 2026 06:29
@d3xter666
d3xter666 marked this pull request as ready for review July 23, 2026 06:57
@d3xter666
d3xter666 requested a review from a team July 23, 2026 07:00
Comment thread internal/documentation/docs/pages/Troubleshooting.md
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch from 301caa6 to 0e631fa Compare July 23, 2026 12:35
@matz3

matz3 commented Jul 27, 2026

Copy link
Copy Markdown
Member

Note: When I run npm i with npm v11.18.0 I get a diff in the package-lock.json, adding yeso to the @ui5/cli deps.
Looks like the lockfile is not up to date?

Comment thread packages/builder/lib/lbt/resources/ResourceCollector.js
Comment thread packages/project/lib/build/cache/BuildCacheStorage.js Outdated
Comment thread packages/project/lib/build/cache/BuildCacheStorage.js
Comment thread packages/project/lib/build/cache/CacheManager.js Outdated
Comment thread packages/project/lib/ui5Framework/cache.js Outdated
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch 4 times, most recently from c64c2c4 to f8d5412 Compare July 28, 2026 14:24
Adds `ui5 cache clean` to remove framework packages and build cache data.
Displays what will be removed with library/version stats, asks for
confirmation (skip with --yes), and handles orphaned staging dirs from
previously interrupted cleans.

No process-coordination locks — that will be added separately.
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch from c25d6e8 to 1108035 Compare July 28, 2026 14:32
Comment thread packages/project/package.json Outdated
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch from 1108035 to 90c1263 Compare July 28, 2026 17:42
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch from eb5321d to 9fb4993 Compare July 29, 2026 07:01
The non-verbose mode is mostly silent,
except for the confirmation prompt and
the warning message.

With --force flag the cache cleanup is silent
Current confirmation does not fit
well for non-verbose mode. It
needs a bit more details.
With that change we provide more context
during the confirmation prompt.
@d3xter666
d3xter666 force-pushed the feat/clean-cache-command branch from ca87570 to 79e7401 Compare July 29, 2026 12:23
@d3xter666
d3xter666 requested a review from matz3 July 29, 2026 12:36
Comment thread packages/cli/lib/cli/commands/cache.js
@d3xter666
d3xter666 requested a review from matz3 July 29, 2026 14:58
}

if (sections.length === 0) {
process.stderr.write(`\n${chalk.italic(PARALLEL_CLEANUP_NOTICE)}\n\n`);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are here, and in other places two additional new-lines, and in case of a success only one? I wonder why two should be needed, but I think this should be consistent.

Comment thread packages/cli/lib/cli/commands/cache.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants