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
1 change: 1 addition & 0 deletions .githooks/post-commit
18 changes: 18 additions & 0 deletions .githooks/post-commit.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env -S dotnet --
#:package TimeWarp.Amuru
#:property NoWarn=CA2007

using TimeWarp.Amuru;

string? root = Git.FindRoot();
if (root is null)
{
return 0;
}

await Shell.Builder("ganda")
.WithArguments("memsearch", "index-repo", "--background")
.WithWorkingDirectory(root)
.WithNoValidation()
.RunAsync();
return 0;
1 change: 1 addition & 0 deletions .githooks/post-merge
18 changes: 18 additions & 0 deletions .githooks/post-merge.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env -S dotnet --
#:package TimeWarp.Amuru
#:property NoWarn=CA2007

using TimeWarp.Amuru;

string? root = Git.FindRoot();
if (root is null)
{
return 0;
}

await Shell.Builder("ganda")
.WithArguments("memsearch", "index-repo", "--background")
.WithWorkingDirectory(root)
.WithNoValidation()
.RunAsync();
return 0;
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -416,3 +416,6 @@ FodyWeavers.xsd
*.msix
*.msm
*.msp

# MemSearch local index data (machine-specific; .memsearch.toml is tracked)
.memsearch/
50 changes: 50 additions & 0 deletions .memsearch.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# MemSearch repo knowledge index — TimeWarp convention
#
# SPEC (proposed extension)
# -------------------------
# memsearch's stock CLI ignores [index]; this file is honored by:
# ganda memsearch index-repo
# ganda hooks install memsearch (post-commit / post-merge runfiles)
#
# Purpose: index markdown knowledge in THIS repo only. One Milvus collection
# per repo (auto-derived from repo path). Global DB file stays at
# ~/.memsearch/milvus.db unless [milvus].uri is overridden below.
#
# [index].paths
# Directory roots (relative to repo root). memsearch indexes all .md files
# under each path recursively. Missing paths are skipped.
#
# [index].exclude_paths
# Directory paths removed from the resolved path list before indexing.
# Does not prune subdirectories when a parent path (e.g. "kanban/") is listed.
#
# [index].exclude_globs
# Reserved — file-level globs (e.g. "**/task-template.md"). Not implemented in v1.
#
# [index].enabled
# false disables hook indexing (conversation plugins still work).
#
# [milvus].collection
# Empty = auto-derive ms_<repo-basename>_<8char_sha256> from repo root.
#
# Search this repo only:
# memsearch search "query" -c <collection> --source-prefix "$(pwd)/kanban/"

[index]
enabled = true
paths = [
"kanban",
"documentation",
"okf",
"adr",
".memsearch/memory",
]
exclude_paths = []
exclude_globs = [
"**/task-template.md",
"**/overview.md",
]

[milvus]
# uri = ".memsearch/milvus.db" # optional per-repo DB file
collection = ""
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,6 @@
"titleBar.activeForeground": "#e7e7e7",
"titleBar.inactiveBackground": "#f61d1f99",
"titleBar.inactiveForeground": "#e7e7e799"
}
}
},
"window.title": "timewarp-builder · ${rootName}${separator}${activeEditorShort}"
}
18 changes: 18 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"version": "2.0.0",
"tasks": [
{
"label": "ganda: window icon",
"type": "shell",
"command": "ganda repo avatar window",
"runOptions": {
"runOn": "folderOpen"
},
"presentation": {
"reveal": "silent",
"echo": false
},
"problemMatcher": []
}
]
}
3 changes: 2 additions & 1 deletion BannedSymbols.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
T:System.Console;Use TimeWarp.Terminal.Terminal static class or inject ITerminal instead
T:System.Console;Prefer injecting ITerminal. TimeWarp.Terminal.Terminal static class is available for migration.
T:System.Diagnostics.ProcessStartInfo;Use TimeWarp.Amuru Shell.Builder instead. See the 'amuru' skill for usage patterns.
11 changes: 10 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>

<!-- Import repository path definitions -->
Expand All @@ -19,6 +20,9 @@
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
<IsPackable>false</IsPackable>

<!-- Required for IDE0005 (unnecessary usings) to run on build -->
<GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

<!-- Source generator debugging: emit generated files to artifacts directory -->
Expand Down Expand Up @@ -70,4 +74,9 @@
<AdditionalFiles Include="$(MSBuildThisFileDirectory)BannedSymbols.txt" />
</ItemGroup>

</Project>
<!-- Assembly metadata build tasks -->
<ItemGroup Label="Build Tasks">
<PackageReference Include="TimeWarp.Build.Tasks" PrivateAssets="all" />
</ItemGroup>

