perarnborg / vuex-oidc

Vuejs (with vuex) wrapper for open id authentication
MIT License
232 stars 65 forks source link

package cannot be used from git #95

Open dschmidt opened 4 years ago

dschmidt commented 4 years ago

Hey Per,

for starters: thanks for the quick feedback loop in my other ticket/PRs :-)

While I was adjusting the PR according to your feedback, I noticed that it's not possible to simply use an unreleased version of this lib from Github.

There are basically two changes needed because the dist file is obviously missing from this repo (and gladly so, I really dislike compiled code in repositories):

diff --git a/package.json b/package.json
index 11975e6..f7df75d 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
     "url": "git+https://github.com/perarnborg/vuex-oidc.git"
   },
   "main": "dist/vuex-oidc.cjs.js",
-  "module": "dist/vuex-oidc.esm.js",
+  "module": "src/main.js",
   "typings": "index.d.ts",
   "peerDependencies": {
     "oidc-client": ">= 1.6.1",
@@ -60,6 +60,7 @@
   },
   "files": [
     "dist",
-    "index.d.ts"
+    "index.d.ts",
+    "src"
   ]
 }

With those changes in place I can point my package.json to my branch and just use it. It would be nice to be able to do this in general and not depend on a new npm release after a fix has been merged (or even just using an existing PR for the time being).

My proposal is to include this change in the repo and let your release script basically revert the change before uploading to npm.

perarnborg commented 4 years ago

OK, let me just read up on this before I make these changes. I will publish the package to npm as soon as I merge the final PR.

dschmidt commented 4 years ago

Yep, sure. I'm no expert on that topic either, I just like to be able to point to git revision from package.json :)