Skip to content

Commit 42890fc

Browse files
Iteration 1: Project foundation
Establish complete project scaffold for the tsb TypeScript pandas port: - package.json: tsb package, Bun runtime, Biome + fast-check devDeps - tsconfig.json: strictest TypeScript (strict, noUncheckedIndexedAccess, exactOptionalPropertyTypes) - biome.json: all linting rules enabled, zero-warning policy - bunfig.toml: test coverage enabled, setup preload - src/index.ts: package entry point with planned export structure - src/types.ts: core type foundation (Scalar, Label, Axis, DtypeName, etc.) - tests/setup.ts: global test setup harness - tests/index.test.ts: hello-world smoke tests proving pipeline works - .github/workflows/ci.yml: CI with type-check, lint, test, build - .github/workflows/pages.yml: GitHub Pages deployment pipeline - playground/index.html: feature roadmap landing page - AGENTS.md: project conventions for AI coding agents - CLAUDE.md: Claude Code configuration Metric: pandas_features_ported = 1 (baseline) Run: https://github.com/githubnext/tsessebe/actions/runs/23954278176 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 0a390a9 commit 42890fc

13 files changed

Lines changed: 655 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- "autoloop/**"
8+
pull_request:
9+
branches:
10+
- main
11+
12+
jobs:
13+
test:
14+
name: Test & Lint
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Setup Bun
20+
uses: oven-sh/setup-bun@v2
21+
with:
22+
bun-version: latest
23+
24+
- name: Install dependencies
25+
run: bun install
26+
27+
- name: Type check
28+
run: bun run typecheck
29+
30+
- name: Lint
31+
run: bun run lint
32+
33+
- name: Test
34+
run: bun test --coverage
35+
36+
build:
37+
name: Build
38+
runs-on: ubuntu-latest
39+
needs: test
40+
steps:
41+
- uses: actions/checkout@v4
42+
43+
- name: Setup Bun
44+
uses: oven-sh/setup-bun@v2
45+
with:
46+
bun-version: latest
47+
48+
- name: Install dependencies
49+
run: bun install
50+
51+
- name: Build library
52+
run: bun build ./src/index.ts --outdir ./dist --target browser --minify
53+
54+
- name: Upload dist artifact
55+
uses: actions/upload-artifact@v4
56+
with:
57+
name: dist
58+
path: dist/

.github/workflows/pages.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Deploy Playground to Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: false
17+
18+
jobs:
19+
build:
20+
name: Build Playground
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Setup Bun
26+
uses: oven-sh/setup-bun@v2
27+
with:
28+
bun-version: latest
29+
30+
- name: Install dependencies
31+
run: bun install
32+
33+
- name: Build library for browser
34+
run: bun build ./src/index.ts --outdir ./playground/dist --target browser --minify
35+
36+
- name: Setup Pages
37+
uses: actions/configure-pages@v5
38+
39+
- name: Upload Pages artifact
40+
uses: actions/upload-pages-artifact@v3
41+
with:
42+
path: playground/
43+
44+
deploy:
45+
name: Deploy to Pages
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
runs-on: ubuntu-latest
50+
needs: build
51+
steps:
52+
- name: Deploy to GitHub Pages
53+
id: deployment
54+
uses: actions/deploy-pages@v4

