Skip to content

Commit e500efb

Browse files
author
loonylabs-dev
committed
init
0 parents  commit e500efb

39 files changed

+28122
-0
lines changed

.eslintrc.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
parserOptions: {
5+
ecmaVersion: 2020,
6+
sourceType: 'module',
7+
ecmaFeatures: {
8+
jsx: true,
9+
},
10+
},
11+
env: {
12+
es6: true,
13+
node: true,
14+
jest: true,
15+
},
16+
extends: [
17+
'eslint:recommended',
18+
'plugin:@typescript-eslint/recommended',
19+
'plugin:react/recommended',
20+
'plugin:react-hooks/recommended',
21+
'prettier',
22+
],
23+
plugins: ['@typescript-eslint', 'react', 'react-hooks'],
24+
rules: {
25+
'react/react-in-jsx-scope': 'off',
26+
'react/prop-types': 'off',
27+
'@typescript-eslint/explicit-module-boundary-types': 'off',
28+
'@typescript-eslint/no-explicit-any': 'warn',
29+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
30+
},
31+
settings: {
32+
react: {
33+
version: 'detect',
34+
},
35+
},
36+
};

.github/workflows/ci.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
lint:
11+
name: Lint
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Node.js
18+
uses: actions/setup-node@v4
19+
with:
20+
node-version: '18'
21+
cache: 'npm'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run ESLint
27+
run: npm run lint
28+
29+
- name: Check formatting
30+
run: npm run format:check
31+
32+
typecheck:
33+
name: Type Check
34+
runs-on: ubuntu-latest
35+
steps:
36+
- name: Checkout code
37+
uses: actions/checkout@v4
38+
39+
- name: Setup Node.js
40+
uses: actions/setup-node@v4
41+
with:
42+
node-version: '18'
43+
cache: 'npm'
44+
45+
- name: Install dependencies
46+
run: npm ci
47+
48+
- name: Run TypeScript compiler
49+
run: npm run typecheck
50+
51+
test:
52+
name: Test
53+
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
node-version: [16, 18, 20]
57+
steps:
58+
- name: Checkout code
59+
uses: actions/checkout@v4
60+
61+
- name: Setup Node.js ${{ matrix.node-version }}
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: ${{ matrix.node-version }}
65+
cache: 'npm'
66+
67+
- name: Install dependencies
68+
run: npm ci
69+
70+
- name: Run tests with coverage
71+
run: npm run test:coverage
72+
73+
- name: Upload coverage to Codecov
74+
uses: codecov/codecov-action@v3
75+
if: matrix.node-version == 18
76+
with:
77+
files: ./coverage/lcov.info
78+
flags: unittests
79+
name: codecov-umbrella
80+
fail_ci_if_error: false
81+
82+
build:
83+
name: Build
84+
runs-on: ubuntu-latest
85+
needs: [lint, typecheck, test]
86+
steps:
87+
- name: Checkout code
88+
uses: actions/checkout@v4
89+
90+
- name: Setup Node.js
91+
uses: actions/setup-node@v4
92+
with:
93+
node-version: '18'
94+
cache: 'npm'
95+
96+
- name: Install dependencies
97+
run: npm ci
98+
99+
- name: Build package
100+
run: npm run build
101+
102+
- name: Check build output
103+
run: |
104+
test -f dist/index.js
105+
test -f dist/index.mjs
106+
test -f dist/index.d.ts
107+
108+
- name: Upload build artifacts
109+
uses: actions/upload-artifact@v3
110+
with:
111+
name: dist
112+
path: dist/
113+
114+
publish-check:
115+
name: Publish Check
116+
runs-on: ubuntu-latest
117+
needs: build
118+
steps:
119+
- name: Checkout code
120+
uses: actions/checkout@v4
121+
122+
- name: Setup Node.js
123+
uses: actions/setup-node@v4
124+
with:
125+
node-version: '18'
126+
cache: 'npm'
127+
128+
- name: Install dependencies
129+
run: npm ci
130+
131+
- name: Build
132+
run: npm run build
133+
134+
- name: Check package contents
135+
run: npm pack --dry-run
136+
137+
- name: Verify package.json
138+
run: |
139+
node -e "const pkg = require('./package.json'); \
140+
if (!pkg.name) throw new Error('Missing name'); \
141+
if (!pkg.version) throw new Error('Missing version'); \
142+
if (!pkg.main) throw new Error('Missing main'); \
143+
if (!pkg.types) throw new Error('Missing types'); \
144+
console.log('package.json is valid');"
145+
146+
all-checks-passed:
147+
name: All Checks Passed
148+
runs-on: ubuntu-latest
149+
needs: [lint, typecheck, test, build, publish-check]
150+
if: always()
151+
steps:
152+
- name: Check all jobs
153+
run: |
154+
if [[ "${{ needs.lint.result }}" != "success" || \
155+
"${{ needs.typecheck.result }}" != "success" || \
156+
"${{ needs.test.result }}" != "success" || \
157+
"${{ needs.build.result }}" != "success" || \
158+
"${{ needs.publish-check.result }}" != "success" ]]; then
159+
echo "One or more checks failed"
160+
exit 1
161+
fi
162+
echo "All checks passed successfully!"

