He, we currently have the problem, that we can't install highcharts libraries from code.highcharts.com anymore. There is a Cloudflare rate limit in place ...
A normal composer install can already fail for us - using 10 highcharts libraries.
We already use npm-assets to install other libraries - but running
composer require npm-assets/highcharts
results in a different file structure for the libraries - the main libraries are within /web/libraries/highchart (e.g. /web/libraries/highchart/highcharts.js ) and additional modules in /web/libraries/highchart/modules/ (e.g. /web/libraries/highchart/modules/data.js )
Is there a way to use npm-asset as an alternative? Or, should I create softlinks in the known file structure for charts?
I found https://www.drupal.org/project/charts/issues/3525615 - but this seems to be a different npm workflow, right?
Issue fork charts-3575378
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
maheshcv commentedYou can try using the equivalent url path in composer file like this 'https://cdn.jsdelivr.net/npm/package@version/file'
ex: https://cdn.jsdelivr.net/npm/highcharts@12.5.0/modules/export-data.js
Comment #3
vistree commentedThank you @maheshcv,
for now I use the npm-asset and created a script, that will run on each composer install to create the needed folder structure and symlinks to the needed libraries.
Comment #4
pingwin4egThank you @maheshcv , your solution works.
Comment #7
andileco commentedHi! I have switched to using jsdelivr.net, and I used this opportunity to bump the Highcharts version as well. I have tested locally with the Charts API Example module enabled and the default library set to Highcharts. I don't see any visual changes. I would appreciate review.
Comment #8
andileco commentedComment #9
andileco commentedMarking this RTBC based on:
Comment #10
andileco commentedComment #12
vistree commented@anileco,
thank you for your work!! I tested on our environments - and your patch works fine ;-)
Comment #13
andileco commentedThank you for confirming, @vistree!