Skip to content

Commit

Permalink
More refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
DylanVann committed May 24, 2018
1 parent b4414b6 commit 01d52e4
Show file tree
Hide file tree
Showing 6 changed files with 1,765 additions and 902 deletions.
27 changes: 14 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,30 +21,31 @@
"url": "git+https://github.com/DylanVann/react-native-fast-image.git"
},
"scripts": {
"format": "prettier --write --list-different ./*.js ./ReactNativeFastImageExample/src/*.js ./react-native-fast-image-server/*.js",
"format": "prettier --write --list-different ./**/*.js",
"prepare": "git submodule update --init --recursive",
"test": "yarn run format && yarn run test:jest",
"test:jest": "jest *.js"
},
"dependencies": {
"prop-types": "^15.5.10"
"test:jest": "jest ./src/*.js"
},
"devDependencies": {
"babel-jest": "^21.2.0",
"babel-jest": "^22.4.4",
"babel-preset-react-native": "^4.0.0",
"jest": "^21.2.1",
"jest": "^22.4.4",
"prettier": "^1.12.1",
"prettier-check": "^2.0.0",
"react": "^16.3.0-alpha.1",
"react-native": "^0.54.1",
"react-test-renderer": "16.0.0"
"prop-types": "^15.6.1",
"react": "^16.4.0",
"react-native": "^0.55.4",
"react-test-renderer": "16.4.0"
},
"peerDependencies": {
"prop-types": "*",
"react": "*",
"react-native": "*"
},
"jest": {
"preset": "react-native",
"modulePathIgnorePatterns": [
"ReactNativeFastImageExample",
"ReactNativeFastImageCocoaPodsExample",
"react-native-fast-image-server"
"react-native-fast-image-example*"
]
}
}
12 changes: 6 additions & 6 deletions react-native-fast-image-example-server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ app.get('/', (req, res) => res.send(welcome))
app.listen(port)

const authentication = (req, res, next) => {
const token = req.query.token || req.headers['token']
if (token) {
next()
} else {
return res.status(403).send({ success: false })
}
const token = req.query.token || req.headers['token']
if (token) {
next()
} else {
return res.status(403).send({ success: false })
}
}

const staticPictures = express.static(path.join(__dirname, 'pictures'))
Expand Down
19 changes: 9 additions & 10 deletions react-native-fast-image-example/metro.config.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
const path = require('path');
const blacklist = require('metro/src/blacklist');
const path = require('path')
const blacklist = require('metro/src/blacklist')

module.exports = {
extraNodeModules: {

},
getBlacklistRE: () => blacklist([
/[/\\]Users[/\\]dylan[/\\]repos[/\\]react-native-fast-image[/\\]node_modules[/\\]react-native[/\\].*/
]),
extraNodeModules: {},
getBlacklistRE: () =>
blacklist([
/[/\\]Users[/\\]dylan[/\\]repos[/\\]react-native-fast-image[/\\]node_modules[/\\]react-native[/\\].*/,
]),
getProjectRoots: () => [
// Include current package as project root
path.resolve(__dirname),
// Include symlinked packages as project roots
path.resolve('/Users/dylan/repos/react-native-fast-image')
path.resolve('/Users/dylan/repos/react-native-fast-image'),
],
};
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ test('Renders a normal Image when not passed a uri.', () => {
const tree = renderer
.create(
<FastImage
source={require('./react-native-fast-image-example-server/pictures/jellyfish.gif')}
source={require('../react-native-fast-image-example-server/pictures/jellyfish.gif')}
style={style.image}
/>,
)
Expand Down
Loading

0 comments on commit 01d52e4

Please sign in to comment.