Skip to content

Commit 8769d7e

Browse files
authored
Merge remote-tracking branch 'origin/copilot/autoloop-build-tsb-pandas-migration' into copilot/fix-ci-errors
Co-authored-by: mrjf <180956+mrjf@users.noreply.github.com>
2 parents afe1a0a + ff64eb3 commit 8769d7e

22 files changed

Lines changed: 2325 additions & 9 deletions

.github/workflows/ci.yml

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

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
dist/
3+
*.tsbuildinfo
4+
package-lock.json
5+
*.tgz

.vscode/mcp.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
"servers": {
33
"github-agentic-workflows": {
44
"command": "gh",
5-
"args": [
6-
"aw",
7-
"mcp-server"
8-
]
5+
"args": ["aw", "mcp-server"]
96
}
107
}
11-
}
8+
}

.vscode/settings.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"github.copilot.enable": {
3-
"markdown": true
4-
}
5-
}
2+
"github.copilot.enable": {
3+
"markdown": true
4+
}
5+
}

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: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
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+
"noBarrelFile": "off"
34+
},
35+
"security": {
36+
"all": true
37+
},
38+
"style": {
39+
"all": true,
40+
"noDefaultExport": "off",
41+
"useNamingConvention": "off"
42+
},
43+
"suspicious": {
44+
"all": true
45+
}
46+
}
47+
},
48+
"javascript": {
49+
"formatter": {
50+
"quoteStyle": "double",
51+
"trailingCommas": "all",
52+
"semicolons": "always"
53+
}
54+
},
55+
"overrides": [
56+
{
57+
"include": ["**/*.ts", "**/*.tsx"],
58+
"javascript": {
59+
"formatter": {
60+
"quoteStyle": "double",
61+
"trailingCommas": "all",
62+
"semicolons": "always"
63+
}
64+
}
65+
}
66+
]
67+
}

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)