Skip to content

feat[init]: Add "nodeModulesDir": "auto" to the deno.json in the freshv2 init script #2973 #2813#2990

Closed
SisyphusZheng wants to merge 12 commits into
freshframework:mainfrom
SisyphusZheng:fix(core)init-deno.json-bug
Closed

feat[init]: Add "nodeModulesDir": "auto" to the deno.json in the freshv2 init script #2973 #2813#2990
SisyphusZheng wants to merge 12 commits into
freshframework:mainfrom
SisyphusZheng:fix(core)init-deno.json-bug

Conversation

@SisyphusZheng

@SisyphusZheng SisyphusZheng commented May 22, 2025

Copy link
Copy Markdown
Contributor

The issue in #2973 appears to be caused by multiple cached versions of dependencies. After directly deleting the ~/.cache/deno directory, the problem was resolved. Enabling nodeModulesDir: "auto" can also avoid this issue. Upon checking the requirement in #2813, it suggests changing "nodeModules": "true" to the recommended "auto" in Fresh v1, while Fresh v2 does not have this setting. Considering these two issues, the configuration in Fresh v1, and future support for Fresh plugins (such as Tailwind v4), I believe adding "nodeModulesDir": "auto" to the init script would be beneficial in many aspects.

Also re-edit the test_utils to add functions for re-deleting the tmp directory and setting timeouts, due to permission issues on Github CI testing in Win env.

Closes #2973
Closes #2813

SisyphusZheng and others added 6 commits May 22, 2025 13:36
…amework#2973

After initializing a project with the current version v2 alpha-34 and directly running deno task dev, the button in the sample program did not work. However, after adding nodeModulesDir: "auto", it worked normally.

Meanwhile, I noticed that there seems to be some problem with the current deno task ok.
Comment thread src/test_utils.ts Outdated
@SisyphusZheng SisyphusZheng requested a review from csvn May 22, 2025 11:20
@SisyphusZheng

Copy link
Copy Markdown
Contributor Author

--patch-1
As suggested by @CVSN, the code has been provided to fix the CI failure caused by permission denial of temporary files in the Windows environment on GitHub CI.

@SisyphusZheng SisyphusZheng changed the title fix[init]: slove the init deno.json problem in fresh v2-alpha #2973 fix[init]: slove the init deno.json problem in fresh v2-alpha #2973 #2813 May 22, 2025
@SisyphusZheng SisyphusZheng marked this pull request as draft May 24, 2025 06:04
@SisyphusZheng SisyphusZheng changed the title fix[init]: slove the init deno.json problem in fresh v2-alpha #2973 #2813 fix[init]: Add "nodeModulesDir": "auto" to the deno.json in the freshv2 init script #2973 #2813 May 28, 2025
@SisyphusZheng SisyphusZheng marked this pull request as ready for review May 28, 2025 09:26
@SisyphusZheng SisyphusZheng changed the title fix[init]: Add "nodeModulesDir": "auto" to the deno.json in the freshv2 init script #2973 #2813 Feat[init]: Add "nodeModulesDir": "auto" to the deno.json in the freshv2 init script #2973 #2813 May 30, 2025
@SisyphusZheng SisyphusZheng changed the title Feat[init]: Add "nodeModulesDir": "auto" to the deno.json in the freshv2 init script #2973 #2813 feat[init]: Add "nodeModulesDir": "auto" to the deno.json in the freshv2 init script #2973 #2813 Jun 7, 2025
marvinhagemeister pushed a commit that referenced this pull request Aug 15, 2025
- Cleaning up TMP files in CI is unnecessary, as files are discarded
automatically between runs (except of using cache/artifacts)
- On Windows, `<user>\AppData\Local\Temp\*` files are _not_
automatically removed (see resources below)

This PR should make tests a tiny bit faster in CI by avoiding work, as
well as skipping error messages that might follow.

And running tests locally will now log warnings if temp files fails to
be removed instead of silently continuing.

## Resources

-
https://www.reddit.com/r/windows/comments/yfpbb1/why_arent_windows_temp_files_deleted/
-
https://www.reddit.com/r/WindowsHelp/comments/1f4lgui/why_does_windows_cleanup_miss_temp_folder/?utm_source=chatgpt.com

<img width="1066" height="1065" alt="image"
src="https://github.com/user-attachments/assets/55c98f86-e134-4a2d-86cc-cbab63048c47"
/>

Partially replaces #2990
@marvinhagemeister

Copy link
Copy Markdown
Contributor

Looks like this was already merged as part of #3054

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.

Islands Not Working in Latest Fresh 2 with Preact 10.26.6 When using tailwind, the deno.json generates deprecated nodeModulesDir

3 participants