#How to make a lib that can share files between projects with correct folder structure?

13 messages · Page 1 of 1 (latest)

violet arch
#

Hello,
I have been trying to share files between my node project and angular project but it never work.
it either the files is not in my rootDir error, or it puts all the files in wrong folders, or cant find my files.

The image is how i want my folder structure to look like. The question is it possible to make it like that?
Deploy folder is the production version.

I want the folder Shared to be able to work on my fontend and backend since im using Typescript on both and i don't want to do two files with the same content.

I hope you understand what i mean 🙂

#

How to make a lib that can share files between projects with correct folder structure?

normal barn
#

Do you have a tsconfig.json at the root of that folder structure?

violet arch
# normal barn Do you have a `tsconfig.json` at the root of that folder structure?

I tried to use tsconfig.json before but
the file structure became

fontend/src/
backend/src/
shared/

Is it possible to make it go

deploy/
   public/here is the fontend production// the fontend i can probably compile for it self to go to the public folder.(im using angular)
   just put the backend/src directly in the deploy/
   shared/ for the shared files
#

it shouldn't be impossible to do what i want i think

silent phoenix
#

You should look into making a MonoRepo. This will greatly simplify sharing code between apps. Maybe try: https://turbo.build/

Turbo

Turbo is an incremental bundler and build system optimized for JavaScript and TypeScript, written in Rust.

violet arch
#

Never heard of Turbo before

silent phoenix
#

Yup it will work with everything

violet arch
#

ah, okay. I will see if i find some examples on github

silent phoenix
#

@violet arch can this be marked as resolved?

violet arch
#

Yeah, sorry about that. Was testing stuff. I will make a new one if I still need help😋