implementing-jsc-classes-zig

Generate Zig-JavaScriptCore bindings scaffolding and .classes.ts definitions for Bun.

95.3k|4.9k|Updated Apr 14, 2021
One-click install
npx skills add https://github.com/oven-sh/bun --skill implementing-jsc-classes-zig-oven-sh
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: implementing-jsc-classes-zig
Source: https://github.com/oven-sh/bun/tree/main/.claude/skills/implementing-jsc-classes-zig
Command: npx skills add https://github.com/oven-sh/bun --skill implementing-jsc-classes-zig-oven-sh

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Creates JavaScriptCore bindings generator scaffolding for Zig projects, enabling the automatic creation of .classes.ts definitions and Zig implementations to bridge JS and Zig code in Bun.

Core Features & Use Cases

  • Automated generation of .classes.ts bindings to describe JS-visible APIs
  • Zig implementation scaffolding that plugs into Bun's JSC integration
  • Use case: expose new Zig-based JS APIs with prototypes and lifecycle management

Quick Start

Run the generator to scaffold a new Zig-JS binding.

Frequently Asked Questions about implementing-jsc-classes-zig

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate JavaScriptCore bindings scaffolding for new Bun APIs in Zig?

To generate JavaScriptCore bindings scaffolding for Bun, run the generator to automatically produce .classes.ts definitions and Zig implementation files that bridge JS and Zig code with lifecycle management.

What are .classes.ts definitions and how do they bridge JS to Zig in Bun?

The .classes.ts definitions describe the JS-visible API prototypes and lifecycles, bridging JS to Zig code in Bun by automatically generating the necessary binding interfaces and cleanup hooks for JavaScriptCore integration.

Do I need a Zig toolchain and Bun development environment to create JSC bindings?

Yes, you need both a Zig toolchain and a Bun development environment to emit binding templates, generate JavaScriptCore prototypes, and attach cleanup hooks for GC when scaffolding new Zig-JS bindings.

Can I expose new Zig-based JavaScript APIs with prototype and lifecycle management automatically?

Yes, the generator automatically scaffolds Zig implementation files and .classes.ts definitions to expose new JS APIs with prototypes and lifecycle management, bridging them to JavaScriptCore with generated cleanup hooks.

What's the best way to attach cleanup hooks for GC when bridging JS and Zig code in Bun?

The best way to attach GC cleanup hooks for bridging JS and Zig code is by using the generator to automatically scaffold the JavaScriptCore integration, ensuring the generated Zig implementation files include the necessary lifecycle management hooks.

Why does my Zig-JS binding require generated prototypes for JavaScriptCore integration?

Zig-JS bindings require generated prototypes for JavaScriptCore integration because they define the API structure and lifecycle management needed to safely bridge JS objects to their underlying Zig implementations within Bun.