Skip to content

[Package Management Rules for PNPM] - pierwszy szkic zasad #34

@klimekszymon

Description

@klimekszymon

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:
    save-exact=true
    

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions