Skip to content

Commit d3a78d4

Browse files
committed
Merge branch 'main' into copilot/add-designer-feature
2 parents 031faff + 3893dfb commit d3a78d4

26 files changed

Lines changed: 1962 additions & 16 deletions

.github/workflows/ci.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
name: Test
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
node-version: [18.x, 20.x]
16+
17+
steps:
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup pnpm
22+
uses: pnpm/action-setup@v4
23+
with:
24+
version: 10
25+
26+
- name: Setup Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
cache: 'pnpm'
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Run tests
36+
run: pnpm test
37+
38+
- name: Generate coverage report
39+
if: matrix.node-version == '20.x'
40+
run: pnpm test:coverage
41+
42+
- name: Upload coverage to Codecov
43+
if: matrix.node-version == '20.x'
44+
uses: codecov/codecov-action@v4
45+
with:
46+
fail_ci_if_error: false
47+
48+
lint:
49+
name: Lint
50+
runs-on: ubuntu-latest
51+
52+
steps:
53+
- name: Checkout code
54+
uses: actions/checkout@v4
55+
56+
- name: Setup pnpm
57+
uses: pnpm/action-setup@v4
58+
with:
59+
version: 10
60+
61+
- name: Setup Node.js
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: '20.x'
65+
cache: 'pnpm'
66+
67+
- name: Install dependencies
68+
run: pnpm install --frozen-lockfile
69+
70+
- name: Run linter
71+
run: pnpm lint
72+
73+
build:
74+
name: Build
75+
runs-on: ubuntu-latest
76+
77+
steps:
78+
- name: Checkout code
79+
uses: actions/checkout@v4
80+
81+
- name: Setup pnpm
82+
uses: pnpm/action-setup@v4
83+
with:
84+
version: 10
85+
86+
- name: Setup Node.js
87+
uses: actions/setup-node@v4
88+
with:
89+
node-version: '20.x'
90+
cache: 'pnpm'
91+
92+
- name: Install dependencies
93+
run: pnpm install --frozen-lockfile
94+
95+
- name: Build packages
96+
run: pnpm build
97+
98+
- name: Check for build artifacts
99+
run: |
100+
if [ ! -d "packages/protocol/dist" ]; then
101+
echo "Protocol package build failed"
102+
exit 1
103+
fi
104+
echo "All packages built successfully"

.github/workflows/pr-checks.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: PR Checks
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened]
6+
7+
jobs:
8+
validate:
9+
name: Validate PR
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0
17+
18+
- name: Setup pnpm
19+
uses: pnpm/action-setup@v4
20+
with:
21+
version: 10
22+
23+
- name: Setup Node.js
24+
uses: actions/setup-node@v4
25+
with:
26+
node-version: '20.x'
27+
cache: 'pnpm'
28+
29+
- name: Install dependencies
30+
run: pnpm install --frozen-lockfile
31+
32+
- name: Type check
33+
run: pnpm build
34+
35+
- name: Run tests
36+
run: pnpm test
37+
38+
- name: Run linter
39+
run: pnpm lint
40+
continue-on-error: true
41+
42+
- name: Comment on PR
43+
if: success()
44+
uses: actions/github-script@v7
45+
with:
46+
script: |
47+
const message = `✅ All checks passed!\n\n- ✅ Type check passed\n- ✅ Tests passed\n- ✅ Lint check completed`;
48+
github.rest.issues.createComment({
49+
issue_number: context.issue.number,
50+
owner: context.repo.owner,
51+
repo: context.repo.repo,
52+
body: message
53+
});

.github/workflows/release.yml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
name: Create Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 10
26+
27+
- name: Setup Node.js
28+
uses: actions/setup-node@v4
29+
with:
30+
node-version: '20.x'
31+
cache: 'pnpm'
32+
registry-url: 'https://registry.npmjs.org'
33+
34+
- name: Install dependencies
35+
run: pnpm install --frozen-lockfile
36+
37+
- name: Run tests
38+
run: pnpm test
39+
40+
- name: Build packages
41+
run: pnpm build
42+
43+
- name: Extract version from tag
44+
id: get_version
45+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
46+
47+
- name: Create GitHub Release
48+
uses: softprops/action-gh-release@v1
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
with:
52+
tag_name: ${{ github.ref }}
53+
name: Release ${{ steps.get_version.outputs.VERSION }}
54+
body: |
55+
Release version ${{ steps.get_version.outputs.VERSION }}
56+
57+
## What's Changed
58+
Please see the [CHANGELOG](CHANGELOG.md) for details.
59+
draft: false
60+
prerelease: false
61+
62+
# Uncomment the following steps when ready to publish to npm
63+
# - name: Publish to npm
64+
# run: pnpm publish -r --access public
65+
# env:
66+
# NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

