Skip to content
This repository has been archived by the owner. It is now read-only.

Commit ec25e28

Browse files
authored
Bump Babel to 7.10, and Prettier to 2.0 (#8)
1 parent ee26a78 commit ec25e28

File tree

5 files changed

+334
-615
lines changed

5 files changed

+334
-615
lines changed

.github/workflows/nodejs.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
name: Node CI
2-
3-
on: [push]
4-
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
57
jobs:
68
build:
7-
8-
runs-on: ubuntu-latest
9-
109
strategy:
1110
matrix:
1211
node-version: [10.x, 12.x]
13-
12+
runs-on: ubuntu-latest
1413
steps:
15-
- uses: actions/checkout@v1
16-
- name: Use Node.js ${{ matrix.node-version }}
17-
uses: actions/setup-node@v1
18-
with:
19-
node-version: ${{ matrix.node-version }}
20-
- name: yarn install, build, and test
21-
run: |
22-
yarn
23-
yarn ci:test
24-
env:
25-
CI: true
14+
- name: Checkout
15+
uses: actions/checkout@v1
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v1
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- name: yarn install, build, and test
21+
env:
22+
CI: true
23+
run: |
24+
yarn
25+
yarn ci:test

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
const BatchedBridge = require("react-native/Libraries/BatchedBridge/BatchedBridge");
22
BatchedBridge.registerCallableModule("ReactExperienceLoader", {
3-
load: (...names) => names.forEach(codegen.require("inlineRequireModules"))
3+
load: (...names) => names.forEach(codegen.require("inlineRequireModules")),
44
});

inlineRequireModules.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const fs = require("fs");
44
const { experiences } = JSON.parse(
55
fs.readFileSync(
66
require.resolve("./package.json", {
7-
paths: [".", ...(module.parent ? module.parent.paths : [])]
7+
paths: [".", ...(module.parent ? module.parent.paths : [])],
88
}),
99
"utf8"
1010
)
@@ -17,7 +17,7 @@ if (!experiences) {
1717
module.exports = `name => {
1818
switch (name) {
1919
${Object.keys(experiences)
20-
.map(name => `case "${name}": return require("${experiences[name]}");`)
20+
.map((name) => `case "${name}": return require("${experiences[name]}");`)
2121
.join("")}
2222
}
2323
}`;

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"scripts": {
2929
"ci:test": "yarn format && yarn codegen && git diff && test $(git diff | grep -c '$') -eq 0",
3030
"codegen": "babel --plugins codegen index.js > index.js.out",
31-
"format": "prettier --write *.js *.json"
31+
"format": "prettier --write $(git ls-files '*.js' '*.json')"
3232
},
3333
"dependencies": {
3434
"@babel/core": "^7.0.0-0",
@@ -39,7 +39,7 @@
3939
},
4040
"devDependencies": {
4141
"@babel/cli": "^7.0.0",
42-
"prettier": "^1.18.0"
42+
"prettier": "2.0.5"
4343
},
4444
"experiences": {
4545
"FeatureA": "@contoso/feature-a",

0 commit comments

Comments
 (0)