absolute json paths
This commit is contained in:
parent
4ff6368a8c
commit
cafa9108bb
|
|
@ -1,12 +1,17 @@
|
||||||
import { globals } from 'shrimp'
|
import { globals } from 'shrimp'
|
||||||
import { AnsiUp } from 'ansi_up'
|
import { AnsiUp } from 'ansi_up'
|
||||||
|
import { join, dirname } from 'path'
|
||||||
|
import { fileURLToPath } from 'url'
|
||||||
|
|
||||||
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
||||||
|
const dataDir = join(__dirname, '..', 'data')
|
||||||
|
|
||||||
const buffer: string[] = []
|
const buffer: string[] = []
|
||||||
const NOSPACE_TOKEN = '!!ribbit-nospace!!'
|
const NOSPACE_TOKEN = '!!ribbit-nospace!!'
|
||||||
const TAG_TOKEN = '!!ribbit-tag!!'
|
const TAG_TOKEN = '!!ribbit-tag!!'
|
||||||
const SELF_CLOSING = new Set(await Bun.file('./data/self-closing.json').json())
|
const SELF_CLOSING = new Set(await Bun.file(join(dataDir, 'self-closing.json')).json())
|
||||||
const HTML5_TAGS = await Bun.file('./data/tags.json').json()
|
const HTML5_TAGS = await Bun.file(join(dataDir, 'tags.json')).json()
|
||||||
const HTML5_ATTRS = new Set(await Bun.file('./data/attrs.json').json())
|
const HTML5_ATTRS = new Set(await Bun.file(join(dataDir, 'attrs.json')).json())
|
||||||
|
|
||||||
export function wrapCode(code: string): string {
|
export function wrapCode(code: string): string {
|
||||||
return "ribbit do:\n " + code + "\nend"
|
return "ribbit do:\n " + code + "\nend"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user