Repository navigation
Conversation
… server's frontend 502 - DistributedTable and KVStore: a conditional put or delete is an atomic check-and-write on one item or key on AWS (and, for KVStore, in the local mock); it is not a multi-item transaction (use DistributedDatabase or Database). KVStore's Local Development section says how the mock handles concurrent conditional writes; both say where the mock keeps its data, and DistributedTable's says how limit behaves locally. A failed condition is JSON-RPC 409 (HTTP 409 only with httpErrorStatus: true). - TROUBLESHOOTING: what the local dev server's '502 Frontend server unavailable' means, its causes and fixes. - core: withAuth reads Next.js cookies() itself; RawRoute params are the same locally and deployed. - AppSetting: the mock's data lives in .bb-data/settings.json.
…by name `cdk-blocks docs` reads the docs that ship in @aws-blocks/blocks wherever npm installed the package, so a coding agent or a developer finds a block's docs and exact signatures in one call instead of resolving paths in node_modules: - `cdk-blocks docs` lists the blocks, their classes and what each does, then the framework docs. - `cdk-blocks docs <block>...` prints each block's README; `--api` prints its API report instead. A block is its class (DistributedTable), its folder (bb-distributed-table) or the folder without bb-; a doc path (bb-cron-job/DESIGN.md) prints that file. - `cdk-blocks docs <name>` prints the import line, the declaration and the README section of an export, an option or Owner.member (inherited members included). - `--section <topic>`, `--exports [filter...]` and `--search <term>` print one section, the importable names and their entry, or matching lines with their section. Unknown names and sections are usage errors (exit 2) that name the closest matches. The CLI exits 0 when its reader closes the pipe early (`| head`), and arguments after `--` are names for docs. The README's CLI table lists the command.
…s docs - The scaffolded AGENTS.md's "AWS Blocks docs" bullet names `npx --no -- cdk-blocks docs` (a block, a name such as an export, a type or Owner.member, `--api`, `--section`, `--exports`, `--search`) and says to use it instead of reading node_modules, .d.ts and API.md files. Its other docs pointers (troubleshooting, a block's own docs) name the command too. - Every template's README and code comments, the Swift demo, the guide's "Building Block documentation" paragraph and the `Full docs:` JSDoc of the @aws-blocks/blocks re-exports name `cdk-blocks docs <package>` instead of the docs path in node_modules; docs-pointers.test.ts checks the JSDoc.
🦋 Changeset detectedLatest commit: c5f9d84 The changes in this PR will be included in the next version bump. This PR includes changesets to release 6 packages
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 |
| assert.ok(usage.includes(`\n ${form} `), form); | ||
| } | ||
| for (const option of ['--api', '--section <topic>', '--exports [filter...]', '--search <term>']) { | ||
| assert.match(usage, new RegExp(`^ {2}${option.replace(/[.[\]]/g, '\\$&')} +\\S`, 'm'), option); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Coding agents working in an AWS Blocks app find a block's docs by resolving paths in
node_modules(node_modules/@aws-blocks/blocks/docs/<block>/README.md, thenAPI.md, then the installed.d.tsfiles) and reading whole files to find one signature. That takes several calls, breaks when npm hoists the package somewhere else, and still leaves the agent guessing which entry (@aws-blocks/blocks,/client,/utils, …) to import a name from.Issue #, if available: none
Changes
cdk-blocks docs(@aws-blocks/blocks, minor): prints the docs that ship in@aws-blocks/blocksby name, for the installed version, wherever npm put the package.DistributedTable), its folder (bb-distributed-table) or the folder withoutbb-; a doc path (bb-cron-job/DESIGN.md) prints that file;guideandtroubleshootingprint the package README andTROUBLESHOOTING.md.import typefor a type and the@aws-blocks/blocks/clientimport when browser code needs it. Declarations an API report leaves out and doc comments come from the installed type files.# <folder>/<file> (<path>), so the reader can cite or re-read it. An unknown name or section is a usage error (exit 2) that names the closest matches.parse.ts,registry.ts): a string option can declare a bare meaning (--sectionwith no topic lists headings),--searchdrops grep's own flags (-i,--) before its term, and fordocsthe arguments after--are names.bin.tsexits 0 onEPIPE, socdk-blocks docs … | headends quietly.Pointers (
@aws-blocks/create-blocks-app, patch;@aws-blocks/blocks): the scaffoldedAGENTS.md"AWS Blocks docs" bullet now namesnpx --no -- cdk-blocks docsand says to use it instead of readingnode_modules,.d.tsandAPI.mdfiles; its other docs pointers, every template's README and code comments, the Swift demo, the guide's "Building Block documentation" paragraph and theFull docs:JSDoc of the@aws-blocks/blocksre-exports name the command instead of the docs path.Docs content fixes (separate commit;
bb-distributed-table,bb-kv-store,bb-app-setting,core,blocks, patch): which conditional writes are atomic (one item or key on AWS, and in KVStore's mock; not a multi-item transaction), what a local502 Frontend server unavailablemeans and how to fix it,withAuth's cookie read andRawRouteparams undernpm run dev, and whereAppSetting's mock keeps its values. A failed condition is JSON-RPC 409, and HTTP 409 only withhttpErrorStatus: true.The command's shape and the AGENTS.md wording were refined against coding-agent sessions on scaffolded apps.
No breaking change:
cdk-blocks docsis a new command, and the bundleddocs/folder and its paths are unchanged.Validation
Run locally on the final branch with Node 22 (
.nvmrc), each exiting 0:npm ci,npm run build,npm run lint(warnings only, in template files this PR touches but did not change on those lines),npm run lint:depsnpm test: 13,189 tests, 13,179 pass, 0 fail, 10 skippednpm run test:e2e:local: 557 tests, 551 pass, 0 fail, 6 skippedNew tests:
packages/blocks/src/cli/docs.test.tsruns the command on a fixture docs folder (listing, blocks by class and folder,--api, names andOwner.memberincluding inherited and aliased members,--section,--exports,--search, usage errors and their suggestions) and, through the built CLI, grep's flags before--search's term and names after--;parse.test.tscovers a bare--sectionbefore another option;bin.test.tschecks that the bin exits 0 when its reader closes the pipe early;docs-pointers.test.tschecks that eachFull docs:JSDoc namescdk-blocks docs <package>for a package that ships docs.No sandbox run: nothing here changes deployed behaviour or serialization.
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.