Skip to content

Commit 3300112

Browse files
author
Kyle Cordes
committed
initial
0 parents  commit 3300112

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+5978
-0
lines changed

.bazelignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
dist
2+
node_modules

.bazelrc

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
build --disk_cache=~/.cache/bazel-disk
2+
fetch --disk_cache=~/.cache/bazel-disk
3+
query --disk_cache=~/.cache/bazel-disk
4+
sync --disk_cache=~/.cache/bazel-disk
5+
test --disk_cache=~/.cache/bazel-disk
6+
7+
# Make TypeScript and Angular compilation fast, by keeping a few copies of the
8+
# compiler running as daemons, and cache SourceFile ASTs to reduce parse time.
9+
10+
build --strategy=TypeScriptCompile=worker
11+
build --strategy=AngularTemplateCompile=worker
12+
13+
# TODO
14+
test --test_output=errors

.bazelversion

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
5.1.0rc3

.circleci/config.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
version: 2.1
2+
3+
orbs:
4+
win: circleci/[email protected]
5+
6+
jobs:
7+
linux:
8+
docker:
9+
- image: ubuntu:rolling
10+
11+
resource_class: large
12+
steps:
13+
- checkout
14+
15+
- run:
16+
command: |
17+
apt-get update
18+
export DEBIAN_FRONTEND=noninteractive
19+
apt-get install -q -y curl patch
20+
curl -sSL https://github.com/bazelbuild/bazelisk/releases/download/v1.10.1/bazelisk-linux-amd64 >/usr/local/bin/bazel
21+
chmod +x /usr/local/bin/bazel
22+
23+
- run:
24+
command: |
25+
./exercise.sh
26+
27+
windows:
28+
executor:
29+
name: win/default
30+
shell: powershell.exe
31+
size: large
32+
steps:
33+
- checkout
34+
35+
- run:
36+
shell: cmd.exe
37+
command: |
38+
curl -sSL https://releases.bazel.build/5.1.0/rc3/bazel-5.1.0rc3-windows-x86_64.exe >/ProgramData/nvm/bazel.exe
39+
40+
- run:
41+
command: |
42+
echo TODO rules_nodejs Windows non-sandbox compatibility problem, bazel build ...
43+
44+
workflows:
45+
version: 2
46+
both_platforms:
47+
jobs:
48+
- linux
49+
- windows

.editorconfig

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Editor configuration, see http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[WORKSPACE]
12+
indent_size = 4
13+
14+
[*.bazel]
15+
indent_size = 4
16+
17+
[*.bzl]
18+
indent_size = 4
19+
20+
[*.md]
21+
max_line_length = off
22+
trim_trailing_whitespace = false

.gitignore

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/tmp
6+
/out-tsc
7+
# Only exists if Bazel was run
8+
/bazel-out
9+
10+
# dependencies
11+
/node_modules
12+
13+
# profiling files
14+
chrome-profiler-events.json
15+
speed-measure-plugin.json
16+
17+
# IDEs and editors
18+
.idea
19+
.ijwb
20+
.project
21+
.classpath
22+
.c9/
23+
*.launch
24+
.settings/
25+
*.sublime-workspace
26+
27+
# IDE - VSCode
28+
.vscode/*
29+
!.vscode/settings.json
30+
!.vscode/tasks.json
31+
!.vscode/launch.json
32+
!.vscode/extensions.json
33+
.history/*
34+
35+
# misc
36+
/.sass-cache
37+
/connect.lock
38+
/coverage
39+
/libpeerconnection.log
40+
npm-debug.log
41+
yarn-error.log
42+
testem.log
43+
/typings
44+
45+
# System Files
46+
.DS_Store
47+
Thumbs.db
48+
49+
/bazel-*
50+
temp.png

.prettierrc

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"printWidth": 70,
3+
"singleQuote": true
4+
}

.vscode/settings.json

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"editor.formatOnSave": true,
3+
"editor.detectIndentation": false,
4+
"files.exclude": {
5+
"**/.classpath": true,
6+
"**/.project": true,
7+
"**/.settings": true,
8+
"**/.factorypath": true,
9+
"bazel-*": true
10+
},
11+
"java.format.settings.url": ".vscode/java-formatting.xml",
12+
"java.format.settings.profile": "Narrow",
13+
"rewrap.wrappingColumn": 70,
14+
"typescript.tsdk": "node_modules/typescript/lib",
15+
"cSpell.words": ["Bazel", "Multiset", "Runfiles", "grpc", "mattn"],
16+
"bazel.enableCodeLens": true
17+
}

