Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eff79f6d54 | ||
|
|
d3f6c2e173 | ||
|
|
418f04b312 | ||
|
|
126df709d6 | ||
|
|
590b9f8326 | ||
|
|
7b686518ed | ||
|
|
491b0caf18 | ||
|
|
393523caa6 | ||
|
|
50f58b7023 | ||
|
|
19afb6b08a | ||
|
|
587a21df1e | ||
|
|
9f15bca7e9 | ||
|
|
0af9bb62de | ||
|
|
a9fcdbe72a | ||
|
|
7ce6851ea7 | ||
|
|
51a72a0641 | ||
|
|
e9b8569636 | ||
|
|
cb4fc02d4c | ||
|
|
30d3b114fb | ||
|
|
9bb1823d8e |
No files matched your search
@@ -1 +1,4 @@
|
||||
.travis.yml
|
||||
CODE_OF_CONDUCT.md
|
||||
CONTRIBUTING.md
|
||||
ISSUE_TEMPLATE.md
|
||||
@@ -6,7 +6,7 @@
|
||||
* https://github.com/emin93/react-native-template-typescript
|
||||
*/
|
||||
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import {
|
||||
Platform,
|
||||
StyleSheet,
|
||||
|
||||
@@ -0,0 +1,46 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project owner at emin@emin.ch. The project owner will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project owner is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/4/
|
||||
@@ -0,0 +1,21 @@
|
||||
# Contributing
|
||||
|
||||
Cool, I'm glad you decided to contribute to React Native Template TypeScript.
|
||||
|
||||
Don't worry, I won't bother you with thousands of rules. I want to make contributing to this project as easy and transparent as possible.
|
||||
|
||||
## Workflow
|
||||
|
||||
We use [GitHub Flow](https://guides.github.com/introduction/flow/), so all code changes happen through pull requests.
|
||||
|
||||
1. Fork the repository and create your branch from `master`.
|
||||
2. If you've changed the functionality, update the documentation.
|
||||
3. Issue that pull request! :tada:
|
||||
|
||||
## License
|
||||
|
||||
By contributing, you agree that your contributions will be licensed under the [MIT License](https://choosealicense.com/licenses/mit/).
|
||||
|
||||
## Code style
|
||||
|
||||
Currently there is no lint configuration, but you should try to stay consistent with the existing code.
|
||||
@@ -0,0 +1,15 @@
|
||||
## Expected results
|
||||
|
||||
What did you expect to happen?
|
||||
|
||||
## Observed results
|
||||
|
||||
What happened?
|
||||
|
||||
### Logs
|
||||
|
||||
Please add the log output here.
|
||||
|
||||
## Steps to reproduce
|
||||
|
||||
1.
|
||||
@@ -49,7 +49,7 @@ The React Native CLI will do everything just as without a template and afterward
|
||||
|
||||
## :computer: Contributing
|
||||
|
||||
Contributions are very welcome. Please try to stay consistent with the other files I've created.
|
||||
Contributions are very welcome. Please check out the [contributing document](https://github.com/emin93/react-native-template-typescript/blob/master/CONTRIBUTING.md).
|
||||
|
||||
### Donations
|
||||
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
import 'react-native';
|
||||
import * as React from 'react';
|
||||
import React from 'react';
|
||||
import App from '../App';
|
||||
|
||||
// Note: test renderer must be required after react-native.
|
||||
import * as renderer from 'react-test-renderer';
|
||||
import renderer from 'react-test-renderer';
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer.create(
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
[
|
||||
"typescript",
|
||||
"react-native-typescript-transformer",
|
||||
"ts-jest",
|
||||
"@types/jest",
|
||||
"@types/react",
|
||||
"@types/react-native",
|
||||
"@types/jest"
|
||||
"@types/react-test-renderer",
|
||||
"react-native-typescript-transformer",
|
||||
"ts-jest",
|
||||
"typescript"
|
||||
]
|
||||
@@ -3,35 +3,45 @@ const path = require('path');
|
||||
const { execSync } = require('child_process');
|
||||
|
||||
const packageJson = require('./package.json');
|
||||
const jestJson = require('./jest.json');
|
||||
const jestConfig = require('./jest.json');
|
||||
const devDependencies = require('./devDependencies.json');
|
||||
|
||||
const deleteFile = (fileName) => fs.unlinkSync(path.join(process.cwd(), fileName));
|
||||
const deleteFile = (fileName) => {
|
||||
const filePath = path.join(process.cwd(), fileName);
|
||||
|
||||
if (!fs.existsSync(filePath)) {
|
||||
return;
|
||||
}
|
||||
|
||||
fs.unlinkSync(filePath);
|
||||
};
|
||||
const writeFile = (fileName, data) => fs.writeFileSync(path.join(process.cwd(), fileName), data);
|
||||
const isYarnAvailable = () => {
|
||||
try {
|
||||
execSync('yarnpkg --version', { stdio: 'ignore' });
|
||||
execSync('yarn --version', { stdio: 'ignore' });
|
||||
return true;
|
||||
} catch (e) {
|
||||
} catch (exc) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
const packager = isYarnAvailable() ? 'yarn' : 'npm';
|
||||
const packageManager = isYarnAvailable() ? 'yarn' : 'npm';
|
||||
const execOptions = { stdio: 'inherit' };
|
||||
|
||||
console.log('\n🔄 Please wait...\n');
|
||||
console.log('🔄 Please wait...\n');
|
||||
|
||||
packageJson.scripts.start = `${packageJson.scripts.start} --config ../../../../rn-cli.config.js`;
|
||||
packageJson.jest = Object.assign(packageJson.jest, jestJson);
|
||||
packageJson.jest = Object.assign(packageJson.jest, jestConfig);
|
||||
writeFile('package.json', JSON.stringify(packageJson, null, 2));
|
||||
|
||||
console.log(`\n📦 Installing dependencies with ${packager}...\n`);
|
||||
console.log(`📦 Installing dependencies with ${packageManager}...\n`);
|
||||
|
||||
if (packager === 'yarn') {
|
||||
execSync(`yarn add ${devDependencies.join(' ')} --dev --exact`, execOptions);
|
||||
} else {
|
||||
execSync(`npm i ${devDependencies.join(' ')} --save-dev --save-exact`, execOptions);
|
||||
switch (packageManager) {
|
||||
case 'yarn':
|
||||
execSync(`yarn add ${devDependencies.join(' ')} --dev --exact`, execOptions);
|
||||
break;
|
||||
default:
|
||||
execSync(`npm i ${devDependencies.join(' ')} --save-dev --save-exact`, execOptions);
|
||||
}
|
||||
|
||||
deleteFile('App.js');
|
||||
@@ -43,4 +53,4 @@ deleteFile('README.md');
|
||||
deleteFile('LICENSE');
|
||||
deleteFile('setup.js');
|
||||
|
||||
console.log(`\n✅ Setup completed! You can now start with: ${packager} start\n`);
|
||||
console.log(`\n✅ Setup completed! You can now start with: ${packageManager} start\n`);
|
||||
+3
-1
@@ -4,7 +4,9 @@
|
||||
"jsx": "react",
|
||||
"noEmit": true,
|
||||
"moduleResolution": "node",
|
||||
"noImplicitAny": true
|
||||
"noImplicitAny": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules"
|
||||
|
||||
Reference in new issue
Block a user