Skip to content

Latest commit

 

History

History
100 lines (65 loc) · 2.05 KB

CONTRIBUTING.md

File metadata and controls

100 lines (65 loc) · 2.05 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

Run only the tests of one example/boilerplate:

cd examples/some-example/ && pnpm exec test-e2e
# Altenertively: provide a substring of the path
pnpm exec test-e2e ome-exampl # At the monorepo root

On Debian, these additional steps are required.


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/
# 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.