Skip to content

docs: correct stale cdk-blocks rename references and a removed telemetry opt-out - #1689

Draft
VarshithaPamisetty wants to merge 1 commit into
mainfrom
docs/cdk-blocks-sweep
Draft

VarshithaPamisetty wants to merge 1 commit into
mainfrom
docs/cdk-blocks-sweep

Conversation

@VarshithaPamisetty

@VarshithaPamisetty VarshithaPamisetty commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

What

Five documentation lines that the recent renames left false, not merely old. Docs only; no behaviour change.

docs/guides/upgrading-older-apps.md

Line 12 — the symptom table named a symptom the reader never gets. The row offered Cannot find module 'aws-blocks' for "any version before the cdk-blocks/ rename". That is the symptom of a half-finished rename — the state the reader reaches after step 1 of this section's own instructions — not of an un-migrated app. Reproduced with the npm workspace symlink in place and this repo's own tsc:

STATE 1  folder aws-blocks/, import 'aws-blocks'   (the reader's starting state)
         tsc exit=0            # clean

STATE 2  folder cdk-blocks/, import still 'aws-blocks'   (after `git mv` only)
         src/index.ts(1,21): error TS2307: Cannot find module 'aws-blocks' or its
         corresponding type declarations.
         tsc exit=2            # node_modules/aws-blocks -> ../aws-blocks now DANGLING

What an un-migrated app actually reports, both verified in source:

  • any CLI-routed command — packages/blocks/src/cli/context.ts:314, reached because findProjectRoot(start, backendDir = 'cdk-blocks') (context.ts:153) defaults to cdk-blocks, and allowLegacyBackendDir is passed by exactly one caller, migrate.ts:1133. CliError defaults to ExitCode.Failure.
  • older apps still running aws-blocks/scripts/* — the dev server starts, then npm run deploy fails in the client codegen at packages/core/src/scripts/deploy.ts:292, before the deploy at 294, because deploy.ts:289 resolves cdk-blocks/index.ts. Reproduced: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '<root>/cdk-blocks/index.ts', exit 1.

One row, not two, because line 9 already sets the precedent for an alternate case in a parenthetical ((older releases: ...)). The row is 236 chars against siblings of 157/93/39 — longer than any sibling, which I accepted deliberately: naming only one of two real symptoms would half-repeat the bug being fixed, and this file's lines routinely run to 450. Table structure re-checked: 2 cells, same as every sibling row.

Line 20 — wrong tense, and a dead command. It said the frontend "cannot resolve the backend until" the folder, the workspace entry and the imports move together. STATE 1 above shows it resolves fine beforehand; resolution breaks when they move separately. The list of three is kept verbatim and only the tense is corrected.

The same sentence invoked cdk-blocks migrate. No package on origin/main declares a cdk-blocks bin — swept every tracked package.json:

packages/bb-auth           -> bb-auth
packages/bb-database       -> bb-database
packages/blocks            -> blocks-generate-client blocks-vendorize
packages/core              -> blocks-generate-spec
packages/create-block      -> create-block
packages/create-blocks-app -> create-blocks-app
packages/hosting           -> hosting-secret hosting-config hosting-typegen

migrate.ts's own header calls it "the former cdk-blocks executable" and names the live form npm run migrate, which templates declare as a package script. npm run … is also the form this guide already uses (npm run sandbox line 70, npm run typecheck line 196). Its internal RENAMED_ALIASES exists precisely to rewrite cdk-blocks <verb> script entries away, so the guide was telling the reader to run the invocation that migrate exists to remove.

I left "rewrites script wrappers only" as it stands: migrate rewrites package script entries and deletes generated wrappers, so the phrase is loose, but the claim that matters here — it does not move the folder or rewrite imports — is true (renameSync appears once, as an atomic temp-to-path file write, and migrate never touches an import specifier).

Line 136 — a path the guide itself had just removed. The DistributedDatabase-to-Database step passed migrationsPath: './aws-blocks/dsql-migrations', inside the folder the reader is told to git mv at line 25. Only the parent moves: the line now reads ./cdk-blocks/dsql-migrations, keeping the app's own dsql-migrations subfolder, because an explicit migrationsPath overrides the default rather than matching it. DEFAULT_MIGRATIONS_ROOT is ./cdk-blocks/migrations (packages/bb-database/src/constants.ts:112), cited here only to confirm the parent folder's name — the edited line deliberately does not equal it. The // Before: comment on line 135 keeps the pre-rename path on purpose.

For the reviewer: #1630 updated this section's prose to cdk-blocks/index.ts but left both ./aws-blocks/dsql-migrations strings. I could not tell from the diff whether that was deliberate, so overrule me if it was.

Line 238 — dead anchor. #1630 renamed the heading to ## TypeScript errors in `cdk-blocks/` from the frontend (packages/blocks/TROUBLESHOOTING.md:90) but not the inbound link. I validated every relative markdown anchor in the repo with a GitHub-accurate slugger: 1 dead before, 0 after, and it was the only one. Unguarded because readme-links.test.ts:28-29 strips #fragment before checking.

test-apps/telemetry/README.md

Line 83, deleted. It listed an environment variable, a global config and a project config as ways to turn telemetry off. All three were removed when telemetry started following CDK's opt-out; the surviving disable mechanisms test group holds only four CDK_DISABLE_CLI_TELEMETRY / cli-telemetry cases, which the bullet at line 87 already describes. Rewriting it would duplicate that bullet, so it is removed rather than reworded.

Verification

npm run build        exit=0, 0 TS errors
npm run lint         exit=0   (biome --changed --since=origin/main)
anchor validation    1 dead anchor before -> 0 after

Tests that read or pin documentation text, all at this base:

create-blocks-app/templates-tsconfig   pass 4,  fail 0   # pins a link inside this guide
core/cdk/blocks-stack                  pass 42, fail 0   # asserts the guide path in an error
blocks/sandbox-dir-coverage            pass 3,  fail 0
blocks/sandbox-url-decoupling          pass 7,  fail 0
blocks/readme-links                    pass 3,  fail 0
blocks/doc-snippets                    pass 2,  fail 0
blocks/docs-pointers                   pass 1,  fail 0
create-blocks-app/docs-pointers        pass 5,  fail 0
create-blocks-app/agents-guide         pass 8,  fail 0

Measured widths (characters, not bytes — an em-dash is one character and two bytes):

upgrading-older-apps.md:12   83ch -> 236ch   (siblings 157/93/39; justified above)
upgrading-older-apps.md:20  325ch -> 396ch   (paragraph neighbours 178/276/327/450)
upgrading-older-apps.md:136 100ch -> 100ch   delta=0
upgrading-older-apps.md:238 178ch -> 178ch   delta=0
telemetry/README.md         112 lines -> 111 (exactly line 83; 65ch standalone bullet)
line count 243 -> 243; only lines 12 and 20 reworded

Lines 136 and 238 are same-length substitutions, proved by reconstructing the base line, applying only the intended substitution, and comparing byte-for-byte, plus a span-masked comparison of the remainder. Line 20 is the only reworded prose; its word-level account is exactly three edits:

replace  'and its frontend cannot resolve the backend until'
   with  'which resolves as it stands;'
insert   'then have to'
replace  'together. `cdk-blocks'
   with  'together, because a frontend cannot resolve the backend while only
          some of them have moved. `npm run'

Opening clause, the list of three ("the folder, the workspace that names it and the imports"), and the closing sentence are preserved verbatim.

No formatter covers this. biome.json includes only packages/**/*.ts, and the repo has no prettier, markdownlint or editorconfig, so markdown width is convention rather than tooling — no gate would have caught a bad wrap. Both edited files are unwrapped, one line per paragraph, and nothing reflowed.

No changeset. changeset-guard verify-coverage reports ✓ No publishable packages were changed. Neither file is under packages/, and scripts/gen-block-docs.mjs copies only from packages/*, so neither can reach a published tarball.

Rebased mid-review

Main moved three times while this was open, so the branch has been rebased three times and now sits on 1de6ea444. It originally sat on 703238f56 (#1630) and carried a sixth edit: the comment in packages/blocks/src/sandbox-dir-coverage.test.ts read ​`cdk-blocks/` → `cdk-blocks/` rename broke 24 tests, because #1630's sweep had rewritten the left side of #1644's arrow. #1655 then merged and rewrote that whole block, fixing it upstream, so that edit is dropped. #1627 then renamed the npm scope to @aws-cdk-blocks and the umbrella to unscoped aws-cdk-blocks, and #1656 made /cdk-blocks/ the primary route prefix with /aws-blocks/ kept as a legacy alias — the item the brief listed as undecided. Neither touched any of the four lines this PR edits (verified line by line), and every cited file, line number and error string was re-checked at 1de6ea444. Dropping it is also why no changeset is needed — it was the only packaged file involved. Every remaining finding was re-verified against the new base.

Checked and deliberately unchanged

5,278 occurrence lines of aws-blocks / AWS_BLOCKS / AWS Blocks / .blocks / blocks-telemetry are classified, with 12 unclassified, each inspected and listed below. Five lines changed; the rest are correct as they stand.

Count Category Why unchanged
208 npm scope @aws-blocks/* mostly renamed by #1627; the remainder is excluded
292 /aws-blocks/* route prefix now a legacy alias: #1656 made /cdk-blocks/ primary and kept /aws-blocks/ for deployed clients
1658 .blocks hidden folder #1607 still open, so true today
1509 published CHANGELOGs shipped release history
263 .changeset/* describe a shipped or pending release
298 brand string "AWS Blocks" Trademarks approval unconfirmed — the new public name is not cleared
26 package-lock.json test-app package names + repo URL
207 pre-rename layout in migrate / this guide deliberately names the old layout
185 user-agent token grammar excluded
69 repo URL / monorepo name see below
135 migrate-apps.json fixture pre-rename app input the migrate test asserts on
110 .blocks-sandbox legitimately live again after #1655
63 aws-blocks.native / .vendorize manifest keys live
48 aws-blocks npm keyword + its guard the confirmed discovery tag
8 crypto brand / HKDF domain separators excluded
24 misc live identifiers keychain service, temp-dir prefixes
35 docs/DECISIONS.md preserved as written; amendment notes already added
39 NODE_DEBUG=blocks-telemetry the debug label is live, distinct from the removed binary
31 test-app inner backend package names see below
21 well-known Symbol.for keys live
16 AWS resource tag keys live
8 the sandbox-dir / sandbox-url guards spell both names on purpose
7 internal registry key / module prefix live
3 aws-blocks:stub-idp excluded
2 $aws-blocks/hosting.ManagedValue JSON wire tag
1 migrate-sandbox-dir.ts reads the old directory by design

Verified not stale though it looked it: the "telemetry" key in 16 test-apps/*/.blocks/config.json holds telemetry.projectId, which packages/core/src/telemetry/identifiers.ts still reads — only telemetry.enabled was removed.

Two findings reported, not fixed here

  1. Repo URL. origin is https://github.com/aws/cdk-blocks.git, but 150 tracked references still say aws-devtools-labs/aws-blocks, including README.md and the repository / bugs / homepage fields of most published package.json files. The old path returns HTTP 301 to https://github.com/aws/cdk-blocks, so these redirect rather than break — old, not false, and so outside a correctness-first sweep. Worth its own change because those fields are published npm metadata.
  2. Test-app backend package names. 31 references such as hosting-ssr-aws-blocks are package names, not folders. refactor!: rename the scaffolded backend folder to cdk-blocks #1630 renamed each folder to cdk-blocks/ and kept these names, and .changeset/config.json still lists them under ignore. Renaming them breaks imports, so it is a code change, not a docs one.

Out of scope by instruction

.blocks → .cdk-blocks (#1607 open); the served sandbox config path (settled by #1655, which restored the old name); the route prefix (settled by #1656 after this PR opened, which made /cdk-blocks/ primary and kept /aws-blocks/ as a legacy alias); the "AWS Blocks" brand strings; the npm scope, Maven groupId, user-agent token, aws-blocks:stub-idp, crypto domain separator, published CHANGELOGs, and anything describing a past release.

Pre-existing CI failures, not from this change

Local Unit Tests (shard 3) fails repo-wide in packages/hosting with ENOTDIR: /tmp/hosting-nitro-cache-*/package.json/package.json; Build and Test and Build, Unit Tests, E2E Local fail in about 3 seconds as aggregates of it.

Unclassified after the latest rebase

12 occurrence lines are not auto-bucketed, all inspected and benign: the new dual-prefix route matchers that accept both segments (segment == 'cdk-blocks' || segment == 'aws-blocks' in the Dart, Kotlin and Swift runtimes, added by #1656), the AWS_BLOCKS_UMBRELLA_MODULE constant whose name keeps the old prefix while its value is aws-cdk-blocks, a README line about aws-cdk-blocks, the bb-auth codemod's positional aws-blocks source argument, and a test name about leaving the app's own legacy workspace package alone. None is a stale doc.

@VarshithaPamisetty VarshithaPamisetty changed the title docs: correct two cdk-blocks rename lags and a removed telemetry opt-out docs: correct four cdk-blocks rename lags and a removed telemetry opt-out Nov 19, 2026
…try opt-out

Five doc lines that the recent renames left false.

`docs/guides/upgrading-older-apps.md`

- The symptom table offered `Cannot find module 'aws-blocks'` for an
  un-migrated app. That is the symptom of a HALF-FINISHED rename, not of an
  un-migrated one: with the folder still `aws-blocks/` and the workspace
  symlink in place, the app typechecks clean. The row now names what such an
  app actually reports, with the older wrapper-app case alongside.
- The same section said the frontend "cannot resolve the backend until" the
  three move together. It resolves fine beforehand; it breaks when they move
  separately. The list of three is unchanged, the tense is corrected.
- It invoked `cdk-blocks migrate`. No package declares a `cdk-blocks` bin;
  `migrate.ts` calls it "the former `cdk-blocks` executable" and the task is
  `npm run migrate`, which is the form used elsewhere in this guide.
- The DistributedDatabase-to-Database step passed
  `migrationsPath: './aws-blocks/dsql-migrations'`, a path inside the folder
  the reader is told to `git mv` earlier in the same guide. Only the parent
  moves: the line now reads `./cdk-blocks/dsql-migrations`, keeping the app's
  own `dsql-migrations` subfolder, because an explicit `migrationsPath`
  overrides the default rather than matching it. `DEFAULT_MIGRATIONS_ROOT` is
  `./cdk-blocks/migrations`, which confirms the parent folder's name only.
- Its link into TROUBLESHOOTING.md named the heading's pre-rename anchor, so
  it landed at the top of the page. It was the only dead relative anchor in
  the repo.

`test-apps/telemetry/README.md`

- Listed an environment variable, a global config and a project config as
  ways to turn telemetry off. All three were removed when telemetry started
  following CDK's opt-out; the bullet below already names the only remaining
  mechanism.

Docs only, no behaviour change. No publishable package is touched, so no
changeset is required.
@VarshithaPamisetty VarshithaPamisetty changed the title docs: correct four cdk-blocks rename lags and a removed telemetry opt-out docs: correct stale cdk-blocks rename references and a removed telemetry opt-out Nov 19, 2026

This branch was previously deployed

1 inactive deployment
e2e — 5c2b0abe Deployed Nov 19, 2026 by VarshithaPamisetty via E2E Teardown Verify #7453
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.

1 participant