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
173 changes: 173 additions & 0 deletions .github/workflows/test-sdk-typescript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,173 @@
name: 🏗️ Test TypeScript SDK

on:
push:
branches:
- main
paths:
- 'sdks/typescript/**'
- 'evals/prompts/**'
- '.github/workflows/test-sdk-typescript.yml'
pull_request:
paths:
- 'sdks/typescript/**'
- 'evals/prompts/**'
- '.github/workflows/test-sdk-typescript.yml'

jobs:
lint:
name: 👖 Lint
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/typescript
steps:
- name: ⛔ Cancel previous runs
uses: styfle/cancel-workflow-action@0.13.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v6

- name: 😻 Setup Node.js 22
uses: actions/setup-node@v6
with:
node-version: 22

- name: 📥 Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: sdks/typescript

- name: 👖 Run linter
run: npm run lint

typecheck:
name: 🔎 TypeScript
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/typescript
steps:
- name: ⛔ Cancel previous runs
uses: styfle/cancel-workflow-action@0.13.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v6

- name: 😻 Setup Node.js 22
uses: actions/setup-node@v6
with:
node-version: 22

- name: 📥 Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: sdks/typescript

- name: 🔎 Type check
run: npm run typecheck

test:
name: ⚡ Unit Tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/typescript
strategy:
matrix:
node-version: ['20.19.0', '22', '24']
steps:
- name: ⛔ Cancel previous runs
uses: styfle/cancel-workflow-action@0.13.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v6

- name: 😻 Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

- name: 📥 Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: sdks/typescript

- name: ⚡ Run unit tests
run: npm run test:unit

build:
name: 🏗️ Build (Node ${{ matrix.node-version }})
needs: [lint, typecheck, test]
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/typescript
strategy:
matrix:
node-version: ['20.19.0', '22', '24']
steps:
- name: ⛔ Cancel previous runs
uses: styfle/cancel-workflow-action@0.13.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v6

- name: 😻 Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}

- name: 📥 Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: sdks/typescript

- name: 🏗️ Build package
run: npm run build

# Temporarily disabled - integration tests take too long in CI
# - name: ⚡ Run integration tests (against dist/)
# if: github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository
# env:
# RUN_INTEGRATION_TESTS: true
# OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
# run: npm run test:integration:dist

coverage:
name: 📊 Coverage
needs: [build]
runs-on: ubuntu-latest
defaults:
run:
working-directory: sdks/typescript
steps:
- name: ⛔ Cancel previous runs
uses: styfle/cancel-workflow-action@0.13.0

- name: ⬇️ Checkout repo
uses: actions/checkout@v6

- name: 😻 Setup Node.js 22
uses: actions/setup-node@v6
with:
node-version: 22

- name: 📥 Install dependencies
uses: bahmutov/npm-install@v1
with:
working-directory: sdks/typescript

- name: 📊 Generate coverage report
run: npm run test:coverage
continue-on-error: true

- name: 📁 Upload coverage to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./sdks/typescript/coverage/coverage-final.json
flags: typescript-sdk
name: typescript-sdk-coverage
continue-on-error: true
20 changes: 20 additions & 0 deletions sdks/typescript/.env.test.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# =============================================================================
# FOR SDK CONTRIBUTORS ONLY — Running integration tests locally
# =============================================================================
# This file is NOT needed to use the SDK. The SDK requires all configuration
# (model, API keys, etc.) to be passed in explicitly by the consumer.
#
# To run integration tests locally:
# 1. Copy this file to .env.test.local
# 2. Fill in the API keys below
# 3. Run: npm run test:integration
# =============================================================================

# OpenAI API Key — https://platform.openai.com/api-keys
# OPENAI_API_KEY=

# Google API Key (for Gemini) — https://makersuite.google.com/app/apikey
# GOOGLE_API_KEY=

# Anthropic API Key — https://console.anthropic.com/
# ANTHROPIC_API_KEY=
23 changes: 23 additions & 0 deletions sdks/typescript/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
},
plugins: ['@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'off',
},
env: {
node: true,
es2022: true,
},
};
37 changes: 37 additions & 0 deletions sdks/typescript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Dependencies
node_modules/
.pnp
.pnp.js

