Skip to content

Commit 2e6992d

Browse files
committed
Add publish script
1 parent 796f714 commit 2e6992d

File tree

4 files changed

+32
-3
lines changed

4 files changed

+32
-3
lines changed

.eslintrc.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ extends: airbnb-base
22
rules:
33
no-tabs: 0
44
prefer-rest-params: 0
5+
import/no-extraneous-dependencies: 0
56
comma-dangle:
67
- error
78
- objects: only-multiline

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@
2323
"android",
2424
"windows"
2525
],
26+
"files": [
27+
"templates",
28+
"utils",
29+
"cli.js",
30+
"command.js",
31+
"lib.js",
32+
"README.md"
33+
],
2634
"author": "Johannes Stein",
2735
"license": "MIT",
2836
"bugs": {
@@ -41,9 +49,10 @@
4149
"devDependencies": {
4250
"eslint": "^3.16.0",
4351
"eslint-config-airbnb-base": "^11.1.0",
44-
"eslint-plugin-import": "^2.2.0"
52+
"eslint-plugin-import": "^2.2.0",
53+
"shelljs": "^0.7.6"
4554
},
4655
"rnpm": {
4756
"plugin": "./command.js"
4857
}
49-
}
58+
}

scripts/publish.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const fs = require('fs');
2+
const shell = require('shelljs');
3+
4+
const content = require('../package.json');
5+
6+
const DEFAULT_NAME = 'react-native-create-library';
7+
const ALTERNATE_NAME = 'rnpm-plugin-create-library';
8+
9+
content.name = ALTERNATE_NAME;
10+
11+
fs.writeFileSync('../package.json', JSON.stringify(content, null, 2));
12+
13+
shell.exec('npm publish');
14+
15+
content.name = DEFAULT_NAME;
16+
17+
fs.writeFileSync('../package.json', JSON.stringify(content, null, 2));
18+
19+
shell.exec('npm publish');

yarn.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1041,7 +1041,7 @@ semver@^5.0.3, semver@^5.1.0:
10411041
version "5.3.0"
10421042
resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f"
10431043

1044-
shelljs@^0.7.5:
1044+
shelljs@^0.7.5, shelljs@^0.7.6:
10451045
version "0.7.6"
10461046
resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.7.6.tgz#379cccfb56b91c8601e4793356eb5382924de9ad"
10471047
dependencies:

0 commit comments

Comments
 (0)