ts-monorepo
alias-hq
Our great sponsors
ts-monorepo | alias-hq | |
---|---|---|
14 | 3 | |
1,420 | 329 | |
- | - | |
8.6 | 4.5 | |
8 days ago | 6 months ago | |
TypeScript | JavaScript | |
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?
alias-hq
-
The Native Way To Configure Path Aliases in Frontend Projects
There are multiple libraries available for configuring path aliases in Node.js, such as alias-hq and tsconfig-paths. However, while looking through the Node.js documentation, I discovered a way to configure path aliases without having to rely on third-party libraries. Moreover, this approach enables the use of aliases without requiring the build step.
-
Path Aliases in TypeScript and why you should use them
You could make it work by yourself, but… instead of spending some time figuring out how to do it (feel free to do it if you want or have time for that), I recommend you to check this amazing package (Alias HQ) which is free and basically uses your tsconfig.json or jsconfig.json file to setup everything for you and make really easy to configure all those more advanced needs.
-
[AskJS] Do you use Yarn v2?
Where I personally gave up on trying to use Yarn + PnP for my team's project was folder aliases. We had a few aliases set up using https://github.com/davestewart/alias-hq , so that we could use the same aliases with Node, Jest, and Webpack. That wouldn't work as-is, because again Yarn has to have full control over all package file access, and so it needs to understand what those aliases are. I got stuck trying to figure out how to get those aliases configured with Yarn instead, and gave up on PnP at that point.
What are some alternatives?
tsconfig-paths - Load node modules according to tsconfig paths, in run-time or via API.
tsdx - Zero-config CLI for TypeScript package development
babel-plugin-tsconfig-paths-module-resolver - Use tsconfig-paths in any bundler that supports a custom babel config.
tsdx - Zero-config CLI for TypeScript package development [Moved to: https://github.com/jaredpalmer/tsdx]
typescript-rollup - A Single-Page Application(SPA) built using TypeScript, Rollup.js, and Web Dev Server
cli - the package manager for JavaScript
lerna-lite - Subset of Lerna in a smaller & more modular project. Helps manage and publish multiple packages in a monorepo/workspace structure
nestjs-monorepo-microservices-proxy - Example of how to implement a Nestjs monorepo with no shared folder
jest - Delightful JavaScript Testing.
taro-hooks - Hooks Library for Taro
proposal-pkg-exports - Proposal for Bare Module Specifier Resolution in node.js