Skip to content

fix(workbench): add __mf__temp directory to .gitignore#1028

Merged
gu-stav merged 3 commits intofeat/workbenchfrom
fix/workbench-tmp-files-ignore
Apr 29, 2026
Merged

fix(workbench): add __mf__temp directory to .gitignore#1028
gu-stav merged 3 commits intofeat/workbenchfrom
fix/workbench-tmp-files-ignore

Conversation

@gu-stav
Copy link
Copy Markdown
Member

@gu-stav gu-stav commented Apr 29, 2026

Description

Module federation still generates the __mf__temp directory in the root of the bootstrapped application when running sanity init, so we need to add it to the gitignore file.

I've added it unconditionally, because if a user would enable module-federation later, it is already ignored.


Note

Low Risk
Small, template-only change plus a matching test assertion; no runtime logic changes beyond the generated .gitignore contents.

Overview
Bootstrapped projects from sanity init will now ignore the module federation temporary directory by adding .__mf__temp/ to the shared .gitignore template.

The federation init test is updated to assert the generated .gitignore contains this entry, and a changeset is added to ship the CLI patch release.

Reviewed by Cursor Bugbot for commit f9f7345. Bugbot is set up for automated code reviews on this repo. Configure here.

@gu-stav gu-stav requested a review from joshuaellis April 29, 2026 08:57
@gu-stav gu-stav requested a review from a team as a code owner April 29, 2026 08:57
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

📦 Bundle Stats — @sanity/cli

Compared against feat/workbench (22f7cafe)

@sanity/cli

Metric Value vs feat/workbench (22f7caf)
Internal (raw) 2.1 KB -
Internal (gzip) 799 B -
Bundled (raw) 10.94 MB -
Bundled (gzip) 2.05 MB -
Import time 824ms +11ms, +1.4%

bin:sanity

Metric Value vs feat/workbench (22f7caf)
Internal (raw) 975 B -
Internal (gzip) 460 B -
Bundled (raw) 9.84 MB -
Bundled (gzip) 1.77 MB -
Import time 2.29s +12ms, +0.5%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — @sanity/cli-core

Compared against feat/workbench (22f7cafe)

Metric Value vs feat/workbench (22f7caf)
Internal (raw) 95.5 KB -
Internal (gzip) 22.5 KB -
Bundled (raw) 21.62 MB -
Bundled (gzip) 3.42 MB -
Import time 784ms -1ms, -0.2%

🗺️ View treemap · Artifacts

Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

📦 Bundle Stats — create-sanity

Compared against feat/workbench (22f7cafe)

Metric Value vs feat/workbench (22f7caf)
Internal (raw) 976 B -
Internal (gzip) 507 B -
Bundled (raw) 50.7 KB -
Bundled (gzip) 12.6 KB -
Import time ❌ ChildProcess denied: node -
Details
  • Import time regressions over 10% are flagged with ⚠️
  • Sizes shown as raw / gzip 🗜️. Internal bytes = own code only. Total bytes = with all dependencies. Import time = Node.js cold-start median.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 29, 2026

Coverage Delta

File Statements
packages/@sanity/cli-core/src/config/cli/getCliConfig.ts 100.0% (±0%)
packages/@sanity/cli-core/src/config/cli/schemas.ts 100.0% (±0%)
packages/@sanity/cli-core/src/services/cliUserConfig.ts 100.0% (±0%)
packages/@sanity/cli-core/src/util/getSanityConfigDir.ts 66.7% (new)
packages/@sanity/cli/src/actions/build/buildApp.ts 95.1% (±0%)
packages/@sanity/cli/src/actions/build/buildStaticFiles.ts 97.6% (+ 1.0%)
packages/@sanity/cli/src/actions/build/buildStudio.ts 96.5% (±0%)
packages/@sanity/cli/src/actions/build/buildVendorDependencies.ts 67.4% (±0%)
packages/@sanity/cli/src/actions/build/getViteConfig.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/build/writeSanityRuntime.ts 96.0% (+ 0.8%)
packages/@sanity/cli/src/actions/deploy/deployApp.ts 80.5% (±0%)
packages/@sanity/cli/src/actions/dev/devAction.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/dev/devServerRegistry.ts 93.5% (new)
packages/@sanity/cli/src/actions/dev/extractDevServerManifest.ts 20.0% (new)
packages/@sanity/cli/src/actions/dev/getDevServerConfig.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/dev/startAppDevServer.ts 100.0% (+ 13.0%)
packages/@sanity/cli/src/actions/dev/startDevManifestWatcher.ts 90.9% (new)
packages/@sanity/cli/src/actions/dev/startStudioDevServer.ts 100.0% (+ 5.0%)
packages/@sanity/cli/src/actions/dev/startWorkbenchDevServer.ts 100.0% (new)
packages/@sanity/cli/src/actions/dev/writeWorkbenchRuntime.ts 100.0% (new)
packages/@sanity/cli/src/actions/init/bootstrapLocalTemplate.ts 89.7% (±0%)
packages/@sanity/cli/src/actions/init/bootstrapTemplate.ts 0.0% (±0%)
packages/@sanity/cli/src/actions/init/createAppCliConfig.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/init/createCliConfig.ts 100.0% (+ 50.0%)
packages/@sanity/cli/src/actions/init/createStudioConfig.ts 83.3% (±0%)
packages/@sanity/cli/src/actions/init/initAction.ts 97.2% (+ 0.1%)
packages/@sanity/cli/src/actions/init/scaffoldTemplate.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/init/types.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/manifest/extractCoreAppManifest.ts 93.1% (new)
packages/@sanity/cli/src/actions/manifest/extractManifest.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/manifest/types.ts 100.0% (±0%)
packages/@sanity/cli/src/actions/manifest/writeManifestFile.ts 100.0% (±0%)
packages/@sanity/cli/src/commands/dev.ts 100.0% (±0%)
packages/@sanity/cli/src/commands/init.ts 100.0% (±0%)
packages/@sanity/cli/src/commands/manifest/extract.ts 100.0% (±0%)
packages/@sanity/cli/src/constants.ts 100.0% (new)
packages/@sanity/cli/src/prompts/init/federation.ts 100.0% (new)
packages/@sanity/cli/src/server/devServer.ts 94.1% (±0%)
packages/@sanity/cli/src/services/userApplications.ts 92.8% (±0%)

