Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 32 additions & 65 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,33 +23,24 @@
| `pnpm dev` | Start dev server |
| `pnpm build` | Build for production |
| `pnpm preview` | Preview production build |
| `pnpm test` | Run tests |
| `pnpm test:watch` | Watch mode |
| `pnpm test:coverage` | Coverage report |
| `pnpm lint` | Lint code |
| `pnpm lint:fix` | Fix lint issues |
| `pnpm type-check` | TypeScript check |
| `pnpm format` | Format with Prettier |
| `pnpm format:check` | Check formatting |
| `pnpm validate-registry` | Validate public/registry.json |
| `pnpm update-readme-versions` | Sync README version table from registry |

## Pull Request Process

1. Fork and create branch from `main`
2. Make changes following coding standards
3. Add tests for new functionality
4. Ensure all checks pass:
3. Verify the build succeeds:
```bash
pnpm lint && pnpm type-check && pnpm test
pnpm build
```
5. Submit PR

### Quality Standards

- ✅ All tests pass
- ✅ Coverage ≥80%
- ✅ No lint errors
- ✅ TypeScript strict mode
- ✅ Formatted with Prettier
- ✅ Build succeeds (`pnpm build`)
- ✅ Registry validates (`pnpm validate-registry`)
- ✅ Spellcheck passes (CI)

## Coding Standards

Expand All @@ -58,13 +49,13 @@
- No `any` types
- Proper type definitions

### React
- Functional components with hooks
- Small, focused components
- Custom hooks for reusable logic
### Astro
- Use `.astro` single-file components
- Prefer Astro components over framework components
- Leverage the shared `@jongio/azd-web-core` design system

### Styling
- Tailwind CSS utilities
- Tailwind CSS 4 utilities
- Responsive design
- Semantic HTML

Expand Down Expand Up @@ -106,7 +97,7 @@

## Adding a New Extension

This is the complete checklist for adding a new azd extension to this registry. Each extension lives in its own repo (e.g., `jongio/azd-myext`) and publishes its own `registry.json`. This repo aggregates them all.

Check warning on line 100 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (myext)

### 1. Create `registry.json` in the Extension Repo

