Skip to content

Commit

Permalink
Merge remote-tracking branch 'CLI/main' into feat/android-applicationId
Browse files Browse the repository at this point in the history
  • Loading branch information
adamTrz committed Jun 15, 2023
2 parents 34e98f4 + 4650a8d commit 485f79f
Show file tree
Hide file tree
Showing 19 changed files with 60 additions and 57 deletions.
1 change: 0 additions & 1 deletion __e2e__/__snapshots__/default.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ exports[`shows up help information without passing in any args 1`] = `
Options:
-v Output the current version
--verbose Increase logging verbosity
-h, --help display help for command
Commands:
Expand Down
3 changes: 2 additions & 1 deletion __e2e__/init.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
cleanupSync,
writeFiles,
} from '../jest/helpers';
import slash from 'slash';

const DIR = getTempDirectory('command-init');

Expand Down Expand Up @@ -41,7 +42,7 @@ afterEach(() => {

let templatePath = path.resolve(DIR, 'custom', 'template');
if (process.platform === 'win32') {
templatePath = templatePath.split('\\').join('/');
templatePath = slash(templatePath);
} else {
templatePath = `file://${templatePath}`;
}
Expand Down
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"npmClient": "yarn",
"useWorkspaces": true,
"exact": true
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-clean/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@react-native-community/cli-clean",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"execa": "^5.0.0",
"prompts": "^2.4.0"
Expand All @@ -19,7 +19,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"@types/prompts": "^2.0.9"
},
"homepage": "https://github.com/react-native-community/cli/tree/master/packages/cli-clean",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-config/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@react-native-community/cli-config",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"cosmiconfig": "^5.1.0",
"deepmerge": "^4.3.0",
Expand All @@ -21,7 +21,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"@types/cosmiconfig": "^5.0.3",
"@types/glob": "^7.1.1"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-debugger-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/cli-debugger-ui",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "./build/middleware",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions packages/cli-doctor/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"name": "@react-native-community/cli-doctor",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-config": "12.0.0-alpha.3",
"@react-native-community/cli-platform-android": "12.0.0-alpha.3",
"@react-native-community/cli-platform-ios": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.3",
"@react-native-community/cli-config": "12.0.0-alpha.4",
"@react-native-community/cli-platform-android": "12.0.0-alpha.4",
"@react-native-community/cli-platform-ios": "12.0.0-alpha.4",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.4",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"command-exists": "^1.2.8",
"envinfo": "^7.7.2",
Expand All @@ -34,7 +34,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"@types/command-exists": "^1.2.0",
"@types/envinfo": "^7.8.1",
"@types/ip": "^1.1.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-doctor/src/commands/doctor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import chalk from 'chalk';
import {logger, getLoader} from '@react-native-community/cli-tools';
import {logger, getLoader, CLIError} from '@react-native-community/cli-tools';
import {getHealthchecks, HEALTHCHECK_TYPES} from '../tools/healthchecks';
import printFixOptions, {KEYS} from '../tools/printFixOptions';
import runAutomaticFix, {AUTOMATIC_FIX_LEVELS} from '../tools/runAutomaticFix';
Expand Down Expand Up @@ -255,8 +255,8 @@ const doctorCommand = (async (_, options, config) => {

process.exit(0);
} catch (err) {
// TODO: log error
process.exit(1);
logger.log((err as any).stderr || (err as any).stdout);
throw new CLIError('Failed to run automatic fixes.', err as Error);
}
}
};
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-doctor/src/tools/runAutomaticFix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export default async function ({
config,
});
} catch (error) {
// TODO: log the error in a meaningful way
logger.error((error as any).stderr || (error as any).stdout);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions packages/cli-hermes/package.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "@react-native-community/cli-hermes",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"types": "build/index.d.ts",
"dependencies": {
"@react-native-community/cli-platform-android": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-platform-android": "12.0.0-alpha.4",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"hermes-profile-transformer": "^0.0.6",
"ip": "^1.1.5"
Expand All @@ -20,7 +20,7 @@
"!*.map"
],
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"@types/ip": "^1.1.0"
},
"homepage": "https://github.com/react-native-community/cli/tree/master/packages/cli-hermes",
Expand Down
8 changes: 4 additions & 4 deletions packages/cli-platform-android/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@react-native-community/cli-platform-android",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"execa": "^5.0.0",
"glob": "^7.1.3",
Expand All @@ -20,8 +20,8 @@
"native_modules.gradle"
],
"devDependencies": {
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.4",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"@types/fs-extra": "^8.1.0",
"@types/glob": "^7.1.1"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-platform-ios/package.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
{
"name": "@react-native-community/cli-platform-ios",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"execa": "^5.0.0",
"fast-xml-parser": "^4.0.12",
"glob": "^7.1.3",
"ora": "^5.4.1"
},
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"@types/glob": "^7.1.1",
"@types/lodash": "^4.14.149",
"hasbin": "^1.2.3"
Expand Down
9 changes: 6 additions & 3 deletions packages/cli-platform-ios/src/tools/getConfigurationScheme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@ export function getConfigurationScheme(
) {
if (scheme && mode) {
return mode;
} else if (scheme) {
return getBuildConfigurationFromXcScheme(scheme, mode, sourceDir);
}

return mode || 'Debug';
const configuration = mode || 'Debug';
if (scheme) {
return getBuildConfigurationFromXcScheme(scheme, configuration, sourceDir);
}

return configuration;
}
8 changes: 4 additions & 4 deletions packages/cli-plugin-metro/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@react-native-community/cli-plugin-metro",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@react-native-community/cli-server-api": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-server-api": "12.0.0-alpha.4",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"execa": "^5.0.0",
"metro": "0.76.5",
Expand All @@ -20,7 +20,7 @@
"readline": "^1.3.0"
},
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.3"
"@react-native-community/cli-types": "12.0.0-alpha.4"
},
"files": [
"build",
Expand Down
6 changes: 3 additions & 3 deletions packages/cli-server-api/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "@react-native-community/cli-server-api",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
"access": "public"
},
"dependencies": {
"@react-native-community/cli-debugger-ui": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-debugger-ui": "12.0.0-alpha.4",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"compression": "^1.7.1",
"connect": "^3.6.5",
"errorhandler": "^1.5.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli-tools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/cli-tools",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"license": "MIT",
"main": "build/index.js",
"publishConfig": {
Expand All @@ -18,7 +18,7 @@
"shell-quote": "^1.7.3"
},
"devDependencies": {
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"@types/lodash": "^4.14.149",
"@types/mime": "^2.0.1",
"@types/node": "^16.0.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli-types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/cli-types",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"main": "build",
"publishConfig": {
"access": "public"
Expand Down
20 changes: 10 additions & 10 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@react-native-community/cli",
"version": "12.0.0-alpha.3",
"version": "12.0.0-alpha.4",
"description": "React Native CLI",
"license": "MIT",
"main": "build/index.js",
Expand All @@ -24,15 +24,15 @@
"testEnvironment": "node"
},
"dependencies": {
"@react-native-community/cli-clean": "12.0.0-alpha.3",
"@react-native-community/cli-config": "12.0.0-alpha.3",
"@react-native-community/cli-debugger-ui": "12.0.0-alpha.3",
"@react-native-community/cli-doctor": "12.0.0-alpha.3",
"@react-native-community/cli-hermes": "12.0.0-alpha.3",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.3",
"@react-native-community/cli-server-api": "12.0.0-alpha.3",
"@react-native-community/cli-tools": "12.0.0-alpha.3",
"@react-native-community/cli-types": "12.0.0-alpha.3",
"@react-native-community/cli-clean": "12.0.0-alpha.4",
"@react-native-community/cli-config": "12.0.0-alpha.4",
"@react-native-community/cli-debugger-ui": "12.0.0-alpha.4",
"@react-native-community/cli-doctor": "12.0.0-alpha.4",
"@react-native-community/cli-hermes": "12.0.0-alpha.4",
"@react-native-community/cli-plugin-metro": "12.0.0-alpha.4",
"@react-native-community/cli-server-api": "12.0.0-alpha.4",
"@react-native-community/cli-tools": "12.0.0-alpha.4",
"@react-native-community/cli-types": "12.0.0-alpha.4",
"chalk": "^4.1.2",
"commander": "^9.4.1",
"execa": "^5.0.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@ const pkgJson = require('../package.json');
const program = new CommanderCommand()
.usage('[command] [options]')
.version(pkgJson.version, '-v', 'Output the current version')
.option('--verbose', 'Increase logging verbosity');
// .enablePositionalOptions();
.enablePositionalOptions();

const handleError = (err: Error) => {
logger.enable();
Expand Down Expand Up @@ -85,6 +84,7 @@ function attachCommand<C extends Command<boolean>>(
): void {
const cmd = program
.command(command.name)
.option('--verbose', 'Increase logging verbosity')
.action(async function handleAction(
this: CommanderCommand,
...args: string[]
Expand Down

0 comments on commit 485f79f

Please sign in to comment.