Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["@commitlint/config-conventional"]
}
68 changes: 68 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Release

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: CI
runs-on: ubuntu-latest
steps:
- name: Check out project
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build schemas
run: npm run build

- name: Verify build output
run: |
echo "Checking component count..."
find components -name "schema.json" | wc -l
echo "Checking main index..."
ls -la index.js

deploy:
name: Deploy release
runs-on: ubuntu-latest
needs: [ci]
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
steps:
- name: Check out project
uses: actions/checkout@v4
with:
# Fetch all history for all branches and tags, which is needed for the release script
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Build schemas
run: npm run build

- name: Deploy to NPM and Github
run: npm run semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
50 changes: 32 additions & 18 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,48 @@ npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime
.DS_Store
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage/
.nyc_output

# Environment variables
.env
.env.local
.env.development.local
.env.test.local
.env.production.local

# Cache directories
.npm
.eslintcache

# Optional npm cache directory
.npm

# Semantic Release
.semanticrc

# OS generated files
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db

# IDE
.vscode/
.idea/
*.swp
*.swo

# Temporary files
*.tmp
*.temp

# Logs
logs
*.log

# Coverage directory used by tools like istanbul
coverage/
*.lcov

# Build outputs (if any)
dist/
build/

# Sample/test files (optional - remove if you want to keep sample-metadata.json)
sample-metadata.json
*.log
70 changes: 60 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# patternfly-component-schemas
# @patternfly/patternfly-component-schemas

JSON Schema metadata for PatternFly React components, providing structured validation and documentation for component props.

## 📦 Installation

```bash
npm install patternfly-component-schemas
npm install @patternfly/patternfly-component-schemas
```

## 🏗️ Structure

This package uses a split structure for optimal performance and modularity:

```
patternfly-component-schemas/
@patternfly/patternfly-component-schemas/
├── components/
│ ├── AboutModal/
│ │ ├── schema.json # JSON Schema for AboutModal props
Expand Down Expand Up @@ -79,14 +79,19 @@ npm run rebuild
The package is generated from `component-metadata.json` which contains the raw PatternFly component metadata for the latest release. This file is included in the git repository for development but excluded from the NPM package.

### Updating Component Metadata
**Current Process - (Manual)**

**📋 Manual Process (Current)**
1. Clone https://github.com/patternfly/patternfly-doc-core
2. Run `npm run build:props` in the doc-core directory
3. Copy `dist/props.json` content to `component-metadata.json` of this repo.
3. Copy `dist/props.json` content to `component-metadata.json` of this repo
4. Run `npm run build` to regenerate schemas
5. Test and publish
5. Commit with: `feat(components): sync with PatternFly vX.X.X`
6. Push to `main` → **automatic release triggers** 🚀

**Future**: This will be automated to sync with PatternFly releases.
**🔮 Future Automation**
- Dependency management via Renovate/Dependabot
- Automated PRs for PatternFly quarterly releases
- Human-in-the-loop review for component updates

## 📊 Package Contents

Expand All @@ -111,12 +116,57 @@ This package is specifically designed for:

MIT

## 🚀 Automated Releases

This package uses **semantic-release** for automated versioning and publishing based on conventional commits.

### Commit Message Format

Follow [Conventional Commits](https://conventionalcommits.org/) specification:

```
<type>[optional scope]: <description>
```

**Examples:**
```bash
feat: add new component schemas
fix: correct required props validation
docs: update installation instructions
chore: update dependencies
```

### Release Process

1. **Push commits** to `main` branch using conventional format
2. **GitHub Actions** runs CI and tests
3. **Semantic-release** analyzes commits and publishes to NPM
4. **GitHub releases** created automatically

## 🤝 Contributing

1. Fork the repository
2. Update `component-metadata.json` with your changes
3. Run `npm run build` to regenerate schemas
4. Submit a pull request
2. Create a feature branch
3. Update `component-metadata.json` with your changes
4. Run `npm run build` to regenerate schemas
5. Commit using conventional commit format
6. Submit a pull request

### Development Setup

```bash
# Install dependencies
npm install

# Build schemas
npm run build

# Watch for changes
npm run dev

# Clean and rebuild
npm run rebuild
```

---

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Auto-generated index file for PatternFly component schemas
// Generated on: 2025-09-11T19:09:50.573Z
// Generated on: 2025-09-16T13:47:33.613Z

export { default as KeyboardHandler } from './components/KeyboardHandler/index.js';
export { default as SampleDataRow } from './components/SampleDataRow/index.js';
Expand Down
Loading