Skip to content

Latest commit

History

History
83 lines (55 loc) 路 2.72 KB

DEVELOPMENT.md

File metadata and controls

83 lines (55 loc) 路 2.72 KB

Development

After forking the repo from GitHub and installing pnpm:

git clone https://github.com/<your-name-here>/emoji-blast
cd emoji-blast
pnpm install

This repository includes a list of suggested VS Code extensions. It's a good idea to use VS Code and accept its suggestion to install them, as they'll help with development.

Building

Run TypeScript to build each project's files from its src/ directory into output files in its lib/ directory:

pnpm build

Add --watch to run the builder in a watch mode that continuously rebuilds as you save files:

pnpm build --watch

You should also see suggestions from TypeScript in your editor.

Individual Packages

Note that some individual packages also have their own build command. Each package build runs webpack to build source files from src/ into output files in dist/.

You can run them all from the root with:

pnpm build:all

See each package's .github/DEVELOPMENT.md for per-package building instructions.

Formatting

Prettier is used to format code. It should be applied automatically when you save files in VS Code or make a Git commit.

To manually reformat all files, you can run:

pnpm format --write

Linting

This package includes several forms of linting to enforce consistent code quality and styling. Each should be shown in VS Code, and can be run manually on the command-line:

  • pnpm lint (ESLint with typescript-eslint): Lints JavaScript and TypeScript source files
  • pnpm lint:knip (knip): Detects unused files, dependencies, and code exports
  • pnpm lint:md (Markdownlint): Checks Markdown source files
  • pnpm lint:packages (pnpm dedupe --check): Checks for unnecessarily duplicated packages in the pnpm-lock.yml file
  • pnpm lint:spelling (cspell): Spell checks across all source files

Testing

Vitest is used for tests. You can run it on the command-line:

pnpm run test

Add the --coverage flat to compute test coverage and place reports in the coverage/ directory:

pnpm run test --coverage

Debugging Tests

This repository includes a VS Code launch configuration for debugging unit tests. To launch it, open a test file, then run Debug Current Test File from the VS Code Debug panel (or press F5).