Skip to content

Conversation

@Industrial
Copy link

This would make writing the files in the config directory in TypeScript very easy.

I run a custom server.ts to start strapi with strapi().start() in it. I start this process with node-ts which is standard for development.

I made this change and I could replace a .js file with a .ts and it would be loaded.

What does it do?

Load config files from the config dir like js files.

Why is it needed?

Writing everything in TypeScript

Related issue(s)/PR(s)

No.

@codecov
Copy link

codecov bot commented Nov 14, 2020

Codecov Report

Merging #8652 (441ae8c) into master (ff7491e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #8652   +/-   ##
=======================================
  Coverage   33.73%   33.73%           
=======================================
  Files        1244     1244           
  Lines       13732    13732           
  Branches     1365     1365           
=======================================
  Hits         4632     4632           
  Misses       8210     8210           
  Partials      890      890           
Flag Coverage Δ
front 25.42% <ø> (ø)
unit 54.36% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.


Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d3c249c...441ae8c. Read the comment docs.

This would make writing the config dir in TypeScript very easy. I tested this and it works fine.

Signed-off-by: Tom Wieland <tom.wieland@gmail.com>
@Industrial
Copy link
Author

I've noticed more files that load either js or json files. I'm going to attempt to edit those aswell.

@derrickmehaffy
Copy link
Member

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

https://forum.strapi.io/t/strapi-integration-with-other-typescript-aplications-in-a-monorepo/1104/2

@Industrial
Copy link
Author

This isn't the right approach. For now, I resort to compiling to an output directory ./lib.

@derrickmehaffy: How do I configure StrAPI to take a subdirectory of the project root directory as a root?

@derrickmehaffy
Copy link
Member

(My previous response was a bot and not actually me 🙈 I'll let our backend engineers try to answer your question better than I can)

@Industrial Industrial closed this Nov 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants