Skip to content

Commit 7d888b4

Browse files
committed
Switch to biome
1 parent 523e426 commit 7d888b4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

53 files changed

+2825
-2804
lines changed

.editorconfig

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
trim_trailing_whitespace = true
6+
insert_final_newline = true
7+
charset = utf-8
8+
indent_style = tab
9+
indent_size = 2
10+
11+
# YAML doesn't support hard tabs 🙃
12+
# Templates that will be weird with hard tabs in the website editor
13+
[{**.yml,**.md,**.rs,**.mdx,justfile,**.json}]
14+
indent_style = space
15+
16+
[*.rs]
17+
indent_size = 4

.vscode/extensions.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["biomejs.biome"]
2+
"recommendations": ["biomejs.biome"]
33
}

.vscode/settings.json

+13-15
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,15 @@
11
{
2-
"search.exclude": {
3-
"**/.yarn": true,
4-
"**/.pnp.*": true
5-
},
6-
"typescript.enablePromptUseWorkspaceTsdk": true,
7-
"typescript.preferences.importModuleSpecifier": "non-relative",
8-
"javascript.preferences.importModuleSpecifier": "non-relative",
9-
"editor.defaultFormatter": "esbenp.prettier-vscode",
10-
"typescript.tsdk": "node_modules/typescript/lib",
11-
"cSpell.words": [
12-
"rjsf"
13-
],
14-
"[typescriptreact]": {
15-
"editor.defaultFormatter": "biomejs.biome"
16-
}
2+
"search.exclude": {
3+
"**/.yarn": true,
4+
"**/.pnp.*": true
5+
},
6+
"typescript.enablePromptUseWorkspaceTsdk": true,
7+
"typescript.preferences.importModuleSpecifier": "non-relative",
8+
"javascript.preferences.importModuleSpecifier": "non-relative",
9+
"editor.defaultFormatter": "esbenp.prettier-vscode",
10+
"typescript.tsdk": "node_modules/typescript/lib",
11+
"cSpell.words": ["rjsf"],
12+
"[typescriptreact]": {
13+
"editor.defaultFormatter": "biomejs.biome"
14+
}
1715
}

