Skip to content

Commit

Permalink
Merge pull request #12 from brklntmhwk/dev
Browse files Browse the repository at this point in the history
chore(docker): 🤖 remove the volume for the whole project
  • Loading branch information
brklntmhwk authored Aug 5, 2024
2 parents efeb336 + 46a5f4b commit eb4af35
Show file tree
Hide file tree
Showing 15 changed files with 212 additions and 78 deletions.
13 changes: 6 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
node_modules/
Dockerfile*
docker-compose*
.dockerignore
dist/
.git/
.gitignore
README.md
node_modules/
# Dockerfile*
# docker-compose*
# .dockerignore
# .git/
# .gitignore
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ node_modules/

# Wrangler
.wrangler/

# VSCode
.vscode/
60 changes: 60 additions & 0 deletions .husky/_/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}

call_lefthook run "pre-commit" "$@"
60 changes: 60 additions & 0 deletions .husky/_/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!/bin/sh

if [ "$LEFTHOOK_VERBOSE" = "1" -o "$LEFTHOOK_VERBOSE" = "true" ]; then
set -x
fi

if [ "$LEFTHOOK" = "0" ]; then
exit 0
fi

call_lefthook()
{
if test -n "$LEFTHOOK_BIN"
then
"$LEFTHOOK_BIN" "$@"
elif lefthook -h >/dev/null 2>&1
then
lefthook "$@"
else
dir="$(git rev-parse --show-toplevel)"
osArch=$(uname | tr '[:upper:]' '[:lower:]')
cpuArch=$(uname -m | sed 's/aarch64/arm64/;s/x86_64/x64/')
if test -f "$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook"
then
"$dir/node_modules/lefthook-${osArch}-${cpuArch}/bin/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook/bin/lefthook-${osArch}-${cpuArch}/lefthook" "$@"
elif test -f "$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook"
then
"$dir/node_modules/@evilmartians/lefthook-installer/bin/lefthook" "$@"
elif test -f "$dir/node_modules/lefthook/bin/index.js"
then
"$dir/node_modules/lefthook/bin/index.js" "$@"

elif bundle exec lefthook -h >/dev/null 2>&1
then
bundle exec lefthook "$@"
elif yarn lefthook -h >/dev/null 2>&1
then
yarn lefthook "$@"
elif pnpm lefthook -h >/dev/null 2>&1
then
pnpm lefthook "$@"
elif swift package plugin lefthook >/dev/null 2>&1
then
swift package --disable-sandbox plugin lefthook "$@"
elif command -v mint >/dev/null 2>&1
then
mint run csjones/lefthook-plugin "$@"
elif command -v npx >/dev/null 2>&1
then
npx lefthook "$@"
else
echo "Can't find lefthook in PATH"
fi
fi
}

