Skip to content

Commit e1af010

Browse files
committed
chore: initial commit - migrate from monorepo
- Standalone package configuration - All dependencies with explicit versions - ESM-only build output - Comprehensive test suite (106 tests passing) - Storybook documentation - CI/CD workflows - Semantic-release configuration REQ-311: UI Package Separation
0 parents  commit e1af010

258 files changed

Lines changed: 29205 additions & 0 deletions

File tree

Some content is hidden

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

.github/workflows/lint.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Lint
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
lint:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: pnpm/action-setup@v2
14+
with:
15+
version: 10
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
cache: 'pnpm'
20+
- run: pnpm install
21+
- run: pnpm lint
22+
- run: pnpm format
23+
- run: pnpm check:type
24+

.github/workflows/publish.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
release:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: write
12+
issues: write
13+
pull-requests: write
14+
id-token: write
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
- uses: pnpm/action-setup@v2
20+
with:
21+
version: 10
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'pnpm'
26+
registry-url: 'https://registry.npmjs.org'
27+
- run: pnpm install
28+
- run: pnpm build
29+
- run: pnpm test:unit
30+
- run: npx semantic-release
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
34+

.github/workflows/security.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: Security
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
schedule:
8+
- cron: '0 0 * * 0' # Weekly
9+
10+
jobs:
11+
audit:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 10
18+
- uses: actions/setup-node@v4
19+
with:
20+
node-version: '20'
21+
cache: 'pnpm'
22+
- run: pnpm install
23+
- run: pnpm audit --audit-level=moderate
24+

.github/workflows/test.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Test
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: pnpm/action-setup@v2
14+
with:
15+
version: 10
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: '20'
19+
cache: 'pnpm'
20+
- run: pnpm install
21+
- run: pnpm test:unit
22+
- run: pnpm test:coverage
23+
- uses: codecov/codecov-action@v3
24+
with:
25+
files: ./coverage/coverage-final.json
26+
fail_ci_if_error: false
27+

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Dependencies
2+
node_modules/
3+
.pnp
4+
.pnp.js
5+
6+
# Testing
7+
coverage/
8+
.nyc_output
9+
10+
# Production
11+
dist/
12+
build/
13+
14+
# Misc
15+
.DS_Store
16+
*.pem
17+
.env
18+
.env.local
19+
.env.development.local
20+
.env.test.local
21+
.env.production.local
22+
23+
# Debug
24+
npm-debug.log*
25+
yarn-debug.log*
26+
yarn-error.log*
27+
pnpm-debug.log*
28+
lerna-debug.log*
29+
30+
# Editor directories and files
31+
.vscode/*
32+
!.vscode/extensions.json
33+
.idea
34+
*.suo
35+
*.ntvs*
36+
*.njsproj
37+
*.sln
38+
*.sw?
39+
40+
# Storybook
41+
storybook-static/
42+
43+
# Turbo
44+
.turbo/
45+
46+
# TypeScript
47+
*.tsbuildinfo

.releaserc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"branches": ["main"],
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@semantic-release/changelog",
7+
"@semantic-release/npm",
8+
"@semantic-release/git",
9+
"@semantic-release/github"
10+
],
11+
"prepare": [
12+
"@semantic-release/changelog",
13+
"@semantic-release/npm",
14+
{
15+
"path": "@semantic-release/git",
16+
"assets": ["CHANGELOG.md", "package.json"],
17+
"message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
18+
}
19+
]
20+
}
21+

.storybook/main.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type { StorybookConfig } from '@storybook/react-vite'
2+
3+
const config: StorybookConfig = {
4+
stories: ['../src/**/*.stories.@(js|jsx|mjs|ts|tsx)'],
5+
addons: [
6+
'@storybook/addon-essentials',
7+
'@storybook/addon-interactions',
8+
],
9+
framework: {
10+
name: '@storybook/react-vite',
11+
options: {},
12+
},
13+
docs: {
14+
autodocs: 'tag',
15+
},
16+
}
17+
18+
export default config
19+

