Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions 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
- Add `Attachment.testRunHookStartedId` for traceability of attachments to test run hooks ([#301](https://github.com/cucumber/messages/pull/301))

### Changed
- [JavaScript] BREAKING CHANGE: Emit types instead of classes ([#287](https://github.com/cucumber/messages/pull/287))

### Fixed
- [python] Add a LICENSE file for Python ([#278](https://github.com/cucumber/messages/pull/278))
- [.NET] Fix NuGet package generation
Expand Down
12 changes: 2 additions & 10 deletions codegen/templates/typescript.ts.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import { Type } from 'class-transformer'
import 'reflect-metadata'

<% @schemas.each do |key, schema| -%>
export class <%= class_name(key) -%> {
export type <%= class_name(key) -%> = {
<%- schema['properties'].each do |property_name, property| -%>

<%- ref = property['$ref'] || property['items'] && property['items']['$ref'] -%>
<%- if ref -%>
<%- %> @Type(() => <%= class_name(ref) -%>)
<%- end -%>
<%- if (schema['required'] || []).index(property_name) -%>
<%- %> <%= property_name %>: <%= type_for(class_name(key), property_name, property) -%> = <%= default_value(class_name(key), property_name, property) -%>
<%- %> <%= property_name %>: <%= type_for(class_name(key), property_name, property) -%>
<%- else -%>
<%- %> <%= property_name %>?: <%= type_for(class_name(key), property_name, property) -%>
<%- end -%>
Expand Down
48 changes: 8 additions & 40 deletions javascript/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions javascript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
"prepublishOnly": "npm run build && npm run copy-schemas"
},
"dependencies": {
"@types/uuid": "10.0.0",
"class-transformer": "0.5.1",
"reflect-metadata": "0.2.2",
"uuid": "11.1.0"
"uuid": "11.0.5"
},
"devDependencies": {
"@types/mocha": "10.0.10",
Expand Down
Loading
Loading