commit 10ba53626f5cedac9998ce10b0d3ee1e2be80eb6 Author: Quinn Date: Mon May 26 22:59:14 2025 +0200 initialize project diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..e3ba2fa --- /dev/null +++ b/.editorconfig @@ -0,0 +1,19 @@ +[*] +charset = utf-8 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true +indent_style = tab +indent_size = tab + +[{makefile,Makefile}] +indent_style = tab +indent_size = tab + +[*.{md,json,tsx,js,html,css}] +indent_style = tab +indent_size = tab + +[*.{yaml}] +indent_style = space +tab_width = 2 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e109b43 --- /dev/null +++ b/.gitignore @@ -0,0 +1,15 @@ +# ignore all dotfiles +.* + +# unignore specific dotfiles +!.gitignore +!.editorconfig +!/.github/ + +# ignore specific files +*.js +*.lock +/package-lock.json +/out/ +/web/js/ +/node_modules/ diff --git a/makefile b/makefile new file mode 100644 index 0000000..50bbbc7 --- /dev/null +++ b/makefile @@ -0,0 +1,24 @@ +ESBUILD ?= npx esbuild +ESFLAGS += --bundle --minify + +# debug handling +DEBUG ?= 0 +ifneq ($(DEBUG),0) +ESFLAGS += --define:NDEBUG=0 +else +ESFLAGS += --define:NDEBUG=1 +endif + +.PHONY: all clean +all: out/script.js out/index.html +clean:; rm -rf out/ + +# generating of HTML +out/index.html: web/index.html + @mkdir -p $(@D) + cp -f $< $@ + +# compiles / links source code +out/script.js: web/src/*.tsx + @mkdir -p $(@D) + npx esbuild web/src/main.tsx $(ESFLAGS) --outfile=$@ diff --git a/package.json b/package.json new file mode 100644 index 0000000..5bfdff3 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "$schema": "https://json.schemastore.org/package", + "dependencies": { + "esbuild": "^0.25.4", + "react": "^19.1.0", + "react-dom": "^19.1.0" + }, + "devDependencies": { + "http-server": "^14.1.1", + "@types/react": "^19.1.2", + "@types/react-dom": "^19.1.2" + } +} diff --git a/web/index.html b/web/index.html new file mode 100644 index 0000000..601c16a --- /dev/null +++ b/web/index.html @@ -0,0 +1,29 @@ + + + + + + + PLACEHOLDER + + + + + + + + + + + + + + + + + + + + + + diff --git a/web/src/d.ts b/web/src/d.ts new file mode 100644 index 0000000..b30aa62 --- /dev/null +++ b/web/src/d.ts @@ -0,0 +1 @@ +declare const NDEBUG: boolean; diff --git a/web/src/main.tsx b/web/src/main.tsx new file mode 100644 index 0000000..5a9fa19 --- /dev/null +++ b/web/src/main.tsx @@ -0,0 +1,5 @@ +import React from 'react' +import { createRoot } from 'react-dom/client' + +const Main = () =>

Hello, World

+createRoot(document.getElementById("root")!).render(
)