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" "url": "git+https://github.com/DylanVann/react-native-fast-image.git"
}, },
"scripts": { "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", "prepare": "git submodule update --init --recursive",
"test": "yarn run format && yarn run test:jest", "test": "yarn run format && yarn run test:jest",
"test:jest": "jest *.js" "test:jest": "jest ./src/*.js"
},
"dependencies": {
"prop-types": "^15.5.10"
}, },
"devDependencies": { "devDependencies": {
"babel-jest": "^21.2.0", "babel-jest": "^22.4.4",
"babel-preset-react-native": "^4.0.0", "babel-preset-react-native": "^4.0.0",
"jest": "^21.2.1", "jest": "^22.4.4",
"prettier": "^1.12.1", "prettier": "^1.12.1",
"prettier-check": "^2.0.0", "prettier-check": "^2.0.0",
"react": "^16.3.0-alpha.1", "prop-types": "^15.6.1",
"react-native": "^0.54.1", "react": "^16.4.0",
"react-test-renderer": "16.0.0" "react-native": "^0.55.4",
"react-test-renderer": "16.4.0"
},
"peerDependencies": {
"prop-types": "*",
"react": "*",
"react-native": "*"
}, },
"jest": { "jest": {
"preset": "react-native", "preset": "react-native",
"modulePathIgnorePatterns": [ "modulePathIgnorePatterns": [
"ReactNativeFastImageExample", "react-native-fast-image-example*"
"ReactNativeFastImageCocoaPodsExample",
"react-native-fast-image-server"
] ]
} }
} }

View File

@ -16,12 +16,12 @@ app.get('/', (req, res) => res.send(welcome))
app.listen(port) app.listen(port)
const authentication = (req, res, next) => { const authentication = (req, res, next) => {
const token = req.query.token || req.headers['token'] const token = req.query.token || req.headers['token']
if (token) { if (token) {
next() next()
} else { } else {
return res.status(403).send({ success: false }) return res.status(403).send({ success: false })
} }
} }
const staticPictures = express.static(path.join(__dirname, 'pictures')) const staticPictures = express.static(path.join(__dirname, 'pictures'))

View File

@ -1,17 +1,16 @@
const path = require('path'); const path = require('path')
const blacklist = require('metro/src/blacklist'); const blacklist = require('metro/src/blacklist')
module.exports = { module.exports = {
extraNodeModules: { extraNodeModules: {},
getBlacklistRE: () =>
}, blacklist([
getBlacklistRE: () => blacklist([ /[/\\]Users[/\\]dylan[/\\]repos[/\\]react-native-fast-image[/\\]node_modules[/\\]react-native[/\\].*/,
/[/\\]Users[/\\]dylan[/\\]repos[/\\]react-native-fast-image[/\\]node_modules[/\\]react-native[/\\].*/ ]),
]),
getProjectRoots: () => [ getProjectRoots: () => [
// Include current package as project root // Include current package as project root
path.resolve(__dirname), path.resolve(__dirname),
// Include symlinked packages as project roots // 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 const tree = renderer
.create( .create(
<FastImage <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} style={style.image}
/>, />,
) )

2585
yarn.lock

File diff suppressed because it is too large Load Diff