Skip to content

Commit 356ae43

Browse files
Jace BennestHubbs
authored andcommitted
allow specifying composer package versions for modules
1 parent b1e4ae4 commit 356ae43

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ For detailed explanation on how things work, checkout the [guide](http://vuejs-t
7272
"type": "string",
7373
"description": "The composer package to be added to the download."
7474
},
75+
"composer_package_version": {
76+
"type": "string",
77+
"description": "The composer package version. Defaults to *"
78+
},
7579
"sponsored": {
7680
"type": "boolean",
7781
"description": "Flag a sponsored card."

src/store/actions.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,17 @@ export default {
1414
let vSections = state.sections
1515
for (let section in state.summary) {
1616
state.summary[section].activeIndex.forEach(function (index) {
17+
let require = []
18+
// Add the package name if exists.
1719
if (vSections[section].options[index].composer_package) {
18-
packages.push(vSections[section].options[index].composer_package)
20+
require.push(vSections[section].options[index].composer_package)
21+
// Add the package version if specified.
22+
if (vSections[section].options[index].composer_package_version) {
23+
require.push(vSections[section].options[index].composer_package_version)
24+
} else {
25+
require.push('*')
26+
}
27+
packages.push(require)
1928
}
2029
})
2130
}

src/store/sections.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ const sections = {
119119
image_src: '/static/gfx/paylogos/paypal.png',
120120
sponsored: true,
121121
composer_package: 'drupal/commerce_paypal',
122+
// composer_package_version: '*',
122123
location: locations.LOCATION_INTL,
123124
package_link: 'https://www.drupal.org/project/commerce_paypal',
124125
},

0 commit comments

Comments
 (0)