Skip to content

Commit

Permalink
[Messages][Javascript] Prevent ignoring schemas from npm package (#2020)
Browse files Browse the repository at this point in the history
* Prevent ignoring schemas from npm package

* Update changelog

* Restore content from gherkin/php/composer.json

* Fix post-release for gherkin php
  • Loading branch information
aurelien-reeves authored Jun 22, 2022
1 parent 664ae4c commit 49e073d
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 4 deletions.
37 changes: 37 additions & 0 deletions gherkin/php/composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"name": "cucumber/gherkin",
"description": "Gherkin parser",
"author": "Cucumber Limited <[email protected]>",
"license": "MIT",
"type": "library",
"autoload": {
"psr-4": {
"Cucumber\\Gherkin\\": [
"src/",
"src-generated/"
]
}
},
"require": {
"php": "^8.1",
"ext-mbstring": "*",
"cucumber/messages": "^18.0||^19.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"vimeo/psalm": "^4.20",
"friendsofphp/php-cs-fixer": "^3.5",
"psalm/plugin-phpunit": "^0.17.0"
},
"repositories": [
{
"type": "path",
"url": "../../messages/php",
"options": {
"versions": {
"cucumber/messages": "18.0.0"
}
}
}
]
}
3 changes: 3 additions & 0 deletions messages/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Fixed

* [Javascript] Schema was still ignored from 19.1.1 due to how npm manages the files attribute in package.json
([PR#2020](https://github.com/cucumber/common/pull/2020))

## [19.1.1] - 2022-06-22

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion messages/javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"files": [
"dist/cjs",
"dist/esm",
"schema"
"schema/*.json"
],
"module": "dist/esm/src/index.js",
"exports": {
Expand Down
3 changes: 3 additions & 0 deletions messages/javascript/schema/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.gitkeep
.gitignore
!*.json
9 changes: 6 additions & 3 deletions messages/php/scripts/update-gherkin-dependency.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,14 @@

if (str_contains($dependencyString, $newDependency)) {
fwrite(STDERR, 'Nothing to update, already depends on ' . $newDependency . "\n");
exit(0);
$newDependency = '';
}

// '||' is OR
$newDependencyString = $dependencyString . '||' .$newDependency;
$newDependencyString = $dependencyString;
if ($newDependency !== '') {
// '||' is OR
$newDependencyString = $dependencyString . '||' .$newDependency;
}

$json['require']['cucumber/messages'] = $newDependencyString;

Expand Down

0 comments on commit 49e073d

Please sign in to comment.