Skip to content

chore: release amplify-category-api (Jul 2026)#3513

Merged
svidgen merged 5 commits into
releasefrom
main
Jul 13, 2026
Merged

chore: release amplify-category-api (Jul 2026)#3513
svidgen merged 5 commits into
releasefrom
main

Conversation

@svidgen

@svidgen svidgen commented Jul 10, 2026

Copy link
Copy Markdown
Member

Release PR

Merges main into release to trigger the next npm publish.

E2E status: All tests passed on run-e2e-beta-sql-layer (batch amplify-category-api-e2e-workflow:8605cb73-2c55-4547-865d-fd840697f807, 195/196 green — only cleanup_e2e_resources failed which is post-test cleanup, not an actual test).

⚠️ MERGE INSTRUCTIONS:

  • Use "Create a merge commit"
  • Do NOT squash
  • After merge, run yarn trigger-release from local clone

Simone319 and others added 5 commits July 1, 2026 19:26
…tput path (#3510)

## Summary

Sanitizes database column names and enum type names in the TypeScript
data schema output path, matching the existing `cleanMappedName`
behavior in the GraphQL-SDL output path.

## Problem

The TypeScript schema generator passed raw database column names and
enum type names directly to `ts.factory.createIdentifier()`, which emits
them as bare JavaScript identifiers without any sanitization. Names
containing special characters (parentheses, brackets, quotes, etc.)
could produce invalid or unsafe TypeScript output.

## Changes

- Add `sanitizeIdentifier()` helper that strips leading non-alphabetic
characters and replaces non-alphanumeric characters with underscores
(matching `cleanMappedName` from the GraphQL-SDL path)
- Use `createStringLiteral` instead of `createIdentifier` for field
property names in `createProperty()`
- Use `createStringLiteral` instead of `createIdentifier` for enum type
property names in `createEnums()`
- Sanitize enum type names in `a.ref()` calls for consistency between
the enum definition and its references
- Fix enum deduplication logic to work with `StringLiteral` property
names (uses `.text` instead of `.escapedText`)

## Defense in Depth

This is a defense-in-depth measure. The TS output path should apply the
same sanitization as the GraphQL-SDL path to ensure consistent, safe
output regardless of database column naming.

## Testing

- Added 5 new unit tests verifying:
  - Column names with shell metacharacters are sanitized
  - Column names with brackets/special chars are sanitized  
  - Enum type names with special characters are sanitized
  - Fallback names are generated for all-special-character column names
  - Property keys are emitted as string literals
- Updated 16 existing snapshots to reflect the new quoted property key
format
- All 100 tests in the package pass
@svidgen svidgen requested review from a team as code owners July 10, 2026 13:52
@svidgen svidgen merged commit 2d9e476 into release Jul 13, 2026
7 of 10 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.

3 participants