.github/workflows/release.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
release:
10+
name: Create Release
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v4
20+
with:
21+
node-version: '18'
22+
registry-url: 'https://registry.npmjs.org'
23+
24+
- name: Install dependencies
25+
run: npm ci
26+
27+
- name: Run tests
28+
run: npm test
29+
30+
- name: Build package
31+
run: npm run build
32+
33+
- name: Publish to npm
34+
run: npm publish
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
38+
- name: Extract release notes
39+
id: extract-release-notes
40+
run: |
41+
VERSION=${GITHUB_REF#refs/tags/v}
42+
echo "version=$VERSION" >> $GITHUB_OUTPUT
43+
44+
# Extract release notes from CHANGELOG.md
45+
awk "/## \[$VERSION\]/,/## \[/" CHANGELOG.md | sed '1d;$d' > release-notes.md
46+
47+
- name: Create GitHub Release
48+
uses: softprops/action-gh-release@v1
49+
with:
50+
body_path: release-notes.md
51+
draft: false
52+
prerelease: false
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
56+
- name: Notify on success
57+
if: success()
58+
run: |
59+
echo "✅ Successfully published version ${{ steps.extract-release-notes.outputs.version }}"
60+
61+
- name: Notify on failure
62+
if: failure()
63+
run: |
64+
echo "❌ Failed to publish release"

.gitignore

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Dependencies
2+
node_modules/
3+
npm-debug.log*
4+
yarn-debug.log*
5+
yarn-error.log*
6+
pnpm-debug.log*
7+
8+
# Build output
9+
dist/
10+
build/
11+
*.tsbuildinfo
12+
13+
# Test coverage
14+
coverage/
15+
.nyc_output/
16+
17+
# IDE
18+
.vscode/
19+
.idea/
20+
*.swp
21+
*.swo
22+
*~
23+
*.sublime-*
24+
25+
# OS
26+
.DS_Store
27+
Thumbs.db
28+
ehthumbs.db
29+
Desktop.ini
30+
31+
# Environment
32+
.env
33+
.env.local
34+
.env.*.local
35+
.env.development.local
36+
.env.test.local
37+
.env.production.local
38+
39+
# Logs
40+
logs/
41+
*.log
42+
43+
# Temporary files
44+
tmp/
45+
temp/
46+
*.tmp
47+
48+
# Package files
49+
*.tgz
50+
51+
# React Native / Metro
52+
.metro-health-check*
53+
.expo/
54+
.expo-shared/
55+
56+
# iOS
57+
ios/Pods/
58+
ios/build/
59+
ios/**/*.xcworkspace/xcuserdata/
60+
ios/**/*.xcodeproj/xcuserdata/
61+
ios/**/*.xcodeproj/project.xcworkspace/xcuserdata/
62+
*.xcuserstate
63+
*.xcscmblueprint
64+
**/.xcode.env.local
65+
66+
# Android
67+
android/build/
68+
android/.gradle/
69+
android/app/build/
70+
android/.idea/
71+
android/local.properties
72+
*.apk
73+
*.aab
74+
*.keystore
75+
!example/android/**/*.keystore
76+
77+
# Example app
78+
example/node_modules/
79+
example/ios/Pods/
80+
example/ios/build/
81+
example/ios/**/*.xcworkspace/xcuserdata/
82+
example/ios/**/*.xcodeproj/xcuserdata/
83+
example/android/build/
84+
example/android/.gradle/
85+
example/android/app/build/
86+
example/android/local.properties
87+
example/.expo/
88+
example/.expo-shared/
89+
example/.metro-health-check*
90+
91+
# Misc
92+
.claude/
93+
*.orig
94+
*.rej

.npmignore

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
src/
2+
__tests__/
3+
example/
4+
docs/
5+
.github/
6+
node_modules/
7+
.eslintrc.js
8+
.prettierrc
9+
jest.config.js
10+
tsconfig.json
11+
*.test.ts
12+
*.test.tsx
13+
*.log
14+
.DS_Store
15+
coverage/
16+
.idea/
17+
.vscode/

.prettierrc

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "es5",
4+
"singleQuote": true,
5+
"printWidth": 100,
6+
"tabWidth": 2,
7+
"useTabs": false,
8+
"arrowParens": "always",
9+
"endOfLine": "lf"
10+
}

0 commit comments

Comments
 (0)