Skip to content

Commit df3ad54

Browse files
feat: migrate toolchain, add AspireC4 project, theme improvements (#56)
- Replace Bun with npm throughout (package.json, workflows, instructions) - Replace husky/hereby with just + lefthook for git hooks and task running - Update all GitHub Actions to latest major versions (checkout v6, setup-node v6, etc.) - Fix deprecated z import: use astro/zod instead of astro:content - Add emoji support to links schema (XOR with image via Zod refine) - Add markdown linting with markdownlint-cli2 and lefthook integration - Rebuild site styles: complete dark/light/system theme, mobile-first, accessible - Add sidebar with ToC and project list on project detail pages - Limit MainBanner and hero heights on wide screens - Add AspireC4 project content entry with hasContent + remote README stacking - Add GitHub README badge to RemoteReadme component - Fix likec4-wordmark.svg theme responsiveness via colorScheme property - Lock Vite to <8 as per deprecation warning - Fix 'Say Hello' contact dialog with captcha support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1440b2a commit df3ad54

54 files changed

Lines changed: 15023 additions & 2752 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/copilot-instructions.md

Lines changed: 156 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,26 +11,168 @@ This is an Astro-based static site generator project using TypeScript, Preact, a
1111
- **Astro**: Static site generator with component-based architecture
1212
- **TypeScript**: Strict mode enabled, prefer explicit typing
1313
- **Preact**: Use functional components with hooks for client-side interactivity
14-
- **Bun**: Runtime and package manager, ES modules preferred
15-
- **Package Manager**: Use Bun (bun.lockb present)
14+
- **npm**: Package manager (use `npm` for all installs and scripts)
1615

17-
## Critical Bun & Astro Rules
16+
## Critical npm & Astro Rules
1817

19-
### Bun Commands Only
18+
### npm Commands Only
2019

21-
- Use Bun exclusively: `bun run`, `bun test`, `bun install`, `bun add`, `bun remove`
22-
- Never use `node`, `npm`, `yarn`, `pnpm` commands
23-
- Use `bun --filter` for workspace operations: `bun --filter="./src/packages/*" run build`
24-
- Leverage Bun's built-in test runner (no Jest, Vitest, or other test frameworks)
25-
- Use Bun's native TypeScript support (no ts-node or similar)
20+
- Use npm exclusively: `npm run`, `npm test`, `npm install`, `npm uninstall`
21+
- Never use `bun`, `yarn`, or `pnpm` commands
22+
- Use `npm install` for dependencies, `npm install --save-dev` for dev dependencies
23+
- Use `npx` to run one-off executables (e.g. `npx astro check`)
2624

2725
### Common Astro Commands
2826

29-
- **Development**: `bun dev` or `bun start` - Start Astro dev server
30-
- **Build**: `bun build` - Build static site for production
31-
- **Preview**: `bun preview` - Preview production build locally
32-
- **Type Check**: `bun astro check` - Run Astro's built-in type checker
33-
- **Generate Types**: `bun astro sync` - Generate TypeScript definitions
27+
- **Development**: `npm run dev` — Start Astro dev server
28+
- **Build**: `npm run build` — Build static site for production
29+
- **Preview**: `npm run preview` — Preview production build locally
30+
- **Type Check**: `npm run check` — Run Astro's built-in type checker
31+
- **Generate Types**: `npx astro sync` — Generate TypeScript definitions
32+
33+
### Build & Development Tools
34+
35+
- **Astro**: Static site generator with component islands architecture
36+
- **Vite**: Underlying build tool (managed by Astro)
37+
- **ESLint**: Code linting with strict rules
38+
- **Prettier**: Code formatting (check .prettierrc for config)
39+
- **TypeScript**: Strict configuration in tsconfig.json
40+
41+
### Testing
42+
43+
- Follow existing test patterns if tests are present
44+
- Prefer unit tests for utilities, integration tests for components
45+
46+
## Code Style & Standards
47+
48+
### TypeScript Guidelines
49+
50+
- Use strict mode settings from tsconfig.json
51+
- Prefer explicit return types for functions
52+
- Use proper type annotations, avoid `any`
53+
- Leverage union types and type guards
54+
- Use interfaces for object shapes, types for unions/primitives
55+
56+
### Preact Guidelines
57+
58+
- Use functional components with hooks
59+
- Prefer arrow functions for components
60+
- Use proper TypeScript typing for props and state
61+
- Follow React best practices for performance (useMemo, useCallback when needed)
62+
- Use proper dependency arrays in useEffect
63+
64+
### File Organization
65+
66+
- **Astro Pages**: `/src/pages/` - File-based routing, supports .astro, .md, .mdx, .html files
67+
- **Astro Components**: `/src/components/` - Reusable .astro components
68+
- **Astro Layouts**: `/src/layouts/` - Page layout components
69+
- **Client Components**: `/src/components/` - Preact components for client-side interactivity
70+
- **Assets**: `/src/assets/` - Images, fonts, and other static assets
71+
- **Styles**: `/src/styles/` - CSS, SCSS, or style files
72+
- **Utilities**: `/src/lib/` or `/src/utils/` - Shared TypeScript utilities
73+
- **Content**: `/src/content/` - Markdown content with collections (if using content collections)
74+
- **Public**: `/public/` - Static assets served directly
75+
- Follow the existing directory structure
76+
- Group related files together
77+
- Use index files for clean imports
78+
- Prefer named exports over default exports for utilities
79+
80+
## Astro-Specific Guidelines
81+
82+
### Component Types
83+
84+
- **Astro Components (.astro)**: For static content, server-side rendering, and layouts
85+
- **Client Components (Preact)**: Use `client:*` directives for interactivity
86+
- **Hybrid Components**: Astro components that import and use client components
87+
88+
### Client Directives
89+
90+
- `client:load` - Hydrate immediately on page load
91+
- `client:idle` - Hydrate when main thread is idle
92+
- `client:visible` - Hydrate when component enters viewport
93+
- `client:media` - Hydrate when media query matches
94+
- `client:only` - Skip server rendering, only run on client
95+
96+
### Content Collections (if used)
97+
98+
- Define schemas in `src/content/config.ts`
99+
- Use `getCollection()` and `getEntry()` for content queries
100+
- Leverage TypeScript types generated from schemas
101+
102+
### Code Quality
103+
104+
- Follow ESLint rules strictly
105+
- Use Prettier for consistent formatting
106+
- Write self-documenting code with clear variable names
107+
- Add JSDoc comments for complex functions
108+
- Prefer composition over inheritance
109+
110+
## Development Workflow
111+
112+
### Dependencies
113+
114+
- Check package.json for existing dependencies before adding new ones
115+
- Use exact versions for critical dependencies
116+
- Keep dependencies up to date but test thoroughly
117+
118+
### Environment
119+
120+
- Use environment variables for configuration
121+
- Follow existing patterns for env variable usage
122+
- Keep sensitive data out of the codebase
123+
124+
### Git & Commits
125+
126+
- Write clear, descriptive commit messages
127+
- Follow conventional commit format if established
128+
- Keep commits focused and atomic
129+
130+
## Specific Preferences
131+
132+
### Import/Export Style
133+
134+
- Use ES6 import/export syntax
135+
- Organize imports: external libraries first, then internal modules
136+
- Use absolute imports if configured in tsconfig paths
137+
138+
### Error Handling
139+
140+
- Use proper error boundaries in React
141+
- Implement comprehensive error handling in async operations
142+
- Prefer specific error types over generic Error
143+
144+
### Performance Considerations
145+
146+
- Consider bundle size when adding dependencies
147+
- Use code splitting for large components/features
148+
- Optimize re-renders with proper memoization
149+
150+
### Accessibility
151+
152+
- Follow WCAG guidelines
153+
- Use semantic HTML elements
154+
- Include proper ARIA attributes when needed
155+
- Ensure keyboard navigation works
156+
157+
## Files to Reference
158+
159+
- `tsconfig.json` - TypeScript configuration
160+
- `astro.config.mjs` - Astro configuration and integrations
161+
- `package.json` - Dependencies and scripts
162+
- `.eslintrc.*` - Linting rules
163+
- `.prettierrc` - Formatting rules
164+
165+
## Common Patterns
166+
167+
When suggesting code changes:
168+
169+
1. Check existing patterns in the codebase first
170+
2. Maintain consistency with current architecture
171+
3. Consider the impact on bundle size and performance
172+
4. Ensure type safety throughout
173+
5. Follow the established error handling patterns
174+
6. Maintain the current level of code documentation
175+
34176

35177
### Build & Development Tools
36178

.github/workflows/deploy.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,30 @@ jobs:
1919
runs-on: ubuntu-latest
2020
steps:
2121
- name: Checkout your repository using git
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v6
2323

24-
- name: Setup Bun
25-
uses: oven-sh/setup-bun@v2
24+
- name: Setup Node.js
25+
uses: actions/setup-node@v6
2626
with:
27-
bun-version: latest
27+
node-version: 'lts/*'
28+
cache: 'npm'
29+
cache-dependency-path: |
30+
package-lock.json
31+
src/package-lock.json
2832
2933
- name: Set Secure Configuration
3034
run: |
3135
echo "PUBLIC_APPINSIGHTS_CONNECTION_STRING=${{ secrets.PUBLIC_APPINSIGHTS_CONNECTION_STRING }}" >> ./src/.env
3236
echo "PUBLIC_CF_TURNSTILE_SITEKEY=${{ secrets.PUBLIC_CF_TURNSTILE_SITEKEY }}" >> ./src/.env
3337
34-
- name: Install dependencies
35-
run: bun install
38+
- name: Install root dependencies
39+
run: npm install
3640

3741
- name: Install, build, and upload your site output
38-
uses: withastro/action@v4
42+
uses: withastro/action@v6
3943
with:
4044
path: ./src/
41-
package-manager: bun@latest
45+
package-manager: npm
4246

4347
deploy:
4448
needs: build
@@ -49,4 +53,4 @@ jobs:
4953
steps:
5054
- name: Deploy to GitHub Pages
5155
id: deployment
52-
uses: actions/deploy-pages@v4
56+
uses: actions/deploy-pages@v5

.github/workflows/pull-request.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,19 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Checkout code
14-
uses: actions/checkout@v3
14+
uses: actions/checkout@v6
1515

16-
- name: Setup Bun
17-
uses: oven-sh/setup-bun@v2
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v6
18+
with:
19+
node-version: 'lts/*'
20+
cache: 'npm'
21+
cache-dependency-path: src/package-lock.json
1822

1923
- name: Install dependencies
2024
working-directory: ./src
21-
run: bun install
25+
run: npm install
2226

2327
- name: Run astro check
2428
working-directory: ./src
25-
run: bun check
29+
run: npm run check

.husky/commit-msg

Lines changed: 0 additions & 1 deletion
This file was deleted.

.markdownlint-cli2.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# markdownlint-cli2 configuration
2+
# Rules are in src/.markdownlint.json (picked up automatically by traversal)
3+
ignores:
4+
- "**/node_modules/**"
5+
- "**/dist/**"
6+
- "**/.astro/**"

Herebyfile.mts

Lines changed: 0 additions & 46 deletions
This file was deleted.

Justfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Show available tasks
2+
default:
3+
@just --list
4+
5+
# Run the Astro dev server
6+
run:
7+
cd src && npm run dev
8+
9+
# Type-check the Astro project
10+
check:
11+
cd src && npm run check
12+
13+
# Install dependencies for all packages
14+
install-deps:
15+
npm install
16+
cd src && npm install
17+
18+
# Update all dependencies
19+
update-deps:
20+
cd src && npx @astrojs/upgrade
21+
npm update
22+
cd src && npm update
23+
24+
# Lint markdown files
25+
lint-md:
26+
npx --no-install markdownlint-cli2 "src/**/*.md"
27+
28+
# Auto-fix markdown lint issues where possible
29+
lint-md-fix:
30+
npx --no-install markdownlint-cli2 --fix "src/**/*.md"
31+
32+
# Release a new version
33+
release:
34+
npm run release

0 commit comments

Comments
 (0)