-
-
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.
- Loading branch information
Showing
14 changed files
with
267 additions
and
54 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,6 +31,9 @@ jobs: | |
name: Deploy | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
pull-requests: write # Needed for biome comments | ||
|
||
steps: | ||
- name: 📚 Git checkout | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
@@ -44,6 +47,8 @@ jobs: | |
with: | ||
deno-version: ${{ env.DENO_VERSION }} | ||
- name: 📦 Cache dependencies | ||
run: deno install --frozen | ||
run: deno install --frozen --allow-scripts=npm:@biomejs/[email protected] | ||
- name: 🕵️ Run linter, verify formatting, typecheck | ||
run: deno task ci | ||
- name: 🔨 Build | ||
run: deno task build |
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 |
---|---|---|
@@ -1,6 +1,7 @@ | ||
{ | ||
"recommendations": [ | ||
"denoland.vscode-deno", | ||
"bradlc.vscode-tailwindcss" | ||
"bradlc.vscode-tailwindcss", | ||
"biomejs.biome" | ||
] | ||
} |
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 |
---|---|---|
@@ -1,20 +1,27 @@ | ||
{ | ||
"deno.enable": true, | ||
"deno.lint": true, | ||
"editor.defaultFormatter": "denoland.vscode-deno", | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
"editor.defaultFormatter": "biomejs.biome", | ||
"[typescript][typescriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
"[javascript][javascriptreact]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
"[json]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "denoland.vscode-deno" | ||
"[css]": { | ||
"editor.defaultFormatter": "biomejs.biome" | ||
}, | ||
"css.customData": [ | ||
".vscode/tailwind.json" | ||
] | ||
"editor.codeActionsOnSave": { | ||
"quickfix.biome": "always", | ||
"source.organizeImports.biome": "always" | ||
}, | ||
"css.customData": [".vscode/tailwind.json"], | ||
"tailwindCSS.experimental.classRegex": [ | ||
"tw`([^`]*)", | ||
["tw\\(([^\\)]*)\\)", "`([^`]*)`"] | ||
], | ||
"cSpell.words": ["Preact"] | ||
} |
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,62 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "deno", | ||
"command": "task", | ||
"problemMatcher": ["$deno"], | ||
"label": "deno task: dev", | ||
"detail": "Run the server in development mode", | ||
"args": ["dev"], | ||
"group": { | ||
"kind": "build" | ||
}, | ||
"icon": { | ||
"color": "terminal.ansiGreen", | ||
"id": "wrench" | ||
}, | ||
}, | ||
{ | ||
"type": "deno", | ||
"command": "task", | ||
"problemMatcher": ["$deno"], | ||
"label": "deno task: start", | ||
"detail": "Run the server", | ||
"args": ["start"], | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"icon": { | ||
"color": "terminal.ansiWhite", | ||
"id": "server" | ||
}, | ||
"runOptions": { | ||
"runOn": "folderOpen", | ||
"instanceLimit": 1 | ||
}, | ||
"promptOnClose": false, | ||
"presentation": { | ||
"reveal": "silent", | ||
"panel": "dedicated", | ||
"showReuseMessage": false, | ||
"clear": true | ||
} | ||
}, | ||
{ | ||
"type": "deno", | ||
"command": "task", | ||
"problemMatcher": ["$deno"], | ||
"label": "deno task: build", | ||
"detail": "Build the website", | ||
"args": ["build"], | ||
"group": { | ||
"kind": "build" | ||
}, | ||
"icon": { | ||
"color": "terminal.ansiBlue", | ||
"id": "gear" | ||
}, | ||
}, | ||
] | ||
} |
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,64 @@ | ||
{ | ||
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", | ||
"organizeImports": { | ||
"enabled": true | ||
}, | ||
"formatter": { | ||
"enabled": true, | ||
"indentStyle": "space", | ||
"formatWithErrors": true | ||
}, | ||
"linter": { | ||
"enabled": true, | ||
"rules": { | ||
"all": true, | ||
"nursery": { | ||
"all": true, | ||
"noHeadElement": "off", | ||
"noImgElement": "off", | ||
"noNestedTernary": "off", | ||
"useComponentExportOnlyModules": "off", | ||
"useConsistentCurlyBraces": "off", | ||
"useExplicitType": "off", | ||
"useImportRestrictions": "off" | ||
}, | ||
"style": { | ||
"noDefaultExport": "off", | ||
"noImplicitBoolean": "off", | ||
"useDefaultSwitchClause": "off", | ||
"useFilenamingConvention": "off", | ||
"useNamingConvention": "off" | ||
}, | ||
"complexity": { | ||
"useLiteralKeys": "off" | ||
}, | ||
"suspicious": { | ||
"noConsole": { | ||
"level": "warn", | ||
"options": { | ||
"allow": ["error", "info", "warn"] | ||
} | ||
}, | ||
"noReactSpecificProps": "off" | ||
}, | ||
"correctness": { | ||
"noUndeclaredDependencies": "off" | ||
}, | ||
"a11y": { | ||
"noLabelWithoutControl": "off" | ||
} | ||
} | ||
}, | ||
"vcs": { | ||
"enabled": true, | ||
"useIgnoreFile": true, | ||
"clientKind": "git", | ||
"defaultBranch": "main" | ||
}, | ||
"files": { | ||
"ignore": [".vscode/*.json"] | ||
}, | ||
"javascript": { | ||
"globals": ["Deno"] | ||
} | ||
} |
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 |
---|---|---|
@@ -1,16 +1,16 @@ | ||
import type { ComponentChildren } from "preact"; | ||
import type { ComponentChildren, JSX } from "preact"; | ||
|
||
export interface ButtonProps { | ||
onClick?: () => void; | ||
children?: ComponentChildren; | ||
disabled?: boolean; | ||
} | ||
|
||
export function Button(props: ButtonProps) { | ||
export function Button(props: ButtonProps): JSX.Element { | ||
return ( | ||
<button | ||
{...props} | ||
class="px-2 py-1 border-gray-500 border-2 rounded bg-white hover:bg-gray-200 transition-colors" | ||
class="rounded border-2 border-gray-500 bg-white px-2 py-1 transition-colors hover:bg-gray-200" | ||
/> | ||
); | ||
} |
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 |
---|---|---|
@@ -1,45 +1,58 @@ | ||
{ | ||
"nodeModulesDir": "auto", | ||
"tasks": { | ||
"check": "deno fmt --check && deno lint && deno check **/*.ts && deno check **/*.tsx", | ||
"check": { | ||
"command": "sleep 0", | ||
"dependencies": ["format", "lint", "typecheck"] | ||
}, | ||
"format": "biome format --write", | ||
"format:check": "biome format", | ||
"lint": { | ||
"command": "sleep 0", | ||
"dependencies": ["lint:deno", "lint:biome"] | ||
}, | ||
"lint:deno": "deno lint", | ||
"lint:biome": "biome check --error-on-warnings", | ||
"ci": { | ||
"command": "sleep 0", | ||
"dependencies": ["lint:deno", "ci:biome", "typecheck"] | ||
}, | ||
"ci:biome": "biome ci --error-on-warnings", | ||
"typecheck": "deno check -q **/*.ts **/*.tsx", | ||
"dev": "deno run -A --watch=static/,routes/ dev.ts", | ||
"build": "deno run -A dev.ts build", | ||
"start": "deno run -A main.ts", | ||
"update": "deno run -A -r jsr:@fresh/update ." | ||
}, | ||
"lint": { | ||
"rules": { | ||
"tags": [ | ||
"fresh", | ||
"recommended" | ||
"tags": ["fresh"], | ||
"include": [ | ||
"ban-untagged-todo", | ||
"explicit-module-boundary-types", | ||
"guard-for-in", | ||
"no-await-in-loop", | ||
"no-external-import", | ||
"no-implicit-declare-namespace-export", | ||
"no-non-null-asserted-optional-chain", | ||
"no-sync-fn-in-async-fn", | ||
"no-throw-literal" | ||
] | ||
} | ||
}, | ||
"exclude": [ | ||
"**/_fresh/*" | ||
], | ||
"exclude": ["**/_fresh/*"], | ||
"imports": { | ||
"fresh": "jsr:@fresh/core@^2.0.0-alpha.26", | ||
"@biomejs/biome": "npm:@biomejs/biome@^1.9.4", | ||
"@fresh/plugin-tailwind": "jsr:@fresh/plugin-tailwind@^0.0.1-alpha.7", | ||
"preact": "npm:preact@^10.25.1", | ||
"@preact/signals": "npm:@preact/signals@^1.3.1", | ||
"fresh": "jsr:@fresh/core@^2.0.0-alpha.26", | ||
"preact": "npm:preact@^10.25.1", | ||
"tailwindcss": "npm:tailwindcss@^3.4.16" | ||
}, | ||
"compilerOptions": { | ||
"lib": [ | ||
"dom", | ||
"dom.asynciterable", | ||
"dom.iterable", | ||
"deno.ns" | ||
], | ||
"lib": ["dom", "dom.asynciterable", "dom.iterable", "deno.ns"], | ||
"jsx": "precompile", | ||
"jsxImportSource": "preact", | ||
"jsxPrecompileSkipElements": [ | ||
"a", | ||
"img", | ||
"source", | ||
"body", | ||
"html", | ||
"head" | ||
] | ||
"jsxPrecompileSkipElements": ["a", "img", "source", "body", "html", "head"] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.