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

[FEATURE] Add included/excludedDependencies parameter #380

Merged
merged 7 commits into from
Dec 16, 2019
Merged

[FEATURE] Add included/excludedDependencies parameter #380

merged 7 commits into from
Dec 16, 2019

Conversation

kristian
Copy link
Contributor

When setting the buildDependencies parameter to "true" builder
used to build all dependencies of the project. By adding two new
parameters includedDependencies and excludedDependencies,
similar to the existing included/excludedTasks parameters, one
can now choose which depenendencies to include into the build.

This is also useful for self-contained builds to include the built
depenendy into the bundle, instead of the unbuilt source read
from the file system (e.g. in case a transpile task is present).

Thank you for your contribution! 🙌

To get it merged faster, kindly review the checklist below:

Pull Request Checklist

@claassistantio
Copy link

claassistantio commented Dec 11, 2019

CLA assistant check
All committers have signed the CLA.

@coveralls
Copy link

coveralls commented Dec 11, 2019

Coverage Status

Coverage increased (+0.3%) to 90.571% when pulling c2742e7 on kristian:master into b7d4aad on SAP:master.

When setting the buildDependencies parameter to "true" builder
used to build all dependencies of the project. By adding two new
parameters includedDependencies and excludedDependencies,
similar to the existing included/excludedTasks parameters, one
can now choose which depenendencies to include into the build.

This is also useful for self-contained builds to include the built
depenendy into the bundle, instead of the unbuilt source read
from the file system (e.g. in case a transpile task is present).
After introducting included/excludedDependencies w/ commit 48cd30d,
the buildDependencies parameter is no longer required. To build all
dependencies excludedDependencies can be set to an empty array, to
build no dependencies (default) excludedDependencies can be set to ["*"]

This change prepares the deprecation of the parameter, by introducing
a warning when buildDependencies is set (commented at the moment, as
buildDependencies is still used by many internal dependencies) and by
setting the new parameters feature comatible if buildDependencies is set
@RandomByte RandomByte self-requested a review December 11, 2019 17:53
@RandomByte RandomByte added the enhancement New feature or request label Dec 11, 2019
@RandomByte RandomByte requested a review from matz3 December 11, 2019 17:55
This change adds tests to builder for bulding bundles using parameters
buildDependencies, included/excludedDependencies, selfContained and a
combination thereof. All these have previously been untested.
This comes in handy, e.g. in case all UI5 libraries should be excluded
from the build (excludedDependencies=[/^sap\.ui\./])
During usage of the builder having the buildDependencies parameter
still in place, eventhough solely having included/excludedDependencies
*could* replace the parameter, was prooven to be more intuitive.

a) Leaving the parameter as is, won't break any existing implementation
b) Setting the flag to true and *then* defining the includes / excludes
   somehow feel "more natural"
c) Due to the default beeing set to an empty array, the logic in builder
   must not filter any dependencies if buildDependencies is set to false
lib/builder/builder.js Outdated Show resolved Hide resolved
lib/builder/builder.js Outdated Show resolved Hide resolved
lib/builder/builder.js Outdated Show resolved Hide resolved
test/lib/builder/builder.js Show resolved Hide resolved
@RandomByte RandomByte changed the title Add included/excludedDependencies to builder [FEATURE] Add included/excludedDependencies parameter Dec 16, 2019
@RandomByte RandomByte merged commit d6ac24a into SAP:master Dec 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants