Godofbrowser/vuejs-dialog

Cloning / building on your own

hjortzen opened this issue · 8 comments

Hi!

I recently forked the project and was looking into building and developing within the project.
Possibly contributing a couple of features, if all goes well.

But:

  • Master doesn't compile
  • Backing to earlier commit and running 'npm run build' complains on a post-build step (something regarding copying docs.js)

Being a newbie in JS-projects and especially using webpack I'm wondering how I can set up a development environment doing continuous development? I couldn't see anything within the project indicating that it can be run (i.e. lacking a index.html). The webpack config however contains webpack-server directives in 'npm run hot', indicating that you run something like that locally?

My only other option is to do a 'npm run build' and copying the dist/vuejs-dialog.min.js to a sample application per development change.

Anyway, I'm probably missing something here, please advice!

Hello @hjortzen , thanks for offering to help.

  • Master should compile without issues, what errors are you getting?

  • Yeah, there's a post-build script added to always copy the bundle into the docs folder once bundling is complete. When this happens, i then load the index.html in the docs folder and within that window i'll have access to vm.$dialog on the browser console and can call any of it's methods.

That way, you'll avoid having to manually copy dist/vuejs-dialog.min.js

Obviously might not be the best way, but if there's a better solution i'll be glad to learn about it. I'm still very new to module bundling.

@hjortzen You're right. Some files were not included in the last commit. mixins. It should now build without errors.

Well, first of all I'm getting the same error regarding the mix-ins that seem to be missing (forgot to commit?) that your CI is complaining about on your master.

I don't have access to my development enviroment at the moment (back on monday) but regarding the copy-docs.js error I was getting; it seemed to be complaining about paths or something. You should be able to recreate problem by checking out clean and doing a short

  • npm install
  • npm run build

Seems this it seemed to be complaining about paths or something OS related. I'll look into it and get back to you. Thanks.

Perfect! Looking forward into getting my hands dirty on monday and hopefully being able to contribute with something (we have a couple of features we'd like to use and hopefully you'll agree with us that they are of general interest).

If it helps, this is my env:
MacOS, High Sierra
Node installed via Homebrew (brew install node)

@hjortzen Yeah, it was helpful and hopefully this should fix it. I'm interested in discussing these features coming in too.

I can confirm that everything is running now!
(Accessed my dev environment and merged the changes)
Thank you for committing changes so rapidly!

To get things straight: You open the docs/index.html in a browser and test that way?
You're not running the web pack dev server for immediate changes and reloads?
(If not then I'll start playing a little with that and we'll see if I can contribute that first off, I believe the web pack dev server does a lot of good :) )

Yeah, that's correct. I open docs/index.html which already has the plugin installed to a vue model registered on the window (window.vm). This allows me call the plugin methods vm.$dialog.confirm() from the browser console. But then, i get to manually reload the page anytime a file changes and the module rebuilds.

So going the route of the webpack dev server like you suggested would be great. I'll be delighted to have that PR.