Repository navigation
feat(cli): add programmatic JS/TS SDK and Rust library API - #149
Merged
Merged
Conversation
| } | ||
| } | ||
|
|
||
| fn run() -> Result<Outcome, CliError> { |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Expose programmatic APIs for both JavaScript/TypeScript (dual ESM + CJS +
.d.tsinsidenpm/codeint) and Rust (crates/cli/src/lib.rs), with structured outcomes for Budget/Regression failures (exit1) and typedCodeintErroron operational errors (exit2), plus documentation indocs/programmatic.md.Closes #146
Closes #147
Closes #148
Tier
Tier 2 from the tier check: new Rust library surface in
crates/cli/src/lib.rs, new dual ESM/CJS/TypeScript exports innpm/codeint, automated Rust and Node.js tests, and documentation indocs/programmatic.md.Task
Spec #146 (Tickets #147 & #148):
check,diff,trend,init,CheckOptions,DiffOptions,TrendOptions,CheckOutcome,DiffOutcome, andCodeintErrorfromcrates/cli/src/lib.rswithcrates/cli/src/main.rsdelegating torun_cli()crates/cli/tests/sdk.rsresolveBinary()intonpm/codeint/lib/binary.cjsshared bybin/codeint.jsandlib/index.cjslib/index.mjs), CommonJS (lib/index.cjs), and TypeScript types (lib/index.d.ts) vianpm/codeint/package.jsonexportsnpm/codeint/test/sdk.test.mjsverifying ESM, CJS,check,diff,trend,init, exit1vs exit2docs/programmatic.mdand link it fromREADME.mdanddocs/reference.mdFail-first test
crates/cli/tests/sdk.rs::rust_sdk_supports_init_check_diff_trend_and_budget_failuresandnpm/codeint/test/sdk.test.mjscodeint-clinornpm/codeintexported a programmatic APIChecks
cargo test --locked --package codeint-cli --test sdk --test referenceCODEINT_BIN=./target/debug/codeint node --test npm/codeint/test/sdk.test.mjscargo clippy --workspace --all-targets --locked -- -D warningscargo xtask merged-result./target/release/codeint diff origin/mainlefthookpre-commit hooksSafety proof
#![forbid(unsafe_code)].crates/cli/tests/sdk.rsandnpm/codeint/test/sdk.test.mjsran realinit,check,diff,trend, exit1, and exit2flows against temporary Git repositories.interrogate: none run below Tier 3.Runtime evidence
Verified both the Rust library (
crates/cli/tests/sdk.rs) and Node.js ESM/CJS SDK (npm/codeint/test/sdk.test.mjs) end-to-end against real Git repositories.Gaps
publish = falseuntil explicitly requested