From 98ec9a4df371903120179014f26ce759ca1a55a5 Mon Sep 17 00:00:00 2001 From: Luca Ban - Black Birdy Date: Thu, 27 Sep 2018 18:17:41 +0900 Subject: [PATCH] =?UTF-8?q?Make=20Firebase=20a=20peer=20dependency=20?= =?UTF-8?q?=F0=9F=A6=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dist/index.cjs.js | 9 +++++++ dist/index.es.js | 9 +++++++ docs/setup.md | 6 ++++- package.json | 10 ++++---- src/utils/setDefaultValues.js | 9 ++++++- test/helpers/index.cjs.js | 9 +++++++ test/helpers/setDefaultValues.cjs.js | 9 +++++++ yarn.lock | 36 +++++++++++++++++++--------- 8 files changed, 80 insertions(+), 17 deletions(-) diff --git a/dist/index.cjs.js b/dist/index.cjs.js index 27e85864..e91d5a39 100644 --- a/dist/index.cjs.js +++ b/dist/index.cjs.js @@ -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); diff --git a/dist/index.es.js b/dist/index.es.js index fe536aad..9977d9dc 100644 --- a/dist/index.es.js +++ b/dist/index.es.js @@ -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); diff --git a/docs/setup.md b/docs/setup.md index 1866d3a4..b0960edf 100644 --- a/docs/setup.md +++ b/docs/setup.md @@ -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! diff --git a/package.json b/package.json index 7405d0fc..c9aa9184 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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" }, @@ -65,5 +64,8 @@ "vue": "^2.5.16", "vuepress": "^0.14.4", "vuex": "^3.0.1" + }, + "peerDependencies": { + "firebase": "^5.5.1" } } diff --git a/src/utils/setDefaultValues.js b/src/utils/setDefaultValues.js index 333e6157..5e58fc36 100644 --- a/src/utils/setDefaultValues.js +++ b/src/utils/setDefaultValues.js @@ -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) diff --git a/test/helpers/index.cjs.js b/test/helpers/index.cjs.js index 2eb16b17..670e6d30 100644 --- a/test/helpers/index.cjs.js +++ b/test/helpers/index.cjs.js @@ -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); diff --git a/test/helpers/setDefaultValues.cjs.js b/test/helpers/setDefaultValues.cjs.js index c0a842d2..f0c89d43 100644 --- a/test/helpers/setDefaultValues.cjs.js +++ b/test/helpers/setDefaultValues.cjs.js @@ -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); diff --git a/yarn.lock b/yarn.lock index 14e2dd7d..c06198ad 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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" @@ -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" @@ -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" @@ -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" @@ -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"