This commit is contained in:
Michael Zhang 2024-10-17 18:23:54 -05:00
commit 43877d689d
10 changed files with 79 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
node_modules

15
README.md Normal file
View file

@ -0,0 +1,15 @@
# mzforge
To install dependencies:
```bash
bun install
```
To run:
```bash
bun run index.ts
```
This project was created using `bun init` in bun v1.1.29. [Bun](https://bun.sh) is a fast all-in-one JavaScript runtime.

BIN
bun.lockb Normal file

Binary file not shown.

13
compiler/index.ts Normal file
View file

@ -0,0 +1,13 @@
import { $ } from "bun";
const inFile: string = "server/main.dhall";
const outDir: string = "dist";
const cmdOutput = await $`dhall-to-json --file ${inFile}`;
if (cmdOutput.exitCode !== 0) {
console.error(cmdOutput.stderr);
process.exit(1);
}
const source = cmdOutput.json();

1
index.ts Normal file
View file

@ -0,0 +1 @@
console.log("Hello via Bun!");

9
lib/Resources.dhall Normal file
View file

@ -0,0 +1,9 @@
let File
: Type
= { path : Text, contents : Text }
let Resources
: Type
= { files : List File }
in { Resources }

1
lib/WebServer.dhall Normal file
View file

@ -0,0 +1 @@
{}

11
package.json Normal file
View file

@ -0,0 +1,11 @@
{
"name": "mzforge",
"module": "compiler/index.ts",
"type": "module",
"devDependencies": {
"@types/bun": "latest"
},
"peerDependencies": {
"typescript": "^5.0.0"
}
}

1
server/main.dhall Normal file
View file

@ -0,0 +1 @@
{ x = 1 }

27
tsconfig.json Normal file
View file

@ -0,0 +1,27 @@
{
"compilerOptions": {
// Enable latest features
"lib": ["ESNext", "DOM"],
"target": "ESNext",
"module": "ESNext",
"moduleDetection": "force",
"jsx": "react-jsx",
"allowJs": true,
// Bundler mode
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"verbatimModuleSyntax": true,
"noEmit": true,
// Best practices
"strict": true,
"skipLibCheck": true,
"noFallthroughCasesInSwitch": true,
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
}
}