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

Command icon 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

vistree created an issue. See original summary.

maheshcv’s picture

You 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

vistree’s picture

Thank 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.

pingwin4eg’s picture

Thank you @maheshcv , your solution works.

andileco made their first commit to this issue’s fork.

andileco’s picture

Status: Active » Needs review

Hi! 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.

andileco’s picture

andileco’s picture

Status: Needs review » Reviewed & tested by the community

Marking this RTBC based on:

  • Comments 3 and 4 confirming the direction from comment 2, which is what I used for the patch
  • Automated tests pass
  • I have tested on a fresh install using the CDN and installing with Composer
  • The charts from Charts API Example are identical to 12.4.0
andileco’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

vistree’s picture

@anileco,
thank you for your work!! I tested on our environments - and your patch works fine ;-)

andileco’s picture

Thank you for confirming, @vistree!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.