惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

有赞技术团队
有赞技术团队
B
Blog
IT之家
IT之家
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
量子位
博客园 - 叶小钗
T
Tailwind CSS Blog
小众软件
小众软件
WordPress大学
WordPress大学
酷 壳 – CoolShell
酷 壳 – CoolShell
博客园 - Franky
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Blog — PlanetScale
Blog — PlanetScale
V
V2EX
博客园_首页
I
InfoQ
B
Blog RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog

Nx Blog

Sharing Tailwind CSS Styles Across Apps in a Monorepo | Nx Blog How SiriusXM Stays Competitive by Iterating and Getting to Market Fast | Nx Blog Agentic Experience Is the New Developer Experience | Nx Blog Nx Joins the Linux Foundation and the Agentic AI Foundation | Nx Blog A Monorepo Is NOT a Monolith | Nx Blog Why we deleted (most of) our MCP tools | Nx Blog Teach Your AI Agent How to Work in a Monorepo | Nx Blog How Broadcom stays efficient and nimble with monorepos | Nx Blog Why Monorepos are King in the Age of AI | Nx Blog Nx 2026 Roadmap: Expanding Agent Autonomy, Improving Performance, Better Polyglot and More | Nx Blog End to End Autonomous AI Agent Workflows with Nx | Nx Blog Autonomous Agents at Scale | Nx Blog Scaling 700+ Projects: How Nx Became a 'No-Brainer' for Caseware | Nx Blog Configure Tailwind v4 with Angular in an Nx Monorepo | Nx Blog The Missing Multiplier for AI Agent Productivity | Nx Blog A Year of Nx Webinars | Nx Blog Wrapping Up 2025 | Nx Blog Nx 22.3 Release: Angular 21 Support, tsgo Compiler, and Prettier v3 | Nx Blog Nx Cloud Release: Agent Resource Usage | Nx Blog Nx Platform Outperforms DIY Cache by 5x | Nx Blog An Nx Carol: Past, Present, and Future of Your Monorepo | Nx Blog Nx 22.1 Release: Terminal UI on Windows, Storybook 10, Vitest 4, and more! | Nx Blog The Compounding Effect: How Nx Features Multiply Performance Gains | Nx Blog 10 Monorepo Myths Debunked: Separating Fact from Fiction | Nx Blog Nx Cloud Release: Enterprise Task Analytics | Nx Blog Watch and Rebuild Storybook Dependencies with Nx | Nx Blog Book - React for Enterprise: Timeless Architecture for Enterprise Apps | Nx Blog Beyond Remote Cache: Unlock 70% More CI Performance | Nx Blog Nx 22 Release: Expanding the build platform | Nx Blog What's the Point of Generating All This Code If You Can't Merge It? | Nx Blog
Advent of Code Gets The Crystal Treatment! | Nx Blog
Zack DeRose · 2024-12-01 · via Nx Blog

Talking with developers, we've found that one of the main reasons folks like using Nx is: Nx allows their team to focus on shipping a great product, while Nx handles all the rest:

  • setting up tools for testing, linting, and etc.
  • dynamic CI/CD pipelines with Nx Cloud
  • a code generation framework to manage expanding their projects

For the past couple years, we've been releasing an Advent of Code Starter Repo with this in mind!

If you're not familiar, Advent of Code is a special event that runs every December that works like a Advent Calendar of programming problems. Every day at midnight, we all get access to 2 new puzzles that will award us a gold star if you can complete it successfully.

Specifically, our goal is to give developers an easy to use starting point that allows them to focus on solving the puzzles, and handing the rest over to Nx instead of wrestling with setting up tools, file i/o, and the like.

This year, we were able to further reduce the nx-specific config needed, using the new Nx Project Crystal enhancements that landed earlier this year!

Packages Landed!

We're excited to announce version 2.0.0 of the create-ts-aoc-starter and ts-aoc-starter packages are released, just in time for Advent of Code 2024!

create-ts-aoc-starter

This is the code generation command to setup your Advent of Code workspace! Simply run the command:

> npx create-ts-aoc-starter@latest

And we'll spin up your workspace for you, all tools configured and ready to go!

ts-aoc-starter

This is the Nx Plugin we're shipping this year that comes pre-installed whenever you run the create-ts-aoc-starter command. By installing this package, and adding the dynamic-tasks to your plugins array of your nx.json file, Nx can setup all the commands we'll need for Advent of Code this year, with no manual setup or config required!

How It Works

After generating your workspace, you'll find a directory for each of the 25 days of the game, and inside each directory, you'll find the following files:

  • a.data.sample.txt
  • a.data.txt
  • a.ts
  • b.data.sample.txt
  • b.data.txt
  • b.ts

Provide your solution to the first part of the day in the a.ts, and you can copy and paste your code into a.data.txt.

For most days, the puzzle also comes with a sample set of data to demonstrate what the correct answer would be. On these days, you can enter that data into the a.data.sample.txt file provided!

To run your solution against the sample data for day 1 then, run one of the commands:

> nx day-1-a-sample
> nx day-1-sample
> nx 1-a-sample
> nx 1-sample

And to run against the actual data, you can run one of the following:

> nx day-1-a
> nx day-1
> nx 1-a
> nx 1

Sometimes the second part of the problem simply builds on top of the first. On those days, you can just continue to code in the a.ts file, but a b.ts and data.txt files are also provided if you want to start over. To run these, use the commands:

> nx day-1-b
> nx 1-b
> nx day-1-b-sample
> nx 1-b-sample

New Feature for 2.0.0: File Watching!

We've also added file watching (using nx watch behind the scenes!)

Simply add watch- to the start of any of the commands and aliases listed above to start any of them in watch mode, so they automatically re-run as soon as any changes to the file system are detected! Example:

New Feature for 2.0.0: Additional Data Sets!

This year, we're also including the ability to drop in additional data sets. This can be particularly helpful in later days (as the problems get harder) and you want to test your solution on a data set that isn't the specific sample or the actual dataset provided. For this, simply create a data.txt file matching the naming pattern.

For example, if I wanted to create a data set called foo, I'd create in the filesystem a file called a.data.foo.txt. Then to run against this data set, run one of the commands:

> nx day-1-a-foo
> nx day-1-foo
> nx 1-a-foo
> nx 1-foo
> nx watch-day-1-a-foo
> nx watch-day-1-foo
> nx watch-1-a-foo
> nx watch-1-foo

Learn more