pickstack

Angular + Turborepo

Monorepo: the app in apps/web, tasks cached by turbo. This page shows exactly what pickstack adds to a Angular project for Turborepo: the packages, the new files and the changes to existing ones. Every combination is installed, built, linted and tested in CI.

$ npm create pickstack@latest my-app -- --framework angular --modules turborepo --yes
Customize in the configurator

Packages it adds

PackageVersionType
turbo^2.11.13dev

New files

apps/web/.gitignore
node_modules
dist
.angular
.env
.env.local
.DS_Store
apps/web/angular.json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "cli": {
    "packageManager": "npm",
    "analytics": false
  },
  "newProjectRoot": "projects",
  "projects": {
    "my-app": {
      "projectType": "application",
      "schematics": {},
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular/build:application",
          "options": {
            "browser": "src/main.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              {
                "glob": "**/*",
                "input": "public"
              }
            ],
            "styles": ["src/styles.css"]
          },
          "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "500kB",
                  "maximumError": "1MB"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "4kB",
                  "maximumError": "8kB"
                }
              ],
              "outputHashing": "all"
            },
            "development": {
              "optimization": false,
              "extractLicenses": false,
              "sourceMap": true
            }
          },
          "defaultConfiguration": "production"
        },
        "serve": {
          "builder": "@angular/build:dev-server",
          "configurations": {
            "production": {
              "buildTarget": "my-app:build:production"
            },
            "development": {
              "buildTarget": "my-app:build:development"
            }
          },
          "defaultConfiguration": "development"
        }
      }
    }
  }
}
apps/web/package.json
{
  "name": "web",
  "private": true,
  "version": "0.1.0",
  "type": "module",
  "scripts": {
    "ng": "ng",
    "dev": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "typecheck": "ngc -p tsconfig.app.json --noEmit"
  },
  "dependencies": {
    "@angular/common": "^22.3.0",
    "@angular/compiler": "^22.3.0",
    "@angular/core": "^22.3.0",
    "@angular/forms": "^22.3.0",
    "@angular/platform-browser": "^22.3.0",
    "@angular/router": "^22.3.0",
    "rxjs": "~7.8.2",
    "tslib": "^2.9.1"
  },
  "devDependencies": {
    "@angular/build": "^22.3.0",
    "@angular/cli": "^22.3.0",
    "@angular/compiler-cli": "^22.3.0",
    "typescript": "~6.0.3"
  }
}
apps/web/public/robots.txt
User-agent: *
Disallow:
apps/web/src/app/app.config.ts
import {
  type ApplicationConfig,
  provideBrowserGlobalErrorListeners,
} from "@angular/core";
import { provideRouter } from "@angular/router";
import { routes } from "./app.routes";

export const appConfig: ApplicationConfig = {
  providers: [provideBrowserGlobalErrorListeners(), provideRouter(routes)],
};
apps/web/src/app/app.html
<main class="app">
  <nav class="nav">
    <a class="link" routerLink="/">Home</a>
    <a class="link" routerLink="/about">About</a>
  </nav>
  <router-outlet />
</main>
apps/web/src/app/app.routes.ts
import type { Routes } from "@angular/router";
import { Home } from "./pages/home/home";

export const routes: Routes = [
  { path: "", component: Home },
  {
    path: "about",
    loadComponent: () => import("./pages/about/about").then((m) => m.About),
  },
];
apps/web/src/app/app.ts
import { Component } from "@angular/core";
import { RouterLink, RouterOutlet } from "@angular/router";

@Component({
  selector: "app-root",
  imports: [RouterLink, RouterOutlet],
  templateUrl: "./app.html",
})
export class App {}
apps/web/src/app/components/counter/counter.html
<div class="card">
  <p class="count">{{ count() }}</p>
  <div class="row">
    <button type="button" class="btn" (click)="decrement()">-1</button>
    <button type="button" class="btn" (click)="increment()">+1</button>
  </div>
</div>
apps/web/src/app/components/counter/counter.ts
import { Component, signal } from "@angular/core";

@Component({
  selector: "app-counter",
  templateUrl: "./counter.html",
})
export class Counter {
  protected readonly count = signal(0);

  protected increment(): void {
    this.count.update((value) => value + 1);
  }

  protected decrement(): void {
    this.count.update((value) => value - 1);
  }
}
apps/web/src/app/pages/about/about.html
<section class="page">
  <h1 class="title">About</h1>
  <p class="text">Built with Angular 22, TypeScript, Turborepo.</p>
</section>
apps/web/src/app/pages/about/about.ts
import { Component } from "@angular/core";

@Component({
  selector: "app-about",
  templateUrl: "./about.html",
})
export class About {}
apps/web/src/app/pages/home/home.html
<section class="page">
  <h1 class="title">my-app</h1>
  <app-counter />
</section>
apps/web/src/app/pages/home/home.ts
import { Component } from "@angular/core";
import { Counter } from "../../components/counter/counter";

@Component({
  selector: "app-home",
  imports: [Counter],
  templateUrl: "./home.html",
})
export class Home {}
apps/web/src/index.html
<!doctype html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <title>my-app</title>
    <base href="/" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
  </head>
  <body>
    <app-root></app-root>
  </body>
</html>
apps/web/src/main.ts
import { bootstrapApplication } from "@angular/platform-browser";
import { App } from "./app/app";
import { appConfig } from "./app/app.config";

bootstrapApplication(App, appConfig).catch((err) => console.error(err));
apps/web/src/styles.css
:root {
  font-family: system-ui, sans-serif;
  color: #0f172a;
  background: #f8fafc;
}

body {
  margin: 0;
}

.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem;
  box-sizing: border-box;
}

.title {
  font-size: 1.875rem;
  margin: 0;
}

.nav {
  display: flex;
  gap: 1rem;
}

.link {
  color: #475569;
  text-decoration: none;
  font-weight: 500;
}

.link:hover {
  color: #0f172a;
}

.page {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
}

.text {
  max-width: 28rem;
  text-align: center;
  color: #475569;
}

.card {
  background: #fff;
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
  text-align: center;
}

.count {
  font-size: 3rem;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.row {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.btn {
  background: #0f172a;
  color: #fff;
  border: 0;
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font: inherit;
  cursor: pointer;
}

.btn:hover {
  background: #334155;
}
apps/web/tsconfig.app.json
{
  "extends": "./tsconfig.json",
  "compilerOptions": {
    "types": []
  },
  "include": ["src/**/*.ts"],
  "exclude": ["src/**/*.spec.ts"]
}
apps/web/tsconfig.json
{
  "compileOnSave": false,
  "compilerOptions": {
    "strict": true,
    "noImplicitOverride": true,
    "noPropertyAccessFromIndexSignature": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "skipLibCheck": true,
    "isolatedModules": true,
    "experimentalDecorators": true,
    "importHelpers": true,
    "target": "ES2022",
    "module": "preserve"
  },
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true
  },
  "files": [],
  "references": [
    {
      "path": "./tsconfig.app.json"
    }
  ]
}
turbo.json
{
  "$schema": "https://turborepo.dev/schema.json",
  "ui": "tui",
  "tasks": {
    "build": {
      "dependsOn": ["^build"],
      "inputs": ["$TURBO_DEFAULT$", ".env*"],
      "outputs": ["dist/**"]
    },
    "dev": {
      "cache": false,
      "persistent": true
    },
    "typecheck": {
      "dependsOn": ["^typecheck"]
    }
  }
}

Changes to existing files

.gitignore (changed)
 node_modules+.turbo−dist−.angular .env .env.local .DS_Store⋯ 1 unchanged lines

Project files

Related templates