# Build output
dist/
build/
*.tsbuildinfo

# Testing
coverage/
.nyc_output/

# Environment variables
.env
.env.local
.env.*.local

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# OS
.DS_Store
Thumbs.db

# Logs
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
1 change: 1 addition & 0 deletions sdks/typescript/.nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
22
12 changes: 12 additions & 0 deletions sdks/typescript/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
The Evaluator code is licensed under [MIT](https://opensource.org/license/mit).
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the same license as the monorepo? It's unfortunate that we have to copy it into each SDK.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes and Yes. But I will still have it double-checked by Trust, just to make sure this is how it should be for sub-projects


Evaluators content (including the prompt and settings information) is provided by Learning Commons under the CC BY 4.0 International license ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.en)).

Annotated CLEAR Corpus is provided by Learning Commons (including annotations and enhancements) under CC BY-NC-SA 4.0 ([CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en)). The original dataset from CLEAR Corpus can be found at [The CLEAR Corpus by CommonLit](https://www.commonlit.org/blog/introducing-the-clear-corpus-an-open-dataset-to-advance-research-28ff8cfea84a/) licensed under CC BY-NC-SA 4.0.

**How to Cite the Evaluator Code:**
Learning Commons (2025). Evaluators. GitHub. [https://github.com/learning-commons-org/evaluators](https://github.com/learning-commons-org/evaluators).
Licensed under MIT.
Comment on lines +1 to +9
Copy link

Copilot AI Feb 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package.json sets license to "MIT", but this LICENSE file is a custom notice with links and citation text rather than the standard MIT license text. This can create licensing/compliance ambiguity for package consumers and tooling. Either include the full MIT license text here (and move notices/citation to a separate NOTICE/ATTRIBUTION file), or adjust package.json to reflect the actual licensing of the published artifact.

Suggested change
The Evaluator code is licensed under [MIT](https://opensource.org/license/mit).
Evaluators content (including the prompt and settings information) is provided by Learning Commons under the CC BY 4.0 International license ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.en)).
Annotated CLEAR Corpus is provided by Learning Commons (including annotations and enhancements) under CC BY-NC-SA 4.0 ([CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en)). The original dataset from CLEAR Corpus can be found at [The CLEAR Corpus by CommonLit](https://www.commonlit.org/blog/introducing-the-clear-corpus-an-open-dataset-to-advance-research-28ff8cfea84a/) licensed under CC BY-NC-SA 4.0.
**How to Cite the Evaluator Code:**
Learning Commons (2025). Evaluators. GitHub. [https://github.com/learning-commons-org/evaluators](https://github.com/learning-commons-org/evaluators).
Licensed under MIT.
MIT License
Copyright (c) 2025 Learning Commons
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
---
Additional Notices
==================
The Evaluator code is licensed under the MIT License set out above.
Evaluators content (including the prompt and settings information) is provided by Learning Commons under the CC BY 4.0 International license ([CC BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.en)).
Annotated CLEAR Corpus is provided by Learning Commons (including annotations and enhancements) under CC BY-NC-SA 4.0 ([CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.en)). The original dataset from CLEAR Corpus can be found at [The CLEAR Corpus by CommonLit](https://www.commonlit.org/blog/introducing-the-clear-corpus-an-open-dataset-to-advance-research-28ff8cfea84a/) licensed under CC BY-NC-SA 4.0.
**How to Cite the Evaluator Code:**
Learning Commons (2025). Evaluators. GitHub. [https://github.com/learning-commons-org/evaluators](https://github.com/learning-commons-org/evaluators).
Licensed under the MIT License.

Copilot uses AI. Check for mistakes.

**How to Cite the Evaluator:**
Learning Commons. (2025). Evaluators content (including the prompt and settings information) is available at GitHub. [https://github.com/learning-commons-org/evaluators](https://github.com/learning-commons-org/evaluators) Licensed under [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/deed.en)
1 change: 1 addition & 0 deletions sdks/typescript/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @learning-commons/evaluators
Loading