Registry / web-framework / vgl-compiler

vgl-compiler

JSON →
library0.0.6jsnpmunverified

A compiler that transforms Visual Grid Language (VGL) statements, used in GSS (Grid Style Sheets), into GSS-flavored Visual Format Language (VFL). Current version 0.0.6 is an early release with minimal documentation. It aims to provide feature parity with W3C Grid Layout Module using constraint-based primitives. The project has been moved to the GSS organization on GitHub. Key differentiator: enables 2D grid layout authoring via VGL, compiled to 1D VFL constraints.

npm install vgl-compiler
INSTALL
IMPORT
SIG · VGL-COMPILER
V
vgl-compiler
web-frameworkjavascriptv0.0.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compile
✓ import { compile } from 'vgl-compiler'
✗ const compile = require('vgl-compiler')
ESM-only export
default
✓ import vglCompiler from 'vgl-compiler'
✗ const vglCompiler = require('vgl-compiler')
Default export is the compile function
TokenType
✓ import { TokenType } from 'vgl-compiler'
✗ const { TokenType } = require('vgl-compiler')
Type exports for custom compile options

Compile a VGL grid definition into VFL constraints.

import { compile } from 'vgl-compiler'; const vglCode = ` @grid [container] { columns: 1fr 1fr 1fr; rows: auto 200px; areas: "a b c" "d e f"; } `; const vflOutput = compile(vglCode); console.log(vflOutput); // Output: VFL representation of the grid
Debug
Known issues
gotchaThe package has not been updated since 2015 and may have unresolved bugs.
fix
Consider using grid layout directly or browser-native CSS Grid.
affects: >=0.0.0
breakingPackage was moved: old repo at gss/vfl-compiler, new at gss/vgl-compiler.
fix
Update dependency to gss/vgl-compiler and ensure version >=0.0.6.
affects: <0.0.6
gotchaNo TypeScript typings shipped; manual typing may be needed.
fix
Use @types/vgl-compiler if available or declare module.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'error-reporter'
v0.0.5 and earlier omitted error-reporter as a dependency.
fix
npm install vgl-compiler@0.0.6 (or add error-reporter to your own dependencies).
TypeError: compile is not a function
Using default import from CommonJS require incorrectly.
fix
Use import { compile } from 'vgl-compiler' instead of require('vgl-compiler').compile.
Upgrade
Version history
0.0.6latest on npm
Audit
Dependencies
error-reporterrequiredReports compilation errors
Agent activity
8 hits · last 30 days
node
8
Resources
vgl-compiler — npm install vgl-compiler · libregistry