Skip to content

rename @tool → @expose; codegen consistency check#77

Merged
ryanrasti merged 1 commit into
mainfrom
ryan_cleanups
May 8, 2026
Merged

rename @tool → @expose; codegen consistency check#77
ryanrasti merged 1 commit into
mainfrom
ryan_cleanups

Conversation

@ryanrasti
Copy link
Copy Markdown
Owner

@ryanrasti ryanrasti commented May 8, 2026

  • Rename: decorator export, namespace, all call sites, ESLint rule, codegen template, regenerated outputs.
  • Codegen template was emitting import { tool } alongside @expose() in the body — visible only on a fresh tg generate. Fixed.
  • Inline snapshot tests in src/tables/generate.test.ts now pipe each output through swc.transform + assert every @<X>() has a matching import. Caught the above.
  • Misc: site homepage code sample fixes (@expose(z.string()), literal in ilike), README dev section + .live() references, pg_notify planned-item phrasing.

@ryanrasti ryanrasti changed the title Ryan cleanups Cleanups May 8, 2026
@ryanrasti ryanrasti requested a review from Copilot May 8, 2026 20:29
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR is a broad cleanup/refactor that renames the exoeval surface decorator from @tool to @expose across the library, codegen output, tests, docs, and the playground/demo site, while also adding a Database.close() API and improving the playground UI (wire log + output diffing).

Changes:

  • Rename the public decorator API from tool to expose (including expose.unchecked) and update all call sites, codegen, and documentation accordingly.
  • Add Database.close() to allow scripts to terminate cleanly by shutting down the underlying driver/pool.
  • Add/expand end-to-end validation (README usage snippet test) and enhance the playground UI (wire log panel, improved widget controls, output diff behavior).

Reviewed changes

