Skip to content

Commit 7b62775

Browse files
Merge pull request #115 from contentstack/development
DX | 11-08-2025 | Release
2 parents f8132ea + 86b54e4 commit 7b62775

File tree

7 files changed

+112
-110
lines changed

7 files changed

+112
-110
lines changed

.talismanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ fileignoreconfig:
33
ignore_detectors:
44
- filecontent
55
- filename: package-lock.json
6-
checksum: 738dce8e598ec48cf261e9b6e013209e3a2c74a345e2f350c761fc3339e169f2
6+
checksum: 935e3c4e56b12c01608ff169a0d025acee6a01e7464fa500f50c1c202c8af08b
77
- filename: .husky/pre-commit
88
checksum: 5baabd7d2c391648163f9371f0e5e9484f8fb90fa2284cfc378732ec3192c193
99
- filename: src/graphqlTS/index.ts

package-lock.json

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

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/types-generator",
3-
"version": "3.4.0",
3+
"version": "3.5.0",
44
"description": "Contentstack type definition generation library",
55
"private": false,
66
"author": "Contentstack",
@@ -40,17 +40,17 @@
4040
"husky": "^9.1.7",
4141
"jest": "^29.7.0",
4242
"nock": "^13.5.6",
43-
"rollup": "^4.46.1",
43+
"rollup": "^4.46.2",
4444
"ts-jest": "^29.4.0",
4545
"tsup": "^8.5.0",
4646
"typescript": "^5.7.3"
4747
},
4848
"dependencies": {
49-
"@contentstack/cli-utilities": "^1.12.1",
49+
"@contentstack/cli-utilities": "^1.13.0",
5050
"@contentstack/delivery-sdk": "^4.8.0",
5151
"@gql2ts/from-schema": "^2.0.0-4",
5252
"async": "^3.2.6",
53-
"axios": "^1.10.0",
53+
"axios": "^1.11.0",
5454
"lodash": "^4.17.21",
5555
"prettier": "^3.6.2"
5656
},

src/generateTS/factory.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ export default function (userOptions: TSGenOptions) {
624624
};
625625

626626
function type_taxonomy() {
627-
return `${options?.naming?.prefix}Taxonomy`;
627+
return `${options?.naming?.prefix}Taxonomy | ${options?.naming?.prefix}TaxonomyEntry`;
628628
}
629629

630630
function type_json_rte(field: ContentstackTypes.Field) {

src/generateTS/stack/builtins.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export const defaultInterfaces = (
5656
mandatory: boolean;
5757
non_localizable: boolean;
5858
}`,
59+
`export type ${prefix}TaxonomyEntry = ${prefix}Taxonomy & { term_uid: string }`,
5960
];
6061
if (hasJsonRte) {
6162
defaultInterfaces.push(

tests/unit/tsgen/global.fields.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe("global fields", () => {
5151
{
5252
_version?: number;
5353
title: string;
54-
taxonomies?: ITaxonomy[];
54+
taxonomies?: ITaxonomy | ITaxonomyEntry[];
5555
}"
5656
`);
5757
});

tests/unit/tsgen/taxonomies.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ describe("builtin taxonomies field", () => {
1818
expect([...types.contentstack]).toHaveLength(1);
1919
expect([...types.globalFields]).toHaveLength(0);
2020
expect([...types.contentstack]).toEqual(
21-
expect.arrayContaining(["ITaxonomy"])
21+
expect.arrayContaining(["ITaxonomy | ITaxonomyEntry"])
2222
);
2323
});
2424

@@ -29,7 +29,7 @@ describe("builtin taxonomies field", () => {
2929
_version?: number;
3030
title: string;
3131
boolean: boolean;
32-
taxonomies?: ITaxonomy[];
32+
taxonomies?: ITaxonomy | ITaxonomyEntry[];
3333
}"
3434
`);
3535
});

0 commit comments

Comments
 (0)