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

Add CHANGELOG, update prettier, run format and update fs-extra #319

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## 0.0.6

#### Bug Fix

* There will be fix here

#### Features

* There will be features here

#### Committers

* There will be commiters here
2 changes: 1 addition & 1 deletion create-react-native-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"babel-runtime": "^6.9.2",
"chalk": "^2.0.1",
"cross-spawn": "^5.1.0",
"fs-extra": "^3.0.1",
"fs-extra": "^4.0.0",
"minimist": "^1.2.0",
"path-exists": "^3.0.0",
"semver": "^5.0.3",
Expand Down
14 changes: 8 additions & 6 deletions create-react-native-app/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,24 @@ function userHasYarn() {
}

// This decides the 'interface' of the package managing command.
// Ex: If it guesses the type of package manager as 'yarn',
// Ex: If it guesses the type of package manager as 'yarn',
// then it executes '(yarn) add' command instead of '(npm) install'.
function packageManagerType() {
const defaultType = 'npm';
const supportedTypes = ['yarn', 'npm'];

if (packageManager) {
let t = supportedTypes.find(type => {
return (packageManager.indexOf(type)>-1);
})
return packageManager.indexOf(type) > -1;
});
return t ? t : defaultType;
}

return userHasYarn() ? 'yarn' : defaultType;
}

