Skip to content

Commit 99c3e45

Browse files
Merge pull request #79 from contentstack/fix/DX-2403
[DX-2403], Major version bump
2 parents 3f0c625 + 78f8db4 commit 99c3e45

7 files changed

Lines changed: 92 additions & 300 deletions

File tree

.github/workflows/node.js.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ jobs:
2323
uses: actions/setup-node@v3.7.0
2424
with:
2525
node-version: ${{ matrix.node-version }}
26-
- run: npm ci
26+
- run: |
27+
rm -rf node_modules package-lock.json
28+
npm i
2729
- run: npm test
2830
env:
2931
TOKEN: ${{secrets.TOKEN}}

.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: c855b257f787ae58c64f68315bfcffaad9910f67a0b797bb7d3b1b7c225aabb4
6+
checksum: 5bdaa34571226c6201c3b6fe2ff213180f0ce06b1afbc9565cb89e0562fb74db
77
- filename: .husky/pre-commit
88
checksum: 5baabd7d2c391648163f9371f0e5e9484f8fb90fa2284cfc378732ec3192c193
99
version: "1.0"

MIGRATION.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
## Migrating from v2 to v3
2+
3+
This changelog documents a breaking change to the `ISystemFields` interface, specifically related to the `publish_details` field.
4+
5+
6+
## What Changed
7+
8+
The `publish_details` field is no longer an array of objects. It is now represented as a single `IPublishDetails` object.
9+
10+
This update aligns the generated types with the actual [Contentstack API](https://www.contentstack.com/docs/developers/apis/content-delivery-api) response.
11+
12+
13+
## Before
14+
15+
```typescript
16+
export interface ISystemFields {
17+
uid?: string;
18+
created_at?: string;
19+
updated_at?: string;
20+
created_by?: string;
21+
updated_by?: string;
22+
_content_type_uid?: string;
23+
tags?: string[];
24+
ACL?: any[];
25+
_version?: number;
26+
_in_progress?: boolean;
27+
locale?: string;
28+
publish_details?: IPublishDetails[]; // Incorrect: Array of IPublishDetails
29+
title?: string;
30+
}
31+
```
32+
33+
34+
## After
35+
```typescript
36+
export interface ISystemFields {
37+
uid?: string;
38+
created_at?: string;
39+
updated_at?: string;
40+
created_by?: string;
41+
updated_by?: string;
42+
_content_type_uid?: string;
43+
tags?: string[];
44+
ACL?: any[];
45+
_version?: number;
46+
_in_progress?: boolean;
47+
locale?: string;
48+
publish_details?: IPublishDetails; // Corrected: Single IPublishDetails object
49+
title?: string;
50+
}
51+
```

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@ This library helps to generate TypeScript type definition for the content types
66

77
`$ npm install @contentstack/types-generator`
88

9+
10+
## Migration
11+
Refer to the [Migration Guide](https://github.com/contentstack/types-generator/blob/main/MIGRATION.md) version 3 if you are migrating from version 2 or older.
12+
13+
914
## Usage
1015

1116
### In NodeJs

0 commit comments

Comments
 (0)