Skip to content

Commit

Permalink
Make Firebase a peer dependency 🦁 [merge]
Browse files Browse the repository at this point in the history
Make Firebase a peer dependency 🦁
  • Loading branch information
mesqueeb authored Sep 27, 2018
2 parents 5341a6b + 98ec9a4 commit 0bb2d93
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 17 deletions.
9 changes: 9 additions & 0 deletions dist/index.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,15 @@ function convertTimestamps(originVal, targetVal) {

return targetVal;
}
/**
* Merge an object onto defaultValues
*
* @export
* @param {object} obj
* @param {object} defaultValues
* @returns the new object
*/


function setDefaultValues (obj, defaultValues) {
if (!isWhat.isObject(defaultValues)) console.error('[vuex-easy-firestore] Trying to merge target:', obj, 'onto a non-object (defaultValues):', defaultValues);
Expand Down
9 changes: 9 additions & 0 deletions dist/index.es.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,15 @@ function convertTimestamps(originVal, targetVal) {

return targetVal;
}
/**
* Merge an object onto defaultValues
*
* @export
* @param {object} obj
* @param {object} defaultValues
* @returns the new object
*/


function setDefaultValues (obj, defaultValues) {
if (!isObject(defaultValues)) console.error('[vuex-easy-firestore] Trying to merge target:', obj, 'onto a non-object (defaultValues):', defaultValues);
Expand Down
6 changes: 5 additions & 1 deletion docs/setup.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
## Installation

```bash
npm i --save vuex-easy-firestore
npm i --save vuex-easy-firestore firebase
# or
yarn add vuex-easy-firestore firebase
```

Firebase is a peer dependency; It will use your existing version.

## Setup

It's super easy to set up and start using!
Expand Down
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuex-easy-firestore",
"version": "1.12.0",
"version": "1.12.1",
"description": "Easy coupling of firestore and a vuex module. 2-way sync with 0 boilerplate!",
"main": "dist/index.cjs.js",
"module": "dist/index.es.js",
Expand Down Expand Up @@ -34,9 +34,8 @@
},
"homepage": "https://github.com/mesqueeb/vuex-easy-firestore#readme",
"dependencies": {
"find-and-replace-anything": "^1.0.0",
"firebase": "^5.5.1",
"is-what": "^2.0.0",
"find-and-replace-anything": "^1.1.0",
"is-what": "^2.1.0",
"merge-anything": "^2.0.1",
"vuex-easy-access": "^2.3.0"
},
Expand Down Expand Up @@ -65,5 +64,8 @@
"vue": "^2.5.16",
"vuepress": "^0.14.4",
"vuex": "^3.0.1"
},
"peerDependencies": {
"firebase": "^5.5.1"
}
}
9 changes: 8 additions & 1 deletion src/utils/setDefaultValues.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ function convertTimestamps (originVal, targetVal) {
}
return targetVal
}

