Compare commits

...
18 Commits
Author SHA1 Message Date
Emin Khateeb 418f04b312 Merge pull request #11 from TimeWarpEngineering/master
Enable esModuleInterop
2018-04-01 11:20:26 +02:00
Steven Cramer 126df709d6 Update import in test
Update the import in __tests__\App.tsx to align with react-native
2018-04-01 16:15:57 +07:00
Steven Cramer 590b9f8326 Update to Standard React Native Template import
react-native default template uses import React from 'react' and this is now supported the the allowSyntheticDefaultImports enabled.
2018-04-01 14:53:51 +07:00
Steven Cramer 7b686518ed Allow esModuleInterop
Allow default imports from modules with no default export. This does not affect code emit, just typechecking.
Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports.
2018-04-01 14:52:23 +07:00
Steven Cramer 491b0caf18 sort dependencies
Lets keep these sorted so easier to find and see differences.
2018-04-01 14:50:39 +07:00
Steven T. Cramer 393523caa6 Merge pull request #1 from emin93/master
Merge pull request #10 from TimeWarpEngineering/master
2018-04-01 14:44:13 +07:00
Emin Khateeb 50f58b7023 Merge pull request #10 from TimeWarpEngineering/master
Add @types/react-test-renderer
2018-04-01 09:29:36 +02:00
Steven T. Cramer 19afb6b08a Add @types/react-test-renderer 2018-04-01 10:42:07 +07:00
Emin Khateeb 587a21df1e added issue template to npm ignore 2018-03-28 20:30:57 +02:00
Emin Khateeb 9f15bca7e9 Create ISSUE_TEMPLATE.md 2018-03-28 20:29:37 +02:00
Emin Khateeb 0af9bb62de added contribution document reference in readme 2018-03-28 20:25:59 +02:00
Emin Khateeb a9fcdbe72a Merge pull request #9 from emin93/remove-contribution-npm
added code of conduct and contribution guide to the npmignore
2018-03-28 20:21:35 +02:00
Emin Khateeb 7ce6851ea7 added code of conduct and contribution guide to the npmignore 2018-03-28 20:18:21 +02:00
Emin Khateeb 51a72a0641 Merge pull request #8 from emin93/add-contribution-guideline
added a contribution guideline
2018-03-28 16:53:43 +02:00
Emin Khateeb e9b8569636 added a contribution guideline 2018-03-28 16:52:43 +02:00
Emin Khateeb cb4fc02d4c Merge pull request #7 from emin93/add-code-of-conduct-1
Create CODE_OF_CONDUCT.md
2018-03-28 15:59:52 +02:00
Emin Khateeb 30d3b114fb Create CODE_OF_CONDUCT.md 2018-03-28 15:58:19 +02:00
Emin Khateeb 9bb1823d8e preparations to support other package managers as well 2018-03-28 15:44:35 +02:00
10 changed files with 112 additions and 22 deletions

No files matched your search

+3
View File
@@ -1 +1,4 @@
.travis.yml
CODE_OF_CONDUCT.md
CONTRIBUTING.md
ISSUE_TEMPLATE.md
+1 -1
View File
@@ -6,7 +6,7 @@
* https://github.com/emin93/react-native-template-typescript
*/
import * as React from 'react';
import React from 'react';
import {
Platform,
StyleSheet,
+46
View File
@@ -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/
+21
View File
@@ -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.
+15
View File
@@ -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.
+1 -1
View File
@@ -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
View File
@@ -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(
+5 -4
View File
@@ -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"
]
+15 -13
View File
@@ -3,35 +3,37 @@ 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 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 +45,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
View File
@@ -4,7 +4,9 @@
"jsx": "react",
"noEmit": true,
"moduleResolution": "node",
"noImplicitAny": true
"noImplicitAny": true,
"allowSyntheticDefaultImports": true,
"esModuleInterop": true
},
"exclude": [
"node_modules"