Expand All @@ -117,15 +108,15 @@
{
"extensions": [
{
"id": "jongio.azd.myext",

Check warning on line 111 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (myext)
"namespace": "myext",

Check warning on line 112 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (myext)
"displayName": "My Extension",
"description": "What it does",
"versions": [
{
"version": "0.1.0",
"capabilities": ["custom-commands"],
"usage": "azd myext <command>",

Check warning on line 119 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (myext)
"artifacts": {
"darwin/amd64": { "url": "...", "checksum": { "algorithm": "sha256", "value": "..." }, "entryPoint": "..." },
"darwin/arm64": { "url": "...", "checksum": { "algorithm": "sha256", "value": "..." }, "entryPoint": "..." },
Expand Down Expand Up @@ -170,7 +161,7 @@
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${{ secrets.EXTENSIONS_DISPATCH_TOKEN }}" \
https://api.github.com/repos/jongio/azd-extensions/dispatches \
-d '{"event_type":"extension-released","client_payload":{"repo":"azd-myext","version":"${{ steps.version.outputs.next }}"}}'

Check warning on line 164 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (myext)
```

### 4. Create the `EXTENSIONS_DISPATCH_TOKEN` Secret
Expand Down Expand Up @@ -212,43 +203,15 @@
)
```

### 6. Add UI Card Data in `ExtensionCard.tsx`

Add your extension's rich card data to the `extensionData` record in `src/components/ExtensionCard.tsx`:

```tsx
'jongio.azd.myext': {
tagline: 'Short tagline',
description: 'Longer description of what the extension does.',
highlight: 'var(--color-glow-violet)', // pick a glow color
website: 'https://jongio.github.io/azd-myext/',
repository: 'https://github.com/jongio/azd-myext',
features: [
{ icon: Terminal, title: 'Feature 1', desc: 'What it does' },
// ... up to 4 features
],
scenarios: [
{ title: 'Basic Usage', command: 'azd myext run' },
// ... example commands
],
},
```
### 6. Add UI Card Data in `ExtensionShowcase.astro`

Also update the sort order in `src/App.tsx` if you want to control card positioning:
```tsx
const order: Record<string, number> = {
'jongio.azd.copilot': 0,
'jongio.azd.app': 1,
'jongio.azd.exec': 2,
'jongio.azd.myext': 3, // Add your extension
}
```
Add your extension's showcase entry in `src/pages/index.astro` using the `ExtensionShowcase` Astro component. See the existing entries for the expected props (tagline, description, glowColor, features, scenarios, etc.).

### 7. Test the Full Flow

1. **Local registry update**: Run `node scripts/update-registry.js` to verify your extension is fetched and merged
2. **Local dev build**: Run `pnpm dev` and verify the extension card renders correctly
3. **Local install**: Run `pwsh scripts/install-all.ps1` to verify the extension builds locally

Check warning on line 214 in CONTRIBUTING.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (pwsh)
4. **Submit PR**: Open a PR to `main` with your changes — CI will validate lint, type-check, and tests
5. **After merge**: The publish workflow deploys to GitHub Pages and the registry goes live

Expand All @@ -261,14 +224,14 @@
| 3 | Extension repo | Add dispatch step to `release.yml` |
| 4 | GitHub Settings | Create PAT and add `EXTENSIONS_DISPATCH_TOKEN` secret |
| 5 | azd-extensions | Add to `scripts/install-all.ps1` and `scripts/watch-all.ps1` |
| 6 | azd-extensions | Add card data in `ExtensionCard.tsx` and sort order in `App.tsx` |
| 6 | azd-extensions | Add showcase entry in `src/pages/index.astro` |
| 7 | Both repos | Test registry update, dev build, and local install |

## CI/CD Workflows

| Workflow | Trigger | Purpose |
|----------|---------|---------|
| `ci.yml` | Push/PR | Lint, type-check, test, build |
| `ci.yml` | Push/PR | Build, validate registry, spellcheck |
| `publish.yml` | Daily / Manual / Dispatch | Update registry, build, deploy to GitHub Pages |
| `codeql.yml` | Weekly / PR | Security scanning |
| `spellcheck.yml` | Push/PR | Spell checking |
Expand All @@ -278,20 +241,24 @@

```
├── src/
│ ├── components/ # React components
│ │ ├── ui/ # shadcn/ui components
│ │ └── icons/ # Custom icons
│ ├── lib/ # Utility functions
│ ├── test/ # Test setup
│ ├── types/ # TypeScript types
│ ├── App.tsx # Main app
│ ├── main.tsx # Entry point
│ └── index.css # Global styles
│ ├── components/ # Astro components
│ │ └── ExtensionShowcase.astro
│ ├── pages/
│ │ └── index.astro # Main page
│ └── styles/
│ └── global.css # Global styles
├── public/
│ └── registry.json # Extension registry
│ └── registry.json # Aggregated extension registry
├── scripts/
│ └── update-registry.js
└── .github/workflows/ # CI/CD
│ ├── lib/semver.js # Shared semver utility
│ ├── update-registry.js # Aggregates per-repo registries
│ ├── update-readme-versions.js
│ ├── validate-registry.js
│ ├── install-all.ps1 # Local dev: build & install all extensions
│ ├── uninstall-all.ps1 # Local dev: remove all extensions
│ └── watch-all.ps1 # Local dev: watch & rebuild
├── schemas/ # Registry JSON schemas
└── .github/workflows/ # CI/CD
```

## Reporting Issues
Expand Down
35 changes: 10 additions & 25 deletions QUICKSTART.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,33 +21,27 @@
pnpm install
```

This will install all required packages including React 19, Vite, TypeScript, Tailwind CSS 4, and testing tools.
This will install all required packages including Astro, TypeScript, and Tailwind CSS 4.

## 3. Start Development Server

```bash
pnpm dev
```

The site will be available at `http://localhost:5173`
The site will be available at `http://localhost:4321`

## 4. Explore the Site

- View the extension cards (currently empty - add your extensions to registry.json)
- Check the responsive design on different screen sizes
- Review the getting started instructions

## 5. Run Tests
## 5. Validate the Registry

```bash
# Run all tests once
pnpm test

# Run tests in watch mode (recommended during development)
pnpm test:watch

# Generate coverage report
pnpm test:coverage
# Validate the aggregated registry
pnpm validate-registry
```

## 6. Build for Production
Expand All @@ -67,20 +61,11 @@
## Common Development Commands

```bash
# Type checking
pnpm type-check

# Linting
pnpm lint

# Fix lint issues
pnpm lint:fix

# Format code
pnpm format
# Validate registry data
pnpm validate-registry

# Check formatting
pnpm format:check
# Update README version table from registry
pnpm update-readme-versions
```

## Adding Your First Extension
Expand All @@ -96,7 +81,7 @@
"displayName": "Your Extension Name",
"description": "Description of your extension",
"version": "1.0.0",
"namespace": "yournamespace",

Check warning on line 84 in QUICKSTART.md

View workflow job for this annotation

GitHub Actions / spellcheck

Unknown word (yournamespace)
"tags": ["tag1", "tag2"],
"repository": "https://github.com/yourusername/your-extension"
}
Expand Down Expand Up @@ -126,7 +111,7 @@

### Port Already in Use

If port 5173 is already in use, Vite will automatically use the next available port.
If port 4321 is already in use, Astro will automatically use the next available port.

### Module Not Found

Expand Down
Loading