-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add/update build script aliases
- add clean script - add typedoc config files
- Loading branch information
1 parent
8fed055
commit 13a05a5
Showing
13 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"excludeProtected": true, | ||
"excludePrivate": true, | ||
"excludeInternal": true, | ||
"out": "doc", | ||
"entryPoints": ["src/index.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"excludeProtected": true, | ||
"excludePrivate": true, | ||
"excludeInternal": true, | ||
"out": "doc", | ||
"entryPoints": ["src/index.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"excludeProtected": true, | ||
"excludePrivate": true, | ||
"excludeInternal": true, | ||
"out": "doc", | ||
"entryPoints": ["src/index.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"excludeProtected": true, | ||
"excludePrivate": true, | ||
"excludeInternal": true, | ||
"out": "doc", | ||
"entryPoints": ["src/index.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"excludeProtected": true, | ||
"excludePrivate": true, | ||
"excludeInternal": true, | ||
"out": "doc", | ||
"entryPoints": ["src/index.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"excludeProtected": true, | ||
"excludePrivate": true, | ||
"excludeInternal": true, | ||
"out": "doc", | ||
"entryPoints": ["src/index.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
import { readdirSync, rmSync, statSync, unlinkSync } from "node:fs"; | ||
import { basename, sep } from "node:path"; | ||
|
||
// utility functions adapted from thi.ng/file-io | ||
// used here directly to be entirely self-contained... | ||
|
||
const isDirectory = (path) => statSync(path).isDirectory(); | ||
|
||
const files = (dir, match, maxDepth = Infinity) => | ||
__files(dir, match, maxDepth, 0); | ||
|
||
function* __files(dir, match, maxDepth = Infinity, depth = 0) { | ||
if (depth >= maxDepth) return; | ||
const pred = (x) => match.test(x); | ||
for (let f of readdirSync(dir).sort()) { | ||
const curr = dir + sep + f; | ||
try { | ||
if (isDirectory(curr)) { | ||
yield* __files(curr, match, maxDepth, depth + 1); | ||
} else if (pred(curr)) { | ||
yield curr; | ||
} | ||
} catch (e) { | ||
console.warn(`ignoring file: ${f} (${e.message})`); | ||
} | ||
} | ||
} | ||
|
||
function* dirs(dir, pred, maxDepth = Infinity, depth = 0) { | ||
if (depth >= maxDepth) return; | ||
for (let f of readdirSync(dir).sort()) { | ||
const curr = dir + sep + f; | ||
try { | ||
if (statSync(curr).isDirectory()) { | ||
if (pred(curr)) yield curr; | ||
yield* dirs(curr, pred, maxDepth, depth + 1); | ||
} | ||
} catch (e) { | ||
console.warn(`ignoring file/dir: ${f} (${e.message})`); | ||
} | ||
} | ||
} | ||
|
||
// accept & merge additional dirs as CLI args | ||
const removeDirs = new Set([ | ||
"doc", | ||
"api", | ||
"generated", | ||
"internal", | ||
...process.argv.slice(2), | ||
]); | ||
|
||
for (let d of dirs(".", (x) => removeDirs.has(basename(x)), 1)) { | ||
console.log("removing directory:", d); | ||
rmSync(d, { recursive: true, force: true }); | ||
} | ||
|
||
for (let f of files(".", /\.(map|js|d\.ts|tsbuildinfo|wasn|wast|o)$/)) { | ||
if (f.indexOf("/bin/") === -1) { | ||
console.log("removing file:", f); | ||
unlinkSync(f); | ||
} | ||
} |