From 24d324743517f477d3f8cde2a51e380d1e6bed30 Mon Sep 17 00:00:00 2001 From: jkomyno Date: Mon, 16 Sep 2024 12:25:45 +0200 Subject: [PATCH] feat(scaffolding): update README --- README.md | 14 ++++++-------- package.json | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 01e3a5f..972a6cb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Github Actions](https://github.com/jkomyno/pnpm-monorepo-example/actions/workflows/ci.yaml/badge.svg?branch=master)](https://github.com/jkomyno/pnpm-monorepo-example/actions/workflows/ci.yaml) -> Practical example of a `TypeScript` monorepo with [`pnpm`](https://pnpm.io), [`turborepo`](https://turborepo.org), and [`jest`](https://jestjs.io). +> Practical example of a `TypeScript` monorepo with [`pnpm`](https://pnpm.io), [`turborepo`](https://turborepo.org), and [`vitest`](https://vitest.dev/). --------------------------------------------- @@ -11,18 +11,18 @@ - `pnpm` workspace, whose configuration is stored in [`pnpm-workspace.yaml`](/pnpm-workspace.yaml). Two example packages are included, [`common-utils`](packages/common-utils) and [`example`](packages/example), with the latter importing `common-utils` as a dependency. All local packages are decorated with a `@jkomyno/*` scope (you may want to substitute these instances in the `name` entries of any `package.json` with yours or your company's name). - `turborepo`, whose configuration is stored in [`turbo.json`](./turbo.json) - an example [`Dockerfile`](./Dockerfile.pnpm) that can be built and used as a base image for your Node.js Docker containers. -- the `jest` test engine, whose configuration is stored in the [`packages/jest`](./packages/jest) folder. -- opinionated [`prettier`](https://prettier.io) and [`eslint`](https://eslint.org) setups. +- the `vitest` test engine, whose configuration is stored in [`vitest.workspace.ts`](./vitest.workspace.ts). +- opinionated linting setups via [`biome`](https://biomejs.dev/), whose configuration is defined in the [`biome.jsonc`](./biome.jsonc) file. ## Available Scripts - `pnpm install`: install the dependencies needed for each package. - `pnpm build`: transpile the local TypeScript packages to JavaScript. -- `pnpm lint:ci`: check that the code follows the `eslint` guidelines. -- `pnpm prettier-check`: check that the code follows the `prettier` guidelines. -- `pnpm prettier-write`: override the code to follow the `prettier` guidelines. +- `pnpm lint:ci`: check that the code follows the `biome` guidelines. +- `pnpm lint`: check that the code follows the `biome` guidelines, and override it to follow them if possible. - `pnpm test:unit`: run unit tests. - `pnpm test:integration`: run integration tests. +- `pnpm test`: run all tests. ## Test Structure @@ -31,8 +31,6 @@ All tests should be written in the `__tests__` directory of a local package. Moreover, unit tests should be placed in the `__tests__/unit` folder; similarly, integration tests should be placed in the `__tests__/integration` folder. This allows for easily running groups of tests (for instance, you might want to run unit tests locally, while deferring integration tests - that will probably need access to external services like Docker containers - to the CI only). -In each local package's `package.json` file, make sure to replace the `JEST_LIB_UNDER_TEST` environment variable declaration with the local package name, for each `test*` command in the `scripts` section. - ## FAQ 1. How do I add a new package to the local workspace? diff --git a/package.json b/package.json index e31479e..05dcee1 100644 --- a/package.json +++ b/package.json @@ -31,6 +31,6 @@ "packageManager": "pnpm@8.15.0", "pre-commit": "lint-staged", "lint-staged": { - "*.{js,ts,cjs,mjs,md,json,jsonc}": "biome ci" + "*.{js,ts,cjs,mjs,md,json,jsonc}": "biome ci --no-errors-on-unmatched" } }