Skip to content

Commit

Permalink
Shim fs.readFileSync
Browse files Browse the repository at this point in the history
Inline node_modules/hyperlog/messages.js per developmentseed/field-data-collection#1 and babelify node_modules/asyncstorage-down.
  • Loading branch information
mojodna committed Apr 25, 2017
1 parent 8f33146 commit a88d632
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 169 deletions.
12 changes: 7 additions & 5 deletions index.android.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,27 +18,29 @@ export default class Surveyor extends Component {
constructor() {
super();

this.osm = osmdb('db');
this.osm = osmdb();

osm.create({
this.osm.create({
id: 'A',
lat: 64.5,
lon: -147.6
}, (err, key, node) => console.log(err, key, node));
osm.create({

this.osm.create({
id: 'B',
lat: 64.5,
lon: -147.6
}, (err, key, node) => console.log(err, key, node));
osm.create({

this.osm.create({
id: 'C',
lat: 64.5,
lon: -147.6
}, (err, key, node) => console.log(err, key, node));
}

render() {
osm.query([
this.osm.query([
[61, 65],
[-149, -147]
], (err, pts) => console.log(err, pts));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
},
"dependencies": {
"asyncstorage-down": "^3.1.1",
"browserify-fs": "^1.0.0",
"buffer": "^5.0.6",
"crypto-browserify": "^3.11.0",
"events": "^1.1.1",
Expand All @@ -24,6 +23,7 @@
"util": "^0.10.3"
},
"devDependencies": {
"babel-cli": "^6.24.1",
"babel-jest": "19.0.0",
"babel-preset-react-native": "1.9.1",
"eslint": "^3.19.0",
Expand Down
5 changes: 0 additions & 5 deletions webpack.haul.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,6 @@ aliases = Object.keys(aliases).reduce((obj, k) => {
return obj;
}, {});

// not included in node-libs-browser
// TODO we probably want a native implementation of this that _actually_ uses
// the filesystem
aliases.fs = 'browserify-fs';

module.exports = ({ platform }, defaults) => ({
entry: `./index.${platform}.js`,
resolve: {
Expand Down
Loading

0 comments on commit a88d632

Please sign in to comment.