Zum Hauptinhalt springen
LIVE
CVSS 6.9CVE-2026-137684 | A security flaw has been discovered in eosphoros-ai DB-GPT up to 0.8.3. This affects the function editor_sql_run of the file packages/dbgpt-app/src/dbgpt_app/openapi/api_v1/editor/api_editor_v1.py of the component Editor SQL Run API. Performing a manipulation of the argument db_name results in authorization bypass. It is possible to initiate the attack remotely. The exploit has been released to the public and may be used for attacks. The pull request to fixCVSS 8.7CVE-2026-137992 | libexpat through 2.11.0 contains a denial of service vulnerability in defineAttribute() of lib/xmlparse.c that fails to detect duplicate non-ID #IMPLIED or #REQUIRED attribute declarations. Attackers can supply a crafted XML document with repeated ATTLIST declarations in an internal DTD subset to cause quadratic CPU consumption in storeAtts() during parsing.CVSS 8.5CVE-2026-137994 | Leo through 6.8.10 contains an insecure deserialization vulnerability that allows attackers to execute code by embedding pickled data in unknown XML attributes of .leo outlines. Attackers can place a pickle __reduce__ gadget in a or element attribute that resolveUa passes to pickle.loads, executing code with user privileges when the outline is opened.CVSS 7.0CVE-2026-137995 | FOG Project before 1.6.0.119 contains an information disclosure vulnerability that allows unauthenticated attackers to obtain host tokens from status/hostgetkey.php by supplying a host MAC address. Attackers can present the token to service/hostinfo.php to retrieve decrypted Active Directory join credentials and Windows product keys during deployment windows.CVSS 6.8CVE-2026-137996 | Zettlr before 4.11.0 fails to validate URI schemes in Markdown link targets, allowing attackers to launch arbitrary registered protocol handlers via Electron shell.openExternal without confirmation. Attackers can craft documents whose Ctrl/Cmd-clicked links use smb:// to leak NTLM credential hashes on Windows or invoke custom protocol handlers with attacker-controlled parameters.CVSS 8.5CVE-2026-137997 | HCIPy through 0.7.1 contains an insecure deserialization vulnerability that allows attackers to execute code by supplying crafted .pkl files to read_field, read_grid or read_mode_basis. Because hcipy/util/io.py selects pickle by file extension and calls pickle.load, a __reduce__ gadget in a pupil, apodizer, PSF or mode-basis file runs code with the user's privileges.CVSS 8.5CVE-2026-137998 | Detoxify 0.5.3 through 0.5.4 contains an insecure deserialization vulnerability in load_checkpoint that allows attackers to execute code by supplying a crafted checkpoint file. Attackers can embed a pickle __reduce__ gadget in a .ckpt file loaded via torch.load with weights_only=False to run code with the user's privileges.CVSS 8.5CVE-2026-137999 | JSONSchema2PoPo2 through 3.0.3 contains a code injection vulnerability that allows attackers to inject Python code by supplying JSON Schema default or format values that are written unescaped. Attackers can place a single quote in a string property default to break out of the literal in the generated __init__ signature, executing injected code when the generated module is imported.
Alle im Drawer
Intelligence View
⚡ tsecurity.de Intelligence

How Turborepo Makes Large JavaScript Projects Fast

Introduction Most projects start with a single repository. Imagine you're building an e-commerce platform: a Next.js storefront for customers, a React Native…

Beitrag
0
Seite
0
↗ Quelle (dev.to)
Quelle & Fakten · 11 Min. Lesezeit
Quelle: dev.to
Rubrik: Sichere Programmierung




Introduction



Most projects start with a single repository. Imagine you're building an e-commerce platform: a Next.js storefront for customers, a React Native mobile app, and a NestJS backend API. Splitting these into three repositories feels like the obvious, clean solution.




ecommerce-web
ecommerce-mobile
ecommerce-api






For the first few months, this works fine. Then the project grows, and the cracks start to show:




  • You copy utility functions between repositories instead of importing them.

  • You duplicate TypeScript interfaces across the frontend, mobile app, and API.

  • Your frontend and backend drift apart because each repo defines its own version of the same models.

  • Updating one shared component means editing it in three different places.



Eventually, maintaining the project becomes harder than building new features.



If that sounds familiar, you're not alone — it's exactly the problem monorepos were designed to solve.



