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
8 changes: 4 additions & 4 deletions .claude/skills/drift/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ name: drift
description: Drift spec-to-code anchor conventions. Use when editing code that is bound by drift specs, updating specs, working with drift frontmatter, or when drift check reports stale anchors.
drift:
files:
- src/main.zig@a7ffa398
- src/frontmatter.zig@a7ffa398
- src/scanner.zig@a7ffa398
- src/vcs.zig@a7ffa398
- src/main.zig@2d3a4080
- src/frontmatter.zig@2d3a4080
- src/scanner.zig@2d3a4080
- src/vcs.zig@2d3a4080
---

# Drift
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
version: 0.15.2

- name: Build
run: zig build -Doptimize=ReleaseSafe -Dtarget=${{ matrix.zig-target }} ${{ matrix.zig-cpu && format('-Dcpu={0}', matrix.zig-cpu) || '' }}
run: zig build -Doptimize=ReleaseSafe -Dversion=${{ github.ref_name }} -Dtarget=${{ matrix.zig-target }} ${{ matrix.zig-cpu && format('-Dcpu={0}', matrix.zig-cpu) || '' }}

- name: Package
run: |
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,22 @@ Any markdown file in your repo can declare anchors to code — specific files or
curl -fsSL https://drift.fp.dev/install.sh | sh
```

To install a specific version:

```bash
curl -fsSL https://drift.fp.dev/install.sh | sh -s -- --version vX.Y.Z
```

Or build from source:

```bash
zig build -Doptimize=ReleaseSafe --prefix ~/.local
```

### Coding agent skill (Claude Code, Codex)

```bash
curl -fsSL https://drift.fp.dev/install.sh | sh
npx skills add fiberplane/drift
```

Expand Down
5 changes: 5 additions & 0 deletions build.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@ const std = @import("std");
pub fn build(b: *std.Build) void {
const target = b.standardTargetOptions(.{});
const optimize = b.standardOptimizeOption(.{});
const version = b.option([]const u8, "version", "Drift version string") orelse "0.0.0-dev";

// Dependencies
const clap_dep = b.dependency("clap", .{});

// Build tree-sitter C library from vendor sources
const ts_module = buildTreeSitter(b, target, optimize);

const build_options = b.addOptions();
build_options.addOption([]const u8, "version", version);

// Root module
const root_module = b.createModule(.{
.root_source_file = b.path("src/main.zig"),
Expand All @@ -21,6 +25,7 @@ pub fn build(b: *std.Build) void {
.{ .name = "tree_sitter", .module = ts_module },
},
});
root_module.addOptions("build_options", build_options);
linkGrammars(b, root_module);

// Executable
Expand Down
2 changes: 1 addition & 1 deletion docs/CLI.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
drift:
files:
- src/main.zig@a7ffa398
- src/main.zig@2d3a4080
---

# CLI Reference
Expand Down
6 changes: 3 additions & 3 deletions docs/DECISIONS.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
drift:
files:
- src/main.zig@a7ffa398
- src/symbols.zig@a7ffa398
- src/vcs.zig@a7ffa398
- src/main.zig@2d3a4080
- src/symbols.zig@2d3a4080
- src/vcs.zig@2d3a4080
---

# Decisions
Expand Down
10 changes: 5 additions & 5 deletions docs/DESIGN.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
drift:
files:
- src/main.zig@a7ffa398
- src/frontmatter.zig@a7ffa398
- src/scanner.zig@a7ffa398
- src/symbols.zig@a7ffa398
- src/vcs.zig@a7ffa398
- src/main.zig@2d3a4080
- src/frontmatter.zig@2d3a4080
- src/scanner.zig@2d3a4080
- src/symbols.zig@2d3a4080
- src/vcs.zig@2d3a4080
---

# Design
Expand Down
6 changes: 3 additions & 3 deletions docs/RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
drift:
files:
- .github/workflows/release.yml@xxoutkyz
- .github/workflows/ci.yml@xxoutkyz
- cliff.toml@xxoutkyz
- .github/workflows/release.yml@2d3a4080
- .github/workflows/ci.yml@2d3a4080
- cliff.toml@2d3a4080
---

# Releasing
Expand Down
3 changes: 2 additions & 1 deletion src/main.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");
const build_options = @import("build_options");
const clap = @import("clap");
const frontmatter = @import("frontmatter.zig");
const scanner = @import("scanner.zig");
Expand All @@ -7,7 +8,7 @@ const vcs = @import("vcs.zig");

const Spec = scanner.Spec;

const version = "0.1.0";
const version = build_options.version;

const SubCommand = enum {
check,
Expand Down
Loading