Skip to content
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

Rebuild package without dev dependencies #290

Merged
merged 2 commits into from
Jun 25, 2016
Merged

Conversation

jhedstrom
Copy link
Member

cwd: destPath
}
});
tasks.push('composer:install');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can anyone think of a reason someone would create a task that executes package followed by a composer operation that needs -dev?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grayside That would only be a problem if also executed in the packaged output, right? The dev dependencies will still exist in the project root.

@arithmetric arithmetric added this to the 1.0.0 milestone Jun 22, 2016
@arithmetric
Copy link
Collaborator

It looks like the tests are failing for D7. Can this Composer task be conditional on if the Composer build process is used?

tasks.push('composer:install');
// If the `composer.json` file is being packaged, rebuild composer dependencies without dev.
if (projFiles.find(function (pattern) {
return pattern.startsWith('composer');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this recursive? Is it a problem if it finds composer.lock but composer.json is missing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It shouldn't be recursive, it's just looking at the actual projFiles array specification (composer.* is the pattern in the test config).

@grayside
Copy link
Contributor

The latest commit raises a question to my mind:

If Drupal core has a composer.json and the project has it's own composer.json... how do we put both into the Drupal docroot and run composer install? Shouldn't that recurse reality?

@jhedstrom
Copy link
Member Author

jhedstrom commented Jun 23, 2016

how do we put both into the Drupal docroot and run composer install? Shouldn't that recurse reality?

This expects the following packaged structure:

\
composer.json
composer.lock
README.md
...
build\
  html\
  index.php
  ...
  core\
    composer.json

Note there is no composer.json file at the docroot, only in core. This differs from downloading a tarball of core, or using the core git repo directly since those do include a docroot-level composer.json file. The recursion there is handled by wikimedia/composer-merge-plugin, which then descends into the core directory.

@grayside
Copy link
Contributor

Does the composer install --no-dev re-download already downloaded dependencies?

@jhedstrom
Copy link
Member Author

Not once there is a .lock file. In manual testing it takes a matter of seconds since the libraries are cached by composer.

@jhedstrom
Copy link
Member Author

screen shot 2016-06-23 at 3 31 31 pm

@arithmetric arithmetric merged commit 778e22c into master Jun 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants