Commit Graph
81 Commits
Author SHA1 Message Date
Marvin Hagemeister a66e0df08d chore: release 2.0.0-alpha.41 (#3107) 2025-07-17 15:37:02 +02:00
Marvin Hagemeister 9efaf0463e chore: release 2.0.0-alpha.40 (#3101) 2025-07-16 14:46:17 +02:00
Marvin Hagemeister be03e4a548 fix(init): add back static files (#3100) 2025-07-16 14:41:12 +02:00
Marvin Hagemeister 713c85c12d chore: release 2.0.0-alpha.39 (#3097) 2025-07-16 13:43:31 +02:00
Marvin Hagemeister c11cf7b41a feat: expose layouts and pages on App (#3086)
This PR extracts the functionality from the `fs_routes` plugin and
exposes it onto `App`. These are the new APIs:

- `app.layout(pattern, route)`
- `app.onError(pattern, route)`
- `app.notFound(pattern, route)`
- `app.route(pattern, route)`

This also removes the need for `.use(staticFiles())`. This line can be
safely removed.

Fixes https://github.com/denoland/fresh/issues/3040
Fixes https://github.com/denoland/fresh/issues/3033
Fixes https://github.com/denoland/fresh/issues/2591
Fixes https://github.com/denoland/fresh/issues/950
Fixes https://github.com/denoland/fresh/issues/1918
2025-07-14 19:27:48 +02:00
Marvin Hagemeister ccb621d2a3 chore: release 2.0.0-alpha.38 (#3095) 2025-07-14 18:19:03 +02:00
Marvin Hagemeister ec2bb17589 chore: release 2.0.0-alpha.37 (#3074) 2025-07-02 12:48:11 +02:00
Marvin Hagemeister b00175fafd fix(core): don't rely on strict esbuild version (#3073) 2025-07-02 12:38:42 +02:00
Marvin Hagemeister 67fd8ccd36 chore: release 2.0.0-alpha.36 (#3072) 2025-06-30 16:39:34 +02:00
Marvin Hagemeister 0b6e62a693 chore: release 2.0.0-alpha.35 (#3062) 2025-06-26 15:53:15 +02:00
Josh Dales b338845c7f fix(init): only add tailwind to imports when selected (#3051)
If you don't install tailwind you shouldn't need the plugin, resolves
https://github.com/denoland/fresh/issues/3050
2025-06-19 19:55:05 +02:00
Asher Gomez 71bec59820 chore: change patch Deno config file option to links (#3030)
Ref: https://github.com/denoland/deno/pull/29677
2025-06-14 09:55:06 +02:00
Mahesh Bansod 1e6f0d69b1 init: update instructions to run project from a fresh scaffold (#2996)
After scaffolding the project with 
```
deno run -Ar jsr:@fresh/init@2.0.0-alpha.34
```
Instruction show up to run the project:
```
Enter your project directory using cd fresh-project.
Run deno task start to start the project. CTRL-C to stop.

Stuck? Join our Discord https://discord.gg/deno
```
these instructions seem to be outdated since running `deno task start`
on this project throws an error.

While this error also hints that you might want to run the dev server, I
think it gives a bad impression that a newly scaffolded project is
throwing an error after running the command that it has specified. Also,
not many people, especially beginners, read the error messages
completely.
2025-05-26 14:12:47 +02:00
Marvin Hagemeister dbb76623a4 Revert "feat: update the tailwind plugin to suuport tailwindv4 #2819 (#2903)" (#2988)
Reverts tailwind v4 update. Something is wrong with the CSS files on
fresh.deno.dev 😢
2025-05-21 16:07:51 +02:00
40e7747228 feat: update the tailwind plugin to suuport tailwindv4 #2819 (#2903)
Inspired by #2819, #2829, and
https://github.com/pakornv/fresh-plugin-tailwindcss, I made minimal
modifications to the plugin-tailwind, I originally intended to update
based on #2829, but I was informed by the system that I couldn't push.

Due to the breaking changes in Tailwind v4, some PostCSS plugins are no
longer required. Additionally, I updated the syntax in the /www
directory. The /www directory now uses the updated plugin supported by
Tailwind v4.I think this has made initial progress.

# What This PR Solves
The Tailwind plugin has been updated to support Tailwind v4, and it is
currently functioning well both in the repository's www directory and in
the initialized project which for test.

## --patch-1

### 1. Dependency Optimization
- Removed `cssnano` dependency, using Tailwind v4's built-in
optimization(Based on @csvn 's suggestion)
- Removed `autoprefixer` dependency
- Updated `tailwind-plugin` version number
### 2. Build Configuration Adjustments
- Added `--node-modules-dir` parameter to `/www` task for Tailwind v4
support (Based on @marvinhagemeister 's suggestion)
- Added `--allow-scripts` parameter to enable `@tailwindcss/oxide`
execution
### 3. Code Adaptation
- Modified Tailwind-related code in `/www` to support Tailwind v4
- Updated dependency configuration in `deno.json`
### 4. Feature Restoration
- Added `imagescript` and `astral` dependencies to restore screenshot
functionality lost in previous PR updates
- Fixed the issue where the `tailwind-plugin` dependency was incorrectly
pointing to the JSR package instead of the local repository source code
in previous PR.

## --patch-2
- Upgraded Tailwind CSS to the latest version.
- Removed unnecessary dependencies.
- Enabled CSS minification by default when Fresh is in production mode.
- Updated docs/canary/examples/migration-guide.md to support the new
Tailwind plugin format.
- Updated init/src/init.ts to support the new Tailwind version and
plugin version, use new `@import "tailwindcss"`, and generate the new
plugin format.
- Updated init/src/init_test.ts: tests now expect `css` to match
`/tailwindcss/` instead of `/@tailwind/`.
- Removed plugin-tailwindcss/src/types.ts as it is no longer needed, and
updated plugin-tailwindcss/src/mod.ts and www/dev.ts to support the new
format.

Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>

## --patch-3
Addressing @marvinhagemeister feedback, this patch reverts the
unintended loss of PR #2960's changes caused by merge conflicts.

## --patch-4

I initialized a project according to the migration documentation and
used @fresh/update to test whether the plugin works properly with
v2-alpha-34. The results show that it works fine.

- The plugin is published at
jsr:@freshpress/fresh-plugin-tailwind@0.0.1-alpha.8.

- The test project is published at
https://github.com/SisyphusZheng/fresh-project-test/tree/main/fresh-project.

# How Testing Was Conducted

## Local Environment Testing
1. Environment Cleanup
```bash
rm -rf ./.cache/deno deno.lock node_modules
```

2. Test Execution
```bash
deno task www
```

3. Result Verification
- Checked functionality in local `/www` environment
- Confirmed all features working properly

## Code Inspection
- Passed `deno task ok` check

## This forked /www website is hosted and running on GitHub Codespaces,
with support for the latest code changes. You can check it out at:
https://silver-trout-pjr4jw7xx5x9299x6-8000.app.github.dev/

---------

Co-authored-by: 李嘉图·M·路 <146103794+Ricardo-M-Zheng@users.noreply.github.com>
Co-authored-by: deno-deploy[bot] <75045203+deno-deploy[bot]@users.noreply.github.com>
Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2025-05-21 16:01:57 +02:00
Christian Svensson 17257dd1c2 test: use disposable tmp dirs (#2983)
Replaces the patterns below with consistent `AsyncDisposable` and `await
using` resource management for automatic cleanup.

- `await withTmpDir(async (dir) => { ... })` with `finally`
  - Makes code a bit flatter, and reduces callback-hell a bit
- `await Deno.makeTempDir()` + `Deno.remove()`
- `await Deno.makeTempDir()`

Helps be more consistent in removing temporary folders. Among others,
ensures temp folders are removed in the tests below:

- `src/build_cache_test.ts`
- `src/dev/builder_test.ts`
- `src/dev/dev_build_cache_test.ts`

## TODO's

The `Deno.makeTempDir()` method is still used by `buildProd` as well,
but this method is used in the top module scope, where it does not work
correctly with `Deno.test` (it runs before the test methods). I removed
this part from the PR and leave this for later to avoid making the PR
too big.

-
https://github.com/csvn/fresh/blob/test%2Fdisposable-tmp-dirs/tests/test_utils.tsx/#L64
-
https://github.com/csvn/fresh/blob/test%2Fdisposable-tmp-dirs/www/main_test.ts/#L7
2025-05-21 11:13:02 +02:00
Asher Gomez 8953650420 refactor(init): tidy up check task (#2976) 2025-05-19 11:04:52 +02:00
Asher Gomez cc93a1f469 tests(init): remove MockTTY (#2974)
These changes simplify implementation logic of the init workflow and
mock `prompt()` and `console()` functionality in a more direct manner.
This makes things easier to reason about by jumping through fewer mental
hoops.
2025-05-19 10:56:16 +02:00
Asher Gomez 3776ef3154 refactor: centralise imports and cleanup exports (#2900)
The benefits of these changes are:
1. Managing and updating dependencies is easier. One only needs to run
`deno outdated` at the root, instead of in each workspace.
2. The versions of dependencies across workspaces is kept consistent.

Closes #2788
2025-05-19 09:41:06 +02:00
Marvin Hagemeister 3900aa70d4 chore: release alpha 34 (#2967) 2025-05-16 21:36:12 +02:00
Marvin Hagemeister fa5aac5233 chore: fix formatting error in Deno 2.3.3 (#2965)
Upstream bug: https://github.com/denoland/deno/issues/29337
2025-05-16 21:09:34 +02:00
Matt NieldandMarvin Hagemeister 107c25b79a chore: Update links (#2956)
This commit updates several links which are outdated and now redirect to
different URLs on the updated Deno website and documentation.

There are a few dozen instances of URLs starting with
`https:://deno.land/x` and `https:://deno.land/std`. I left these alone
since they are dependencies. Would it make sense to update these from
the versions hosted at `deno.land` to their JSR equivalents, since that
is the new and preferred location of the Deno Standard Library packages
as well as other JavaScript/TypeScript packages used by Deno projects?

For example, the latest version of the Deno Standard Library is now
hosted at `https://jsr.io/@std` instead of `https://deno.land/std`.


![image](https://github.com/user-attachments/assets/7416da3b-3867-4d8f-9a1a-79e6a11ddb46)

---------

Co-authored-by: Marvin Hagemeister <hello@marvinh.dev>
2025-05-15 19:24:27 +02:00
Marvin Hagemeister f8d390e2c3 chore: release alpha 33 (#2949) 2025-05-14 23:25:08 +02:00
Marvin Hagemeister ffd7cdd0bd fix(init): fetch favicon from network like before (#2948)
Reverts back to fetching the favicon from the network. Copying assets
from JSR turns out to be difficult.

Fixes https://github.com/denoland/fresh/issues/2941
2025-05-14 23:20:42 +02:00
Marvin Hagemeister 638a98b106 chore: release alpha 32 (#2947) 2025-05-14 23:05:22 +02:00
Marvin Hagemeister 1957fd0ff6 fix(init): must use urls for asset copying (#2946)
Second attempt to fix https://github.com/denoland/fresh/pull/2943 .
Turns out that `import.meta.dirname` is `undefined` when served from
JSR. I'm not able to reproduce that error locally though.

Fixes https://github.com/denoland/fresh/pull/2943
2025-05-14 22:59:02 +02:00
Marvin Hagemeister 74d5c0f98f chore: release alpha.31 (#2945) 2025-05-14 22:50:25 +02:00
Marvin Hagemeister 4fc1a2b92e fix(init): include favicon.ico in init package (#2943)
Fixes a regression introduced by
https://github.com/denoland/fresh/pull/2867

Fixes https://github.com/denoland/fresh/issues/2941
2025-05-14 22:38:10 +02:00
Marvin Hagemeister c3095f38c4 chore: release 2.0.0-alpha.30 (#2939) 2025-05-14 10:55:47 +02:00
Asher Gomez 84a03ee66c chore(init): cleanup twind options (#2868)
These values are no longer used.
2025-05-12 23:29:17 +02:00
Marvin Hagemeister a49fc3796f chore: ignore check fmt on canary (#2925)
Ignore checking formatting on canary as the formatting might be
different from stable releases of Deno.
2025-05-12 20:30:17 +02:00
Christian Svensson d10ea5a89a fix: remove unnecessary config property in init script (#2915)
From what I can see, `fsRoutes` uses the `FreshConfig.root` option by
default, so this property does not need to be specified. I also added
some JSDoc for the `dir` option in `fsRoutes()` as I understood it's
purpose.
2025-05-12 09:42:16 +02:00
Asher Gomez 54d18d8bca tests: fix leaks, macOS hangs and utility cleanups (#2897)
1. Upgrades `@astral/astral`
2. Fixes test leaks
3. Fixes `@fresh/init` test hangs
4. Simplifies and cleans up test utilities
2025-05-07 10:53:42 +02:00
Asher Gomez 45ce7e3ac0 chore: add doc checker (#2877)
First steps towards #2876
Depends on https://github.com/denoland/std/pull/6632
2025-05-02 10:55:55 +02:00
Asher Gomez d077130b05 refactor(init): avoid network request for downloading of favicon (#2867) 2025-04-28 15:10:03 +02:00
Asher Gomez 149509995e fix(init): define working directory in check task for init script (#2852)
~~This fixes CI for current PRs until
https://github.com/denoland/deno/pull/28655 is added to Deno 2.3.0.~~

This fixes CI until https://github.com/denoland/deno/issues/28923 is
fixed. Then, we can use `Deno.makeTempDir()` and not have to use
`tmp_*/`.
2025-04-22 13:17:05 +02:00
Marvin Hagemeister 65c05b2127 2.0.0-alpha.29 (#2812) 2025-01-16 22:43:40 +01:00
Marvin Hagemeister c7c341b695 2.0.0-alpha.28 (#2810) 2025-01-16 14:24:07 +01:00
Luca Casonato 0864559562 2.0.0-alpha.27 (#2791) 2024-12-12 14:08:25 +01:00
Luca Casonato 03847e9a33 2.0.0-alpha.26 2024-12-10 16:05:22 +01:00
Luca Casonato 4a25ac385f refactor: make this repo a Deno workspace (#2719) 2024-12-10 13:41:18 +01:00
Brian Buchholz d86dcd6d2f fix: tests broken on Deno 2.1 (#2776)
Resolves https://github.com/denoland/fresh/issues/2771

Specifically the `init` test fails:
```
deno test -A ./init
```
Output:
```
error: No target files found.
----- output end -----
init - fmt, lint, and type check project ... FAILED (157ms)
init with tailwind - fmt, lint, and type check project ...
------- output -------
Task check deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx
error: No target files found.
----- output end -----
init with tailwind - fmt, lint, and type check project ... FAILED (136ms)
```

Seems to be a gitignore issue, and _probably_ relates to the new
features that ["lint an fmt respect
gitignore"](https://github.com/denoland/deno/pull/26897):
- the gitignore file in the fresh project has `tmp-*`
- the tmp directory created by the init test matches that pattern:
`tmp-${hash}`
- changing the tmp directory to `tmp_${hash}` resolves the issue 😄
2024-12-04 10:44:45 -08:00
Luca Casonato 6ee4551df1 2.0.0-alpha.25 2024-11-08 12:08:56 +01:00
Luca Casonato 96e520a352 chore: release alpha.24 (#2745) 2024-10-31 11:31:51 +01:00
Marvin Hagemeister bf45e8652a chore: release alpha.23 (#2728) 2024-10-22 14:01:21 +02:00
Luca CasonatoandMarvin Hagemeister 407987589f feat: support fresh projects that are part of a workspace (#2716)
Also a performance improvement & bug fix in the tailwind plugin.

---------

Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-10-17 17:08:24 +02:00
Marvin Hagemeister e303b873a6 chore: release 2.0.0-alpha.22 (#2685) 2024-10-04 10:32:02 +02:00
Tim Reichen 182bda5b7f fix(init): add dom.iterable to template compilerOptions.lib (#2656)
Ref: https://github.com/denoland/deno/issues/25741
2024-10-02 01:28:50 +02:00
Marvin Hagemeister e0f65319cd chore: add license fields (#2666) 2024-09-30 18:45:51 +02:00
Marvin Hagemeister 39dbee5497 chore: release 2.0.0-alpha.21 (#2665) 2024-09-30 18:38:41 +02:00