In this article, we'll cover:




  • What a monorepo actually is, and how it differs from a multi-repo (polyrepo) setup

  • Why engineering teams choose it

  • How Turborepo makes monorepos fast instead of slow

  • A practical, production-ready structure for a Next.js + React Native + NestJS monorepo

  • Common mistakes and best practices



Whether you work with React, Next.js, React Native, or NestJS, these concepts will help you build projects that scale without becoming a maintenance burden.






The Problem With Multiple Repositories



A typical multi-repo setup looks like this:




web-app/
mobile-app/
backend-api/
shared-components/






Each repository has its own package.json, dependencies, CI/CD pipeline, Git history, and versioning strategy. It looks clean at first — but as the project grows, several problems appear.






1. Code duplication



You write a helper function once:




export function formatPrice(price: number) {
return `$${price.toFixed(2)}`;
}






Both the web app and the mobile app need it, so instead of importing it, someone copies it. Now there are two versions. When one changes, the other silently falls behind.






2. Inconsistent type definitions



The backend defines a User model:




export interface User {
id: string;
name: string;
email: string;
}






The frontend defines its own version. The mobile app defines a third. Someone later adds an avatar field — but only updates one of the three. Now the applications disagree about what a User actually is, and that mismatch surfaces as runtime bugs.






3. Harder dependency management



Every repository maintains its own dependency tree:




web/package.json
mobile/package.json
api/package.json






Upgrading React, TypeScript, or ESLint means repeating the same work three times — and different repos can quietly end up on different versions of the same package.






4. More complex CI/CD



Each repository needs its own build pipeline, test workflow, deployment configuration, and environment variables. Multiplied across several repos, this adds up to a real maintenance cost.






5. Harder refactoring



Renaming Product to CatalogProduct across four repositories means updating each one, publishing shared packages, bumping dependency versions, and coordinating releases. A simple rename becomes a multi-day effort.






What Is a Monorepo?



A monorepo (short for "monolithic repository") keeps multiple related projects in a single Git repository, instead of splitting them across separate ones:




company-project/
├── apps/
│ ├── web
│ ├── mobile
│ └── api
│
├── packages/
│ ├── ui
│ ├── types
│ ├── utils
│ └── config
│
├── package.json
└── turbo.json






This structure separates applications from reusable code:





  • apps/ — runnable applications, e.g. a Next.js site, a React Native app, a NestJS API, an admin dashboard.


  • packages/ — reusable modules, e.g. UI components, utility functions, shared TypeScript types, or shared ESLint/Prettier configs.



Instead of duplicating a Button component across apps, both the web app and the mobile app import it from packages/ui.






Monorepo vs. Polyrepo
















































Feature Monorepo Polyrepo
Single Git repository ✅ ❌
Shared code ✅ Easy ⚠️ Requires publishing packages
Dependency management Centralized Separate per repo
Refactoring Easier More complex
Consistent tooling ✅ ⚠️ Often inconsistent
Initial setup More advanced Simpler
Best for Medium & large projects Small, independent projects


Neither approach is universally better — the right choice depends on your project's size and how much code your applications actually share.






Benefits of Using a Monorepo



Better code reuse. packages/ui can be imported by both apps/web and apps/mobile, giving you a single source of truth instead of copy-pasted components.



Shared TypeScript types. User, Product, Order, and Address are defined once in packages/types and imported everywhere, which eliminates an entire category of "the frontend and backend disagree" bugs.



Easier refactoring. Since every project lives in the same repository, your IDE can rename a shared interface and update every import automatically.



Consistent tooling. One shared packages/eslint-config (or Prettier, TypeScript, Tailwind config) replaces three or four slightly-different copies.



Better collaboration. New team members clone one repository and can start working immediately, instead of juggling multiple repos and remembering how they relate to each other.






When Should You Use a Monorepo?



Monorepos shine when applications genuinely share code: a Next.js site and a React Native app pulling from the same design system, a frontend and backend sharing TypeScript models, multiple dashboards, or a SaaS platform with several client apps.



They're usually unnecessary for a simple portfolio site or a small standalone API. A monorepo is a tool, not a rule — use it when it solves a problem you actually have.






Introducing Turborepo



A fair question at this point: if a monorepo can hold dozens of apps and hundreds of packages, won't builds get painfully slow?



