GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - aspect-build/rules_ts: Bazel rules for the `tsc` compiler from http://typescriptlang.org

BranchesTags
Open more actions menu

Latest commit

 

History

709 Commits
709 Commits

Folders and files

NameName
Last commit message
Last commit date
.aspect
.aspect
 
 
.bcr
.bcr
 
 
.github/workflows
.github/workflows
 
 
.vscode
.vscode
 
 
docs
docs
 
 
e2e
e2e
 
 
examples
examples
 
 
tools
tools
 
 
ts
ts
 
 
.bazelignore
.bazelignore
 
 
.bazelrc
.bazelrc
 
 
.bazelversion
.bazelversion
 
 
.gitattributes
.gitattributes
 
 
.gitignore
.gitignore
 
 
.npmrc
.npmrc
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
.prettierignore
.prettierignore
 
 
.prettierrc
.prettierrc
 
 
BUILD.bazel
BUILD.bazel
 
 
CONTRIBUTING.md
CONTRIBUTING.md
 
 
LICENSE
LICENSE
 
 
MODULE.bazel
MODULE.bazel
 
 
MODULE.bazel.lock
MODULE.bazel.lock
 
 
README.md
README.md
 
 
renovate.json
renovate.json
 
 

Repository files navigation

Bazel rules for TypeScript

Note

This repository uses the Aspect CLI for CI and local development. See the docs and install instructions to get started.

This is the canonical ruleset for using Bazel with TypeScript, based on https://github.com/aspect-build/rules_js.

Many companies are successfully building with rules_ts. If you're getting value from the project, please let us know! Just comment on our Adoption Discussion.

rules_ts is just a part of what Aspect provides:

  • Need help? This ruleset has support provided by https://aspect.build/services.
  • See our other Bazel rules, especially those built for rules_js, linked from https://github.com/aspect-build

Installation

Follow instructions from the release you wish to use: https://github.com/aspect-build/rules_ts/releases

Examples

There are a number of examples in the examples/ folder and larger examples in the bazel-examples repository using rules_ts such as jest, react, angular.

If you'd like an example added, you can fund a Feature Request.

Usage

See the API documentation in the docs/ folder.

From a BUILD file

The most common use is with the ts_project macro which invokes a transpiler you configure to transform source files like .ts files into outputs such as .js and .js.map, and the tsc CLI to type-check the program and produce .d.ts files.

In a macro

Many organizations set default values, so it's common to write a macro to wrap ts_project, then ensure that your developers load your macro rather than loading from @aspect_rules_ts directly.

BUILD file generation

Aspect provides a TypeScript BUILD file generator as part of the Aspect CLI. Run aspect configure to create or update BUILD.bazel files as you edit TypeScript sources. See https://docs.aspect.build/cli/commands/aspect_configure.

Advanced: custom rules

If you know how to write Bazel rules, you might find that ts_project doesn't do what you want.

One way to customize it is to peel off one layer of indirection, by calling the ts_project_rule directly. This bypasses our default setting logic, and also the validation program which checks that ts_project attributes are well-formed.

You can also write a custom rule from scratch. We expose helper functions from /ts/private in this repo. Be aware that these are not a public API, so you may have to account for breaking changes which aren't subject to our usual semver policy.

About

Bazel rules for the `tsc` compiler from http://typescriptlang.org

Topics

bazelbazel-rulestypescript

Resources

Readme
Apache-2.0 license

Code of conduct

Code of conduct

Contributing

Contributing
Activity
Custom properties

Stars

140 stars

Watchers

6 watching

Forks

91 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

Generated from bazel-contrib/rules-template
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.