@react-native-community/cli
Advanced tools
Comparing version 14.0.0-alpha.9 to 14.0.0-alpha.10
@@ -36,2 +36,2 @@ #!/usr/bin/env node | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/bin.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/bin.js.map |
@@ -35,2 +35,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/index.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/index.js.map |
@@ -25,2 +25,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/banner.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/banner.js.map |
@@ -192,2 +192,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/editTemplate.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/editTemplate.js.map |
@@ -21,2 +21,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/errors/DirectoryAlreadyExistsError.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/errors/DirectoryAlreadyExistsError.js.map |
@@ -21,2 +21,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/errors/HelloWorldError.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/errors/HelloWorldError.js.map |
@@ -21,2 +21,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/errors/InvalidNameError.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/errors/InvalidNameError.js.map |
@@ -21,2 +21,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/errors/ReservedNameError.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/errors/ReservedNameError.js.map |
@@ -25,2 +25,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/errors/TemplateAndVersionError.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/errors/TemplateAndVersionError.js.map |
@@ -87,2 +87,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/git.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/git.js.map |
@@ -63,2 +63,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/index.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/index.js.map |
@@ -92,3 +92,6 @@ "use strict"; | ||
// `yarn set` is unsupported until 1.22, however it's a alias (yarnpkg/yarn/pull/7862) calling `policies set-version`. | ||
const setVersionArgs = yarnVersion.major > 1 && yarnVersion.minor >= 22 ? ['set', 'version', YARN_VERSION] : ['policies', 'set-version', YARN_VERSION]; | ||
let setVersionArgs = ['set', 'version', YARN_VERSION]; | ||
if (yarnVersion.major === 1 && yarnVersion.minor < 22) { | ||
setVersionArgs = ['policies', 'set-version', YARN_VERSION]; | ||
} | ||
await (0, _executeCommand.executeCommand)('yarn', setVersionArgs, { | ||
@@ -334,22 +337,14 @@ root, | ||
if (!useLegacyTemplate) { | ||
// This will use ~ to grab the latest patch version. | ||
// | ||
// Because we allow for many PATCHes to occur for a version of react-native, it's not possible to know | ||
// (without inspecting the template's npm metadata) which template works with which react-native version. | ||
// We are guaranteed that the latest version of react-native will work with the latest version of the | ||
// template on that version. | ||
// | ||
// Example: | ||
// | ||
// Suppose react-native 0.75.0 was released, and 0.74.8 was the previous version. If I ran | ||
// `init --version 0.74.8` it would be guaranteed to work with the latest version of the template | ||
// matching the MAJOR.MINOR, e.g. 0.74.21. | ||
if (/nightly/.test(version)) { | ||
_cliTools().logger.debug("[template]: you're using a nightly version of react-native"); | ||
// Template nightly versions and react-native@nightly versions don't match (template releases at a much | ||
// lower cadence). The naming scheme we use for nightlies doesn't support '~'. We have to assume the user | ||
// is running against the latest nightly: | ||
// lower cadence). We have to assume the user is running against the latest nightly by pointing to the tag. | ||
return `${TEMPLATE_PACKAGE_COMMUNITY}@nightly`; | ||
} | ||
return `${TEMPLATE_PACKAGE_COMMUNITY}@~${version}`; | ||
// Special case to unblock a release. This will need to be cleaned up in the future once 0.75 RC2 is out. | ||
if (version === '0.75.0-rc.1') { | ||
return `${TEMPLATE_PACKAGE_COMMUNITY}@0.75.0-rc.1.1`; | ||
} | ||
return `${TEMPLATE_PACKAGE_COMMUNITY}@${version}`; | ||
} | ||
@@ -382,5 +377,2 @@ _cliTools().logger.debug(`Using the legacy template because '${TEMPLATE_PACKAGE_LEGACY}' still contains a template folder`); | ||
// 3. For version < 0.75, the template ships with react-native. | ||
if (_semver().default.valid(version) == null) { | ||
throw new Error(`--version=${options.version} -> '${version}' isn't valid SEMVER`); | ||
} | ||
const templateUri = await createTemplateUri(options, version); | ||
@@ -423,3 +415,10 @@ _cliTools().logger.debug(`Template: '${templateUri}'`); | ||
(0, _validate.validateProjectName)(projectName); | ||
const version = await (0, _npm.npmResolveConcreteVersion)(options.platformName ?? 'react-native', options.version ?? DEFAULT_VERSION); | ||
let version = options.version ?? DEFAULT_VERSION; | ||
try { | ||
const updatedVersion = await (0, _npm.npmResolveConcreteVersion)(options.platformName ?? 'react-native', version); | ||
_cliTools().logger.debug(`Mapped: ${version} -> ${updatedVersion}`); | ||
version = updatedVersion; | ||
} catch (e) { | ||
_cliTools().logger.debug(`Failed to get concrete version from '${version}': `, e); | ||
} | ||
@@ -429,3 +428,7 @@ // From 0.75 it actually is useful to be able to specify both the template and react-native version. | ||
if (!!options.template && !!options.version) { | ||
if (_semver().default.gte(version, TEMPLATE_COMMUNITY_REACT_NATIVE_VERSION)) { | ||
var _semver$coerce; | ||
// 0.75.0-nightly-20240618-5df5ed1a8' -> 0.75.0 | ||
// 0.75.0-rc.1 -> 0.75.0 | ||
const semverVersion = ((_semver$coerce = _semver().default.coerce(version)) === null || _semver$coerce === void 0 ? void 0 : _semver$coerce.version) ?? version; | ||
if (_semver().default.gte(semverVersion, TEMPLATE_COMMUNITY_REACT_NATIVE_VERSION)) { | ||
_cliTools().logger.warn(`Use ${_chalk().default.bold('--template')} and ${_chalk().default.bold('--version')} only if you know what you're doing. Here be dragons 🐉.`); | ||
@@ -468,2 +471,2 @@ } else { | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/init.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/init.js.map |
@@ -99,2 +99,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/printRunInstructions.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/printRunInstructions.js.map |
@@ -107,2 +107,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/template.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/template.js.map |
@@ -29,2 +29,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/commands/init/validate.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/commands/init/validate.js.map |
@@ -223,2 +223,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/index.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/index.js.map |
@@ -62,2 +62,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/bun.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/bun.js.map |
@@ -97,2 +97,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/copyFiles.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/copyFiles.js.map |
@@ -29,2 +29,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/executeCommand.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/executeCommand.js.map |
@@ -26,2 +26,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/gracefulifyFs.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/gracefulifyFs.js.map |
@@ -60,3 +60,18 @@ "use strict"; | ||
url.pathname = `${packageName}/${tagOrVersion}`; | ||
const json = await fetch(url).then(resp => resp.json()); | ||
const resp = await fetch(url); | ||
if ([200, | ||
// OK | ||
301, | ||
// Moved Permanemently | ||
302, | ||
// Found | ||
304, | ||
// Not Modified | ||
307, | ||
// Temporary Redirect | ||
308 // Permanent Redirect | ||
].indexOf(resp.status) === -1) { | ||
throw new Error(`Unknown version ${packageName}@${tagOrVersion}`); | ||
} | ||
const json = await resp.json(); | ||
return json.version; | ||
@@ -72,2 +87,2 @@ } | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/npm.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/npm.js.map |
@@ -95,2 +95,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/packageManager.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/packageManager.js.map |
@@ -22,2 +22,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/replacePathSepForRegex.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/replacePathSepForRegex.js.map |
@@ -41,2 +41,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/walk.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/walk.js.map |
@@ -80,2 +80,2 @@ "use strict"; | ||
//# sourceMappingURL=/Users/thymikee/Developer/oss/rncli/packages/cli/build/tools/yarn.js.map | ||
//# sourceMappingURL=/Users/szymonrybczak/development/cli/packages/cli/build/tools/yarn.js.map |
{ | ||
"name": "@react-native-community/cli", | ||
"version": "14.0.0-alpha.9", | ||
"version": "14.0.0-alpha.10", | ||
"description": "React Native CLI", | ||
@@ -27,9 +27,9 @@ "license": "MIT", | ||
"dependencies": { | ||
"@react-native-community/cli-clean": "14.0.0-alpha.9", | ||
"@react-native-community/cli-config": "14.0.0-alpha.9", | ||
"@react-native-community/cli-debugger-ui": "14.0.0-alpha.9", | ||
"@react-native-community/cli-doctor": "14.0.0-alpha.9", | ||
"@react-native-community/cli-server-api": "14.0.0-alpha.9", | ||
"@react-native-community/cli-tools": "14.0.0-alpha.9", | ||
"@react-native-community/cli-types": "14.0.0-alpha.9", | ||
"@react-native-community/cli-clean": "14.0.0-alpha.10", | ||
"@react-native-community/cli-config": "14.0.0-alpha.10", | ||
"@react-native-community/cli-debugger-ui": "14.0.0-alpha.10", | ||
"@react-native-community/cli-doctor": "14.0.0-alpha.10", | ||
"@react-native-community/cli-server-api": "14.0.0-alpha.10", | ||
"@react-native-community/cli-tools": "14.0.0-alpha.10", | ||
"@react-native-community/cli-types": "14.0.0-alpha.10", | ||
"chalk": "^4.1.2", | ||
@@ -59,3 +59,4 @@ "commander": "^9.4.1", | ||
"directory": "packages/cli" | ||
} | ||
}, | ||
"gitHead": "28b4f6c14feb7e0e67696f38a6a1f8c555a74165" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
209575
104
2138
6
+ Added@react-native-community/cli-clean@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-config@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-debugger-ui@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-doctor@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-platform-android@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-platform-apple@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-platform-ios@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-server-api@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-tools@14.0.0-alpha.10(transitive)
+ Added@react-native-community/cli-types@14.0.0-alpha.10(transitive)
- Removed@react-native-community/cli-clean@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-config@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-debugger-ui@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-doctor@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-platform-android@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-platform-apple@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-platform-ios@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-server-api@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-tools@14.0.0-alpha.9(transitive)
- Removed@react-native-community/cli-types@14.0.0-alpha.9(transitive)
Updated@react-native-community/cli-debugger-ui@14.0.0-alpha.10
Updated@react-native-community/cli-server-api@14.0.0-alpha.10