Repo of the Day
isaacplmann/epic-stack-with-nx
Published: Jan 28, 2025
Open repository ↗This repository shows one way to set up Nx in an Epic Stack app.
Summary
This repository is a reference setup that adds Nx to an Epic Stack application, a Remix-based web stack from Epic Web. It demonstrates two Nx features in particular, explicit task pipelines and task result caching, applied to an existing Epic Stack project.
What it is useful for
Epic Stack ships with run-s and run-p scripts in package.json that chain tasks like build:icons and build:remix. The README calls out a concrete failure mode: if you reorder the lines in the build script, the build breaks, and running npm run build:remix on its own skips the prerequisite build:icons step. Nx replaces that fragility with explicit per-task dependencies, so the developer running a task no longer has to remember what must run first.
Caching is the other main benefit. The README reports that an uncached build takes about 10 seconds and validate about 27 seconds, while both drop to roughly 0.5 seconds when Nx reuses cached results because the inputs have not changed. The repo is therefore most useful for engineers who want faster local feedback loops and CI runs on Epic Stack codebases, and as a starting point if they later want to split the app into multiple apps or libraries.
How engineers can use it
The README documents a one-command setup: run npx nx@latest init inside an existing repository, following Nx's "Adding Nx to a Monorepo" guide. After running it, this repo makes a handful of specific changes worth copying: add .nx to .gitignore so the cache stays out of Git, create a blank nx.json for future config, add nx as a devDependency, and prefix selected package scripts with nx exec -- so both npm run build:icons and nx build:icons benefit from the cache. The task pipeline (dependsOn) and cache inputs/outputs are configured under the nx property in nx.json.
The README also flags a current limitation: every task uses the default inputs value, the entire repository, so cache hits are coarser than they could be. The suggested next step is reading Nx's "Configure Inputs for Task Caching" guide to scope inputs per task. For teams that outgrow a single app, the README lists expansion commands such as nx add @nx/remix, nx generate app second-app --directory=second-app, nx add @nx/react, and nx generate library ui-components --directory=ui-components to scaffold additional apps and shared libraries.
The exact diff applied to the starter is in the commit referenced in the README, which is the quickest way to see every line of the setup. The repository is published under the MIT license.