MCPcopy Index your code
hub / github.com/withastro/compiler

github.com/withastro/compiler @v0.2.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.2.7 ↗ · + Follow
472 symbols 1,224 edges 45 files 148 documented · 31%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Astro Compiler

Astro’s Go + WASM compiler.

⚠️ Currently in beta!

Install

npm install @astrojs/compiler

Usage

Note: API will change before 1.0! Use at your own discretion.

import { transform } from '@astrojs/compiler';

const result = await transform(source, {
  site: 'https://mysite.dev',
  sourcefile: '/Users/astro/Code/project/src/pages/index.astro',
  sourcemap: 'both',
  internalURL: 'astro/internal',
});

Contributing

CONTRIBUTING.md

Extension points exported contracts — how you extend this code

ParseOption (FuncType)
ParseOption configures a parser.
internal/parser.go
Service (Interface)
(no doc)
lib/compiler/browser/index.ts
PreprocessorResult (Interface)
(no doc)
lib/compiler/shared/types.ts
TransformOptions (Interface)
(no doc)
lib/compiler/shared/types.ts
TransformResult (Interface)
(no doc)
lib/compiler/shared/types.ts
InitializeOptions (Interface)
(no doc)
lib/compiler/shared/types.ts

Core symbols most depended-on inside this repo

print
called by 104
internal/printer/printer.go
pop
called by 56
internal/node.go
addElement
called by 52
internal/parser.go
readByte
called by 47
internal/token.go
addSourceMapping
called by 38
internal/printer/printer.go
top
called by 35
internal/parser.go
popUntil
called by 34
internal/parser.go
WriteString
called by 34
internal/escape.go

Shape

Function 244
Method 162
Struct 36
Interface 12
Class 8
TypeAlias 8
FuncType 2

Languages

Go66%
TypeScript34%

Modules by API surface

internal/parser.go69 symbols
lib/compiler/deno/wasm_exec.js50 symbols
internal/token.go49 symbols
lib/compiler/browser/wasm_exec.ts48 symbols
internal/sourcemap/sourcemap.go29 symbols
internal/xxhash/xxhash.go24 symbols
internal/printer/printer.go18 symbols
internal/node.go18 symbols
internal/js_scanner/js_scanner.go18 symbols
lib/compiler/deno/internal.ts17 symbols
lib/compiler/node/wasm_exec.ts16 symbols
cmd/astro-wasm/astro-wasm.go11 symbols

For agents

$ claude mcp add compiler \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact