Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Typescript Projects

Sketch can be used to quickly generate Typescript monorepos and packages, and uses modular and extensible presets to define some reusable elements that can be shared among different kinds of typical TS projects.

These are the top level configuration settings for Typescript projects, with their default values:

# yaml-language-server: $schema=../../schemas/latest.json

typescript:
  # Convert `latest` to a version range for dependencies
  no_convert_latest_to_range: false

  # Use this kind of version range when converting from `latest`
  version_range: patch

  # Do not add default dependencies to new `package.json` files (typescript and oxlint, plus vitest if enabled)
  no_default_deps: false

  # Use the pnpm catalog for default dependencies
  catalog: false

  package_manager: pnpm

  # Configuration for the generated pnpm-workspace.yaml file
  pnpm_config:
    # All dirs listed here will be created automatically
    packages: ["packages/*"]

  # A map containing extensible package.json presets
  package_json_presets: {}

  # A map containing extensible package presets
  package_presets: {}

  # A map containing extensible tsconfig presets
  tsconfig_presets: {}

  # A map of contributors and maintainers, which can be referred to
  # in package.json presets with their ID
  people: {}

  # The configuration for the root package
  # (only relevant when creating a monorepo)
  root_package: null