call_lefthook run "prepare-commit-msg" "$@"
4 changes: 4 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"recommendations": ["astro-build.astro-vscode", "unifiedjs.vscode-mdx"],
"unwantedRecommendations": []
}
11 changes: 11 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"version": "0.2.0",
"configurations": [
{
"command": "./node_modules/.bin/astro dev",
"name": "Development server",
"request": "launch",
"type": "node-terminal"
}
]
}
Binary file modified bun.lockb
Binary file not shown.
55 changes: 28 additions & 27 deletions changelog.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -19,34 +19,34 @@ module.exports = {
scopes: ['api', "cms", 'config', 'contents', 'db', 'deps', 'docker', 'i18n', 'none', '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...)',
Expand All @@ -59,19 +59,20 @@ module.exports = {
value: 'revert',
},
style: {
description: 'Formatting tweaks(Markup, white-space, missing semi-colons etc...)',
emoji: '💄',
value: 'style',
description:
"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",
},
package: {
description: 'Package changes(install, update, remove etc...)',
emoji: '📦',
value: 'package',
description: "Package changes(install, update, remove etc...)",
emoji: "📦",
value: "package",
},
},
};
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ services:
environment:
- COMPOSE_PROJECT_NAME=app
working_dir: /workspace
volumes:
- .:/workspace:cached
# - node-modules-data:/workspace/node_modules
# volumes:
# - .:/workspace:cached
# - node-modules-data:/workspace/node_modules
user: dev
# volumes:
# node-modules-data:
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@
"db:generate": "drizzle-kit generate",
"db:studio:prod": "drizzle-kit studio",
"db:migrate:local": "wrangler d1 migrations apply younagi_dev_db --local",
"db:migrate:prod": "wrangler d1 migrations apply younagi_dev_db",
"prepare": "lefthook install"
"db:migrate:prod": "wrangler d1 migrations apply younagi_dev_db"
},
"dependencies": {
"@astrojs/check": "^0.5.10",
Expand All @@ -43,6 +42,7 @@
"astro": "^4.12.2",
"astro-purgecss": "4.1.0",
"drizzle-orm": "^0.31.1",
"nodemailer": "^6.9.14",
"purgecss": "5.0.0",
"solid-js": "^1.8.17",
"solid-motionone": "^1.0.0",
Expand Down
38 changes: 19 additions & 19 deletions src/components/Icon/types.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
export type IconName =
| 'bmc'
| 'check'
| 'failure'
| 'github'
| 'hand-heart-filled'
| 'hand-heart'
| 'info'
| 'language'
| 'left-arrow'
| 'link'
| 'unsplash'
| 'magnifier'
| 'publish'
| 'mail'
| 'moon'
| 'new'
| 'pencil'
| 'point'
| 'publish'
| 'question'
| 'quote'
| 'point'
| 'bmc'
| 'right-arrow'
| 'rss'
| 'sun'
| 'pencil'
| 'warning'
| 'toc'
| 'unsplash'
| 'failure'
| 'hand-heart-filled'
| 'github'
| 'info'
| 'new'
| 'hand-heart'
| 'update'
| 'warning';
| 'left-arrow'
| 'language'
| 'rss'
| 'sun'
| 'link'
| 'check'
| 'question';
7 changes: 1 addition & 6 deletions src/pages/[locale]/api/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ export const POST: APIRoute = async ({
),
confirmation: pipe(
boolean(),
// string(),
// check(
// (input) => input === 'on',
// t.data.contact_form.confirmation.required
// )
check(
(input) => input === true,
t.data.contact_form.confirmation.required,
Expand Down Expand Up @@ -161,7 +156,7 @@ export const POST: APIRoute = async ({
if (!response.ok) {
return new Response(
JSON.stringify({
message: `Form submission failed: ${response.status} ${response.statusText}`,
message: `Failed to submit form data: ${response.status} ${response.statusText}`,
}),
{ status: 500 },
);
Expand Down
2 changes: 1 addition & 1 deletion src/pages/api/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ export const POST: APIRoute = async ({
if (!response.ok) {
return new Response(
JSON.stringify({
message: `Form submission failed: ${response.status} ${response.statusText}`,
message: `Failed to submit form data: ${response.status} ${response.statusText} ${response.url}`,
}),
{ status: 500 },
);
Expand Down
3 changes: 2 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
},
"exclude": [
"./dist",
"./node_modules"
"./node_modules",
"src/functions"
]
}
24 changes: 12 additions & 12 deletions worker-configuration.d.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// Generated by Wrangler on Tue Jun 25 2024 10:03:22 GMT+0900 (日本標準時)
// Generated by Wrangler on Fri Aug 02 2024 06:25:18 GMT+0000 (Coordinated Universal Time)
// by running `wrangler types`

interface Env {
UNSPLASH_API_ACCESS_KEY: string
TURNSTILE_SITE_KEY: string
PUBLIC_TURNSTILE_SITE_KEY: string
TURNSTILE_SECRET_KEY: string
BREVO_API_KEY: string
MY_CUSTOM_EMAIL_ADDRESS: string
CLOUDFLARE_ACCOUNT_ID: string
D1_DB_ID: string
D1_DB_API_TOKEN: string
LOCAL_DB_PATH: string
DB: D1Database
UNSPLASH_API_ACCESS_KEY: string;
TURNSTILE_SITE_KEY: string;
PUBLIC_TURNSTILE_SITE_KEY: string;
TURNSTILE_SECRET_KEY: string;
BREVO_API_KEY: string;
MY_CUSTOM_EMAIL_ADDRESS: string;
CLOUDFLARE_ACCOUNT_ID: string;
D1_DB_ID: string;
D1_DB_API_TOKEN: string;
LOCAL_DB_PATH: string;
DB: D1Database;
}

0 comments on commit eb4af35

Please sign in to comment.