Yes — unless you use the right tooling. That's what Turborepo is for.



Turborepo is a high-performance build system built specifically for JavaScript and TypeScript monorepos. It understands the relationships between your apps and packages, so it only does the work that's actually necessary instead of rebuilding everything on every run.



Think of it this way: a monorepo organizes your code; Turborepo optimizes how that code gets built, tested, linted, and run in development.






Why not just use npm scripts?



With three apps in your repo:




apps/
web
mobile
api






running npm run build builds all three — even if you only touched a single file inside web. For a small project that's fine. For a repo with a dozen apps, it's a lot of wasted time.



Turborepo fixes this with four core optimizations: intelligent caching, incremental builds, parallel execution, and task pipelines.






1. Intelligent caching



Say your build takes five minutes. You make no changes and run:




turbo run build






Turborepo recognizes that nothing has changed and restores the previous output instead of rebuilding:




✔ Using cached result






The command finishes in seconds. Under the hood, Turborepo calculates a fingerprint for each task based on its source files, dependencies, configuration, environment variables, and package versions. If none of that has changed, it just replays the cached result.






2. Incremental builds



Now suppose you change one file in a shared package:




packages/ui/Button.tsx






Only the applications that actually depend on packages/ui need to rebuild:




        packages/ui
/ \
web admin






The API doesn't rebuild, and mobile doesn't rebuild if it doesn't use that package. Turborepo rebuilds only what's affected, instead of the whole repository.






3. Parallel execution



Plain npm scripts often run sequentially — build web, then wait, then build api, then wait, then build mobile. Turborepo runs independent tasks at the same time, taking advantage of your machine's multiple CPU cores automatically:




Building web    ✓
Building mobile ✓
Building api ✓









4. Task pipelines



Applications typically depend on packages, which may depend on other packages:




packages/types → packages/ui → apps/web






Build order matters here — types has to be ready before ui, which has to be ready before web. Instead of managing that sequence by hand, Turborepo builds the dependency graph automatically and executes tasks in the correct order.






A more realistic dependency graph






                packages/types
│
┌──────────────┼───────────────┐
packages/ui packages/utils
│ │
┌────┴────┐ │
web admin api
│
mobile






If you modify packages/utils, should web rebuild? No — it doesn't depend on that package. Only api (and anything downstream of it) needs to rebuild. Turborepo works this out automatically from the graph.






A Practical Monorepo Structure



Here's a realistic full-stack layout:




my-company/
├── apps/
│ ├── web
│ ├── mobile
│ ├── api
│ └── admin
│
├── packages/
│ ├── ui
│ ├── types
│ ├── utils
│ ├── hooks
│ ├── config
│ ├── eslint-config
│ └── tsconfig
│
├── package.json
└── turbo.json






Applications and shared libraries are clearly separated, and each folder has a single responsibility.



Sharing TypeScript models. Instead of an API, web, and mobile app each defining their own Product interface, define it once in packages/types:




// packages/types/Product.ts
export interface Product {
id: string;
title: string;
price: number;
image: string;
}






Every app imports the same model:




import { Product } from "@repo/types";






Sharing utility functions. A currency formatter used by every app lives in packages/utils instead of being copy-pasted three times:




// packages/utils/formatCurrency.ts
export function formatCurrency(value: number) {
return new Intl.NumberFormat("en-US", {
style: "currency",
currency: "USD",
}).format(value);
}






Sharing UI components. packages/ui becomes your design system — Button, Card, Input, Modal, Avatar, Badge — so every app stays visually consistent instead of reinventing the same components.



Sharing configuration. Centralize ESLint, TypeScript, Prettier, and Tailwind configs into packages/eslint-config and similar packages, instead of maintaining a slightly different .eslintrc in every app.






Understanding turbo.json



At the root of your project, turbo.json defines how Turborepo executes tasks:




{
"$schema": "https://turbo.build/schema.json",
"tasks": {
"build": {
"dependsOn": ["^build"],
"outputs": ["dist/**", ".next/**"]
},
"lint": {},
"test": {},
"dev": {
"cache": false
}
}
}








  • dependsOn: ["^build"] — before building this package, build all of its dependencies first.


  • outputs — the files Turborepo caches after a successful build. If they haven't changed, it restores them instantly next time.


  • cache: false on dev — development servers shouldn't be cached; turbo run dev should always give you a fresh environment.



