ts-monorepo
tsx
ts-monorepo | tsx | |
---|---|---|
14 | 24 | |
1,434 | 7,841 | |
- | 5.2% | |
8.5 | 9.2 | |
5 days ago | 4 days ago | |
TypeScript | TypeScript | |
MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ts-monorepo
-
[AskJS] Is there a silver bullet for consuming Typescript libraries in a Monorepo?
1. Linking libs with tsconfig paths. This approach involves setting a tsconfig.json paths object which maps the package name, to the local filesystem location. Eg. "paths": {"@org/lib":"../libs/lib"} - Nx uses this approach for their Integrated Monorepo configuration https://nx.dev/tutorials/integrated-repo-tutorial https://github.com/NiGhTTraX/ts-monorepo.
-
Recommendations for lerna/yarn mono repos?
FYI I tried renaming packages/bar/index.ts to index.js and adding allowJs: true in its tsconfig.json and tsconfig.build.json and everything works as expected.
-
Structuring packages and working with workspaces
Give https://github.com/NiGhTTraX/ts-monorepo a try :) It uses path aliases to map your imports to the source code inside the monorepo.
-
How to use npm workspace with create-react-app and typescript?
Make sure you've copied the jest craco config and that you've set up path aliases accordingly.
-
Handling TypeScript in a monorepo
You can check https://github.com/NiGhTTraX/ts-monorepo.
-
You might not need TypeScript project references
FWIW https://github.com/NiGhTTraX/ts-monorepo works in a similar way by using path aliases instead. The result is the same (imports resolve to monorepo source code), but this approach doesn't prevent you from publishing any of the packages (check the repo and the linked docs for more details).
-
using references in tsconfig.json to point to library code
You didn't give an example of how your imports look, but I'm assuming you're trying to use absolute imports for the lib files like from 'lib/src/...'. Project references don't rewrite the imports in any way, they just optimize the builds by caching referenced projects. You'll want to use path aliases instead. Feel free to check out https://github.com/NiGhTTraX/ts-monorepo for full examples.
-
[Question] Setting up monorepo: How be able to debug and build in the same project without changing package.json?
You can use two tsconfig.json files and in one of them configure path aliases to map your package names to the source code, effectively "overriding" package.json#main. You can find examples here https://github.com/NiGhTTraX/ts-monorepo.
-
Monorepo with Yarn Workspaces + TS + Docker Templates
Here is one I liked that is very basic, although I removed lerna from it personally. Shows examples of package sharing and a bunch of popular libraries. Next not nuxt but you get the idea. https://github.com/NiGhTTraX/ts-monorepo
- How do you manage TypeScript monorepos?
tsx
-
Finally, a guide for Node.js and TypeScript and ESM that works
I really enjoy frontend/node/typescript development. I roll my eyes whenever the HN-types complain about CSS or frontend development being a hellhole. Mostly the comments I see seem ignorant or impatient ("Why doesn't this thing work without be bothering to learn it?")
However, the intersection of typescript, nodejs, and ES modules is consistently the most frustrating experience I ever have. Trying to figure out which magic incantation of tsconfig/esbuild/tsc/node options will let me just write code and run it is a fools errand. You might figure something out, and then you try to use Jest and then you descend into madness again.
The biggest tip I can give people is to ditch ts-node and just use (the awkwardly named) tsx https://github.com/privatenumber/tsx, which pretty much just "mostly works" for running Typescript during dev for node.
The problem mostly seems to stem for all the stakeholders being pretty dogmatic to whatever their goals are, rather than the pragmatic option of just meeting people where they are. I really wish the Node, Typescript, Deno/Bun, and maybe some bundler people would come together and figure out how to make this easier for people.
-
ERDIA: TypeORM entity specification documentation tool
If your TypeORM entity is written in TypeScript, you have to run ERDIA using ts-node or tsx as follows.
-
xtsz - a TS / JS file runner with support for HTTP/S imports
Want to import a package / file conveniently from esm.sh or unpkg or directly from a GitHub repo for a one-off script (for example). To do this I created a custom ESBuild plugin to handle HTTP imports - that worked for ,js files. To support running both ESM and CJS, I use tsx.
-
What is your must have npm package on any given project?
I prefer tsx honestly. Nodemon will detect that your using TypeScript and switch from node to ts-node but tsx is a no config necessary version of ts-node that also runs faster. Of course you can configure ts-node to use swc to be faster but then you're playing with config files to get things working.
-
Question about debugging TypeScript
I highly recommend you give this a shot over ts-node
-
Jsx as a general templating language?
Dude I just worked on a PoC a few hours ago. What I did was use ReactDOM's renderToStaticMarkup and tsx to execute the script so I get jsx transpilation on the fly.
-
Thoughts about Deno?
I’ve been trying to adopt Deno into new projects, but I find Node through tsx good enough.
-
Will nodeJs ever have out of the box typescript support?
try tsx. it has support for watch mode and works great with esm module projects.
-
Why is this so hard to do? Help
This is the answer: https://github.com/esbuild-kit/tsx
-
<3 Deno
Have a look at https://github.com/esbuild-kit/tsx
_tsx is a CLI command (alternative to node) for seamlessly running TypeScript & ESM, in both commonjs & module package types.
It's powered by esbuild so it's insanely fast._
What are some alternatives?
tsconfig-paths - Load node modules according to tsconfig paths, in run-time or via API.
esbuild-runner - ⚡️ Super-fast on-the-fly transpilation of modern JS, TypeScript and JSX using esbuild
babel-plugin-tsconfig-paths-module-resolver - Use tsconfig-paths in any bundler that supports a custom babel config.
ts-node - TypeScript execution and REPL for node.js
typescript-rollup - A Single-Page Application(SPA) built using TypeScript, Rollup.js, and Web Dev Server
ts-runtime-comparison - Comparison of Node.js TypeScript runtimes
alias-hq - The end-to-end solution for configuring, refactoring, maintaining and using path aliases
esno - Alias to `tsx`
lerna-lite - Subset of Lerna in a smaller & more modular project. Helps manage and publish multiple packages in a monorepo/workspace structure
esbuild-node-tsc - Build your Typescript Node.js projects using blazing fast esbuild
nestjs-monorepo-microservices-proxy - Example of how to implement a Nestjs monorepo with no shared folder
vite - Next generation frontend tooling. It's fast!