documentation icon indicating copy to clipboard operation
documentation copied to clipboard

add TypeScript to deployment docs

Open stb13579 opened this issue 2 years ago • 1 comments

What does it do?

replicate the PM2 code example in the deployment page for server.js start command.

Why is it needed?

Describe the issue you are solving.

Related issue(s)/PR(s)

Let us know if this is related to any issue/pull request

stb13579 avatar Aug 30 '22 09:08 stb13579

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
documentation ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Dec 22, 2022 at 8:18AM (UTC)
documentation-docu-mvp ❌ Failed (Inspect) Dec 22, 2022 at 8:18AM (UTC)

vercel[bot] avatar Aug 30 '22 09:08 vercel[bot]

It could be confusing that in the TS code block we're not actually using TypeScript, but instead, just showing the option needed to support TS projects

I'd say that we either don't need to have a TS code block and just mention that the distDir option is needed for TS projects.

Or we can use a TS code block like the following.

// path: `./server.ts`

import strapi from '@strapi/strapi'

strapi({ distDir: '<path_to_your_out_dir>' }).start()

Though with that approach, it's worth mentioning that the user would need to run node <path_to_your_out_dir>/server.js as you can't run TS file directly with node.

I agree we might confuse users by providing a TS code block that isn't a TS example. A callout with information regarding typescript ("if strapi typescript project then provide the distDir option") might be clearer. I'll let you judge that @pwizla @StrapiShaun .

Convly avatar Dec 05 '22 11:12 Convly

It could be confusing that in the TS code block we're not actually using TypeScript, but instead, just showing the option needed to support TS projects I'd say that we either don't need to have a TS code block and just mention that the distDir option is needed for TS projects. Or we can use a TS code block like the following.

// path: `./server.ts`

import strapi from '@strapi/strapi'

strapi({ distDir: '<path_to_your_out_dir>' }).start()

Though with that approach, it's worth mentioning that the user would need to run node <path_to_your_out_dir>/server.js as you can't run TS file directly with node.

I agree we might confuse users by providing a TS code block that isn't a TS example. A callout with information regarding typescript ("if strapi typescript project then provide the distDir option") might be clearer. I'll let you judge that @pwizla @StrapiShaun .

I like this idea. I added a callout instead and think it is much clearer. Thanks for the suggestion.

stb13579 avatar Dec 22 '22 09:12 stb13579

This pull request has been mentioned on Strapi Community Forum. There might be relevant details there:

https://forum.strapi.io/t/new-documentation-release-v4-5-5/24573/1

strapi-bot avatar Dec 28 '22 15:12 strapi-bot