Skip to content

Commit 5c29a04

Browse files
committed
Update fly scripts and npm scripts.
1 parent 3b3e4a2 commit 5c29a04

File tree

5 files changed

+61
-16
lines changed

5 files changed

+61
-16
lines changed

create-react-native-app/flyfile.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@ export default async function (fly) {
1111
}
1212

1313
export async function babel(fly, opts) {
14-
await fly.source(opts.src || paths.source).babel().target(paths.build);
14+
await fly.clear(paths.build).source(opts.src || paths.source).babel().target(paths.build);
1515
}
1616

1717
export async function clean(fly) {
1818
await fly.clear(paths.build);
1919
}
2020

21-
export async function build(fly) {
22-
await fly.start('babel');
21+
export async function publish(fly) {
22+
await fly.serial(["clean", "babel"]).shell("npm publish");
2323
}

create-react-native-app/package.json

+5-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
"create-react-native-app": "./build/index.js"
2121
},
2222
"scripts": {
23-
"start": "fly"
23+
"start": "fly",
24+
"build": "fly babel",
25+
"clean": "fly clean",
26+
"publish": "fly publish"
2427
},
2528
"dependencies": {
2629
"babel-runtime": "^6.9.2",
@@ -42,6 +45,7 @@
4245
"fly-babel": "^2.1.1",
4346
"fly-clear": "^1.0.1",
4447
"fly-esnext": "^2.0.0",
48+
"fly-shell": "^2.1.0",
4549
"fly-watch": "^1.1.1"
4650
}
4751
}

create-react-native-app/yarn.lock

+44-2
Original file line numberDiff line numberDiff line change
@@ -803,6 +803,13 @@ core-util-is@~1.0.0:
803803
version "1.0.2"
804804
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
805805

806+
cross-spawn-async@^2.1.1:
807+
version "2.2.5"
808+
resolved "https://registry.yarnpkg.com/cross-spawn-async/-/cross-spawn-async-2.2.5.tgz#845ff0c0834a3ded9d160daca6d390906bb288cc"
809+
dependencies:
810+
lru-cache "^4.0.0"
811+
which "^1.2.8"
812+
806813
cross-spawn@^4.0.0:
807814
version "4.0.2"
808815
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41"
@@ -872,6 +879,17 @@ esutils@^2.0.2:
872879
version "2.0.2"
873880
resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b"
874881

882+
execa@^0.4.0:
883+
version "0.4.0"
884+
resolved "https://registry.yarnpkg.com/execa/-/execa-0.4.0.tgz#4eb6467a36a095fabb2970ff9d5e3fb7bce6ebc3"
885+
dependencies:
886+
cross-spawn-async "^2.1.1"
887+
is-stream "^1.1.0"
888+
npm-run-path "^1.0.0"
889+
object-assign "^4.0.1"
890+
path-key "^1.0.0"
891+
strip-eof "^1.0.0"
892+
875893
expand-brackets@^0.1.4:
876894
version "0.1.5"
877895
resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
@@ -945,6 +963,12 @@ fly-esnext@^2.0.0:
945963
dependencies:
946964
require-like "^0.1.2"
947965

966+
fly-shell@^2.1.0:
967+
version "2.1.0"
968+
resolved "https://registry.yarnpkg.com/fly-shell/-/fly-shell-2.1.0.tgz#7cf7bcd27644e9234e701bf72256361564e6dca5"
969+
dependencies:
970+
execa "^0.4.0"
971+
948972
fly-watch@^1.1.1:
949973
version "1.1.1"
950974
resolved "https://registry.yarnpkg.com/fly-watch/-/fly-watch-1.1.1.tgz#2870081e80826faa5239379b4df97ae10aebae8d"
@@ -1224,6 +1248,10 @@ is-primitive@^2.0.0:
12241248
version "2.0.0"
12251249
resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
12261250

