Skip to content

Latest commit

 

History

History
139 lines (95 loc) · 2.59 KB

CONTRIBUTING.md

File metadata and controls

139 lines (95 loc) · 2.59 KB

How to contribute


System requirements

These requirements are only needed for developing the source code of Vike. The npm package vike can be used with Windows and with any package manager.

  • Node.js >= v16.0.0.
  • pnpm.

    Install it with $ npm install -g pnpm.

  • Unix (e.g. Linux or macOS).

    Windows may work but there are no guarantees.


Basics

Install

Download and install the entire monorepo:

git clone [email protected]:vikejs/vike
# Go to the monorepo root
cd vike/
pnpm install

Build & Dev

Build Vike's source code:

# At the monorepo root
pnpm run build

Develop vike:

# At the monorepo root
pnpm run dev

Run tests

# At the monorepo root

# Run the end-to-end tests (`/**/*.test.js`)
pnpm exec test-e2e
# Run the unit tests (`/**/*.spec.js`)
pnpm exec vitest
# Typecheck all `.ts` files
pnpm exec test-types

On Debian, these additional steps are required.

Run only the tests of one example/boilerplate:

cd examples/some-example/ # From the monorepo root
pnpm exec test-e2e

Alternatively:

# At the monorepo root
pnpm exec test-e2e ome-exampl

Create new example

New examples should be minimal and implement only what you want to showcase.


Modify existing example

Follow the setup instructions at Basics.

The README instructions of examples use npm. We use pnpm instead if we want to install the entire monorepo and build & link Vike's source code.

To run the example:

cd examples/some-example/ # From the monorepo root
# See package.json#scripts, e.g. package.json#scripts['dev']:
pnpm run dev

Check whether the tests defined in examples/some-example/*.spec.ts are still valid and make changes accordingly. See Basics for how to run the example's tests.


Docs

To develop Vike's documentation (https://vike.dev):

  1. Download and install the entire monorepo:

    git clone [email protected]:vikejs/vike
    # Go to the monorepo root
    cd vike/
    pnpm install
  2. Build Vike:

    # At the monorepo root
    pnpm run build
  3. Develop Vike's docs:

    cd docs/ # From the monorepo root
    pnpm run dev

    Or build Vike's docs:

    cd docs/ # From the monorepo root
    pnpm run build