Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
15 commits
Select commit Hold shift + click to select a range
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
10 changes: 8 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
{
"name": "Aspire.Dev",
"image": "mcr.microsoft.com/devcontainers/javascript-node:1-22-bookworm",
"features": {
"ghcr.io/devcontainers-extra/features/pnpm:2": {
"version": "10.25.0"
}
},
"customizations": {
"vscode": {
"extensions": [
"astro-build.astro-vscode"
"astro-build.astro-vscode",
"unifiedjs.vscode-mdx"
],
"settings": {
"terminal.integrated.defaultProfile.linux": "bash"
Expand All @@ -18,6 +24,6 @@
"onAutoForward": "openBrowser"
}
},
"postCreateCommand": "npm install && echo '\n✨ Ready to go! Run \"npm run dev\" to start the dev server.\n'",
"postCreateCommand": "pnpm install && echo '\n✨ Ready to go! Run \"pnpm dev\" to start the dev server.\n'",
"remoteUser": "node"
}
19 changes: 11 additions & 8 deletions .github/workflows/dependency-updates.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,32 @@ jobs:
update-integration-data:
name: Update Integration Data
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/frontend

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

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

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
cache: "npm"
cache-dependency-path: "src/frontend/package-lock.json"
cache: pnpm
cache-dependency-path: src/frontend/pnpm-lock.yaml

- name: Install dependencies
run: |
cd src/frontend
npm ci
run: pnpm install --frozen-lockfile

- name: Update integration data
run: |
cd src/frontend
npm run update:all
run: pnpm update:all

- name: Check for changes
id: verify-changed-files
Expand Down
19 changes: 13 additions & 6 deletions .github/workflows/frontend-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,32 +16,39 @@ jobs:
build:
name: Frontend Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/frontend
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: npm
cache-dependency-path: src/frontend/package-lock.json
cache: pnpm
cache-dependency-path: src/frontend/pnpm-lock.yaml

- name: Install deps
run: cd src/frontend && npm ci
run: pnpm install --frozen-lockfile

- name: Build frontend
env:
MODE: production
run: cd src/frontend && npm run build:production
run: pnpm build:production

- name: Check dist
run: |
if [ ! -d "src/frontend/dist" ]; then
if [ ! -d "dist" ]; then
echo "Frontend build failed - dist directory not found"
exit 1
fi
ls -la src/frontend/dist
ls -la dist

- name: Upload artifact
if: ${{ always() }}
Expand Down
20 changes: 14 additions & 6 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,43 @@ permissions:
jobs:
integration:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/frontend
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: npm
cache-dependency-path: src/frontend/package-lock.json
cache: pnpm
cache-dependency-path: src/frontend/pnpm-lock.yaml

- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Install frontend deps
run: cd src/frontend && npm ci
run: pnpm install --frozen-lockfile

- name: Build frontend
env:
MODE: production
run: cd src/frontend && npm run build:production
run: pnpm build:production

- name: Build AppHost
run: cd src/apphost/Aspire.Dev.AppHost && dotnet build --configuration Release
working-directory: src/apphost/Aspire.Dev.AppHost
run: dotnet build --configuration Release

- name: Validate frontend index
run: |
if [ ! -f "src/frontend/dist/index.html" ]; then
if [ ! -f "dist/index.html" ]; then
echo "Frontend build incomplete - index.html not found"
exit 1
fi
Expand Down
24 changes: 17 additions & 7 deletions .github/workflows/lint-validate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,33 +13,43 @@ permissions:
jobs:
lint_validate:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/frontend
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

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

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: npm
cache-dependency-path: src/frontend/package-lock.json
cache: pnpm
cache-dependency-path: src/frontend/pnpm-lock.yaml

- name: Install deps
run: cd src/frontend && npm ci
run: pnpm install --frozen-lockfile

- name: Run ESLint
run: pnpm lint

- name: Astro type check
run: cd src/frontend && npx astro check | tee ../astro-check.txt
run: npx astro check | tee astro-check.txt

- name: Astro config dry run
run: cd src/frontend && npx astro build --dry-run | tee ../astro-dry-run.txt || echo "Dry run validation completed"
run: npx astro build --dry-run | tee astro-dry-run.txt || echo "Dry run validation completed"

- name: Upload lint/validate artifacts
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: lint-validate-results
path: |
src/astro-check.txt
src/astro-dry-run.txt
src/frontend/astro-check.txt
src/frontend/astro-dry-run.txt
if-no-files-found: warn
retention-days: 7
24 changes: 16 additions & 8 deletions .github/workflows/security-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,39 @@ on:
jobs:
security:
runs-on: ubuntu-latest
defaults:
run:
working-directory: src/frontend
permissions:
contents: read
security-events: write
steps:
- uses: actions/checkout@v4

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

- uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node_version }}
cache: npm
cache-dependency-path: src/frontend/package-lock.json
cache: pnpm
cache-dependency-path: src/frontend/pnpm-lock.yaml

