Skip to content

Commit

Permalink
2. bazel
Browse files Browse the repository at this point in the history
  • Loading branch information
CGQAQ committed Nov 29, 2023
1 parent 755f361 commit 5e53229
Show file tree
Hide file tree
Showing 13 changed files with 14,258 additions and 0 deletions.
1 change: 1 addition & 0 deletions .bazelignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
editor/node_modules
1 change: 1 addition & 0 deletions .bazeliskrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
USE_BAZEL_VERSION=6.4.0
9 changes: 9 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
common --enable_bzlmod

# passes an argument `--skipLibCheck` to *every* spawn of the TypeScript compiler, tsc
build --@aspect_rules_ts//ts:skipLibCheck=always
fetch --@aspect_rules_ts//ts:skipLibCheck=always
query --@aspect_rules_ts//ts:skipLibCheck=always

# Required for rules_js
build --enable_runfiles
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/bazel-*
Empty file added BUILD.bazel
Empty file.
44 changes: 44 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
module(
name = "project3b",
version = "0.0.0",
compatibility_level = 1,
)

bazel_dep(name = "aspect_bazel_lib", version = "1.33.0")
bazel_dep(name = "aspect_rules_jest", version = "0.19.6")
bazel_dep(name = "aspect_rules_js", version = "1.32.2")
bazel_dep(name = "aspect_rules_swc", version = "1.0.2")
bazel_dep(name = "aspect_rules_ts", version = "2.0.1")
bazel_dep(name = "aspect_rules_rollup", version = "1.0.0")
bazel_dep(name = "bazel_skylib", version = "1.4.2")

npm = use_extension("@aspect_rules_js//npm:extensions.bzl", "npm", dev_dependency = True)
npm.npm_translate_lock(
name = "npm",
bins = {
# derived from "bin" attribute in node_modules/react-scripts/package.json
"react-scripts": [
"react-scripts=./bin/react-scripts.js",
],
},
npm_package_lock = "//editor:package-lock.json",
npmrc = "//editor:.npmrc",
pnpm_lock = "//editor:pnpm-lock.yaml",
public_hoist_packages = {
"@next/eslint-plugin-next": ["next.js"],
"eslint-config-react-app": ["react"],
"[email protected]": ["react"],
},
verify_node_modules_ignored = "//:.bazelignore",
)
use_repo(npm, "npm")

rules_ts_ext = use_extension(
"@aspect_rules_ts//ts:extensions.bzl",
"ext",
dev_dependency = True,
)

rules_ts_ext.deps()

use_repo(rules_ts_ext, "npm_typescript")
61 changes: 61 additions & 0 deletions WORKSPACE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# https://bazelbuild.github.io/rules_rust/#setup

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

# To find additional information on this release or newer ones visit:
# https://github.com/bazelbuild/rules_rust/releases
http_archive(
name = "rules_rust",
sha256 = "36ab8f9facae745c9c9c1b33d225623d976e78f2cc3f729b7973d8c20934ab95",
urls = ["https://github.com/bazelbuild/rules_rust/releases/download/0.31.0/rules_rust-v0.31.0.tar.gz"],
)

load("@rules_rust//rust:repositories.bzl", "rules_rust_dependencies", "rust_register_toolchains")

rules_rust_dependencies()

rust_register_toolchains()
##############################################################################################################

# https://bazelbuild.github.io/rules_nodejs/install.html
http_archive(
name = "rules_nodejs",
sha256 = "162f4adfd719ba42b8a6f16030a20f434dc110c65dc608660ef7b3411c9873f9",
strip_prefix = "rules_nodejs-6.0.2",
url = "https://github.com/bazelbuild/rules_nodejs/releases/download/v6.0.2/rules_nodejs-v6.0.2.tar.gz",
)
load("@rules_nodejs//nodejs:repositories.bzl", "node_repositories")


node_repositories(
name = "windows_amd64",
node_version = "20.10.0",
node_urls = ["https://nodejs.org/dist/v{version}/{filename}"],
node_repositories = {
"20.10.0-windows_amd64": ("node-v20.10.0-win-x64.zip", "node-v20.10.0-win-x64", "e5b861814a97e28ae7ac06a34e88fd5e0565b447d270c26e20b5ef60bf0aaaf9"),
},
)
node_repositories(
name = "linux_amd64",
node_version = "20.10.0",
node_urls = ["https://nodejs.org/dist/v{version}/{filename}"],
node_repositories = {
"20.10.0-linux_amd64": ("node-v20.10.0-linux-x64.tar.gz", "node-v20.10.0-linux-x64", "d3f0908a9d9190a8525c5b9a716ed91bb57e908555841b0c47f75b2a001ff91b"),
},
)
node_repositories(
name = "darwin_amd64",
node_version = "20.10.0",
node_urls = ["https://nodejs.org/dist/v{version}/{filename}"],
node_repositories = {
"20.10.0-darwin_amd64": ("node-v20.10.0-darwin-x64.tar.gz", "node-v20.10.0-darwin-x64", "5ff5e8abd3eea6e5f507eb6677554f5b2188eedef654096aa4168a9941e91a32"),
},
)
node_repositories(
name = "darwin_arm64",
node_version = "20.10.0",
node_urls = ["https://nodejs.org/dist/v{version}/{filename}"],
node_repositories = {
"20.10.0-darwin_arm64": ("node-v20.10.0-darwin-arm64.tar.gz", "node-v20.10.0-darwin-arm64", "68b93099451d77aac116cf8fce179cabcf53fec079508dc6b39d3a086fb461a8"),
},
)
Loading

0 comments on commit 5e53229

Please sign in to comment.