Copilot reviewed 40 out of 121 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
vitest.config.ts Update decorator name in SWC/decorator pipeline comment.
tsdown.config.ts Update decorator name in SWC/decorator pipeline comment.
src/types/overrides/any.ts Switch tool import/usage to expose for override methods.
src/types/generated/xml.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/xid8.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/xid.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/varchar.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/varbit.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/uuid.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/unknown.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/txid_snapshot.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/tsvector.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/timetz.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/time.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/tid.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regtype.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regrole.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regprocedure.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regproc.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regoperator.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regoper.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regnamespace.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regdictionary.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regconfig.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regcollation.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/regclass.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/refcursor.ts Switch generated import from tool to expose.
src/types/generated/record.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/pg_snapshot.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/pg_node_tree.ts Switch generated import from tool to expose.
src/types/generated/pg_ndistinct.ts Switch generated import from tool to expose.
src/types/generated/pg_mcv_list.ts Switch generated import from tool to expose.
src/types/generated/pg_lsn.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/pg_dependencies.ts Switch generated import from tool to expose.
src/types/generated/pg_brin_minmax_multi_summary.ts Switch generated import from tool to expose.
src/types/generated/pg_brin_bloom_summary.ts Switch generated import from tool to expose.
src/types/generated/path.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/oid.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/macaddr8.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/macaddr.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/jsonpath.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/json.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/gtsvector.ts Switch generated import from tool to expose.
src/types/generated/cidr.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/cid.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/char.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/bool.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/anynonarray.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/anyenum.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/anyelement.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/anycompatiblerange.ts Switch generated import from tool to expose.
src/types/generated/anycompatiblenonarray.ts Switch generated import from tool to expose.
src/types/generated/anycompatiblemultirange.ts Switch generated import from tool to expose.
src/types/generated/anycompatiblearray.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/anycompatible.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/any.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generated/aclitem.ts Replace @tool.unchecked() with @expose.unchecked() in generated type.
src/types/generate.ts Update generator template to emit expose import and @expose.unchecked().
src/tables/generate.ts Update table codegen to emit @expose() decorators and preserve decoration state.
src/tables/generate.test.ts Update snapshots/tests for the new decorator naming.
src/rpc.test.ts Update test fixtures to use expose decorator.
src/readme.test.ts Add an end-to-end test that compiles/runs the README Usage snippet in a fresh install.
src/index.ts Re-export expose (instead of tool) and keep the convenience typegres() factory.
src/exoeval/tool.ts Rename decorator export from tool to expose (including expose.unchecked).
src/exoeval/tool.test.ts Update decorator tests to use expose.
src/exoeval/rpc.test.ts Update RPC protocol tests and docs to use expose.
src/exoeval/index.ts Re-export expose from the exoeval entrypoint.
src/exoeval/evaluator.test.ts Update evaluator tests to use expose and adjust wording.
src/database.ts Add Database.close() to shut down the underlying driver/pool.
src/builder/update.ts Update builder method decorators from @tool to @expose.
src/builder/query.ts Update builder method decorators from @tool to @expose.
src/builder/query.test.ts Add a regression test around select callback return validation messaging.
src/builder/insert.ts Update builder method decorators from @tool to @expose.
src/builder/delete.ts Update builder method decorators from @tool to @expose.
site/src/pages/_PlayWidgets.tsx Add manual “fire” buttons + auto toggles; adjust grouped query output.
site/src/pages/_PlayActiveArea.tsx Add resizable wire log panel; improve output diffing/render lifecycle.
site/src/pages/_HomePage.tsx Update landing-page snippets to new @expose API and updated db.Table usage.
site/src/demo/wire-log.ts Add a bounded pub/sub store for wire traffic events.
site/src/demo/widgets/orders.ts Update demo widget query to include aggregates and debugging.
site/src/demo/server/api.ts Update demo API to expose; wrap channel to log requests/responses.
site/src/demo/schema/users.ts Update generated schema decorators/imports to expose.
site/src/demo/schema/shipments.ts Update generated schema decorators/imports to expose.
site/src/demo/schema/organizations.ts Update generated schema decorators/imports to expose.
site/src/demo/schema/orders.ts Update generated schema decorators/imports to expose.
site/src/demo/schema/order_lines.ts Update generated schema decorators/imports to expose.
site/src/demo/schema/locations.ts Update generated schema decorators/imports to expose.
site/src/demo/schema/inventory_positions.ts Update generated schema decorators/imports to expose.
site/src/demo/schema/customers.ts Update generated schema decorators/imports to expose.
site/src/components/WireLog.tsx New UI component that renders wire log entries.
site/.gitignore Ignore local-only working artifacts.
README.md Refresh README with new API (@expose) and add explicit db.close() usage.
eslint.config.js Update restricted-syntax rule from tool.unchecked to expose.unchecked.
docs/ISSUES.md Mark the rename task done; minor doc maintenance.
docs/ARCHITECTURE.md Add a new architecture doc describing the system and API surface.
docs/AGENTS.md Document a repo convention for helper extraction/inlining.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/tables/generate.ts
export const WireLog = () => {
const [entries, setEntries] = useState<WireEntry[]>([]);

useEffect(() => wireLog.subscribe(setEntries), []);
Comment thread site/src/pages/_PlayActiveArea.tsx
Comment thread site/src/pages/_PlayActiveArea.tsx
- Rename: decorator export, namespace, all call sites, ESLint rule,
  codegen template, regenerated outputs.
- Codegen template was emitting `import { tool }` alongside
  `@expose()` in the body — visible only on a fresh `tg generate`.
  Fixed.
- Inline snapshot tests in `src/tables/generate.test.ts` now pipe
  each output through `swc.transform` + assert every `@<X>()` has
  a matching import. Caught the above.
- Misc: site homepage code sample fixes (`@expose(z.string())`,
  literal in `ilike`), README dev section + `.live()` references,
  `pg_notify` planned-item phrasing.
@ryanrasti ryanrasti changed the title Cleanups rename @tool → @expose; codegen consistency check May 8, 2026
@ryanrasti ryanrasti merged commit 19fbd40 into main May 8, 2026
3 checks passed
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.

2 participants