biome.json biome.jsonc

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
"organizeImports": {
44
"enabled": true
55
},
6+
"javascript": {
7+
"formatter": {
8+
"quoteStyle": "single"
9+
}
10+
},
611
"linter": {
712
"enabled": true,
813
"rules": {

package.json

+77-79
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,79 @@
11
{
2-
"name": "edge-cms",
3-
"type": "module",
4-
"private": true,
5-
"sideEffects": false,
6-
"scripts": {
7-
"dev": "rakkas",
8-
"build": "rakkas build",
9-
"start": "node dist/server",
10-
"start-miniflare": "miniflare --modules dist/server/cloudflare-workers-bundle.js",
11-
"format": "prettier --write --ignore-unknown src",
12-
"test": "npm run test:typecheck && npm run test:format && npm run test:lint && npm run test:unit",
13-
"test:typecheck": "tsc -p tsconfig.json --noEmit",
14-
"test:format": "prettier --check --ignore-unknown src",
15-
"test:lint": "eslint . --ignore-pattern dist",
16-
"test:unit": "vitest run",
17-
"preinstall": "npx only-allow pnpm",
18-
"pages-deploy": "wrangler pages publish dist/client/ --project-name edge-cms",
19-
"pages-preview": "wrangler pages dev dist/client/"
20-
},
21-
"devDependencies": {
22-
"@biomejs/biome": "1.8.3",
23-
"@cloudflare/workers-types": "4.20240620.0",
24-
"@hattip/adapter-cloudflare-workers": "0.0.46",
25-
"@hattip/bundler-cloudflare-workers": "0.0.46",
26-
"@ltd/j-toml": "1.38.0",
27-
"@miniflare/d1": "2.14.2",
28-
"@miniflare/shared": "2.14.2",
29-
"@miniflare/tre": "3.0.0-next.14",
30-
"@tailwindcss/forms": "0.5.7",
31-
"@types/better-sqlite3": "7.6.11",
32-
"@types/gensync": "1.0.4",
33-
"@types/lodash-es": "4.17.12",
34-
"@types/react": "18.3.3",
35-
"@types/react-dom": "18.3.0",
36-
"autoprefixer": "10.4.19",
37-
"better-sqlite3": "11.1.2",
38-
"daisyui": "4.12.10",
39-
"miniflare": "3.20240701.0",
40-
"only-allow": "^1.1.1",
41-
"postcss": "8.4.39",
42-
"prettier": "3.3.2",
43-
"rakkasjs": "0.7.0-next.48",
44-
"sql-formatter": "15.3.2",
45-
"tailwindcss": "3.4.4",
46-
"typescript": "5.5.3",
47-
"vite": "5.3.3",
48-
"vite-node": "2.0.1",
49-
"vite-plugin-monaco-editor": "^1.1.0",
50-
"vite-tsconfig-paths": "4.3.2",
51-
"vitest": "2.0.1",
52-
"wrangler": "3.63.2"
53-
},
54-
"dependencies": {
55-
"@hattip/response": "0.0.46",
56-
"@monaco-editor/react": "^4.5.1",
57-
"@rjsf/core": "5.19.2",
58-
"@rjsf/utils": "5.19.2",
59-
"@rjsf/validator-ajv8": "5.19.2",
60-
"@sinclair/typebox": "0.32.34",
61-
"@types/json-schema": "7.0.15",
62-
"clsx": "2.1.1",
63-
"dirty-json": "0.9.2",
64-
"gensync": "1.0.0-beta.2",
65-
"lodash-es": "4.17.21",
66-
"monaco-editor": "^0.50.0",
67-
"react": "18.3.1",
68-
"react-dom": "18.3.1",
69-
"react-error-boundary": "4.0.13",
70-
"sql-template-tag": "5.2.1",
71-
"sqlstring-sqlite": "0.1.1",
72-
"zod": "3.23.8",
73-
"zustand": "4.5.4"
74-
},
75-
"pnpm": {
76-
"onlyBuiltDependencies": [
77-
"better-sqlite3"
78-
]
79-
},
80-
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
2+
"name": "edge-cms",
3+
"type": "module",
4+
"private": true,
5+
"sideEffects": false,
6+
"scripts": {
7+
"dev": "rakkas",
8+
"build": "rakkas build",
9+
"start": "node dist/server",
10+
"start-miniflare": "miniflare --modules dist/server/cloudflare-workers-bundle.js",
11+
"format": "prettier --write --ignore-unknown src",
12+
"test": "npm run test:typecheck && npm run test:format && npm run test:lint && npm run test:unit",
13+
"test:typecheck": "tsc -p tsconfig.json --noEmit",
14+
"test:format": "prettier --check --ignore-unknown src",
15+
"test:lint": "eslint . --ignore-pattern dist",
16+
"test:unit": "vitest run",
17+
"preinstall": "npx only-allow pnpm",
18+
"pages-deploy": "wrangler pages publish dist/client/ --project-name edge-cms",
19+
"pages-preview": "wrangler pages dev dist/client/"
20+
},
21+
"devDependencies": {
22+
"@biomejs/biome": "1.8.3",
23+
"@cloudflare/workers-types": "4.20240620.0",
24+
"@hattip/adapter-cloudflare-workers": "0.0.46",
25+
"@hattip/bundler-cloudflare-workers": "0.0.46",
26+
"@ltd/j-toml": "1.38.0",
27+
"@miniflare/d1": "2.14.2",
28+
"@miniflare/shared": "2.14.2",
29+
"@miniflare/tre": "3.0.0-next.14",
30+
"@tailwindcss/forms": "0.5.7",
31+
"@types/better-sqlite3": "7.6.11",
32+
"@types/gensync": "1.0.4",
33+
"@types/lodash-es": "4.17.12",
34+
"@types/react": "18.3.3",
35+
"@types/react-dom": "18.3.0",
36+
"autoprefixer": "10.4.19",
37+
"better-sqlite3": "11.1.2",
38+
"daisyui": "4.12.10",
39+
"miniflare": "3.20240701.0",
40+
"only-allow": "^1.1.1",
41+
"postcss": "8.4.39",
42+
"prettier": "3.3.2",
43+
"rakkasjs": "0.7.0-next.48",
44+
"sql-formatter": "15.3.2",
45+
"tailwindcss": "3.4.4",
46+
"typescript": "5.5.3",
47+
"vite": "5.3.3",
48+
"vite-node": "2.0.1",
49+
"vite-plugin-monaco-editor": "^1.1.0",
50+
"vite-tsconfig-paths": "4.3.2",
51+
"vitest": "2.0.1",
52+
"wrangler": "3.63.2"
53+
},
54+
"dependencies": {
55+
"@hattip/response": "0.0.46",
56+
"@monaco-editor/react": "^4.5.1",
57+
"@rjsf/core": "5.19.2",
58+
"@rjsf/utils": "5.19.2",
59+
"@rjsf/validator-ajv8": "5.19.2",
60+
"@sinclair/typebox": "0.32.34",
61+
"@types/json-schema": "7.0.15",
62+
"clsx": "2.1.1",
63+
"dirty-json": "0.9.2",
64+
"gensync": "1.0.0-beta.2",
65+
"lodash-es": "4.17.21",
66+
"monaco-editor": "^0.50.0",
67+
"react": "18.3.1",
68+
"react-dom": "18.3.1",
69+
"react-error-boundary": "4.0.13",
70+
"sql-template-tag": "5.2.1",
71+
"sqlstring-sqlite": "0.1.1",
72+
"zod": "3.23.8",
73+
"zustand": "4.5.4"
74+
},
75+
"pnpm": {
76+
"onlyBuiltDependencies": ["better-sqlite3"]
77+
},
78+
"packageManager": "[email protected]+sha512.140036830124618d624a2187b50d04289d5a087f326c9edfc0ccd733d76c4f52c3a313d4fc148794a2a9d81553016004e6742e8cf850670268a7387fc220c903"
8179
}

postcss.config.cjs

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module.exports = {
2-
plugins: {
3-
tailwindcss: {},
4-
autoprefixer: {},
5-
},
2+
plugins: {
3+
tailwindcss: {},
4+
autoprefixer: {},
5+
},
66
};

public/_routes.json

+14-14
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
{
2-
"version": 1,
3-
"include": ["/*"],
4-
"exclude": [
5-
"/assets/*",
6-
"/monacoeditorwork/*",
7-
"/robots.txt",
8-
"/android-chrome-192x192.png",
9-
"/android-chrome-512x512.png",
10-
"/apple-touch-icon.png",
11-
"/favicon-16x16.png",
12-
"/favicon-32x32.png",
13-
"/favicon.ico",
14-
"/site.webmanifest"
15-
]
2+
"version": 1,
3+
"include": ["/*"],
4+
"exclude": [
5+
"/assets/*",
6+
"/monacoeditorwork/*",
7+
"/robots.txt",
8+
"/android-chrome-192x192.png",
9+
"/android-chrome-512x512.png",
10+
"/apple-touch-icon.png",
11+
"/favicon-16x16.png",
12+
"/favicon-32x32.png",
13+
"/favicon.ico",
14+
"/site.webmanifest"
15+
]
1616
}

public/site.webmanifest

+17-17
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
{
2-
"name": "",
3-
"short_name": "",
4-
"icons": [
5-
{
6-
"src": "/android-chrome-192x192.png",
7-
"sizes": "192x192",
8-
"type": "image/png"
9-
},
10-
{
11-
"src": "/android-chrome-512x512.png",
12-
"sizes": "512x512",
13-
"type": "image/png"
14-
}
15-
],
16-
"theme_color": "#ffffff",
17-
"background_color": "#ffffff",
18-
"display": "standalone"
2+
"name": "",
3+
"short_name": "",
4+
"icons": [
5+
{
6+
"src": "/android-chrome-192x192.png",
7+
"sizes": "192x192",
8+
"type": "image/png"
9+
},
10+
{
11+
"src": "/android-chrome-512x512.png",
12+
"sizes": "512x512",
13+
"type": "image/png"
14+
}
15+
],
16+
"theme_color": "#ffffff",
17+
"background_color": "#ffffff",
18+
"display": "standalone"
1919
}

renovate.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": [
4-
"local>patdx/renovate-config"
5-
]
2+
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3+
"extends": ["local>patdx/renovate-config"]
64
}

