diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..d1ed59a --- /dev/null +++ b/.editorconfig @@ -0,0 +1,14 @@ +root = true + +[*] +indent_style = tab +insert_final_newline = true +trim_trailing_whitespace = true + +[*.html] +indent_size = 2 +indent_style = space + +[*.{md,mdx}] +indent_size = 2 +indent_style = space diff --git a/README.md b/README.md index 63c0dfd..6f18286 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![cover](https://sequoia.pub/og.png) -A CLI for publishing [Standard.site](https://standard.site) documents to the [AT Protocol](https://atproto.com). +A CLI for publishing [Standard.site](https://standard.site) documents to the [AT Protocol](https://atproto.com). > [!NOTE] > [Visit the docs for more info](https://sequoia.pub) @@ -60,7 +60,7 @@ cd packages/cli bun dev ``` -## License +## License MIT diff --git a/biome.json b/biome.json new file mode 100644 index 0000000..f51f2da --- /dev/null +++ b/biome.json @@ -0,0 +1,38 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.3.13/schema.json", + "root": true, + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "files": { + "includes": ["**"] + }, + "formatter": { + "enabled": true, + "useEditorconfig": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "style": { + "noNonNullAssertion": "off" + } + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + } +} diff --git a/bun.lock b/bun.lock index ed61607..642c9a6 100644 --- a/bun.lock +++ b/bun.lock @@ -22,6 +22,7 @@ "vocs": "latest", }, "devDependencies": { + "@biomejs/biome": "^2.3.13", "@cloudflare/workers-types": "latest", "@types/react": "latest", "typescript": "latest", diff --git a/docs/docs/public/sequoia-comments.js b/docs/docs/public/sequoia-comments.js index 8aa2c8f..0e49491 100644 --- a/docs/docs/public/sequoia-comments.js +++ b/docs/docs/public/sequoia-comments.js @@ -588,7 +588,6 @@ class SequoiaComments extends BaseElement { this.commentsContainer = container; this.state = { type: "loading" }; this.abortController = null; - } static get observedAttributes() { @@ -701,7 +700,7 @@ class SequoiaComments extends BaseElement { `; if (this.hide) { - this.commentsContainer.style.display = 'none'; + this.commentsContainer.style.display = "none"; } break; diff --git a/docs/package.json b/docs/package.json index 215475e..eb80e86 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,6 +4,7 @@ "version": "0.0.0", "type": "module", "scripts": { + "format": "biome format --write", "dev": "vocs dev", "dev:api": "wrangler dev", "build": "vocs build && bun inject-og-tags.ts", @@ -20,6 +21,7 @@ "vocs": "latest" }, "devDependencies": { + "@biomejs/biome": "^2.3.13", "@cloudflare/workers-types": "latest", "@types/react": "latest", "typescript": "latest" diff --git a/docs/sequoia.json b/docs/sequoia.json index 3e4dc58..b098486 100644 --- a/docs/sequoia.json +++ b/docs/sequoia.json @@ -1,19 +1,17 @@ { - "siteUrl": "https://sequoia.pub", - "contentDir": "docs/pages/blog", - "imagesDir": "docs/public", - "publicDir": "docs/public", - "outputDir": "docs/dist", - "pathPrefix": "/blog", - "publicationUri": "at://did:plc:kq6bvkw4sxof3vdinuitehn5/site.standard.publication/3mdnzt4rqr42v", - "pdsUrl": "https://andromeda.social", - "frontmatter": { - "publishDate": "date" - }, - "ignore": [ - "index.mdx" - ], - "ui": { - "components": "docs/components" - } -} \ No newline at end of file + "siteUrl": "https://sequoia.pub", + "contentDir": "docs/pages/blog", + "imagesDir": "docs/public", + "publicDir": "docs/public", + "outputDir": "docs/dist", + "pathPrefix": "/blog", + "publicationUri": "at://did:plc:kq6bvkw4sxof3vdinuitehn5/site.standard.publication/3mdnzt4rqr42v", + "pdsUrl": "https://andromeda.social", + "frontmatter": { + "publishDate": "date" + }, + "ignore": ["index.mdx"], + "ui": { + "components": "docs/components" + } +} diff --git a/docs/src/lib/kv-stores.ts b/docs/src/lib/kv-stores.ts index 6de9756..acca209 100644 --- a/docs/src/lib/kv-stores.ts +++ b/docs/src/lib/kv-stores.ts @@ -10,10 +10,7 @@ type SerializedStateData = Omit & { dpopJwk: Record; }; -type SerializedSession = Omit< - Parameters[1], - "dpopKey" -> & { +type SerializedSession = Omit[1], "dpopKey"> & { dpopJwk: Record; }; @@ -27,10 +24,7 @@ async function deserializeKey(jwk: Record): Promise { return JoseKey.fromJWK(jwk); } -export function createStateStore( - kv: KVNamespace, - ttl = 600, -): StateStore { +export function createStateStore(kv: KVNamespace, ttl = 600): StateStore { return { async set(key, { dpopKey, ...rest }) { const data: SerializedStateData = { diff --git a/docs/tsconfig.json b/docs/tsconfig.json index 3131cb4..746d8ec 100644 --- a/docs/tsconfig.json +++ b/docs/tsconfig.json @@ -1,25 +1,25 @@ { - "compilerOptions": { - "target": "ES2020", - "useDefineForClassFields": true, - "lib": ["ES2020", "DOM", "DOM.Iterable"], - "module": "ESNext", - "skipLibCheck": true, + "compilerOptions": { + "target": "ES2020", + "useDefineForClassFields": true, + "lib": ["ES2020", "DOM", "DOM.Iterable"], + "module": "ESNext", + "skipLibCheck": true, - /* Bundler mode */ - "moduleResolution": "bundler", - "allowImportingTsExtensions": true, - "resolveJsonModule": true, - "isolatedModules": true, - "noEmit": true, - "jsx": "react-jsx", + /* Bundler mode */ + "moduleResolution": "bundler", + "allowImportingTsExtensions": true, + "resolveJsonModule": true, + "isolatedModules": true, + "noEmit": true, + "jsx": "react-jsx", - /* Linting */ - "strict": true, - "noUnusedLocals": true, - "noUnusedParameters": true, - "noFallthroughCasesInSwitch": true, - "types": ["@cloudflare/workers-types"] - }, - "include": ["**/*.ts", "**/*.tsx"] + /* Linting */ + "strict": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noFallthroughCasesInSwitch": true, + "types": ["@cloudflare/workers-types"] + }, + "include": ["**/*.ts", "**/*.tsx"] } diff --git a/package.json b/package.json index 695b688..32e97ca 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "docs" ], "scripts": { - "dev:cli": "cd packages/cli && bun run dev", + "format:cli": "cd packages/cli && bun run format", + "format:docs": "cd docs && bun run format", + "dev:cli": "cd packages/cli && bun run dev", "dev:docs": "cd docs && bun run dev", "build:docs": "cd docs && bun run build", "build:cli": "cd packages/cli && bun run build", diff --git a/packages/cli/biome.json b/packages/cli/biome.json index 80098a8..63e4789 100644 --- a/packages/cli/biome.json +++ b/packages/cli/biome.json @@ -1,37 +1,7 @@ { "$schema": "https://biomejs.dev/schemas/2.3.13/schema.json", - "vcs": { - "enabled": true, - "clientKind": "git", - "useIgnoreFile": true - }, + "extends": ["../../biome.json"], "files": { "includes": ["**", "!!**/dist"] - }, - "formatter": { - "enabled": true, - "indentStyle": "tab" - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true, - "style": { - "noNonNullAssertion": "off" - } - } - }, - "javascript": { - "formatter": { - "quoteStyle": "double" - } - }, - "assist": { - "enabled": true, - "actions": { - "source": { - "organizeImports": "on" - } - } } }