</Project>
16 changes: 2 additions & 14 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,15 @@
</PropertyGroup>
<ItemGroup Label="TimeWarp Packages">
<PackageVersion Include="TimeWarp.Amuru" Version="1.0.0-beta.33" />
<PackageVersion Include="TimeWarp.Nuru" Version="3.0.0-beta.70" />
<PackageVersion Include="TimeWarp.Jaribu" Version="1.0.0-beta.12" />
<PackageVersion Include="TimeWarp.Nuru" Version="3.0.0-beta.71" />
<PackageVersion Include="TimeWarp.Build.Tasks" Version="1.0.0" />
</ItemGroup>
<ItemGroup Label="Testing">
<PackageVersion Include="Shouldly" Version="4.3.0" />
</ItemGroup>
<ItemGroup Label="Code Analyzers">
<PackageVersion Include="GlobalUsingsAnalyzer" Version="1.4.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageVersion>
<PackageVersion Include="Roslynator.Analyzers" Version="4.15.0" />
<PackageVersion Include="Roslynator.CodeAnalysis.Analyzers" Version="4.15.0" />
<PackageVersion Include="Roslynator.Formatting.Analyzers" Version="4.15.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="10.0.300" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp.CodeStyle" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.BannedApiAnalyzers" Version="4.14.0" />
</ItemGroup>
<ItemGroup Label="Roslyn Analyzer Dependencies">
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="5.3.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="5.3.0" />
</ItemGroup>
</Project>
</Project>
Empty file added documentation/.gitkeep
Empty file.
Empty file added kanban/archived/.gitkeep
Empty file.
Empty file added kanban/backlog/.gitkeep
Empty file.
Empty file added kanban/to-do/.gitkeep
Empty file.
Empty file added skills/.gitkeep
Empty file.
6 changes: 1 addition & 5 deletions source/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<!-- Default package metadata (can be overridden in individual projects) -->
<PropertyGroup Label="Package Metadata">
<Version>1.0.0-beta.2</Version>
<Version>1.0.0-beta.3</Version>
<Authors>Steven T. Cramer</Authors>
<RepositoryUrl>https://github.com/TimeWarpEngineering/timewarp-builder</RepositoryUrl>
<PackageLicenseExpression>Unlicense</PackageLicenseExpression>
Expand All @@ -29,8 +29,4 @@
<None Include="$(RepositoryRoot)assets/logo.png" Pack="true" PackagePath="" />
</ItemGroup>

<ItemGroup Label="Build Tasks">
<PackageReference Include="TimeWarp.Build.Tasks" />
</ItemGroup>

</Project>
Empty file added tests/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion timewarp-builder.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
<Project Path="source/timewarp-builder/timewarp-builder.csproj" />
</Folder>
<Folder Name="/tools/">
<Project Path="tools/dev-cli/dev.cs" />
<File Path="tools/dev-cli/dev.cs" />
</Folder>
</Solution>
4 changes: 3 additions & 1 deletion tools/dev-cli/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
<!-- CA2016: CancellationToken forwarding - will address where needed -->
<!-- CA2000: Dispose on app builder - handled by framework -->
<!-- RCS1046: Async suffix - private methods don't need it -->
<NoWarn>$(NoWarn);CA1031;CA1303;CA1508;CA1515;CA1849;CA2007;CA2016;CA2000;RCS1046</NoWarn>
<!-- IDE0211: Program.Main style - dev.cs is a runfile and must use top-level statements -->
<!-- CS1591: XML doc comments not required for CLI tool internals -->
<NoWarn>$(NoWarn);CA1031;CA1303;CA1508;CA1515;CA1849;CA2007;CA2016;CA2000;RCS1046;IDE0211;CS1591</NoWarn>

<!-- AOT Support -->
<PublishAot>true</PublishAot>
Expand Down
23 changes: 15 additions & 8 deletions tools/dev-cli/dev.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/dotnet --
#!/usr/bin/env -S dotnet --
// ═══════════════════════════════════════════════════════════════════════════════
// DEV CLI - TIMEWARP.BUILDER DEVELOPMENT TOOL
// ═══════════════════════════════════════════════════════════════════════════════
Expand All @@ -12,22 +12,29 @@
// As AOT: ./bin/dev <command>
//
// Commands:
// dev build - Build the TimeWarp.Builder library
// dev test - Run tests
// dev clean - Clean solution and artifacts
// dev pack - Create NuGet packages
// dev format - Check/fix code formatting
// dev self-install - AOT compile and install dev CLI to ./bin
// dev build - Build the TimeWarp.Builder library
// dev test - Run tests
// dev clean - Clean solution and artifacts
// dev pack - Create NuGet packages
// dev format - Check/fix code formatting
// dev check-version - Verify version is ready to release
// dev verify-samples - Verify code samples compile
// dev workflow - Run full CI/CD pipeline
// dev self-install - AOT compile and install dev CLI to ./bin
//
// To bootstrap:
// dotnet run tools/dev-cli/dev.cs -- self-install
// direnv allow
// dev --help
// ═══════════════════════════════════════════════════════════════════════════════

