Skip to content

Commit 50d26e6

Browse files
authored
Merge pull request #110 from contentstack/staging
Staging-to-Master | DX | 20-05-2024 | Release
2 parents 8553c58 + f99c581 commit 50d26e6

16 files changed

+35
-35
lines changed

package-lock.json

Lines changed: 18 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "contentstack-cli-tsgen",
33
"description": "Generate TypeScript typings from a Stack.",
4-
"version": "2.3.2",
4+
"version": "2.3.3",
55
"author": "Michael Davis",
66
"bugs": "https://github.com/Contentstack-Solutions/contentstack-cli-tsgen/issues",
77
"dependencies": {

src/lib/tsgen/factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ export default function (userOptions: TSGenOptions) {
240240
define_interface(contentType, options.systemFields),
241241
'{',
242242
['/**', "Version", '*/'].join(' '),
243-
[`_version: `,contentType._version,';'].join(' '),
243+
[`_version?: `,contentType._version,';'].join(' '),
244244
visit_fields(contentType.schema),
245245
'}',
246246
]

tests/tsgen/boolean.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("builtin boolean field", () => {
2525
"export interface IBoolean
2626
{
2727
/** Version */
28-
_version: 2 ;
28+
_version?: 2 ;
2929
title: string ;
3030
boolean?: boolean ;
3131
}"

tests/tsgen/defaults.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("default single content block", () => {
1818
"export interface IMetadataSingleContentBlock
1919
{
2020
/** Version */
21-
_version: 2 ;
21+
_version?: 2 ;
2222
title: string ;
2323
}"
2424
`);
@@ -44,7 +44,7 @@ describe("default single webpage", () => {
4444
"export interface IMetadataSingleWebpage
4545
{
4646
/** Version */
47-
_version: 2 ;
47+
_version?: 2 ;
4848
title: string ;
4949
url: string ;
5050
}"

tests/tsgen/global.fields.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("global fields", () => {
2525
"export interface ISeo
2626
{
2727
/** Version */
28-
_version: ;
28+
_version?: ;
2929
keywords?: string ;
3030
description?: string ;
3131
}"
@@ -37,7 +37,7 @@ describe("global fields", () => {
3737
"export interface IGlobalFields
3838
{
3939
/** Version */
40-
_version: 2 ;
40+
_version?: 2 ;
4141
title: string ;
4242
seo?: ISeo ;
4343
}"

tests/tsgen/group.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ describe("group", () => {
2424
"export interface Group
2525
{
2626
/** Version */
27-
_version: 3 ;
27+
_version?: 3 ;
2828
title: string ;
2929
multiple_group_max_limit?: [{
3030
number?: number | null ;

tests/tsgen/isodate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ describe("builtin isodate field", () => {
2525
"export interface Isodate
2626
{
2727
/** Version */
28-
_version: 2 ;
28+
_version?: 2 ;
2929
title: string ;
3030
date?: string | null ;
3131
date_required: string ;

tests/tsgen/jsdoc.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ describe("jsdoc", () => {
1616
export interface Jsdoc
1717
{
1818
/** Version */
19-
_version: 3 ;
19+
_version?: 3 ;
2020
/** Name */
2121
title: string ;
2222
/** Age */

tests/tsgen/modular.blocks.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ describe("modular blocks", () => {
2121
"export interface ModularBlocks
2222
{
2323
/** Version */
24-
_version: 2 ;
24+
_version?: 2 ;
2525
title: string ;
2626
url: string ;
2727
modular_blocks?: ({string_block: {single_line?: string ;

0 commit comments

Comments
 (0)