Skip to content

Angular 01: project structure - #32

Merged
gpbsumido merged 7 commits into
developfrom
ps/ng-01-structure
Nov 21, 2026
Merged

gpbsumido merged 7 commits into
developfrom
ps/ng-01-structure

Conversation

@gpbsumido

@gpbsumido gpbsumido commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner

First lesson in my Angular guide: thirteen stacked PRs, one topic each. Each one adds a lesson page that lives inside the site and makes a real change to the app the lesson can point at. Together they turn Thoughts into an interactive reader.

What shipped

Interactive lessons in Thoughts. A thought can now carry a lazily loaded lesson page under its prose.

  • thoughts-content/lessons/lessons.ts maps slugs to loaders.
  • thought-detail.ts loads the page through resource(), so SSR waits for it.
  • A small CodeBlock component renders the samples as data, so {{ }} and @if inside a sample never get compiled.

Lesson 01: project structure (/thoughts/angular-01-project-structure)

  • Covers the material at three levels (simple, intermediate, expert), then pitfalls and interview Q&A.
  • Includes a live "may this file import that one?" checker built on the same rules the architecture spec enforces.

Architecture fitness spec. src/app/architecture.spec.ts fails if anything outside apps/ statically imports from apps/, or if an @NgModule appears. Lazy import() is allowed, since that is the code-splitting seam.

Settings state moved to shared/settings/. The spec's first run found app.ts, dock/dock.ts and menu-bar/menu-bar.ts importing SettingsService/AppearanceService from the apps/settings/ feature. The services moved; the System Preferences screen stayed in the feature folder.

Annotations. main.ts, app.config.ts and app.config.server.ts carry [ng-01] comments. grep -rn "ng-01" src finds every example.

Version and changelog. 1.4.0, with a matching changelog entry.

Commits

  1. Add a failing architecture spec for shell-to-feature imports
  2. Move app-wide settings state from apps/ into shared/
  3. Annotate the bootstrap files for the structure lesson
  4. Add failing specs for an interactive lesson page in Thoughts
  5. Write lesson 01 with a live import checker
  6. Load a thought's interactive lesson page lazily under its prose
  7. Bump to 1.4.0 with the lesson 01 changelog entry

Verification

  • npm run lint, tsc --noEmit for app and spec configs, and ng test: 42 files, 315 tests, all exit 0.
  • Production build: the prerendered browser/thoughts/angular-01-project-structure/index.html contains the whole lesson, demo and interview section included.
  • Bundle sizes: lesson 01 is a 13 kB lazy chunk. The initial bundle is 372.98 kB against the 400 kB budget.

TO-DOs for this PR

  • Before/after screenshots (thoughts list plus the new lesson page, light and dark). Chromium couldn't launch in the environment I built this in, so they still need capturing from a normal shell before merging.

@gpbsumido
gpbsumido marked this pull request as ready for review November 21, 2026 14:43
@gpbsumido
gpbsumido added this pull request to stack #46 November 21, 2026 17:00
@gpbsumido
gpbsumido merged commit 530c68f into develop Nov 21, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant