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 AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Each Rust crate has a `package.json` whose **identity and workspace-dependency w
mise run sync:turborepo # sync package.json identity + deps from Cargo.toml metadata
```

`sync:turborepo` only manages that generated wiring β€” the `scripts` section is hand-maintained and is used by CI and Turborepo (e.g. `test:unit`, `lint:clippy`, `doc:dependency-diagram`), so add or edit scripts by hand. The task wraps the `repo-chores` CLI; the equivalent direct invocation is `cargo run --package hash-repo-chores --bin repo-chores-cli -- sync-turborepo`. A related task, `mise run fix:package-json`, sorts `package.json` keys consistently.
`sync:turborepo` only manages that generated wiring. A crate's tasks live in its `turbo.json`, each with the `command` Turborepo runs (e.g. `test:unit`, `lint:clippy`, `doc:dependency-diagram`); the `package.json` carries no `scripts`. Add or edit tasks there by hand. The task wraps the `repo-chores` CLI; the equivalent direct invocation is `cargo run --package hash-repo-chores --bin repo-chores-cli -- sync-turborepo`. A related task, `mise run fix:package-json`, sorts `package.json` keys consistently.

## Git commits

Expand Down
4 changes: 4 additions & 0 deletions apps/hash-graph/docs/task-dependencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@
"@rust/darwin-kperf-codegen"
]
},
"build:docker:dev": {
"dependsOn": [],
"cache": false
},
"compile": {
"dependsOn": [],
"cache": false
Expand Down
16 changes: 0 additions & 16 deletions apps/hash-graph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,6 @@
"private": true,
"description": "The entity-graph query-layer for the HASH datastore",
"license": "AGPL-3",
"scripts": {
"build:docker": "docker buildx build --build-arg PROFILE=release --tag hash-graph --file docker/Dockerfile ../../ --load",
"build:docker:dev": "docker buildx build --build-arg PROFILE=dev --tag hash-graph --file docker/Dockerfile ../../ --load",
"compile": "cargo build --bin hash-graph --all-features",
"compile:release": "cargo build --bin hash-graph --all-features --release",
"doc:dependency-diagram": "cargo run -p hash-repo-chores -- dependency-diagram --output docs/dependency-diagram.mmd --root hash-graph --root-deps-and-dependents --link-mode non-roots --include-dev-deps --include-build-deps --logging-console-level info",
"fix:clippy": "just clippy --fix",
"lint:clippy": "just clippy",
"start": "../../target/release/hash-graph server",
"start:healthcheck": "../../target/release/hash-graph server --healthcheck --wait --timeout 1200 --logging-console-level=warn",
"start:migrate": "../../target/release/hash-graph migrate --user postgres --password postgres",
"start:test": "../../target/debug/hash-graph server",
"start:test:healthcheck": "../../target/debug/hash-graph server --healthcheck --wait --timeout 300 --logging-console-level=warn",
"start:test:migrate": "../../target/debug/hash-graph migrate --user postgres --password postgres",
"test:unit": "mise run test:unit @apps/hash-graph"
},
"dependencies": {
"@blockprotocol/type-system-rs": "workspace:*",
"@rust/error-stack": "workspace:*",
Expand Down
110 changes: 110 additions & 0 deletions apps/hash-graph/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,134 @@
"extends": ["//"],
"tasks": {
"start:migrate": {
"command": [
"../../target/release/hash-graph",
"migrate",
"--user",
"postgres",
"--password",
"postgres"
],
"cache": false,
"dependsOn": ["compile:release"]
},
"start:healthcheck": {
"command": [
"../../target/release/hash-graph",
"server",
"--healthcheck",
"--wait",
"--timeout",
"1200",
"--logging-console-level=warn"
],
"dependsOn": ["compile:release"]
},
"start": {
"command": ["../../target/release/hash-graph", "server"],
"dependsOn": ["start:migrate"]
},
"start:test:migrate": {
"command": [
"../../target/debug/hash-graph",
"migrate",
"--user",
"postgres",
"--password",
"postgres"
],
"cache": false,
"dependsOn": ["compile"]
},
"start:test:healthcheck": {
"command": [
"../../target/debug/hash-graph",
"server",
"--healthcheck",
"--wait",
"--timeout",
"300",
"--logging-console-level=warn"
],
"dependsOn": ["compile"]
},
"start:test": {
"command": ["../../target/debug/hash-graph", "server"],
"dependsOn": ["start:test:migrate"]
},
"build:docker": {
"command": [
"docker",
"buildx",
"build",
"--build-arg",
"PROFILE=release",
"--tag",
"hash-graph",
"--file",
"docker/Dockerfile",
"../../",
"--load"
]
},
"build:docker:dev": {
"cache": false,
"command": [
"docker",
"buildx",
"build",
"--build-arg",
"PROFILE=dev",
"--tag",
"hash-graph",
"--file",
"docker/Dockerfile",
"../../",
"--load"
]
},
Comment thread
cursor[bot] marked this conversation as resolved.
"compile": {
"command": ["cargo", "build", "--bin", "hash-graph", "--all-features"]
},
"compile:release": {
"command": [
"cargo",
"build",
"--bin",
"hash-graph",
"--all-features",
"--release"
]
},
"doc:dependency-diagram": {
"command": [
"cargo",
"run",
"-p",
"hash-repo-chores",
"--",
"dependency-diagram",
"--output",
"docs/dependency-diagram.mmd",
"--root",
"hash-graph",
"--root-deps-and-dependents",
"--link-mode",
"non-roots",
"--include-dev-deps",
"--include-build-deps",
"--logging-console-level",
"info"
]
},
"fix:clippy": {
"command": ["just", "clippy", "--fix"]
},
"lint:clippy": {
"command": ["just", "clippy"]
},
"test:unit": {
"command": ["mise", "run", "test:unit", "@apps/hash-graph"]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,15 @@
]
},
"test:unit": {
"dependsOn": [],
"dependsOn": [
"test:unit:doc"
],
"env": [
"TEST_COVERAGE"
]
},
"test:unit:doc": {
"dependsOn": []
}
}
}
8 changes: 0 additions & 8 deletions libs/@blockprotocol/type-system/rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,6 @@
"private": true,
"description": "Definitions of types within the Block Protocol Type System",
"license": "MIT OR Apache-2.0",
"scripts": {
"build:types": "INSTA_UPDATE=always mise exec --env dev cargo:cargo-insta -- cargo-insta test --features codegen --test codegen",
"build:wasm": "mise exec --env prod github:wasm-bindgen/wasm-pack -- wasm-pack build --target web --out-name type-system --scope blockprotocol --release . && rm pkg/package.json",
"doc:dependency-diagram": "cargo run -p hash-repo-chores -- dependency-diagram --output docs/dependency-diagram.mmd --root type-system --root-deps-and-dependents --link-mode non-roots --include-dev-deps --include-build-deps --logging-console-level info",
"fix:clippy": "just clippy --fix",
"lint:clippy": "just clippy",
"test:unit": "cargo hack nextest run --feature-powerset --all-targets && cargo test --all-features --doc"
},
"dependencies": {
"@rust/error-stack": "workspace:*",
"@rust/hash-codec": "workspace:*",
Expand Down
77 changes: 77 additions & 0 deletions libs/@blockprotocol/type-system/rust/turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,89 @@
"extends": ["//"],
"tasks": {
"build:wasm": {
"command": [
"mise",
"exec",
"--env",
"prod",
"github:wasm-bindgen/wasm-pack",
"--",
"wasm-pack",
"build",
"--target",
"web",
"--out-name",
"type-system",
"--scope",
"blockprotocol",
"--release",
".",
"--no-pack"
],
"dependsOn": ["^manifest"],
"outputs": ["pkg/**"]
},
"build:types": {
"command": [
"env",
"INSTA_UPDATE=always",
"mise",
"exec",
"--env",
"dev",
"cargo:cargo-insta",
"--",
"cargo-insta",
"test",
"--features",
"codegen",
"--test",
"codegen"
],
"dependsOn": ["^manifest"],
"outputs": ["types/**"]
},
"doc:dependency-diagram": {
"command": [
"cargo",
"run",
"-p",
"hash-repo-chores",
"--",
"dependency-diagram",
"--output",
"docs/dependency-diagram.mmd",
"--root",
"type-system",
"--root-deps-and-dependents",
"--link-mode",
"non-roots",
"--include-dev-deps",
"--include-build-deps",
"--logging-console-level",
"info"
]
},
"fix:clippy": {
"command": ["just", "clippy", "--fix"]
},
"lint:clippy": {
"command": ["just", "clippy"]
},
"test:unit": {
"command": [
"cargo",
"hack",
"nextest",
"run",
"--feature-powerset",
"--all-targets"
],
"dependsOn": ["^manifest", "test:unit:doc"]
},
"test:unit:doc": {
"command": ["cargo", "test", "--all-features", "--doc"],
"dependsOn": ["^manifest"]
}
}
}
19 changes: 19 additions & 0 deletions libs/@hashintel/ds-components/vercel-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -euo pipefail

eval "$(mise activate bash --shims)"

echo "Changing dir to root"
cd ../../..

# TODO: Mise is picking up `.env` files. We need to overhaul our approach for
# environment variables. To avoid this in the meantime, we'll remove the
# `.env` file.
# See: https://linear.app/hash/issue/H-3213/use-consistent-naming-schema-for-environment-variables
# See: https://linear.app/hash/issue/H-4202/sort-out-which-environment-variables-are-defined-where
# See: https://linear.app/hash/issue/H-3212/clean-up-env-files
rm -f .env

echo "Building the design system component gallery"
turbo run build:ladle --filter='@hashintel/ds-components' --env-mode=loose
27 changes: 27 additions & 0 deletions libs/@hashintel/ds-components/vercel-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -euo pipefail

echo "Changing dir to root"
cd ../../..

echo "updating certificates"
yum update ca-certificates -y

echo "installing mise"
./.config/mise/install.sh
eval "$(mise activate bash --shims)"

# The ladle build is Node throughout β€” `ladle build` <- `codegen` <- the
# `ds-helpers` build β€” and `.yarnrc.yml` sets `enableScripts: false`, so nothing
# compiles during install. That leaves out the Rust toolchain, wasm-pack,
# binaryen, java, protoc and redocly the other Vercel apps here install; turbo
# loads the Cargo workspace only for a selection that contains a crate.
#
# turbo comes from the pin rather than the build image: the root `turbo.json`
# declares future flags that only the pinned version accepts.
echo "Installing prerequisites"
mise install --locked node npm:turbo

echo "Installing yarn dependencies"
LEFTHOOK=0 yarn install --immutable
3 changes: 2 additions & 1 deletion libs/@hashintel/ds-components/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"silent": true,
"autoJobCancelation": true
},
"buildCommand": "turbo run build:ladle",
"buildCommand": "./vercel-build.sh",
"installCommand": "./vercel-install.sh",
"outputDirectory": ".build/ladle"
}
7 changes: 0 additions & 7 deletions libs/@local/codec/rust/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,6 @@
"version": "0.0.0-private",
"private": true,
"license": "AGPL-3",
"scripts": {
"build:types": "INSTA_UPDATE=always mise exec --env dev cargo:cargo-insta -- cargo-insta test --features codegen,numeric --test codegen",
"doc:dependency-diagram": "cargo run -p hash-repo-chores -- dependency-diagram --output docs/dependency-diagram.mmd --root hash-codec --root-deps-and-dependents --link-mode non-roots --include-dev-deps --include-build-deps --logging-console-level info",
"fix:clippy": "just clippy --fix",
"lint:clippy": "just clippy",
"test:unit": "mise run test:unit @rust/hash-codec"
},
"dependencies": {
"@rust/error-stack": "workspace:*",
"@rust/harpc-wire-protocol": "workspace:*"
Expand Down
Loading
Loading