.storybook/preview.tsx

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import type { Preview } from '@storybook/react'
2+
import { TamaguiProvider } from 'tamagui'
3+
import { config } from '../src/tamagui.config'
4+
5+
const preview: Preview = {
6+
parameters: {
7+
actions: { argTypesRegex: '^on[A-Z].*' },
8+
controls: {
9+
matchers: {
10+
color: /(background|color)$/i,
11+
date: /Date$/i,
12+
},
13+
},
14+
},
15+
decorators: [
16+
(Story) => (
17+
<TamaguiProvider config={config}>
18+
<Story />
19+
</TamaguiProvider>
20+
),
21+
],
22+
}
23+
24+
export default preview
25+

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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+
## [1.0.0] - 2025-11-30
9+
10+
### Added
11+
- Initial release of `@unicornlove/ui` standalone component library
12+
- Comprehensive UI component library for Tamagui and Expo
13+
- Support for iOS, Android, and Web platforms
14+
- Configurable theme system with factory utilities
15+
- Type definitions for geographic (Boundary, Coordinate) and phone utilities
16+
- Extensive component library including:
17+
- Form components (Input, Checkbox, Radio, PhoneNumberInput, ToggleSwitch, etc.)
18+
- Layout components (Card, Stack, Sheet, Dialog, Modal, etc.)
19+
- Navigation components (Breadcrumb, Tabs, Accordion, etc.)
20+
- Data display components (Charts, Tables, Lists, etc.)
21+
- Feedback components (Toast, Spinner, Loading states, etc.)
22+
- Map components with Mapbox integration
23+
- Rich text editor components
24+
- And many more...
25+
- Comprehensive documentation and API reference
26+
- Example Expo app demonstrating component usage
27+
- TypeScript definitions for all components
28+
- CJS, ESM, and DTS build outputs
29+
30+
### Platform Support
31+
- ✅ iOS
32+
- ✅ Android
33+
- ✅ Web
34+
35+
### Breaking Changes
36+
- This is the initial release, extracted from the legacy `@app/ui` package
37+
- Domain-specific components (ImageUpload, domain-specific layouts, etc.) have been moved to `@app/core` and are not included in this standalone package
38+
39+
### Dependencies
40+
- React >= 18.0.0
41+
- React Native >= 0.74.0 (optional)
42+
- Expo >= 51.0.0 (optional)
43+
- Tamagui >= 1.138.0
44+
- React Hook Form >= 7.0.0
45+
- Zod >= 3.0.0
46+
47+
[1.0.0]: https://github.com/Unicorn/SCF-Scaffald/releases/tag/@unicornlove/ui-v1.0.0
48+

CONTRIBUTING.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Contributing to @unicornlove/ui
2+
3+
Thank you for your interest in contributing to @unicornlove/ui!
4+
5+
## Development Setup
6+
7+
### Prerequisites
8+
9+
- Node.js >= 18.0.0
10+
- pnpm >= 8.0.0
11+
12+
### Getting Started
13+
14+
1. Clone the repository
15+
2. Install dependencies:
16+
```bash
17+
pnpm install
18+
```
19+
3. Build the package:
20+
```bash
21+
pnpm --filter @unicornlove/ui build
22+
```
23+
4. Run tests:
24+
```bash
25+
pnpm --filter @unicornlove/ui test:unit
26+
```
27+
28+
## Development Workflow
29+
30+
1. Create a feature branch from `main`
31+
2. Make your changes
32+
3. Run linting and type checking:
33+
```bash
34+
pnpm check
35+
```
36+
4. Run tests:
37+
```bash
38+
pnpm test:all
39+
```
40+
5. Commit your changes with descriptive messages
41+
6. Push and create a pull request
42+
43+
## Code Style
44+
45+
- Follow the existing code style
46+
- Use TypeScript for all new code
47+
- Prefer named exports over default exports
48+
- Use Tamagui shorthand properties (see project rules)
49+
- Write tests for new components
50+
51+
## Testing
52+
53+
- Write unit tests for all new components
54+
- Maintain 80%+ code coverage
55+
- Test on iOS, Android, and web when applicable
56+
57+
## Building
58+
59+
The package uses `tsup` for building. Build outputs are in the `dist/` directory:
60+
61+
- ESM: `dist/index.mjs`
62+
- CJS: `dist/index.js`
63+
- Types: `dist/index.d.ts`
64+
65+
## Questions?
66+
67+
Feel free to open an issue for questions or discussions.
68+

0 commit comments

Comments
 (0)