AGENTS.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Agent Instructions (AGENTS.md)
2+
3+
This file provides project-specific conventions for AI coding agents working in this repository.
4+
5+
## Project Overview
6+
7+
**tsb** is a TypeScript port of [pandas](https://pandas.pydata.org/), built from first principles.
8+
- Package name: `tsb` — all imports use `tsb`
9+
- Runtime: Bun
10+
- Language: TypeScript (strictest mode)
11+
12+
## Key Rules
13+
14+
1. **Never modify `README.md`** — it is read-only, the source of truth for project parameters.
15+
2. **Never modify `.autoloop/programs/**`** or autoloop workflow files.
16+
3. **Strict TypeScript only** — no `any`, no `as` casts, no `@ts-ignore`, no escape hatches.
17+
4. **Zero core dependencies** — implement everything from scratch.
18+
5. **100% test coverage** required — unit + property-based (fast-check) + fuzz where applicable.
19+
6. **Every feature gets a playground page** in `playground/`.
20+
7. **One feature per commit** — keep changes small and targeted.
21+
22+
## Project Structure
23+
24+
```
25+
src/
26+
index.ts — package entry point, re-exports all features
27+
types.ts — shared type definitions
28+
core/ — core data structures (Series, DataFrame, Index, Dtype)
29+
io/ — I/O utilities (read_csv, read_json, etc.)
30+
groupby/ — groupby and aggregation
31+
reshape/ — pivot, melt, stack, unstack
32+
merge/ — merge, join, concat
33+
window/ — rolling, expanding, ewm
34+
stats/ — statistical functions
35+
tests/
36+
setup.ts — global test setup (loaded via bunfig.toml)
37+
*.test.ts — mirrors src/ structure
38+
playground/
39+
index.html — landing page
40+
*.html — one page per feature
41+
```
42+
43+
## Adding a New Feature
44+
45+
1. Create `src/{module}/{feature}.ts` with the implementation.
46+
2. Export from `src/index.ts`.
47+
3. Create `tests/{module}/{feature}.test.ts` with full coverage.
48+
4. Create `playground/{feature}.html` with an interactive tutorial.
49+
5. Update `playground/index.html` to mark the feature as complete.
50+
51+
## Running Locally
52+
53+
```bash
54+
bun install # install devDependencies
55+
bun test # run all tests
56+
bun run lint # check linting
57+
bun run typecheck # TypeScript strict check
58+
```
59+
60+
## Autoloop Coordination
61+
62+
This project is built by [Autoloop](https://github.com/githubnext/autoloop), an iterative optimization agent.
63+
- Long-running branch: `autoloop/build-tsb-pandas-typescript-migration`
64+
- State file: `build-tsb-pandas-typescript-migration.md` on `memory/autoloop` branch
65+
- Issue #1 is the program definition — do not modify it.

CLAUDE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
description: Coding preferences for Claude when working on tsb.
3+
---
4+
5+
# Claude Code Configuration (CLAUDE.md)
6+
7+
## Behavior
8+
9+
- Always read `AGENTS.md` first for project conventions.
10+
- Read `README.md` to understand the project requirements — treat it as read-only.
11+
- Read the state file in `.autoloop/memory/` for current migration progress.
12+
13+
## Code Style
14+
15+
- TypeScript strict mode — no `any`, no `as`, no `@ts-ignore`
16+
- Biome formatting (spaces, 100-col lines, double quotes, trailing commas)
17+
- JSDoc for all exported symbols
18+
- Unit tests with `bun:test` + property tests with `fast-check`
19+
20+
## Commands
21+
22+
```bash
23+
bun install # install deps
24+
bun test # run tests
25+
bun run lint # Biome lint
26+
bun run typecheck # tsc --noEmit
27+
```

biome.json

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": ["dist/**", "node_modules/**", "*.d.ts"]
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineWidth": 100
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": true,
22+
"complexity": {
23+
"all": true
24+
},
25+
"correctness": {
26+
"all": true
27+
},
28+
"nursery": {
29+
"all": true
30+
},
31+
"performance": {
32+
"all": true
33+
},
34+
"security": {
35+
"all": true
36+
},
37+
"style": {
38+
"all": true,
39+
"noDefaultExport": "off",
40+
"useNamingConvention": "off"
41+
},
42+
"suspicious": {
43+
"all": true
44+
}
45+
}
46+
},
47+
"javascript": {
48+
"formatter": {
49+
"quoteStyle": "double",
50+
"trailingCommas": "all",
51+
"semicolons": "always"
52+
}
53+
},
54+
"typescript": {
55+
"formatter": {
56+
"quoteStyle": "double",
57+
"trailingCommas": "all",
58+
"semicolons": "always"
59+
}
60+
}
61+
}

bunfig.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[test]
2+
preload = ["./tests/setup.ts"]
3+
coverage = true
4+
5+
[install]
6+
exact = true

package.json

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
{
2+
"name": "tsb",
3+
"version": "0.0.1",
4+
"description": "A TypeScript port of pandas, built from first principles",
5+
"type": "module",
6+
"main": "./src/index.ts",
7+
"module": "./src/index.ts",
8+
"types": "./src/index.ts",
9+
"exports": {
10+
".": {
11+
"import": "./src/index.ts",
12+
"types": "./src/index.ts"
13+
}
14+
},
15+
"scripts": {
16+
"test": "bun test",
17+
"lint": "biome check .",
18+
"lint:fix": "biome check --write .",
19+
"typecheck": "tsc --noEmit",
20+
"build": "bun build ./src/index.ts --outdir ./dist --target browser",
21+
"playground": "bun run playground/serve.ts"
22+
},
23+
"devDependencies": {
24+
"@biomejs/biome": "^1.9.4",
25+
"fast-check": "^3.22.0",
26+
"@types/bun": "^1.1.14"
27+
},
28+
"peerDependencies": {
29+
"typescript": "^5.7.0"
30+
}
31+
}

0 commit comments

Comments
 (0)