Skip to content
Open
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
25 changes: 25 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Runs `devenv sync` to install `uv`, `yarn install`, and installs the `pre-commit` hook.

if [[ -x "${PWD}/.devenv/bin/devenv" ]]; then
DEVENV="${PWD}/.devenv/bin/devenv"
elif command -v devenv >/dev/null 2>&1; then
DEVENV="devenv"
fi

if [[ -n "$DEVENV" ]]; then
$DEVENV sync
PATH_add "${PWD}/.devenv/bin"
fi

if ! command -v uv >/dev/null 2>&1; then
echo "ERROR: Please install devenv (https://github.com/getsentry/devenv) or uv (https://docs.astral.sh/uv/)"
return 1
fi

if [ ! -d "node_modules" ]; then
yarn install
fi

if command -v uvx >/dev/null 2>&1 && [ ! -f ".git/hooks/pre-commit" ]; then
uvx pre-commit@latest install
fi
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -146,4 +146,7 @@ dist
# Turborepo
.turbo

.DS_Store
.DS_Store

# Devenv
**/__pycache__
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: local
hooks:
- id: format
name: format
description: yarn format
entry: yarn format
language: system
pass_filenames: false
- id: lint
name: lint
description: yarn lint
entry: yarn lint
language: system
pass_filenames: false
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": false },
"files": {
"ignoreUnknown": false,
"ignore": ["dist/*", "javascript/sentry-conventions/package.json", "rust/*", "python/*"]
"ignore": [".devenv/*", "dist/*", "javascript/sentry-conventions/package.json", "rust/*", "python/*"]
},
"formatter": {
"enabled": true,
Expand Down
21 changes: 21 additions & 0 deletions devenv/config.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[devenv]
minimum_version = 1.22.0

[uv]
darwin_arm64 = https://github.com/astral-sh/uv/releases/download/0.9.3/uv-aarch64-apple-darwin.tar.gz
darwin_arm64_sha256 = d6b2eaa1025b24b4779602763ad92f20112cbf19732fc6e0c72bb57a6a592c6c
# used for autoupdate
version = 0.9.3

[node]
darwin_x86_64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v22.16.0-darwin-x64.tar.xz
darwin_x86_64_sha256 = 5c34638f2c0e3f3aaa7b3a94b58304765a169730da1896ebba8515ea4d987a9c
darwin_arm64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v22.16.0-darwin-arm64.tar.xz
darwin_arm64_sha256 = aaf7fc3c936f1b359bc312b63638e41f258689ac2303966ad932cda18c54ea00
linux_x86_64 = https://storage.googleapis.com/sentry-dev-infra-assets/node/node-v22.16.0-linux-x64.tar.xz
linux_x86_64_sha256 = f4cb75bb036f0d0eddf6b79d9596df1aaab9ddccd6a20bf489be5abe9467e84e
# used for autoupdate
version = v22.16.0

[yarn]
version = 1.22.22
25 changes: 25 additions & 0 deletions devenv/sync.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from devenv import constants
from devenv.lib import config, node, uv


def main(context: dict[str, str]) -> int:
reporoot = context["reporoot"]
cfg = config.get_repo(reporoot)

uv.install(
cfg["uv"]["version"],
cfg["uv"][constants.SYSTEM_MACHINE],
cfg["uv"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)

node.install(
cfg["node"]["version"],
cfg["node"][constants.SYSTEM_MACHINE],
cfg["node"][f"{constants.SYSTEM_MACHINE}_sha256"],
reporoot,
)

node.install_yarn(cfg["yarn"]["version"], reporoot)

return 0