From 81a35c5902d26b242a1d137f15b85184ba0e98d9 Mon Sep 17 00:00:00 2001 From: Max Obrist Date: Mon, 13 Apr 2026 02:03:05 +0700 Subject: [PATCH] fix(scribe): ci broke --- .gitignore | 6 +-- Directory.Build.props | 2 +- Scribe.Sdk/Sdk/Phases/Analyzer.targets | 11 ++-- Scribe.Sdk/Sdk/Phases/Companion.targets | 8 +-- Scribe.Sdk/Sdk/Phases/Library.targets | 7 ++- Scribe.Sdk/Sdk/Phases/Meta.targets | 18 +++---- Scribe.Sdk/Sdk/Phases/Stubs.targets | 4 +- Scribe.Sdk/Sdk/Sdk.targets | 19 ++++--- Scribe.slnx | 3 ++ Scribe/build/Scribe.LocalDev.props | 70 +++++++++++++++---------- Scribe/build/Scribe.LocalDev.targets | 6 +-- docs/architecture-infrastructure.md | 19 ++++--- docs/project-setup.md | 10 ++-- version.json | 2 +- 14 files changed, 107 insertions(+), 78 deletions(-) diff --git a/.gitignore b/.gitignore index f7684e3..09b9c0f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,5 @@ -# Scribe LocalDev sentinels — per-producer (.scribe.user, .hermetic.local, ...) -# Either suffix activates producer mode; both are supported (see Scribe docs). -*.user -*.local +# Scribe LocalDev sentinels — per-producer (.scribe.scribe, .hermetic.scribe, ...) +*.scribe # Build output bin/ diff --git a/Directory.Build.props b/Directory.Build.props index e48862f..d6c6975 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -21,7 +21,7 @@ $(MSBuildThisFileDirectory).. diff --git a/Scribe.Sdk/Sdk/Phases/Analyzer.targets b/Scribe.Sdk/Sdk/Phases/Analyzer.targets index 5608ed1..cc92b1c 100644 --- a/Scribe.Sdk/Sdk/Phases/Analyzer.targets +++ b/Scribe.Sdk/Sdk/Phases/Analyzer.targets @@ -11,8 +11,11 @@ Companion + Library. --> + + - + false Analyzer true @@ -20,8 +23,7 @@ + BeforeTargets="_GetPackageFiles"> @@ -31,8 +33,7 @@ + DependsOnTargets="ResolvePackageAssets"> <_ScribeSdkDep Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' diff --git a/Scribe.Sdk/Sdk/Phases/Companion.targets b/Scribe.Sdk/Sdk/Phases/Companion.targets index 99c6d27..cce0024 100644 --- a/Scribe.Sdk/Sdk/Phases/Companion.targets +++ b/Scribe.Sdk/Sdk/Phases/Companion.targets @@ -22,8 +22,11 @@ --> + + - + false @@ -44,7 +47,6 @@ conflicts at analyze time). --> @@ -68,7 +70,7 @@ TargetPathWithTargetPlatformMoniker carries them across the reference boundary. --> - + diff --git a/Scribe.Sdk/Sdk/Phases/Library.targets b/Scribe.Sdk/Sdk/Phases/Library.targets index 217f83c..63f18f4 100644 --- a/Scribe.Sdk/Sdk/Phases/Library.targets +++ b/Scribe.Sdk/Sdk/Phases/Library.targets @@ -26,8 +26,11 @@ (a companion typically s its Library). --> + + - + true @@ -49,7 +52,7 @@ --> + Condition="'@(ScribeCompanion)' != ''"> diff --git a/Scribe.Sdk/Sdk/Phases/Meta.targets b/Scribe.Sdk/Sdk/Phases/Meta.targets index 9a6966f..20f2ad1 100644 --- a/Scribe.Sdk/Sdk/Phases/Meta.targets +++ b/Scribe.Sdk/Sdk/Phases/Meta.targets @@ -29,8 +29,11 @@ --> + + - + false Analyzer true @@ -48,7 +51,7 @@ - + <_ScribeMetaArtifactsDir>$([MSBuild]::EnsureTrailingSlash('$(ArtifactsPath)')) $(_ScribeMetaArtifactsDir)packages\ $(RestoreAdditionalProjectSources);$(_ScribeMetaArtifactsDir)packages @@ -56,8 +59,7 @@ + BeforeTargets="_GetPackageFiles"> @@ -66,8 +68,7 @@ + DependsOnTargets="ResolvePackageAssets"> <_ScribeSdkMetaDep Include="@(ReferenceCopyLocalPaths)" Condition="'%(ReferenceCopyLocalPaths.NuGetPackageId)' != '' @@ -79,7 +80,7 @@ - + @@ -89,8 +90,7 @@ <_ScribeMetaOverrideVersion>$(NuGetPackageVersion) diff --git a/Scribe.Sdk/Sdk/Phases/Stubs.targets b/Scribe.Sdk/Sdk/Phases/Stubs.targets index fbfe015..1e2b272 100644 --- a/Scribe.Sdk/Sdk/Phases/Stubs.targets +++ b/Scribe.Sdk/Sdk/Phases/Stubs.targets @@ -19,7 +19,9 @@ InternalsVisibleTo or a shared linked source. --> - + + diff --git a/Scribe.Sdk/Sdk/Sdk.targets b/Scribe.Sdk/Sdk/Sdk.targets index d1b9731..469190b 100644 --- a/Scribe.Sdk/Sdk/Sdk.targets +++ b/Scribe.Sdk/Sdk/Sdk.targets @@ -10,14 +10,21 @@ + → type-specific phases only import when the matching flag is set. Gating + at the Import level (rather than on every PropertyGroup/Target inside) + keeps the per-type files free of per-node conditions that could drift. --> - - - - - + + + + + diff --git a/Scribe.slnx b/Scribe.slnx index 3ba87c9..2f4963b 100644 --- a/Scribe.slnx +++ b/Scribe.slnx @@ -1,5 +1,8 @@ + + + diff --git a/Scribe/build/Scribe.LocalDev.props b/Scribe/build/Scribe.LocalDev.props index 307634b..1488b2d 100644 --- a/Scribe/build/Scribe.LocalDev.props +++ b/Scribe/build/Scribe.LocalDev.props @@ -4,9 +4,8 @@ Per-project local NuGet development: each producer declares its own name via $(ScribesName), and activates "producer mode" when a sentinel file - '.$(ScribesName).user' or '.$(ScribesName).local' exists in $(ScribeRoot). - Consumer-side infrastructure activates whenever *any* such suffix sentinel - is present. + '.$(ScribesName).scribe' exists in $(ScribeRoot). Consumer-side + infrastructure activates whenever *any* such sentinel is present. ── Setup ────────────────────────────────────────────────────────────── @@ -23,18 +22,14 @@ ── Activation ───────────────────────────────────────────────────────── Producer mode (auto-pack, timestamped versions, override-file generation): - Create EITHER '.$(ScribesName).user' OR '.$(ScribesName).local' in - $(ScribeRoot), e.g. '.hermetic.user' or '.hermetic.local'. Both forms - are supported: '.user' follows the .NET convention (matches - VisualStudio.gitignore's '*.user' rule out of the box); '.local' reads - more naturally and matches the JS ecosystem (Vite, Next.js). Pick - whichever you prefer — either activates. Lowercase is canonical; - Windows matches case-insensitively, Linux does not. + Create '.$(ScribesName).scribe' in $(ScribeRoot), e.g. '.hermetic.scribe' + or '.scribe.scribe'. Lowercase is canonical (Windows matches case- + insensitively, Linux does not). The '.scribe' suffix is brand-unique + and gitignored via a single '*.scribe' rule. Consumer mode (local package source, import overrides from artifacts): - Activates when ANY '.*.user' or '.*.local' sentinel exists in - $(ScribeRoot), or when $(IsLocalScribe) is set true via CLI / - Directory.Build.props. + Activates when ANY '.*.scribe' sentinel exists in $(ScribeRoot), or + when $(IsLocalScribe) is set true via CLI / Directory.Build.props. ── Producer Set ──────────────────────────────────────────────────── @@ -48,10 +43,10 @@ $(IsLocalScribe) 'true' when any local sentinel is active (umbrella flag — governs consumer-side infra). - $(IsLocalProducer) 'true' when THIS project's '.$(ScribesName).user' - or '.$(ScribesName).local' sentinel exists - (applies to every project in the set — governs - auto-pack and override-file emission). + $(IsLocalProducer) 'true' when THIS project's '.$(ScribesName).scribe' + sentinel exists (applies to every project in + the set — governs auto-pack and override-file + emission). $(ScribeArtifactsDir) $(ScribeRoot)\.artifacts\ $(ScribePackagesDir) $(ScribeArtifactsDir)packages\ @@ -84,17 +79,26 @@ $(ScribeName) - - + - <_ScribeLocalSentinel Include="$(ScribeRoot)\.*.user" /> - <_ScribeLocalSentinel Include="$(ScribeRoot)\.*.local" /> + <_ScribeLocalSentinel Include="$(ScribeRoot)/.*.scribe" /> <_ScribeLocalSentinelList>@(_ScribeLocalSentinel) @@ -107,15 +111,14 @@ + Matches '.$(ScribesName).scribe' (lowercased) in $(ScribeRoot). --> - <_ScribeProducerBase>$(ScribeRoot)\.$(ScribesName.ToLowerInvariant()) + <_ScribeProducerSentinel>$(ScribeRoot)\.$(ScribesName.ToLowerInvariant()).scribe + and '$(_ScribeProducerSentinel)' != '' + and Exists('$(_ScribeProducerSentinel)')"> true @@ -123,7 +126,18 @@ $(ScribeRoot)\.artifacts\ $(ScribeArtifactsDir)packages\ - + + + + $(RestoreAdditionalProjectSources);$(ScribePackagesDir) diff --git a/Scribe/build/Scribe.LocalDev.targets b/Scribe/build/Scribe.LocalDev.targets index 1c233ab..f7df530 100644 --- a/Scribe/build/Scribe.LocalDev.targets +++ b/Scribe/build/Scribe.LocalDev.targets @@ -23,7 +23,7 @@ Scribe.LocalDev.props: $(ScribesName) Producer project name. Used for: - • sentinel detection: '.$(ScribesName).user' or '.$(ScribesName).local' + • sentinel detection: '.$(ScribesName).scribe' • auto-pack trigger: $(MSBuildProjectName) == $(ScribesName) • override file name: $(ScribesName).Directory.Packages.targets Example: Hermetic @@ -110,8 +110,8 @@ @@ -203,9 +202,9 @@ Two tiers of activation — one per-producer, one umbrella: Three activation methods (umbrella): -1. **Sentinel file (recommended):** Create `..user` OR `..local` in `$(ScribeRoot)` — e.g. `.scribe.user` to build Scribe locally, `.hermetic.local` to build Hermetic locally. Either form works. Delete to deactivate. Add to `.gitignore`. +1. **Sentinel file (recommended):** Create `..scribe` in `$(ScribeRoot)` — e.g. `.scribe.scribe` to build Scribe locally, `.hermetic.scribe` to build Hermetic locally. Delete to deactivate. Add to `.gitignore` via `*.scribe`. - **Why two forms?** `.user` is the .NET convention — `*.user` is in the standard [VisualStudio.gitignore](https://github.com/github/gitignore/blob/main/VisualStudio.gitignore), so it won't be accidentally committed. `.local` reads more naturally and matches the JS ecosystem (Vite, Next.js). Both are accepted rather than forcing a choice between idioms. + **Why `.scribe`?** The suffix is brand-unique — zero risk of collision with `.user` (VS project user settings) or `.local` (Vite/Next.js/prettier env files) that a future tool might also scan. One `.gitignore` line covers every producer. 2. **Explicit property:** `-p:IsLocalScribe=true` on the command line — consumer infra only. Does not activate any specific producer; pair with a `-p:IsLocalProducer=true` or a sentinel. 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 e7fe5c1..b8fb6af 100644 --- a/docs/project-setup.md +++ b/docs/project-setup.md @@ -274,7 +274,7 @@ In the producer's `Directory.Build.props`, set the producer name and package IDs `$(ScribesName)` drives three things: -- **Sentinel detection:** matches `.$(ScribesName).user` OR `.$(ScribesName).local` (lowercased, e.g. `.myframework.user` or `.myframework.local`) at `$(ScribeRoot)`. Either form activates — pick whichever you prefer. +- **Sentinel detection:** matches `.$(ScribesName).scribe` (lowercased, e.g. `.myframework.scribe`) at `$(ScribeRoot)`. - **Auto-pack trigger:** the MSBuild project whose name equals `$(ScribesName)` is the one that packs. - **Override file name:** generated as `$(ScribesName).Directory.Packages.targets`. @@ -300,9 +300,9 @@ For direct import from a sibling checkout: Activation is **per-producer**: -1. **Sentinel file (recommended):** Create EITHER `.$(ScribesName).user` OR `.$(ScribesName).local` at `$(ScribeRoot)` — for example `.myframework.user` or `.myframework.local`. Either form works; pick whichever you prefer. Delete to deactivate. Multiple producers can be activated independently (e.g. `.scribe.user` + `.hermetic.local`). Already `.gitignore`d via the `*.user` and `*.local` patterns. +1. **Sentinel file (recommended):** Create `.$(ScribesName).scribe` at `$(ScribeRoot)` — for example `.myframework.scribe`. Delete to deactivate. Multiple producers can be activated independently (e.g. `.scribe.scribe` + `.hermetic.scribe`). Already `.gitignore`d via a single `*.scribe` pattern. - **Why two forms?** `.user` is the long-standing .NET convention — `*.user` is already in the standard [VisualStudio.gitignore](https://github.com/github/gitignore/blob/main/VisualStudio.gitignore) so it won't be accidentally committed in any .NET repo. `.local` reads more naturally ("myframework, local variant") and matches the convention used by the JS ecosystem (Vite, Next.js, etc.). Rather than force a choice between "idiomatic .NET" and "idiomatic elsewhere," both are accepted. + **Why `.scribe`?** The suffix is brand-unique — zero risk of collision with `.user` (VS project user settings) or `.local` (Vite/Next.js/prettier env files) that a future tool might also scan. One `.gitignore` line (`*.scribe`) covers every producer regardless of name. 2. **MSBuild property:** `dotnet build -p:IsLocalScribe=true` — activates consumer infra only; pair with a sentinel or `-p:IsLocalProducer=true` to enable a producer. 3. **Props file:** Set `true` in `Directory.Build.props` or `Directory.Solution.props`. @@ -313,8 +313,8 @@ Building a producer **without** its sentinel triggers automatic cleanup: the pro | Property | Value when active | | ---------- | ------------------- | -| `$(IsLocalScribe)` | `true` when *any* `.*.user` or `.*.local` sentinel exists (umbrella — consumer infra) | -| `$(IsLocalProducer)` | `true` when `.$(ScribesName).user` or `.$(ScribesName).local` exists (per-producer — pack + overrides) | +| `$(IsLocalScribe)` | `true` when *any* `.*.scribe` sentinel exists (umbrella — consumer infra) | +| `$(IsLocalProducer)` | `true` when `.$(ScribesName).scribe` exists (per-producer — pack + overrides) | | `$(ScribeArtifactsDir)` | `$(ScribeRoot)\.artifacts\` | | `$(ScribePackagesDir)` | `$(ScribeArtifactsDir)packages\` | diff --git a/version.json b/version.json index 2a2e82c..9b37024 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.4", + "version": "0.5", "nugetPackageVersion": { "semVer": 2 },