Skip to content

Commit a27248a

Browse files
committed
feat: initial library setup with docusaurus and changesets
0 parents  commit a27248a

93 files changed

Lines changed: 33723 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.

.changeset/config.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
3+
"changelog": [
4+
"@changesets/changelog-github",
5+
{
6+
"repo": "codebelt/classy-store"
7+
}
8+
],
9+
"commit": false,
10+
"fixed": [],
11+
"linked": [],
12+
"access": "public",
13+
"baseBranch": "main",
14+
"updateInternalDependencies": "patch",
15+
"ignore": []
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../CLAUDE.md

.github/workflows/ci.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: CI
2+
on:
3+
pull_request:
4+
branches: [main]
5+
6+
jobs:
7+
ci:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v4
11+
- uses: oven-sh/setup-bun@v2
12+
- run: bun install --frozen-lockfile
13+
- run: bun run lint
14+
- run: bun run test
15+
- run: bun run typecheck
16+
- run: bun run build

.github/workflows/docs.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Deploy Docs
2+
on:
3+
push:
4+
branches: [main]
5+
paths:
6+
- 'website/**'
7+
- 'README.md'
8+
9+
permissions:
10+
pages: write
11+
id-token: write
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
- uses: oven-sh/setup-bun@v2
19+
- run: cd website && bun install --frozen-lockfile
20+
- run: cd website && bun run build
21+
- uses: actions/upload-pages-artifact@v3
22+
with:
23+
path: website/build
24+
25+
deploy:
26+
needs: build
27+
environment:
28+
name: github-pages
29+
url: ${{ steps.deployment.outputs.page_url }}
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/deploy-pages@v4
33+
id: deployment

.github/workflows/release.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Release
2+
on:
3+
push:
4+
branches: [main]
5+
6+
concurrency: ${{ github.workflow }}-${{ github.ref }}
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
id-token: write # Required for OIDC
15+
steps:
16+
- uses: actions/checkout@v4
17+
with: { fetch-depth: 0 }
18+
- uses: oven-sh/setup-bun@v2
19+
- run: bun install --frozen-lockfile
20+
- run: bun run build
21+
- uses: changesets/action@v1
22+
with:
23+
version: bun run changeset:version
24+
publish: bun run changeset:publish
25+
commit: "chore: release"
26+
title: "chore: release"
27+
env:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# dependencies (bun install)
2+
node_modules
3+
4+
# output
5+
out
6+
dist
7+
*.tgz
8+
9+
# code coverage
10+
coverage
11+
*.lcov
12+
13+
# logs
14+
logs
15+
_.log
16+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
17+
18+
# dotenv environment variable files
19+
.env
20+
.env.development.local
21+
.env.test.local
22+
.env.production.local
23+
.env.local
24+
25+
# caches
26+
.eslintcache
27+
.cache
28+
*.tsbuildinfo
29+
30+
# IntelliJ based IDEs
31+
.idea
32+
33+
# Finder (MacOS) folder config
34+
.DS_Store
35+
36+
# Docusaurus
37+
website/build
38+
website/.docusaurus
39+
website/.cache-loader

