Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npm package ? #87

Closed
mdartic opened this issue Nov 28, 2016 · 11 comments
Closed

npm package ? #87

mdartic opened this issue Nov 28, 2016 · 11 comments

Comments

@mdartic
Copy link
Contributor

mdartic commented Nov 28, 2016

Hello again,

I'm using npm to instantiate my projects, and not bower.

There isn't any npm package published yet, I think it could be nice.

But, with npm, we can install a package directly from his github URL, for example

npm install socib/Leaflet.TimeDimension#d579118

I encounter some errors :

npm ERR! Linux 4.4.0-47-generic
npm ERR! argv "/home/mdartic/.nvm/versions/node/v4.4.7/bin/node" "/home/mdartic/.nvm/versions/node/v4.4.7/bin/npm" "install" "socib/Leaflet.TimeDimension#d579118"
npm ERR! node v4.4.7
npm ERR! npm  v2.15.8
npm ERR! code E404

npm ERR! 404 Registry returned 404 for GET on https://registry.npmjs.org/iso8601-js-period
npm ERR! 404 
npm ERR! 404 'iso8601-js-period' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'leaflet-timedimension'
npm ERR! 404 
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

This is due to the iso8601-js-period that is not declared into npmjs registry.

Several questions :

  • what do you think about publishing this plugin in npm ?
  • do you agree i make a PR to update package.json and add iso8601-js-period in dependency ?
@bielfrontera
Copy link
Contributor

Hi @mdartic,
we should make a PR at iso8601-js-period, or ask @phammer if he can add a package.json in their repository, no?

Here, I assume we should change:
"iso8601-js-period": "*",
by:
"iso8601-js-period": "nezasa/iso8601-js-period",

And its ok for me to publish the plugin in npm!

@mdartic
Copy link
Contributor Author

mdartic commented Nov 29, 2016

I'll do that, but I checked the repo and I didn't see any activity since the last commit in 2013.

So, I prefer to add the repo first in your package.json and after see if there is any chance to transform iso8601 in a npm package.

@mdartic
Copy link
Contributor Author

mdartic commented Nov 29, 2016

So, in fact I've created the npm package of iso8601-js-period.

I didn't remember npm installneed a repo with a package.json.

Thanks for reviewing the PR.

@bielfrontera
Copy link
Contributor

thanks @mdartic! merged! :)

@mdartic
Copy link
Contributor Author

mdartic commented Nov 29, 2016

Great, thank you, could you publish it to npm ?

@bielfrontera
Copy link
Contributor

done. Can you test it?

@mdartic
Copy link
Contributor Author

mdartic commented Nov 29, 2016

Well, the package is well published,

But I encounter an error with the initialisation of the plugin.

I use webpack, and I import leaflet-timedimension.

When I execute the code, I get the error in the browser

leaflet.timedimension.min.js:18Uncaught ReferenceError: jQuery is not defined

And if I import jQuery before leaflet-timedimension in my code, same result.

If you have an idea, I'll take it !

Else, maybe I'm gonna make a PR for #86 :-)

@mdartic
Copy link
Contributor Author

mdartic commented Nov 29, 2016

By the way, thanks for publishing it !

@mdartic
Copy link
Contributor Author

mdartic commented Nov 29, 2016

To make it work for the moment, we have to include a script tag and load jQuery basically before the bundle of webpack, or the plugin itself.

Just like if we were writing vanilla JS.

But it's ok, and I close the issue. I'm gonna work on #86 to make the integration better.

@mdartic mdartic closed this as completed Nov 29, 2016
@bielfrontera
Copy link
Contributor

I managed to make it work with webpack (v1) with these instructions:

require('iso8601-js-period');
window.jQuery = require('jquery');
require('leaflet');
require('leaflet-timedimension');

I think this is related to #12

@mdartic
Copy link
Contributor Author

mdartic commented Nov 29, 2016

Thank you ! Works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants