commit 43877d689d9f21101c7941dbbd449705181fba9a Author: Michael Zhang Date: Thu Oct 17 18:23:54 2024 -0500 initial diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b512c09 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..92f5b32 --- /dev/null +++ b/README.md @@ -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. diff --git a/bun.lockb b/bun.lockb new file mode 100644 index 0000000..f357c55 Binary files /dev/null and b/bun.lockb differ diff --git a/compiler/index.ts b/compiler/index.ts new file mode 100644 index 0000000..563f187 --- /dev/null +++ b/compiler/index.ts @@ -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(); diff --git a/index.ts b/index.ts new file mode 100644 index 0000000..f67b2c6 --- /dev/null +++ b/index.ts @@ -0,0 +1 @@ +console.log("Hello via Bun!"); \ No newline at end of file diff --git a/lib/Resources.dhall b/lib/Resources.dhall new file mode 100644 index 0000000..828c018 --- /dev/null +++ b/lib/Resources.dhall @@ -0,0 +1,9 @@ +let File + : Type + = { path : Text, contents : Text } + +let Resources + : Type + = { files : List File } + +in { Resources } diff --git a/lib/WebServer.dhall b/lib/WebServer.dhall new file mode 100644 index 0000000..0967ef4 --- /dev/null +++ b/lib/WebServer.dhall @@ -0,0 +1 @@ +{} diff --git a/package.json b/package.json new file mode 100644 index 0000000..33286c9 --- /dev/null +++ b/package.json @@ -0,0 +1,11 @@ +{ + "name": "mzforge", + "module": "compiler/index.ts", + "type": "module", + "devDependencies": { + "@types/bun": "latest" + }, + "peerDependencies": { + "typescript": "^5.0.0" + } +} \ No newline at end of file diff --git a/server/main.dhall b/server/main.dhall new file mode 100644 index 0000000..a601184 --- /dev/null +++ b/server/main.dhall @@ -0,0 +1 @@ +{ x = 1 } diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..238655f --- /dev/null +++ b/tsconfig.json @@ -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 + } +}