From ae01be871f40b73b99f12d2aac8b8892ef9b65c0 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:43:34 +0000 Subject: [PATCH 01/12] =?UTF-8?q?refactor(none):=20=E2=9C=A8=20tweak=20tsc?= =?UTF-8?q?onfig,=20issue=20templates=20and=20devcontainer.json?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- .devcontainer/devcontainer.json | 4 +++- .github/ISSUE_TEMPLATE/03_tweak.md | 4 ++-- tsconfig.json | 1 - 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index b3f785f3..40e545d9 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -14,7 +14,9 @@ "unifiedjs.vscode-mdx", "github.vscode-github-actions", "eliostruyf.vscode-front-matter", - "ms-azuretools.vscode-docker" + "ms-azuretools.vscode-docker", + "tamasfe.even-better-toml", + "redhat.vscode-yaml" ] } }, diff --git a/.github/ISSUE_TEMPLATE/03_tweak.md b/.github/ISSUE_TEMPLATE/03_tweak.md index ea3148d1..dff1371a 100644 --- a/.github/ISSUE_TEMPLATE/03_tweak.md +++ b/.github/ISSUE_TEMPLATE/03_tweak.md @@ -1,13 +1,13 @@ --- name: Tweak about: Use this when you want to make tweaks around -title: 'tweak A, B and C' +title: 'tweak' labels: 'tweak' assignees: brklntmhwk --- ## Tweaks to be made -Specify what to tweak below. +Specify what to tweak as much as you're planning at the moment. (List all tweaks later in a pull request) - xxxxx diff --git a/tsconfig.json b/tsconfig.json index 67d3e80a..55611ffb 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,6 +16,5 @@ "exclude": [ "./dist", "./node_modules", - "src/functions" ] } From ad19db8775e622ca3f5474df1f674288a1768e89 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:47:07 +0000 Subject: [PATCH 02/12] =?UTF-8?q?docs(none):=20=F0=9F=93=96=20add=20a=20li?= =?UTF-8?q?cense=20section=20to=20readme?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 68806993..ace2b934 100644 --- a/README.md +++ b/README.md @@ -123,3 +123,7 @@ This project adopts Issue-driven Development. 1. Set the `LOCAL_DB_PATH` var looking up the dir ".wrangler/state/v3/d1/miniflare-D1DatabaseObject/" 2. Run `bun dev --host` to start the dev server 3. Go to "http://localhost:4321/" + +## License + +This project is licensed under the MIT License, see the [LICENSE](./LICENSE) file for more details. From bcde093f9e32a9d4c24fa4ea51ac0bdea9c542c9 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:54:41 +0000 Subject: [PATCH 03/12] =?UTF-8?q?ci(none):=20=F0=9F=8E=A1=20add=20permissi?= =?UTF-8?q?ons=20to=20the=20GA=20workflow=20for=20Danger=20PR=20checking?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- .github/workflows/danger.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/danger.yml b/.github/workflows/danger.yml index 61ccdf3c..d6cc023c 100644 --- a/.github/workflows/danger.yml +++ b/.github/workflows/danger.yml @@ -4,6 +4,11 @@ on: pull_request: types: [edited, opened, reopened, synchronize] +permissions: + contents: read + pull-requests: write + statuses: write + jobs: danger: name: Run Danger JS on Pull Request From a3bcb6aece83fec39735352a08eb6f9bf7598cc6 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Wed, 7 Aug 2024 08:59:41 +0000 Subject: [PATCH 04/12] =?UTF-8?q?refactor(config):=20=E2=9C=A8=20tweak=20b?= =?UTF-8?q?reak=20lines?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- changelog.config.cjs | 8 ++++++-- dangerfile.ts | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/changelog.config.cjs b/changelog.config.cjs index 46e25f95..9a08de94 100644 --- a/changelog.config.cjs +++ b/changelog.config.cjs @@ -14,8 +14,12 @@ module.exports = { ], maxMessageLength: 72, minMessageLength: 3, - questions: ['type', 'scope', 'subject', 'body', 'breaking', 'issues', 'lerna'], - scopes: ['api', "cms", 'config', 'contents', 'db', 'deps', 'docker', 'i18n', 'none', 'ui', "utils"], + questions: [ + 'type', 'scope', 'subject', 'body', 'breaking', 'issues', 'lerna' + ], + scopes: [ + 'api', "cms", 'config', 'contents', 'db', 'deps', 'docker', 'i18n', 'none', 'ui', "utils" + ], types: { chore: { description: "Build process or auxiliary tool changes", diff --git a/dangerfile.ts b/dangerfile.ts index f9db1629..3ed88898 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -22,7 +22,6 @@ const checkPRTitle = () => { const scopePattern = scopeAllowList.join('|'); const titleRegex = new RegExp(`^(${typePattern})\\((${scopePattern})\\): .+`); - if (!titleRegex.test(title)) { fail( `:x: Invalid PR title: ${title}\n` + From c0d3de6d3db9a26e60c7f9d821aa500a87a491de Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 00:40:51 +0000 Subject: [PATCH 05/12] =?UTF-8?q?refactor(overall):=20=E2=9C=A8=20format?= =?UTF-8?q?=20overall=20code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- .devcontainer/devcontainer.json | 4 +- astro.config.ts | 68 +++++++++++++++---------------- changelog.config.cjs | 72 ++++++++++++++++++++------------- dangerfile.ts | 68 ++++++++++++++++++------------- drizzle.config.ts | 16 ++++---- frontmatter.json | 49 +++++----------------- package.json | 6 +-- tsconfig.json | 9 +---- worker-configuration.d.ts | 8 ++-- 9 files changed, 146 insertions(+), 154 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 40e545d9..f6107d12 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -26,9 +26,7 @@ "onAutoForward": "openBrowserOnce" } }, - "forwardPorts": [ - 4321 - ], + "forwardPorts": [4321], "overrideCommand": true, "postCreateCommand": "/bin/sh .devcontainer/postCreateCommand.sh" } diff --git a/astro.config.ts b/astro.config.ts index 80dcbf4a..e2120b99 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -1,42 +1,42 @@ -import { defineConfig, passthroughImageService } from 'astro/config' -import cloudflare from '@astrojs/cloudflare' -import mdx from '@astrojs/mdx' -import sitemap from '@astrojs/sitemap' -import solidJs from '@astrojs/solid-js' -import purgecss from 'astro-purgecss' -import browserslist from 'browserslist' -import { browserslistToTargets } from 'lightningcss' -import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin' -import { h } from 'hastscript' -import remarkGfm from 'remark-gfm' -import remarkMath from 'remark-math' -import rehypeKatex from 'rehype-katex' +import cloudflare from '@astrojs/cloudflare'; +import mdx from '@astrojs/mdx'; +import sitemap from '@astrojs/sitemap'; +import solidJs from '@astrojs/solid-js'; +import { vanillaExtractPlugin } from '@vanilla-extract/vite-plugin'; +import purgecss from 'astro-purgecss'; +import { defineConfig, passthroughImageService } from 'astro/config'; +import browserslist from 'browserslist'; +import { h } from 'hastscript'; +import { browserslistToTargets } from 'lightningcss'; import rehypeAutolinkHeadings, { type Options as RehypeAutoLinkHeadingsOptions, -} from 'rehype-autolink-headings' -import rehypeSlug from 'rehype-slug' +} from 'rehype-autolink-headings'; +import rehypeKatex from 'rehype-katex'; import rehypePrettyCode, { type Options as RehypePrettyCodeOptions, -} from 'rehype-pretty-code' -import rehypeImageFigure from './src/plugins/rehype-image-figure' -import rehypePagefindIgnore from './src/plugins/rehype-pagefind-ignore' -import remarkCallout from './src/plugins/remark-callout' -import remarkAstroImageAssets from './src/plugins/remark-astro-image-assets' -import remarkFootnote from './src/plugins/remark-footnote' -import remarkLinkCard from './src/plugins/remark-link-card' -import remarkLineBreaks from './src/plugins/remark-line-breaks' +} from 'rehype-pretty-code'; +import rehypeSlug from 'rehype-slug'; +import remarkGfm from 'remark-gfm'; +import remarkMath from 'remark-math'; +import { iconNameTypes } from './src/lib/astro-integrations/icon-name-type'; +import { pagefind } from './src/lib/astro-integrations/pagefind'; +import { SITE_URL } from './src/lib/consts'; +import rehypeImageFigure from './src/plugins/rehype-image-figure'; +import rehypePagefindIgnore from './src/plugins/rehype-pagefind-ignore'; +import remarkAstroImageAssets from './src/plugins/remark-astro-image-assets'; +import remarkCallout from './src/plugins/remark-callout'; import remarkEmbed, { type RemarkEmbedOptions, -} from './src/plugins/remark-embed' +} from './src/plugins/remark-embed'; +import remarkFootnote from './src/plugins/remark-footnote'; +import remarkLineBreaks from './src/plugins/remark-line-breaks'; +import remarkLinkCard from './src/plugins/remark-link-card'; import { canvaTransformer, googleSlidesTransformer, - youTubeTransformer, oEmbedTransformer, -} from './src/plugins/transformers' -import { SITE_URL } from './src/lib/consts' -import { pagefind } from "./src/lib/astro-integrations/pagefind" -import { iconNameTypes } from "./src/lib/astro-integrations/icon-name-type" + youTubeTransformer, +} from './src/plugins/transformers'; // https://astro.build/config export default defineConfig({ @@ -59,7 +59,7 @@ export default defineConfig({ }), sitemap(), iconNameTypes(), - pagefind() + pagefind(), ], prefetch: { defaultStrategy: 'viewport', @@ -91,8 +91,8 @@ export default defineConfig({ server: { watch: { usePolling: true, - interval: 1000 - } + interval: 1000, + }, }, ssr: { external: ['node:fs', 'unfurl.js'], @@ -139,7 +139,7 @@ export default defineConfig({ { title: 'Anchor link', }, - ['#'] + ['#'], ), } satisfies RehypeAutoLinkHeadingsOptions, ], @@ -156,4 +156,4 @@ export default defineConfig({ rehypePagefindIgnore, ], }, -}) +}); diff --git a/changelog.config.cjs b/changelog.config.cjs index 9a08de94..8d8635ed 100644 --- a/changelog.config.cjs +++ b/changelog.config.cjs @@ -15,44 +15,62 @@ module.exports = { maxMessageLength: 72, minMessageLength: 3, questions: [ - 'type', 'scope', 'subject', 'body', 'breaking', 'issues', 'lerna' + 'type', + 'scope', + 'subject', + 'body', + 'breaking', + 'issues', + 'lerna', ], scopes: [ - 'api', "cms", 'config', 'contents', 'db', 'deps', 'docker', 'i18n', 'none', 'ui', "utils" + 'api', + 'cms', + 'config', + 'contents', + 'db', + 'deps', + 'docker', + 'i18n', + 'none', + 'overall', + 'ui', + 'utils', ], types: { chore: { - description: "Build process or auxiliary tool changes", - emoji: "🤖", - value: "chore", + description: 'Build process or auxiliary tool changes', + emoji: '🤖', + value: 'chore', }, ci: { - description: "CI related changes", - emoji: "🎡", - value: "ci", + description: 'CI related changes', + emoji: '🎡', + value: 'ci', }, docs: { - description: "Doc or article tweaks only", - emoji: "📖", - value: "docs", + description: 'Doc or article tweaks only', + emoji: '📖', + value: 'docs', }, feat: { - description: "A new feature", - emoji: "🆕", - value: "feat", + description: 'A new feature', + emoji: '🆕', + value: 'feat', }, fix: { - description: "A bug fix", - emoji: "🐛", - value: "fix", + description: 'A bug fix', + emoji: '🐛', + value: 'fix', }, perf: { - description: "A code tweak for performance enhancement", - emoji: "⚡️", - value: "perf", + description: 'A code tweak for performance enhancement', + emoji: '⚡️', + value: 'perf', }, refactor: { - description: 'A code tweak that neither fixes a bug or adds a new feature(rename a variable etc...)', + description: + 'A code tweak that neither fixes a bug or adds a new feature(rename a variable etc...)', emoji: '✨', value: 'refactor', }, @@ -63,14 +81,14 @@ module.exports = { }, style: { description: - "Formatting tweaks(Markup, white-space, missing semi-colons etc...)", - emoji: "💄", - value: "style", + 'Formatting tweaks(Markup, white-space, missing semi-colons etc...)', + emoji: '💄', + value: 'style', }, test: { - description: "Tweaks for tests", - emoji: "✒️", - value: "test", + description: 'Tweaks for tests', + emoji: '✒️', + value: 'test', }, }, }; diff --git a/dangerfile.ts b/dangerfile.ts index 3ed88898..a3f714db 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -1,7 +1,7 @@ -import {danger, fail, warn} from 'danger' +import { danger, fail, warn } from 'danger'; const checkPRTitle = () => { - const title = danger.github.pr.title + const title = danger.github.pr.title; // These must be consistent with those in the changelog config const typeAllowList = [ @@ -16,7 +16,19 @@ const checkPRTitle = () => { 'ci', 'perf', ]; - const scopeAllowList = ['api', "cms", 'config', 'contents', 'db', 'deps', 'docker', 'i18n', 'none', 'ui', "utils"] + const scopeAllowList = [ + 'api', + 'cms', + 'config', + 'contents', + 'db', + 'deps', + 'docker', + 'i18n', + 'none', + 'ui', + 'utils', + ]; const typePattern = typeAllowList.join('|'); const scopePattern = scopeAllowList.join('|'); @@ -24,41 +36,43 @@ const checkPRTitle = () => { if (!titleRegex.test(title)) { fail( - `:x: Invalid PR title: ${title}\n` + - `Use either of the following type & scope instead.\n` + - `Allowed type list:\n` + - `${typeAllowList.join(",")}\n` + - `Allowed scope list:\n` + - `${scopeAllowList.join(",")}\n` + - `e.g., feat(ui): 🆕 add a likes button` - ) + `:x: Invalid PR title: ${title}\n + Use either of the following type & scope instead.\n + Allowed type list:\n + ${typeAllowList.join(',')}\n + Allowed scope list:\n + ${scopeAllowList.join(',')}\n + e.g., feat(ui): 🆕 add a likes button`, + ); } -} +}; const warnLargePR = () => { - const changedFiles = danger.github.pr.changed_files - const changedLinesTotal = danger.github.pr.additions + danger.github.pr.deletions + const changedFiles = danger.github.pr.changed_files; + const changedLinesTotal = + danger.github.pr.additions + danger.github.pr.deletions; if (changedLinesTotal > 500 || changedFiles > 30) { warn( - `:warning: PR size appears relatively large.\n` + - `Preferably, break changes into separate PRs for faster and easier code review.` - ) + `:warning: PR size appears relatively large.\n + Changed files: ${changedFiles}, Changed lines: ${changedLinesTotal}\n + Preferably, break changes into separate PRs for faster and easier code review.`, + ); } -} +}; const preventInconsistentDeps = () => { - const hasPackageChanges = danger.git.modified_files.includes('packge.json') - const hasLockfileChanges = danger.git.modified_files.includes("bun.lockb") + const hasPackageChanges = danger.git.modified_files.includes('packge.json'); + const hasLockfileChanges = danger.git.modified_files.includes('bun.lockb'); if (hasPackageChanges && !hasLockfileChanges) { fail( - ":x: Inconsistent deps changes detected.\n" + - "Make changes in package.json consistent with those in your lockfile." - ) + ':x: Inconsistent deps changes detected.\n' + + 'Make changes in package.json consistent with those in your lockfile.', + ); } -} +}; -checkPRTitle() -warnLargePR() -preventInconsistentDeps() +checkPRTitle(); +warnLargePR(); +preventInconsistentDeps(); diff --git a/drizzle.config.ts b/drizzle.config.ts index dab4b917..d2a250ff 100644 --- a/drizzle.config.ts +++ b/drizzle.config.ts @@ -1,22 +1,22 @@ -import type { Config } from "drizzle-kit"; +import type { Config } from 'drizzle-kit'; const { CLOUDFLARE_ACCOUNT_ID, D1_DB_ID, D1_DB_API_TOKEN, LOCAL_DB_PATH } = process.env; export default LOCAL_DB_PATH ? ({ - schema: "./src/db/schema/index.ts", - out: "./src/db/migrations", - dialect: "sqlite", + schema: './src/db/schema/index.ts', + out: './src/db/migrations', + dialect: 'sqlite', dbCredentials: { url: LOCAL_DB_PATH, }, } satisfies Config) : ({ - schema: "./src/db/schema/index.ts", - out: "./src/db/migrations", - dialect: "sqlite", - driver: "d1-http", + schema: './src/db/schema/index.ts', + out: './src/db/migrations', + dialect: 'sqlite', + driver: 'd1-http', dbCredentials: { accountId: CLOUDFLARE_ACCOUNT_ID!, databaseId: D1_DB_ID!, diff --git a/frontmatter.json b/frontmatter.json index a317b19a..b3d0edd6 100644 --- a/frontmatter.json +++ b/frontmatter.json @@ -7,25 +7,19 @@ { "title": "blog", "path": "[[workspace]]/src/content/blog", - "contentTypes": [ - "blog" - ], + "contentTypes": ["blog"], "defaultLocale": "en" }, { "title": "news", "path": "[[workspace]]/src/content/news", - "contentTypes": [ - "news" - ], + "contentTypes": ["news"], "defaultLocale": "en" }, { "title": "page", "path": "[[workspace]]/src/content/page", - "contentTypes": [ - "page" - ], + "contentTypes": ["page"], "defaultLocale": "en" } ], @@ -44,11 +38,7 @@ "frontMatter.content.draftField": { "name": "draft", "type": "choice", - "choices": [ - "draft", - "in progress", - "published" - ] + "choices": ["draft", "in progress", "published"] }, "frontMatter.taxonomy.seoTitleLength": 90, "frontMatter.taxonomy.contentTypes": [ @@ -233,11 +223,7 @@ "schema": { "title": "Categories", "type": "object", - "required": [ - "title", - "slug", - "color" - ], + "required": ["title", "slug", "color"], "properties": { "title": { "type": "string", @@ -259,11 +245,7 @@ "schema": { "title": "Tags", "type": "object", - "required": [ - "title", - "slug", - "color" - ], + "required": ["title", "slug", "color"], "properties": { "title": { "type": "string", @@ -320,11 +302,7 @@ }, "Code block with specified language": { "description": "Insert code block snippet", - "body": [ - "```[[language]] title=\"[[filename]]\"", - "", - "```" - ], + "body": ["```[[language]] title=\"[[filename]]\"", "", "```"], "fields": [ { "name": "language", @@ -360,10 +338,7 @@ }, "Callout": { "description": "Insert a callout", - "body": [ - "> [![[type]] ][[symbol]][[title]]", - "> [[content]]" - ], + "body": ["> [![[type]] ][[symbol]][[title]]", "> [[content]]"], "fields": [ { "name": "type", @@ -385,11 +360,7 @@ "name": "symbol", "title": "Symbol", "type": "choice", - "choices": [ - "+", - "-", - " " - ], + "choices": ["+", "-", " "], "single": true, "default": " " }, @@ -414,4 +385,4 @@ "frontMatter.framework.startCommand": "bun dev", "frontMatter.dashboard.openOnStart": false, "frontMatter.content.autoUpdateDate": true -} \ No newline at end of file +} diff --git a/package.json b/package.json index 32b00eeb..48127e29 100644 --- a/package.json +++ b/package.json @@ -109,9 +109,5 @@ "engines": { "bun": "^1.0.0" }, - "trustedDependencies": [ - "@biomejs/biome", - "esbuild", - "sharp" - ] + "trustedDependencies": ["@biomejs/biome", "esbuild", "sharp"] } diff --git a/tsconfig.json b/tsconfig.json index 55611ffb..77600562 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,13 +8,8 @@ "jsxImportSource": "solid-js", "baseUrl": ".", "paths": { - "@/*": [ - "./src/*" - ] + "@/*": ["./src/*"] } }, - "exclude": [ - "./dist", - "./node_modules", - ] + "exclude": ["./dist", "./node_modules"] } diff --git a/worker-configuration.d.ts b/worker-configuration.d.ts index 5a412b11..5d0ba3ef 100644 --- a/worker-configuration.d.ts +++ b/worker-configuration.d.ts @@ -2,8 +2,8 @@ // by running `wrangler types` interface Env { - TURNSTILE_SECRET_KEY: string; - MY_CUSTOM_EMAIL_ADDRESS: string; - RESEND_API_KEY: string; - DB: D1Database; + TURNSTILE_SECRET_KEY: string; + MY_CUSTOM_EMAIL_ADDRESS: string; + RESEND_API_KEY: string; + DB: D1Database; } From 9bdd52c0fb3afb13226d3ba3ca76be6700b6f9f8 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 01:00:18 +0000 Subject: [PATCH 06/12] =?UTF-8?q?refactor(api):=20=E2=9C=A8=20remove=20con?= =?UTF-8?q?sts=20dir?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- src/content/page/ja/about.mdx | 7 ++++--- src/lib/{consts/index.ts => consts.ts} | 0 2 files changed, 4 insertions(+), 3 deletions(-) rename src/lib/{consts/index.ts => consts.ts} (100%) diff --git a/src/content/page/ja/about.mdx b/src/content/page/ja/about.mdx index be7e4270..cdf81444 100644 --- a/src/content/page/ja/about.mdx +++ b/src/content/page/ja/about.mdx @@ -1,7 +1,7 @@ --- title: 運営者 type: page -modifiedAt: 2024-02-28T06:27:41.594Z +modifiedAt: 2024-08-08T00:51:50.229Z --- {/* textlint-disable ja-technical-writing/ja-no-weak-phrase */} @@ -19,7 +19,7 @@ modifiedAt: 2024-02-28T06:27:41.594Z - 自身が得た知見や情報を発信するだけでなく、現在進行形で挑戦していること、その学習過程についても取り上げる - **多言語で情報発信** - 読者層を広げるため、そして自身の語学学習の一環も兼ねて - - 多言語化には機械翻訳は使用せず、ほぼ全て手動で翻訳しています + - 多言語化には機械翻訳は使用せず、ほぼ全て手動で翻訳している - 言語の特性や各言語での読者の文化的なバックグラウンドの違い等から、意訳や全く違う表現を採用しているケースも多々ある ### 情報発信の指針 @@ -34,9 +34,10 @@ modifiedAt: 2024-02-28T06:27:41.594Z - 自分の信念や意見の正しさを主張する為にブログを書くわけではない - **刺激の強い言葉やセンシティブな話題は避ける** - 発信した内容を通して誰かを傷つけることは意図していない - - 人それぞれ基準にする物差しが違うので、意図せず傷つけてしまうことがあるかもしれません + - 人それぞれ基準にする物差しが違うので、意図せず傷つけてしまうことがあるかもしれない - **広告ゼロ** - 当サイトは**アフィリエイト広告を利用していません** + - 言ってみたかっただけ ## 運営者について diff --git a/src/lib/consts/index.ts b/src/lib/consts.ts similarity index 100% rename from src/lib/consts/index.ts rename to src/lib/consts.ts From c7e12424b8681e6a871d01c5e9d1b425791c389a Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 01:11:14 +0000 Subject: [PATCH 07/12] =?UTF-8?q?refactor(config):=20=E2=9C=A8=20tweak=20d?= =?UTF-8?q?anger=20error=20messages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit change the format of danger messages like line breaks and Markdown annotations ✅ Closes: #28 --- dangerfile.ts | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/dangerfile.ts b/dangerfile.ts index a3f714db..3ac50f57 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -36,13 +36,13 @@ const checkPRTitle = () => { if (!titleRegex.test(title)) { fail( - `:x: Invalid PR title: ${title}\n + `**:x: Invalid PR title: ${title}**\n Use either of the following type & scope instead.\n Allowed type list:\n - ${typeAllowList.join(',')}\n + - ${typeAllowList.join(',')}\n Allowed scope list:\n - ${scopeAllowList.join(',')}\n - e.g., feat(ui): 🆕 add a likes button`, + - ${scopeAllowList.join(',')}\n + e.g., feat(ui): 🆕 add a likes button\n`, ); } }; @@ -54,9 +54,10 @@ const warnLargePR = () => { if (changedLinesTotal > 500 || changedFiles > 30) { warn( - `:warning: PR size appears relatively large.\n - Changed files: ${changedFiles}, Changed lines: ${changedLinesTotal}\n - Preferably, break changes into separate PRs for faster and easier code review.`, + `**:warning: PR size appears relatively large.**\n + - Changed files: ${changedFiles}\n + - Changed lines: ${changedLinesTotal}\n + Preferably, break changes into separate PRs for faster and easier code review.\n`, ); } }; @@ -67,8 +68,8 @@ const preventInconsistentDeps = () => { if (hasPackageChanges && !hasLockfileChanges) { fail( - ':x: Inconsistent deps changes detected.\n' + - 'Make changes in package.json consistent with those in your lockfile.', + '**:x: Inconsistent deps changes detected.**\n' + + 'Make changes in package.json consistent with those in your lockfile.\n', ); } }; From e2172cfeedc7e6d48f234e2e0b968791e8616985 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 01:37:12 +0000 Subject: [PATCH 08/12] =?UTF-8?q?docs(none):=20=F0=9F=93=96=20tweak=20the?= =?UTF-8?q?=20dev=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- README.md | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ace2b934..eea3ad7d 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,9 @@ This project adopts Issue-driven Development. > - After peer code reviews and passing your team's conventional rules, changes are finally merged into the main branch 1. On [the issue page](https://github.com/brklntmhwk/younagi.dev/issues), create an issue - - Preferably add a label that matches the purpose of your issue + - Select a template that matches the purpose of your issue + - Add a label that describes the purpose well on an as-needed basis + - Some templates has the default setting so you don't have to do so - In your issue, clarify the following points - The purpose - As-is @@ -91,20 +93,21 @@ This project adopts Issue-driven Development. - Hereafter, you're supposed to be at the project root 4. Execute `git pull origin [[the branch name]]` to keep your local up to date 5. Start coding! - 1. [Setup](#setup-for-coding) + 1. [Setup outside the container](#setup-for-coding) 2. Open the VSCode command palette 3. Select "Dev Containers: Reopen Container" - It starts rebuilding the container if needed - It might take longer the first time - 4. [Setup](#setup-for-coding) + 4. [Setup inside the container](#setup-for-coding) 6. After you're finished coding, execute `git add .` > `git cz`, add commit info answering prompts, and then execute `git push origin [[the branch name]]` 7. Go to [the project's repo](https://github.com/brklntmhwk/younagi.dev) and create a pull request for changes you've made - The title of pull requests must be in this format: `(): detailed descriptions here...` - Check the changelog config or dangerfile for allowed types & scopes - e.g., "feat(ui): 🆕 add a likes button" - - In your pull request, clarify the following points: - - Changes - - Checklist + - Use a template by hitting the URL like below + - `https://github.com/brklntmhwk/younagi.dev/compare/main...${BRANCH_NAME}?template=${TEMPLATE_NAME}` + - For the TEMPLATE_NAME, see `.github/PULL_REQUEST_TEMPLATE` + - e.g., `...?template=01_basic.md` 8. Fix your code over the course of peer code review on an as-needed basis - Once the whole team gives you the green light, changes you've made will be merged into the main branch 9. Confirm if the merge is done without any problem and then delete the remote branch from [this page](https://github.com/brklntmhwk/younagi.dev/branches) @@ -122,7 +125,7 @@ This project adopts Issue-driven Development. 1. Set the `LOCAL_DB_PATH` var looking up the dir ".wrangler/state/v3/d1/miniflare-D1DatabaseObject/" 2. Run `bun dev --host` to start the dev server -3. Go to "http://localhost:4321/" +3. Access the localhost URL shown ## License From 522f1ebec3a2d40fcfdf36ff060bc83ff0ba2a1f Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 01:43:56 +0000 Subject: [PATCH 09/12] =?UTF-8?q?docs(none):=20=F0=9F=93=96=20tweak=20the?= =?UTF-8?q?=20dev=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index eea3ad7d..b202911d 100644 --- a/README.md +++ b/README.md @@ -106,7 +106,7 @@ This project adopts Issue-driven Development. - e.g., "feat(ui): 🆕 add a likes button" - Use a template by hitting the URL like below - `https://github.com/brklntmhwk/younagi.dev/compare/main...${BRANCH_NAME}?template=${TEMPLATE_NAME}` - - For the TEMPLATE_NAME, see `.github/PULL_REQUEST_TEMPLATE` + - For the `TEMPLATE_NAME`, see under the ".github/PULL_REQUEST_TEMPLATE/" directory - e.g., `...?template=01_basic.md` 8. Fix your code over the course of peer code review on an as-needed basis - Once the whole team gives you the green light, changes you've made will be merged into the main branch From 8cbe27e75e04565e89e2bb4cdf52138a270da10d Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 01:58:13 +0000 Subject: [PATCH 10/12] =?UTF-8?q?docs(none):=20=F0=9F=93=96=20comment=20ou?= =?UTF-8?q?t=20descriptions=20in=20issue=20&=20PR=20templates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- .github/ISSUE_TEMPLATE/01_basic.md | 6 ++---- .github/ISSUE_TEMPLATE/03_tweak.md | 3 +-- .github/PULL_REQUEST_TEMPLATE/01_basic.md | 9 +++------ .github/PULL_REQUEST_TEMPLATE/02_content.md | 9 +++------ .github/PULL_REQUEST_TEMPLATE/03_tweak.md | 9 +++------ 5 files changed, 12 insertions(+), 24 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/01_basic.md b/.github/ISSUE_TEMPLATE/01_basic.md index d2fea0ab..4ca08be4 100644 --- a/.github/ISSUE_TEMPLATE/01_basic.md +++ b/.github/ISSUE_TEMPLATE/01_basic.md @@ -11,13 +11,11 @@ assignees: brklntmhwk - xxxxx ## As-is - -The as-is around this issue + - xxxxx ## To-be - -The to-be as a result of upcoming changes + - xxxxx diff --git a/.github/ISSUE_TEMPLATE/03_tweak.md b/.github/ISSUE_TEMPLATE/03_tweak.md index dff1371a..64dee2ec 100644 --- a/.github/ISSUE_TEMPLATE/03_tweak.md +++ b/.github/ISSUE_TEMPLATE/03_tweak.md @@ -7,7 +7,6 @@ assignees: brklntmhwk --- ## Tweaks to be made - -Specify what to tweak as much as you're planning at the moment. (List all tweaks later in a pull request) + - xxxxx diff --git a/.github/PULL_REQUEST_TEMPLATE/01_basic.md b/.github/PULL_REQUEST_TEMPLATE/01_basic.md index 0a9a46f4..d7f67f7e 100644 --- a/.github/PULL_REQUEST_TEMPLATE/01_basic.md +++ b/.github/PULL_REQUEST_TEMPLATE/01_basic.md @@ -1,17 +1,14 @@ ## Changes - -List up changes you've made below. + - xxxxx ## Checklist - -Let team members know what to check in the peer review process. + - xxxxx ## Notes - -Add whatever you want to let team members know about the changes. Write "Nothing" if you have nothing special. + - xxxxx diff --git a/.github/PULL_REQUEST_TEMPLATE/02_content.md b/.github/PULL_REQUEST_TEMPLATE/02_content.md index 952f37d0..06c94689 100644 --- a/.github/PULL_REQUEST_TEMPLATE/02_content.md +++ b/.github/PULL_REQUEST_TEMPLATE/02_content.md @@ -1,20 +1,17 @@ ## Changes - -List up changes you've made below. + - Add/Update/Delete an article - The title: xxxxx ## Checklist - -Let team members know what to check in the peer review process. + - Typos in the article - Missing info - Accuracy in the info provided in the article ## Notes - -Add whatever you want to let team members know about the changes. Write "Nothing" if you have nothing special. + - xxxxx diff --git a/.github/PULL_REQUEST_TEMPLATE/03_tweak.md b/.github/PULL_REQUEST_TEMPLATE/03_tweak.md index f29e0784..b0e9bb08 100644 --- a/.github/PULL_REQUEST_TEMPLATE/03_tweak.md +++ b/.github/PULL_REQUEST_TEMPLATE/03_tweak.md @@ -1,17 +1,14 @@ ## Changes - -List up changes you've made below. + - xxxxx ## Checklist - -Let team members know what to check in the peer review process. + - Potential side-effects arisen from the changes ## Notes - -Add whatever you want to let team members know about the changes. Write "Nothing" if you have nothing special. + - xxxxx From 6c6dd8cdc51f24b269ac52498ecc5fff89761dea Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 02:13:33 +0000 Subject: [PATCH 11/12] =?UTF-8?q?chore(config):=20=F0=9F=A4=96=20add=20ove?= =?UTF-8?q?rall=20to=20scope=20list=20in=20dangerfile=20too?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- dangerfile.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/dangerfile.ts b/dangerfile.ts index 3ac50f57..425e583b 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -26,6 +26,7 @@ const checkPRTitle = () => { 'docker', 'i18n', 'none', + 'overall', 'ui', 'utils', ]; From a2bfce3999944f9c1b56406dfcecad3d9b01d023 Mon Sep 17 00:00:00 2001 From: brklntmhwk_dev <86272619+brklntmhwk@users.noreply.github.com> Date: Thu, 8 Aug 2024 02:25:47 +0000 Subject: [PATCH 12/12] =?UTF-8?q?chore(config):=20=F0=9F=A4=96=20modify=20?= =?UTF-8?q?danger=20error=20messages=20using=20markdown?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ✅ Closes: #28 --- dangerfile.ts | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/dangerfile.ts b/dangerfile.ts index 425e583b..27b8e025 100644 --- a/dangerfile.ts +++ b/dangerfile.ts @@ -1,4 +1,4 @@ -import { danger, fail, warn } from 'danger'; +import { danger, fail, markdown, warn } from 'danger'; const checkPRTitle = () => { const title = danger.github.pr.title; @@ -36,12 +36,12 @@ const checkPRTitle = () => { const titleRegex = new RegExp(`^(${typePattern})\\((${scopePattern})\\): .+`); if (!titleRegex.test(title)) { - fail( - `**:x: Invalid PR title: ${title}**\n - Use either of the following type & scope instead.\n - Allowed type list:\n + fail(`**:x: Invalid PR title: ${title}**\n`); + markdown( + `Use either of the following type & scope instead.\n + **Allowed type list:**\n - ${typeAllowList.join(',')}\n - Allowed scope list:\n + **Allowed scope list:**\n - ${scopeAllowList.join(',')}\n e.g., feat(ui): 🆕 add a likes button\n`, ); @@ -54,11 +54,11 @@ const warnLargePR = () => { danger.github.pr.additions + danger.github.pr.deletions; if (changedLinesTotal > 500 || changedFiles > 30) { - warn( - `**:warning: PR size appears relatively large.**\n - - Changed files: ${changedFiles}\n - - Changed lines: ${changedLinesTotal}\n - Preferably, break changes into separate PRs for faster and easier code review.\n`, + warn('**:warning: PR size appears relatively large.**\n'); + markdown( + `Preferably, break changes into separate PRs for faster and easier code review.\n + - Changed files: ${changedFiles}\n + - Changed lines: ${changedLinesTotal}\n`, ); } };