Skip to content

Commit 32f7299

Browse files
committed
initial commit
0 parents  commit 32f7299

69 files changed

Lines changed: 6841 additions & 0 deletions

Some content is hidden

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

.github/workflows/client-ci.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Client CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'packages/**'
8+
pull_request:
9+
paths:
10+
- 'packages/**'
11+
12+
jobs:
13+
test:
14+
name: Test & Build (Node ${{ matrix.node }})
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
node: ['18', '20', '22']
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- uses: pnpm/action-setup@v3
24+
with:
25+
version: 9
26+
27+
- uses: actions/setup-node@v4
28+
with:
29+
node-version: ${{ matrix.node }}
30+
cache: pnpm
31+
32+
- name: Install dependencies
33+
run: pnpm install --frozen-lockfile
34+
35+
- name: Build @nightshift/schema
36+
run: pnpm --filter @nightshift/schema build
37+
38+
- name: Build @nightshift/client (enforces 5kb size limit)
39+
run: pnpm --filter @nightshift/client build
40+
41+
- name: Test @nightshift/client
42+
run: pnpm --filter @nightshift/client test --coverage
43+
44+
- name: Typecheck
45+
run: pnpm --filter @nightshift/client typecheck

.github/workflows/edge-ci.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: Edge CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths:
7+
- 'crates/**'
8+
- 'Cargo.toml'
9+
- 'Cargo.lock'
10+
pull_request:
11+
paths:
12+
- 'crates/**'
13+
- 'Cargo.toml'
14+
- 'Cargo.lock'
15+
16+
env:
17+
CARGO_TERM_COLOR: always
18+
RUST_BACKTRACE: 1
19+
20+
jobs:
21+
test:
22+
name: Test (Rust stable)
23+
runs-on: ubuntu-latest
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- uses: dtolnay/rust-toolchain@stable
29+
with:
30+
components: rustfmt, clippy
31+
32+
- uses: Swatinem/rust-cache@v2
33+
34+
- name: Format check
35+
run: cargo fmt --check
36+
37+
- name: Clippy
38+
run: cargo clippy -p nightshift-core -p nightshift-adapters -p nightshift-server -- -D warnings
39+
40+
- name: Test
41+
run: cargo test -p nightshift-core -p nightshift-adapters -p nightshift-server
42+
43+
wasm-check:
44+
name: WASM build check (worker-rs)
45+
runs-on: ubuntu-latest
46+
47+
steps:
48+
- uses: actions/checkout@v4
49+
50+
- uses: dtolnay/rust-toolchain@stable
51+
with:
52+
targets: wasm32-unknown-unknown
53+
54+
- uses: Swatinem/rust-cache@v2
55+
56+
- name: Check nightshift-worker compiles for wasm32
57+
run: cargo check -p nightshift-worker --target wasm32-unknown-unknown

.github/workflows/release.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*.*.*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
publish-npm:
13+
name: Publish to npm
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v4
17+
18+
- uses: pnpm/action-setup@v3
19+
with:
20+
version: 9
21+
22+
- uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
registry-url: 'https://registry.npmjs.org'
26+
cache: pnpm
27+
28+
- run: pnpm install --frozen-lockfile
29+
30+
- name: Build schema (must publish before client)
31+
run: pnpm --filter @nightshift/schema build
32+
33+
- name: Publish @nightshift/schema
34+
run: pnpm --filter @nightshift/schema publish --no-git-checks --access public
35+
env:
36+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
37+
38+
- name: Build client
39+
run: pnpm --filter @nightshift/client build
40+
41+
- name: Publish @nightshift/client
42+
run: pnpm --filter @nightshift/client publish --no-git-checks --access public
43+
env:
44+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
45+
46+
build-server-binary:
47+
name: Build nightshift-server binary
48+
runs-on: ubuntu-latest
49+
steps:
50+
- uses: actions/checkout@v4
51+
52+
- uses: dtolnay/rust-toolchain@stable
53+
54+
- uses: Swatinem/rust-cache@v2
55+
56+
- name: Build release binary
57+
run: cargo build -p nightshift-server --release
58+
59+
- name: Upload binary artifact
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: nightshift-server-linux-amd64
63+
path: target/release/nightshift-server
64+
65+
github-release:
66+
name: Create GitHub Release
67+
runs-on: ubuntu-latest
68+
needs: [publish-npm, build-server-binary]
69+
steps:
70+
- uses: actions/checkout@v4
71+
72+
- uses: actions/download-artifact@v4
73+
with:
74+
name: nightshift-server-linux-amd64
75+
path: ./artifacts
76+
77+
- name: Create Release
78+
uses: softprops/action-gh-release@v2
79+
with:
80+
files: ./artifacts/nightshift-server
81+
generate_release_notes: true

.gitignore

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Rust
2+
/target/
3+
Cargo.lock
4+
5+
# Node
6+
node_modules/
7+
.pnpm-store/
8+
9+
# Build outputs
10+
dist/
11+
.next/
12+
out/
13+
14+
# Turbo
15+
.turbo/
16+
17+
# Environment
18+
.env.local
19+
.env.*.local
20+
!.env.local.example
21+
22+
# OS
23+
.DS_Store
24+
Thumbs.db
25+
26+
# Editor
27+
.vscode/
28+
.idea/
29+
*.swp
30+
*.swo
31+
32+
# Coverage
33+
coverage/
34+
lcov.info
35+
36+
# Wrangler
37+
.wrangler/
38+
worker-build/

Cargo.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
[workspace]
2+
members = [
3+
"crates/nightshift-core",
4+
"crates/nightshift-adapters",
5+
"crates/nightshift-worker",
6+
"crates/nightshift-vercel",
7+
"crates/nightshift-server",
8+
]
9+
resolver = "2"
10+
11+
[workspace.dependencies]
12+
serde = { version = "1", features = ["derive"] }
13+
serde_json = "1"
14+
tokio = { version = "1", features = ["full"] }
15+
axum = { version = "0.7", features = ["macros"] }
16+
tower = "0.5"
17+
tower-http = { version = "0.6", features = ["cors", "trace"] }
18+
thiserror = "2"
19+
async-trait = "0.1"
20+
tracing = "0.1"
21+
tracing-subscriber = { version = "0.3", features = ["env-filter", "json"] }
22+
once_cell = "1"
23+
regex = "1"
24+
uuid = { version = "1", features = ["v4"] }
25+
futures = "0.3"
26+
27+
# HTTP client — feature-gated per target
28+
reqwest = { version = "0.12", features = ["json"] }
29+
30+
# Test deps
31+
httpmock = "0.7"
32+
tokio-test = "0.4"

0 commit comments

Comments
 (0)