Skip to content

refactor!: rename the scaffolded backend folder to cdk-blocks - #1630

Open
VarshithaPamisetty wants to merge 1 commit into
mainfrom
fix/cdk-blocks-folder-rename
Open

VarshithaPamisetty wants to merge 1 commit into
mainfrom
fix/cdk-blocks-folder-rename

Conversation

@VarshithaPamisetty

@VarshithaPamisetty VarshithaPamisetty commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Problem

The scaffolded backend folder is named aws-blocks/, but the product is now cdk-blocks. Bare blocks was ruled out as a third name, so the folder, the package it declares, and the specifier the frontend imports all have to move together.

Changes

  • Rename the scaffolded backend directory to cdk-blocks/ across 33 directories (222 file renames): the 14 create-blocks-app templates, 17 test apps, and the Swift and Kotlin examples.
  • Rename the three coupled things the directory carries, because the folder is an npm workspace package: its own "name" (18 manifests), the parent's "workspaces" entry (27 manifests, including 13 path-form entries in the root), and every from 'aws-blocks' import (173 occurrences in 104 files). Renaming the directory alone leaves imports resolving by package name, so a green suite would not prove the rename landed.
  • Add LEGACY_BLOCKS_BACKEND_DIR in core/src/common/constants.ts and a findLegacyProjectRoot path that only migrate opts into. migrate reads a pre-rename app, so it keeps detecting aws-blocks/; every other command detects the current name. index.test.ts pins both constants so a future bulk rename cannot sweep the legacy one up with the rest.
  • Narrow the four feat(blocks)!: run app tasks through package scripts instead of cdk-blocks #1610 assertions that forbid cdk-blocks in CLI help and generated scripts to \bcdk-blocks(?!/). They guard the removed bin, and the folder now shares its name, so a cdk-blocks/ path must not trip them.

Breaking / maintainer review: an existing app renames the directory, its "workspaces" entry, the "name" in its cdk-blocks/package.json, and every from 'aws-blocks' import. There is no dual-name support and no compatibility shim; preview customers are asked to migrate. Deliberately unchanged: the reserved URL namespace (/aws-blocks/api, /aws-blocks/auth/*, /aws-blocks/dashboard, 1727 occurrences) so deployed API Gateway routes and OAuth callback URLs already registered with an identity provider keep working; the @aws-blocks/* npm scope; the aws-blocks user-agent token, which the warehouse filters on; aws-blocks:stub-idp and the versioned aws-blocks:key-fingerprint:v1 separator; released CHANGELOG.md and .changeset/ entries; the 114 GitHub URLs, since the repository keeps its name; and the npm keywords entry, which is a separate open question.

Validation

  • Every occurrence was classified before editing rather than bulk-replaced: 12075 occurrences labelled across 10 populations, applied per occurrence at exact line and column, with each batch's applied count asserted against its classified count. No repository-wide sed was used.
  • npm run build: exit 0, 0 TypeScript errors.
  • Base is not green. origin/main at e1e484465 fails 15: core 1, create-blocks-app 14 (all template "X" enables @aws-blocks/bb-data:encryptStorageByDefault).
  • At this head, against that base: blocks 0 = 0, core 1 = 1, create-blocks-app 14 = 14, bb-auth 0 = 0, admin-ui 0 = 0, hosting 0 = 0. Delta: 0 new failures. Built and run with TMPDIR on a non-symlinked path, since mkdtemp and realpath differ on macOS.
  • One pre-existing flake seen while measuring: blocks fails stops npm run dev and its frontend on a SIGTERM to its process group about one run in three, and passes on re-run. It is a signal-timing test and does not reference either folder name.
  • A completeness check asserts the three coupled edits per app and that the route constants, the admin-ui duplicate, the GitHub URLs and the history files are untouched. It was mutation-tested in 8 states: all-done passes, and directory-stale, name-stale, workspaces-stale, import-stale, history-edited, github-edited and route-edited each fail on their own.
  • Rebased onto e1e484465, which landed feat(blocks)!: run app tasks through package scripts instead of cdk-blocks #1610 and added 535 new aws-blocks references. The change was re-derived through the same classification pipeline on that base rather than hand-resolving 27 conflicts, so one rule set covers the whole diff.
  • CI covers npm run test:e2e:local and the puppeteer suites. This worktree installs with PUPPETEER_SKIP_DOWNLOAD=1 because chrome-headless-shell will not install here.

The *-aws-blocks workspace package names in the test apps stay as they are. npm requires a unique name per workspace across the monorepo, so only one backend can be called cdk-blocks (test-apps/comprehensive holds that slot). Each of those apps imports the name it declares, or aliases cdk-blocks to its own client.js, so nothing resolves by the old folder name.

@changeset-bot

changeset-bot Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: f92dae5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 27 packages
Name Type
@aws-blocks/core Minor
@aws-blocks/create-blocks-app Minor
@aws-blocks/blocks Minor
@aws-blocks/admin-ui Minor
@aws-blocks/bb-auth Minor
@aws-blocks/bb-database Minor
@aws-blocks/create-block Minor
@aws-blocks/hosting Minor
@aws-blocks/auth-common Patch
@aws-blocks/bb-agent Patch
@aws-blocks/bb-file-bucket Patch
@aws-blocks/bb-kv-store Patch
@aws-blocks/bb-realtime Patch
@aws-blocks/bb-logger Patch
@aws-blocks/bb-app-setting Patch
@aws-blocks/bb-secret Patch
@aws-blocks/bb-async-job Patch
@aws-blocks/bb-dashboard Patch
@aws-blocks/bb-cron-job Patch
@aws-blocks/bb-knowledge-base Patch
@aws-blocks/bb-email-client Patch
@aws-blocks/bb-tracer Patch
@aws-blocks/bb-metrics Patch
@aws-blocks/bb-lambda-compute Patch
@aws-blocks/bb-container-compute Patch
@aws-blocks/bb-compute Patch
@aws-blocks/pipeline Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@VarshithaPamisetty VarshithaPamisetty self-assigned this Nov 18, 2026
@VarshithaPamisetty
VarshithaPamisetty force-pushed the fix/cdk-blocks-folder-rename branch 2 times, most recently from a548c5d to 0177e23 Compare November 18, 2026 17:08
@VarshithaPamisetty
VarshithaPamisetty force-pushed the fix/cdk-blocks-folder-rename branch 3 times, most recently from 2e0dc13 to 8c96d0a Compare November 18, 2026 18:00
Comment thread packages/core/src/common/index.test.ts Resolved
Comment thread packages/create-blocks-app/src/index.ts Resolved
xyos
xyos previously approved these changes Nov 19, 2026

This branch is being deployed

2 in progress deployments
e2e — c6c5e8d7 Deployed Nov 19, 2026 by VarshithaPamisetty via Dart E2E (sandbox) #7359
agent-bench — c6c5e8d7 Deployed Nov 19, 2026 by VarshithaPamisetty via bench / observability-api · backend #6399
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