npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dbx-tools/sdk-shared

v0.1.36

Published

Zod schemas plus inferred TypeScript types for the Databricks SDK shapes the rest of the `@dbx-tools/*` packages consume. Everything under `./generated/` is regenerated from upstream `@databricks/sdk-experimental` `.d.ts` declarations by [`scripts/codegen

Readme

@dbx-tools/sdk-shared

Zod schemas plus inferred TypeScript types for the Databricks SDK shapes the rest of the @dbx-tools/* packages consume. Everything under ./generated/ is regenerated from upstream @databricks/sdk-experimental .d.ts declarations by scripts/codegen.ts; nothing in here is hand-maintained.

import {
  genieMessageSchema,
  genieAttachmentSchema,
  messageStatusSchema,
  type GenieMessage,
  type MessageStatus,
} from "@dbx-tools/sdk-shared";

// Parse / validate a wire payload.
const message = genieMessageSchema.parse(rawJson);

// Or just use the inferred type.
function format(m: GenieMessage): string {
  return `${m.status}: ${m.content}`;
}

The package has zero runtime dependency beyond zod itself. No WorkspaceClient, no node:*, no SDK runtime - importing it from a browser bundle is safe.

What's inside

The single dashboards input currently expands to 74 exported schemas + matching inferred types, covering the Genie and Lakeview SDK surfaces (conversations, messages, attachments, query results, suggested questions, dashboard schedules, subscriptions, etc.). The full list lives at ./generated/dashboards.zod.ts and the package barrel at ./generated/index.ts.

For each upstream type the generator emits two exports:

| Export | Shape | | ------------------ | ------------------------------------------- | | xxxSchema | z.ZodType<X> for runtime validation | | Xxx (type alias) | z.infer<typeof xxxSchema> for static use |

How codegen works

Each consumer package declares its own codegen.inputs in package.json:

{
  "name": "@dbx-tools/sdk-shared",
  "codegen": {
    "inputs": [
      "node_modules/@databricks/sdk-experimental/dist/apis/dashboards/model.d.ts"
    ]
  }
}

bun scripts/codegen.ts walks every package with a codegen field and, for each input:

  1. Reads the upstream .d.ts.
  2. Strips every import declaration and rewrites any type reference whose root identifier was introduced by one of those imports (sql.StatementResponse, ApiClient, ...) to unknown. The output is a pure data-shape surface; peer SDK runtime modules don't belong here.
  3. Pipes the cleaned source into ts-to-zod to produce a <name>.zod.ts schema module.
  4. Regenerates generated/index.ts as a barrel re-export of every schema module.

The whole generated/ tree is gitignored (generated/.gitignore holds *); the hand-tracked top-level ./index.ts re-exports it so the publish merge in scripts/release.ts picks up the standard package.default.json exports map without any per-package wiring.

// index.ts
export * from "./generated/index.js";

Regenerating

bun run prebuild         # runs codegen across every package with a codegen field
# or, just sdk-shared:
bun scripts/codegen.ts

Codegen refuses to write or delete any file inside generated/ that isn't already gitignored at the start of the run, so manually dropping a file into generated/ without updating the ignore aborts with a clear error instead of silently overwriting.

Adding a new SDK surface

Append the upstream .d.ts path to codegen.inputs and rerun codegen. Optionally append =<basename> to override the auto-derived file name:

{
  "codegen": {
    "inputs": [
      "node_modules/@databricks/sdk-experimental/dist/apis/dashboards/model.d.ts",
      "node_modules/@databricks/sdk-experimental/dist/apis/jobs/model.d.ts=jobs"
    ]
  }
}

That produces generated/dashboards.zod.ts and generated/jobs.zod.ts, both re-exported by generated/index.ts.

License

Apache-2.0