- name: Install frontend deps
run: cd src/frontend && npm ci
run: pnpm install --frozen-lockfile

- name: Run npm audit
run: cd src/frontend && npm audit --audit-level=moderate | tee ../npm-audit.txt
- name: Run pnpm audit
run: pnpm audit --audit-level=moderate | tee pnpm-audit.txt
continue-on-error: true

- uses: actions/setup-dotnet@v4
with:
global-json-file: global.json

- name: Run .NET security scan
run: cd src/apphost/Aspire.Dev.AppHost && dotnet list package --vulnerable --include-transitive | tee ../../dotnet-vulnerabilities.txt
working-directory: src/apphost/Aspire.Dev.AppHost
run: dotnet list package --vulnerable --include-transitive | tee ../../../src/frontend/dotnet-vulnerabilities.txt
continue-on-error: true

- name: Trivy filesystem vulnerability scan (SARIF)
Expand Down Expand Up @@ -62,7 +70,7 @@ jobs:
name: security-scan-results
path: |
trivy-results.sarif
src/npm-audit.txt
src/dotnet-vulnerabilities.txt
src/frontend/pnpm-audit.txt
src/frontend/dotnet-vulnerabilities.txt
if-no-files-found: warn
retention-days: 7
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ yarn-debug.log*
yarn-error.log*
pnpm-debug.log*

# pnpm
.pnpm-store/
.pnpm-debug.log

# User-specific files (MonoDevelop/Xamarin Studio)
*.userprefs

Expand Down
3 changes: 1 addition & 2 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"recommendations": [
"astro-build.astro-vscode",
"unifiedjs.vscode-mdx",
"hideoo.starlight-i18n"
"unifiedjs.vscode-mdx"
],
"unwantedRecommendations": []
}
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"prettier.documentSelectors": [
"**/*.astro"
],
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
11 changes: 0 additions & 11 deletions package-lock.json

This file was deleted.

12 changes: 7 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,12 @@
"private": true,
"description": "Root-level package.json delegating to src/frontend.",
"scripts": {
"install": "cd src/frontend && npm i",
"dev": "cd src/frontend && npm run dev",
"build": "cd src/frontend && npm run build",
"preview": "cd src/frontend && npm run preview",
"update:all": "cd src/frontend && npm run update:all"
"install": "cd src/frontend && pnpm i",
"dev": "cd src/frontend && pnpm dev",
"build": "cd src/frontend && pnpm build",
"preview": "cd src/frontend && pnpm preview",
"lint": "cd src/frontend && pnpm lint",
"format": "cd src/frontend && pnpm format",
"update:all": "cd src/frontend && pnpm update:all"
}
}
9 changes: 9 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/apphost/Aspire.Dev.AppHost/AppHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
{
// For local development: Use ViteApp for hot reload and development experience
builder.AddViteApp("frontend", "../../frontend")
.WithPnpm()
.WithUrlForEndpoint("http", static url => url.DisplayText = "aspire.dev (Local)")
.WithExternalHttpEndpoints();
}
Expand Down
10 changes: 10 additions & 0 deletions src/frontend/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Deep Directories
**/node_modules

# Generated Directories
**/dist
**/build
**/.astro

# GitHub Actions workflow files
.github/workflows/*.yml
27 changes: 27 additions & 0 deletions src/frontend/.prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"printWidth": 100,
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5",
"useTabs": false,
"endOfLine": "lf",
"plugins": [
"prettier-plugin-astro",
"./src/prettier-plugins/prettier-plugin-starlight-steps.mjs"
],
"overrides": [
{
"files": "*.astro",
"options": {
"parser": "astro"
}
},
{
"files": ["*.md", "*.mdx"],
"options": {
"printWidth": 80
}
}
]
}
Loading
Loading