CONTRIBUTING.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Contributing to @codebelt/classy-store
2+
3+
## Development Setup
4+
5+
1. Install [Bun](https://bun.sh).
6+
2. Clone the repository.
7+
3. Run `bun install`.
8+
9+
## Workflow
10+
11+
- **Dev**: `bun run dev` (watch mode)
12+
- **Test**: `bun run test`
13+
- **Lint**: `bun run lint`
14+
- **Docs**: `bun run docs:dev`
15+
16+
## Releasing
17+
18+
We use [Changesets](https://github.com/changesets/changesets) to manage versioning and changelogs.
19+
20+
### 1. Create a Changeset
21+
22+
When you make changes that should be released, run:
23+
24+
```bash
25+
bun run changeset:add
26+
```
27+
28+
Follow the prompts to select the package and bump type (patch, minor, major). This creates a file in `.changeset/`. Commit this file with your PR.
29+
30+
### 2. Automated Release
31+
32+
When your PR is merged to `main`:
33+
1. The **Release** GitHub Action will create a "Version Packages" PR.
34+
2. When you merge that PR, the action will automatically publish the new version to npm and update the CHANGELOG.
35+
36+
### 3. Pre-releases
37+
38+
To enter pre-release mode (e.g., beta):
39+
40+
```bash
41+
bun run prerelease:enter beta
42+
bun run changeset:version
43+
bun run changeset:publish
44+
```
45+
46+
To exit:
47+
```bash
48+
bun run prerelease:exit
49+
```

README.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# @codebelt/classy-store
2+
3+
**Class-based reactive state management for React.**
4+
5+
[![npm version](https://img.shields.io/npm/v/@codebelt/classy-store.svg)](https://www.npmjs.com/package/@codebelt/classy-store)
6+
[![CI](https://github.com/codebelt/classy-store/actions/workflows/ci.yml/badge.svg)](https://github.com/codebelt/classy-store/actions/workflows/ci.yml)
7+
[![License](https://img.shields.io/npm/l/@codebelt/classy-store.svg)](https://github.com/codebelt/classy-store/blob/main/LICENSE)
8+
9+
## 📚 Documentation
10+
11+
Visit the **[Documentation Website](https://codebelt.github.io/classy-store/)** for tutorials, API reference, and examples.
12+
13+
## 🚀 Features
14+
15+
- **Class-Based**: Define state and logic using standard ES6 classes.
16+
- **Reactive**: Automatic reactivity using Proxies.
17+
- **React Integration**: Seamless integration with React 18+ hooks.
18+
- **TypeScript**: Written in TypeScript with first-class type support.
19+
20+
## 📦 Installation
21+
22+
```bash
23+
npm install @codebelt/classy-store
24+
# or
25+
bun add @codebelt/classy-store
26+
```
27+
28+
## 🛠️ Development
29+
30+
This project uses [Bun](https://bun.sh) for development.
31+
32+
```bash
33+
# Install dependencies
34+
bun install
35+
36+
# Run tests
37+
bun run test
38+
39+
# Run build
40+
bun run build
41+
42+
# Start docs website locally
43+
bun run docs:dev
44+
```
45+
46+
## 🤝 Contributing
47+
48+
See [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to contribute and the release workflow.

biome.json

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.15/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": true,
10+
"includes": [
11+
"**",
12+
"!node_modules",
13+
"!.next",
14+
"!dist",
15+
"!build",
16+
"!**/_generated",
17+
"!coverage"
18+
]
19+
},
20+
"formatter": {
21+
"enabled": true,
22+
"indentStyle": "space",
23+
"indentWidth": 2,
24+
"bracketSpacing": false
25+
},
26+
"linter": {
27+
"enabled": true,
28+
"rules": {
29+
"recommended": true,
30+
"style": {
31+
"noImplicitBoolean": "error",
32+
"noInferrableTypes": "error",
33+
"noParameterAssign": "error",
34+
"noUnusedTemplateLiteral": "error",
35+
"noUselessElse": "error",
36+
"useAsConstAssertion": "error",
37+
"useConsistentCurlyBraces": {
38+
"level": "error",
39+
"fix": "safe",
40+
"options": {}
41+
},
42+
"useDefaultParameterLast": "error",
43+
"useEnumInitializers": "error",
44+
"useNumberNamespace": "error",
45+
"useSelfClosingElements": "error",
46+
"useSingleVarDeclarator": "error"
47+
},
48+
"correctness": {
49+
"noUnusedImports": {
50+
"level": "error",
51+
"fix": "safe",
52+
"options": {}
53+
},
54+
"noChildrenProp": {
55+
"level": "off"
56+
}
57+
},
58+
"suspicious": {
59+
"noUnknownAtRules": "off"
60+
}
61+
},
62+
"domains": {
63+
"next": "recommended",
64+
"react": "recommended"
65+
}
66+
},
67+
"javascript": {
68+
"formatter": {
69+
"quoteStyle": "single"
70+
}
71+
},
72+
"overrides": [
73+
{
74+
"includes": ["**/styles.css"],
75+
"linter": {
76+
"rules": {
77+
"complexity": {
78+
"noImportantStyles": "off"
79+
}
80+
}
81+
}
82+
},
83+
{
84+
"includes": ["**/CodeBlock.tsx"],
85+
"linter": {
86+
"rules": {
87+
"suspicious": {
88+
"noArrayIndexKey": "off"
89+
}
90+
}
91+
}
92+
}
93+
],
94+
"css": {
95+
"parser": {
96+
"tailwindDirectives": true
97+
}
98+
},
99+
"assist": {
100+
"actions": {
101+
"source": {
102+
"organizeImports": "on"
103+
}
104+
}
105+
}
106+
}

0 commit comments

Comments
 (0)