Skip to content

test: type-check README quickstart example - #21

Merged
kriptoburak merged 1 commit into
Xquik-dev:mainfrom
11suixing11:test/readme-quickstart-example
Jul 30, 2026
Merged

test: type-check README quickstart example#21
kriptoburak merged 1 commit into
Xquik-dev:mainfrom
11suixing11:test/readme-quickstart-example

Conversation

@11suixing11

@11suixing11 11suixing11 commented Jul 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • add a compile-only examples/readme-quickstart.ts that mirrors the README client construction and typed tweet-search params
  • keep the example deterministic and offline by not invoking any API method
  • run TypeScript checking from ./scripts/test so examples remain covered by the normal test gate

Fixes #16

Verification

  • npm exec --yes pnpm@11.15.1 -- install --frozen-lockfile
  • ./node_modules/typescript/bin/tsc --project tsconfig.json --noEmit
  • ./scripts/test --runInBand
  • npm exec --yes pnpm@11.15.1 -- run lint
  • npm exec --yes pnpm@11.15.1 -- run check:reproducible
  • git diff --check

Notes

  • The repository requires pnpm@11.15.1; this machine's Corepack pnpm shim fails with ERR_VM_DYNAMIC_IMPORT_CALLBACK_MISSING, so I used npm exec --yes pnpm@11.15.1 -- ... for pnpm-backed commands.
  • No generated SDK files or public contracts were changed.

Note

Add type-checking step to test script and README quickstart example

  • Adds examples/readme-quickstart.ts as a compile-only TypeScript file that mirrors the README quickstart, ensuring the example stays type-correct.
  • Updates scripts/test to run tsc --project tsconfig.json --noEmit before executing tests, so type errors fail the build early.
  • Behavioral Change: the test script will now exit on TypeScript type errors before any tests run.

Macroscope summarized 1bc5f76.

Summary by CodeRabbit

  • Documentation

    • Added a compile-only TypeScript quickstart example showing how to set up the client and define tweet search parameters (without making network requests).
  • Tests

    • Added a TypeScript compile type-check step before running the test suite, to catch type errors earlier.

@11suixing11

Copy link
Copy Markdown
Contributor Author

Thanks for the review. I confirmed the failing lint job is pnpm audit --audit-level high on GHSA-mh99-v99m-4gvg via the existing ESLint/minimatch dependency chain; build and test are green for this branch. I will keep this PR scoped to the README quickstart type-check coverage and update/re-run it after the base dependency remediation lands, rather than mixing an unrelated lockfile/security upgrade into this test PR.

@11suixing11
11suixing11 force-pushed the test/readme-quickstart-example branch from 90f657d to 8637e39 Compare July 29, 2026 04:19
@11suixing11
11suixing11 requested a review from furkanerday as a code owner July 29, 2026 04:19
@11suixing11

11suixing11 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Updated this branch on top of the latest main now that the base audit remediation has landed in #24.

Current head is 8637e39; the previous high-severity audit failure is gone:

  • npm exec --yes pnpm@11.15.1 -- install --frozen-lockfile
  • ./node_modules/typescript/bin/tsc --project tsconfig.json --noEmit
  • ./scripts/test --runInBand
  • npm exec --yes pnpm@11.15.1 -- run lint
  • npm exec --yes pnpm@11.15.1 -- audit --audit-level high -> no known vulnerabilities
  • npm exec --yes pnpm@11.15.1 -- run check:reproducible
  • git diff --check

The GitGuardian and Socket checks on the updated head are green. Ready for re-review.

@furkanerday furkanerday left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

DCO blocker: external contributor commit 8637e39 has no author-matching Signed-off-by trailer, contrary to CONTRIBUTING.md. The contributor must amend and re-push this commit with their own valid sign-off; a later maintainer commit cannot cure it.

@11suixing11
11suixing11 force-pushed the test/readme-quickstart-example branch from 8637e39 to cbed75d Compare July 29, 2026 22:56
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a compile-only TypeScript README quickstart and updates scripts/test to run tsc --noEmit before Jest.

Changes

README quickstart type-checking

Layer / File(s) Summary
Add and validate the offline quickstart
examples/readme-quickstart.ts, scripts/test
The example constructs a typed XTwitterScraper client and tweet search parameters without making network requests. The test script type-checks the project before running Jest.

Estimated code review effort: 2 (Simple) | ~10 minutes

Suggested reviewers: furkanerday

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR adds a compile-only README quickstart example and type-checks it in ./scripts/test without network calls or API key requirements.
Out of Scope Changes check ✅ Passed The changes stay within the linked issue scope and only add the example plus the test-command type check.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately reflects the main change: type-checking the README quickstart example.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@11suixing11

11suixing11 commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Updated the branch again at 1bc5f76.

What changed:

  • rebased the single contributor commit onto current main (e9aa6fa, release 0.7.1)
  • retained the author-matching Signed-off-by: kittydev <108918571+11suixing11@users.noreply.github.com> trailer
  • kept the diff scoped to the compile-only quickstart and existing test entry point

Verification on the updated head:

  • npm exec --yes pnpm@11.15.1 -- install --frozen-lockfile
  • ./node_modules/typescript/bin/tsc --project tsconfig.json --noEmit
  • ./scripts/test --runInBand -> 47 suites / 447 tests passed; 1 suite / 1 test skipped
  • npm exec --yes pnpm@11.15.1 -- run lint
  • npm exec --yes pnpm@11.15.1 -- audit --audit-level high -> no known vulnerabilities
  • npm exec --yes pnpm@11.15.1 -- run check:reproducible
  • git diff --check

The two prior requested changes (base dependency audit and contributor DCO sign-off) remain addressed. Ready for re-review on the current head.

Add a compile-only quickstart example that mirrors the README client setup without sending a request.

Run TypeScript checking from the existing test script so the example stays covered by the normal test gate.

Signed-off-by: kittydev <108918571+11suixing11@users.noreply.github.com>
@11suixing11
11suixing11 force-pushed the test/readme-quickstart-example branch from cbed75d to 1bc5f76 Compare July 30, 2026 14:25
@kriptoburak
kriptoburak merged commit 95b9959 into Xquik-dev:main Jul 30, 2026
10 checks passed
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.

2 participants