Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 72 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI

on:
push:
branches: ["main"]
pull_request:

jobs:
node:
name: Node (pnpm) - lint + ts typecheck + tests
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

# Install pnpm first so setup-node's pnpm cache can run pnpm safely
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9.0.0

- name: Setup Node 20
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"

- name: Show tool versions
run: |
node -v
npm -v
pnpm -v

- name: Install dependencies
run: pnpm install --frozen-lockfile

# Matches your root script: "lint": "pnpm -r lint"
- name: Lint (JS + TS)
run: pnpm lint

# Run TS typecheck explicitly (safer than pnpm -r typecheck if JS has no typecheck script)
- name: Typecheck (TS)
run: pnpm --filter @moltiful/ts typecheck

# Matches your root script: "test": "pnpm -r test && pnpm py:test"
# Here we run only Node tests; Python is handled in the python job.
- name: Tests (JS + TS)
run: pnpm -r test

python:
name: Python - pytest
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python 3.11
uses: actions/setup-python@v5
with:
python-version: "3.11"

- name: Install Python deps (dev)
working-directory: py
run: |
python -m pip install --upgrade pip
pip install -e ".[dev]"

# Matches your root script: "py:test": "cd py && python -m pytest"
- name: Pytest
run: cd py && python -m pytest
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
"lint": "pnpm -r lint",
"format": "pnpm -r format",
"typecheck": "pnpm -r typecheck",

"js:test": "pnpm --filter @moltiful/js test",
"ts:test": "pnpm --filter @moltiful/ts test",
"py:test": "cd py && python -m pytest"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0"
}
}
4 changes: 2 additions & 2 deletions packages/js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"format": "prettier -w src"
},
"devDependencies": {
"eslint": "^9.0.0",
"eslint": "^9.39.2",
"prettier": "^3.0.0",
"vitest": "^2.0.0"
}
}
}
28 changes: 23 additions & 5 deletions packages/ts/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,12 +1,30 @@
import js from "@eslint/js";
import tsParser from "@typescript-eslint/parser";
import tsPlugin from "@typescript-eslint/eslint-plugin";

export default [
// Optional: baseline JS recommended rules (safe even for TS projects)
js.configs.recommended,

{
files: ["src/**/*.ts"],
languageOptions: {
ecmaVersion: 2022,
sourceType: "module"
parser: tsParser, // ✅ THIS IS THE KEY
parserOptions: {
ecmaVersion: 2022,
sourceType: "module",
// If you want type-aware rules later, uncomment:
// project: "./tsconfig.json",
// tsconfigRootDir: import.meta.dirname,
},
},
plugins: {
"@typescript-eslint": tsPlugin,
},
rules: {
"no-unused-vars": "off"
}
}
// Turn off base rule, use TS-aware version if you want
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "off",
},
},
];
11 changes: 7 additions & 4 deletions packages/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
"type": "module",
"scripts": {
"test": "vitest run",
"lint": "eslint src",
"lint": "eslint -c eslint.config.mjs src",
"format": "prettier -w src",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"devDependencies": {
"eslint": "^9.0.0",
"@eslint/js": "^9.39.2",
"@typescript-eslint/eslint-plugin": "^8.54.0",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"prettier": "^3.0.0",
"vitest": "^2.0.0",
"typescript": "^5.4.0"
"typescript": "^5.9.3",
"vitest": "^2.0.0"
}
}
Loading