Comparing 39 changed files against main @ 737ab0b3fdee054b76a4262635097637a1ebd6a2

Overall Coverage

Metric Coverage
Statements 84.5% (+ 0.3%)
Branches 74.5% (+ 0.4%)
Functions 84.4% (+ 0.4%)
Lines 85.0% (+ 0.3%)

@gu-stav gu-stav force-pushed the fix/workbench-tmp-files-ignore branch from f550a64 to 40985a7 Compare April 29, 2026 10:39
@claude
Copy link
Copy Markdown

claude Bot commented Apr 29, 2026

Claude finished @gu-stav's task in 1m 17s —— View job


Review

  • Read changed files
  • Review diff
  • Check changeset
  • Post review

Changeset summary is inaccurate

.changeset/pr-1028.md line 6: The summary reads fix(workbench): add \__mf__temp` directory to .gitignore, but the actual directory name added is .__mf__temp (note the leading dot). The conventional-commit prefix (fix(workbench):`) also shouldn't appear in a changeset summary — it should be a plain user-facing sentence.

Suggested: Adds \.__mf__temp/` to the scaffolded `.gitignore` to prevent module federation temporary files from being committed.` Fix this →

Fixture gitignore is inconsistent with the template

fixtures/federated-studio/.gitignore line 31 has .__mf__temp (no trailing slash), while the new template entry is .__mf__temp/ (with trailing slash). These should match. Fix this →

@joshuaellis
Copy link
Copy Markdown
Member

it'd be nice if we could avoid having this at the root of projects. iirc its set from the vite plugin, should we look into adding a way to change this filePath upstream do you think?

@gu-stav
Copy link
Copy Markdown
Member Author

gu-stav commented Apr 29, 2026

@joshuaellis Turns out it wasn't hard to add it there: module-federation/vite#670

Since it will take a while to get this merged and updated (the HMR implementation has since been done in the Vite plugin) I'm wondering if we should merge this and revert once it has landed?

@joshuaellis
Copy link
Copy Markdown
Member

Since it will take a while to get this merged and updated (the HMR implementation has since been done in the Vite plugin) I'm wondering if we should merge this and revert once it has landed?

Sure, i think we should be very careful about introducing the HMR behaviour in and be extra vigilant it works as intended before shipping,

@joshuaellis
Copy link
Copy Markdown
Member

ALso need to write a follow ticket to revert this change when we do the update

@gu-stav gu-stav merged commit 236d11c into feat/workbench Apr 29, 2026
82 of 85 checks passed
@gu-stav gu-stav deleted the fix/workbench-tmp-files-ignore branch April 29, 2026 14:22
@gu-stav
Copy link
Copy Markdown
Member Author

gu-stav commented Apr 29, 2026

@claude add an issue to the Dashboard 2.0 project, to revert the above change.

@squiggler-app
Copy link
Copy Markdown
Contributor

squiggler-app Bot commented Apr 29, 2026

Claude finished @gu-stav's task in 3m 1s —— View job


Tasks

  • Understand the request
  • Attempt to find the "Dashboard 2.0" GitHub project
  • Attempt to create a GitHub issue
  • Add issue to Dashboard 2.0 project

I was unable to create the issue — gh write commands (issue creation, project queries) are blocked by the tool permission settings in this environment and require explicit user approval.

To create the issue manually, you can use this pre-filled link:

Create issue →

Then add the created issue to the Dashboard 2.0 project from the issue's sidebar.

If you'd like me to retry with approved permissions, you can add gh issue create and gh project item-add to your allowed tools.

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