Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ fileignoreconfig:
- filename: lib/commands/tsgen.js
checksum: 02bab20fef5508565dbf38b5c12192c48ec27249b89d48c70303abaae17984ce
- filename: package-lock.json
checksum: 44c6d643ffd404bad85ab55aedd739f1c9a09fa015745882968b572617637de4
checksum: e7ea94799c4afab6e55935c79ac40d3cac38e2ce6e9882dbd4c2e5a3c551e087
version: "1.0"
61 changes: 57 additions & 4 deletions MIGRATION.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,61 @@
## Migrating from v3 to v4

This changelog documents a breaking change to the `ISystemFields` interface, specifically related to the `publish_details` field.

## What Changed

The `publish_details` field is no longer an array of objects. It is now represented as a single `IPublishDetails` object.

This update aligns the generated types with the actual [Contentstack API](https://www.contentstack.com/docs/developers/apis/content-delivery-api) response.

## Before

```typescript
export interface ISystemFields {
uid?: string;
created_at?: string;
updated_at?: string;
created_by?: string;
updated_by?: string;
_content_type_uid?: string;
tags?: string[];
ACL?: any[];
_version?: number;
_in_progress?: boolean;
locale?: string;
publish_details?: IPublishDetails[]; // Incorrect: Array of IPublishDetails
title?: string;
}
```

## After

```typescript
export interface ISystemFields {
uid?: string;
created_at?: string;
updated_at?: string;
created_by?: string;
updated_by?: string;
_content_type_uid?: string;
tags?: string[];
ACL?: any[];
_version?: number;
_in_progress?: boolean;
locale?: string;
publish_details?: IPublishDetails; // Corrected: Single IPublishDetails object
title?: string;
}
```

---

## Migrating from v2 to v3

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.

## Before
## Before

```typescript
export interface Test {
/** Version */
Expand All @@ -27,8 +81,8 @@ export interface Test {
}
```


## After

```typescript
export interface Test {
/** Version */
Expand All @@ -39,7 +93,6 @@ export interface Test {
modular_blocks?: ModularBlocks[];
}


export interface ModularBlocks {
/** Multi Line Textbox */
multi_line?: string;
Expand All @@ -53,4 +106,4 @@ export interface ModularBlocks1 {
/** Multi Line Textbox */
multi_line?: string;
}
```
```
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "contentstack-cli-tsgen",
"description": "Generate TypeScript typings from a Stack.",
"version": "3.5.1",
"version": "4.0.0",
"author": "Michael Davis",
"bugs": "https://github.com/Contentstack-Solutions/contentstack-cli-tsgen/issues",
"dependencies": {
"@contentstack/cli-command": "^1.5.0",
"@contentstack/cli-utilities": "^1.11.0",
"@contentstack/types-generator": "^2.3.3",
"dotenv": "^16.5.0"
"@contentstack/types-generator": "^3.0.0",
"dotenv": "^16.4.7"
},
"devDependencies": {
"@oclif/plugin-help": "^6.2.27",
Expand Down
Loading