Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/cmake-rn/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@commander-js/extra-typings": "^13.1.0",
"bufout": "^0.3.1",
"bufout": "^0.3.2",
"chalk": "^5.4.1",
"cmake-js": "^7.3.1",
"commander": "^13.1.0",
Expand Down
26 changes: 21 additions & 5 deletions packages/cmake-rn/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ const DEFAULT_NDK_VERSION = "27.1.12297006";

// TODO: Add automatic ccache support

const verboseOption = new Option(
"--verbose",
"Print more output during the build"
).default(process.env.CI === "true");

const sourcePathOption = new Option(
"--source <path>",
"Specify the source directory containing a CMakeLists.txt file"
Expand Down Expand Up @@ -100,6 +105,7 @@ const xcframeworkExtensionOption = new Option(

export const program = new Command("cmake-rn")
.description("Build React Native Node API modules with CMake")
.addOption(verboseOption)
.addOption(sourcePathOption)
.addOption(configurationOption)
.addOption(tripletOption)
Expand Down Expand Up @@ -163,6 +169,7 @@ export const program = new Command("cmake-rn")
// Configure every triplet project
await oraPromise(Promise.all(tripletContext.map(configureProject)), {
text: "Configuring projects",
isSilent: globalContext.verbose,
Copy link
Preview

Copilot AI Jun 19, 2025

Choose a reason for hiding this comment

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

The spinner configuration uses globalContext.verbose while the spawn calls use a locally destructured verbose flag. For consistency and clearer behavior, consider using one source for the verbose flag throughout the file.

Copilot uses AI. Check for mistakes.

successText: "Configured projects",
failText: ({ message }) => `Failed to configure projects: ${message}`,
});
Expand All @@ -182,6 +189,7 @@ export const program = new Command("cmake-rn")
),
{
text: "Building projects",
isSilent: globalContext.verbose,
successText: "Built projects",
failText: ({ message }) => `Failed to build projects: ${message}`,
}
Expand Down Expand Up @@ -365,8 +373,14 @@ function getBuildArgs(triplet: SupportedTriplet) {
}

async function configureProject(context: TripletScopedContext) {
const { triplet, tripletBuildPath, source, ndkVersion, weakNodeApiLinkage } =
context;
const {
verbose,
triplet,
tripletBuildPath,
source,
ndkVersion,
weakNodeApiLinkage,
} = context;
await spawn(
"cmake",
[
Expand All @@ -381,13 +395,14 @@ async function configureProject(context: TripletScopedContext) {
}),
],
{
outputMode: "buffered",
outputMode: verbose ? "inherit" : "buffered",
outputPrefix: verbose ? chalk.dim(`[${triplet}] `) : undefined,
}
);
}

async function buildProject(context: TripletScopedContext) {
const { triplet, tripletBuildPath, configuration } = context;
const { verbose, triplet, tripletBuildPath, configuration } = context;
await spawn(
"cmake",
[
Expand All @@ -399,7 +414,8 @@ async function buildProject(context: TripletScopedContext) {
...getBuildArgs(triplet),
],
{
outputMode: "buffered",
outputMode: verbose ? "inherit" : "buffered",
outputPrefix: verbose ? chalk.dim(`[${triplet}] `) : undefined,
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ferric/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"dependencies": {
"@napi-rs/cli": "3.0.0-alpha.80",
"@commander-js/extra-typings": "^13.1.0",
"bufout": "^0.3.1",
"bufout": "^0.3.2",
"chalk": "^5.4.1",
"commander": "^13.1.0",
"ora": "^8.2.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
"license": "MIT",
"dependencies": {
"@commander-js/extra-typings": "^13.1.0",
"bufout": "^0.3.1",
"bufout": "^0.3.2",
"chalk": "^5.4.1",
"commander": "^13.1.0",
"ora": "^8.2.0",
Expand Down
Loading