BUILD.bazel

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Typescript tools need a top level target
2+
3+
exports_files(
4+
["tsconfig.json"],
5+
visibility = ["//visibility:public"],
6+
)

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Oasis Digital Bazel examples
2+
3+
We use these examples to teach Bazel, but you are welcome to study them
4+
for your own purposes!
5+
6+
https://oasisdigital.com/class/bazel

WORKSPACE.bazel

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
workspace(
2+
name = "full_stack_suite",
3+
)
4+
5+
# Docs:
6+
# "As of rules_nodejs 5.0, symlink_node_modules defaults to False and
7+
# using managed_directories is not recommended"
8+
9+
# Issue:
10+
# https://github.com/bazelbuild/rules_nodejs/issues/2708
11+
12+
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
13+
14+
# Javascript / Typescript tooling
15+
16+
http_archive(
17+
name = "build_bazel_rules_nodejs",
18+
sha256 = "a09edc4ba3931a856a5ac6836f248c302d55055d35d36e390a0549799c33145b",
19+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/5.0.2/rules_nodejs-5.0.2.tar.gz"],
20+
)
21+
22+
load("@build_bazel_rules_nodejs//:repositories.bzl", "build_bazel_rules_nodejs_dependencies")
23+
24+
build_bazel_rules_nodejs_dependencies()
25+
26+
load("@rules_nodejs//nodejs:repositories.bzl", "nodejs_register_toolchains")
27+
28+
nodejs_register_toolchains(
29+
name = "nodejs", # You can load another version under another name
30+
node_version = "16.13.2",
31+
)
32+
33+
# It is also possible to set up the various things
34+
# nodejs_register_toolchains separately, which lets you do things like
35+
# set a Yarn version.
36+
37+
# build_bazel_rules_nodejs comes with bazel_skylib
38+
39+
load("@bazel_skylib//:workspace.bzl", "bazel_skylib_workspace")
40+
41+
bazel_skylib_workspace()
42+
43+
load("@build_bazel_rules_nodejs//:index.bzl", "yarn_install")
44+
45+
yarn_install(
46+
name = "npm",
47+
# This is required to allow rules to reach inside packages and
48+
# depend on arbitrary files. It is needed for ts_library,
49+
# ng_module, and many other cases.
50+
exports_directories_only = False,
51+
package_json = "//:package.json",
52+
yarn_lock = "//:yarn.lock",
53+
)
54+
55+
# Setup esbuild repositories
56+
57+
load("@build_bazel_rules_nodejs//toolchains/esbuild:esbuild_repositories.bzl", "esbuild_repositories")
58+
59+
esbuild_repositories(npm_repository = "npm")
60+
61+
# Needed the POM file generator:
62+
63+
http_archive(
64+
name = "bazel_common",
65+
strip_prefix = "bazel-common-bf8e5ef95b118d1716b0cb4982cf15b6ed1c896f",
66+
url = "https://github.com/google/bazel-common/archive/bf8e5ef95b118d1716b0cb4982cf15b6ed1c896f.zip",
67+
)

client/.prettierignore

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.vscode
2+
tsconfig.*
3+
dist
4+
angular.json
5+
package.json
6+
tslint*.json

client/BUILD.bazel

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package(default_visibility = ["//:__subpackages__"])
2+
3+
exports_files(["favicon.ico"])
4+
5+
alias(
6+
name = "client",
7+
actual = "//client/src:devserver",
8+
)
9+
10+
# ts_project uses the `//:tsconfig.json` target
11+
# by default. This alias allows omitting explicit tsconfig
12+
# attribute.
13+
alias(
14+
name = "tsconfig.json",
15+
actual = "//client/src:tsconfig.json",
16+
)
17+
18+
# Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test
19+
sh_test(
20+
name = "dummy_test",
21+
srcs = ["dummy_test.sh"],
22+
)

client/dummy_test.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
echo "Just a dummy test so that we have a test target for //... on certain bazelci platforms with bazel_integration_test"
2+
exit 0

client/favicon.ico

15 KB
Binary file not shown.

0 commit comments

Comments
 (0)