Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
8.4.0
5 changes: 5 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
watch_file bazel-out/bazel_env-opt/bin/bin/bazel_env/bin
PATH_add bazel-out/bazel_env-opt/bin/bin/bazel_env/bin
if [[ ! -d bazel-out/bazel_env-opt/bin/bin/bazel_env/bin ]]; then
log_error "ERROR[bazel_env.bzl]: Run 'bazel run //bin:bazel_env' to regenerate bazel-out/bazel_env-opt/bin/bin/bazel_env/bin"
fi
11 changes: 9 additions & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,17 @@ jobs:
with:
version: 8.6.12

- name: Install direnv
run: |
sudo apt-get install -y direnv
eval "$(direnv hook bash)"
- name: Install required binaries
run: |
./install_bins.sh

direnv allow .
eval "$(direnv export bash)"
# GHA steps run as non-interactive shells so they don't source the .bashrc
echo "PATH=$PATH" >> $GITHUB_ENV
bazel run //bin:bazel_env
- name: Checkout BCR submodule
run: |
git submodule update --init -- data/bazel-central-registry
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,17 @@ jobs:
version: 8.6.12
- name: Install node_modules
run: pnpm install --frozen-lockfile

- name: Install direnv
run: |
sudo apt-get install -y direnv
eval "$(direnv hook bash)"
- name: Install required binaries
run: |
./install_bins.sh

direnv allow .
eval "$(direnv export bash)"
# GHA steps run as non-interactive shells so they don't source the .bashrc
echo "PATH=$PATH" >> $GITHUB_ENV
bazel run //bin:bazel_env
- name: Check prettier formatting
run: pnpm prettier-check

Expand Down
3 changes: 3 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
bazel_dep(name = "bazel_env.bzl", version = "0.5.0")
bazel_dep(name = "buildifier_prebuilt", version = "8.2.0.2")
bazel_dep(name = "buildozer", version = "7.1.2")
209 changes: 209 additions & 0 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ We use git submodules to include the data from bazelbuild/bazel-central-registry
git submodule update --init
```

To get a buildozer binary, you also need to run this before launching the app:
To get a buildifier and buildozer on your PATH, you also need to run this before launching the app:

```bash
./install_bins.sh
bazel run //bin:bazel_env
```

Packages are managed via [pnpm](https://pnpm.io/), so they can be installed via `npx pnpm install`
Expand Down
26 changes: 0 additions & 26 deletions WORKSPACE

This file was deleted.

1 change: 0 additions & 1 deletion bin/.gitignore

This file was deleted.

Empty file removed bin/.gitkeep
Empty file.
11 changes: 11 additions & 0 deletions bin/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
load("@bazel_env.bzl", "bazel_env")
load("@buildozer//:buildozer.bzl", "BUILDOZER_LABEL")

# Setup PATH via direnv
bazel_env(
name = "bazel_env",
tools = {
"buildifier": "@buildifier_prebuilt//:buildifier",
"buildozer": BUILDOZER_LABEL,
},
)
10 changes: 4 additions & 6 deletions data/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ export const MODULES_ROOT_DIR = path.join(
'modules'
)

export const BUILDOZER_BIN = path.join(process.cwd(), 'bin', 'buildozer')

export interface Metadata {
homepage?: string
maintainers?: Array<{
Expand Down Expand Up @@ -176,24 +174,24 @@ export const extractModuleInfo = async (
await fs.cp(moduleFilePath, path.join(directory, 'BUILD.bazel'))

const { stdout: compatibilityLevelOut } = await execa(
BUILDOZER_BIN,
'buildozer',
['print compatibility_level', ':%module'],
{ cwd: directory }
)
const compatibilityLevel = parseInt(compatibilityLevelOut, 10) || 0

const { stdout: listDepNamesOut } = await execa(
BUILDOZER_BIN,
'buildozer',
['print name', ':%bazel_dep'],
{ cwd: directory }
)
const { stdout: listDepVersionsOut } = await execa(
BUILDOZER_BIN,
'buildozer',
['print version', ':%bazel_dep'],
{ cwd: directory }
)
const { stdout: listDepDevOut } = await execa(
BUILDOZER_BIN,
'buildozer',
['print dev_dependency', ':%bazel_dep'],
{ cwd: directory }
)
Expand Down
4 changes: 0 additions & 4 deletions install_bins.sh

This file was deleted.