Граф коммитов

2709 Коммитов

Автор SHA1 Сообщение Дата
Mark Probst 6fc4e77ba9 Unify check for whether a type needs a transformer 2018-06-17 07:44:18 -07:00
Mark Probst 2f93024d6b Make getArrayType take type attributes 2018-06-17 07:44:18 -07:00
Mark Probst cb604a40e2 Use converter for nullable integer-strings, too 2018-06-17 07:44:18 -07:00
Mark Probst 50aa32b7d8 Add test case 2018-06-17 07:44:18 -07:00
Mark Probst 5a152c303c Stringified integers 2018-06-17 07:44:15 -07:00
Mark Probst 089ddf9c70 Simplify UnionAccumulator 2018-06-15 23:30:10 -07:00
Mark Probst 84a2a60e84
Merge pull request #902 from uhop/better-use-stream-json
Better leverage of stream-json to speed things up a little.
2018-06-15 20:09:42 -07:00
Eugene Lazutkin 208d40eb56
Added proper typing. 2018-06-15 21:53:56 -05:00
Eugene Lazutkin c810119075
Replacing three linear checks with a regular expression. 2018-06-15 21:01:40 -05:00
Eugene Lazutkin e7c526076a
Make flag purely boolean. 2018-06-15 20:47:26 -05:00
Eugene Lazutkin d3e6394567 Saved on checks for a number. 2018-06-15 16:40:23 -05:00
Eugene Lazutkin 912345af1a Removed unnecessary property. 2018-06-15 16:37:29 -05:00
Eugene Lazutkin 672b831ff2 Better leverage of stream-json to speed things up a little. 2018-06-15 16:23:30 -05:00
Mark Probst 93c39e581a
Merge pull request #893 from quicktype/more-granular-decoding
More granular decoding
2018-06-11 08:09:32 -07:00
Mark Probst 62872a6519 Don't reconstitute a type twice when remapping 2018-06-11 07:01:48 -07:00
Mark Probst aa7c3f1449 Don't "decode" null 2018-06-11 06:48:40 -07:00
Mark Probst 2396d54e0c Make DecodingChoiceTransformer not decode
If it decodes itself then we can't do custom decoding in the cases.  For
example, we might want to decode an array to transform its elements
without while decoding.  We need this for stringified integers, for
example.
2018-06-10 23:50:56 -07:00
Mark Probst 12860eea06 Add a fixed point rewrite step before making transformations
We still have some duplicate unions lying around sometimes, for example
in `kitchen-sink.json`.  This will get rid of them.  The main issue with
them is that we will create a transformation for each one of them, all
of them duplicates of each other.
2018-06-10 23:50:56 -07:00
Mark Probst 4f43aaf48a Use remap for GC 2018-06-10 23:50:52 -07:00
Mark Probst e88036f292
Merge pull request #891 from quicktype/fix-transformed-types
Use transformation's target types in properties
2018-06-10 16:43:57 -07:00
Mark Probst cf951744c1 Use transformation's target types in propertiesIf we don't, we end up with the non-transformed source types, suchas "string" for enums, or "object" for unions. 2018-06-10 16:09:08 -07:00
Solomon Victorino 7f4d2bcb2b Style changes for the base class option (#890)
* Style changes for the base class option
2018-06-08 15:51:17 -07:00
Solomon Victorino 36e7ae136e WIP: Add superclass options to the NewtonsoftCSharpTargetLanguage (#886)
* NewtonsoftCSharpTargetLanguage: Emit superclass option

includes Microsoft.Azure.Mobile.Server EntityData class option
forbids superclass name in NewtonsoftCSharpRenderer
overrides superclassForType to return _options.superclass

* Set OptionType to "secondary" for superclass

* Changed equality operator

* Explicitly check if superclass is undefined if needed

* No need for this conditional statement
2018-06-08 13:26:41 -07:00
Mark Probst 23e7616123
Merge pull request #888 from bitsol/fix-handling-undefined-option-value
Fixed handling of undefined option values
2018-06-08 13:10:29 -07:00
Solomon Victorino 4e30f58cdc Fixed handling of undefined option values 2018-06-08 12:51:20 -07:00
Solomon Victorino f174cadc81 Fix watch script directory (#887)
* Fix watch script directory
2018-06-08 12:47:55 -07:00
Mark Probst e720b518e3
Merge pull request #884 from quicktype/update-collection-utils
Update collection-utils
2018-06-07 08:15:03 -07:00
Mark Probst 6acab7c8c9 Update collection-utils 2018-06-07 07:45:43 -07:00
Mark Probst 65203b4194
Merge pull request #883 from quicktype/graphql
GraphQL fixes
2018-06-05 08:02:05 -07:00
Mark Probst 6cf8f164d6 data property in GraphQL response must be nullable
It can be null if there are errors.
2018-06-04 21:29:20 -07:00
Mark Probst 5def2610bf Allow specifying HTTP method for GraphQL introspection. Fixes #619 2018-06-04 20:28:10 -07:00
Mark Probst f5fe060cce Stringify GraphQL introspection errors 2018-06-04 19:37:00 -07:00
Mark Probst 59e2344584 Use collection-utils 2018-06-04 18:56:15 -07:00
Daichi Jameson 0513ddda79 Changed arrow methods to being regular methods in C++ Renderer and exported TypeContext (#878)
* Changed all arrow methods in classes to be regular methods. Also exported TypeContext to support this.

* Changed locations that passed functions in previously to pass anonymous functions since proper functions can't be passed around in Typescript
2018-05-31 19:43:39 -07:00
Daichi Jameson bad32ae7c4 Fixed bug #876 (#877)
* Fixed Issue #876
2018-05-31 09:11:59 -07:00
Daichi Jameson 27ef1c6de3 Enabled the option to select between upper cased and capitalized acronyms in camel and pascal case for C++ (#875)
* Moved cppNameStyle from CPlusPlus.ts to support/Strings.ts and renamed it to makeNameStyle.
Added 2 new parameters to makeNameStyle:
 - legalizeName: A language-specific function that legalizes a name to render in a given language
 - prefix: An optional parameter that specifies a prefix to prepend to names

Moved NamingStyle enumerator from CPlusPlus.ts to support/Strings.ts to support the above change

CPlusPlus.ts:
 - Removed multiple private naming function variables and implemented them in their corresponding `makeXxxNamer` methods so they may be modified by inheritors
 - Changed the constructor to have C++ properties as default parameters instead of being hardcoded so that inheritors can make their language targetable by quicktype
 - updated code to use makeNamStyle instead of cppNameStyle
Removed private parameter naming functions

* Fixed a typo in the constructor for the C++ target language and made it more clear that the prefix function will not in makeNameStyle if no prefix is given

* Checked for if defined for the non-default behaviour for prefix checking in makeNameStyle

* Moved cppNameStyle from CPlusPlus.ts to support/Strings.ts and renamed it to makeNameStyle.
Added 2 new parameters to makeNameStyle:
 - legalizeName: A language-specific function that legalizes a name to render in a given language
 - prefix: An optional parameter that specifies a prefix to prepend to names

Moved NamingStyle enumerator from CPlusPlus.ts to support/Strings.ts to support the above change

CPlusPlus.ts:
 - Removed multiple private naming function variables and implemented them in their corresponding `makeXxxNamer` methods so they may be modified by inheritors
 - Changed the constructor to have C++ properties as default parameters instead of being hardcoded so that inheritors can make their language targetable by quicktype
 - updated code to use makeNamStyle instead of cppNameStyle
Removed private parameter naming functions

Fixed a typo in the constructor for the C++ target language and made it more clear that the prefix function will not in makeNameStyle if no prefix is given

Checked for if defined for the non-default behaviour for prefix checking in makeNameStyle

* Reverted package.json and package-lock.json

* For C++, changed camel case and pascal case to default to not uppercasing all acronyms, and added two new naming styles to provide the option to upper case acronyms. Updated cpp file to make these options seletable as well

* Fixed whitespace damage, and changed pascal/camel upper acronym comparison to use explicit values
2018-05-30 22:27:02 -07:00
Daichi Jameson a59d0ecf05 Moved cppNameStyle from CPlusPlus.ts to support/Strings.ts and rename… (#874)
* Moved cppNameStyle from CPlusPlus.ts to support/Strings.ts and renamed it to makeNameStyle.
Added 2 new parameters to makeNameStyle:
 - legalizeName: A language-specific function that legalizes a name to render in a given language
 - prefix: An optional parameter that specifies a prefix to prepend to names

Moved NamingStyle enumerator from CPlusPlus.ts to support/Strings.ts to support the above change

CPlusPlus.ts:
 - Removed multiple private naming function variables and implemented them in their corresponding `makeXxxNamer` methods so they may be modified by inheritors
 - Changed the constructor to have C++ properties as default parameters instead of being hardcoded so that inheritors can make their language targetable by quicktype
 - updated code to use makeNamStyle instead of cppNameStyle
Removed private parameter naming functions

* Fixed a typo in the constructor for the C++ target language and made it more clear that the prefix function will not in makeNameStyle if no prefix is given

* Checked for if defined for the non-default behaviour for prefix checking in makeNameStyle

* Moved cppNameStyle from CPlusPlus.ts to support/Strings.ts and renamed it to makeNameStyle.
Added 2 new parameters to makeNameStyle:
 - legalizeName: A language-specific function that legalizes a name to render in a given language
 - prefix: An optional parameter that specifies a prefix to prepend to names

Moved NamingStyle enumerator from CPlusPlus.ts to support/Strings.ts to support the above change

CPlusPlus.ts:
 - Removed multiple private naming function variables and implemented them in their corresponding `makeXxxNamer` methods so they may be modified by inheritors
 - Changed the constructor to have C++ properties as default parameters instead of being hardcoded so that inheritors can make their language targetable by quicktype
 - updated code to use makeNamStyle instead of cppNameStyle
Removed private parameter naming functions

Fixed a typo in the constructor for the C++ target language and made it more clear that the prefix function will not in makeNameStyle if no prefix is given

Checked for if defined for the non-default behaviour for prefix checking in makeNameStyle

* Reverted package.json and package-lock.json
2018-05-30 16:21:43 -07:00
Mark Probst 8206b5c1da
Merge pull request #873 from quicktype/for-each-first-last
Add onFirst and onLast arguments to all forEach methods
2018-05-30 12:26:01 -07:00
Mark Probst 1d9ef0b0ed Use a string enum to indication position in a forEach 2018-05-30 10:49:18 -07:00
Mark Probst 854ef29c25 Add onFirst and onLast arguments to all forEach methods 2018-05-29 19:07:26 -07:00
Mark Probst 5eb75590ce Update package build scripts 2018-05-29 14:18:24 -07:00
David Siegel 974431039b
Set git credentials for homebrew PR 2018-05-29 12:19:52 -07:00
Mark Probst b26154faa4
Merge pull request #866 from quicktype/fix-csharp-union-array
Fix C# union array
2018-05-29 08:52:54 -07:00
Mark Probst cb42245ced Fix array of unions top-level in C#. Fixes #863 2018-05-29 08:14:07 -07:00
Mark Probst 8df7e5e475
Merge pull request #868 from quicktype/integer-type-refs
Big reorganization
2018-05-29 08:11:12 -07:00
Mark Probst e04674b89b Actually run unit tests and TSLint 2018-05-29 07:26:22 -07:00
Mark Probst 4ca48d2b26 Fix TSLint issues 2018-05-25 19:59:46 -07:00
Mark Probst c2eeeb5f49 Auto increment package versions 2018-05-25 16:07:09 -07:00
Mark Probst d8f3c96d29 Use "semver" instead of "compare-versions"
semver is more powerful and we can use it in the package build
scripts, too.
2018-05-25 16:07:09 -07:00
Mark Probst a56541c62b Export more in quicktype-core 2018-05-25 16:07:09 -07:00