Skip to content

Commit b9ed9d7

Browse files
committed
Update TS recipe
1 parent 869e7ef commit b9ed9d7

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

Diff for: app/cookbook/typescript-template.md renamed to app/cookbook/use-typescript.md

+5-11
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,20 @@
11
---
2-
title: TypeScript template
2+
title: Use TypeScript
33
---
44

5-
We know you like [TypeScript](https://www.typescriptlang.org/). We’ve seen how often you search for TypeScript on the [Enhance](https://enhance.dev) documentation site. We’ve heard from users on our [Discord](https://enhance.dev/discord) that they want a way to work with TypeScript in their Enhance projects.
6-
7-
The thing is, you’ve always been able to use TypeScript with Enhance. The reason we haven’t officially described a way to set up an Enhance project with TypeScript before is because TypeScript configurations are a matter of taste and we didn’t want to give folks the impression that this is the only way.
8-
9-
However, this has given a number of folks the impression that you cannot use TypeScript with Enhance and we wanted to dispel that myth. According to one user we were giving serious “not a real project” vibes by not supporting TypeScript.
10-
11-
So today, we are introducing the [Enhance TypeScript Starter](https://github.com/enhance-dev/enhance-starter-typescript).
5+
If you prefer to work with TypeScript, we recommend starting with our [TypeScript starter project](https://github.com/enhance-dev/enhance-starter-typescript).
126

137

148
## Getting Started
159

16-
Assuming you are starting a new Enhance project you would run the command:
10+
Assuming you’re starting a new Enhance project, you would run the command:
1711

1812
```bash
1913
npx "@enhance/cli@latest" new ./myproject \
2014
--template https://github.com/enhance-dev/enhance-starter-typescript -y
2115
```
2216

23-
This will set up a new Enhance project where you will code your APIs, elements and pages in TypeScript instead of JavaScript. Instead of editing files in the `app` folder you will do your editing in the `ts` folder.
17+
This will set up a new Enhance project where you’ll code your APIs, elements and pages in TypeScript instead of JavaScript. Instead of editing files in the `app` folder, you’ll do your editing in the `ts` folder.
2418

2519

2620
### Project Structure
@@ -45,7 +39,7 @@ Note: We are using `.mts` to tell the TypeScript Compiler to generate ES Modules
4539

4640
## Local Development
4741

48-
Running the local development environment is the same as any other Enhance project. The new `@enhance/plugin-typescript` is responsible for watching the `ts` folder for any file changes. If the file has an `.mts` extension they are re-compiled with the compilation target being the `app` folder. All other file types are simply copied to their corresponding locations in the `app` folder.
42+
Running the local development environment is the same as any other Enhance project. The new `@enhance/plugin-typescript` is responsible for watching the `ts` folder for any file changes. If a file with an `.mts` extension is updated, it will be re-compiled with the compilation target being the `app` folder. All other file types are simply copied to their corresponding locations in the `app` folder.
4943

5044
## Authoring Code
5145

Diff for: app/elements/cookbook/recipes.mjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ export default function CookbookRecipes ({ html }) {
4343
</p>
4444
</cookbook-recipe-card>
4545
46-
<cookbook-recipe-card name="TypeScript Template" href="/cookbook/typescript-template">
46+
<cookbook-recipe-card name="Use Typescript" href="/cookbook/use-typescript">
4747
<p slot="description">
48-
Work with TypeScript in their Enhance projects.
48+
Work with Typescript in your Enhance project
4949
</p>
5050
</cookbook-recipe-card>
5151

0 commit comments

Comments
 (0)