Skip to content

Commit f021398

Browse files
authored
setup typescript config for bazel (#3)
1 parent 2f040d9 commit f021398

File tree

84 files changed

+7645
-644
lines changed

Some content is hidden

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

84 files changed

+7645
-644
lines changed

.github/workflows/deno.yml

Lines changed: 0 additions & 17 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,5 @@
3737
# Ignore all bazel-* symlinks. There is no full list since this can change
3838
# based on the name of the directory bazel is cloned into.
3939
bazel-*
40+
41+
node_modules

WORKSPACE

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,18 @@
1+
workspace(
2+
# How this workspace would be referenced with absolute labels from another workspace
3+
name = "leetcode",
4+
# Map the @npm bazel workspace to the node_modules directory.
5+
# This lets Bazel use the same node_modules as other local tooling.
6+
managed_directories = {
7+
"@npm": ["node_modules"],
8+
# "@website_npm": ["website/node_modules"],
9+
},
10+
)
11+
112
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
213
load("@bazel_tools//tools/build_defs/repo:git.bzl", "git_repository")
314

15+
416
http_archive(
517
name = "com_google_googletest",
618
urls = ["https://github.com/google/googletest/archive/609281088cfefc76f9d0ce82e1ff6c30cc3591e5.zip"],
@@ -13,8 +25,31 @@ http_archive(
1325
strip_prefix = "rules_cc-40548a2974f1aea06215272d9c2b47a14a24e556",
1426
)
1527

28+
# Fetch rules_nodejs so we can install our npm dependencies
29+
http_archive(
30+
name = "build_bazel_rules_nodejs",
31+
sha256 = "0fa2d443571c9e02fcb7363a74ae591bdcce2dd76af8677a95965edf329d778a",
32+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/3.6.0/rules_nodejs-3.6.0.tar.gz"],
33+
)
34+
1635
git_repository(
1736
name = "com_google_absl",
1837
remote = "https://github.com/abseil/abseil-cpp.git",
1938
tag = "20200225.2",
2039
)
40+
41+
load("@build_bazel_rules_nodejs//:index.bzl", "check_rules_nodejs_version", "node_repositories", "npm_install")
42+
43+
node_repositories(
44+
node_version = "16.2.0",
45+
package_json = ["//:package.json"],
46+
)
47+
48+
npm_install(
49+
# Name this npm so that Bazel Label references look like @npm//package
50+
name = "npm",
51+
package_json = "//:package.json",
52+
package_lock_json = "//:package-lock.json",
53+
patch_args = ["-p1"]
54+
)
55+

cpp/0020_valid_parentheses/0020_valid_parentheses.cc

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,18 @@ using std::unordered_map;
1010
bool Solution::isValid(string s) {
1111
unordered_map<char, char> dict({{'(', ')'}, {'[', ']'}, {'{', '}'}});
1212
stack<char> stack;
13-
std::cout << "heyyy" << "\n";
1413

1514
for (const char &letter : s) {
16-
std::cout << "heyyy" << "\n";
1715
if (dict.find(letter) != dict.end()) {
1816
stack.push(dict[letter]);
1917
continue;
2018
}
2119

2220
if (stack.empty()) {
23-
return false;
21+
return false;
2422
}
2523

26-
const char& popped = stack.top();
24+
const char &popped = stack.top();
2725

2826
if (letter != popped) {
2927
return false;

0 commit comments

Comments
 (0)