Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tutorial section to use Typia on Turborepo (Monorepo) #865

Closed
MarArMar opened this issue Nov 11, 2023 · 11 comments
Closed

Tutorial section to use Typia on Turborepo (Monorepo) #865

MarArMar opened this issue Nov 11, 2023 · 11 comments
Labels
help wanted Extra attention is needed

Comments

@MarArMar
Copy link
Contributor

I am using turborepo

I think a Typia tutorial section on how to install it for a turbo monorepo would be best

What I ended up doing is :

pnpm add typia --filter ProjectName
# CD to project folder
npx typia setup

But cannot verify if it worked because I used Sveltekit and Typia does not seem to support svelte yet

@MarArMar
Copy link
Contributor Author

Note : I additionally created a minimal Turborepo + Sveltekit repo but I have a bug, currently it does not work

https://github.com/MarArMar/TurboTest/tree/main

And created an issue about this

ezolenko/rollup-plugin-typescript2#465

@samchon samchon added the help wanted Extra attention is needed label Nov 11, 2023
@samchon
Copy link
Owner

samchon commented Nov 11, 2023

As I've not used turbo and svelte at all, and maybe no change to use it in my project. hope someone to help.

@MarArMar
Copy link
Contributor Author

Ok I will share my progress on this

@MarArMar
Copy link
Contributor Author

Ok here is a working example : Turborepo X Sveltekit X Typia

MarArMar/TurboTestBis

Main thing was the vite config :

import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import typescript from "rollup-plugin-typescript2";

export default defineConfig({
  // esbuild: false,
  plugins: [
    sveltekit(),
    typescript({
      check: false,
    }),
  ],
});

Have to not set esbuild: false else loading of workspace modules in ts do not work

@MarArMar
Copy link
Contributor Author

Ok actually seems to give false positive results at described in #873

@MarArMar
Copy link
Contributor Author

MarArMar commented Nov 22, 2023

Will update on my progress : currently have a monorepo / turborepo that supports Typia in TS files with workspace imports of TS files, as inside Sveltekit with workspace imports of JS files,

But once typia is installed I cannot import TS files from other modules anymore so not yet done

https://github.com/MarArMar/TurboSvelteKitTypia

@MarArMar
Copy link
Contributor Author

Ok finally made it work !!!! https://github.com/MarArMar/ExampleTurboSvelteKitTypiaTS

had to do this in vite.config.ts :

import { sveltekit } from "@sveltejs/kit/vite";
import { defineConfig } from "vite";
import typescript from "rollup-plugin-typescript2";

export default defineConfig({
  esbuild: false,
  plugins: [
    typescript({
      include: ["../../**/*.ts+(|x)"],
      exclude: ["../../**/node_modules/**/*"],
    }),
    sveltekit(),
  ],
});

@MarArMar
Copy link
Contributor Author

Should I do a PR for a new doc in https://github.com/samchon/typia/tree/master/website/pages/docs/utilization ?

Was thinking of a "Monorepo with Vite" doc page

For Monorepo with TS I believe it worked instantly for me

Also maybe a "Svelte" doc page, specifying you can import TS files using Typia in svelte files but not use it directly inside svelte files

@samchon
Copy link
Owner

samchon commented Nov 23, 2023

Great job!

I think here "setup" page would be better:

@MarArMar
Copy link
Contributor Author

Will try to do that this Week-end

samchon added a commit that referenced this issue Nov 26, 2023
* Complement #865 - documentation

* A little bit detailing

---------

Co-authored-by: Jeongho Nam <samchon.github@gmail.com>
@samchon
Copy link
Owner

samchon commented Nov 27, 2023

https://typia.io/docs/setup/#vite

@samchon samchon closed this as completed Nov 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants