-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Migrate from react-native-windows-init
to react-native init-windows
for new RNW projects
#11920
Comments
Background context: RNW Init v1RNW Init v1: Basics
RNW Init v1: Package VersioningRNW Init v1: CLI Arguments
¹: If unspecified, calculated based on existing project RN version RNW Init v1: Code Flow |
More background context: The Problems
|
## Description The CLI package has grown since its original `run-windows` focus. This PR refactors every top-level command `run-windows`, `autolink-windows`, and `codegen-windows` into a new commands folder, and breaks out the options for each command into its own file. ### Type of Change - New feature (non-breaking change which adds functionality) ### Why As part of the prep for creating an `init-windows` command (see #11920) I wanted to make it easier and more obvious as to "where" to put new commands for the CLI, without cluttering future PRs. ### What This PR refactors every top-level command `run-windows`, `autolink-windows`, and `codegen-windows` into a new commands folder, and breaks out the options for each command into its own file. ## Screenshots N/A ## Testing Verified tests still run. ## Changelog Should this change be included in the release notes: no
## Description This PR implements a new, named template-based `react-native init-windows` command as described by microsoft#11920. Note, this does not change or deprecate the existing `react-native-windows-init` / `generateWindows` infrastructure or templates. ### Type of Change - New feature (non-breaking change which adds functionality) ### Why This is part of restructuring how users can add RNW support to their RN projects. ### What 1. Creates a new `init-windows` RN CLI command that creates a new windows project based on a given template 2. The first CLI templates under `old/`, which are just wrappers which call the existing templating code in `generateWindows` Closes microsoft#12152 Closes microsoft#12151 Closes microsoft#12150 Closes microsoft#12149 Closes microsoft#12148 Closes microsoft#12147 ## Screenshots N/A ## Testing Ran existing tests, created base `initWindows` tests. ## Changelog Should this change be included in the release notes: yes Created a new `init-windows` command
* Create new CLI init-windows command ## Description This PR implements a new, named template-based `react-native init-windows` command as described by #11920. Note, this does not change or deprecate the existing `react-native-windows-init` / `generateWindows` infrastructure or templates. ### Type of Change - New feature (non-breaking change which adds functionality) ### Why This is part of restructuring how users can add RNW support to their RN projects. ### What 1. Creates a new `init-windows` RN CLI command that creates a new windows project based on a given template 2. The first CLI templates under `old/`, which are just wrappers which call the existing templating code in `generateWindows` Closes #12152 Closes #12151 Closes #12150 Closes #12149 Closes #12148 Closes #12147 ## Screenshots N/A ## Testing Ran existing tests, created base `initWindows` tests. ## Changelog Should this change be included in the release notes: yes Created a new `init-windows` command * fix generateWrapper * remove sample apps package.json * update yarn.lock * Rename old templates
react-native-windows-init
to react-native init-windows
for new RNW projects
@jonthysell FYI adding link to #13362. Resolve when appropriate. |
I'm opening the remaining valid issues to be tracked toward milestones indivudually and moving this into next until it's all done |
Curious why the change. Should macOS follow suit? |
Because the So we built a RNW CLI command With that working, the old, evergreen But it's okay, now we can just tell devs "yarn add the RNW version you want" then you can use "react-native init-windows" at any time to restamp a windows template in your project folder. It's faster and more flexible. As for what macos should do - do you need to support more than one type of template and/or you have a lot of args you allow to be passed into react-native-macos-init? |
Closing this as the individual items track the remaining work. |
This item tracks all the work necessary to build a new simpler path for creating new RNW projects, with a primary focus of enabling the React Native New Architecture and golden-path supported scenarios.
Tasks
Create named "old architecture" templates from existing UWP templates (in
/vnext
)Create named "new architecture" templates (in
/vnext
)Create RNW CLI
init-windows
command (in/packages/@react-native-windows/cli
)initWindowsInternal()
method that copies and fills in files from the given template name #12151init
command which callsinitWindowsInternal
(wrapped in the appropriate telemetry) #12152init-windows
to list available templates (with descriptions?) #13459initWindowsInternal()
such that other scripts could call it directly #13460Stop using
react-native-windows-init
react-native-windows-init
to prevent trying to target newer RN / RNW versions and give useful error messages to the user #13461jobs/cli-init.yml
jobs still callingreact-native-windows-init
#13462Documentation / Samples
react-native init-windows
#13394react-native init-windows
#13464react-native init-windows
#13463Deprecate and remove old code
react-native-windows-init
package all together #13466The text was updated successfully, but these errors were encountered: