setup.ts

Quick Start

The following guide will get you up and running as quickly as possible, while also teaching you the fundamentals of setup.ts

The following examples will use pnpm as a package manager, but yarn and npm are also supported!

Project setup

Create a directory

First we create our project directory and initialize a new project inside

mkdir setup-starter
cd setup-starter
pnpm init

Installing setup.ts

Next we will install setup.ts as a dev-dependency.

pnpm install -D @setup.ts/setup

Running setup.ts

@setup.ts/setup ships with a useful CLI tool. You can access it via pnpm setup.ts ... or npx setup.ts ... when using NPM.

There are two commands you should know:

Getting a setup.ts file

In your project directory run:

pnpm setup.ts generate

This will create a setup.ts file in your project directory with the contents of your package.json file.

You should see that a setup.ts file has been created that should look something like this

import { defineSetup } from "@setup.ts/setup";

export default defineSetup({
  name: "setup-starter",
  version: "1.0.0",
  description: "",
  main: "index.js",
  scripts: {
    test: 'echo "Error: no test specified" && exit 1',
  },
  keywords: [],
  author: "",
  license: "ISC",
  dependencies: {
    "@setup.ts/setup": "...",
  },
});

Closing Words

Now you are basically ready to go! You can now freely edit your setup.ts file and run setup.ts run to compile your project.

Make sure to check out the docs for more advanced usage and plugins.