Skip to content
This repository has been archived by the owner on Nov 12, 2024. It is now read-only.

Commit

Permalink
rm site
Browse files Browse the repository at this point in the history
  • Loading branch information
slmjkdbtl committed Oct 12, 2023
1 parent ef031c9 commit a0716c9
Show file tree
Hide file tree
Showing 296 changed files with 0 additions and 47,643 deletions.
48 changes: 0 additions & 48 deletions scripts/lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,65 +152,22 @@ export async function genDTS() {
// check if global defs are being generated
let globalGenerated = false

// contain the type data for doc gen
const types = {}
const sections = [{
name: "Start",
entries: [ "kaboom" ],
}]

// generate global decls for KaboomCtx members
let globalDts = ""

globalDts += "import { KaboomCtx } from \"./kaboom\"\n"
globalDts += "declare global {\n"

for (const stmt of stmts) {

if (!types[stmt.name]) {
types[stmt.name] = []
}

types[stmt.name].push(stmt)

if (stmt.name === "KaboomCtx") {

if (stmt.kind !== "InterfaceDeclaration") {
throw new Error("KaboomCtx must be an interface.")
}

for (const name in stmt.members) {

const mem = stmt.members[name]

globalDts += `\tconst ${name}: KaboomCtx["${name}"]\n`

const tags = mem[0].jsDoc?.tags ?? {}

if (tags["section"]) {
const name = tags["section"][0]
const docPath = path.resolve(`doc/sections/${name}.md`)
sections.push({
name: name,
entries: [],
doc: await isFile(docPath)
? await fs.readFile(docPath, "utf8")
: null,
})
}

const curSection = sections[sections.length - 1]

if (name && !curSection.entries.includes(name)) {
curSection.entries.push(name)
}

}

globalGenerated = true

}

}

globalDts += "}\n"
Expand All @@ -219,11 +176,6 @@ export async function genDTS() {
throw new Error("KaboomCtx not found, failed to generate global defs.")
}

writeFile("site/doc.json", JSON.stringify({
types,
sections,
}))

writeFile(`${distDir}/kaboom.d.ts`, dts)
writeFile(`${distDir}/global.d.ts`, globalDts)
writeFile(`${distDir}/global.js`, "")
Expand Down
6 changes: 0 additions & 6 deletions site/.eslintrc.json

This file was deleted.

5 changes: 0 additions & 5 deletions site/.gitignore

This file was deleted.

21 changes: 0 additions & 21 deletions site/README.md

This file was deleted.

25 changes: 0 additions & 25 deletions site/comps/Background.tsx

This file was deleted.

Loading

0 comments on commit a0716c9

Please sign in to comment.