From d72f800c877bcb745c68ee52fcc50bf031f8bc39 Mon Sep 17 00:00:00 2001 From: Max Obrist Date: Mon, 6 Apr 2026 10:22:25 +0700 Subject: [PATCH] feat(scribe): the local dev flow is now configured with a .localscribelockfile --- .claude/CLAUDE.md | 8 ++--- .github/copilot-instructions.md | 8 ++--- .gitignore | 3 ++ Scribe/build/Scribe.LocalDev.props | 51 +++++++++++++--------------- Scribe/build/Scribe.LocalDev.targets | 18 ++++++++-- docs/architecture-infrastructure.md | 15 ++++---- docs/project-setup.md | 2 +- version.json | 2 +- 8 files changed, 61 insertions(+), 46 deletions(-) diff --git a/.claude/CLAUDE.md b/.claude/CLAUDE.md index 16411aa..43d7c3f 100644 --- a/.claude/CLAUDE.md +++ b/.claude/CLAUDE.md @@ -33,7 +33,7 @@ Scribe is a **public, reusable library**. It is open-sourced independently. It m ## The Compass — Where to Find What You Need | Document | What it covers | -|---|---| +| --- | --- | | [README](../README.md) | Overview, quick start, component table, doc index | | [Writing Generators](../docs/writing-generators.md) | Transform -> Register -> Render pattern, Quill usage guide | | [Project Setup](../docs/project-setup.md) | .csproj configuration, packaging, Stubs, LocalDev multi-repo workflow with automatic local NuGet resolution | @@ -48,7 +48,7 @@ Scribe is a **public, reusable library**. It is open-sourced independently. It m ## Terminology | Term | What it is | -|---|---| +| --- | --- | | **Quill** | The fluent source builder — handles indentation, blank-line separation, using directives, namespaces, and XML documentation. | | **Template** | Structured output template for generated code. | | **Naming** | Naming convention helpers for generated identifiers. | @@ -115,7 +115,7 @@ This repository uses [Conventional Commits](https://www.conventionalcommits.org/ **Format:** `(): ` | Type | When to use | -|---|---| +| --- | --- | | `feat` | A new feature or public surface addition | | `fix` | A bug fix | | `docs` | Documentation-only changes | @@ -155,7 +155,7 @@ git config core.hooksPath .githooks ## CI/CD | Workflow | Trigger | What it does | -|---|---|---| +| --- | --- | --- | | **Build & Test** (`build-test.yml`) | Push to `master`, PRs to `master` | Restore → Build (Release) → Test → Upload packages as artefact | | **Release** (`release.yml`) | Manual dispatch from `master` | Build → Test → Push to NuGet → Tag commit → Create GitHub Release with notes derived from conventional commits | diff --git a/.github/copilot-instructions.md b/.github/copilot-instructions.md index 16411aa..43d7c3f 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -33,7 +33,7 @@ Scribe is a **public, reusable library**. It is open-sourced independently. It m ## The Compass — Where to Find What You Need | Document | What it covers | -|---|---| +| --- | --- | | [README](../README.md) | Overview, quick start, component table, doc index | | [Writing Generators](../docs/writing-generators.md) | Transform -> Register -> Render pattern, Quill usage guide | | [Project Setup](../docs/project-setup.md) | .csproj configuration, packaging, Stubs, LocalDev multi-repo workflow with automatic local NuGet resolution | @@ -48,7 +48,7 @@ Scribe is a **public, reusable library**. It is open-sourced independently. It m ## Terminology | Term | What it is | -|---|---| +| --- | --- | | **Quill** | The fluent source builder — handles indentation, blank-line separation, using directives, namespaces, and XML documentation. | | **Template** | Structured output template for generated code. | | **Naming** | Naming convention helpers for generated identifiers. | @@ -115,7 +115,7 @@ This repository uses [Conventional Commits](https://www.conventionalcommits.org/ **Format:** `(): ` | Type | When to use | -|---|---| +| --- | --- | | `feat` | A new feature or public surface addition | | `fix` | A bug fix | | `docs` | Documentation-only changes | @@ -155,7 +155,7 @@ git config core.hooksPath .githooks ## CI/CD | Workflow | Trigger | What it does | -|---|---|---| +| --- | --- | --- | | **Build & Test** (`build-test.yml`) | Push to `master`, PRs to `master` | Restore → Build (Release) → Test → Upload packages as artefact | | **Release** (`release.yml`) | Manual dispatch from `master` | Build → Test → Push to NuGet → Tag commit → Create GitHub Release with notes derived from conventional commits | diff --git a/.gitignore b/.gitignore index 4079ad2..cbca5af 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,6 @@ +# Scribe LocalDev sentinel +.localscribe + # Build output bin/ obj/ diff --git a/Scribe/build/Scribe.LocalDev.props b/Scribe/build/Scribe.LocalDev.props index 3450aca..a8f8bd5 100644 --- a/Scribe/build/Scribe.LocalDev.props +++ b/Scribe/build/Scribe.LocalDev.props @@ -2,9 +2,9 @@ - - - Debug;Release - $(Configurations);Debug (Local Scribe);Release (Local Scribe) - - - - - + + + true - - Debug - Release - + $(ScribeRoot)\.artifacts\ $(ScribeArtifactsDir)packages\ diff --git a/Scribe/build/Scribe.LocalDev.targets b/Scribe/build/Scribe.LocalDev.targets index b28c0b9..b5acfb3 100644 --- a/Scribe/build/Scribe.LocalDev.targets +++ b/Scribe/build/Scribe.LocalDev.targets @@ -23,6 +23,16 @@ Output: $(ScribeArtifactsDir).Directory.Packages.targets --> + + + + <_ScribeLocalDevTargetsSkip>true + + + <_ScribeLocalDevTargetsImported>true + + - + $(ScribeLocalDevTriggerProject) diff --git a/docs/architecture-infrastructure.md b/docs/architecture-infrastructure.md index a3d92a8..f6e1e32 100644 --- a/docs/architecture-infrastructure.md +++ b/docs/architecture-infrastructure.md @@ -50,19 +50,22 @@ Prevents double-import when both a NuGet package and a direct file import bring All subsequent property groups and imports are conditioned on `'$(_ScribeLocalDevSkip)' != 'true'`. -### Configuration Injection +### Sentinel File Detection -Appends `Debug (Local Scribe)` and `Release (Local Scribe)` to the `$(Configurations)` property so they appear in IDE dropdowns: +Activates Local Scribe mode when a `.localscribe` file exists in `$(ScribeRoot)` (the shared workspace root). This works in both Visual Studio and CLI builds without build configuration hacks. ```xml -$(Configurations);Debug (Local Scribe);Release (Local Scribe) + + true + ``` -### Configuration Detection - Three activation methods: -1. **Configuration suffix:** `$(Configuration)` ends with `(Local Scribe)` — detected and normalized back to `Debug` or `Release`. +1. **Sentinel file (recommended):** Create `.localscribe` in `$(ScribeRoot)`. Delete it to deactivate. Add `.localscribe` to `.gitignore`. 2. **Explicit property:** `-p:IsLocalScribe=true` on the command line. 3. **Props file:** `true` in Directory.Build.props or Directory.Solution.props. diff --git a/docs/project-setup.md b/docs/project-setup.md index a0046d1..2674d54 100644 --- a/docs/project-setup.md +++ b/docs/project-setup.md @@ -199,7 +199,7 @@ For direct import from a sibling checkout: Three ways to activate LocalDev: -1. **Build configuration:** Select `Debug (Local Scribe)` or `Release (Local Scribe)` in your IDE — configurations are injected automatically. +1. **Sentinel file (recommended):** Create a `.localscribe` file in `$(ScribeRoot)` (the shared workspace root). Delete it to deactivate. Add `.localscribe` to `.gitignore`. 2. **MSBuild property:** `dotnet build -p:IsLocalScribe=true` 3. **Props file:** Set `true` in `Directory.Build.props` or `Directory.Solution.props`. diff --git a/version.json b/version.json index 8937b2f..64fa533 100644 --- a/version.json +++ b/version.json @@ -1,6 +1,6 @@ { "$schema": "https://raw.githubusercontent.com/dotnet/Nerdbank.GitVersioning/main/src/NerdBank.GitVersioning/version.schema.json", - "version": "0.2", + "version": "0.3", "nugetPackageVersion": { "semVer": 2 },