Repository navigation
Conversation
|
Claude finished @adssib's task in 2m 2s —— View job ✅ Ready to merge. Every rule is met, the 10 npm sources have complete registrations, pages, goldens and drop tests, and every check I could run passes. Two small non-blocking notes are inline. Rules
BugsNone found. Precision looks right:
Verified
Non-blocking
|
| for i := len(old.Params); i < len(now.Params); i++ { | ||
| if np := now.Params[i]; !np.HasDef && np.Kind != "args" && !slices.ContainsFunc(old.Params, func(p pysurface.Param) bool { return p.Kind == "args" }) { | ||
| out = append(out, Change{Symbol: k, Note: fmt.Sprintf("%s: new required parameter %s (no subject for it in the contract yet)", k, np.Name)}) | ||
| } |
There was a problem hiding this comment.
Non-blocking: this pairs parameters by position, so when a release inserts a required parameter in front (Stainless SDKs do this when a path parameter moves, create(params?) → create(id, params?)), the event names now.Params[i].Name (id) and says it "is no longer optional", though id didn't exist before. The break is real and the hint ("Pass id") is right, so this is about the wording. You could check op.Name == now.Params[i].Name and, when the names differ, say "a required parameter id now comes at position i+1" in the description. A rename-only case already produces nothing, which is good.
| "removed_symbol Transaction ", | ||
| }, [2]string{"7.0.0", "7.1.0"}}, | ||
| // convex 1.35.1 removed the react entry's QueryOptions and | ||
| // UseQueryResult types. |
There was a problem hiding this comment.
Non-blocking: this comment says 1.35.1 removed the react entry's QueryOptions and UseQueryResult, but the wanted list (and the golden) has only convex/browser.QueryOptions. Could you make the comment match? If UseQueryResult really was removed from convex/react, also say why it isn't an event: for example, it's an interface inside a namespace, or convex/react re-exports it. Please also confirm that 1.35.1 doesn't still declare QueryOptions in a file the trimmed tarball left out. The trimmed tarball only keeps browser/index.d.ts and browser/query_options.d.ts, so if the type moved to another file that browser/index.d.ts re-exports, this golden would come from the trimming and not from a real removal.
dtsurface reads a tarball's .d.ts, .d.mts and .d.cts files as text (a tokenizer and a parser of declarations, standard library only): every entry point package.json declares, what each exports, and below classes and namespaces their public members, with parameters compared by position. Nothing in the package runs. Registers ten npm sources (openai, @anthropic-ai/sdk, stripe, @google/genai, @sentry/node, mongodb, @redis/client, @supabase/supabase-js, @neondatabase/serverless, convex), each with a golden and a drop pair of real releases. One declaration reachable at several import paths is now one event for both ecosystems, its paths in the subject's symbols. new-plugin's apisurface template takes the ecosystem (an npm: package picks the npm reader). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
Under another name it may have been inserted before the optional one, so changed_default (and its wording) applies only when the name is the same. Also: OpenAI's Lister check beside its adapter; the class-by-name gap on the npm pages. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
79497b1 to
d6f0e7d
Compare
Stacked on #242.
Closes #212
What this changes
The
apisurfacekind reads npm packages:plugins/apisurface/dtsurfacereads each release's TypeScript declarations (.d.ts,.d.mts,.d.cts) out of the registry tarball, in memory, as text. Needs a minor release (new reader, new ecosystem,Releasegains fields).How it parses, and why this way. Declaration files hold declarations only, never statements, so a tokenizer (comments, strings, template literal types,
=>, single>soArray<Array<T>>closes) and a parser of declarations that skips each type expression by its brackets read every name, member and parameter a caller can see: imports and every export form (export { a as b } from,export *,export * as ns,export =,export default,export import X = A.B), classes (public members, constructor, overloads, accessors), functions, interfaces, type aliases, enums, variables, namespaces (merged with classes, the ambient-export rule), anddeclare module "x". Entry points come frompackage.json(exportswith conditions and wildcards, elsetypes/typings). About a thousand lines of standard-library Go: no dependency, themake importsallowlist is unchanged. Not chosen: the TypeScript compiler (JavaScript: running Node and npm code next to the plugins), Go ports of TS parsers (internal to their projects, or cgo via tree-sitter), a type checker (far more than an API diff needs). No package code runs and no install script runs.Compared like Python, but by position: a parameter gone off the end (no rest parameter now) is
removed_parameter; one optional before and required now ischanged_default; a renamed parameter is no change. Notes, not events: a member of a name now re-exported from another package or now a value/interface/type; a method gone from a class that extends another package's class; names an entry point may get fromexport * from "other".One declaration reachable at several import paths is now one event (both ecosystems), every path in
subject.symbols, the shortest first. PyPI goldens from #242 change accordingly (fewer, merged events; the wanted lists inpypi_test.gosay exactly which).Ten npm sources, each with a golden and a drop pair of real consecutive releases (trimmed tarballs):
openai/node-surfacenpm:openaianthropic/typescript-surfacenpm:@anthropic-ai/sdkstripe/node-surfacenpm:stripegoogle/genai-js-surfacenpm:@google/genaisentry/node-surfacenpm:@sentry/nodemongodb/node-surfacenpm:mongodbredis/node-redis-surfacenpm:@redis/client,npm:redissupabase/js-surfacenpm:@supabase/supabase-jsneon/serverless-surfacenpm:@neondatabase/serverlessconvex/js-surfacenpm:convexnew-plugin's apisurface template takes the ecosystem: readerspypi(default) andnpm, picked by annpm:package when--readeris left out.#212 acceptance criteria
@internal, never produce events (TestRead)package.jsonand declaration files are read out of the tarball)npm:packages and pages; the template takes the ecosystemChecklist
plugins/apisurface/npm_packages.go), and I read the words.TestNPMGolden), drop tests (TestNPMDrop), reader tests (dtsurface_test.go, incl. a truncated-input test)testdata/README.mdlists each fileproviders/<provider>-<source>.mdfor each, with Why this sourceenv.Getmake checkpasses locallyCalls I made (please check)
Stripe.*resource types are therefore not read (its API spec covers fields).client.chat.completions.createis reached asCompletions.createthrough namespaces and entry points.redisreads@redis/client(theredispackage only re-exports it wholesale), coveringnpm:redistoo.@octokit/rest(its API is a mapped object type from a plugin package: 2 symbols, nothing to compare without type resolution), and the low-priority@vercel/sdk,@planetscale/database."import"condition preferred over"require"(Stripe's CJS typings re-wrap the class).Related PRs
🤖 Generated with Claude Code