Skip to content

Commit e6aec65

Browse files
committed
prepared for CLI v2
1 parent fdcc07a commit e6aec65

File tree

8 files changed

+28
-27
lines changed

8 files changed

+28
-27
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"version": "0.0.1",
44
"description": "Clean and minimalist React Native template for a quick start with TypeScript.",
55
"scripts": {
6-
"test": "standard setup.js",
6+
"test": "standard *.js",
77
"prepublishOnly": "npm --no-git-tag-version version $TRAVIS_TAG",
88
"install": "node setup.js"
99
},

script.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
const fs = require('fs');
2+
const path = require('path');
3+
4+
if (fs.existsSync(path.join(__dirname, '.travis.yml'))) {
5+
process.exit();
6+
}
7+
8+
const projectFilesToDelete = ['.flowconfig', 'App.js', '__tests__/App-test.js'];
9+
10+
const deleteFile = filePath => {
11+
if (!fs.existsSync(filePath)) {
12+
return;
13+
}
14+
15+
fs.unlinkSync(filePath);
16+
};
17+
18+
const projectPath = path.join(__dirname, '..', '..');
19+
const deleteProjectFile = fileName => deleteFile(path.join(projectPath, fileName));
20+
21+
projectFilesToDelete.forEach(deleteProjectFile);

setup.js

Lines changed: 0 additions & 25 deletions
This file was deleted.

template.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
placeholderName: 'ProjectName',
3+
templateDir: './template',
4+
postInitScript: './script.js',
5+
};
File renamed without changes.

App.tsx renamed to template/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/**
2-
* Sample React Native App
2+
* ProjectName
33
* https://github.com/facebook/react-native
44
*
55
* Generated with the TypeScript template
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)