GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - openworkers/openworkers-transform

BranchesTags
Open more actions menu

Latest commit

 

History

9 Commits
9 Commits

Folders and files

NameName
Last commit message
Last commit date
benches
benches
 
 
src
src
 
 
.gitignore
.gitignore
 
 
Cargo.lock
Cargo.lock
 
 
Cargo.toml
Cargo.toml
 
 
README.md
README.md
 
 

Repository files navigation

openworkers-transform

SWC-based TypeScript/JavaScript transform for OpenWorkers.

  • Strips TypeScript types
  • Transforms export default { ... } → globalThis.default = { ... } (required for V8 classic script evaluation)
  • Collects named exports in globalThis.__exports, where the runtime finds a Durable Object class

Usage

use openworkers_transform::{parse_worker_code, CodeLanguage};

let code = b"export default { fetch() { return new Response('hello'); } }";
let result = parse_worker_code(code, CodeLanguage::JavaScript).unwrap();
// => "globalThis.default = { fetch () { return new Response('hello'); } };"

Supported patterns

Pattern Result
export default { ... } globalThis.default = { ... }
export default function f() {} globalThis.default = function f() {}
export default class C {} globalThis.default = class C {}
export { x as default } globalThis.default = x
Re-exports (from '...') Kept as-is
Named exports (export class X, export { a as b }) Declarations kept, and globalThis.__exports = { "X": X, "b": a } at the end

About

No description, website, or topics provided.

Resources

Readme
Activity
Custom properties

Stars

0 stars

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Sponsor this project

Packages

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.