Skip to content

Conversation

@NisargaK-21
Copy link

@NisargaK-21 NisargaK-21 commented Feb 2, 2026

This change fixes incorrect C++ codegen include generation in the cpp-lib init-windows template by using codegenConfig.name from the user library’s package.json as the source of truth.

Previously, the template inferred codegen spec filenames from the project name (pascalName) or attempted to detect generated files on disk. This produced incorrect includes when the project name and codegen module name differed, particularly for scoped packages and during first-time initialization before codegen output exists.

The fix removes spec filename inference and disk scanning logic, reads codegenConfig.name directly from package.json, passes this value into the cpp-lib templates, and updates the generated C++ header to include Native<codegenConfig.name>Spec.g.h. This aligns the template output with how codegen names generated files and makes the behavior deterministic.

This change only affects generated template output and does not modify runtime behavior.

Microsoft Reviewers: Open in CodeFlow

@NisargaK-21 NisargaK-21 requested a review from a team as a code owner February 2, 2026 19:08
@NisargaK-21
Copy link
Author

@microsoft-github-policy-service agree

@vineethkuttan
Copy link
Contributor

/azp run PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vineethkuttan
Copy link
Contributor

vineethkuttan commented Feb 4, 2026

@NisargaK-21
Can you add change files for this?

You have to run yarn change at root of the repo

refer this

@vineethkuttan
Copy link
Contributor

/azp run PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@NisargaK-21
Copy link
Author

I ran yarn format-files at the repo root and git status is clean.
The remaining failures appear to be CI-only (template/prettier/hermes),
since they don’t reproduce locally.
Please let me know if a specific change is needed.

@vineethkuttan
Copy link
Contributor

vineethkuttan commented Feb 4, 2026

I ran yarn format-files at the repo root and git status is clean. The remaining failures appear to be CI-only (template/prettier/hermes), since they don’t reproduce locally. Please let me know if a specific change is needed.

You have to run yarn format at the root of the repo.

Will be mentioned here

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