From 299dee3ce52e4954b63bd4641df9777c1820bba0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Filip=20Sodi=C4=87?= Date: Thu, 10 Oct 2024 20:39:50 +0200 Subject: [PATCH 1/2] Add wasp ts-setup callout to docs --- web/docs/general/wasp-ts-config.md | 4 ++++ web/versioned_docs/version-0.15.0/general/wasp-ts-config.md | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/web/docs/general/wasp-ts-config.md b/web/docs/general/wasp-ts-config.md index e3656f26ec..69000fd3bf 100644 --- a/web/docs/general/wasp-ts-config.md +++ b/web/docs/general/wasp-ts-config.md @@ -106,6 +106,10 @@ In short, you'll have to: ::: 11. That is it, you are now using Wasp TS config! You can delete `main.wasp.old` file now if you still have it around. +:::caution + If you run `wasp clean` or remove `node_modules` on your own, you will have to rerun `wasp ts-setup`! +::: + Got stuck on any of these steps? Let us know in our and we will help! ## What next? diff --git a/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md b/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md index e3656f26ec..69000fd3bf 100644 --- a/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md +++ b/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md @@ -106,6 +106,10 @@ In short, you'll have to: ::: 11. That is it, you are now using Wasp TS config! You can delete `main.wasp.old` file now if you still have it around. +:::caution + If you run `wasp clean` or remove `node_modules` on your own, you will have to rerun `wasp ts-setup`! +::: + Got stuck on any of these steps? Let us know in our and we will help! ## What next? From 62258128889b6149b02a2b67f9dfff14f6e8308e Mon Sep 17 00:00:00 2001 From: Martin Sosic Date: Thu, 10 Oct 2024 21:15:56 +0200 Subject: [PATCH 2/2] Small fix to the Wasp TS config docs. --- web/docs/general/wasp-ts-config.md | 14 +++++++------- .../version-0.15.0/general/wasp-ts-config.md | 14 +++++++------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/web/docs/general/wasp-ts-config.md b/web/docs/general/wasp-ts-config.md index 69000fd3bf..fd970ff1e7 100644 --- a/web/docs/general/wasp-ts-config.md +++ b/web/docs/general/wasp-ts-config.md @@ -78,7 +78,7 @@ Wasp TS config is an **early preview** feature, meaning it is a little rough and } ``` -5. Add `"type": "module"` to the top level of your `package.json`: +5. Add `"type": "module"` to the top level of your `package.json`, if you don't have it yet: ```json title="package.json" { @@ -93,16 +93,16 @@ Wasp TS config is an **early preview** feature, meaning it is a little rough and 9. Create an empty `main.wasp.ts` file and rewrite your `main.wasp.old` in it but in TypeScript. Check out the [reference main.wasp.ts file](#reference-main-wasp-ts-file) below for details on what the TypeScript API for configuring Wasp looks like. -In short, you'll have to: - 1. Import `App` from `wasp-config` - 2. Create a new `app` object with `new App()`. - 3. Use the `app` object to define parts of your web app like `auth`, `pages`, `query`, `api`... - 4. Export the `app` from your file using a default export. + In short, you'll have to: + 1. Import `App` from `wasp-config` + 2. Create a new `app` object with `new App()`. + 3. Use the `app` object to define parts of your web app like `auth`, `pages`, `query`, `api`... + 4. Export the `app` from your file using a default export. You can manually do the rewrite using the reference file and TS types as guides (IDE support should work for you in `main.wasp.ts`), or you can (and we recommend it!) give the reference main.wasp.ts file to the LLM of your choice and tell it to rewrite your `main.wasp` while following the format in the reference file: we had great results with this! 10. Run `wasp start` to run your app! If you got everything right, your app should work exactly like it did before. The only difference is that it's now reading the Wasp config from `main.wasp.ts` instead of `main.wasp`. :::tip - Don't forget to have the database running or do the db migrations if needed, as you would normally when running your app in development. + Don't forget, during `wasp start`, to have the database running or do the db migrations if needed, as you would normally when running your app in development. ::: 11. That is it, you are now using Wasp TS config! You can delete `main.wasp.old` file now if you still have it around. diff --git a/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md b/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md index 69000fd3bf..fd970ff1e7 100644 --- a/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md +++ b/web/versioned_docs/version-0.15.0/general/wasp-ts-config.md @@ -78,7 +78,7 @@ Wasp TS config is an **early preview** feature, meaning it is a little rough and } ``` -5. Add `"type": "module"` to the top level of your `package.json`: +5. Add `"type": "module"` to the top level of your `package.json`, if you don't have it yet: ```json title="package.json" { @@ -93,16 +93,16 @@ Wasp TS config is an **early preview** feature, meaning it is a little rough and 9. Create an empty `main.wasp.ts` file and rewrite your `main.wasp.old` in it but in TypeScript. Check out the [reference main.wasp.ts file](#reference-main-wasp-ts-file) below for details on what the TypeScript API for configuring Wasp looks like. -In short, you'll have to: - 1. Import `App` from `wasp-config` - 2. Create a new `app` object with `new App()`. - 3. Use the `app` object to define parts of your web app like `auth`, `pages`, `query`, `api`... - 4. Export the `app` from your file using a default export. + In short, you'll have to: + 1. Import `App` from `wasp-config` + 2. Create a new `app` object with `new App()`. + 3. Use the `app` object to define parts of your web app like `auth`, `pages`, `query`, `api`... + 4. Export the `app` from your file using a default export. You can manually do the rewrite using the reference file and TS types as guides (IDE support should work for you in `main.wasp.ts`), or you can (and we recommend it!) give the reference main.wasp.ts file to the LLM of your choice and tell it to rewrite your `main.wasp` while following the format in the reference file: we had great results with this! 10. Run `wasp start` to run your app! If you got everything right, your app should work exactly like it did before. The only difference is that it's now reading the Wasp config from `main.wasp.ts` instead of `main.wasp`. :::tip - Don't forget to have the database running or do the db migrations if needed, as you would normally when running your app in development. + Don't forget, during `wasp start`, to have the database running or do the db migrations if needed, as you would normally when running your app in development. ::: 11. That is it, you are now using Wasp TS config! You can delete `main.wasp.old` file now if you still have it around.