Skip to content

DX | 29-09-2026 | Release - #207

Merged
cs-raj merged 6 commits into
mainfrom
development
Oct 6, 2026
Merged

cs-raj merged 6 commits into
mainfrom
development

Conversation

@cs-raj

@cs-raj cs-raj commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Bug fixes

  • Type generation no longer emits two interfaces with the same name when a modular blocks field's UID matches a content type, global field or built-in interface. That clash produced a .d.ts that didn't compile (TS2687/TS2717). The block interface now gets a numeric suffix instead, top-level interfaces keep their names, and each rename is logged.

Enhancements

  • Updated prettier to ^3.9.9, and the dev tooling (rollup, ts-jest and @types/async) to their latest patch releases.

naman-contentstack and others added 6 commits August 31, 2026 14:19
…ted names

REST-mode type generation emitted two interfaces with the same name when a
modular blocks field's UID matched the UID of a content type, producing a
.d.ts that does not compile:

    export interface Form { heading?: string }    // content type `form`
    export interface Form { heading: { ... } }    // blocks field `form`

TypeScript then reports TS2687 and TS2717 on the merged members.

Block interface names were de-duplicated only against other block names, so
they were blind to content types, global fields and the builtin interfaces.
Content types are also generated one at a time, so the factory could not see
a content type it had not reached yet.

Route every block name through a single registry, seeded up front with the
builtin names and with every top-level name in the batch:

- interfaceNameForUid() is now the one place a UID becomes a name.
- collectBuiltinInterfaceNames() reads the builtin names from
  stack/builtins.ts rather than restating them, so the list cannot drift, and
  passes the real emission flags so names that are not emitted are not
  reserved.
- generateTSFromContentTypes reserves all top-level names before the loop,
  making the fix independent of content type ordering.
- The prefix is normalised once at that boundary so the builtins, the
  reserved names and the generated interfaces agree.

Top-level interfaces are never renamed: customers import those by name. Only
the derived block interface is suffixed, and the suffix counter is
deliberately left shared so existing output is unchanged - a stack that
produces Card2 today still produces Card2, not Card1.

A rename is now reported through the logger, matching every other
name-mangling path in the file, so a customer does not meet it first as a
"Cannot find name" error in their own build.

Group fields are unaffected: they are emitted inline and claim no name, so
they cannot collide. The ticket describes the trigger as a group field; the
customer's generated output confirms it is a modular blocks field.

Known gap, unchanged by this commit and tracked separately: a content type
whose UID maps to a builtin name still emits a duplicate. Both sides are
top-level, so neither can be renamed without breaking imports. Verified
byte-identical to the previous behaviour.

Fixes DX-10385

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
fix(tsgen): stop modular block interfaces colliding with other generated names
chore: bump version to 3.10.6 and update dependencies
@cs-raj
cs-raj requested a review from a team as a code owner September 28, 2026 11:15
@cs-raj cs-raj self-assigned this Sep 28, 2026
@snyk-io

snyk-io Bot commented Sep 28, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues
✅ Licenses 0 0 0 0 0 issues
✅ Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@github-actions

Copy link
Copy Markdown

🔒 Security Scan Results

ℹ️ Note: Only vulnerabilities with available fixes (upgrades or patches) are counted toward thresholds.

Check Type Count (with fixes) Without fixes Threshold Result
🔴 Critical Severity 0 0 10 ✅ Passed
🟠 High Severity 0 0 25 ✅ Passed
🟡 Medium Severity 0 2 500 ✅ Passed
🔵 Low Severity 0 0 1000 ✅ Passed

⏱️ SLA Breach Summary

✅ No SLA breaches detected. All vulnerabilities are within acceptable time thresholds.

Severity Breaches (with fixes) Breaches (no fixes) SLA Threshold (with/no fixes) Status
🔴 Critical 0 0 15 / 30 days ✅ Passed
🟠 High 0 0 30 / 120 days ✅ Passed
🟡 Medium 0 0 90 / 365 days ✅ Passed
🔵 Low 0 0 180 / 365 days ✅ Passed

ℹ️ Vulnerabilities Without Available Fixes (Informational Only)

The following vulnerabilities were detected but do not have fixes available (no upgrade or patch). These are excluded from failure thresholds:

  • Critical without fixes: 0
  • High without fixes: 0
  • Medium without fixes: 2
  • Low without fixes: 0

✅ BUILD PASSED - All security checks passed

@cs-raj
cs-raj merged commit 6f89fd4 into main Oct 6, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants