mirror of
https://github.com/ManInDark/HabitTrove.git
synced 2026-01-21 06:34:30 +01:00
Merge Tag 'v0.2.26'
This commit is contained in:
@@ -9,3 +9,15 @@ npm-debug.log
|
|||||||
data
|
data
|
||||||
CLAUDE.md
|
CLAUDE.md
|
||||||
docs/
|
docs/
|
||||||
|
Budfile
|
||||||
|
PLAN.md
|
||||||
|
/backups/
|
||||||
|
/data.bak/
|
||||||
|
/coverage/
|
||||||
|
*.md
|
||||||
|
!README.md
|
||||||
|
!CHANGELOG.md
|
||||||
|
tags
|
||||||
|
tsconfig.tsbuildinfo
|
||||||
|
.env.local
|
||||||
|
.env.*.local
|
||||||
|
|||||||
10
.husky/pre-commit
Normal file → Executable file
10
.husky/pre-commit
Normal file → Executable file
@@ -1 +1,11 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# Check that package.json version exists in CHANGELOG.md
|
||||||
|
VERSION=$(node -p "require('./package.json').version")
|
||||||
|
if ! grep -q "## Version $VERSION" CHANGELOG.md; then
|
||||||
|
echo "❌ Error: Version $VERSION from package.json not found in CHANGELOG.md"
|
||||||
|
echo "Please add an entry for version $VERSION in CHANGELOG.md"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
echo "✅ Version $VERSION found in CHANGELOG.md"
|
||||||
|
|
||||||
npm run typecheck && npm run lint && npm run test
|
npm run typecheck && npm run lint && npm run test
|
||||||
|
|||||||
@@ -1,5 +1,11 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## Version 0.2.26
|
||||||
|
|
||||||
|
### Improved
|
||||||
|
|
||||||
|
* Docker build performance optimization with cache mounts
|
||||||
|
|
||||||
## Version 0.2.25
|
## Version 0.2.25
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
@@ -24,6 +24,15 @@ HabitTrove is a gamified habit tracking PWA built with Next.js 15, TypeScript, a
|
|||||||
- `docker compose up -d` - Run with docker-compose (recommended)
|
- `docker compose up -d` - Run with docker-compose (recommended)
|
||||||
- Requires `AUTH_SECRET` environment variable: `openssl rand -base64 32`
|
- Requires `AUTH_SECRET` environment variable: `openssl rand -base64 32`
|
||||||
|
|
||||||
|
## Version Management
|
||||||
|
|
||||||
|
### Creating a New Version
|
||||||
|
1. Update version in `package.json`
|
||||||
|
2. Update `CHANGELOG.md` with new version and changes (follow existing patterns in the file)
|
||||||
|
3. Run `npm run typecheck && npm run lint` to ensure code quality
|
||||||
|
4. Commit changes: `git add . && git commit -m "feat: description"`
|
||||||
|
* Follow Conventional Commits Standard: `<type>[scope]: <description>` (e.g., `feat(auth): add OAuth integration`, `fix: resolve memory leak in task loader`).
|
||||||
|
|
||||||
## Architecture Overview
|
## Architecture Overview
|
||||||
|
|
||||||
### State Management (Jotai)
|
### State Management (Jotai)
|
||||||
|
|||||||
29
Dockerfile
29
Dockerfile
@@ -1,18 +1,17 @@
|
|||||||
# syntax=docker.io/docker/dockerfile:1
|
# syntax=docker.io/docker/dockerfile:1
|
||||||
|
|
||||||
FROM node:18-alpine AS base
|
# Use build platform for base images to avoid emulation
|
||||||
|
FROM --platform=$BUILDPLATFORM node:22-alpine AS base
|
||||||
|
|
||||||
# Install dependencies only when needed
|
# Install dependencies only when needed
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
|
|
||||||
RUN apk add --no-cache libc6-compat
|
RUN apk add --no-cache libc6-compat
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Install dependencies based on the preferred package manager
|
# Use cache mounts for npm cache
|
||||||
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
|
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* ./
|
||||||
RUN \
|
RUN --mount=type=cache,target=/root/.npm \
|
||||||
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
|
||||||
# use --force flag until all deps supports react19
|
|
||||||
elif [ -f package-lock.json ]; then npm ci --force; \
|
elif [ -f package-lock.json ]; then npm ci --force; \
|
||||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
|
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
|
||||||
else echo "Lockfile not found." && exit 1; \
|
else echo "Lockfile not found." && exit 1; \
|
||||||
@@ -26,32 +25,28 @@ COPY . .
|
|||||||
|
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
RUN \
|
# Use cache mount for Next.js cache
|
||||||
|
RUN --mount=type=cache,target=/app/.next/cache \
|
||||||
if [ -f yarn.lock ]; then yarn run build; \
|
if [ -f yarn.lock ]; then yarn run build; \
|
||||||
elif [ -f package-lock.json ]; then npm run build; \
|
elif [ -f package-lock.json ]; then npm run build; \
|
||||||
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
|
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm run build; \
|
||||||
else echo "Lockfile not found." && exit 1; \
|
else echo "Lockfile not found." && exit 1; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Production image, copy all the files and run next
|
# Production image - use target platform
|
||||||
FROM base AS runner
|
FROM node:22-alpine AS runner
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
ENV NODE_ENV=production
|
ENV NODE_ENV=production
|
||||||
ENV NEXT_TELEMETRY_DISABLED=1
|
ENV NEXT_TELEMETRY_DISABLED=1
|
||||||
|
|
||||||
RUN addgroup --system --gid 1001 nodejs
|
RUN addgroup --system --gid 1001 nodejs && \
|
||||||
RUN adduser --system --uid 1001 nextjs
|
adduser --system --uid 1001 nextjs && \
|
||||||
|
mkdir -p /app/data /app/backups && \
|
||||||
# Create data and backups directories and set permissions
|
chown nextjs:nodejs /app/data /app/backups
|
||||||
RUN mkdir -p /app/data /app/backups \
|
|
||||||
&& chown nextjs:nodejs /app/data /app/backups
|
|
||||||
|
|
||||||
COPY --from=builder /app/public ./public
|
COPY --from=builder /app/public ./public
|
||||||
COPY --from=builder /app/CHANGELOG.md ./
|
COPY --from=builder /app/CHANGELOG.md ./
|
||||||
|
|
||||||
# Automatically leverage output traces to reduce image size
|
|
||||||
# https://nextjs.org/docs/advanced-features/output-file-tracing
|
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
|
||||||
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "habittrove",
|
"name": "habittrove",
|
||||||
"version": "0.2.25",
|
"version": "0.2.26",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev --turbopack",
|
"dev": "next dev --turbopack",
|
||||||
|
|||||||
Reference in New Issue
Block a user