Skip to content

Instantly share code, notes, and snippets.

View alexeagle's full-sized avatar
🌿
Making a better Bazel

Alex Eagle alexeagle

🌿
Making a better Bazel
View GitHub Profile
"""
Read a poetry lock file and convert to a bazel dependency graph,
then write BUILD.bazel files for each installed dependency.
"""
import textwrap
import os
import re
import sys
readonly STATS_URL="http://pushgateway.domain:9091/metrics/job/livegrep_query_stats"
get_query () {
query=$1
# max_matches: -1 means no limit on number of matches
# NB: the query will have spaces in it, and appear as multiple argv to lg command,
# however it joins the argv residual on space again
matches=$(/livegrep/bin/lg -server http://0.0.0.0:8000 'max_matches:-1' $query | wc -l)
# Produce output that we can pipe to the pushgateway
# see https://github.com/prometheus/pushgateway/blob/master/README.md#command-line
--- angular/.github/CODEOWNERS.scrubbed
+++ angular/.github/codeowners.gen
@@ -1 +0,0 @@
-* @IgorMinar @angular/framework-global-approvers
@@ -3,284 +1,0 @@
-/packages/platform-browser/animations/** @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
-/aio/content/guide/animations.md @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
-/aio/content/examples/animations/** @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
-/aio/content/images/guide/animations/** @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
-/aio/content/guide/complex-animation-sequences.md @angular/fw-animations @angular/framework-global-approvers @angular/framework-global-approvers-for-docs-only-changes
load("@npm_bazel_rollup//:index.bzl", "rollup_bundle")
load("@npm_bazel_terser//:index.bzl", "terser_minified")
load("@npm//@babel/cli:index.bzl", "babel")
# TODO(alexeagle): promote web_package rule to the public API
load("@build_bazel_rules_nodejs//internal/web_package:web_package.bzl", "web_package")
def differential_loading(name, entry_point, srcs):
"Common workflow to serve native ESModules to modern browsers"
rollup_bundle(
execroot/angular/external/npm/node_modules/@types/hammerjs/index.d.ts
execroot/angular/external/npm/node_modules/zone.js/dist/zone.js.d.ts
execroot/angular/external/npm/node_modules/tslib/tslib.d.ts
execroot/angular/external/npm/node_modules/typescript/lib/protocol.d.ts
execroot/angular/external/npm/node_modules/typescript/lib/tsserverlibrary.d.ts
execroot/angular/external/npm/node_modules/typescript/lib/typescript.d.ts
execroot/angular/external/npm/node_modules/typescript/lib/typescriptServices.d.ts
execroot/angular/packages/goog.d.ts
execroot/angular/packages/system.d.ts
execroot/angular/packages/types.d.ts
(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
var v = factory(require, exports);
if (v !== undefined) module.exports = v;
}
else if (typeof define === "function" && define.amd) {
define("angular_bazel_example/src/app.component.ngfactory", ["require", "exports", "@angular/core", "@angular/material/toolbar/typings/index.ngfactory", "@angular/common", "@angular/router", "angular_bazel_example/src/app.component"], factory);
}
})(function (require, exports) {
"use strict";

TypeScript rules for Bazel

WARNING: this is beta-quality software. Breaking changes are likely. Not recommended for production use without expert support.

The TypeScript rules integrate the TypeScript compiler with Bazel.

Looking for Karma rules ts_web_test and karma_web_test? These are now documented in the README at http://npmjs.com/package/@bazel/karma

<!doctype html>
<title>webtreemap</title>
<style>
body {
font-family: sans-serif;
}
#treemap {
width: 800px;
height: 600px;
}
/**
* @fileoverview
* @enhanceable
* @suppress {messageConventions} JS Compiler reports an error if a variable or
* field starts with 'MSG_' and isn't a translatable message.
* @public
*/
// GENERATED CODE -- DO NOT EDIT!
var jspb = require('google-protobuf');

Proposal: ts.DiagnosticPlugin and tswarn

The Angular team owns a couple of tools that would like to extend the diagnostics produced by the TypeScript compiler:

  • tsetse is our set of third-party --strict checks. So far, these are wired into our custom Bazel tsc compiler, tsc_wrapped, and they produce only Severity.ERROR diagnostics. See http://tsetse.info

  • Angular Ivy is a new rendering engine for Angular, and it allows a simpler compiler pipeline which we hope can fit entirely within tsc given a plugin model for producing extra diagnostics (such as semantic or type errors within Angular template