Skip to content

Commit 46865ae

Browse files
Merge pull request #190 from contentstack/fix/DX-2403
[DX-2403], major version bump
2 parents 3eb1513 + f193510 commit 46865ae

File tree

4 files changed

+70
-17
lines changed

4 files changed

+70
-17
lines changed

.talismanrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ fileignoreconfig:
55
- filename: lib/commands/tsgen.js
66
checksum: 02bab20fef5508565dbf38b5c12192c48ec27249b89d48c70303abaae17984ce
77
- filename: package-lock.json
8-
checksum: 44c6d643ffd404bad85ab55aedd739f1c9a09fa015745882968b572617637de4
8+
checksum: e7ea94799c4afab6e55935c79ac40d3cac38e2ce6e9882dbd4c2e5a3c551e087
99
version: "1.0"

MIGRATION.md

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

4-
## Before
57+
## Before
58+
559
```typescript
660
export interface Test {
761
/** Version */
@@ -27,8 +81,8 @@ export interface Test {
2781
}
2882
```
2983

30-
3184
## After
85+
3286
```typescript
3387
export interface Test {
3488
/** Version */
@@ -39,7 +93,6 @@ export interface Test {
3993
modular_blocks?: ModularBlocks[];
4094
}
4195

42-
4396
export interface ModularBlocks {
4497
/** Multi Line Textbox */
4598
multi_line?: string;
@@ -53,4 +106,4 @@ export interface ModularBlocks1 {
53106
/** Multi Line Textbox */
54107
multi_line?: string;
55108
}
56-
```
109+
```

package-lock.json

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

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "contentstack-cli-tsgen",
33
"description": "Generate TypeScript typings from a Stack.",
4-
"version": "3.5.1",
4+
"version": "4.0.0",
55
"author": "Michael Davis",
66
"bugs": "https://github.com/Contentstack-Solutions/contentstack-cli-tsgen/issues",
77
"dependencies": {
88
"@contentstack/cli-command": "^1.5.0",
99
"@contentstack/cli-utilities": "^1.11.0",
10-
"@contentstack/types-generator": "^2.3.3",
11-
"dotenv": "^16.5.0"
10+
"@contentstack/types-generator": "^3.0.0",
11+
"dotenv": "^16.4.7"
1212
},
1313
"devDependencies": {
1414
"@oclif/plugin-help": "^6.2.27",

0 commit comments

Comments
 (0)