Add cmake-file-api package, implementing a TypeScript wrapper of the CMake file-based API#257
Merged
kraenhansen merged 17 commits intomainfrom Sep 28, 2025
Merged
Conversation
kraenhansen
commented
Sep 26, 2025
Comment on lines
+1
to
+17
| { | ||
| "extends": "./tsconfig.node.json", | ||
| "compilerOptions": { | ||
| "composite": true, | ||
| "emitDeclarationOnly": true, | ||
| "declarationMap": false | ||
| }, | ||
| "include": ["${configDir}/src/**/*.test.ts"], | ||
| "exclude": [] | ||
| /* | ||
| "references": [ | ||
| { | ||
| "path": "./tsconfig.json" | ||
| } | ||
| ] | ||
| */ | ||
| } |
Collaborator
Author
There was a problem hiding this comment.
As a drive-by refactor, I'm creating this tsconfig, which I intent to share from other packages of the repo.
kraenhansen
commented
Sep 26, 2025
| @@ -0,0 +1,77 @@ | |||
| # Copilot Instructions for React Native Node-API | |||
Collaborator
Author
There was a problem hiding this comment.
I created this as part of my use of Copilot.
57a5fbf to
898559b
Compare
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.
As part of #254 I wanted to use the CMake file API to read target information - this took me and my Copilot agent down a vibe-coding rabbit hole and this PR serves as proof of what was committed to the repo when I woke up the next morning 🫨
To be clear:
What is this madness?
The CMake File API provides an interface for querying CMake's configuration and project information.
The API is based on files, where queries are written by client tools and read by CMake and replies are then written by CMake and read by client tools. The API is versioned, and the current version is v1 and these files are located in a directory named
.cmake/api/v1in the build directory.This package provides a TypeScript interface to create query files and read replies and is intended to serve the same purpose to the TypeScript community that the
cmake-file-apicrate, serves to the Rust community.Note
Introduce
packages/cmake-file-apiproviding TS schemas and helpers to write CMake queries and read replies, plus repo config updates and VS Code task.packages/cmake-file-apiReplyIndexV1,CodemodelV2,TargetV2(v2.0–2.8),CacheV2,CmakeFilesV1(v1.0–1.1),ToolchainsV1,ConfigureLogV1insrc/schemas/**/*.src/query.ts):createSharedStatelessQuery,createClientStatelessQuery,createClientStatefulQuery.src/reply.ts):findCurrentReplyIndexPath,readReplyIndex,isReplyErrorIndexPath,readReplyErrorIndex,readCodemodel,readCurrentSharedCodemodel,readCurrentTargets,readCurrentTargetsDeep,readTarget,readCache,readCmakeFiles,readToolchains,readConfigureLog.src/index.tsandsrc/schemas.ts.README.md, bundled CMake docs (docs/cmake-file-api.7.rst.txt), extensive tests (src/*.test.ts), packagetsconfig.jsonandtsconfig.tests.json.cmake-file-api(rootpackage.json,tsconfig.json)..vscode/tasks.jsonto runcmake-file-apitests..github/copilot-instructions.md,packages/cmake-file-api/copilot-instructions.md).configs/tsconfig.node-tests.json; broaden includes/excludes inconfigs/tsconfig.node.json;packages/cli-utils/tsconfig.jsonnow extendsconfigs/tsconfig.node.json.package-lock.json) aligning dependent package versions.Written by Cursor Bugbot for commit 61303ee. This will update automatically on new commits. Configure here.