Skip to content

Commit 566f798

Browse files
Alexandre NédélecCopilot
andcommitted
refactor: remove Playwright screenshots, improve runner compatibility
- Remove Step 6 (dev server + screenshots) - too complex for GH Actions sandbox - Add fallback for missing template-sync-state.json (use initial baseline SHA) - Add better-sqlite3 rebuild instructions for --ignore-scripts fallback - Recompile lock.yml without screenshot artifact upload step Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ac210cb commit 566f798

3 files changed

Lines changed: 122 additions & 88 deletions

File tree

.github/copilot-instructions.md

Lines changed: 97 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,102 @@
11
# GitHub Copilot Instructions
22

3+
## Project Overview
4+
5+
This is **TechWatching.dev**, Alexandre Nédélec's personal blog at https://techwatching.dev. It is a statically generated site built with:
6+
7+
- **Nuxt 4** — Vue.js meta-framework (compatibility date `2024-07-11`)
8+
- **Nuxt UI v3** (`@nuxt/ui`) — UI component library based on TailwindCSS v4
9+
- **Nuxt Content v3** (`@nuxt/content`) — Markdown/YAML content management with SQLite
10+
- **TailwindCSS v4** — Utility-first CSS
11+
- **@nuxtjs/seo** — SEO, OG images, schema.org, sitemap
12+
- **TypeScript** — strict typing throughout
13+
14+
## Development Environment
15+
16+
### Package Manager
17+
18+
This project uses **pnpm** (version specified in `package.json``"packageManager": "pnpm@10.29.2"`). Always use `pnpm` — never `npm` or `yarn`.
19+
20+
The `.npmrc` sets `shamefully-hoist=true`.
21+
22+
### Bootstrap
23+
24+
```bash
25+
pnpm install # install all dependencies
26+
```
27+
28+
### Common Commands
29+
30+
| Command | Description |
31+
|---------|-------------|
32+
| `pnpm dev` | Start dev server at http://localhost:3000 |
33+
| `pnpm build` | Build for production (SSR) |
34+
| `pnpm generate` | Generate static site (prerendered) |
35+
| `pnpm preview` | Preview production build |
36+
| `pnpm lint` | Run ESLint |
37+
| `pnpm lint:fix` | Run ESLint with auto-fix |
38+
| `pnpm typecheck` | Run TypeScript type checking via `nuxt typecheck` |
39+
40+
### CI Validation
41+
42+
The CI workflow (`.github/workflows/ci.yml`) runs on every push:
43+
44+
1. `pnpm install` — install dependencies
45+
2. `pnpm run lint`**must pass with zero errors**
46+
3. `pnpm run typecheck`**must pass with zero errors**
47+
48+
Always run both `pnpm lint` and `pnpm typecheck` before committing. Fix all lint and type errors before marking work as done.
49+
50+
## Project Layout
51+
52+
```
53+
techwatching.dev/
54+
├── .github/
55+
│ ├── copilot-instructions.md # this file — repository-wide Copilot instructions
56+
│ ├── git-commit-instructions.md # Conventional Commits format guide
57+
│ ├── instructions/ # path-specific instructions (.instructions.md)
58+
│ │ ├── content.instructions.md # applyTo: content/**/*.{md,yml}
59+
│ │ └── nuxt.instructions.md # applyTo: **/*.vue
60+
│ ├── prompts/ # reusable prompt templates
61+
│ │ └── new-article.prompt.md
62+
│ ├── agents/ # Copilot agent definitions
63+
│ │ └── nuxt.agent.md
64+
│ └── workflows/
65+
│ └── ci.yml # lint + typecheck on every push
66+
├── app/ # Nuxt app source (Nuxt 4 layout)
67+
│ ├── app.vue # root Vue component
68+
│ ├── app.config.ts # Nuxt UI theme config (colors, components)
69+
│ ├── components/ # shared Vue components (AppHeader, GiscusComments, etc.)
70+
│ ├── pages/ # file-based routes (index.vue, blog/[slug].vue, etc.)
71+
│ ├── layouts/ # Nuxt layouts (default.vue)
72+
│ ├── assets/css/main.css # global TailwindCSS entry point
73+
│ ├── plugins/ # Nuxt plugins (posthog.client.ts)
74+
│ ├── types/ # shared TypeScript types
75+
│ └── utils/ # utility functions
76+
├── content/ # @nuxt/content source files
77+
│ ├── 0.index.yml # home page structured data
78+
│ ├── 1.posts/ # blog posts — {number}.{slug}.md
79+
│ ├── 2.speaking.yml # speaking events array
80+
│ └── 3.goodies/ # goodies/tools — {slug}.md
81+
├── server/
82+
│ ├── api/ # JSON API endpoints (*.<method>.ts)
83+
│ └── routes/ # custom routes (RSS/Atom: *.rss, *.atom)
84+
├── public/ # static assets served as-is
85+
├── content.config.ts # @nuxt/content collection schemas (zod)
86+
├── nuxt.config.ts # Nuxt configuration
87+
├── eslint.config.mjs # ESLint flat config
88+
├── tsconfig.json # TypeScript config
89+
├── pnpm-workspace.yaml # pnpm workspace
90+
└── .npmrc # pnpm config
91+
```
92+
93+
### Key architecture notes
94+
95+
- **Static generation**: all routes prerendered via `routeRules: { '/**': { prerender: true } }` and Nitro crawl
96+
- **Content collections**: defined in `content.config.ts` using `defineCollection` + zod schemas; collection names are `index`, `posts`, `speaking`, `goodies`, `goodiesPage`, `content`
97+
- **Server handlers**: must import from `@nuxt/content/server` and pass `event` as first arg: `queryCollection(event, 'posts')`
98+
- **Commit messages**: follow Conventional Commits (see `.github/git-commit-instructions.md`)
99+
3100
## MCP Tool Usage
4101

