SauravKanchan / svelte-chartjs

svelte wrapper for chart.js
https://saurav.tech/mdbsvelte/?path=/story/charts--examples
MIT License
278 stars 34 forks source link

refactor(sandboxes): update package.json for each sample to use latest source #139

Closed dysfunc closed 5 months ago

dysfunc commented 5 months ago

I made the change that produces the smallest diff. You could also create an alias inside vite, but this does the same thing.

import { defineConfig } from 'vite';
import { svelte } from '@sveltejs/vite-plugin-svelte';
import path from 'path';

export default defineConfig({
  plugins: [svelte()],
  resolve: {
    alias: {
      'svelte-chartjs': path.resolve(__dirname, '../../')
    }
  }
});
niemyjski commented 5 months ago

Do you know if this will work from code sandbox https://codesandbox.io/s/github/SauravKanchan/svelte-chartjs/tree/master/sandboxes/bar ?

dysfunc commented 5 months ago

Do you know if this will work from code sandbox https://codesandbox.io/s/github/SauravKanchan/svelte-chartjs/tree/master/sandboxes/bar ?

Oh, if you're going to link out then those files shouldn't change. Once you deploy the new version, that warning will go away about the missing exports.

dysfunc commented 5 months ago

Are you planning to treat this as a major release (v4.0.0) since we modified bundling? If so, we could change the sandbox to reference ^4.0.0 now. Either way, these changes are no good since it requires installing the specific chartjs version.

niemyjski commented 5 months ago

@dysfunc good catch, I didn't think so because it was just the bundling folder which tools should pick up on. Is there anything I'm missing?

dysfunc commented 5 months ago

I think it's fine. It's just a way to control who receives the latest since they'll need to manually update the major, but I don't think that's needed.