Skip to content

Commit

Permalink
composer.json 'scripts' entries can be strings (#91)
Browse files Browse the repository at this point in the history
* composer.json 'scripts' can be string

Fixes #90

* a little smoke test addition for 'scripts' for now

refs #90
  • Loading branch information
dzuelke authored Jun 4, 2024
1 parent 7e44e5a commit cc624cd
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions buildpacks/php/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `buildpack.toml` declaration of `[[stacks]]` has been replaced with `[[targets]]`, currently supporting Ubuntu 20.04 and 22.04 (both `amd64`)
- Bump versions of Composer and minimal PHP for bootstrapping to 2.7.6 and 8.3.7

### Fixed

- Strings should be allowed as values in `scripts` object in `composer.json` ([#90](https://github.com/heroku/buildpacks-php/issues/90))

## [0.1.2] - 2023-10-24

### Changed
Expand Down
7 changes: 7 additions & 0 deletions buildpacks/php/tests/fixtures/smoke/hello-world/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,12 @@
},
"config":{
"bin-dir": "sbin"
},
"scripts": {
"foo": "echo 'foo'",
"bar": [
"echo 'one'",
"echo 'two'"
]
}
}
1 change: 1 addition & 0 deletions composer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ pub struct ComposerBasePackage {
pub repositories: Option<Vec<ComposerRepository>>,
pub require: Option<HashMap<String, String>>,
pub require_dev: Option<HashMap<String, String>>,
#[serde_as(as = "Option<HashMap<_, OneOrMany<_, PreferOne>>>")]
pub scripts: Option<HashMap<String, Vec<String>>>,
pub scripts_descriptions: Option<HashMap<String, String>>,
pub source: Option<ComposerPackageSource>,
Expand Down

0 comments on commit cc624cd

Please sign in to comment.