Skip to content

fix!: rename the _fresh build folder to .fresh (BREAKING)#3175

Open
csvn wants to merge 1 commit into
freshframework:mainfrom
csvn:fix/change-build-dir-default
Open

fix!: rename the _fresh build folder to .fresh (BREAKING)#3175
csvn wants to merge 1 commit into
freshframework:mainfrom
csvn:fix/change-build-dir-default

Conversation

@csvn
Copy link
Copy Markdown
Contributor

@csvn csvn commented Aug 1, 2025

As mentioned in a prior discussion, it seemed like renaming _fresh build folder to .fresh would align more with generated files than the current _. This PR implements that suggestion, to make the breaking change potentially sooner rather than later.

Prior arts

  • node_modules/.deno - Deno installed packages
  • .vite - Cache of prebuilt packages and files
  • .angular - Cache of built files and metadata
  • .github/ or .vscode/ folders

The . prefix in general seems to be used either for generated files, files that should be considered "hidden", or configuration files (e.g. .editorconfig or .gitignore). This seems to fit well with outDir, and would make naming more consistent IMO.

@csvn csvn force-pushed the fix/change-build-dir-default branch 3 times, most recently from 7dd4c6f to c67d14d Compare August 5, 2025 22:20
@csvn csvn force-pushed the fix/change-build-dir-default branch 3 times, most recently from d9b9736 to c807a19 Compare August 20, 2025 08:39
@csvn csvn force-pushed the fix/change-build-dir-default branch from c807a19 to 6519787 Compare September 11, 2025 22:18
@csvn csvn force-pushed the fix/change-build-dir-default branch from 6519787 to b24d008 Compare September 11, 2025 22:20
@fry69
Copy link
Copy Markdown
Contributor

fry69 commented Sep 12, 2025

I strongly object to this. .fresh is a hidden folder, those usually reserved for configuration files or ephemeral caches.

Generated output should be visible in a clearly marked/named folder. Common folder names are:

  • dist
  • out
  • build
  • public (that may clash with static a bit)

The examples also are not fitting IMHO:

  • node_modules/.deno` is a special case, it's wild west inside that hierarchy
  • .vite/.angular are cache/staging folders, not generated output. Cache/staging folders are ephemeral, those can be deleted without any side effect, unlike generated output folders, which might break a running site
  • .github/.vscode are well-known special purpose configuration folders

If no agreement on a new folder name for the generated output can be reached, please keep the _fresh name, it is at least not a hidden folder.

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

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

The rename touches deno.json, .gitignore, packages/init, the deploy workflow, docs, and the migration tool consistently. One thing worth confirming intent on: the asset URL prefix is still _freshpackages/fresh/src/dev/builder.ts:333 (/_fresh/js/${BUILD_ID}/), packages/fresh/src/dev/dev_build_cache.ts:581, and packages/fresh/src/middlewares/static_files.ts:87. After this PR the on-disk folder is .fresh but the URL path served to the browser is still _fresh/js/.... packages/fresh/tests/islands_test.tsx:801 still asserts the _fresh/js/ URL too. Intentional (URL path independent of build folder), or should they move together?

  • nit: packages/update/src/update.ts:140 only matches tasks.preview === "deno serve -A _fresh/server.js" as an exact string — a user who customised the preview task (e.g. added --port) won't be migrated.
  • nit: the migration tool doesn't touch the user project's .gitignore, so existing projects will need a manual _fresh/.fresh/ swap there.

CI green on b24d008.

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.

3 participants