-
Notifications
You must be signed in to change notification settings - Fork 7
chore: Setup sdk infra #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
98bf33a
4bfd96b
4e191c0
c57712b
03be57d
6366f25
45808c9
ab29225
5c46345
4736a44
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 | ||
| 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= |
| 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, | ||
| }, | ||
| }; |
| 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* |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 22 |
| 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). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| # @learning-commons/evaluators | ||
adnanrhussain marked this conversation as resolved.
Show resolved
Hide resolved
|
||
Uh oh!
There was an error while loading. Please reload this page.