Skip to content

Commit

Permalink
setup hack / change pouchdb-binary-utils/package.json
Browse files Browse the repository at this point in the history
  • Loading branch information
stockulus committed Sep 15, 2016
1 parent 26ccce7 commit fdba6d2
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 7 deletions.
4 changes: 2 additions & 2 deletions example/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "example",
"version": "6.1.5",
"version": "6.1.7",
"author": {
"name": "Christoph Stock",
"email": "[email protected]",
Expand All @@ -22,7 +22,7 @@
"postinstall": "npm run copy-packages"
},
"dependencies": {
"pouchdb-react-native": "6.1.5",
"pouchdb-react-native": "6.1.7",
"react": "15.3.1",
"react-native": "0.33.0",
"react-native-action-button": "2.0.3"
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pouchdb-react-native-bundle",
"version": "6.1.5",
"version": "6.1.7",
"description": "Package Bundle for PouchDB for ReactNative",
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion packages/pouchdb-adapter-asyncstorage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pouchdb-adapter-asyncstorage",
"version": "6.1.5",
"version": "6.1.7",
"description": "asyncstorage adapter for PouchDB",
"main": "./src/index.js",
"repository": {
Expand Down
7 changes: 4 additions & 3 deletions packages/pouchdb-react-native/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "pouchdb-react-native",
"version": "6.1.5",
"version": "6.1.7",
"description": "PouchDB Bundle for ReactNative",
"main": "index.js",
"repository": {
Expand All @@ -14,7 +14,8 @@
"offlinefirst"
],
"scripts": {
"updtr": "updtr --save-exact"
"updtr": "updtr --save-exact",
"postinstall": "node ./setup.js"
},
"author": {
"name": "Christoph Stock",
Expand All @@ -27,7 +28,7 @@
},
"homepage": "https://github.com/stockulus/pouchdb-react-native#readme",
"dependencies": {
"pouchdb-adapter-asyncstorage": "6.1.5",
"pouchdb-adapter-asyncstorage": "6.1.7",
"pouchdb-adapter-http": "6.0.4",
"pouchdb-core": "6.0.4",
"pouchdb-mapreduce": "6.0.4",
Expand Down
23 changes: 23 additions & 0 deletions packages/pouchdb-react-native/setup.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
const fs = require('fs')

let PATH = './node_modules/pouchdb-binary-utils/package.json'
let packageContent
try {
packageContent = JSON.parse(fs.readFileSync(PATH))
} catch (e) {
PATH = '../pouchdb-binary-utils/package.json'
packageContent = JSON.parse(fs.readFileSync(PATH))
}

packageContent['react-native'] = {
'./lib/index.js': './lib/index.js',
'./src/base64.js': './src/base64-browser.js',
'./src/base64StringToBlobOrBuffer.js': './src/base64StringToBlobOrBuffer.js',
'./src/blob.js': './src/blob.js',
'./src/binaryStringToBlobOrBuffer.js': './src/binaryStringToBlobOrBuffer.js',
'./src/blobOrBufferToBase64.js': './src/blobOrBufferToBase64.js',
'./src/blobOrBufferToBinaryString.js': './src/blobOrBufferToBinaryString.js',
'./src/typedBuffer.js': './src/typedBuffer.js'
}

fs.writeFileSync(PATH, JSON.stringify(packageContent))

0 comments on commit fdba6d2

Please sign in to comment.