Skip to content

chore: Setup sdk infra#11

Merged
adnanrhussain merged 10 commits intoahussain/sdk_typescriptfrom
ahussain/sdk_2_infra
Mar 2, 2026
Merged

chore: Setup sdk infra#11
adnanrhussain merged 10 commits intoahussain/sdk_typescriptfrom
ahussain/sdk_2_infra

Conversation

@adnanrhussain
Copy link
Contributor

@adnanrhussain adnanrhussain commented Feb 6, 2026

Summary

This PR sets up the basic infra for a TypeScript SDK.

Key Changes:

  • Setup TypeScript / NodeJS package + infra files
  • Setup a sdks/typescript/scripts/copy-prompts.js to copy the prompt text files from evals/prompts to the src & dist folders

Documentation

TODO: Update README in a downstream PR

Testing

  • Included new CI workflow should build successfully

SDK Feature PR Index

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR establishes the foundational infrastructure for a TypeScript SDK that will provide educational text complexity evaluators. It's part of a larger effort (PRs #10-14) to build a complete SDK, with PR #10 having extracted prompts to text files and subsequent PRs implementing specific evaluators.

Changes:

  • Set up TypeScript/Node.js package with build tooling (tsup, vitest, eslint)
  • Created a dynamic prompt copying script that syncs .txt files from evals/prompts to SDK directories
  • Configured comprehensive testing infrastructure with unit and integration test support
  • Added CI workflow for automated testing, linting, and coverage reporting

Reviewed changes

Copilot reviewed 14 out of 15 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
package.json Package configuration with dependencies, scripts, and metadata
tsconfig.json TypeScript compiler configuration for ES2022/ESNext
tsup.config.ts Build configuration with hardcoded prompt file copying
vitest.config.ts Unit test configuration with v8 coverage
vitest.ci.config.ts CI test configuration with hardcoded evaluator aliases
scripts/copy-prompts.js Dynamic script to copy prompt .txt files for development
tests/unit/scripts/copy-prompts.test.ts Unit tests for the copy-prompts script
.eslintrc.json ESLint configuration for TypeScript
.gitignore Ignore patterns for build artifacts and dependencies
.env.example Example environment variables for API keys
LICENSE Dual licensing (MIT for code, CC BY 4.0 for content)
README.md Minimal placeholder documentation
src/index.ts Empty entry point placeholder
.github/workflows/test-sdk-typescript.yml CI pipeline with testing and coverage

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -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

const sourcePromptsDir = join(__dirname, '../../evals/prompts');
const destPromptsDir = join(__dirname, 'dist/prompts');

// Create directory structure
Copy link

Choose a reason for hiding this comment

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

Why are we creating this organizational structure in the SDK and not in the parent project? Won't other SDKs need to recreate this logic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed its not ideal. The source prompts in PR#10 are organized above the SDKs, but each SDK needs prompts as part of its own build/dist. Moving the logic to a shared location is a worthwhile optimization but scoped to a future PR.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

@czi-fsisenda czi-fsisenda left a comment

Choose a reason for hiding this comment

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

Looks good! You might have already addressed some of the comments from our conversations.

Choose a reason for hiding this comment

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

We'll copy new files and overwrite existing files, but we won't delete files that are removed from prompts.

Choose a reason for hiding this comment

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

We should add a CI step that ensures that src/prompts matches ../../evals/prompts

Choose a reason for hiding this comment

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

As I look through this, this seems like part of a build step, but it is used as a separate action.
Would it be easier to just have build step include rm -f src/prompts && cp -R ../../evals/prompts src/prompts or something like that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@czi-fsisenda - I removed the whole copy-prompts logic, and instead just import the text files are typed resources

Choose a reason for hiding this comment

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

This makes me think we should use the package as the end consumer would use it rather than test source directly. So test the packaged SDK with some test app and see that required config is loaded as expected and we get the expected result.
We could test the packaged version separately, but then testing source would be redundant?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the .env file is only used for local integration tests. I'll think through this and handle it in a downstream PR

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 14 changed files in this pull request and generated 6 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.
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.
Copy link

@czi-fsisenda czi-fsisenda left a comment

Choose a reason for hiding this comment

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

🚀

@adnanrhussain adnanrhussain force-pushed the ahussain/sdk_1_prompts branch from ad3614d to 2b4ef17 Compare March 2, 2026 18:38
Base automatically changed from ahussain/sdk_1_prompts to ahussain/sdk_typescript March 2, 2026 18:39
@adnanrhussain adnanrhussain force-pushed the ahussain/sdk_2_infra branch from 3f727ff to 181d7dc Compare March 2, 2026 18:42
@adnanrhussain adnanrhussain force-pushed the ahussain/sdk_2_infra branch from 15a4c50 to ab29225 Compare March 2, 2026 19:13
@adnanrhussain adnanrhussain merged commit cad8ca4 into ahussain/sdk_typescript Mar 2, 2026
9 checks passed
@adnanrhussain adnanrhussain deleted the ahussain/sdk_2_infra branch March 2, 2026 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants