Skip to content

Instantly share code, notes, and snippets.

View mattem's full-sized avatar

Matt Mackay mattem

View GitHub Profile
@mattem
mattem / stub.tpl.py
Created January 31, 2022 14:27
Stub Python interpreter launcher template for multiple interpreter support under bazel
#! /usr/bin/env python3
import os
import sys
from bazel_tools.tools.python.runfiles import runfiles
DEFAULT_PYTHON_FLAGS = ["-B", "-s"]
ARGV = sys.argv[1:]
@mattem
mattem / karma.conf.js
Created October 16, 2020 18:30
karma web tests with Chrome and ChromeHeadless with bazel
// THIS FILE IS AUTO GENERATED BY TEMPL_TARGET
// DO NOT EDIT
const path = require('path');
const child_process = require('child_process');
const runfiles = require(process.env.BAZEL_NODE_RUNFILES_HELPER);
/**
* Helper function to find a particular namedFile
@mattem
mattem / es_build.bzl
Created September 5, 2020 23:01
bazel rule for using esbuild to generate a single bundle. Include quick repo rule for fetching the esbuild binary (not complete)
load("@build_bazel_rules_nodejs//:providers.bzl", "JSEcmaScriptModuleInfo", "JSModuleInfo", "NpmPackageInfo", "node_modules_aspect")
load("@build_bazel_rules_nodejs//internal/linker:link_node_modules.bzl", "module_mappings_aspect")
def _strip_ext(f):
return f.short_path[:-len(f.extension) - 1]
def _resolve_js_input(f, inputs):
if f.extension == "js" or f.extension == "mjs":
return f
@mattem
mattem / rules_nodejs_1_6_1.patch
Created May 18, 2020 21:00
rules_nodejs patch for stardoc generation
diff --git a/BUILD.bazel b/BUILD.bazel
index 6486cc5..b898b6d 100755
--- BUILD.bazel
+++ BUILD.bazel
@@ -13,8 +13,8 @@
# limitations under the License.
# bazel_skylib mocked out
-# load("@bazel_skylib//:bzl_library.bzl", "bzl_library")
-load("@build_bazel_rules_nodejs//:index.bzl", bzl_library = "dummy_bzl_library")
+load("@bazel_skylib//:bzl_library.bzl", "bzl_library")