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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@

/target
/build
/.deps

/.claude/settings.local.json
/.claude.local/

/playground/node_modules/
/playground/src/placeholder.wasm
29 changes: 20 additions & 9 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,37 +5,48 @@
All dependency versions are declared in one place:

- **Rust crates**: `Cargo.toml` `[dependencies]`
- **Asset dependencies** (e.g. playground artifact): `Cargo.toml` `[package.metadata.assets.<name>]`
- **Asset dependencies** (e.g. playground, brand): `Cargo.toml` `[package.metadata.assets.<name>]`

### Updating dependencies

Run `cargo run -- update-deps` to update all dependencies:

1. Runs `cargo update` (Rust crates)
2. Downloads asset dependencies from GitHub releases into `build/assets/`
2. Downloads asset dependencies from GitHub releases into `.deps/`

### Build vs fetch

- `cargo run` (or `cargo run -- build`) builds with what is already in `build/assets/`. It will error if a referenced asset is missing.
- `cargo run` (or `cargo run -- build`) builds with what is already in `.deps/`. It will error if a referenced asset is missing.
- `cargo run -- update-deps` fetches/updates dependencies. It does not build.
- A clean build should never fetch dependencies.

## Build output
## Project layout

```
.deps/ # downloaded dependencies — NOT wiped by build, gitignored
playground/ # playground artifact (JS/WASM/CSS)
brand/ # brand assets (logo SVGs, favicon PNGs, social image)
build/
assets/ # downloaded dependencies — NOT wiped by build
site/ # generated output — wiped on each build
site/ # generated output — wiped on each build
static/ # static files copied verbatim to build/site/
# (brand assets here are fallbacks, overridden by .deps/brand/)
```

`build/` is gitignored. The dev server (`cargo run -- serve`) serves from `build/site/`.
The dev server (`cargo run -- serve`) serves from `build/site/`.

## Brand assets

Brand assets (logo, favicons, social image) come from the `brand` dependency.
The build copies them from `.deps/brand/assets/` into `build/site/`, overriding
any fallback files in `static/`. Once the brand release is live, the fallback
copies in `static/` can be removed.

## Fragment injection

Content pages can inject HTML fragments from `build/assets/` using frontmatter:
Content pages can inject HTML fragments from `.deps/` using frontmatter:

```yaml
fragment: playground/fragment.html # path relative to build/assets/
fragment: playground/fragment.html # path relative to .deps/
asset_dir: playground # copies runtime files to build/site/<path>
```

Expand Down
101 changes: 99 additions & 2 deletions Cargo.lock

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

11 changes: 9 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,19 @@ edition = "2024"
[package.metadata.assets.playground]
url = "https://github.com/fink-lang/playground/releases/download/{version}/playground.tar.gz"
version = "v1.9.0"
dest = "build/assets/playground"
dest = ".deps/playground"

[package.metadata.assets.brand]
url = "https://github.com/fink-lang/brand/releases/download/{version}/brand-assets.tar.gz"
version = "v1.0.0"
dest = ".deps/brand"

[dependencies]
fink = { git = "https://github.com/fink-lang/fink.git", branch = "main" }
fink = { git = "https://github.com/fink-lang/fink.git", tag = "v0.1.0" }
pulldown-cmark = "0.13"
tera = "1"
walkdir = "2"
anyhow = "1"
tiny_http = "0.12"
flate2 = "1"
image = { version = "0.25", default-features = false, features = ["png"] }
Loading
Loading