/**
* Merge an object onto defaultValues
*
* @export
* @param {object} obj
* @param {object} defaultValues
* @returns the new object
*/
export default function (obj, defaultValues) {
if (!isObject(defaultValues)) console.error('[vuex-easy-firestore] Trying to merge target:', obj, 'onto a non-object (defaultValues):', defaultValues)
if (!isObject(obj)) console.error('[vuex-easy-firestore] Trying to merge a non-object:', obj, 'onto the defaultValues:', defaultValues)
Expand Down
9 changes: 9 additions & 0 deletions test/helpers/index.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,15 @@ function convertTimestamps(originVal, targetVal) {

return targetVal;
}
/**
* Merge an object onto defaultValues
*
* @export
* @param {object} obj
* @param {object} defaultValues
* @returns the new object
*/


function setDefaultValues (obj, defaultValues) {
if (!isWhat.isObject(defaultValues)) console.error('[vuex-easy-firestore] Trying to merge target:', obj, 'onto a non-object (defaultValues):', defaultValues);
Expand Down
9 changes: 9 additions & 0 deletions test/helpers/setDefaultValues.cjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,15 @@ function convertTimestamps(originVal, targetVal) {

return targetVal;
}
/**
* Merge an object onto defaultValues
*
* @export
* @param {object} obj
* @param {object} defaultValues
* @returns the new object
*/


function setDefaultValues (obj, defaultValues) {
if (!isWhat.isObject(defaultValues)) console.error('[vuex-easy-firestore] Trying to merge target:', obj, 'onto a non-object (defaultValues):', defaultValues);
Expand Down
36 changes: 25 additions & 11 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4163,11 +4163,11 @@ fill-range@^4.0.0:
repeat-string "^1.6.1"
to-regex-range "^2.1.0"

find-and-replace-anything@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/find-and-replace-anything/-/find-and-replace-anything-1.0.0.tgz#3e80784d8eee9cd1bcc13170443734b5f25acf21"
find-and-replace-anything@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/find-and-replace-anything/-/find-and-replace-anything-1.1.0.tgz#df27da299ffa59ee895323c68444ea41f79b0a88"
dependencies:
is-what "^2.0.2"
is-what "^2.1.0"

find-cache-dir@^0.1.1:
version "0.1.1"
Expand Down Expand Up @@ -4705,12 +4705,18 @@ hullabaloo-config-manager@^1.1.0:
resolve-from "^3.0.0"
safe-buffer "^5.0.1"

iconv-lite@^0.4.17, iconv-lite@^0.4.4, iconv-lite@~0.4.13:
iconv-lite@^0.4.17, iconv-lite@^0.4.4:
version "0.4.23"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.23.tgz#297871f63be507adcfbfca715d0cd0eed84e9a63"
dependencies:
safer-buffer ">= 2.1.2 < 3"

iconv-lite@~0.4.13:
version "0.4.24"
resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b"
dependencies:
safer-buffer ">= 2.1.2 < 3"

icss-replace-symbols@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/icss-replace-symbols/-/icss-replace-symbols-1.1.0.tgz#06ea6f83679a7749e386cfe1fe812ae5db223ded"
Expand Down Expand Up @@ -5149,14 +5155,14 @@ is-what@^1.0.4:
version "1.1.0"
resolved "https://registry.yarnpkg.com/is-what/-/is-what-1.1.0.tgz#c841068a15731a7abb62852af7328e160c04e15c"

is-what@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/is-what/-/is-what-2.0.0.tgz#c5d3874fbad3d15e8f56a0585c2e93d7f18f3bcc"

is-what@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/is-what/-/is-what-2.0.2.tgz#16b3fe0e3fd18fcd378973bf2e1c3b3265d469c7"

is-what@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/is-what/-/is-what-2.1.0.tgz#4772694462bfdf492175e1952ae81fe938388ac9"

is-windows@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
Expand Down Expand Up @@ -6015,7 +6021,11 @@ mz@^2.6.0:
object-assign "^4.0.1"
thenify-all "^1.0.0"

nan@^2.0.0, nan@^2.9.2:
nan@^2.0.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.11.0.tgz#574e360e4d954ab16966ec102c0c049fd961a099"

nan@^2.9.2:
version "2.10.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.10.0.tgz#96d0cd610ebd58d4b4de9cc0c6828cda99c7548f"

Expand Down Expand Up @@ -8729,10 +8739,14 @@ well-known-symbols@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/well-known-symbols/-/well-known-symbols-1.0.0.tgz#73c78ae81a7726a8fa598e2880801c8b16225518"

whatwg-fetch@2.0.4, whatwg-fetch@>=0.10.0:
whatwg-fetch@2.0.4:
version "2.0.4"
resolved "http://registry.npmjs.org/whatwg-fetch/-/whatwg-fetch-2.0.4.tgz#dde6a5df315f9d39991aa17621853d720b85566f"

whatwg-fetch@>=0.10.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/whatwg-fetch/-/whatwg-fetch-3.0.0.tgz#fc804e458cc460009b1a2b966bc8817d2578aefb"

when@~3.6.x:
version "3.6.4"
resolved "https://registry.yarnpkg.com/when/-/when-3.6.4.tgz#473b517ec159e2b85005497a13983f095412e34e"
Expand Down

0 comments on commit 0bb2d93

Please sign in to comment.