Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 8 additions & 16 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# CircleCI pipeline configuration
# Docs: https://circleci.com/docs/reference/configuration-reference
version: 2.1

orbs:
Expand All @@ -8,29 +7,22 @@ orbs:
jobs:
build-and-test:
docker:
# Track the active LTS release automatically; pin to a specific version (e.g. cimg/node:22.4)
# once the project has stricter Node version requirements.
- image: cimg/node:lts

# Use `small` (1 vCPU, 2 GB RAM) — sufficient for a static site with no heavy test suite.
# Upgrade to `medium` if build times increase with a real test runner.
resource_class: small

steps:
- checkout

# Install dependencies and restore/save the npm cache automatically.
- node/install-packages:
pkg-manager: npm

# Verify the project builds cleanly before running tests.
- run:
name: Install pnpm
command: sudo npm install -g pnpm
- run:
name: Install dependencies
command: pnpm install
- run:
name: Build
command: npm run build

command: pnpm run build
- run:
name: Run tests
command: npm test
command: pnpm test

workflows:
ci:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/deploy-ghcr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,14 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '20'
# cache: 'npm' # REMOVED - causes lock file error

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10

- name: Install dependencies
run: npm install --no-audit --fund=false
run: pnpm install

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
Expand Down
6 changes: 4 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM node:20-alpine
WORKDIR /app
COPY package*.json ./
RUN npm install --production --no-audit --fund=false
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --production
COPY . .
RUN pnpm run build
EXPOSE 3000
CMD ["node", "server.js"]
6 changes: 6 additions & 0 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,12 @@ function updateMetrics() {
if(durEl) durEl.textContent = `${minutes}:${seconds.toString().padStart(2, '0')}`;
}
function updateFocusMetrics() {
const ta = document.getElementById("focusTextArea");
if (ta) {
const words = ta.value.trim().split(/\s+/).filter(w => w.length > 0).length;
const el = document.getElementById("focusMetrics");
if (el) el.textContent = `${words} words`;
}
const words = document.getElementById("focusTextArea").value.trim().split(/\s+/).filter(w => w.length > 0).length;
document.getElementById('focusMetrics').textContent = `${words} words`;
}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@vercel/analytics": "^2.0.1",
"@vercel/edge-config": "^1.4.3",
"@vercel/speed-insights": "^2.0.0",
"express": "^5.2.1",
"flags": "^4.0.6",
"hypertune": "^2.10.1",
"server-only": "^0.0.1"
Expand Down
Loading
Loading