chore(types): name the decorator shapes so JSR sees no slow types
deno publish --dry-run reported 17 slow types across metadata.ts and params.ts: two factories with inferred return types, and the fifteen exported decorators built from them. Naming RouteDecorator and ArgDecorator fixes all seventeen, since annotating each factory resolves its constants with it. Fixed rather than waived with --allow-slow-types. That flag degrades the generated declarations and makes type checking 1.5-2x slower for consumers, which is a strange thing to ship in the framework whose central claim is type safety. The two names are public API and worth having on their own: a caller can now give a decorator of either shape a name. The factories also lost their inline parameter types, which the declared return type now supplies. deno.json gains the JSR manifest. Exports mirror npm's four entry points on purpose — a docs example importing @green-tea/core/bun has to work whichever registry the reader installed from. Dry run is clean with no flags; claiming the @green-tea scope on jsr.io is the remaining step. Refs: Green-Tea/core#19 Signed-off-by: Diego Resendez <diego.resendez@zero-oneit.com>
This commit is contained in:
5 files changed
+88
-52
No files matched your search
+2
-2
@@ -40,7 +40,7 @@ export {
|
||||
Options,
|
||||
Html,
|
||||
} from './metadata';
|
||||
export type { Transport, HttpMethod } from './metadata';
|
||||
export type { Transport, HttpMethod, RouteDecorator } from './metadata';
|
||||
export type { Plugin } from './plugin';
|
||||
|
||||
// Transformers & error signals
|
||||
@@ -63,7 +63,7 @@ export type { StepFn, CompiledFlow } from './flow';
|
||||
|
||||
// Parameter decorators
|
||||
export { needs, ctx, param, query, body, headers, header, inbound, abort } from './params';
|
||||
export type { Query, Headers, Context, ArgSpec } from './params';
|
||||
export type { Query, Headers, Context, ArgSpec, ArgDecorator } from './params';
|
||||
|
||||
// Streaming
|
||||
export { channel, isAsyncIterable } from './channel';
|
||||
|
||||
Reference in new issue
Block a user