More refactoring.

This commit is contained in:
Dylan Vann 2018-05-24 12:24:47 -04:00
parent b4414b6477
commit 01d52e4363
6 changed files with 1754 additions and 891 deletions

View File

@ -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*"
]
}
}

View File

@ -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'))

View File

@ -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'),
],
};
}

View File

@ -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}
/>,
)

2585
yarn.lock

File diff suppressed because it is too large Load Diff