Skip to content

Commit

Permalink
[Messages][JavaScript] Add schemas to npm package (#2010)
Browse files Browse the repository at this point in the history
* Copy schemas to messages/javascript when generating the package

* Remove debugging info from messages/js makefile

* Update CHANGELOG
  • Loading branch information
aurelien-reeves authored Jun 20, 2022
1 parent e2c3d2e commit ff6e215
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions messages/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

### Added

* [Javascript] Adding the json schemas of the messages to the NPM package
([PR#2010](https://github.com/cucumber/common/pull/2010))

### Changed

### Deprecated
Expand Down
6 changes: 5 additions & 1 deletion messages/javascript/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
include default.mk

JSONSCHEMAS = $(shell find ../jsonschema -name "*.json")
LOCAL_SCHEMAS = $(patsubst ../jsonschema/%, schema/%, $(JSONSCHEMAS))

.codegen: src/messages.ts src/version.ts
.codegen: src/messages.ts src/version.ts $(LOCAL_SCHEMAS)

schema/%.json: ../jsonschema/%.json
cp $< $@

src/messages.ts: $(JSONSCHEMAS) ../jsonschema/scripts/codegen.rb ../jsonschema/scripts/templates/typescript.ts.erb ../jsonschema/scripts/templates/typescript.enum.ts.erb
ruby ../jsonschema/scripts/codegen.rb TypeScript ../jsonschema typescript.ts.erb > $@
Expand Down
1 change: 1 addition & 0 deletions messages/javascript/schema/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.json
Empty file.

0 comments on commit ff6e215

Please sign in to comment.