Dodam że pracuje póki co tylko z VsCode i weszły nowe funkcje związane z MCP. Skłoniło mnie to do nakreślenia kontekstu dla agenta że używam pnpm, a nie npm w projekcie. Oto one:
Project Commands Explanation
Scripts in package.json
Development Commands
pnpm dev: Starts the Vite development server for local development. Automatically rebuilds and reloads the app on file changes.
pnpm build: Builds the project for production using Vite. Outputs optimized static assets to the dist directory.
pnpm preview: Serves the production build locally for testing. Useful for verifying the build before deployment.
Linting and Code Quality
pnpm lint: Runs ESLint to check for code quality issues and automatically fixes them where possible. Ignores files specified in .gitignore.
Updated Project Package Management Rules
Dependency Management
- Use
pnpm for all dependency management tasks:
- Install dependencies:
pnpm install
- Add a new dependency:
pnpm add <package-name>
- Add a dev dependency:
pnpm add -D <package-name>
- Remove a dependency:
pnpm remove <package-name>
Lockfile Management
- Always commit the
pnpm-lock.yaml file to version control to ensure consistent dependency resolution across environments.
Security
- Use
pnpm audit to check for vulnerabilities in dependencies and address them promptly.
Versioning
- Add the following to
.npmrc to ensure exact versions are installed:
CI/CD Optimization
- Use
pnpm install --frozen-lockfile in CI/CD pipelines to ensure consistent builds.
Dependency Tree Optimization
- Run
pnpm dedupe periodically to optimize the dependency tree and reduce duplication.
Scripts Update
- Ensure all scripts in
package.json use pnpm commands:
"scripts": {
"install": "pnpm install",
"dev": "pnpm dev",
"build": "pnpm build",
"lint": "pnpm lint"
}
Documentation
- Update the README file to include instructions for using
pnpm in the project.
Environment Variables
- Store sensitive data and configuration in a
.env file and load it using dotenv or similar tools.
Dodam że pracuje póki co tylko z VsCode i weszły nowe funkcje związane z MCP. Skłoniło mnie to do nakreślenia kontekstu dla agenta że używam pnpm, a nie npm w projekcie. Oto one:
Project Commands Explanation
Scripts in
package.jsonDevelopment Commands
pnpm dev: Starts the Vite development server for local development. Automatically rebuilds and reloads the app on file changes.pnpm build: Builds the project for production using Vite. Outputs optimized static assets to thedistdirectory.pnpm preview: Serves the production build locally for testing. Useful for verifying the build before deployment.Linting and Code Quality
pnpm lint: Runs ESLint to check for code quality issues and automatically fixes them where possible. Ignores files specified in.gitignore.Updated Project Package Management Rules
Dependency Management
pnpmfor all dependency management tasks:pnpm installpnpm add <package-name>pnpm add -D <package-name>pnpm remove <package-name>Lockfile Management
pnpm-lock.yamlfile to version control to ensure consistent dependency resolution across environments.Security
pnpm auditto check for vulnerabilities in dependencies and address them promptly.Versioning
.npmrcto ensure exact versions are installed:CI/CD Optimization
pnpm install --frozen-lockfilein CI/CD pipelines to ensure consistent builds.Dependency Tree Optimization
pnpm dedupeperiodically to optimize the dependency tree and reduce duplication.Scripts Update
package.jsonusepnpmcommands:Documentation
pnpmin the project.Environment Variables
.envfile and load it usingdotenvor similar tools.