Skip to content

Commit 4e560d2

Browse files
authored
Initialize astro project (#1)
* Initialize Astro project with basic structure and assets - Added package.json for project dependencies and scripts. - Included favicon.svg for the site icon. - Added astro.svg and background.svg assets for branding and background. - Created Welcome component to serve as the main landing page. - Implemented Layout component for consistent HTML structure. - Set up index.astro as the entry point for the application. - Configured TypeScript with tsconfig.json for strict type checking. * Rename project from "absolute-ablation" to "chocomax" in package.json and package-lock.json * Refactor project structure: remove Welcome and Layout components, add Main layout and ProductCard component; integrate product listing from JSON data in index page. * Add Prettier for code formatting and update devcontainer settings * Remove Prettier installation from postStartCommand in devcontainer configuration * Update autoShowOutputPanel setting to show on error in Prettier configuration * Refactor ProductCard component structure and update index page layout for better organization and styling * Refactor ProductCard and Main layout styles for improved structure and consistency * Add Header and Footer components, update Main layout for improved structure and styling * Fix title formatting in Main layout and adjust product list styling for consistency * Update package-lock.json to reflect dependency version upgrades * Refactor permissions structure in workflow files for consistency and clarity * Add global CSS styles for consistent layout and design * Add global CSS import and refactor spacing variables for consistency across components * Refactor Header and ProductCard components for improved styling consistency * Refactor code structure for improved readability and maintainability * Refactor Header and ProductCard components for improved layout and styling consistency; add Icon component for SVG icons * Update astro.config.mjs to define output format as 'static' * Update astro.config.mjs to include a trailing comma; update oniguruma-to-es package version to 4.3.1 * Update devcontainer-verification.yml to use the correct repository for docker-image-verification; remove obsolete docker-image-verification.yml file * Refactor global.css to improve comments for spacing and border-radius variables * Update super-linter.yml to refine FILTER_REGEX_EXCLUDE for better linting control * Refactor devcontainer-verification.yml to adjust permissions for actions and security-events * Add GitHub Actions workflow for deploying static content to GitHub Pages * Update ProductCard.astro to enhance background color for better contrast * Add Vite server configuration for file watching in astro.config.mjs * Fix formatting in astro.config.mjs for better readability
1 parent d34b29c commit 4e560d2

40 files changed

+5372
-68
lines changed

.devcontainer/Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
FROM alpine:latest
22

33
# Install common tools
4-
RUN apk add --no-cache bash git
4+
RUN apk add --no-cache bash git \
5+
nodejs npm
56

67
# Setup default user
78
ARG USERNAME=vscode

.devcontainer/devcontainer.json

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,18 @@
11
{
2-
"name": "Template Development Container",
2+
"name": "ChocoMax Prototype Development Container",
33
"dockerFile": "Dockerfile",
44
"customizations": {
55
"settings": {
66
"terminal.integrated.shell.linux": "/bin/bash"
7+
},
8+
"vscode": {
9+
"extensions": [
10+
"esbenp.prettier-vscode",
11+
"astro-build.astro-vscode",
12+
"emeraldwalk.RunOnSave"
13+
]
714
}
815
},
16+
"postStartCommand": "npm update && npm install && npx prettier --write .",
917
"remoteUser": "vscode"
1018
}

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: Deploy static content to Pages
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
10+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
17+
# Cancel any in-progress runs.
18+
concurrency:
19+
group: 'pages'
20+
cancel-in-progress: true
21+
22+
jobs:
23+
deploy:
24+
environment:
25+
name: github-pages
26+
url: ${{ steps.deployment.outputs.page_url }}
27+
runs-on: ubuntu-latest
28+
29+
steps:
30+
- name: Checkout repository
31+
uses: actions/checkout@v4
32+
33+
- name: Install Node.js
34+
uses: actions/setup-node@v4
35+
with:
36+
node-version: 22
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Build Astro site
42+
run: npm run build
43+
44+
- name: Setup Pages
45+
uses: actions/configure-pages@v5
46+
47+
- name: Upload artifact
48+
uses: actions/upload-pages-artifact@v3
49+
with:
50+
# Upload the build output directory
51+
path: './dist'
52+
53+
- name: Deploy to GitHub Pages
54+
id: deployment
55+
uses: actions/deploy-pages@v4

.github/workflows/devcontainer-verification.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Scan Devcontainer Image
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
branches:
@@ -11,11 +14,7 @@ jobs:
1114
scan-devcontainer:
1215
name: Scan Devcontainer Image
1316

14-
permissions:
15-
actions: read
16-
security-events: write
17-
18-
uses: <your-username>/<your-repo>/.github/workflows/docker-image-verification.yml@main
17+
uses: Vianpyro/Template/.github/workflows/docker-image-verification.yml@main
1918
with:
2019
image_name: devcontainer
2120
dockerfile_path: ./Dockerfile

.github/workflows/docker-image-verification.yml

Lines changed: 0 additions & 52 deletions
This file was deleted.

.github/workflows/super-linter.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
---
22
name: Lint
33

4+
permissions:
5+
contents: read
6+
packages: read
7+
statuses: write
8+
49
on:
510
push:
611
branches:
712
- main
813
- master
914
pull_request: null
1015

11-
permissions: {}
12-
1316
jobs:
1417
build:
1518
name: Lint
1619
runs-on: ubuntu-latest
1720

18-
permissions:
19-
contents: read
20-
packages: read
21-
statuses: write
22-
2321
steps:
2422
- name: Checkout code
2523
uses: actions/checkout@v4
@@ -31,3 +29,4 @@ jobs:
3129
env:
3230
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3331
VALIDATE_ALL_CODEBASE: false
32+
FILTER_REGEX_EXCLUDE: '(.devcontainer/Dockerfile|.github/pull_request_template.md|.github/ISSUE_TEMPLATE/*.md)'

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,27 @@
1+
# Environment variables
12
.env
3+
4+
# build output
5+
dist/
6+
7+
# generated types
8+
.astro/
9+
10+
# dependencies
11+
node_modules/
12+
13+
# logs
14+
npm-debug.log*
15+
yarn-debug.log*
16+
yarn-error.log*
17+
pnpm-debug.log*
18+
19+
# environment variables
20+
.env
21+
.env.production
22+
23+
# macOS-specific files
24+
.DS_Store
25+
26+
# jetbrains setting folder
27+
.idea/

.vscode/extensions.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"recommendations": ["astro-build.astro-vscode"],
3+
"unwantedRecommendations": []
4+
}

.vscode/launch.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"command": "./node_modules/.bin/astro dev",
6+
"name": "Development server",
7+
"request": "launch",
8+
"type": "node-terminal"
9+
}
10+
]
11+
}

0 commit comments

Comments
 (0)