npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cc-ts/builder

v0.2.0

Published

A powerful bundler and build tool for ComputerCraft TypeScript projects. The builder helps you compile, bundle, and serve TypeScript code for ComputerCraft computers.

Downloads

68

Readme

@cc-ts/builder

A powerful bundler and build tool for ComputerCraft TypeScript projects. The builder helps you compile, bundle, and serve TypeScript code for ComputerCraft computers.

Features

  • 🎯 TypeScript to Lua compilation optimized for ComputerCraft
  • 📦 Smart bundling with dependency resolution
  • 🔍 Source map support for better debugging
  • 🚀 Development server for quick testing
  • ⚡ Watch mode for rapid development
  • 📑 Minimal Lua library generation per entrypoint
  • 🗜️ Optional minification

Getting Started

The easiest way to get started with CC-TS is to use our project creation tool:

bun create cc-ts my-project
# or
npm create cc-ts@latest my-project

This will guide you through creating a new project with two options:

  • Bundled App: A complete application that uses @cc-ts/builder for bundling and development
  • CC Library: A library project that can be published and used by other CC-TS projects

The creation tool will set up your project with the correct dependencies and configuration files.

For more information about creating new projects, check out the create-cc-ts package.

Installation

bun add -D @cc-ts/builder
# or
npm install --save-dev @cc-ts/builder

Usage

CLI

The builder can be used via its CLI command cc-ts:

cc-ts [options] [files...]

Configuration

Configure your project by adding a cc-ts section to your tsconfig.json:

{
    "compilerOptions": {
        // ... your TypeScript options
    },
    "tstl": {
        "luaTarget": "CC-5.2",
        "luaLibImport": "require-minimal",
        "buildMode": "default"
    },
    "cc-ts": {
        "minify": false,
        "builtInModules": [],
        "serve": false,
        "servePort": 8080
    }
}

CLI Options

  • -p, --project <path> - Path to tsconfig.json
  • --minify - Minify the output Lua code
  • --serve - Start a development server
  • --servePort <number> - Specify development server port (default: 8080)
  • --watch - Watch mode for development
  • --debug - Enable debug logging
  • -h, --help - Show help information
  • -v, --version - Show version information

Development Server

The builder includes a development server for testing your code. Enable it with:

cc-ts --serve

This will start a server (default port 8080) that serves your compiled Lua files.

Watch Mode

For development, you can use watch mode to automatically recompile on changes:

cc-ts --watch

Combine with serve for a complete development setup:

cc-ts --watch --serve

Package Scripts

Add these convenient scripts to your package.json:

{
    "scripts": {
        "build": "cc-ts",
        "dev": "cc-ts --watch --serve",
        "watch": "cc-ts --watch"
    }
}

Advanced Features

Built-in Modules

Specify built-in modules that should not be resolved and bundled:

{
    "cc-ts": {
        "builtInModules": ["fs", "http"]
    }
}

Minification

Enable minification for production builds:

{
    "cc-ts": {
        "minify": true
    }
}

Created and maintained by Jakob Helgesson.