CHANGELOG.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
### Added
11+
12+
- Comprehensive test suite using Vitest and React Testing Library
13+
- Test coverage for @object-ui/protocol, @object-ui/engine, @object-ui/renderer, @object-ui/ui, and @object-ui/designer packages
14+
- GitHub Actions CI/CD workflows:
15+
- CI workflow for automated testing, linting, and building
16+
- Release workflow for publishing new versions
17+
- Test coverage reporting with @vitest/coverage-v8
18+
- Contributing guidelines (CONTRIBUTING.md)
19+
- Documentation for testing and development workflow in README
20+
21+
### Changed
22+
23+
- Updated package.json scripts to use Vitest instead of placeholder test commands
24+
- Enhanced README with testing instructions and CI status badges
25+
26+
## [0.1.0] - Initial Release
27+
28+
### Added
29+
30+
- Core packages:
31+
- @object-ui/protocol - Pure metadata definitions and types
32+
- @object-ui/engine - Headless logic for handling data
33+
- @object-ui/renderer - Schema to UI component renderer
34+
- @object-ui/ui - High-quality UI components built with Tailwind CSS & Shadcn
35+
- @object-ui/designer - Drag-and-drop visual editor
36+
- Monorepo structure using pnpm and TurboRepo
37+
- Basic TypeScript configuration
38+
- Example applications in the examples directory
39+
40+
[Unreleased]: https://github.com/objectql/object-ui/compare/v0.1.0...HEAD
41+
[0.1.0]: https://github.com/objectql/object-ui/releases/tag/v0.1.0

CONTRIBUTING.md

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
# Contributing to Object UI
2+
3+
Thank you for your interest in contributing to Object UI! This document provides guidelines and instructions for contributing.
4+
5+
## Getting Started
6+
7+
1. Fork the repository
8+
2. Clone your fork: `git clone https://github.com/YOUR_USERNAME/object-ui.git`
9+
3. Install dependencies: `pnpm install`
10+
4. Create a new branch: `git checkout -b feature/your-feature-name`
11+
12+
## Development Workflow
13+
14+
### Running Tests
15+
16+
```bash
17+
# Run all tests
18+
pnpm test
19+
20+
# Run tests in watch mode
21+
pnpm test:watch
22+
23+
# Run tests with UI
24+
pnpm test:ui
25+
26+
# Generate coverage report
27+
pnpm test:coverage
28+
```
29+
30+
### Building
31+
32+
```bash
33+
# Build all packages
34+
pnpm build
35+
36+
# Build specific package
37+
cd packages/protocol && pnpm build
38+
```
39+
40+
### Linting
41+
42+
```bash
43+
# Lint all packages
44+
pnpm lint
45+
```
46+
47+
## Writing Tests
48+
49+
All tests should be placed in `__tests__` directories within the source code. We use **Vitest** and **React Testing Library**.
50+
51+
Example test structure:
52+
53+
```typescript
54+
import { describe, it, expect } from 'vitest';
55+
import { render, screen } from '@testing-library/react';
56+
57+
describe('ComponentName', () => {
58+
it('should render correctly', () => {
59+
render(<ComponentName />);
60+
expect(screen.getByText('Expected Text')).toBeInTheDocument();
61+
});
62+
});
63+
```
64+
65+
## Commit Guidelines
66+
67+
We follow conventional commit messages:
68+
69+
- `feat:` - New features
70+
- `fix:` - Bug fixes
71+
- `docs:` - Documentation changes
72+
- `test:` - Adding or updating tests
73+
- `chore:` - Maintenance tasks
74+
- `refactor:` - Code refactoring
75+
76+
Example: `feat: add new button variant`
77+
78+
## Pull Request Process
79+
80+
1. Ensure all tests pass: `pnpm test`
81+
2. Ensure the build succeeds: `pnpm build`
82+
3. Update documentation if needed
83+
4. Create a pull request with a clear description of changes
84+
5. Link any relevant issues
85+
86+
## Code Style
87+
88+
- Follow existing code style in the project
89+
- Use TypeScript for type safety
90+
- Write meaningful variable and function names
91+
- Add comments for complex logic
92+
- Keep functions small and focused
93+
94+
## Adding New Packages
95+
96+
If you need to add a new package to the monorepo:
97+
98+
1. Create a new directory under `packages/`
99+
2. Add a `package.json` with proper workspace dependencies
100+
3. Update the main README if the package is user-facing
101+
4. Add tests for the new package
102+
103+
## Questions?
104+
105+
If you have questions, feel free to:
106+
- Open an issue with the `question` label
107+
- Start a discussion in GitHub Discussions
108+
- Reach out to the maintainers
109+
110+
## License
111+
112+
By contributing, you agree that your contributions will be licensed under the MIT License.

0 commit comments

Comments
 (0)