function packageManagerCmd() {
if ( packageManager ) {
if (packageManager) {
return packageManager;
} else {
return packageManagerType() === 'yarn' ? 'yarnpkg' : 'npm';
Expand Down Expand Up @@ -105,7 +105,9 @@ async function createApp(name: string, verbose: boolean, version: ?string): Prom
await fse.writeFile(path.join(root, 'package.json'), JSON.stringify(packageJson, null, 2));
process.chdir(root);

console.log(`Using package manager as ${packageManagerCmd()} with ${packageManagerType()} interface.`)
console.log(
`Using package manager as ${packageManagerCmd()} with ${packageManagerType()} interface.`
);
console.log('Installing packages. This might take a couple minutes.');
console.log('Installing react-native-scripts...');
console.log();
Expand All @@ -122,7 +124,7 @@ function install(
let args, result;
let cmd = packageManagerCmd();

if ( type === 'yarn' ) {
if (type === 'yarn') {
args = ['add'];

if (verbose) {
Expand Down
6 changes: 3 additions & 3 deletions create-react-native-app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1010,9 +1010,9 @@ form-data@~2.1.1:
combined-stream "^1.0.5"
mime-types "^2.1.12"

fs-extra@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291"
fs-extra@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.0.tgz#414fb4ca2d2170ba0014159d3a8aec3303418d9e"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^3.0.0"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
"format": "prettier --single-quote --trailing-comma=es5 --print-width=100 --write '{create-react-native-app,react-native-scripts}/{src,template}/**/*.js'"
},
"devDependencies": {
"prettier": "^0.21.0"
"prettier": "^1.5.3"
}
}
6 changes: 3 additions & 3 deletions react-native-scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@
"build": "taskr build"
},
"dependencies": {
"@expo/bunyan": "1.8.10",
"babel-runtime": "^6.9.2",
"chalk": "^2.0.1",
"cross-spawn": "^5.0.1",
"fs-extra": "^3.0.1",
"fs-extra": "^4.0.0",
"indent-string": "^3.0.0",
"inquirer": "^3.0.1",
"match-require": "^2.0.0",
"minimist": "^1.2.0",
"path-exists": "^3.0.0",
"progress": "^2.0.0",
"qrcode-terminal": "^0.11.0",
"xdl": "42.4.0",
"@expo/bunyan": "1.8.10"
"xdl": "42.4.0"
},
"devDependencies": {
"@taskr/babel": "^1.0.6",
Expand Down
28 changes: 16 additions & 12 deletions react-native-scripts/src/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,19 @@ async function eject() {

let expoSdkWarning;
if (usingExpo) {
expoSdkWarning = `${chalk.bold('Warning!')} We found at least one file where your project imports the Expo SDK:
expoSdkWarning = `${chalk.bold(
'Warning!'
)} We found at least one file where your project imports the Expo SDK:
`;

for (let filename of filesWithExpo) {
expoSdkWarning += ` ${chalk.cyan(filename)}\n`;
}

expoSdkWarning += `
${chalk.yellow.bold('If you choose the "plain" React Native option below, these imports will stop working.')}`;
${chalk.yellow.bold(
'If you choose the "plain" React Native option below, these imports will stop working.'
)}`;
} else {
expoSdkWarning = `\
We didn't find any uses of the Expo SDK in your project, so you should be fine to eject to
Expand All @@ -37,7 +41,9 @@ We didn't find any uses of the Expo SDK in your project, so you should be fine t
${expoSdkWarning}

We ${chalk.italic('strongly')} recommend that you read this document before you proceed:
${chalk.cyan('https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md')}
${chalk.cyan(
'https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md'
)}

Ejecting is permanent! Please be careful with your selection.
`
Expand All @@ -46,9 +52,10 @@ Ejecting is permanent! Please be careful with your selection.
let reactNativeOptionMessage = "React Native: I'd like a regular React Native project.";

if (usingExpo) {
reactNativeOptionMessage = chalk.italic(
"(WARNING: See above message for why this option may break your project's build)\n "
) + reactNativeOptionMessage;
reactNativeOptionMessage =
chalk.italic(
"(WARNING: See above message for why this option may break your project's build)\n "
) + reactNativeOptionMessage;
}

const questions = [
Expand All @@ -63,7 +70,8 @@ Ejecting is permanent! Please be careful with your selection.
value: 'raw',
},
{
name: "ExpoKit: I'll create or log in with an Expo account to use React Native and the Expo SDK.",
name:
"ExpoKit: I'll create or log in with an Expo account to use React Native and the Expo SDK.",
value: 'expoKit',
},
{
Expand All @@ -80,11 +88,7 @@ Ejecting is permanent! Please be careful with your selection.
const npmOrYarn = (await fse.exists(path.resolve('yarn.lock'))) ? 'yarnpkg' : 'npm';
const appJson = JSON.parse(await fse.readFile(path.resolve('app.json')));
const pkgJson = JSON.parse(await fse.readFile(path.resolve('package.json')));
let {
name: newName,
displayName: newDisplayName,
expo: { name: expName },
} = appJson;
let { name: newName, displayName: newDisplayName, expo: { name: expName } } = appJson;

// we ask user to provide a project name (default is package name stripped of dashes)
// but we want to infer some good default choices, especially if they've set them up in app.json
Expand Down
4 changes: 3 additions & 1 deletion react-native-scripts/src/scripts/ios.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ if (!Simulator.isPlatformSupported()) {
);
log(
chalk.yellow(
`If you run \`${chalk.cyan(command + ' start')}\` then you can view your app on a physical device.\n`
`If you run \`${chalk.cyan(
command + ' start'
)}\` then you can view your app on a physical device.\n`
)
);
process.exit(1);
Expand Down
4 changes: 3 additions & 1 deletion react-native-scripts/src/util/expo.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ export async function detach() {
`
You'll need to specify an iOS bundle identifier. It must be unique on the App Store if you want to
publish it there. See this StackOverflow question for more information:
${chalk.cyan('https://stackoverflow.com/questions/11347470/what-does-bundle-identifier-mean-in-the-ios-project')}
${chalk.cyan(
'https://stackoverflow.com/questions/11347470/what-does-bundle-identifier-mean-in-the-ios-project'
)}
`
);
const { iosBundleIdentifier } = await inquirer.prompt([
Expand Down
6 changes: 3 additions & 3 deletions react-native-scripts/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1441,9 +1441,9 @@ fs-extra@^0.30.0:
path-is-absolute "^1.0.0"
rimraf "^2.2.8"

fs-extra@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-3.0.1.tgz#3794f378c58b342ea7dbbb23095109c4b3b62291"
fs-extra@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-4.0.0.tgz#414fb4ca2d2170ba0014159d3a8aec3303418d9e"
dependencies:
graceful-fs "^4.1.2"
jsonfile "^3.0.0"
Expand Down
Loading