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
5 changes: 0 additions & 5 deletions .bazelignore

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/buildifier.yaml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ jobs:
os: [ubuntu-latest, macos-latest]
folder:
- "."
- "e2e/smoke"
- "examples/simple"
- "examples/aggregate"
runs-on: ${{ matrix.os }}
Expand All @@ -28,22 +27,3 @@ jobs:
- name: Test ${{ matrix.folder }}
working-directory: ${{ matrix.folder }}
run: bazel test //...

pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: pre-commit/action@v3.0.1

conclusion:
needs: [test, pre-commit]
runs-on: ubuntu-latest
if: always()
steps:
- uses: technote-space/workflow-conclusion-action@45ce8e0eb155657ab8ccf346ade734257fd196a5 # v3.0.3
- name: Report success
if: ${{ env.WORKFLOW_CONCLUSION == 'success' }}
run: exit 0
- name: Report failure
if: ${{ env.WORKFLOW_CONCLUSION == 'failure' }}
run: exit 1
14 changes: 1 addition & 13 deletions .github/workflows/release_prep.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,25 +26,13 @@ tar --create --auto-compress \
cat << EOF
## Using Bzlmod with Bazel 6 or greater

1. (Bazel 6 only) Enable with \`common --enable_bzlmod\` in \`.bazelrc\`.
1. (Bazel 6+ only) Enable with \`common --enable_bzlmod\` in \`.bazelrc\`.
2. Add to your \`MODULE.bazel\` file:

\`\`\`starlark
bazel_dep(name = "rules_formatjs", version = "${TAG:1}")
\`\`\`

## Using WORKSPACE

Paste this snippet into your \`WORKSPACE.bazel\` file:

\`\`\`starlark
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive(
name = "rules_formatjs",
sha256 = "${SHA}",
strip_prefix = "${PREFIX}",
url = "https://github.com/formatjs/rules_formatjs/releases/download/${TAG}/${ARCHIVE}",
)
EOF

awk 'f;/--SNIP--/{f=1}' e2e/smoke/WORKSPACE.bazel
Expand Down
73 changes: 73 additions & 0 deletions .github/workflows/verify-hooks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: Verify Hooks
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
verify-hooks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 100
- uses: pnpm/action-setup@v4
with:
version: "10.0.0"
- uses: actions/setup-node@v4
with:
node-version: 24
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- uses: bazel-contrib/setup-bazel@0.16.0
with:
bazelisk-cache: true
- name: Get changed files
id: changed-files
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
git fetch origin ${{ github.base_ref }}
echo "files=$(git diff --name-only origin/${{ github.base_ref }}...HEAD | tr '\n' ' ')" >> $GITHUB_OUTPUT
else
echo "files=$(git diff --name-only HEAD~1 HEAD | tr '\n' ' ')" >> $GITHUB_OUTPUT
fi
- name: Run lefthook on changed files
if: steps.changed-files.outputs.files != ''
run: |
# Stage the changed files
for file in ${{ steps.changed-files.outputs.files }}; do
if [ -f "$file" ]; then
git add "$file"
fi
done

# Run pre-commit hooks
pnpm exec lefthook run pre-commit

# Check if any files were modified by the hooks
if ! git diff --quiet; then
echo "Error: Hooks modified files. Please run 'pnpm exec lefthook run pre-commit' locally and commit the changes."
git diff
exit 1
fi
- name: Validate commit messages
if: github.event_name == 'pull_request'
run: |
# Get all commits in the PR
commits=$(git log origin/${{ github.base_ref }}..HEAD --format=%H)

for commit in $commits; do
echo "Validating commit: $commit"
message=$(git log -1 --format=%B $commit)

# Save message to temporary file
echo "$message" > /tmp/commit-msg

# Run commit-msg hook
if command -v cz &> /dev/null; then
cz check --commit-msg-file /tmp/commit-msg || exit 1
else
echo "commitizen not installed, skipping commit message validation for $commit"
fi
done
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ bazel-*
.bazelrc.user
.idea/
.ijwb/
node_modules/
56 changes: 0 additions & 56 deletions .pre-commit-config.yaml

This file was deleted.

12 changes: 0 additions & 12 deletions BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")
load("@package_metadata//licenses/rules:license.bzl", "license")
load("@package_metadata//purl:purl.bzl", "purl")
load("@package_metadata//rules:package_metadata.bzl", "package_metadata")
Expand All @@ -17,14 +16,3 @@ license(
kind = "@package_metadata//licenses/spdx:Apache-2.0",
text = "LICENSE",
)

# gazelle:map_kind bzl_library bzl_library @bazel_lib//:bzl_library.bzl
gazelle_binary(
name = "gazelle_bin",
languages = ["@bazel_skylib_gazelle_plugin//bzl"],
)

gazelle(
name = "gazelle",
gazelle = "gazelle_bin",
)
14 changes: 14 additions & 0 deletions BUILD.dev.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Development-only build targets (gazelle, etc)"""

load("@bazel_gazelle//:def.bzl", "gazelle", "gazelle_binary")

# gazelle:map_kind bzl_library bzl_library @bazel_lib//:bzl_library.bzl
gazelle_binary(
name = "gazelle_bin",
languages = ["@bazel_skylib_gazelle_plugin//bzl"],
)

gazelle(
name = "gazelle",
gazelle = "gazelle_bin",
)
13 changes: 13 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,16 @@ bazel_dep(name = "bazel_lib", version = "3.0.0", dev_dependency = True)
bazel_dep(name = "buildifier_prebuilt", version = "8.2.1", dev_dependency = True)

bazel_dep(name = "bazelrc-preset.bzl", version = "1.6.0")

# FormatJS CLI toolchain
formatjs_cli = use_extension("//formatjs_cli:extensions.bzl", "formatjs_cli")
formatjs_cli.toolchain(version = "0.1.0")
use_repo(
formatjs_cli,
"formatjs_cli_toolchains_darwin_arm64",
"formatjs_cli_toolchains_linux_x64",
)

register_toolchains("@formatjs_cli_toolchains_darwin_arm64//:toolchain")

register_toolchains("@formatjs_cli_toolchains_linux_x64//:toolchain")
45 changes: 45 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions REPO.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,13 @@ repo(
"//:package_metadata",
],
)

ignore_directories([
# Examples are separate workspaces
"examples",
# Bazel convenience symlinks
"bazel-bin",
"bazel-out",
"bazel-rules_formatjs",
"bazel-testlogs",
])
2 changes: 0 additions & 2 deletions e2e/REPO.bazel

This file was deleted.

Empty file removed e2e/smoke/.bazelrc
Empty file.
17 changes: 0 additions & 17 deletions e2e/smoke/BUILD

This file was deleted.

7 changes: 0 additions & 7 deletions e2e/smoke/MODULE.bazel

This file was deleted.

Loading
Loading