From 23e6be0862748dbcff7f19308d19ff93303a1f9f Mon Sep 17 00:00:00 2001 From: aster <137767097+aster-void@users.noreply.github.com> Date: Sat, 22 Mar 2025 11:41:56 +0900 Subject: [PATCH 1/6] patch tsconfig to ignore .direnv, enable astro content intellisense, remove unused files --- .eslintrc.js | 12 ------------ .helix/languages.toml | 6 ++++-- .nvmrc | 1 - shell.nix | 1 + tsconfig.json | 2 +- 5 files changed, 6 insertions(+), 16 deletions(-) delete mode 100644 .eslintrc.js delete mode 100644 .nvmrc diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 7ed2f5b8..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,12 +0,0 @@ -/** @type {import("eslint").Linter.Config} */ -module.exports = { - extends: ["airbnb-typescript-prettier"], - rules: { - // for-of 構文を使いたい - "no-restricted-syntax": "off", - // TypeScript と相性が悪い - "react/require-default-props": "off", - "react/jsx-props-no-spreading": "off", - }, - ignorePatterns: ["/public/**"], -}; diff --git a/.helix/languages.toml b/.helix/languages.toml index a1baf64a..a47264c5 100644 --- a/.helix/languages.toml +++ b/.helix/languages.toml @@ -1,5 +1,7 @@ -[language-servers] -astro-ls = { command = "astro-ls", args = ["--stdio"] } +[language-servers.astro-ls] +command = "astro-ls" +args = ["--stdio"] +config = { contentIntellisense = true } [[language]] name = "astro" diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 3c032078..00000000 --- a/.nvmrc +++ /dev/null @@ -1 +0,0 @@ -18 diff --git a/shell.nix b/shell.nix index 43db9070..67f195f3 100644 --- a/shell.nix +++ b/shell.nix @@ -3,6 +3,7 @@ pkgs.mkShell { packages = [ pkgs.bun pkgs.biome + pkgs.astro-language-server pkgs.nodejs-slim # required by astro to find sharp ]; } diff --git a/tsconfig.json b/tsconfig.json index 5a89c962..2c3da799 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,5 +20,5 @@ } }, "include": [".astro/types.d.ts", "**/*"], - "exclude": ["dist"] + "exclude": ["dist", ".direnv"] } From 6f3a3ee4bccb72fab4a362508f4efb0779374316 Mon Sep 17 00:00:00 2001 From: aster <137767097+aster-void@users.noreply.github.com> Date: Sat, 22 Mar 2025 12:01:29 +0900 Subject: [PATCH 2/6] setup typos --- .github/workflows/check.yml | 10 ++++++++-- .vscode/extensions.json | 2 +- _typos.toml | 2 ++ shell.nix | 2 ++ src/schema.ts | 2 -- 5 files changed, 13 insertions(+), 5 deletions(-) create mode 100644 _typos.toml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index a2ecea20..84961e89 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -5,17 +5,23 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 with: bun-version: "1.2.4" - run: bun install --frozen-lockfile - run: bun check + typos: + name: Check Typos + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: crate-ci/typos@v1 build: name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - uses: oven-sh/setup-bun@v2 with: bun-version: "1.2.4" diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 30810fab..9a8a6908 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,3 +1,3 @@ { - "recommendations": ["astro-build.astro-vscode"] + "recommendations": ["astro-build.astro-vscode", "tekumara.typos-vscode"] } diff --git a/_typos.toml b/_typos.toml new file mode 100644 index 00000000..454089ba --- /dev/null +++ b/_typos.toml @@ -0,0 +1,2 @@ +[default.extend-words] +progate = "progate" diff --git a/shell.nix b/shell.nix index 67f195f3..34939c29 100644 --- a/shell.nix +++ b/shell.nix @@ -5,5 +5,7 @@ pkgs.mkShell { pkgs.biome pkgs.astro-language-server pkgs.nodejs-slim # required by astro to find sharp + pkgs.typos + pkgs.typos-lsp ]; } diff --git a/src/schema.ts b/src/schema.ts index f1d2541e..74cf70f9 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -8,8 +8,6 @@ export type Project = z.infer>; export const CreateArticleSchema = ({ image }: { image: ImageFunction }) => z.object({ - // excerpt: z.string().nullable(), - // longExcerpt: z.string().nullable(), date: z .date() .transform((date) => new TZDate(date).withTimeZone("Asia/Tokyo")), From 2a2b3b52eb6b1835a79a5a55a3d6b2298a23a4ce Mon Sep 17 00:00:00 2001 From: aster <137767097+aster-void@users.noreply.github.com> Date: Sat, 22 Mar 2025 12:01:57 +0900 Subject: [PATCH 3/6] run typos on precommit --- lefthook.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lefthook.yml b/lefthook.yml index 4bab75ca..4485cd88 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -10,3 +10,5 @@ pre-commit: stage_fixed: true sync: run: bun sync + typos: + run: typos From fab53f82e97ff3e180cab6f41115bc75159bf507 Mon Sep 17 00:00:00 2001 From: aster <137767097+aster-void@users.noreply.github.com> Date: Sat, 22 Mar 2025 12:07:34 +0900 Subject: [PATCH 4/6] update readme --- README.md | 3 ++- lefthook.yml | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4bc646f1..e85d6b03 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,8 @@ ### ローカル - (必須) Bun >= v1.1.39 -- 任意のエディタ https://docs.astro.build/en/editor-setup/ +- (推奨) Typos +- 任意のエディタ ```sh bun install --frozen-lockfile diff --git a/lefthook.yml b/lefthook.yml index 4485cd88..e81fce92 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -11,4 +11,4 @@ pre-commit: sync: run: bun sync typos: - run: typos + run: if command -v typos 2&> /dev/null; then typos; fi From 49b710e282fb80c616ef0aaa8d3c8d65191667ea Mon Sep 17 00:00:00 2001 From: aster <137767097+aster-void@users.noreply.github.com> Date: Sat, 22 Mar 2025 12:12:59 +0900 Subject: [PATCH 5/6] fix package.json metas --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index f2590021..3ce3969d 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,14 @@ { "name": "website", - "version": "3.1.0", - "private": true, + "homepage": "https://utcode.net", "description": "website of ut.code();, version 3", - "author": "aster-void and others", - "type": "module", + "private": true, + "version": "3.1.1", "keywords": [ "astro", "ut.code();" ], + "type": "module", "scripts": { "prepare": "lefthook install && bun sync", "sync": "astro sync", From f904b1e5a8f885e74b1c84ebdefd7a2e50534448 Mon Sep 17 00:00:00 2001 From: aster <137767097+aster-void@users.noreply.github.com> Date: Sat, 22 Mar 2025 12:53:29 +0900 Subject: [PATCH 6/6] set mdx = markdown (not true) --- .helix/languages.toml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.helix/languages.toml b/.helix/languages.toml index a47264c5..481e73a5 100644 --- a/.helix/languages.toml +++ b/.helix/languages.toml @@ -1,7 +1,7 @@ [language-servers.astro-ls] command = "astro-ls" args = ["--stdio"] -config = { contentIntellisense = true } +config = { contentIntellisense = true } # not working? [[language]] name = "astro" @@ -16,3 +16,8 @@ formatter = { command = "bun", args = ["prettier", "--parser", "typescript"] } name = "svelte" formatter = { command = "bun", args = ["prettier", "--parser", "svelte"] } auto-format = true + +[[language]] +name = "markdown" +file-types = ["md", "mdx"] +language-servers = ["astro-ls"]