Commit Graph
85 Commits
Author SHA1 Message Date
Kerim Hudson c98579e499 fix: add .js + .jsx extension to tailwind content glob (#2414)
Whilst Deno supports Typescript by default, not everyone necessarily
will want to write every file in Typescript. If using TailwindCSS, at
the moment the files Tailwind searches for classes does not include
`.js` and `.jsx` endings. Whilst you can manually add them via the
`tailwind.config.ts`, it might be nice to have these added in by default
for a better onboarding experience.

Closes #2291
2024-04-26 16:09:17 +02:00
Luca CasonatoandMarvin Hagemeister 29d582c987 chore: update ahead-of-time build docs for Deno Deploy (#2381)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2024-03-22 22:19:17 +01:00
Marvin Hagemeister b26a0d6c6e fix: improve init choice design (#2314)
Before:

<img width="528" alt="Screenshot 2024-02-14 at 15 33 41"
src="https://github.com/denoland/fresh/assets/1062408/1c7093db-a509-4d42-998c-3b5282cd88d5">

After:

<img width="530" alt="Screenshot 2024-02-14 at 15 33 09"
src="https://github.com/denoland/fresh/assets/1062408/99e2bdeb-e0f5-4926-91e1-f972df1149c1">
2024-02-14 15:39:47 +01:00
Roj [roːʒ] d19c22d592 feat: add back twind in init wizard (#2290) 2024-01-30 12:34:38 +01:00
Marvin Hagemeister 912f3782a3 feat: improve tailwind deployment flow (#2227)
By moving folks from `twind` over to the `tailwind` plugin we have
traded support questions about "how to get twind autocompletion
working?" with "my styles are not showing up in automatic mode". The
tailwind plugin has a hard requirement on having a build step. We have
documented this at various places and have a guide on how to set
everything up, but it's much better if we float those steps from Fresh
itself when we detect this.

With this PR we will prepare a `.github/workflows/deploy.yml` file
already where the user only needs to swap out the project name.

When Fresh is started in production mode, the tailwind plugin is active
and no snapshot files were loaded, then we print a helpful hint to the
console:

```sh
No pre-compiled tailwind styles found.

Did you forget to run "deno task build" prior to starting the production server?
```

When we are running inside Deno Deploy this PR goes one step further.
Since it is the first time many users might use Deno Deploy we'll also
show a simple page that shows how to finish the tailwind setup. I've
intentionally tried to not present this as a warning but rather as a
"finishing" step to avoid scaring users off. It's not the prettiest
page, but it's good enough for now.

<img width="892" alt="Screenshot 2024-01-09 at 23 41 27"
src="https://github.com/denoland/fresh/assets/1062408/9bf2a61b-5551-4d8e-bdf8-b498072f8e98">


Fixes https://github.com/denoland/fresh/issues/2223
2024-01-10 10:35:26 +01:00
Marvin Hagemeister 8c4385043c Revert "refactor: use --env CLI arg" (#2212)
Reverts denoland/fresh#2204

The `--env` flag cannot be used by default because it fails when no
`.env` file is present. Therefore this PR accidentally introduced a
breaking change.
2024-01-04 11:53:15 +01:00
Asher Gomez 99eb5435bb refactor: use --env CLI arg (#2204)
This change replaces the use of the Standard Library's `dotenv.load()`
with the native `--env` CLI flag.

The benefits include:
* One less dependency
* More obvious consumption of the `.env` file in the CLI output
2023-12-29 10:47:15 +01:00
Nicolò Ribaudo df35a063fd fix: .vscode/tailwind.json generation (#2185)
Fixes #2184

Is there any reason for this not being `JSON.stringify({ ... that object
... })` and avoid a lat of escaping?
2023-12-19 21:45:05 +00:00
Marvin Hagemeister 90b0642bdd fix: init app use same width numbers (#2155) 2023-12-07 11:30:14 +01:00
Reed von Redwitz 7465dbd978 feat(init): task to generate manifest file (#1422) 2023-12-05 15:03:37 +01:00
迷渡 04c62173fe fix: Unknown at rule @apply css(unknownAtRules) (#2141) 2023-12-05 11:28:21 +01:00
迷渡andMarvin Hagemeister 87d1f2356a chore: Use satisfies instead of as (#2136)
Co-authored-by: Marvin Hagemeister <marvin@deno.com>
2023-12-04 11:38:52 +01:00
Reed von Redwitz 35da45bff1 chore: update types in tests, init, update (#2122)
Of particular note is the change to
`tests/fixture_plugin/routes/test.tsx`. Note how I do this:
```diff
-  async GET(_req, ctx: HandlerContext<unknown, { test: string }>) {
+  async GET(_req, ctx: FreshContext<{ test: string }, unknown>) {
```

I find it strange and confusing that the order of the type parameters
has "changed". This makes it impossible to do a simple search and
replace, because people now have to change order as well.

Most of the types have been declared as `<T, S>`, i.e. data before
state:
* `PageProps<T = any, S = Record<string, unknown>>`
* `RouteContext<T = any, S = Record<string, unknown>>`
* `Handler<T = any, State = Record<string, unknown>>`
* `Handlers<T = any, State = Record<string, unknown>> `
* `AsyncRoute<T = any, S = Record<string, unknown>>`
* `PageComponent<T = any, S = Record<string, unknown>> `
* `AsyncLayout<T = any, S = Record<string, unknown>>`

And then `FreshContext` comes around like 
```
export interface FreshContext<
  State = Record<string, unknown>,
  // deno-lint-ignore no-explicit-any
  Data = any,
  NotFoundData = Data,
>
```
and switches it all up.

Not a huge issue, but just something to be aware of that others might
report.
2023-12-02 10:33:59 +01:00
Marvin Hagemeister fe792455ab fix: add missing -h/--help to init (#2096) 2023-11-29 16:57:39 +01:00
Marvin Hagemeister ef26451dc6 fix: update tailwind init script (#2078) 2023-11-28 13:58:57 +01:00
Marvin Hagemeister a8dfdd0b91 fix: Tailwind CSS intellisense not working (#2073) 2023-11-28 11:22:41 +01:00
Reed von Redwitz ad2341dada chore: switch init to use tailwind (#2061) 2023-11-22 11:17:42 +01:00
Marvin Hagemeister 0a85a1fe5f Revert "chore: merge language-specific VSCode settings" (#2054) 2023-11-21 14:46:47 +01:00
int ba3fa2c895 chore: merge language-specific VSCode settings (#2051) 2023-11-20 14:49:12 +00:00
Marvin Hagemeister e0f503ee37 fix: ready color not readable in light themes (#2014) 2023-11-06 10:39:03 +01:00
Marvin Hagemeister e9717ed911 fix: meta charSet -> charset (#1875) 2023-10-06 15:59:13 +02:00
Sanjaiyan Parthipan a4ed93bfac init: use Promise.all (#1831) 2023-10-02 10:38:08 +02:00
mmuddasani d71f947327 fix: init fresh config formatting (#1804) 2023-09-21 01:37:06 +02:00
mmuddasani ff6ae7eb7f fix: Fix typo in hover rule for default non-twind CSS (#1799) 2023-09-20 07:52:29 +00:00
Marvin Hagemeister ead634b0cf feat: exclude _fresh dir from everything (#1788) 2023-09-18 15:05:59 +02:00
Marvin Hagemeister 20d5630534 fix: env files not loaded in build task (#1743) 2023-09-06 13:00:07 +02:00
Marvin Hagemeister ce4df30e92 fix: exclude _fresh dir from lint + fmt (#1656) 2023-08-17 10:48:53 +02:00
Marvin Hagemeister 477364c567 feat: prebundle code + restore from snapshot (#1604) 2023-08-16 16:47:51 +02:00
Marvin Hagemeister 86f92114d8 feat: Support setting <html> in _app template (#1617) 2023-08-11 18:40:20 +02:00
Reed von Redwitz a489aff190 feat(init): add check task to run all static analysis (#1454) 2023-08-07 14:39:53 +02:00
vrunt a66f7217da fix: typo boder-box to border-box (#1574) 2023-08-02 10:09:17 +02:00
Reed von Redwitz 5af441cde6 chore(init): remove blank line from _404 template (#1539) 2023-07-28 10:50:13 +02:00
Lino Le Van 5ba19abe13 fix: typos (#1526) 2023-07-26 13:09:42 +00:00
Lino Le Van 18857ea052 fix(init): typo in flags parsing (#1525) 2023-07-26 08:47:40 +02:00
Will Bandwill berry f1922fb984 feat: add --docker option to Fresh init (#1520)
Co-authored-by: will berry <willberry@wills-MBP.attlocal.net>
2023-07-25 19:41:04 +02:00
Roj 16453b4dc9 style: fix remaining inconsistencies (#1505) 2023-07-22 14:09:25 +02:00
Roj d1e78095be www: consistently spell Fresh (#1504) 2023-07-22 13:02:31 +02:00
Marvin Hagemeister f2ea4055df fix: init banner not colored in ansi256 terminals (#1456)
This basically uses the same fix as #1377 and #1323 for the init script.

Before:

<img width="505" alt="Screenshot 2023-07-12 at 22 18 29"
src="https://github.com/denoland/fresh/assets/1062408/e77c3110-d3e2-479e-8381-c67c39e216fa">


After:

<img width="446" alt="Screenshot 2023-07-12 at 22 18 38"
src="https://github.com/denoland/fresh/assets/1062408/debda939-bdce-4890-8dfb-265a4e1b8328">
2023-07-13 00:56:36 +02:00
Yuki Tanaka 37f1618004 feat(init.ts): enable lint rules for fresh apps (#1434) 2023-07-09 10:11:36 +02:00
Marvin Hagemeister 92516e441e feat: make vscode-deno default formatter (#1431) 2023-07-08 21:50:21 +02:00
Reed von Redwitz 70e9c556c3 feat(starter): always initialize _app.tsx (#1380) 2023-07-01 12:59:10 +02:00
Marvin Hagemeister 87b15885aa feat(starter): add 404 page template (#1336) 2023-06-21 11:01:48 +02:00
kit 4e2abd67dd feat(init): make project name as default header title (#1275)
default header title should be same as project name
2023-06-18 06:39:37 +02:00
Marvin Hagemeister ea6a74237d feat: improve starter template design (#1320) 2023-06-17 20:31:08 +02:00
Marvin Hagemeister 372d0dfffb feat(init): add update task (#1290) 2023-06-14 15:48:52 +02:00
Tyler Mueller d3a2edc984 fix(init): Typo "Projet" -> "Project" (#1269) 2023-06-11 16:20:57 +00:00
Marvin Hagemeister 503bdc384f feat(init): make directory argument optional (#1263) 2023-06-10 15:48:02 +02:00
Luca Casonato 94b23f30dd chore: improve init readme (#1238) 2023-06-03 21:15:39 +10:00
Asher GomezandLuca Casonato 1b6678951a feat: support embedded import map in deno.json (#1188)
One can now inline the `imports` and `scopes` from the import map directly into deno.json.

For new projects, `import_map.json` is not generated anymore.

Co-authored-by: Luca Casonato <hello@lcas.dev>
2023-06-03 10:46:40 +02:00
Asher Gomez 8fa4141e06 refactor: replace useState() with useSignal() (#1234) 2023-06-02 06:43:01 +10:00