1251+
is-stream@^1.1.0:
1252+
version "1.1.0"
1253+
resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44"
1254+
12271255
is-typedarray@~1.0.0:
12281256
version "1.0.0"
12291257
resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a"
@@ -1341,7 +1369,7 @@ loose-envify@^1.0.0:
13411369
dependencies:
13421370
js-tokens "^3.0.0"
13431371

1344-
lru-cache@^4.0.1:
1372+
lru-cache@^4.0.0, lru-cache@^4.0.1:
13451373
version "4.0.2"
13461374
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.0.2.tgz#1d17679c069cda5d040991a09dbc2c0db377e55e"
13471375
dependencies:
@@ -1449,6 +1477,12 @@ normalize-path@^2.0.1:
14491477
version "2.0.1"
14501478
resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.0.1.tgz#47886ac1662760d4261b7d979d241709d3ce3f7a"
14511479

1480+
npm-run-path@^1.0.0:
1481+
version "1.0.0"
1482+
resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-1.0.0.tgz#f5c32bf595fe81ae927daec52e82f8b000ac3c8f"
1483+
dependencies:
1484+
path-key "^1.0.0"
1485+
14521486
npmlog@^4.0.1:
14531487
version "4.0.2"
14541488
resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.0.2.tgz#d03950e0e78ce1527ba26d2a7592e9348ac3e75f"
@@ -1522,6 +1556,10 @@ path-is-absolute@^1.0.0:
15221556
version "1.0.1"
15231557
resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
15241558

1559+
path-key@^1.0.0:
1560+
version "1.0.0"
1561+
resolved "https://registry.yarnpkg.com/path-key/-/path-key-1.0.0.tgz#5d53d578019646c0d68800db4e146e6bdc2ac7af"
1562+
15251563
path-type@^1.0.0:
15261564
version "1.1.0"
15271565
resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441"
@@ -1831,6 +1869,10 @@ strip-bom@^2.0.0:
18311869
dependencies:
18321870
is-utf8 "^0.2.0"
18331871

1872+
strip-eof@^1.0.0:
1873+
version "1.0.0"
1874+
resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf"
1875+
18341876
strip-json-comments@~2.0.1:
18351877
version "2.0.1"
18361878
resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
@@ -1921,7 +1963,7 @@ [email protected]:
19211963
dependencies:
19221964
extsprintf "1.0.2"
19231965

1924-
which@^1.2.9:
1966+
which@^1.2.8, which@^1.2.9:
19251967
version "1.2.12"
19261968
resolved "https://registry.yarnpkg.com/which/-/which-1.2.12.tgz#de67b5e450269f194909ef23ece4ebe416fa1192"
19271969
dependencies:

react-native-scripts/flyfile.js

+5-9
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,18 @@ const paths = {
66
sourceRoot: join(__dirname, 'src'),
77
};
88

9+
export default async function (fly) {
10+
await fly.watch(paths.source, 'babel');
11+
}
12+
913
export async function babel(fly, opts) {
10-
await fly.source(opts.src || paths.source).babel().target(paths.build);
14+
await fly.clear(paths.build).source(opts.src || paths.source).babel().target(paths.build);
1115
}
1216

1317
export async function clean(fly) {
1418
await fly.clear(paths.build);
1519
}
1620

17-
export async function build(fly) {
18-
await fly.start('babel');
19-
}
20-
2121
export async function publish(fly) {
2222
await fly.serial(['clear', 'babel']).shell('npm publish');
2323
}
24-
25-
export default async function (fly) {
26-
await fly.watch(paths.source, 'babel');
27-
}

react-native-scripts/package.json

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
"react-native-scripts": "./build/bin/react-native-scripts.js"
2121
},
2222
"scripts": {
23-
"start": "fly"
23+
"start": "fly",
24+
"build": "fly babel",
25+
"clean": "fly clean",
26+
"publish": "fly publish"
2427
},
2528
"dependencies": {
2629
"babel-runtime": "^6.9.2",

0 commit comments

Comments
 (0)