From 6817e4c8f5b94beaabdff5615fc6c17ab90dfed0 Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 18:38:13 +0200 Subject: [PATCH 01/21] setup dependencies --- package.json | 13 +++- yarn.lock | 214 ++++++++++++++++++++++++++++++++++----------------- 2 files changed, 153 insertions(+), 74 deletions(-) diff --git a/package.json b/package.json index 396a165..1f445d4 100644 --- a/package.json +++ b/package.json @@ -30,12 +30,19 @@ }, "homepage": "https://github.com/scottrobertson/vue-supabase#readme", "dependencies": { - "@supabase/supabase-js": "^1.4.2" + "@supabase/supabase-js": "^1.4.2", + "vue-demi": "^0.11.2" }, "peerDependencies": { - "vue": ">=1.x.x" + "@vue/composition-api": "^1.0.0-rc.1", + "vue": "^2.0.0 || >=3.0.0" + }, + "peerDependenciesMeta": { + "@vue/composition-api": { + "optional": true + } }, "devDependencies": { - "vue": "^2" + "vue": "^3.0.0" } } diff --git a/yarn.lock b/yarn.lock index 6a7ed70..2a01872 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,50 +2,123 @@ # yarn lockfile v1 -"@supabase/gotrue-js@^1.11.2": - version "1.11.2" - resolved "https://registry.yarnpkg.com/@supabase/gotrue-js/-/gotrue-js-1.11.2.tgz#51e20124b4740903aa5a33a7d8ade16ac9303d07" - integrity sha512-QYrA8wYTwofJcwQ5hWkg7HyDenykxSMUMImo7Um884EPHIhyZMJaCw9DK+p87f7HJ6rdYvCDF20LK1GcsMOB0A== +"@babel/helper-validator-identifier@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" + integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== + +"@babel/parser@^7.12.0": + version "7.14.7" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" + integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== + +"@babel/types@^7.12.0": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff" + integrity sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg== + dependencies: + "@babel/helper-validator-identifier" "^7.14.5" + to-fast-properties "^2.0.0" + +"@supabase/gotrue-js@^1.16.6": + version "1.16.6" + resolved "https://registry.yarnpkg.com/@supabase/gotrue-js/-/gotrue-js-1.16.6.tgz#d9d63740b11ad51d2f8d6c68e9ac16bb83439888" + integrity sha512-tLaG4G4sMW2P1hyq05Nr0jM/6AbdiWkjOPbM+QZsuVSsNbZ/z+BNxuE5q+6zHOnoP+YKEHup7x9xKR0zy2UqUQ== dependencies: cross-fetch "^3.0.6" -"@supabase/postgrest-js@^0.24.4": - version "0.24.5" - resolved "https://registry.yarnpkg.com/@supabase/postgrest-js/-/postgrest-js-0.24.5.tgz#bfad12442bd7eef2e44d7698c08f3cd72e63f712" - integrity sha512-DJWynRWLIVSnEHGWsPoLd7hjVO9MekPPWHwKUX/8uJnRS+SGj61EnvC5EIB2DkmSQSO0HJHXRt90nwvnTG/YVA== +"@supabase/postgrest-js@^0.33.0": + version "0.33.0" + resolved "https://registry.yarnpkg.com/@supabase/postgrest-js/-/postgrest-js-0.33.0.tgz#36e0bfd0f79a0fa01a4bb7c7881ee463fd7d60a8" + integrity sha512-og6Evdkan7Qp6+tOch7Pyq+ZWMnrCQtPHWwPpsN5A3iYQSro2yn21Yvazs9qAFoWAeTGNkuTOVpShT5Mbc9WcQ== dependencies: cross-fetch "^3.0.6" -"@supabase/realtime-js@^1.0.6": - version "1.0.6" - resolved "https://registry.yarnpkg.com/@supabase/realtime-js/-/realtime-js-1.0.6.tgz#d4cb1a9351cc8c836ee3f1392742a4466e0d7424" - integrity sha512-qzYYBzXteYsqQYlLzoYwee2OloWn3w8YzUFbDYFUPdkUwLs01OIqsm+lRCzKDivmyn2G0FJQjloWcF4BF5TyBg== +"@supabase/realtime-js@^1.0.11": + version "1.0.11" + resolved "https://registry.yarnpkg.com/@supabase/realtime-js/-/realtime-js-1.0.11.tgz#2b3a0b7822bcb8b2cf6201ec3c34220be23f40de" + integrity sha512-jE8/8I64VpEygEbrd9+RBZBIREo43Vacy8exef1QlyRegblG2VtqqK96BiQSaVG5ZwXumOs6Igl8kgyrDqUAPg== dependencies: "@types/websocket" "^1.0.1" - query-string "^6.12.1" - websocket "^1.0.31" + websocket "^1.0.34" + +"@supabase/storage-js@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@supabase/storage-js/-/storage-js-1.2.2.tgz#6eeef2d1365af2497b35ae6c6384f5dfbd75f5b6" + integrity sha512-EJ2BsfD7Mc+fXJqRef3YiWF8kg/GhBdxIil7EzmrAFBSJ3VCbN4sqzvCCUYK2dtNICUV3JOKh5SBX2RrgROIOA== + dependencies: + cross-fetch "^3.1.0" "@supabase/supabase-js@^1.4.2": - version "1.4.2" - resolved "https://registry.yarnpkg.com/@supabase/supabase-js/-/supabase-js-1.4.2.tgz#ebd6a7459b9c401def80cff9431d1cd445cccadd" - integrity sha512-qczdclPR85glzKjg0ed9bnKUt0HoxFq47MTsUN5MEQ5w5uk/dpnF2MYawLR7ATgoXCokxdWWB2pdzjbBTrTpUQ== + version "1.18.1" + resolved "https://registry.yarnpkg.com/@supabase/supabase-js/-/supabase-js-1.18.1.tgz#58fa3dfff3a1f86c169c83330282120195f6c5f1" + integrity sha512-YZhp867/HV9Az8icouAJ7S2j1SV4ZlshvQ1wTR0aV+Em+TTj9ZiS6GVykCjKn2SE2cUfG/wgmaXm9tiKecUhFg== dependencies: - "@supabase/gotrue-js" "^1.11.2" - "@supabase/postgrest-js" "^0.24.4" - "@supabase/realtime-js" "^1.0.6" + "@supabase/gotrue-js" "^1.16.6" + "@supabase/postgrest-js" "^0.33.0" + "@supabase/realtime-js" "^1.0.11" + "@supabase/storage-js" "^1.2.2" "@types/node@*": - version "14.14.31" - resolved "https://registry.yarnpkg.com/@types/node/-/node-14.14.31.tgz#72286bd33d137aa0d152d47ec7c1762563d34055" - integrity sha512-vFHy/ezP5qI0rFgJ7aQnjDXwAMrG0KqqIH7tQG5PPv3BWBayOPIQNBjVc/P6hhdZfMx51REc6tfDNXHUio893g== + version "16.3.2" + resolved "https://registry.yarnpkg.com/@types/node/-/node-16.3.2.tgz#655432817f83b51ac869c2d51dd8305fb8342e16" + integrity sha512-jJs9ErFLP403I+hMLGnqDRWT0RYKSvArxuBVh2veudHV7ifEC1WAmjJADacZ7mRbA2nWgHtn8xyECMAot0SkAw== "@types/websocket@^1.0.1": - version "1.0.1" - resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.1.tgz#039272c196c2c0e4868a0d8a1a27bbb86e9e9138" - integrity sha512-f5WLMpezwVxCLm1xQe/kdPpQIOmL0TXYx2O15VYfYzc7hTIdxiOoOvez+McSIw3b7z/1zGovew9YSL7+h4h7/Q== + version "1.0.3" + resolved "https://registry.yarnpkg.com/@types/websocket/-/websocket-1.0.3.tgz#49e09f939afd0ccdee4f7108d4712ec9feb0f153" + integrity sha512-ZdoTSwmDsKR7l1I8fpfQtmTI/hUwlOvE3q0iyJsp4tXU0MkdrYowimDzwxjhQvxU4qjhHLd3a6ig0OXRbLgIdw== dependencies: "@types/node" "*" +"@vue/compiler-core@3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.1.4.tgz#a3a74cf52e8f01af386d364ac8a099cbeb260424" + integrity sha512-TnUz+1z0y74O/A4YKAbzsdUfamyHV73MihrEfvettWpm9bQKVoZd1nEmR1cGN9LsXWlwAvVQBetBlWdOjmQO5Q== + dependencies: + "@babel/parser" "^7.12.0" + "@babel/types" "^7.12.0" + "@vue/shared" "3.1.4" + estree-walker "^2.0.1" + source-map "^0.6.1" + +"@vue/compiler-dom@3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.1.4.tgz#bf3795e1449f32c965d38c4ea6d808ca05fdfc97" + integrity sha512-3tG2ScHkghhUBuFwl9KgyZhrS8CPFZsO7hUDekJgIp5b1OMkROr4AvxHu6rRMl4WkyvYkvidFNBS2VfOnwa6Kw== + dependencies: + "@vue/compiler-core" "3.1.4" + "@vue/shared" "3.1.4" + +"@vue/reactivity@3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.1.4.tgz#d926ed46fb0d48582ccf8665b062d37b5d35ba99" + integrity sha512-YDlgii2Cr9yAoKVZFzgY4j0mYlVT73986X3e5SPp6ifqckSEoFSUWXZK2Tb53TB/9qO29BEEbspnKD3m3wAwkA== + dependencies: + "@vue/shared" "3.1.4" + +"@vue/runtime-core@3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.1.4.tgz#3e30ae6ecbfff06df5adc9414491143191a375ba" + integrity sha512-qmVJgJuFxfT7M4qHQ4M6KqhKC66fjuswK+aBivE8dWiZ2rtIGl9gtJGpwqwjQEcKEBTOfvvrtrwBncYArJUO8Q== + dependencies: + "@vue/reactivity" "3.1.4" + "@vue/shared" "3.1.4" + +"@vue/runtime-dom@3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.1.4.tgz#acfeee200d5c45fc2cbdf7058cda1498f9b45849" + integrity sha512-vbmwgTxku1BU87Kw7r29adv0OIrDXCW0PslOPQT0O/9R5SqcXgS94Yj6zsztDjvghegenwIAPNLlDR1Auh5s+w== + dependencies: + "@vue/runtime-core" "3.1.4" + "@vue/shared" "3.1.4" + csstype "^2.6.8" + +"@vue/shared@3.1.4": + version "3.1.4" + resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.1.4.tgz#c14c461ec42ea2c1556e86f60b0354341d91adc3" + integrity sha512-6O45kZAmkLvzGLToBxEz4lR2W6kXohCtebV2UxjH9GXjd8X9AhEn68FN9eNanFtWNzvgw1hqd6HkPRVQalqf7Q== + bufferutil@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.3.tgz#66724b756bed23cd7c28c4d306d7994f9943cc6b" @@ -53,13 +126,18 @@ bufferutil@^4.0.1: dependencies: node-gyp-build "^4.2.0" -cross-fetch@^3.0.6: - version "3.0.6" - resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.0.6.tgz#3a4040bc8941e653e0e9cf17f29ebcd177d3365c" - integrity sha512-KBPUbqgFjzWlVcURG+Svp9TlhA5uliYtiNx/0r8nv0pdypeQCRJ9IaSIc3q/x3q8t3F75cHuwxVql1HFGHCNJQ== +cross-fetch@^3.0.6, cross-fetch@^3.1.0: + version "3.1.4" + resolved "https://registry.yarnpkg.com/cross-fetch/-/cross-fetch-3.1.4.tgz#9723f3a3a247bf8b89039f3a380a9244e8fa2f39" + integrity sha512-1eAtFWdIubi6T4XPy6ei9iUFoKpUkIF971QLN8lIvvvwueI65+Nw5haMNKUwfJxabqlIIDODJKGrQ66gxC0PbQ== dependencies: node-fetch "2.6.1" +csstype@^2.6.8: + version "2.6.17" + resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.17.tgz#4cf30eb87e1d1a005d8b6510f95292413f6a1c0e" + integrity sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A== + d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -75,11 +153,6 @@ debug@^2.2.0: dependencies: ms "2.0.0" -decode-uri-component@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545" - integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU= - es5-ext@^0.10.35, es5-ext@^0.10.50: version "0.10.53" resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.53.tgz#93c5a3acfdbef275220ad72644ad02ee18368de1" @@ -106,6 +179,11 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3: d "^1.0.1" ext "^1.1.2" +estree-walker@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" + integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== + ext@^1.1.2: version "1.4.0" resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" @@ -113,11 +191,6 @@ ext@^1.1.2: dependencies: type "^2.0.0" -filter-obj@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/filter-obj/-/filter-obj-1.1.0.tgz#9b311112bc6c6127a16e016c6c5d7f19e0805c5b" - integrity sha1-mzERErxsYSehbgFsbF1/GeCAXFs= - is-typedarray@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/is-typedarray/-/is-typedarray-1.0.0.tgz#e479c80858df0c1b11ddda6940f96011fcda4a9a" @@ -143,25 +216,15 @@ node-gyp-build@^4.2.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== -query-string@^6.12.1: - version "6.14.1" - resolved "https://registry.yarnpkg.com/query-string/-/query-string-6.14.1.tgz#7ac2dca46da7f309449ba0f86b1fd28255b0c86a" - integrity sha512-XDxAeVmpfu1/6IjyT/gXHOl+S0vQ9owggJ30hhWKdHAsNPOcasn5o9BW0eejZqL2e4vMjhAxoW3jVHcD6mbcYw== - dependencies: - decode-uri-component "^0.2.0" - filter-obj "^1.1.0" - split-on-first "^1.0.0" - strict-uri-encode "^2.0.0" +source-map@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" + integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== -split-on-first@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/split-on-first/-/split-on-first-1.1.0.tgz#f610afeee3b12bce1d0c30425e76398b78249a5f" - integrity sha512-43ZssAJaMusuKWL8sKUBQXHWOpq8d6CfN/u1p4gUzfJkM05C8rxTmYrkIPTXapZpORA6LkkzcUulJ8FqA7Uudw== - -strict-uri-encode@^2.0.0: +to-fast-properties@^2.0.0: version "2.0.0" - resolved "https://registry.yarnpkg.com/strict-uri-encode/-/strict-uri-encode-2.0.0.tgz#b9c7330c7042862f6b142dc274bbcc5866ce3546" - integrity sha1-ucczDHBChi9rFC3CdLvMWGbONUY= + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= type@^1.0.1: version "1.2.0" @@ -169,9 +232,9 @@ type@^1.0.1: integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== type@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/type/-/type-2.3.0.tgz#ada7c045f07ead08abf9e2edd29be1a0c0661132" - integrity sha512-rgPIqOdfK/4J9FhiVrZ3cveAjRRo5rsQBAIhnylX874y1DX/kEKSVdLsnuHB6l1KTjHyU01VjiMBHgU2adejyg== + version "2.5.0" + resolved "https://registry.yarnpkg.com/type/-/type-2.5.0.tgz#0a2e78c2e77907b252abe5f298c1b01c63f0db3d" + integrity sha512-180WMDQaIMm3+7hGXWf12GtdniDEy7nYcyFMKJn/eZz/6tSLXrUN9V0wKSbMjej0I1WHWbpREDEKHtqPQa9NNw== typedarray-to-buffer@^3.1.5: version "3.1.5" @@ -181,21 +244,30 @@ typedarray-to-buffer@^3.1.5: is-typedarray "^1.0.0" utf-8-validate@^5.0.2: - version "5.0.4" - resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.4.tgz#72a1735983ddf7a05a43a9c6b67c5ce1c910f9b8" - integrity sha512-MEF05cPSq3AwJ2C7B7sHAA6i53vONoZbMGX8My5auEVm6W+dJ2Jd/TZPyGJ5CH42V2XtbI5FD28HeHeqlPzZ3Q== + version "5.0.5" + resolved "https://registry.yarnpkg.com/utf-8-validate/-/utf-8-validate-5.0.5.tgz#dd32c2e82c72002dc9f02eb67ba6761f43456ca1" + integrity sha512-+pnxRYsS/axEpkrrEpzYfNZGXp0IjC/9RIxwM5gntY4Koi8SHmUGSfxfWqxZdRxrtaoVstuOzUp/rbs3JSPELQ== dependencies: node-gyp-build "^4.2.0" -vue@^2: - version "2.6.12" - resolved "https://registry.yarnpkg.com/vue/-/vue-2.6.12.tgz#f5ebd4fa6bd2869403e29a896aed4904456c9123" - integrity sha512-uhmLFETqPPNyuLLbsKz6ioJ4q7AZHzD8ZVFNATNyICSZouqP2Sz0rotWQC8UNBF6VGSCs5abnKJoStA6JbCbfg== +vue-demi@^0.11.2: + version "0.11.2" + resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.11.2.tgz#faa06da53887c493a695b997f4fcb4784a667990" + integrity sha512-J+X8Au6BhQdcej6LY4O986634hZLu55L0ewU2j8my7WIKlu8cK0dqmdUxqVHHMd/cMrKKZ9SywB/id6aLhwCtA== -websocket@^1.0.31: - version "1.0.33" - resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.33.tgz#407f763fc58e74a3fa41ca3ae5d78d3f5e3b82a5" - integrity sha512-XwNqM2rN5eh3G2CUQE3OHZj+0xfdH42+OFK6LdC2yqiC0YU8e5UK0nYre220T0IyyN031V/XOvtHvXozvJYFWA== +vue@^3.0.0: + version "3.1.4" + resolved "https://registry.yarnpkg.com/vue/-/vue-3.1.4.tgz#120d6818c51eaa35d0879e5bc1cff60135bc69fd" + integrity sha512-p8dcdyeCgmaAiZsbLyDkmOLcFGZb/jEVdCLW65V68LRCXTNX8jKsgah2F7OZ/v/Ai2V0Fb1MNO0vz/GFqsPVMA== + dependencies: + "@vue/compiler-dom" "3.1.4" + "@vue/runtime-dom" "3.1.4" + "@vue/shared" "3.1.4" + +websocket@^1.0.34: + version "1.0.34" + resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" + integrity sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ== dependencies: bufferutil "^4.0.1" debug "^2.2.0" From 8d14ddb7475494984766dd98c26d9a19351f1efa Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 19:14:47 +0200 Subject: [PATCH 02/21] use vue-demi --- index.js | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 6c4eb17..b936c4d 100644 --- a/index.js +++ b/index.js @@ -1,19 +1,31 @@ 'use strict'; +import {install, inject, isVue2, isVue3} from "vue-demi" import { createClient } from '@supabase/supabase-js' +export const supabaseKey = 'supabase'; + +export function useSupabase(key = null) { + return inject(key !== null ? key : supabaseKey); +} + export default { - install: function (Vue, options) { + install: function (app, options) { const supabase = createClient(options.supabaseUrl, options.supabaseKey, options.supabaseOptions) - Object.defineProperties(Vue.prototype, { - $supabase: { - get: function() { - return supabase; - }, - }, - }); + app.provide(supabaseKey, supabase); - Vue.supabase = supabase; + if (isVue3){ + app.config.globalProperties.$supabase = supabase; + } else { + Object.defineProperties(app.prototype, { + $supabase: { + get: function() { + return supabase; + }, + }, + }); + app.supabase = supabase; + } } }; From c1d997b4c18fcd28dc58d332eab6889dcd468e78 Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 19:25:04 +0200 Subject: [PATCH 03/21] include key to exports --- index.d.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/index.d.ts b/index.d.ts index ec16295..a449be7 100644 --- a/index.d.ts +++ b/index.d.ts @@ -9,3 +9,4 @@ declare module 'vue/types/vue' { } export function useSupabase(key?: string): SupabaseClient; +export const supabaseKey: string; \ No newline at end of file From fde174b3a057867ddc6719dbe9baca2115e75a9b Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 19:36:29 +0200 Subject: [PATCH 04/21] Add helper comment in types file --- index.d.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/index.d.ts b/index.d.ts index a449be7..cf8cf28 100644 --- a/index.d.ts +++ b/index.d.ts @@ -8,5 +8,11 @@ declare module 'vue/types/vue' { } } +/** + * Used to get the injected instance of SupabaseClient. + * If using Vuejs 2.x, this function will be undefined, please use + * `this.$supabase` instead. + * @returns SupabaseClient + */ export function useSupabase(key?: string): SupabaseClient; export const supabaseKey: string; \ No newline at end of file From ccfd4f4ed8ec9fdf995a38a4263c96f7b13a66cc Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 19:49:21 +0200 Subject: [PATCH 05/21] default import --- index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index cf8cf28..d05a3f1 100644 --- a/index.d.ts +++ b/index.d.ts @@ -15,4 +15,6 @@ declare module 'vue/types/vue' { * @returns SupabaseClient */ export function useSupabase(key?: string): SupabaseClient; -export const supabaseKey: string; \ No newline at end of file +export const supabaseKey: string; + +export default {} \ No newline at end of file From 31cb646d70303cab86e5ef80425d64066feba719 Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 19:56:41 +0200 Subject: [PATCH 06/21] types to changes --- index.d.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index d05a3f1..5164858 100644 --- a/index.d.ts +++ b/index.d.ts @@ -17,4 +17,6 @@ declare module 'vue/types/vue' { export function useSupabase(key?: string): SupabaseClient; export const supabaseKey: string; -export default {} \ No newline at end of file +export default { + install(Vue: typeof Vue, options: any): void +} \ No newline at end of file From 51eff715feba1fc8913d4dd4d7f31693f03a3946 Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 20:05:45 +0200 Subject: [PATCH 07/21] fix runtime issue with vite looking for default module --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 444c5a0..ec59102 100644 --- a/index.js +++ b/index.js @@ -8,7 +8,7 @@ const supabaseKey = 'supabase'; function useSupabase(key = null) { return inject(key !== null ? key : supabaseKey); } -module.exports = { +exports['default'] = { supabaseKey, useSupabase, install: function (app, options) { @@ -29,4 +29,6 @@ module.exports = { app.supabase = supabase; } } -} \ No newline at end of file +} + +module.exports = exports['default']; \ No newline at end of file From ecada85bec937904d3d9807277e5fcfeadcab1c8 Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 20:12:31 +0200 Subject: [PATCH 08/21] :alembic: Try use another method to expose module --- index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index ec59102..9a7df5f 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,7 @@ 'use strict'; -import {inject, isVue3} from "vue-demi" +Object.defineProperty(exports, '__esModule', { value: true }); + +const { inject, isVue3 } = require('vue-demi'); const { createClient } = require('@supabase/supabase-js') @@ -8,9 +10,10 @@ const supabaseKey = 'supabase'; function useSupabase(key = null) { return inject(key !== null ? key : supabaseKey); } +exports.useSupabase = useSupabase; +exports.supabaseKey = supabaseKey; + exports['default'] = { - supabaseKey, - useSupabase, install: function (app, options) { const supabase = createClient(options.supabaseUrl, options.supabaseKey, options.supabaseOptions) From 3f734bf2d258600fcabb869607d4b3ecd0d67f7d Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 20:15:31 +0200 Subject: [PATCH 09/21] bundle exported items to default object --- index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 9a7df5f..5958a91 100644 --- a/index.js +++ b/index.js @@ -10,10 +10,11 @@ const supabaseKey = 'supabase'; function useSupabase(key = null) { return inject(key !== null ? key : supabaseKey); } -exports.useSupabase = useSupabase; -exports.supabaseKey = supabaseKey; + exports['default'] = { + supabaseKey, + useSupabase, install: function (app, options) { const supabase = createClient(options.supabaseUrl, options.supabaseKey, options.supabaseOptions) From bfa9d56f41a358f2fde6f432d464ea80b23891e1 Mon Sep 17 00:00:00 2001 From: Sduu Date: Fri, 16 Jul 2021 23:47:44 +0200 Subject: [PATCH 10/21] remove meta prop for composition api --- package.json | 8 ----- yarn.lock | 95 ---------------------------------------------------- 2 files changed, 103 deletions(-) diff --git a/package.json b/package.json index 1f445d4..55b658f 100644 --- a/package.json +++ b/package.json @@ -36,13 +36,5 @@ "peerDependencies": { "@vue/composition-api": "^1.0.0-rc.1", "vue": "^2.0.0 || >=3.0.0" - }, - "peerDependenciesMeta": { - "@vue/composition-api": { - "optional": true - } - }, - "devDependencies": { - "vue": "^3.0.0" } } diff --git a/yarn.lock b/yarn.lock index 2a01872..3367633 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,24 +2,6 @@ # yarn lockfile v1 -"@babel/helper-validator-identifier@^7.14.5": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.5.tgz#d0f0e277c512e0c938277faa85a3968c9a44c0e8" - integrity sha512-5lsetuxCLilmVGyiLEfoHBRX8UCFD+1m2x3Rj97WrW3V7H3u4RWRXA4evMjImCsin2J2YT0QaVDGf+z8ondbAg== - -"@babel/parser@^7.12.0": - version "7.14.7" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.14.7.tgz#6099720c8839ca865a2637e6c85852ead0bdb595" - integrity sha512-X67Z5y+VBJuHB/RjwECp8kSl5uYi0BvRbNeWqkaJCVh+LiTPl19WBUfG627psSgp9rSf6ojuXghQM3ha6qHHdA== - -"@babel/types@^7.12.0": - version "7.14.5" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.14.5.tgz#3bb997ba829a2104cedb20689c4a5b8121d383ff" - integrity sha512-M/NzBpEL95I5Hh4dwhin5JlE7EzO5PHMAuzjxss3tiOBD46KfQvVedN/3jEPZvdRvtsK2222XfdHogNIttFgcg== - dependencies: - "@babel/helper-validator-identifier" "^7.14.5" - to-fast-properties "^2.0.0" - "@supabase/gotrue-js@^1.16.6": version "1.16.6" resolved "https://registry.yarnpkg.com/@supabase/gotrue-js/-/gotrue-js-1.16.6.tgz#d9d63740b11ad51d2f8d6c68e9ac16bb83439888" @@ -71,54 +53,6 @@ dependencies: "@types/node" "*" -"@vue/compiler-core@3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@vue/compiler-core/-/compiler-core-3.1.4.tgz#a3a74cf52e8f01af386d364ac8a099cbeb260424" - integrity sha512-TnUz+1z0y74O/A4YKAbzsdUfamyHV73MihrEfvettWpm9bQKVoZd1nEmR1cGN9LsXWlwAvVQBetBlWdOjmQO5Q== - dependencies: - "@babel/parser" "^7.12.0" - "@babel/types" "^7.12.0" - "@vue/shared" "3.1.4" - estree-walker "^2.0.1" - source-map "^0.6.1" - -"@vue/compiler-dom@3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@vue/compiler-dom/-/compiler-dom-3.1.4.tgz#bf3795e1449f32c965d38c4ea6d808ca05fdfc97" - integrity sha512-3tG2ScHkghhUBuFwl9KgyZhrS8CPFZsO7hUDekJgIp5b1OMkROr4AvxHu6rRMl4WkyvYkvidFNBS2VfOnwa6Kw== - dependencies: - "@vue/compiler-core" "3.1.4" - "@vue/shared" "3.1.4" - -"@vue/reactivity@3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@vue/reactivity/-/reactivity-3.1.4.tgz#d926ed46fb0d48582ccf8665b062d37b5d35ba99" - integrity sha512-YDlgii2Cr9yAoKVZFzgY4j0mYlVT73986X3e5SPp6ifqckSEoFSUWXZK2Tb53TB/9qO29BEEbspnKD3m3wAwkA== - dependencies: - "@vue/shared" "3.1.4" - -"@vue/runtime-core@3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@vue/runtime-core/-/runtime-core-3.1.4.tgz#3e30ae6ecbfff06df5adc9414491143191a375ba" - integrity sha512-qmVJgJuFxfT7M4qHQ4M6KqhKC66fjuswK+aBivE8dWiZ2rtIGl9gtJGpwqwjQEcKEBTOfvvrtrwBncYArJUO8Q== - dependencies: - "@vue/reactivity" "3.1.4" - "@vue/shared" "3.1.4" - -"@vue/runtime-dom@3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@vue/runtime-dom/-/runtime-dom-3.1.4.tgz#acfeee200d5c45fc2cbdf7058cda1498f9b45849" - integrity sha512-vbmwgTxku1BU87Kw7r29adv0OIrDXCW0PslOPQT0O/9R5SqcXgS94Yj6zsztDjvghegenwIAPNLlDR1Auh5s+w== - dependencies: - "@vue/runtime-core" "3.1.4" - "@vue/shared" "3.1.4" - csstype "^2.6.8" - -"@vue/shared@3.1.4": - version "3.1.4" - resolved "https://registry.yarnpkg.com/@vue/shared/-/shared-3.1.4.tgz#c14c461ec42ea2c1556e86f60b0354341d91adc3" - integrity sha512-6O45kZAmkLvzGLToBxEz4lR2W6kXohCtebV2UxjH9GXjd8X9AhEn68FN9eNanFtWNzvgw1hqd6HkPRVQalqf7Q== - bufferutil@^4.0.1: version "4.0.3" resolved "https://registry.yarnpkg.com/bufferutil/-/bufferutil-4.0.3.tgz#66724b756bed23cd7c28c4d306d7994f9943cc6b" @@ -133,11 +67,6 @@ cross-fetch@^3.0.6, cross-fetch@^3.1.0: dependencies: node-fetch "2.6.1" -csstype@^2.6.8: - version "2.6.17" - resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.17.tgz#4cf30eb87e1d1a005d8b6510f95292413f6a1c0e" - integrity sha512-u1wmTI1jJGzCJzWndZo8mk4wnPTZd1eOIYTYvuEyOQGfmDl3TrabCCfKnOC86FZwW/9djqTl933UF/cS425i9A== - d@1, d@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" @@ -179,11 +108,6 @@ es6-symbol@^3.1.1, es6-symbol@~3.1.3: d "^1.0.1" ext "^1.1.2" -estree-walker@^2.0.1: - version "2.0.2" - resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-2.0.2.tgz#52f010178c2a4c117a7757cfe942adb7d2da4cac" - integrity sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w== - ext@^1.1.2: version "1.4.0" resolved "https://registry.yarnpkg.com/ext/-/ext-1.4.0.tgz#89ae7a07158f79d35517882904324077e4379244" @@ -216,16 +140,6 @@ node-gyp-build@^4.2.0: resolved "https://registry.yarnpkg.com/node-gyp-build/-/node-gyp-build-4.2.3.tgz#ce6277f853835f718829efb47db20f3e4d9c4739" integrity sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg== -source-map@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263" - integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== - -to-fast-properties@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" - integrity sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4= - type@^1.0.1: version "1.2.0" resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" @@ -255,15 +169,6 @@ vue-demi@^0.11.2: resolved "https://registry.yarnpkg.com/vue-demi/-/vue-demi-0.11.2.tgz#faa06da53887c493a695b997f4fcb4784a667990" integrity sha512-J+X8Au6BhQdcej6LY4O986634hZLu55L0ewU2j8my7WIKlu8cK0dqmdUxqVHHMd/cMrKKZ9SywB/id6aLhwCtA== -vue@^3.0.0: - version "3.1.4" - resolved "https://registry.yarnpkg.com/vue/-/vue-3.1.4.tgz#120d6818c51eaa35d0879e5bc1cff60135bc69fd" - integrity sha512-p8dcdyeCgmaAiZsbLyDkmOLcFGZb/jEVdCLW65V68LRCXTNX8jKsgah2F7OZ/v/Ai2V0Fb1MNO0vz/GFqsPVMA== - dependencies: - "@vue/compiler-dom" "3.1.4" - "@vue/runtime-dom" "3.1.4" - "@vue/shared" "3.1.4" - websocket@^1.0.34: version "1.0.34" resolved "https://registry.yarnpkg.com/websocket/-/websocket-1.0.34.tgz#2bdc2602c08bf2c82253b730655c0ef7dcab3111" From 1cd2d627e546e75aa0d7c46dbca5ebd7d952bcb5 Mon Sep 17 00:00:00 2001 From: Sduu Date: Sat, 24 Jul 2021 23:59:51 +0200 Subject: [PATCH 11/21] :arrow-up: Update composition api --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 55b658f..01d5ead 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "vue-demi": "^0.11.2" }, "peerDependencies": { - "@vue/composition-api": "^1.0.0-rc.1", + "@vue/composition-api": "^1.0.4", "vue": "^2.0.0 || >=3.0.0" } } From 3ef083e35f6ba150d34e2cb4e415fdbcc05a5b3b Mon Sep 17 00:00:00 2001 From: Sduu Date: Sun, 25 Jul 2021 00:46:12 +0200 Subject: [PATCH 12/21] :alembic: add logging --- index.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 5958a91..00223e5 100644 --- a/index.js +++ b/index.js @@ -1,7 +1,7 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); - -const { inject, isVue3 } = require('vue-demi'); +const {isVue2, isVue3 } = require('vue-demi'); +const { provide, inject } = isVue3 ? require("vue") : require("@vue/composition-api") const { createClient } = require('@supabase/supabase-js') @@ -18,7 +18,12 @@ exports['default'] = { install: function (app, options) { const supabase = createClient(options.supabaseUrl, options.supabaseKey, options.supabaseOptions) - app.provide(supabaseKey, supabase); + if (provide) { + provide(supabaseKey, supabase); + } + + console.log('is vue 3',isVue3) + console.log('is vue 2', isVue2) if (isVue3){ app.config.globalProperties.$supabase = supabase; From a574837d3452180465821e45276f6dee768d24fd Mon Sep 17 00:00:00 2001 From: Sduu Date: Sun, 25 Jul 2021 01:36:17 +0200 Subject: [PATCH 13/21] cleanup logging --- index.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/index.js b/index.js index 00223e5..774565e 100644 --- a/index.js +++ b/index.js @@ -1,32 +1,24 @@ 'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); -const {isVue2, isVue3 } = require('vue-demi'); -const { provide, inject } = isVue3 ? require("vue") : require("@vue/composition-api") +const { isVue3 } = require('vue-demi'); const { createClient } = require('@supabase/supabase-js') -const supabaseKey = 'supabase'; +const supabasesymbol = Symbol('supabase'); -function useSupabase(key = null) { - return inject(key !== null ? key : supabaseKey); +function useSupabase() { + return inject(supabasesymbol); } exports['default'] = { - supabaseKey, useSupabase, install: function (app, options) { const supabase = createClient(options.supabaseUrl, options.supabaseKey, options.supabaseOptions) - if (provide) { - provide(supabaseKey, supabase); - } - - console.log('is vue 3',isVue3) - console.log('is vue 2', isVue2) - if (isVue3){ app.config.globalProperties.$supabase = supabase; + app.provide(supabasesymbol, supabase); } else { Object.defineProperties(app.prototype, { $supabase: { From a697caa1a36eacc93e134bf65585a19c8afd2da1 Mon Sep 17 00:00:00 2001 From: Sduu Date: Sun, 25 Jul 2021 02:19:39 +0200 Subject: [PATCH 14/21] refactored implementation --- .eslintrc.json | 11 +++++++++++ index.js | 35 +++++++++++++++-------------------- 2 files changed, 26 insertions(+), 20 deletions(-) create mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..286fcf8 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,11 @@ +{ + "parserOptions": { + "ecmaVersion": 2017 + }, + + "env": { + "browser": true, + "node": true, + "es6": true + } +} \ No newline at end of file diff --git a/index.js b/index.js index 774565e..95d2099 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ 'use strict'; -Object.defineProperty(exports, '__esModule', { value: true }); -const { isVue3 } = require('vue-demi'); +const { isVue3, inject } = require('vue-demi'); const { createClient } = require('@supabase/supabase-js') @@ -10,26 +9,22 @@ function useSupabase() { return inject(supabasesymbol); } +function install(app, options) { + const supabase = createClient(options.supabaseUrl, options.supabaseKey, options.supabaseOptions) -exports['default'] = { - useSupabase, - install: function (app, options) { - const supabase = createClient(options.supabaseUrl, options.supabaseKey, options.supabaseOptions) - - if (isVue3){ - app.config.globalProperties.$supabase = supabase; - app.provide(supabasesymbol, supabase); - } else { - Object.defineProperties(app.prototype, { - $supabase: { - get: function() { - return supabase; - }, + if (isVue3){ + app.config.globalProperties.$supabase = supabase; + app.provide(supabasesymbol, supabase); + } else { + Object.defineProperties(app.prototype, { + $supabase: { + get: function() { + return supabase; }, - }); - app.supabase = supabase; - } + }, + }); } } -module.exports = exports['default']; \ No newline at end of file +exports.install = install; +exports.useSupabase = useSupabase; \ No newline at end of file From a735908e08c55864eea346bc07ceded0fa349945 Mon Sep 17 00:00:00 2001 From: Sduu Date: Sun, 25 Jul 2021 02:58:41 +0200 Subject: [PATCH 15/21] Updated the readme to reflect incoming changes --- README.md | 38 +++++++++++++++++++++++++++++++++----- 1 file changed, 33 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 29e505f..d1927e6 100644 --- a/README.md +++ b/README.md @@ -2,13 +2,16 @@ A supa simple wrapper around Supabase.js to enable usage within Vue. -## Usage - -``` +## Installation +```bash +# Vue 3.x yarn add vue-supabase +# Vue 2.x +yarn add @vue/composition-api vue-supabase ``` - - +Note: Currently `@vue/composition-api` is required for this package to work for projects using Vue 2.x +## Usage +### Vue 2.x ```js import VueSupabase from 'vue-supabase' @@ -19,6 +22,31 @@ Vue.use(VueSupabase, { }); ``` +### Vue 3.x +```js +import VueSupabase from 'vue-supabase' + +const app = createApp(...) + +app.use(VueSupabase, { + supabaseUrl: '', + supaaseKey: '', + supabaseOptions: {}, + }) + +app.mount(...) +``` + +### Options API ```js const { data, error } = await this.$supabase.from("events").select("*"); ``` + +### Composition API +```js +import { useSupabase } from 'vue-supabase'; + +const supabase = useSupabase() + +const { data, error } = await this.$supabase.from("events").select("*"); +``` \ No newline at end of file From f36d1c7d416c5346cb7c21474fefdec6ba56c751 Mon Sep 17 00:00:00 2001 From: Sduu Date: Sun, 25 Jul 2021 03:40:27 +0200 Subject: [PATCH 16/21] provide supabase to Vue namespace --- index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/index.js b/index.js index 95d2099..c101b69 100644 --- a/index.js +++ b/index.js @@ -23,6 +23,7 @@ function install(app, options) { }, }, }); + app.supabase = supabase; } } From c14136cf449b96f9a145bdd3b242d7ad71ed5af4 Mon Sep 17 00:00:00 2001 From: Beautus <48126337+sduduzog@users.noreply.github.com> Date: Sun, 25 Jul 2021 04:33:50 +0200 Subject: [PATCH 17/21] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d1927e6..f6546e5 100644 --- a/README.md +++ b/README.md @@ -48,5 +48,5 @@ import { useSupabase } from 'vue-supabase'; const supabase = useSupabase() -const { data, error } = await this.$supabase.from("events").select("*"); -``` \ No newline at end of file +const { data, error } = await supabase.from("events").select("*"); +``` From 830d373c7c4eb0a423a14a185108f9eb81eddda2 Mon Sep 17 00:00:00 2001 From: Beautus <48126337+sduduzog@users.noreply.github.com> Date: Sun, 25 Jul 2021 04:35:27 +0200 Subject: [PATCH 18/21] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index f6546e5..406871b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ yarn add vue-supabase # Vue 2.x yarn add @vue/composition-api vue-supabase ``` -Note: Currently `@vue/composition-api` is required for this package to work for projects using Vue 2.x +Note: Currently `@vue/composition-api` is required for this package to work for projects using Vue 2.x even if the composition api is not used in that particular project ## Usage ### Vue 2.x ```js From ba7596453ae99e805dec852441d97e04ad64251c Mon Sep 17 00:00:00 2001 From: Beautus <48126337+sduduzog@users.noreply.github.com> Date: Sun, 25 Jul 2021 04:42:10 +0200 Subject: [PATCH 19/21] Delete .eslintrc.json --- .eslintrc.json | 11 ----------- 1 file changed, 11 deletions(-) delete mode 100644 .eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 286fcf8..0000000 --- a/.eslintrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "parserOptions": { - "ecmaVersion": 2017 - }, - - "env": { - "browser": true, - "node": true, - "es6": true - } -} \ No newline at end of file From dd46149b6b5232339122908d09f0c2dc6e039c0c Mon Sep 17 00:00:00 2001 From: Beautus <48126337+sduduzog@users.noreply.github.com> Date: Sun, 25 Jul 2021 04:43:07 +0200 Subject: [PATCH 20/21] Remove unused type --- index.d.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 5164858..269a602 100644 --- a/index.d.ts +++ b/index.d.ts @@ -15,8 +15,7 @@ declare module 'vue/types/vue' { * @returns SupabaseClient */ export function useSupabase(key?: string): SupabaseClient; -export const supabaseKey: string; export default { install(Vue: typeof Vue, options: any): void -} \ No newline at end of file +} From 732dc699e3108d552ca1095534aed24470c67613 Mon Sep 17 00:00:00 2001 From: Beautus <48126337+sduduzog@users.noreply.github.com> Date: Sun, 25 Jul 2021 04:44:29 +0200 Subject: [PATCH 21/21] Camel case for a variable --- index.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index c101b69..9ea3e89 100644 --- a/index.js +++ b/index.js @@ -3,10 +3,10 @@ const { isVue3, inject } = require('vue-demi'); const { createClient } = require('@supabase/supabase-js') -const supabasesymbol = Symbol('supabase'); +const supabaseSymbol = Symbol('supabase'); function useSupabase() { - return inject(supabasesymbol); + return inject(supabaseSymbol); } function install(app, options) { @@ -14,7 +14,7 @@ function install(app, options) { if (isVue3){ app.config.globalProperties.$supabase = supabase; - app.provide(supabasesymbol, supabase); + app.provide(supabaseSymbol, supabase); } else { Object.defineProperties(app.prototype, { $supabase: { @@ -28,4 +28,4 @@ function install(app, options) { } exports.install = install; -exports.useSupabase = useSupabase; \ No newline at end of file +exports.useSupabase = useSupabase;