Project Commands
Relevant source files
The following files were used as context for generating this wiki page:The Quant project utilizes pnpm as its package manager and provides a set of scripts to manage the development lifecycle. These commands, defined in package.json, are primarily wrappers around the Astro CLI, which is the underlying web framework for the project. The commands cover dependency installation, starting the local development server, building the application for production, and previewing the production build.
The project is built with Astro and uses React for UI components, as indicated by the dependencies in package.json. The command-line tools facilitate a standard workflow for developers working within this technology stack.
Sources: README.md:108-126, package.json:5-10
Command Overview
The primary commands for interacting with the project are run from the root directory using pnpm.
| Command | Action | Source Script |
|---|---|---|
pnpm install | Installs all project dependencies using pnpm. | N/A (Standard pnpm command) |
pnpm dev | Starts the local development server at localhost:4321. | "dev": "astro dev" |
pnpm build | Builds the production-ready site into the ./dist/ directory. | "build": "astro build" |
pnpm preview | Previews the local production build before deployment. | "preview": "astro preview" |
pnpm astro ... | Provides direct access to run Astro CLI commands. | "astro": "astro" |
pnpm lint | Runs ESLint and other code quality checks. | N/A (Mentioned in README.md but not in package.json scripts) |
Sources: README.md:120-126, package.json:5-10
Development Workflow
The commands facilitate a standard development-to-production workflow. A developer typically starts by installing dependencies, then runs the development server for real-time feedback, and finally builds and previews the application before deployment.
This diagram illustrates the typical developer workflow using the project's commands.
Sources: README.md:108-126
Script Definitions
The project's commands are defined in the scripts section of the package.json file. These scripts are aliases for commands provided by the Astro framework. The complexity of the application, including the detailed CVSS scoring logic, is managed through this standardized build process.
Sources: src/lib/cvss/v3/scoring.ts, src/lib/cvss/v4/scoring.ts
Key Scripts from package.json
"scripts": {
"dev": "astro dev",
"build": "astro build",
"preview": "astro preview",
"astro": "astro"
},
Source: package.json:5-10
dev: This command executesastro dev, which starts the Astro development server. It provides features like Hot Module Replacement (HMR) for a fast and efficient development experience. The server is accessible athttp://localhost:4321by default.
Sources: README.md:117, package.json:6build: This command runsastro build. It compiles and optimizes the Astro, React, and TypeScript code into static assets suitable for production deployment. The output is placed in the./dist/directory.
Sources: README.md:122, package.json:7, src/components/CVSSCalculator.tsxpreview: After a production build,pnpm preview(which runsastro preview) starts a simple local server to serve the contents of the./dist/directory. This allows for a final check of the production build before it goes live.
Sources: README.md:123, package.json:8astro: This script provides a direct pass-through to the Astro CLI, allowing developers to run any Astro command (e.g.,pnpm astro check) without needing to install Astro globally or reference it fromnode_modules.
Sources: README.md:124, package.json:9
Technology Stack Context
The commands are built upon the project's technology stack. The following diagram shows the relationship between the package manager, the core framework, and the commands.
This diagram shows how pnpm uses scripts to interact with the Astro framework.
Sources: package.json:11-36