#region Purpose
// Runfile entry point for the dev CLI: builds the Nuru app and dispatches to the endpoint commands.
#endregion

NuruApp app = NuruApp.CreateBuilder()
.WithName("dev")
.WithDescription("Development CLI for TimeWarp.Builder")
.WithDescription("Development CLI for timewarp-builder")
.DiscoverEndpoints()
.Build();

Expand Down
8 changes: 0 additions & 8 deletions tools/dev-cli/endpoints/GlobalSuppressions.cs

This file was deleted.

4 changes: 4 additions & 0 deletions tools/dev-cli/endpoints/build.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// ═══════════════════════════════════════════════════════════════════════════════
// Builds the TimeWarp.Builder library.

#region Purpose
// 'dev build' endpoint: compiles source/timewarp-builder via dotnet build.
#endregion

namespace DevCli.Commands;

/// <summary>
Expand Down
67 changes: 67 additions & 0 deletions tools/dev-cli/endpoints/check-version.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
// ═══════════════════════════════════════════════════════════════════════════════
// CHECK-VERSION COMMAND
// ═══════════════════════════════════════════════════════════════════════════════
// Verifies the source version is not already published on NuGet.org.

#region Purpose
// 'dev check-version' endpoint: verifies the version in source/Directory.Build.props is not already published on NuGet.org.
#endregion

namespace DevCli.Commands;

using System.Xml.Linq;

/// <summary>
/// Verify the version is ready to release.
/// </summary>
[NuruRoute("check-version", Description = "Verify version is ready to release")]
internal sealed class CheckVersionCommand : ICommand<Unit>
{
internal sealed class Handler : ICommandHandler<CheckVersionCommand, Unit>
{
private readonly ITerminal Terminal;

public Handler(ITerminal terminal)
{
Terminal = terminal;
}

public async ValueTask<Unit> Handle(CheckVersionCommand command, CancellationToken ct)
{
string? repoRoot = Git.FindRoot() ??
throw new InvalidOperationException("Could not find git repository root (.git not found)");

string propsPath = Path.Combine(repoRoot, "source", "Directory.Build.props");

if (!File.Exists(propsPath))
{
throw new FileNotFoundException($"Could not find {propsPath}");
}

XDocument doc = XDocument.Load(propsPath);
string? version = doc.Descendants("Version").FirstOrDefault()?.Value;

if (string.IsNullOrEmpty(version))
{
throw new InvalidOperationException("Could not find version in source/Directory.Build.props");
}

Terminal.WriteLine($"Checking if TimeWarp.Builder {version} is already published on NuGet.org...");

CommandOutput result = await Shell.Builder("dotnet")
.WithArguments("package", "search", "TimeWarp.Builder", "--exact-match", "--prerelease", "--source", "https://api.nuget.org/v3/index.json")
.WithNoValidation()
.CaptureAsync();

if (result.Stdout.Contains($"| {version} |", StringComparison.Ordinal))
{
Terminal.WriteErrorLine($"TimeWarp.Builder {version} is already published. Increment the version in source/Directory.Build.props.");
Environment.ExitCode = 1;
return Value;
}

Terminal.WriteLine($"✅ TimeWarp.Builder {version} is not yet published. Ready to release.");
return Value;
}
}
}
7 changes: 6 additions & 1 deletion tools/dev-cli/endpoints/clean.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
// ═══════════════════════════════════════════════════════════════════════════════
// Cleans the TimeWarp.Builder project and deletes all bin/obj directories.

#region Purpose
// 'dev clean' endpoint: runs dotnet clean and deletes bin/obj directories (sparing the dev CLI's own).
#endregion

namespace DevCli.Commands;

/// <summary>
Expand Down Expand Up @@ -48,12 +52,13 @@ public async ValueTask<Unit> Handle(CleanCommand command, CancellationToken ct)
}

// Also delete obj and bin directories for a thorough clean
// (sparing the dev CLI's own directories and the repo-root bin that holds the installed dev binary)
Terminal.WriteLine("\nDeleting obj and bin directories...");
string[] directoriesToDelete =
[
.. Directory.GetDirectories(repoRoot, "obj", SearchOption.AllDirectories)
.Concat(Directory.GetDirectories(repoRoot, "bin", SearchOption.AllDirectories))
.Where(d => !d.Contains(Path.Combine("tools", "dev-cli"))),
.Where(d => !d.Contains(Path.Combine("tools", "dev-cli")) && d != Path.Combine(repoRoot, "bin")),
];

foreach (string dir in directoriesToDelete)
Expand Down
Loading
Loading