Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: CI

on:
push:
branches: [main]
pull_request:

jobs:
all:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run all
13 changes: 13 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"printWidth": 120,
"tabWidth": 2,
"useTabs": false,
"semi": false,
"singleQuote": true,
"trailingComma": "all",
"arrowParens": "avoid",
"bracketSpacing": true,
"sortTailwindcss": true,
"ignorePatterns": ["node_modules", "dist", "out", ".next", "public"]
}
36 changes: 36 additions & 0 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "unicorn", "import", "react"],
"categories": {
"correctness": "error",
"suspicious": "warn",
"pedantic": "off",
"style": "off",
"restriction": "off",
"nursery": "off"
},
"rules": {
"no-unused-vars": [
"error",
{
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_"
}
],
"no-unused-expressions": [
"error",
{
"allowShortCircuit": true,
"allowTernary": true
}
],
"typescript/no-non-null-assertion": "warn",
"unicorn/no-useless-spread": "warn",
"unicorn/consistent-function-scoping": "warn",
"react/react-in-jsx-scope": "off",
"no-constant-binary-expression": "off",
"import/no-unassigned-import": ["error", { "allow": ["**/*.css"] }]
},
"ignorePatterns": ["node_modules", "dist", "out", ".next"]
}
Binary file modified bun.lockb
Binary file not shown.
2 changes: 2 additions & 0 deletions next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const withNextra = nextra({
const config = withNextra({
assetPrefix: process.env.NEXT_PUBLIC_CDN ?? '',
output: 'export',
reactStrictMode: true,
reactCompiler: true,
images: { unoptimized: true },
})

Expand Down
31 changes: 21 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,21 @@
"version": "0.0.0",
"private": true,
"type": "module",
"deployBump": 1,
"scripts": {
"postbuild": "next-sitemap",
"dev": "next dev",
"dev": "portless webgamedev next dev",
"build": "next build",
"start": "serve out",
"prestart": "bun purge-cdn.ts",
"lint": "next lint",
"format": "oxfmt .",
"format:check": "oxfmt --check .",
"lint": "oxlint .",
"lint:fix": "oxlint --fix .",
"typecheck": "tsc --noEmit",
"warden": "warden",
"all": "bun run format:check && bun run lint && bun run typecheck && bun run warden",
"prepare": "husky"
},
"prettier": {
"printWidth": 100,
"semi": false,
"singleQuote": true,
"arrowParens": "avoid"
},
"dependencies": {
"@codesandbox/sandpack-react": "2.7.0",
"@codesandbox/sandpack-themes": "2.0.21",
Expand All @@ -36,17 +35,29 @@
"@types/react": "18.3.3",
"@types/react-dom": "18.3.0",
"@typescript-eslint/eslint-plugin": "5.47.0",
"@verekia/warden": "0.0.3",
"autoprefixer": "10.4.16",
"babel-plugin-react-compiler": "1.0.0",
"eslint": "8.30.0",
"eslint-config-next": "15.0.2",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-react": "7.31.11",
"husky": "9.1.7",
"next-sitemap": "4.2.3",
"oxfmt": "0.48.0",
"oxlint": "1.63.0",
"portless": "0.13.0",
"postcss": "8.4.47",
"prettier": "3.0.3",
"tailwindcss": "3.4.1",
"tsconfig-paths": "4.2.0",
"typescript": "5.3.3"
}
},
"prettier": {
"arrowParens": "avoid",
"printWidth": 100,
"semi": false,
"singleQuote": true
},
"deployBump": 1
}
34 changes: 18 additions & 16 deletions purge-cdn.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
if (!process.env.BUNNY_PULLZONE_ID || !process.env.BUNNY_ACCESS_KEY) {
console.warn('BUNNY_PULLZONE_ID or BUNNY_ACCESS_KEY is not set')
process.exit(0)
}
const purge = async () => {
if (!process.env.BUNNY_PULLZONE_ID || !process.env.BUNNY_ACCESS_KEY) {
console.warn('BUNNY_PULLZONE_ID or BUNNY_ACCESS_KEY is not set')
process.exit(0)
}

try {
await fetch(`https://api.bunny.net/pullzone/${process.env.BUNNY_PULLZONE_ID}/purgeCache`, {
method: 'POST',
headers: {
'content-type': 'application/json',
AccessKey: process.env.BUNNY_ACCESS_KEY as string,
},
})
console.log('Purged CDN cache')
} catch (e) {
console.error(e)
try {
await fetch(`https://api.bunny.net/pullzone/${process.env.BUNNY_PULLZONE_ID}/purgeCache`, {
method: 'POST',
headers: {
'content-type': 'application/json',
AccessKey: process.env.BUNNY_ACCESS_KEY as string,
},
})
console.log('Purged CDN cache')
} catch (e) {
console.error(e)
}
}

export {}
purge()
4 changes: 1 addition & 3 deletions src/components/A.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
const A = ({ children, className = '', isExternal = true, ...props }) => (
<a
{...(isExternal ? { target: '_blank', rel: 'noopener' } : {})}
className={`_text-primary-600 _underline _decoration-from-font [text-underline-position:under] ${
className ?? ''
}`}
className={`_text-primary-600 _underline _decoration-from-font [text-underline-position:under] ${className ?? ''}`}
{...props}
>
{children}
Expand Down
Loading
Loading