Instead of cd-ing into each app individually, you run tasks from the root:




turbo run dev
turbo run build
turbo run lint
turbo run test






Turborepo figures out what needs to run, in what order, whether it can reuse the cache, and which tasks can run in parallel — so you can focus on writing code instead of orchestrating builds.






Common Mistakes



Adopting a monorepo doesn't automatically improve your architecture. A few pitfalls to watch for:



Sharing everything. Moving nearly every file into packages/ makes the repo harder to navigate. Share stable, reusable code — not application-specific business logic.



Circular dependencies. If ui depends on utils, which depends on hooks, which depends back on ui, you've created a loop that makes builds fragile and hard to reason about. Keep dependencies flowing in one direction.



Oversized shared packages. Avoid dumping everything into a single common/ or shared/ folder with hundreds of unrelated files. Prefer small, focused packages: ui, types, utils, auth, config.



Ignoring boundaries. Living in one repository doesn't mean every app should import from every package. Each app should only depend on what it actually needs — clear boundaries make the whole thing easier to scale.






Best Practices





  • Keep packages small, each with one clear responsibility (UI, types, auth, API client, utilities).


  • Share only stable code. Business-specific logic usually belongs inside the application, not a shared package.


  • Use TypeScript everywhere. Sharing interfaces between frontend and backend removes a whole class of runtime errors.


  • Standardize tooling — one shared ESLint, Prettier, TypeScript, and Tailwind config for the whole repo.


  • Automate quality checks by running turbo run lint, turbo run test, and turbo run build in CI, so issues are caught before deployment.






Should You Always Use a Monorepo?



Not necessarily. A monorepo is an architectural choice, not a universal solution.



It's a strong fit when multiple applications share code, teams collaborate on related projects, consistency matters, or a frontend and backend share TypeScript models. It's often unnecessary for personal portfolios, landing pages, or small standalone projects — the added structure isn't worth it if there's nothing to share.






Final Thoughts



As applications grow, architecture matters as much as clean code. A monorepo makes it easier to organize multiple applications and shared packages in one place, which pays off in collaboration, code reuse, and maintenance. Turborepo is what keeps that structure fast as it scales — through intelligent caching, dependency-aware task execution, and parallel builds.



Together, they give you a solid foundation for modern JavaScript and TypeScript projects, whether you're building a SaaS platform, an e-commerce app, or an internal enterprise tool.



If you're just getting started, don't reach for a monorepo on day one. Start small, experiment with a shared package or two, and introduce Turborepo once your codebase actually needs it. You'll understand the trade-offs a lot better than if you set it all up upfront.



Thanks for reading! If you found this useful, I'd love to hear how your team structures its projects — drop a comment below.

Information ergänzen Fachhinweis, Update, Korrektur oder Quelle zur Meldung beitragen
Gäste-Hinweise werden kurz redaktionell geprüft und danach hier angezeigt.

Community-Hinweise zur Meldung

0 freigegeben
Social ReaktionenReagiere als Erste:r — dein Feedback zählt!
Informations-Bewertung:

💬 Community-Diskussion & Kommentare

🌐 Zum Hauptchat

Starte die Diskussion im Social-Chat Broadcast Stream oder reiche oben über „Information ergänzen“ einen Fachbeitrag ein.

Community Rating & Social Proof
⭐ Leser-Wertung
–
Ø / 5.0
Noch keine Leser-Bewertungen
War dieser Artikel hilfreich?
0
Jetzt Bewertung abgeben
Detail-Bewertung (optional)
Inhalt & Qualität
Quelle & Glaubwürdigkeit
Aktualität
Security Briefing Kostenlos · 1-Klick-Abmeldung

Intelligence Digest — kostenlos

Täglich die wichtigsten Security-News · jederzeit abbestellbar

Verwandte Story-Cluster & Quellen (Vektor-KI)

2 Cluster
2 Quellen
OpenAI counter-sues Apple over trade secret theft
AppleInsider News vor 2 Std.
1 weitere Quelle
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten How Turborepo Makes Large JavaScript Projects Fast

Thematisch verwandte Begriffe: Turborepo, Makes, Large, JavaScript · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

💬 Kommentare werden geladen…
Zum Aktualisieren ziehen
Widgets & Themen
Widgets werden geladen…
Nächster Beitrag