Skip to content

Commit b53a9ec

Browse files
committed
feat: update project
1 parent 6b653f1 commit b53a9ec

File tree

150 files changed

+4382
-5305
lines changed

Some content is hidden

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

150 files changed

+4382
-5305
lines changed

.github/CODEOWNERS

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Global owners
2+
* @no-witness-labs
3+
4+
# Evolution SDK core
5+
/packages/evolution/ @no-witness-labs
6+
7+
# Documentation
8+
/docs/ @no-witness-labs
9+
/README.md @no-witness-labs
10+
11+
# CI/CD and GitHub configuration
12+
/.github/ @no-witness-labs
13+
/.changeset/ @no-witness-labs
14+
15+
# Package configuration
16+
/package.json @no-witness-labs
17+
/turbo.json @no-witness-labs
18+
/tsconfig*.json @no-witness-labs

.github/workflows/ci.yml

Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
jobs:
15+
lint:
16+
name: ⬣ ESLint
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: ⬇️ Checkout repo
20+
uses: actions/checkout@v4
21+
22+
- name: ⎔ Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
cache: 'pnpm'
27+
28+
- name: 📦 Install pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 9
32+
33+
- name: 📦 Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: 🔬 Lint
37+
run: pnpm turbo run lint --affected
38+
39+
typecheck:
40+
name: ʦ TypeScript
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: ⬇️ Checkout repo
44+
uses: actions/checkout@v4
45+
46+
- name: ⎔ Setup Node.js
47+
uses: actions/setup-node@v4
48+
with:
49+
node-version: 20
50+
cache: 'pnpm'
51+
52+
- name: 📦 Install pnpm
53+
uses: pnpm/action-setup@v4
54+
with:
55+
version: 9
56+
57+
- name: 📦 Install dependencies
58+
run: pnpm install --frozen-lockfile
59+
60+
- name: 🔎 Type check
61+
run: pnpm turbo run type-check --affected
62+
63+
test:
64+
name: 🧪 Test
65+
runs-on: ubuntu-latest
66+
steps:
67+
- name: ⬇️ Checkout repo
68+
uses: actions/checkout@v4
69+
70+
- name: ⎔ Setup Node.js
71+
uses: actions/setup-node@v4
72+
with:
73+
node-version: 20
74+
cache: 'pnpm'
75+
76+
- name: 📦 Install pnpm
77+
uses: pnpm/action-setup@v4
78+
with:
79+
version: 9
80+
81+
- name: 📦 Install dependencies
82+
run: pnpm install --frozen-lockfile
83+
84+
- name: 🧪 Run tests
85+
run: pnpm turbo run test --affected
86+
87+
build:
88+
name: 🏗 Build
89+
runs-on: ubuntu-latest
90+
steps:
91+
- name: ⬇️ Checkout repo
92+
uses: actions/checkout@v4
93+
94+
- name: ⎔ Setup Node.js
95+
uses: actions/setup-node@v4
96+
with:
97+
node-version: 20
98+
cache: 'pnpm'
99+
100+
- name: 📦 Install pnpm
101+
uses: pnpm/action-setup@v4
102+
with:
103+
version: 9
104+
105+
- name: 📦 Install dependencies
106+
run: pnpm install --frozen-lockfile
107+
108+
- name: 🏗 Build packages
109+
run: pnpm turbo run build --affected
110+
111+
- name: 📄 Generate docs (validate examples)
112+
run: pnpm turbo run docgen --affected || echo "No docgen script found, skipping"
113+
114+
# Matrix strategy for testing across different environments
115+
test-matrix:
116+
name: 🧪 Test Matrix
117+
runs-on: ${{ matrix.os }}
118+
strategy:
119+
matrix:
120+
os: [ubuntu-latest, windows-latest, macos-latest]
121+
node-version: [18, 20]
122+
fail-fast: false
123+
steps:
124+
- name: ⬇️ Checkout repo
125+
uses: actions/checkout@v4
126+
127+
- name: ⎔ Setup Node.js ${{ matrix.node-version }}
128+
uses: actions/setup-node@v4
129+
with:
130+
node-version: ${{ matrix.node-version }}
131+
cache: 'pnpm'
132+
133+
- name: 📦 Install pnpm
134+
uses: pnpm/action-setup@v4
135+
with:
136+
version: 9
137+
138+
- name: 📦 Install dependencies
139+
run: pnpm install --frozen-lockfile
140+
141+
- name: 🏗 Build
142+
run: pnpm turbo run build --affected
143+
144+
- name: 🧪 Test
145+
run: pnpm turbo run test --affected
146+
147+
# All jobs must pass
148+
ci:
149+
name: ✅ CI
150+
runs-on: ubuntu-latest
151+
if: always()
152+
needs: [lint, typecheck, test, build, test-matrix]
153+
steps:
154+
- name: ✅ All jobs passed
155+
if: ${{ !(contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled')) }}
156+
run: exit 0
157+
158+
- name: ❌ Some jobs failed
159+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
160+
run: exit 1

.github/workflows/docs.yml

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
name: Deploy Documentation
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'docs/**'
8+
- 'packages/evolution/src/**'
9+
- 'packages/evolution/docs/**'
10+
workflow_dispatch:
11+
12+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: false
23+
24+
jobs:
25+
# Build job
26+
build:
27+
runs-on: ubuntu-latest
28+
outputs:
29+
should_build: ${{ steps.changes.outputs.should_build }}
30+
steps:
31+
- name: ⬇️ Checkout
32+
uses: actions/checkout@v4
33+
with:
34+
fetch-depth: 0 # Need full history for turbo-ignore
35+
36+
- name: 🔍 Check for documentation changes
37+
id: changes
38+
run: |
39+
npx turbo-ignore docs
40+
echo "should_build=$?" >> $GITHUB_OUTPUT
41+
continue-on-error: true
42+
43+
- name: ⎔ Setup Node.js
44+
if: steps.changes.outputs.should_build == '1'
45+
uses: actions/setup-node@v4
46+
with:
47+
node-version: 20
48+
cache: 'pnpm'
49+
50+
- name: 📦 Install pnpm
51+
if: steps.changes.outputs.should_build == '1'
52+
uses: pnpm/action-setup@v4
53+
with:
54+
version: 9
55+
56+
- name: 🔧 Setup Pages
57+
if: steps.changes.outputs.should_build == '1'
58+
uses: actions/configure-pages@v4
59+
with:
60+
# Automatically inject basePath in your Next.js configuration file and disable
61+
# server side image optimization (https://nextjs.org/docs/api-reference/next/image#unoptimized).
62+
#
63+
# You may remove this line if you want to manage the configuration yourself.
64+
static_site_generator: next
65+
66+
- name: 📦 Install dependencies
67+
if: steps.changes.outputs.should_build == '1'
68+
run: pnpm install --frozen-lockfile
69+
70+
- name: 🏗 Build packages (required for docs)
71+
if: steps.changes.outputs.should_build == '1'
72+
run: pnpm turbo run build
73+
74+
- name: 📄 Generate Evolution SDK docs
75+
if: steps.changes.outputs.should_build == '1'
76+
run: pnpm turbo run docgen
77+
working-directory: packages/evolution
78+
79+
- name: 📚 Copy Evolution docs to website
80+
if: steps.changes.outputs.should_build == '1'
81+
run: node scripts/copy-evolution-docs.mjs
82+
working-directory: docs
83+
84+
- name: 🏗 Build documentation with Next.js
85+
if: steps.changes.outputs.should_build == '1'
86+
run: pnpm turbo run build
87+
working-directory: docs
88+
89+
- name: 📤 Upload artifact
90+
if: steps.changes.outputs.should_build == '1'
91+
uses: actions/upload-pages-artifact@v3
92+
with:
93+
path: ./docs/out
94+
95+
# Deployment job
96+
deploy:
97+
environment:
98+
name: github-pages
99+
url: ${{ steps.deployment.outputs.page_url }}
100+
runs-on: ubuntu-latest
101+
needs: build
102+
if: needs.build.outputs.should_build == '1' || github.event_name == 'workflow_dispatch'
103+
steps:
104+
- name: 🚀 Deploy to GitHub Pages
105+
id: deployment
106+
uses: actions/deploy-pages@v4

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
concurrency: ${{ github.workflow }}-${{ github.ref }}
9+
10+
jobs:
11+
release:
12+
name: 🚀 Release
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: ⬇️ Checkout repo
16+
uses: actions/checkout@v4
17+
with:
18+
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
19+
fetch-depth: 0
20+
21+
- name: ⎔ Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: 'pnpm'
26+
registry-url: 'https://registry.npmjs.org/'
27+
28+
- name: 📦 Install pnpm
29+
uses: pnpm/action-setup@v4
30+
with:
31+
version: 9
32+
33+
- name: 📦 Install dependencies
34+
run: pnpm install --frozen-lockfile
35+
36+
- name: 🏗 Build packages
37+
run: pnpm turbo run build
38+
39+
- name: 🧪 Run tests
40+
run: pnpm turbo run test
41+
42+
- name: 📄 Generate docs
43+
run: pnpm turbo run docgen || echo "No docgen script found, skipping"
44+
45+
- name: 🦋 Create Release Pull Request or Publish to npm
46+
id: changesets
47+
uses: changesets/action@v1
48+
with:
49+
# This uses our custom publish script that builds before publishing
50+
publish: pnpm changeset-publish
51+
title: "ci(changesets): version packages"
52+
commit: "ci(changesets): version packages"
53+
createGithubReleases: true
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
57+
58+
- name: 📢 Send a Slack notification if a publish happened
59+
if: steps.changesets.outputs.published == 'true'
60+
# You can do something when a publish happens.
61+
run: echo "A new version of Evolution SDK was published!"

0 commit comments

Comments
 (0)