Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RNW CLI to preserve and re-use init-windows arguments #13988

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jonthysell
Copy link
Contributor

@jonthysell jonthysell commented Oct 16, 2024

Description

This PR updates the RNW CLI to preserve and re-use the arguments passed to init-windows when the project was created.

Type of Change

Erase all that don't apply.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • This change requires a documentation update

Why

The RNW CLI should be smart enough to change its command's behaviors based on the template used by the project.

Closes #13927

What

  1. The init-windows command will now stamp the template, name, and namespace arguments to the project's package.json file as follows:
    {
      "react-native-windows": {
        "init-windows": {
          "name": "testcli",
          "namespace": "testcli",
          "template": "cpp-app",
        },
      },
    }
  2. The config command (and therefore all other CLI commands) will now contain the contents of this new react-native-windows section in a new rnwConfig property.
  3. If the template file is missing (as it will be for all previously created projects) the config command will try to determine which template to use

Screenshots

N/A

Testing

Verified new projects contain the new information.

Changelog

Should this change be included in the release notes: yes

Update RNW CLI to preserve and re-use init-windows arguments

Microsoft Reviewers: Open in CodeFlow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

init-windows should stamp the name of the template used into the app.json
1 participant