Baremetrics / calendar

Date range picker for Baremetrics
MIT License
681 stars 79 forks source link

Request: Publish to npm #45

Closed tinyfly closed 5 years ago

tinyfly commented 8 years ago

Could you publish this to npm? I think the only thing that might be needed in package.json is a "main" entry pointing to your Calendar.js file.

kalepail commented 8 years ago

I tried awhile back, ran into some weird issues and haven't had the need or time to get through them. Anyone else is welcome to try though.

warrenbuckley commented 8 years ago

@tyvdh do you have a copy of the error/logs that you were seeing when trying to publish this to NPM. Obviously its best that the package author publishes this onto NPM rather than say myself with my key/account

kalepail commented 7 years ago

https://www.npmjs.com/package/baremetrics-calendar

hoverlover commented 7 years ago
➜  txt2give-dashboard git:(master) ✗ npm i --save BaremetricsCalendar
txt2give-dashboard@1.0.0 /Users/cboyd/code/txt2give-dashboard
└── BaremetricsCalendar@1.0.8

webpack.config.js:

module.exports = {
  entry: {
    vendor: [
      'BaremetricsCalendar',
      ...

webpack -p output:

ERROR in multi vendor
Module not found: Error: Cannot resolve module 'BaremetricsCalendar' in /Users/cboyd/code/txt2give-dashboard
 @ multi vendor

Any ideas? Can't seem to get past this.

hoverlover commented 7 years ago

After tinkering, I think @tinyfly is correct. @tyvdh, you commented with the link to the npm repo but I still don't see a main entry in package.json. @warrenbuckley is right, it would be better for you to publish to the NPM repo if possible.

hoverlover commented 7 years ago

Btw, fixed using a webpack resolve alias:

webpack.config.js:

module.exports = {
  ...
  resolve: {
    ...
    alias: {
      'BaremetricsCalendar': path.join(__dirname, "node_modules", "BaremetricsCalendar", "public/js/Calendar.js"),
    },
  }
  ...
}

Still would be nice to have a main entry. The documentation for webpack is kinda notorious for being a bit vague so it typically is hard to figure out workarounds like this.

leonardofaria commented 7 years ago

Using webpack 2:

resolve: {
  alias: {
    BaremetricsCalendar: path.resolve('./node_modules/BaremetricsCalendar/public/js/Calendar.js'),
  },
},

And inside your code:

import Calendar from 'BaremetricsCalendar'
hheimbuerger commented 6 years ago

@tyvdh Can this issue please be reopened? The aforementioned hack works for me, but I wish it wasn't needed.

kalepail commented 6 years ago

I'll try and get to this once we hit our next bug sprint week in a couple weeks.

kalepail commented 5 years ago

Just updated https://www.npmjs.com/package/baremetrics-calendar Give it a try when you get the chance!