Compare commits
93 Commits
da2fc876d4
...
website-co
| Author | SHA1 | Date | |
|---|---|---|---|
| 6ff2249955 | |||
| ec6cfba9ba | |||
| 22b6a06b32 | |||
| dac9e80efd | |||
| 8fd744118f | |||
| adcbce68c8 | |||
| 33fbbe96b3 | |||
| 076618784a | |||
| 91ce9aa6c6 | |||
| 52eac520e8 | |||
| 2583e4e99b | |||
| 1b1db88a2a | |||
| 028637fdd3 | |||
| 649b596c7c | |||
| 25c08f7a1d | |||
| c320190a8d | |||
| e17d28914e | |||
| 95c9f186bb | |||
| 4f571b3ae1 | |||
| c5fdcf6b10 | |||
| a38cd26894 | |||
| 37e7b3617a | |||
| 87224a6dbb | |||
| 4b5f65bfdd | |||
| f9a837f0fa | |||
| 4847e9f172 | |||
| 3aa75e1a10 | |||
| 91cd9af0f8 | |||
| 4a59e44716 | |||
| 67eb549ed2 | |||
| 8fd009ffda | |||
| 4b1eb3777f | |||
| 7858d95f58 | |||
| b91d37db45 | |||
| 109996989e | |||
| 96151d6512 | |||
| ac266b98ec | |||
| 8fa3c0b3ab | |||
| cef1b3381f | |||
| 049861c255 | |||
| ba948e4181 | |||
| 68b6d7f785 | |||
| 1f9264a409 | |||
| 7774e31c36 | |||
| c9f921ba5b | |||
| 85a86f3681 | |||
| b8cf035890 | |||
| c966f9302b | |||
| 47e10ba05f | |||
| 199074f10b | |||
| 4741b36003 | |||
| c3673b76b6 | |||
| d0f5838cac | |||
| 5c0152d234 | |||
| c6796e782a | |||
| 2d7f2904a8 | |||
| 6bb862e6e5 | |||
| 083d52d3a5 | |||
| 69c811854c | |||
| adcd336a16 | |||
| 4cd7e565eb | |||
| cf3b740907 | |||
| 297a56e7d6 | |||
| ee76972667 | |||
| 005e092344 | |||
| ffbc3beaf7 | |||
| 506987c164 | |||
| a807a39b09 | |||
| 40a673a418 | |||
| 9a4ecdd073 | |||
| d24a3054c1 | |||
| d1bc55e556 | |||
| f0319c4446 | |||
| 221587eff9 | |||
| 9ac3295127 | |||
| c5dde92023 | |||
| f91be707d9 | |||
| 7fe9303d5e | |||
| 33388f59ee | |||
| 3e34b94ec5 | |||
| 128dc14459 | |||
| d6e75ae2ea | |||
| 6f728ad146 | |||
| b342f7b1cb | |||
| 5b0829eac4 | |||
| f7825ed740 | |||
| 3d88f23e88 | |||
| efaa02ae20 | |||
| 396b6d210b | |||
| 594bc9bc4f | |||
| e4a87c3941 | |||
| 3ba6db7f83 | |||
| b37ee3f94c |
@@ -1,7 +1,17 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
.idea
|
.gitea/
|
||||||
.astro
|
.astro/
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
*/dist/
|
||||||
*/build/
|
*/build/
|
||||||
*/node_modules/
|
*/node_modules/
|
||||||
|
*/playwright-report/
|
||||||
|
*/test-results/
|
||||||
|
|
||||||
|
.gitignore
|
||||||
|
Dockerfile
|
||||||
|
Makefile
|
||||||
|
new-words.txt
|
||||||
|
README.md
|
||||||
7
.editorconfig
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[*]
|
||||||
|
charset = utf-8
|
||||||
|
insert_final_newline = true
|
||||||
|
end_of_line = lf
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
max_line_length = 80
|
||||||
@@ -4,7 +4,7 @@ on:
|
|||||||
branches: [main]
|
branches: [main]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
determine_version:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
repo_name: ${{ steps.project_metadata.outputs.REPO_NAME }}
|
repo_name: ${{ steps.project_metadata.outputs.REPO_NAME }}
|
||||||
@@ -12,52 +12,73 @@ jobs:
|
|||||||
project_version: ${{ steps.project_metadata.outputs.PROJECT_VERSION }}
|
project_version: ${{ steps.project_metadata.outputs.PROJECT_VERSION }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup Node Environment
|
- name: Setup Node Environment
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: ">=22.20"
|
||||||
|
|
||||||
- name: Acquire Project Metadata
|
- name: Setup Project Dependencies
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npx playwright install --with-deps
|
||||||
|
|
||||||
|
- name: Code Formatting Check
|
||||||
|
run: npx prettier . --check
|
||||||
|
|
||||||
|
- name: Spelling Check
|
||||||
|
run: npx cspell .
|
||||||
|
|
||||||
|
- name: Build Project
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Run Unit Tests
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Run E2E Tests
|
||||||
|
run: npm run e2e-test
|
||||||
|
|
||||||
|
- name: Set Project Metadata
|
||||||
id: project_metadata
|
id: project_metadata
|
||||||
run: |
|
run: |
|
||||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||||
echo REPO_VERSION_HASH=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
echo REPO_VERSION_HASH=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||||
echo PROJECT_VERSION=$(npm pkg get version --workspaces=false | tr -d \") >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
build_and_push:
|
build_and_push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: determine_version
|
needs: test
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout caperren-com Repository
|
- name: Checkout caperren-com Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
path: caperren-com
|
path: caperren-com
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: gitea.perren.cloud
|
registry: 192.168.1.36:30008
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.ACTIONS_TOKEN }}
|
password: ${{ secrets.ACTIONS_TOKEN }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
buildkitd-config-inline: |
|
||||||
|
[registry."192.168.1.36:30008"]
|
||||||
|
http = true
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: caperren-com
|
context: caperren-com
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.repo_version_hash }}
|
192.168.1.36:30008/caperren/${{ needs.test.outputs.repo_name }}:${{ needs.test.outputs.repo_version_hash }}
|
||||||
gitea.perren.cloud/caperren/${{ needs.determine_version.outputs.repo_name }}:${{ needs.determine_version.outputs.project_version }}
|
192.168.1.36:30008/caperren/caperren-com:latest
|
||||||
gitea.perren.cloud/caperren/caperren-com:latest
|
build-args: |
|
||||||
|
REPO_VERSION_HASH=${{ needs.test.outputs.repo_version_hash }}
|
||||||
test:
|
BUILD_ENVIRONMENT=production
|
||||||
runs-on: ubuntu-latest
|
|
||||||
needs: build_and_push
|
|
||||||
steps:
|
|
||||||
- run: echo "Placeholder"
|
|
||||||
|
|
||||||
deploy_production:
|
deploy_production:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -85,8 +106,8 @@ jobs:
|
|||||||
- name: Start App
|
- name: Start App
|
||||||
run: |
|
run: |
|
||||||
curl -k -X 'POST' \
|
curl -k -X 'POST' \
|
||||||
'https://caperren.com:444/api/v2.0/app/stop' \
|
'https://caperren.com:444/api/v2.0/app/start' \
|
||||||
-H 'accept: */*' \
|
-H 'accept: */*' \
|
||||||
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
|
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d '"caperren-com"'
|
-d '"caperren-com"'
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
name: Build and Test - Staging
|
name: Build and Test - Staging
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
types: [ opened, synchronize, reopened ]
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
determine_version:
|
test:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
repo_name: ${{ steps.project_metadata.outputs.REPO_NAME }}
|
repo_name: ${{ steps.project_metadata.outputs.REPO_NAME }}
|
||||||
@@ -12,50 +12,72 @@ jobs:
|
|||||||
project_version: ${{ steps.project_metadata.outputs.PROJECT_VERSION }}
|
project_version: ${{ steps.project_metadata.outputs.PROJECT_VERSION }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: Setup Node Environment
|
- name: Setup Node Environment
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v6
|
||||||
|
with:
|
||||||
|
node-version: ">=22.20"
|
||||||
|
|
||||||
- name: Acquire Project Metadata
|
- name: Setup Project Dependencies
|
||||||
|
run: |
|
||||||
|
npm ci
|
||||||
|
npx playwright install --with-deps
|
||||||
|
|
||||||
|
- name: Code Formatting Check
|
||||||
|
run: npx prettier . --check
|
||||||
|
|
||||||
|
- name: Spelling Check
|
||||||
|
run: npx cspell .
|
||||||
|
|
||||||
|
- name: Build Project
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Run Unit Tests
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Run E2E Tests
|
||||||
|
run: npm run e2e-test
|
||||||
|
|
||||||
|
- name: Set Project Metadata
|
||||||
id: project_metadata
|
id: project_metadata
|
||||||
run: |
|
run: |
|
||||||
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
echo REPO_NAME=$(echo ${GITHUB_REPOSITORY} | awk -F"/" '{print $2}') >> $GITHUB_OUTPUT
|
||||||
echo REPO_VERSION_HASH=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
echo REPO_VERSION_HASH=$(git describe --tags --always | sed 's/^v//') >> $GITHUB_OUTPUT
|
||||||
echo PROJECT_VERSION=$(npm pkg get version --workspaces=false | tr -d \") >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
build_and_push:
|
build_and_push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs: determine_version
|
needs: test
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout caperren-com Repository
|
- name: Checkout caperren-com Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
path: caperren-com
|
path: caperren-com
|
||||||
|
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
registry: gitea.perren.cloud
|
registry: 192.168.1.36:30008
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
username: ${{ secrets.REGISTRY_USERNAME }}
|
||||||
password: ${{ secrets.ACTIONS_TOKEN }}
|
password: ${{ secrets.ACTIONS_TOKEN }}
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
with:
|
||||||
|
buildkitd-config-inline: |
|
||||||
|
[registry."192.168.1.36:30008"]
|
||||||
|
http = true
|
||||||
|
|
||||||
- name: Build and Push
|
- name: Build and Push
|
||||||
uses: docker/build-push-action@v5
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: caperren-com
|
context: caperren-com
|
||||||
push: true
|
push: true
|
||||||
tags: |
|
tags: |
|
||||||
gitea.perren.cloud/caperren/caperren-com:latest-staging
|
192.168.1.36:30008/caperren/caperren-com:latest-staging
|
||||||
|
build-args: |
|
||||||
test:
|
REPO_VERSION_HASH=${{ needs.test.outputs.repo_version_hash }}
|
||||||
runs-on: ubuntu-latest
|
BUILD_ENVIRONMENT=staging
|
||||||
needs: build_and_push
|
|
||||||
steps:
|
|
||||||
- run: echo "Placeholder"
|
|
||||||
|
|
||||||
deploy_staging:
|
deploy_staging:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@@ -72,6 +94,7 @@ jobs:
|
|||||||
"name": "caperren-com-stg",
|
"name": "caperren-com-stg",
|
||||||
"options": {}
|
"options": {}
|
||||||
}'
|
}'
|
||||||
|
|
||||||
- name: Stop App
|
- name: Stop App
|
||||||
run: |
|
run: |
|
||||||
curl -k -X 'POST' \
|
curl -k -X 'POST' \
|
||||||
@@ -83,8 +106,8 @@ jobs:
|
|||||||
- name: Start App
|
- name: Start App
|
||||||
run: |
|
run: |
|
||||||
curl -k -X 'POST' \
|
curl -k -X 'POST' \
|
||||||
'https://caperren.com:444/api/v2.0/app/stop' \
|
'https://caperren.com:444/api/v2.0/app/start' \
|
||||||
-H 'accept: */*' \
|
-H 'accept: */*' \
|
||||||
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
|
-H 'Authorization: Bearer ${{ secrets.TRUENAS_CAPERRENCOM_API_KEY }}' \
|
||||||
-H 'Content-Type: application/json' \
|
-H 'Content-Type: application/json' \
|
||||||
-d '"caperren-com-stg"'
|
-d '"caperren-com-stg"'
|
||||||
|
|||||||
16
.gitignore
vendored
@@ -1,9 +1,3 @@
|
|||||||
# Ignore everything under src/content, as they are dynamically added from obsidian
|
|
||||||
src/content/*
|
|
||||||
|
|
||||||
# Do not ignore config.ts in src/content since that necessary to import the dynamic content
|
|
||||||
!src/content/config.ts
|
|
||||||
|
|
||||||
# build output
|
# build output
|
||||||
dist/
|
dist/
|
||||||
|
|
||||||
@@ -28,3 +22,13 @@ pnpm-debug.log*
|
|||||||
|
|
||||||
# jetbrains setting folder
|
# jetbrains setting folder
|
||||||
.idea/
|
.idea/
|
||||||
|
|
||||||
|
# Playwright
|
||||||
|
/test-results/
|
||||||
|
/playwright-report/
|
||||||
|
/blob-report/
|
||||||
|
/playwright/.cache/
|
||||||
|
/playwright/.auth/
|
||||||
|
|
||||||
|
# Local temporary storage files
|
||||||
|
new-words.txt
|
||||||
|
|||||||
34
.prettierignore
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
# build output
|
||||||
|
dist/
|
||||||
|
|
||||||
|
# generated types
|
||||||
|
.astro/
|
||||||
|
|
||||||
|
# dependencies
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# logs
|
||||||
|
npm-debug.log*
|
||||||
|
yarn-debug.log*
|
||||||
|
yarn-error.log*
|
||||||
|
pnpm-debug.log*
|
||||||
|
|
||||||
|
# environment variables
|
||||||
|
.env
|
||||||
|
.env.production
|
||||||
|
|
||||||
|
# macOS-specific files
|
||||||
|
.DS_Store
|
||||||
|
|
||||||
|
# jetbrains setting folder
|
||||||
|
.idea/
|
||||||
|
|
||||||
|
# Playwright
|
||||||
|
/test-results/
|
||||||
|
/playwright-report/
|
||||||
|
/blob-report/
|
||||||
|
/playwright/.cache/
|
||||||
|
/playwright/.auth/
|
||||||
|
|
||||||
|
# Local temporary storage files
|
||||||
|
new-words.txt
|
||||||
29
.prettierrc
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"astroOrganizeImportsMode": "All",
|
||||||
|
"importOrder": [
|
||||||
|
"^@core/(.*)$",
|
||||||
|
"^@server/(.*)$",
|
||||||
|
"^@ui/(.*)$",
|
||||||
|
"^@layouts/(.*)$",
|
||||||
|
"^@components/(.*)$",
|
||||||
|
"^@interfaces/(.*)$",
|
||||||
|
"^@assets/(.*)$",
|
||||||
|
"^[./]"
|
||||||
|
],
|
||||||
|
"importOrderSeparation": true,
|
||||||
|
"importOrderSortSpecifiers": true,
|
||||||
|
"plugins": [
|
||||||
|
"prettier-plugin-astro",
|
||||||
|
"prettier-plugin-tailwindcss",
|
||||||
|
"@trivago/prettier-plugin-sort-imports",
|
||||||
|
"prettier-plugin-astro-organize-imports"
|
||||||
|
],
|
||||||
|
"overrides": [
|
||||||
|
{
|
||||||
|
"files": "*.astro",
|
||||||
|
"options": {
|
||||||
|
"parser": "astro"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
45
Dockerfile
@@ -5,21 +5,50 @@ WORKDIR /app
|
|||||||
# Therefore, the `-deps` steps will be skipped if only the source code changes.
|
# Therefore, the `-deps` steps will be skipped if only the source code changes.
|
||||||
COPY package.json package-lock.json tsconfig.json astro.config.mjs ./
|
COPY package.json package-lock.json tsconfig.json astro.config.mjs ./
|
||||||
|
|
||||||
|
CMD [ "/bin/bash" ]
|
||||||
|
|
||||||
FROM base AS prod-deps
|
FROM base AS prod-deps
|
||||||
RUN npm install --omit=dev
|
RUN npm install --omit=dev
|
||||||
|
|
||||||
FROM base AS build-deps
|
FROM prod-deps AS test-base
|
||||||
RUN npm install
|
|
||||||
|
|
||||||
FROM build-deps AS build
|
RUN npm ci
|
||||||
COPY . .
|
RUN npx playwright install --with-deps
|
||||||
|
|
||||||
|
FROM prod-deps AS build
|
||||||
|
|
||||||
|
COPY --exclude=test \
|
||||||
|
--exclude=test-e2e \
|
||||||
|
--exclude=playwright.config.ts \
|
||||||
|
--exclude=vitest.config.ts \
|
||||||
|
--exclude=.prettierrc \
|
||||||
|
--exclude=.prettierignore \
|
||||||
|
--exclude=cspell.json \
|
||||||
|
--exclude=project-words.txt \
|
||||||
|
. .
|
||||||
|
|
||||||
|
ARG REPO_VERSION_HASH
|
||||||
|
ARG BUILD_ENVIRONMENT
|
||||||
|
|
||||||
|
RUN echo "PUBLIC_REPO_VERSION_HASH=\"${REPO_VERSION_HASH}\" \n\
|
||||||
|
PUBLIC_BUILD_ENVIRONMENT=\"${BUILD_ENVIRONMENT}\"" >> .env
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
|
|
||||||
FROM httpd:latest AS runtime
|
FROM test-base AS test
|
||||||
WORKDIR /usr/local/apache2/htdocs
|
|
||||||
|
|
||||||
RUN rm index.html
|
COPY . .
|
||||||
|
COPY --from=build /app/dist /app/dist
|
||||||
|
|
||||||
COPY --from=build /app/dist .
|
RUN npx prettier . --check
|
||||||
|
RUN npx cspell .
|
||||||
|
RUN npm run test
|
||||||
|
RUN npm run e2e-test
|
||||||
|
|
||||||
|
FROM nginx:alpine AS runtime
|
||||||
|
|
||||||
|
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=build /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
RUN chown -R nginx:nginx /usr/share/nginx/html
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
76
Makefile
@@ -5,7 +5,18 @@
|
|||||||
fix \
|
fix \
|
||||||
astro_upgrade \
|
astro_upgrade \
|
||||||
build \
|
build \
|
||||||
dev
|
dev \
|
||||||
|
dev-hosted \
|
||||||
|
test \
|
||||||
|
_spelling-generate-new-words \
|
||||||
|
spelling-find-new-words \
|
||||||
|
spelling-add-new-words \
|
||||||
|
spelling-check \
|
||||||
|
cleanup-check \
|
||||||
|
cleanup-code \
|
||||||
|
convert_video \
|
||||||
|
convert_video_times \
|
||||||
|
generate_asset_imports
|
||||||
|
|
||||||
default: dev
|
default: dev
|
||||||
|
|
||||||
@@ -24,3 +35,66 @@ build:
|
|||||||
dev:
|
dev:
|
||||||
npm run dev
|
npm run dev
|
||||||
|
|
||||||
|
dev-hosted:
|
||||||
|
npm run dev-hosted
|
||||||
|
|
||||||
|
test: spelling-check
|
||||||
|
@npx playwright install --with-deps
|
||||||
|
npm run test --ui
|
||||||
|
npx playwright test --ui
|
||||||
|
|
||||||
|
_spelling-generate-new-words:
|
||||||
|
@cspell --words-only --unique . 2>/dev/null | sort --ignore-case -o new-words.txt
|
||||||
|
|
||||||
|
spelling-find-new-words: _spelling-generate-new-words
|
||||||
|
@echo "Found the following new words:"
|
||||||
|
@cat new-words.txt
|
||||||
|
@rm -f new-words.txt
|
||||||
|
|
||||||
|
spelling-add-new-words: _spelling-generate-new-words
|
||||||
|
@echo "Adding to project-words.txt"
|
||||||
|
@cat new-words.txt >> project-words.txt
|
||||||
|
@rm -f new-words.txt
|
||||||
|
@cat project-words.txt | sort --ignore-case -o project-words.txt
|
||||||
|
|
||||||
|
spelling-check:
|
||||||
|
npx cspell .
|
||||||
|
|
||||||
|
cleanup-check:
|
||||||
|
npx prettier . --check
|
||||||
|
|
||||||
|
cleanup-code:
|
||||||
|
npx prettier . --write
|
||||||
|
|
||||||
|
convert_video:
|
||||||
|
ffmpeg \
|
||||||
|
-init_hw_device vaapi=va:/dev/dri/renderD128 \
|
||||||
|
-filter_hw_device va \
|
||||||
|
-i $(input) \
|
||||||
|
-vf 'format=nv12,hwupload,scale_vaapi=-2:720' \
|
||||||
|
-c:v h264_vaapi \
|
||||||
|
-rc_mode CQP \
|
||||||
|
-qp 28 \
|
||||||
|
-an \
|
||||||
|
$(extra_args) \
|
||||||
|
$(output)
|
||||||
|
|
||||||
|
convert_video_times:
|
||||||
|
ffmpeg \
|
||||||
|
-init_hw_device vaapi=va:/dev/dri/renderD128 \
|
||||||
|
-filter_hw_device va \
|
||||||
|
-i $(input) \
|
||||||
|
-ss $(start) \
|
||||||
|
-to $(end) \
|
||||||
|
-vf 'format=nv12,hwupload,scale_vaapi=-2:720' \
|
||||||
|
-c:v h264_vaapi \
|
||||||
|
-rc_mode CQP \
|
||||||
|
-qp 28 \
|
||||||
|
-an \
|
||||||
|
$(output)
|
||||||
|
|
||||||
|
generate_asset_imports:
|
||||||
|
@for assets_path in `find "src/assets/${assets_relative_path}" -maxdepth 1 -type f -printf "%f\n"`; do \
|
||||||
|
without_extension=$${assets_path/%.*}; \
|
||||||
|
echo "import $${without_extension//-/_} from \"@assets/${assets_relative_path}/$$assets_path\";"; \
|
||||||
|
done;
|
||||||
|
|||||||
49
README.md
@@ -1,48 +1,3 @@
|
|||||||
# Astro Starter Kit: Basics
|
# Corwin Perren's Personal Portfolio Website
|
||||||
|
|
||||||
```sh
|
Check the Makefile and/or package.json for the commands needed to build and run this project.
|
||||||
npm create astro@latest -- --template basics
|
|
||||||
```
|
|
||||||
|
|
||||||
[](https://stackblitz.com/github/withastro/astro/tree/latest/examples/basics)
|
|
||||||
[](https://codesandbox.io/p/sandbox/github/withastro/astro/tree/latest/examples/basics)
|
|
||||||
[](https://codespaces.new/withastro/astro?devcontainer_path=.devcontainer/basics/devcontainer.json)
|
|
||||||
|
|
||||||
> 🧑🚀 **Seasoned astronaut?** Delete this file. Have fun!
|
|
||||||
|
|
||||||

|
|
||||||
|
|
||||||
## 🚀 Project Structure
|
|
||||||
|
|
||||||
Inside of your Astro project, you'll see the following folders and files:
|
|
||||||
|
|
||||||
```text
|
|
||||||
/
|
|
||||||
├── public/
|
|
||||||
│ └── favicon.svg
|
|
||||||
├── src/
|
|
||||||
│ ├── layouts/
|
|
||||||
│ │ └── Layout.astro
|
|
||||||
│ └── pages/
|
|
||||||
│ └── index.astro
|
|
||||||
└── package.json
|
|
||||||
```
|
|
||||||
|
|
||||||
To learn more about the folder structure of an Astro project, refer to [our guide on project structure](https://docs.astro.build/en/basics/project-structure/).
|
|
||||||
|
|
||||||
## 🧞 Commands
|
|
||||||
|
|
||||||
All commands are run from the root of the project, from a terminal:
|
|
||||||
|
|
||||||
| Command | Action |
|
|
||||||
| :------------------------ | :----------------------------------------------- |
|
|
||||||
| `npm install` | Installs dependencies |
|
|
||||||
| `npm run dev` | Starts local dev server at `localhost:4321` |
|
|
||||||
| `npm run build` | Build your production site to `./dist/` |
|
|
||||||
| `npm run preview` | Preview your build locally, before deploying |
|
|
||||||
| `npm run astro ...` | Run CLI commands like `astro add`, `astro check` |
|
|
||||||
| `npm run astro -- --help` | Get help using the Astro CLI |
|
|
||||||
|
|
||||||
## 👀 Want to learn more?
|
|
||||||
|
|
||||||
Feel free to check [our documentation](https://docs.astro.build) or jump into our [Discord server](https://astro.build/chat).
|
|
||||||
|
|||||||
@@ -1,18 +1,32 @@
|
|||||||
// @ts-check
|
// @ts-check
|
||||||
import { defineConfig } from 'astro/config';
|
import sitemap from "@astrojs/sitemap";
|
||||||
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
|
|
||||||
|
|
||||||
import tailwindcss from "@tailwindcss/vite";
|
import tailwindcss from "@tailwindcss/vite";
|
||||||
|
import { defineConfig } from "astro/config";
|
||||||
|
|
||||||
|
// We don't have access to short imports this early in the build chain
|
||||||
|
// noinspection ES6PreferShortImport
|
||||||
|
import { getPaths, siteLayout } from "./src/data/site-layout.ts";
|
||||||
|
|
||||||
|
const disabledPaths = getPaths(siteLayout, [], true);
|
||||||
|
|
||||||
// https://astro.build/config
|
// https://astro.build/config
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
integrations: [],
|
site: "https://caperren.com",
|
||||||
|
trailingSlash: "never",
|
||||||
markdown: {
|
prefetch: {
|
||||||
rehypePlugins: [rehypeAstroRelativeMarkdownLinks],
|
prefetchAll: true,
|
||||||
},
|
},
|
||||||
|
integrations: [
|
||||||
|
sitemap({
|
||||||
|
filter: (pagePath) =>
|
||||||
|
!disabledPaths.some((disabledPath) => pagePath.includes(disabledPath)),
|
||||||
|
}),
|
||||||
|
],
|
||||||
vite: {
|
vite: {
|
||||||
plugins: [tailwindcss()],
|
plugins: [
|
||||||
|
// @ts-ignore
|
||||||
|
tailwindcss(),
|
||||||
|
],
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
23
cspell.json
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
{
|
||||||
|
"$schema": "https://raw.githubusercontent.com/streetsidesoftware/cspell/main/cspell.schema.json",
|
||||||
|
"version": "0.2",
|
||||||
|
"dictionaryDefinitions": [
|
||||||
|
{
|
||||||
|
"name": "project-words",
|
||||||
|
"path": "./project-words.txt",
|
||||||
|
"addWords": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"dictionaries": ["project-words"],
|
||||||
|
"ignorePaths": [
|
||||||
|
".astro",
|
||||||
|
".idea",
|
||||||
|
"dist",
|
||||||
|
"node_modules",
|
||||||
|
"playwright-report",
|
||||||
|
"test-results",
|
||||||
|
"new-words.txt",
|
||||||
|
"playwright.config.ts",
|
||||||
|
"/project-words.txt"
|
||||||
|
]
|
||||||
|
}
|
||||||
35
nginx/nginx.conf
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
worker_processes 4;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 1024;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=my_cache:10m max_size=1g inactive=60m use_temp_path=off;
|
||||||
|
|
||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html index.htm;
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
|
||||||
|
gzip on;
|
||||||
|
gzip_proxied any;
|
||||||
|
gzip_types text/plain text/css application/json application/javascript application/x-javascript text/xml application/xml application/xml+rss text/javascript;
|
||||||
|
|
||||||
|
error_page 404 /404.html;
|
||||||
|
location = /404.html {
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
internal;
|
||||||
|
}
|
||||||
|
|
||||||
|
location / {
|
||||||
|
proxy_cache my_cache;
|
||||||
|
proxy_cache_valid 200 1h;
|
||||||
|
|
||||||
|
try_files $uri $uri/index.html =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
4306
package-lock.json
generated
29
package.json
@@ -1,18 +1,35 @@
|
|||||||
{
|
{
|
||||||
"name": "caperren-com",
|
"name": "caperren-com",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"version": "0.0.1",
|
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "astro dev",
|
"dev": "astro dev",
|
||||||
|
"dev-hosted": "astro dev --host",
|
||||||
"build": "astro build",
|
"build": "astro build",
|
||||||
"preview": "astro preview",
|
"preview": "astro preview",
|
||||||
"astro": "astro"
|
"astro": "astro",
|
||||||
|
"test": "vitest",
|
||||||
|
"e2e-test": "playwright test"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@astrojs/sitemap": "^3.6.0",
|
||||||
"@tailwindcss/vite": "^4.1.11",
|
"@tailwindcss/vite": "^4.1.11",
|
||||||
"astro": "^5.11.0",
|
"astro": "^5.16.3",
|
||||||
"astro-navbar": "^2.4.0",
|
"flowbite": "^3.1.2",
|
||||||
"astro-rehype-relative-markdown-links": "^0.18.1",
|
"leader-line-new": "^1.1.9",
|
||||||
"tailwindcss": "^4.1.11"
|
"luxon": "^3.7.2",
|
||||||
|
"tailwindcss": "^4.1.11",
|
||||||
|
"uuid": "^13.0.0"
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"@playwright/test": "^1.56.1",
|
||||||
|
"@trivago/prettier-plugin-sort-imports": "^6.0.0",
|
||||||
|
"@types/luxon": "^3.7.1",
|
||||||
|
"@types/node": "^24.10.0",
|
||||||
|
"cspell": "^9.3.2",
|
||||||
|
"prettier": "3.7.3",
|
||||||
|
"prettier-plugin-astro": "0.14.1",
|
||||||
|
"prettier-plugin-astro-organize-imports": "^0.4.11",
|
||||||
|
"prettier-plugin-tailwindcss": "0.7.1",
|
||||||
|
"vitest": "^4.0.7"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
80
playwright.config.ts
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
import { defineConfig, devices } from "@playwright/test";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Read environment variables from file.
|
||||||
|
* https://github.com/motdotla/dotenv
|
||||||
|
*/
|
||||||
|
// import dotenv from 'dotenv';
|
||||||
|
// import path from 'path';
|
||||||
|
// dotenv.config({ path: path.resolve(__dirname, '.env') });
|
||||||
|
|
||||||
|
/**
|
||||||
|
* See https://playwright.dev/docs/test-configuration.
|
||||||
|
*/
|
||||||
|
export default defineConfig({
|
||||||
|
testDir: "./test-e2e",
|
||||||
|
/* Run tests in files in parallel */
|
||||||
|
fullyParallel: true,
|
||||||
|
/* Fail the build on CI if you accidentally left test.only in the source code. */
|
||||||
|
forbidOnly: !!process.env.CI,
|
||||||
|
/* Retry on CI only */
|
||||||
|
retries: process.env.CI ? 2 : 0,
|
||||||
|
/* Opt out of parallel tests on CI. */
|
||||||
|
workers: process.env.CI ? 1 : undefined,
|
||||||
|
/* Reporter to use. See https://playwright.dev/docs/test-reporters */
|
||||||
|
reporter: "html",
|
||||||
|
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */
|
||||||
|
use: {
|
||||||
|
/* Base URL to use in actions like `await page.goto('')`. */
|
||||||
|
baseURL: "http://localhost:4321",
|
||||||
|
|
||||||
|
/* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */
|
||||||
|
trace: "on-first-retry",
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Configure projects for major browsers */
|
||||||
|
projects: [
|
||||||
|
{
|
||||||
|
name: "chromium",
|
||||||
|
use: { ...devices["Desktop Chrome"] },
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "firefox",
|
||||||
|
use: { ...devices["Desktop Firefox"] },
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
name: "webkit",
|
||||||
|
use: { ...devices["Desktop Safari"] },
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Test against mobile viewports. */
|
||||||
|
{
|
||||||
|
name: "Mobile Chrome",
|
||||||
|
use: { ...devices["Pixel 5"] },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: "Mobile Safari",
|
||||||
|
use: { ...devices["iPhone 12"] },
|
||||||
|
},
|
||||||
|
|
||||||
|
/* Test against branded browsers. */
|
||||||
|
// {
|
||||||
|
// name: 'Microsoft Edge',
|
||||||
|
// use: { ...devices['Desktop Edge'], channel: 'msedge' },
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// name: 'Google Chrome',
|
||||||
|
// use: { ...devices['Desktop Chrome'], channel: 'chrome' },
|
||||||
|
// },
|
||||||
|
],
|
||||||
|
|
||||||
|
/* Run your local dev server before starting the tests */
|
||||||
|
webServer: {
|
||||||
|
command: "npm run preview",
|
||||||
|
url: "http://localhost:4321",
|
||||||
|
timeout: 120 * 1000,
|
||||||
|
reuseExistingServer: !process.env.CI,
|
||||||
|
},
|
||||||
|
});
|
||||||
96
project-words.txt
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
ADCP
|
||||||
|
Altium
|
||||||
|
ASSEM
|
||||||
|
astrojs
|
||||||
|
Atmel
|
||||||
|
automations
|
||||||
|
barebones
|
||||||
|
beaglebone
|
||||||
|
Bitwarden
|
||||||
|
Candian
|
||||||
|
caperren
|
||||||
|
CEOAS
|
||||||
|
COMSC
|
||||||
|
Concours
|
||||||
|
CONSERV
|
||||||
|
Corwin
|
||||||
|
dangerousthings
|
||||||
|
dechorionation
|
||||||
|
Dechorionator
|
||||||
|
dechorionators
|
||||||
|
dockerization
|
||||||
|
dockerizing
|
||||||
|
drumheller
|
||||||
|
ebox
|
||||||
|
ELMI
|
||||||
|
fhhs
|
||||||
|
flowbite
|
||||||
|
flowrate
|
||||||
|
gcode
|
||||||
|
gerbers
|
||||||
|
Gitea
|
||||||
|
HDFS
|
||||||
|
headshot
|
||||||
|
Homelab
|
||||||
|
hwupload
|
||||||
|
iceops
|
||||||
|
ITAR
|
||||||
|
Jetson
|
||||||
|
KFSK
|
||||||
|
Labjack
|
||||||
|
leconte
|
||||||
|
Loctite
|
||||||
|
luxon
|
||||||
|
MGMT
|
||||||
|
microcontroller
|
||||||
|
microcontroller's
|
||||||
|
Micropumps
|
||||||
|
Millis
|
||||||
|
modbus
|
||||||
|
Mokai
|
||||||
|
Multimeters
|
||||||
|
nixos
|
||||||
|
nvme
|
||||||
|
offroad
|
||||||
|
Onshape
|
||||||
|
OSSM
|
||||||
|
OSURC
|
||||||
|
panelized
|
||||||
|
Passthroughs
|
||||||
|
pcbs
|
||||||
|
Perren
|
||||||
|
Perren's
|
||||||
|
Pixhawk
|
||||||
|
Protocase
|
||||||
|
pubpath
|
||||||
|
RFID
|
||||||
|
Rito
|
||||||
|
RSSI
|
||||||
|
SARL
|
||||||
|
SCARA
|
||||||
|
showerheads
|
||||||
|
Shuttlebox
|
||||||
|
simplemotion
|
||||||
|
sinnhuber
|
||||||
|
sitemapindex
|
||||||
|
Smartsheet
|
||||||
|
solderable
|
||||||
|
ssds
|
||||||
|
Starlink
|
||||||
|
steller
|
||||||
|
Steller
|
||||||
|
Tanguay
|
||||||
|
Teamcenter
|
||||||
|
timelapse
|
||||||
|
touchoff
|
||||||
|
triaging
|
||||||
|
trivago
|
||||||
|
Truong
|
||||||
|
Ubiquiti
|
||||||
|
Unstow
|
||||||
|
uuidv
|
||||||
|
vaapi
|
||||||
|
vitest
|
||||||
|
Waterjet
|
||||||
|
Zebrafish
|
||||||
|
zscan
|
||||||
BIN
public/16x16-favicon.png
Normal file
|
After Width: | Height: | Size: 308 B |
BIN
public/180x180-favicon.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
public/192x192-favicon.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
public/32x32-favicon.png
Normal file
|
After Width: | Height: | Size: 500 B |
BIN
public/48x48-favicon.png
Normal file
|
After Width: | Height: | Size: 785 B |
BIN
public/512x512-favicon.png
Normal file
|
After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 662 B |
BIN
src/assets/about/headshot.jpg
Normal file
|
After Width: | Height: | Size: 3.2 MiB |
BIN
src/assets/education/fhhs-diploma.jpg
Normal file
|
After Width: | Height: | Size: 3.7 MiB |
BIN
src/assets/education/osu-bs-cs-diploma.jpg
Normal file
|
After Width: | Height: | Size: 5.0 MiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 2.6 MiB |
|
After Width: | Height: | Size: 4.2 MiB |
|
After Width: | Height: | Size: 4.1 MiB |
|
After Width: | Height: | Size: 2.6 MiB |
|
After Width: | Height: | Size: 5.1 MiB |
|
After Width: | Height: | Size: 2.5 MiB |
|
After Width: | Height: | Size: 4.1 MiB |
|
After Width: | Height: | Size: 5.1 MiB |
|
After Width: | Height: | Size: 6.8 MiB |
|
After Width: | Height: | Size: 5.0 MiB |
|
After Width: | Height: | Size: 2.7 MiB |
|
After Width: | Height: | Size: 3.3 MiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 851 KiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 2.6 MiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 902 KiB |
|
After Width: | Height: | Size: 2.3 MiB |
|
After Width: | Height: | Size: 2.7 MiB |
|
After Width: | Height: | Size: 10 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 3.3 MiB |
|
After Width: | Height: | Size: 10 MiB |
|
After Width: | Height: | Size: 1.9 MiB |
|
After Width: | Height: | Size: 10 MiB |
|
After Width: | Height: | Size: 14 MiB |
|
After Width: | Height: | Size: 12 MiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 4.7 MiB |
|
After Width: | Height: | Size: 1.8 MiB |
|
After Width: | Height: | Size: 4.0 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 4.0 MiB |
|
After Width: | Height: | Size: 3.1 MiB |
|
After Width: | Height: | Size: 3.6 MiB |
|
After Width: | Height: | Size: 4.2 MiB |
|
After Width: | Height: | Size: 3.7 MiB |
|
After Width: | Height: | Size: 7.7 MiB |
|
After Width: | Height: | Size: 7.3 MiB |
|
After Width: | Height: | Size: 8.3 MiB |
|
After Width: | Height: | Size: 7.6 MiB |
|
After Width: | Height: | Size: 4.4 MiB |
|
After Width: | Height: | Size: 3.5 MiB |
|
After Width: | Height: | Size: 3.8 MiB |
|
After Width: | Height: | Size: 4.1 MiB |
|
After Width: | Height: | Size: 166 KiB |
|
After Width: | Height: | Size: 239 KiB |
|
After Width: | Height: | Size: 3.8 MiB |
|
After Width: | Height: | Size: 3.9 MiB |
|
After Width: | Height: | Size: 4.6 MiB |
|
After Width: | Height: | Size: 4.2 MiB |
|
After Width: | Height: | Size: 4.2 MiB |
|
After Width: | Height: | Size: 4.3 MiB |
|
After Width: | Height: | Size: 4.4 MiB |
|
After Width: | Height: | Size: 4.4 MiB |
|
After Width: | Height: | Size: 6.4 MiB |
|
After Width: | Height: | Size: 7.9 MiB |
|
After Width: | Height: | Size: 8.9 MiB |
|
After Width: | Height: | Size: 8.7 MiB |
|
After Width: | Height: | Size: 7.8 MiB |
|
After Width: | Height: | Size: 5.9 MiB |
|
After Width: | Height: | Size: 9.2 MiB |
|
After Width: | Height: | Size: 4.2 MiB |