Skip to content

Latest commit

 

History

History
87 lines (63 loc) · 2.28 KB

CONTRIBUTING.md

File metadata and controls

87 lines (63 loc) · 2.28 KB

Get started

1. Install

git clone git@github.com:vikejs/bati.git
cd bati # Go to the monorepo root
pnpm install

Note

See System requirements for how to install pnpm.

2. Build

Build Bati's source code:

pnpm build # At the monorepo root

Note

The build process works is divided into several phases:

  1. Compile packages necessary to compile boilerplates
  2. Compile and prepare every boilerplate (from boilerplates folder) individually
  3. Compile package/cli to generate the self-contained Bati CLI

Integrate a new feature

# At the monorepo root

pnpm run new-boilerplate <name_of_integration>
pnpm i

This will create a new folder in boilerplates/ folder. You can then check the boilerplates documentation, or take inspiration from existing ones.


Run tests

# At the monorepo root

# Run the unit tests /**/*.local.spec.ts
pnpm run test
# Run the end-to-end tests /packages/tests/tests/*.spec.ts
pnpm run test-e2e

Filter end-to-end tests:

# Run all e2e tests containing --solid and --authjs flags
pnpm run test-e2e --filter solid,authjs

Note

End-to-end tests run thanks to turborepo, which will cache tests results. This means that even when running the full end-to-end test suite, only changed tests/code will actually be executed.

Tip

Even with the help of turborepo, the end-to-end tests can take a lot of time. We therefore recommend the following:

  • Instead of running all end-to-end tests, run only the end-to-end tests of one example.
  • Instead of running all end-to-end tests locally, run them on GitHub: push your changes to your Bati fork (github.com/my-username/bati) and see the result of all end-to-end tests on the GitHub actions of your fork.

System requirements

Note

These requirements are only needed for developing the source code of Bati. @bati/cli itself can be used with Windows and with any package manager.

  • Node.js >=18.0.0
  • pnpm 9.4.0
  • Unix (Linux or macOS)

Note

To install pnpm run:

npm install -g pnpm

(Or see pnpm Docs > Installation for alternative methods.)