5102
When answering questions about this project, use the appropriate MCP (Model Context Protocol) tools:
@@ -45,16 +142,6 @@ Activate additional tool groups as needed:
45142
- How do I deploy to Netlify/Vercel?
46143
- How do I create API routes in Nuxt?
47144

48-
## Project Context
49-
50-
This is a personal blog built with:
51-
- **Nuxt 4** - Vue.js meta-framework
52-
- **Nuxt UI v3** - UI component library
53-
- **Nuxt Content v3** - Markdown/content management
54-
- **TailwindCSS v4** - Styling
55-
56-
Content is stored in the `content/` directory with blog posts in `content/1.posts/`.
57-
58145
## Nuxt UI v3 Styling Guidelines
59146

60147
When customizing Nuxt UI v3 components:

.github/workflows/template-sync.lock.yml

Lines changed: 11 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.github/workflows/template-sync.md

Lines changed: 14 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,11 @@ were added. Your job is to apply useful upstream improvements without breaking a
2929

3030
## Step 1: Check for new template changes
3131

32-
Read the file `.github/template-sync-state.json`. It contains `lastSyncedCommit` — the last
33-
template commit SHA that was already processed.
32+
Read the file `.github/template-sync-state.json` from the repository. It contains
33+
`lastSyncedCommit` — the last template commit SHA that was already processed.
34+
35+
**Important**: If the file does not exist, use the initial baseline SHA
36+
`d548b61351af9ef0802da1946d26b2c35a3db449` as the starting point and create the state file.
3437

3538
Use the GitHub repos tool to get the latest commit SHA on the `main` branch of
3639
`nuxt-ui-templates/saas`.
@@ -137,66 +140,23 @@ corepack enable 2>/dev/null || npm install -g pnpm
137140
pnpm install
138141
```
139142

140-
Run type checking and linting:
141-
142-
```bash
143-
pnpm run typecheck
144-
pnpm run lint
145-
```
146-
147-
## Step 6: Run the dev server and take screenshots
148-
149-
Install `@playwright/cli` (the Playwright CLI tool designed for coding agents), then start the
150-
dev server and take screenshots of key pages. Save them to `.playwright-screenshots/` (this
151-
folder is not committed to git — it will be uploaded as a workflow artifact separately).
143+
If `pnpm install` fails due to native module compilation (e.g. `better-sqlite3`), try:
152144

153145
```bash
154-
npm install -g @playwright/cli@latest
146+
pnpm install --ignore-scripts
147+
# Then rebuild only the needed native module
148+
cd node_modules/.pnpm/better-sqlite3@*/node_modules/better-sqlite3 && npx --yes prebuild-install || npx --yes node-gyp rebuild
149+
cd -
155150
```
156151

157-
Start the dev server in background and wait for it to be ready:
158-
159-
```bash
160-
# Start dev server in background
161-
pnpm dev &
162-
DEV_PID=$!
163-
164-
# Wait up to 90 seconds for the dev server to be ready
165-
for i in $(seq 1 30); do
166-
curl -sf http://localhost:3000 > /dev/null && echo "Dev server ready" && break
167-
echo "Waiting for dev server... ($i/30)"
168-
sleep 3
169-
done
170-
```
171-
172-
Create the screenshots directory and take screenshots with `playwright-cli`:
152+
Run type checking and linting:
173153

174154
```bash
175-
mkdir -p .playwright-screenshots
176-
177-
playwright-cli open http://localhost:3000
178-
playwright-cli screenshot --filename=.playwright-screenshots/home.png
179-
180-
playwright-cli goto http://localhost:3000/posts
181-
playwright-cli screenshot --filename=.playwright-screenshots/posts.png
182-
183-
playwright-cli goto http://localhost:3000/goodies
184-
playwright-cli screenshot --filename=.playwright-screenshots/goodies.png
185-
186-
playwright-cli goto http://localhost:3000/speaking
187-
playwright-cli screenshot --filename=.playwright-screenshots/speaking.png
188-
189-
playwright-cli goto http://localhost:3000/tags
190-
playwright-cli screenshot --filename=.playwright-screenshots/tags.png
191-
192-
playwright-cli goto http://localhost:3000/about
193-
playwright-cli screenshot --filename=.playwright-screenshots/about.png
194-
195-
playwright-cli close
196-
kill $DEV_PID 2>/dev/null || true
155+
pnpm run typecheck
156+
pnpm run lint
197157
```
198158

199-
## Step 7: Create pull request
159+
## Step 6: Create pull request
200160

201161
Create a pull request with:
202162

@@ -210,6 +170,4 @@ Create a pull request with:
210170
- A table listing each changed file and the action taken (Applied / Adapted / Improved /
211171
Skipped) with a brief reason for skipped files
212172
- Any errors encountered during typecheck or lint, and whether they were fixed
213-
- A note that screenshots of key pages are available as a **workflow artifact** on the
214-
Actions run (link to the run URL) — they expire after 30 days
215173
- A reminder to review `package.json` dependency changes carefully before merging

0 commit comments

Comments
 (0)