react-native-community / template

The React Native Community Template - getting started building RN apps for Android & iOS
MIT License
71 stars 16 forks source link

Missing template versions means unable to create/test new react-native projects with nightly versions #38

Closed jonthysell closed 4 months ago

jonthysell commented 4 months ago

Description

For react-native-windows we're continually integrating to newer nightly versions of react-native, and have to be able to initialize new projects with those versions. This new template package doesn't appear to have matching nightly versions as the react-native package (the way all of the other ancillary RN packages get matching nightly versions published).

Steps to reproduce

  1. npx --yes @react-native-community/cli@latest init test3 --template react-native@0.75.0-nightly-20240618-5df5ed1a8

React Native Community Template Version

0.75.0-nightly-20240618-5df5ed1a8

Affected Platforms

Build - Windows

Output of npx @react-native-community/cli@latest info

info Fetching system and libraries information...
System:
  OS: Windows 11 10.0.26120
  CPU: "(24) x64 AMD Ryzen Threadripper PRO 3945WX 12-Cores     "
  Memory: 44.39 GB / 63.86 GB
Binaries:
  Node:
    version: 18.18.0
    path: C:\Program Files\nodejs\node.EXE
  Yarn:
    version: 1.22.19
    path: C:\Program Files (x86)\Yarn\bin\yarn.CMD
  npm:
    version: 9.8.1
    path: C:\Program Files\nodejs\npm.CMD
  Watchman: Not Found
SDKs:
  Android SDK: Not Found
  Windows SDK:
    AllowDevelopmentWithoutDevLicense: Enabled
    AllowAllTrustedApps: Enabled
    Versions:
      - 10.0.18362.0
      - 10.0.19041.0
      - 10.0.22000.0
      - 10.0.22621.0
IDEs:
  Android Studio: AI-213.7172.25.2113.9123335
  Visual Studio:
    - 17.10.35013.160 (Visual Studio Enterprise 2022)
    - 16.11.34931.43 (Visual Studio Enterprise 2019)
Languages:
  Java:
    version: 18.0.2.1
    path: C:\Program Files\Common Files\Oracle\Java\javapath\javac.EXE
  Ruby: Not Found
npmPackages:
  "@react-native-community/cli": Not Found
  react: Not Found
  react-native: Not Found
  react-native-windows: Not Found
npmGlobalPackages:
  "*react-native*": Not Found
Android:
  hermesEnabled: Not found
  newArchEnabled: Not found
iOS:
  hermesEnabled: Not found
  newArchEnabled: Not found

Stacktrace or Logs

Downloading template
⠋ Copying templateerror Installing pods failed. This doesn't affect project initialization and you can safely proceed.
However, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section.

✖ Copying template

Reproducer

https://github.com/Microsoft/react-native-windows

Screenshots and Videos

No response

jonthysell commented 4 months ago

Another question: if there isn't a matching template version for every react-native version, how is react-native CI testing that new nightlies aren't breaking new app creation? Does it just sit on a "known good" template version? Is there a way we could get that version programmatically (instead of just relying on matching version numbers)?

jonthysell commented 4 months ago

Okay, maybe I spoke too soon: https://github.com/facebook/react-native/commit/4e14c5eeab86a188663c2eddf301f753c317235b

blakef commented 4 months ago

@jonthysell I see that https://www.npmjs.com/package/@react-native-community/template/v/0.76.0-nightly-2024716-fa868c5 has now been published and it looks alright from a quick scan on of the contents. This shouldn't be an issue going forwards.

Tested this locally too:

➜  rn npx --yes @react-native-community/cli@next init RNNightly --version nightly --verbose
debug We couldn't find a package.json in your project. Are you sure you are running it inside a React Native project?
debug Failed to load configuration of your project. Only a subset of commands will be available.
debug Mapped: nightly -> 0.76.0-nightly-20240715-2eb7bcb8d
debug [template]: is '0.76.0-nightly-20240715-2eb7bcb8d (0.76.0)' < '0.75.0' = no, look for template in @react-native-community/template
debug [template]: you're using a nightly version of react-native
debug Template: '@react-native-community/template@nightly'
debug Initializing new project

Output seemed sane.

Please reopen is there are issues with this.