
Security News
Insecure Agents Podcast: Certified Patches, Supply Chain Security, and AI Agents
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.
@toil/typebox-genx
Advanced tools
Code generation tool that extends `@sinclair/typebox-codegen` package with import functionality
typebox-genx (TypeBox Generator eXtended) is a code generation tool that extends @sinclair/typebox-codegen package with import functionality
Install via Bun:
bun install @toil/typebox-genx
Install via Node:
npm install @toil/typebox-genx
This lib is very very very very unstable and some parts of planned functionality aren't available.
Lib work bad with scopes and i mean you have separate files for types
Supports only 1 type of import by line. Any of these code variants are valid:
[!WARNING] Now you can only import with
import {...} from "...". Also you can use "type".
import type { ClientOpts } from "@vot.js/node";
// or
// import { ClientOpts as RenamedOpts } from "@vot.js/node";
// or
import { Client, type ClientOpts } from "@vot.js/node";
// or
// import * as Client from "@vot.js/node";
// and many more
These code variants unsupported:
import Client, { ClientOpts } from "@vot.js/node";
// or
import "@vot.js/node";
Now typeof variable unsupported too
The library class provides several methods:
const genx = new GenX({
root: path.join(__dirname),
includeNearbyFiles: true,
});
// read from input dir and write to output
await genx.generateByDir(
path.join(__dirname, "src/types"),
path.join(__dirname, "dist"),
);
// read file and return result to variable
const codeByFile = await genx.generateByFile(
path.join(__dirname, "src/types/with.ts"),
);
// read string and return result to variable
const raw = `import type { RequestMethod } from "@toil/translate/types/providers/base";
export type Test = {
method: RequestMethod;
};`;
const codeByStr = await genx.generateByCode(raw);
// clear saved imports and depends list if needed
genx.clearData();
// create client for enabled workspaces
const genxw = new GenX({
root: path.join(__dirname, "packages", "packageA"),
workspaceRoot: path.join(__dirname),
});
await genx.generateByDir(
path.join(__dirname, "packages", "packageA"),
path.join(__dirname, "dist"),
);
To build, you must have:
Don't forget to install the dependencies:
bun install
Start building:
bun build:all
The library has minimal test coverage to check its performance.
Run the tests:
bun test
FAQs
Code generation tool that extends `@sinclair/typebox-codegen` package with import functionality
The npm package @toil/typebox-genx receives a total of 75 weekly downloads. As such, @toil/typebox-genx popularity was classified as not popular.
We found that @toil/typebox-genx demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.

Security News
The planned feature introduces a review step before releases go live, following the Shai-Hulud attacks and a rocky migration off classic tokens that disrupted maintainer workflows.