-
Notifications
You must be signed in to change notification settings - Fork 819
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
Add a composer.json file to make headroom.js installable as part of a drupal module #319
base: master
Are you sure you want to change the base?
Conversation
Hmm is this necessary? Why is there a need for explicit support for drupal? Excuse my ignorance, I'm totally unfamliar with Drupal and its ecosystem |
Sorry for the slow reply. |
Why would you manage JS dependencies with Composer and not NPM? |
That's what I'm wondering too. Why not npm/yarn? |
An issue on the Drupal project (https://www.drupal.org/project/headroomjs/issues/3019252) implied that this was the way to do it, but on reflection I wonder if the main aim was to make it install to a /libraries folder, rather than /node-modules. Their installation process is quite manual (https://www.drupal.org/project/headroomjs) and I was attempting to make it more standard, but maybe I went about it the wrong way... |
Not sure I understand how Drupal deals with this 100% but it seems like this would require Still not 100% sure this is the way to go. Some things online seem to show it's possible to install dependencies directly from NPM/GitHub via something like this:
|
I'd rather find a solution that doesn't involve adding new config files to the repo. Is the goal here to simplify installing the drupal headroom project? If so, I would recommend changing the install steps to avoid getting and extracting a zip from github, and instead get all the (published) files from unpkg.com: |
@CuriousCactus hey, do you have anything to add? |
I created a fork of this repo so I could add a composer.json file, so that it can be correctly installed using composer for use with this Drupal module.
The issue discussing this is here.
The user would then need to add the code below to their project's composer.json file.
(replace curiouscactus with wickynilliams if you accept this pull request, both in the code below and in the composer.json file I added)