scripts/generate-wrangler.js

+33-31
Original file line numberDiff line numberDiff line change
@@ -6,42 +6,44 @@ import child_process from 'child_process';
66
let secrets = undefined;
77

88
try {
9-
const result = child_process.execSync('sops --decrypt secrets.json', {
10-
encoding: 'utf8',
11-
});
12-
secrets = JSON.parse(result);
9+
const result = child_process.execSync('sops --decrypt secrets.json', {
10+
encoding: 'utf8',
11+
});
12+
secrets = JSON.parse(result);
1313
} catch (err) {
14-
console.log(
15-
`Could not decrypt secrets. Some values may be missing. Error:` + '\n' + err
16-
);
14+
console.log(
15+
`Could not decrypt secrets. Some values may be missing. Error:` +
16+
'\n' +
17+
err,
18+
);
1719
}
1820

1921
const config = {
20-
account_id: secrets?.account_id ?? null,
21-
compatibility_date: '2022-12-14',
22-
compatibility_flags: [],
23-
d1_databases: [
24-
{
25-
binding: 'CLOUDFLARE_DB',
26-
database_id: secrets?.database_id ?? null,
27-
database_name: 'edge-cms-db',
28-
preview_database_id: secrets?.preview_database_id ?? null,
29-
},
30-
],
31-
main: 'dist/server/cloudflare-workers-bundle.js',
32-
name: 'edge-cms',
33-
site: {
34-
bucket: './dist/client',
35-
},
36-
workers_dev: true,
22+
account_id: secrets?.account_id ?? null,
23+
compatibility_date: '2022-12-14',
24+
compatibility_flags: [],
25+
d1_databases: [
26+
{
27+
binding: 'CLOUDFLARE_DB',
28+
database_id: secrets?.database_id ?? null,
29+
database_name: 'edge-cms-db',
30+
preview_database_id: secrets?.preview_database_id ?? null,
31+
},
32+
],
33+
main: 'dist/server/cloudflare-workers-bundle.js',
34+
name: 'edge-cms',
35+
site: {
36+
bucket: './dist/client',
37+
},
38+
workers_dev: true,
3739
};
3840

3941
fs.writeFileSync(
40-
new URL('../wrangler-old.toml', import.meta.url),
41-
// @ts-ignore
42-
TOML.stringify(config, {
43-
newline: '\n',
44-
// Not sure how to handle this. I wish it would just ignore undefined values, or generate commented placeholders, etc...
45-
xNull: true,
46-
})
42+
new URL('../wrangler-old.toml', import.meta.url),
43+
// @ts-ignore
44+
TOML.stringify(config, {
45+
newline: '\n',
46+
// Not sure how to handle this. I wish it would just ignore undefined values, or generate commented placeholders, etc...
47+
xNull: true,
48+
}),
4749
);

0 commit comments

Comments
 (0)