-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support verbatim module syntax option in typescript (#16)
* support verbatim module syntax option in typescript * Add specs * Update CHANGELOG.md --------- Co-authored-by: Svyatoslav Kryukov <[email protected]>
- Loading branch information
Showing
12 changed files
with
82 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<%- interfaces.each do |interface| -%> | ||
<%- if interface.config.verbatim_module_syntax -%> | ||
export type { <%= interface.name %> } from './<%= interface.filename %>' | ||
<%- else -%> | ||
export type { default as <%= interface.name %> } from './<%= interface.filename %>' | ||
<%- end -%> | ||
<%- end -%> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Typelizer digest a6d580654a084cc58071460e42093126 | ||
// | ||
// DO NOT MODIFY: This file was automatically generated by Typelizer. | ||
|
||
type AlbaVerbatimModuleSyntax = { | ||
id: number; | ||
username: string; | ||
} | ||
|
||
export type { AlbaVerbatimModuleSyntax }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Typelizer digest 4f6b6fed16d511dbfe9a02a0b7aa9c41 | ||
// | ||
// DO NOT MODIFY: This file was automatically generated by Typelizer. | ||
|
||
type AmsVerbatimModuleSyntax = { | ||
id: number; | ||
username: string; | ||
} | ||
|
||
export type { AmsVerbatimModuleSyntax }; |
10 changes: 10 additions & 0 deletions
10
spec/__snapshots__/OjSerializersVerbatimModuleSyntax.ts.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// Typelizer digest c0f49e6c7ece40d4d23624555e33da67 | ||
// | ||
// DO NOT MODIFY: This file was automatically generated by Typelizer. | ||
|
||
type OjSerializersVerbatimModuleSyntax = { | ||
id: number; | ||
username: string; | ||
} | ||
|
||
export type { OjSerializersVerbatimModuleSyntax }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
spec/app/app/serializers/alba/verbatim_module_syntax_serializer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Alba | ||
class VerbatimModuleSyntaxSerializer < BaseSerializer | ||
typelize_from ::User | ||
|
||
attributes :id, :username | ||
|
||
typelizer_config.verbatim_module_syntax = true | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
spec/app/app/serializers/ams/verbatim_module_syntax_serializer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Ams | ||
class VerbatimModuleSyntaxSerializer < BaseSerializer | ||
typelize_from ::User | ||
|
||
attributes :id, :username | ||
|
||
typelizer_config.verbatim_module_syntax = true | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
spec/app/app/serializers/oj_serializers/verbatim_module_syntax_serializer.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module OjSerializers | ||
class VerbatimModuleSyntaxSerializer < BaseSerializer | ||
typelize_from ::User | ||
|
||
attributes :id, :username | ||
|
||
typelizer_config.verbatim_module_syntax = true | ||
end | ||
end |