Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
17864b1
Initial plan
Copilot Sep 5, 2025
c9e1eea
Add setup-module-windows command with cpp-app template support
Copilot Sep 5, 2025
645a1f7
Add comprehensive documentation for setup-module-windows command
Copilot Sep 5, 2025
7685aaa
Export setupModuleWindowsInternal from CLI index.ts
Copilot Sep 5, 2025
3f6616a
Remove .xaml files from cpp-app template documentation
Copilot Sep 5, 2025
fda336c
Fix yarn and yarn build issues
Copilot Sep 5, 2025
347f68a
Refactor setupModuleWindows.ts by extracting functions into separate …
Copilot Sep 5, 2025
328517a
Revert vnext/codegen changes and restore beachball-config engines req…
Copilot Sep 5, 2025
aa06852
Fix TypeScript compilation errors in setupModuleWindows command
Copilot Sep 5, 2025
3673b03
Add logic to parse nativemodulespec.g.h files and fix path reporting …
Copilot Sep 5, 2025
ca76aee
Reorganize utils into subdirectory and add hello world method to gene…
Copilot Sep 5, 2025
9d67ee3
Remove all changes in vnext/codegen directory
Copilot Sep 5, 2025
8c0753e
Fix init-windows multiple execution issue by handling problematic exa…
Copilot Sep 5, 2025
02639e3
Set overwrite flag to true for init-windows in setup-module-windows c…
Copilot Sep 5, 2025
45c45b9
Fix fs.exists import pattern in setup-module-windows to use ES6 imports
Copilot Sep 5, 2025
56fcf71
Complete import consistency fixes in setup-module-windows utils
Copilot Sep 5, 2025
08eb305
Fix TypeScript compilation errors in setupModuleWindows test mocks
Copilot Sep 5, 2025
32ee87a
Improve stub function generation with proper callback signatures and …
Copilot Sep 5, 2025
60b0cc3
Remove all changes in vnext/codegen directory as requested
Copilot Sep 5, 2025
c1469af
Remove cleaning and installing dependencies step from setup-module-wi…
Copilot Sep 5, 2025
dd13b19
Fix codegen directory detection and module name display in setup-modu…
Copilot Sep 5, 2025
e214378
Change files
anupriya13 Sep 5, 2025
473a6d5
Remove unused skipDeps and skipBuild parameters and fix formatting
Copilot Sep 5, 2025
6dfe853
lint fixes
anupriya13 Sep 5, 2025
fb908eb
Update documentation to remove skip-deps and skip-build options and r…
Copilot Sep 5, 2025
d321494
Fix multiple init-windows logging by preventing spinner conflicts and…
Copilot Sep 5, 2025
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add setup-module-windows command with cpp-app template support",
"packageName": "@react-native-windows/cli",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"type": "prerelease",
"comment": "Add setup-module-windows command with cpp-app template support",
"packageName": "@react-native-windows/telemetry",
"email": "[email protected]",
"dependentChangeType": "patch"
}
Original file line number Diff line number Diff line change
Expand Up @@ -260,58 +260,73 @@ export async function codegenWindowsInternal(
args: string[],
config: Config,
options: CodeGenOptions,
existingSpinner?: Ora,
) {
const startTime = performance.now();
const spinner = newSpinner(
options.check
? 'Checking codegen-windows files...'
: 'Running codegen-windows...',
);
const spinner =
existingSpinner ||
newSpinner(
options.check
? 'Checking codegen-windows files...'
: 'Running codegen-windows...',
);
const shouldLog = !existingSpinner; // Only log completion messages if we created our own spinner

try {
const codegen = new CodeGenWindows(config.root, options);
await codegen.run(spinner);
const endTime = performance.now();

if (!codegen.areChangesNeeded()) {
console.log(
`${chalk.green(
'Success:',
)} No codegen-windows changes necessary. (${Math.round(
endTime - startTime,
)}ms)`,
);
if (shouldLog) {
console.log(
`${chalk.green(
'Success:',
)} No codegen-windows changes necessary. (${Math.round(
endTime - startTime,
)}ms)`,
);
}
} else if (options.check) {
const codegenCommand = 'npx @react-native-community/cli codegen-windows';
console.log(
`${chalk.yellow(
'Warning:',
)} Codegen-windows changes were necessary but ${chalk.bold(
'--check',
)} specified. Run '${chalk.bold(
`${codegenCommand}`,
)}' to apply the changes. (${Math.round(endTime - startTime)}ms)`,
);
if (shouldLog) {
console.log(
`${chalk.yellow(
'Warning:',
)} Codegen-windows changes were necessary but ${chalk.bold(
'--check',
)} specified. Run '${chalk.bold(
`${codegenCommand}`,
)}' to apply the changes. (${Math.round(endTime - startTime)}ms)`,
);
}
throw new CodedError(
'NeedCodegen',
`Codegen-windows changes were necessary but --check was specified. Run '${codegenCommand}' to apply the changes`,
);
} else {
if (shouldLog) {
console.log(
`${chalk.green(
'Success:',
)} Codegen-windows changes completed. (${Math.round(
endTime - startTime,
)}ms)`,
);
}
}
} catch (e) {
if (!existingSpinner) {
spinner.fail();
}
const endTime = performance.now();
if (shouldLog) {
console.log(
`${chalk.green(
'Success:',
)} Codegen-windows changes completed. (${Math.round(
`${chalk.red('Error:')} ${(e as any).toString()}. (${Math.round(
endTime - startTime,
)}ms)`,
);
}
} catch (e) {
spinner.fail();
const endTime = performance.now();
console.log(
`${chalk.red('Error:')} ${(e as any).toString()}. (${Math.round(
endTime - startTime,
)}ms)`,
);
throw e;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,32 +372,42 @@ async function initWindows(
* @param args Unprocessed args passed from react-native CLI.
* @param config Config passed from react-native CLI.
* @param options Options passed from react-native CLI.
* @param existingSpinner Optional existing spinner to use instead of creating a new one.
*/
export async function initWindowsInternal(
args: string[],
config: Config,
options: InitOptions,
existingSpinner?: Ora,
) {
const startTime = performance.now();
const spinner = newSpinner('Running init-windows...');
const spinner = existingSpinner || newSpinner('Running init-windows...');
const shouldLog = !existingSpinner; // Only log completion messages if we created our own spinner

try {
const codegen = new InitWindows(config, options);
await codegen.run(spinner);
const endTime = performance.now();

console.log(
`${chalk.green('Success:')} init-windows completed. (${Math.round(
endTime - startTime,
)}ms)`,
);
if (shouldLog) {
console.log(
`${chalk.green('Success:')} init-windows completed. (${Math.round(
endTime - startTime,
)}ms)`,
);
}
} catch (e) {
spinner.fail();
if (!existingSpinner) {
spinner.fail();
}
const endTime = performance.now();
console.log(
`${chalk.red('Error:')} ${(e as any).toString()}. (${Math.round(
endTime - startTime,
)}ms)`,
);
if (shouldLog) {
console.log(
`${chalk.red('Error:')} ${(e as any).toString()}. (${Math.round(
endTime - startTime,
)}ms)`,
);
}
throw e;
}
}
Expand Down
Loading
Loading