Coder Social home page Coder Social logo

buildbuddy-nodejs-example's Introduction

Bazel / Node.js / React / TypeScript / BuildBuddy template

This repository serves as a starter project for a Node.js / React / TypeScript app built with Bazel and BuildBuddy.

Technologies used

  • Bazel: Build system built and maintained by Google that enables fast and correct builds

  • BuildBuddy: Makes Bazel even faster and more useful:

    • Allows cached artifacts to be shared across developer machines (remote Bazel cache)
    • Enables massively parallel remote build execution, by running build actions in the cloud instead of locally
    • Provides a Web UI to view and share your build logs, details, timing profile, and much more.
    • Automatically runs Bazel tests and reports the results to GitHub, so that branches can only be merged if tests pass.
  • rules_nodejs: Bazel rules for frontend projects.

  • TypeScript: A language that extends JavaScript with types.

  • React: A popular frontend framework for building modern Web apps.

  • nodejs: Allows building server-side apps with JavaScript. In this example, the backend is also written in TypeScript.

  • swc: Used to transpile TypeScript to JavaScript. By default, the ts_project rule will use tsc to transpile TS to JS, but this project includes a macro in //:defs.bzl to use SWC instead. SWC is much faster than tsc but does not do type checking. Instead, type checking happens when running bazel test //..., via auto-generated _typecheck_test rules. See https://blog.aspect.dev/typescript-speedup

  • esbuild: Used to bundle and minify the resulting JS.

How to use this template

Make sure you have git and bazel installed. Then:

  1. Make a copy of this repo (with git clone)

  2. Push your repo to GitHub (using your account or GitHub org).

  3. Set up BuildBuddy CI, so that BuildBuddy runs all tests on each push or pull request commit: https://app.buildbuddy.io/workflows/

  4. Highly recommended: set up branch protection rules to prevent code from being merged if it doesn't pass all tests.

Running the server locally

Run yarn dev and then visit http://localhost:8082. If you make changes to the app, the app will automatically be re-built, and any open pages will be reloaded in the browser. This is done using ibazel.

Running tests

Run bazel test //... to run tests.

buildbuddy-nodejs-example's People

Contributors

bduffany avatar

Stargazers

Ryan Murray avatar George Scrivener avatar

Watchers

James Cloos avatar  avatar

buildbuddy-nodejs-example's Issues

feature request --run_per_test=100

Hi Brandon,

Would it be possible to add a simple e2e test that just verifies the title of the page with buildbuddy on this project?

The biggest win for my organization would be to execute our e2e tests with --run_per_test=100 to deflake the e2e tests.

rules_nodejs project has this cypress sample:
git clone https://github.com/bazelbuild/rules_nodejs.git
cd rules_nodejs/examples/cypress
bazel test :test --runs_per_test=4 --config=remote --disk_cache=

The problem I have on buildbuddy is I need to supply my own docker image
--experimental_docker_image=
https://github.com/cypress-io/cypress-docker-images

the cypress sample yields

Read our documentation on dependencies for more information:
https://on.cypress.io/required-dependencies
If you are using Docker, we provide containers with all required dependencies installed.
----------
Error: spawn Xvfb ENOENT

because it is using the default gcr.io/cloud-marketplace/google/rbe-ubuntu16-04

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.