Skip to content
Open
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
7 changes: 4 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<VersionPrefix>1.1.1</VersionPrefix>
<Version>$(VersionPrefix)</Version>
<PackageVersion>$(VersionPrefix)</PackageVersion>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>alpha.1</VersionSuffix>
<Version>$(VersionPrefix)-$(VersionSuffix)</Version>
<PackageVersion>$(Version)</PackageVersion>
<AssemblyVersion>$(VersionPrefix).0</AssemblyVersion>
<FileVersion>$(VersionPrefix).0</FileVersion>
<SelfContained>false</SelfContained>
Expand Down
1 change: 1 addition & 0 deletions Icod.LineEditor.Ed.Shared/Icod.LineEditor.Ed.Shared.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Icod.CommandFramework" Version="2.1.0" />
<PackageReference Include="Icod.Expressions" Version="0.1.0-alpha.1" Aliases="Expressions" />
<PackageReference Include="Icod.Processes" Version="1.2.0" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
Expand Down
19 changes: 8 additions & 11 deletions Icod.LineEditor.Ed.Shared/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,19 +21,16 @@ The project deliberately has no runtime reference to `Icod.DiffUtils.Shared`. Co

## Dependency direction

The permanent repository boundary is:
The repository dependency boundary is:

```text
Published neutral foundation
Icod.CommandFramework 2.1.0
↓ PackageReference
Icod.LineEditor.Ed.Shared
↓ ↓
ed red
ProjectReference
```
| Project | Dependencies |
|---|---|
| `Icod.LineEditor.Ed.Shared` | `Icod.CommandFramework 2.1.0`, `Icod.Expressions 0.1.0-alpha.1`, `Icod.Processes 1.2.0` |
| `ed`, `red` | The repository-local shared engine and aliased `Icod.Expressions` regex providers |

The shared engine consumes GNU regular-expression contracts from published `Icod.Expressions 0.1.0-alpha.1`. It continues to consume record, process, temporary-file, filesystem, metadata, traversal, and transactional-replacement contracts from published `Icod.CommandFramework 2.1.0`. The Expressions package currently retains the `Icod.CommandFramework.RegularExpressions` namespace, so source files use an assembly alias to distinguish the types.

The shared engine consumes neutral command-line, record, regular-expression, process, temporary-file, filesystem, metadata, traversal, and transactional-replacement contracts from the published `Icod.CommandFramework` package.
The public `EditorEngine` provider parameter now has `Icod.Expressions` assembly identity. In-process callers injecting a provider must reference that package and update their provider type; this is a source and binary API change in the planned `2.0.0-alpha.1` prerelease. Additional API refactoring may follow before the stable 2.0 release.

`ed` and `red` consume this engine through repository-local `ProjectReference` relationships. The library has no source-tree dependency on `Icod.CoreUtils.Shared`.

Expand Down
10 changes: 6 additions & 4 deletions Icod.LineEditor.Ed.Shared/src/EditorEngine.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
extern alias Expressions;

namespace Icod.LineEditor.Ed;

using System.Globalization;
using System.Text;
using Icod.CommandFramework.Records;
using Icod.CommandFramework.RegularExpressions;
using Expressions::Icod.CommandFramework.RegularExpressions;

/// <summary>
/// Executes Ed scripts over a mutable, stable-identity line buffer using injectable regular-expression,
Expand Down Expand Up @@ -34,7 +36,7 @@ public EditorEngine() : this(

/// <summary>Initializes an engine from one immutable capability profile.</summary>
/// <param name="profile">The policy and capabilities exposed to the engine.</param>
/// <param name="regularExpressionProvider">The Shared GNU regular-expression provider.</param>
/// <param name="regularExpressionProvider">The Icod.Expressions GNU regular-expression provider.</param>
public EditorEngine(
EditorCapabilityProfile profile,
IRegularExpressionProvider regularExpressionProvider
Expand All @@ -50,7 +52,7 @@ IRegularExpressionProvider regularExpressionProvider
/// <param name="securityPolicy">The immutable parser and dispatch policy.</param>
/// <param name="fileAccess">The filename-bearing capability.</param>
/// <param name="processAccess">The process capability.</param>
/// <param name="regularExpressionProvider">The Shared GNU BRE provider.</param>
/// <param name="regularExpressionProvider">The Icod.Expressions GNU BRE provider.</param>
public EditorEngine(
EditorSecurityPolicy securityPolicy,
IEditorFileAccess fileAccess,
Expand All @@ -71,7 +73,7 @@ IRegularExpressionProvider regularExpressionProvider
/// <summary>Creates a restricted engine rooted at the supplied working directory.</summary>
/// <param name="workingDirectory">The captured working directory.</param>
/// <param name="fileAccess">The underlying file capability to constrain beneath the captured directory.</param>
/// <param name="regularExpressionProvider">An optional Shared GNU BRE provider.</param>
/// <param name="regularExpressionProvider">An optional Icod.Expressions GNU BRE provider.</param>
/// <returns>The configured engine.</returns>
public static EditorEngine CreateRestricted(
string workingDirectory,
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ It calls the managed command implementations directly and does not spawn the sta

## Installation and distribution

The distribution router is published as the .NET tool package `Icod.LineEditor.Tools`. Install version `1.1.1` with:
The last stable distribution router is published as the .NET tool package `Icod.LineEditor.Tools`. Install version `1.1.1` with:

```text
dotnet tool install --global Icod.LineEditor.Tools --version 1.1.1
Expand Down Expand Up @@ -183,7 +183,9 @@ The solution defines `Debug`, `Staging`, and `Release` configurations. Release b

## Versioning

Repository versioning is centralized in the root [`Directory.Build.props`](Directory.Build.props). `VersionPrefix` is the single authoritative release-version literal and is currently `1.1.1`. `Version`, `PackageVersion`, `AssemblyVersion`, and `FileVersion` are derived from it for projects in the repository.
Repository versioning is centralized in the root [`Directory.Build.props`](Directory.Build.props). This branch prepares the unpublished `2.0.0-alpha.1` prerelease: `VersionPrefix` is `2.0.0`, `VersionSuffix` is `alpha.1`, and the package version combines them. `AssemblyVersion` and `FileVersion` remain numeric `2.0.0.0`.

The prerelease moves the `ed`/`red` injectable regex provider from the CommandFramework assembly to `Icod.Expressions 0.1.0-alpha.1`. In-process callers of `EditorEngine` must reference `Icod.Expressions` and pass its provider type; this changes source and binary API identity. The command-line interfaces remain the same. Further API refactoring may occur before stable 2.0. `sed` will migrate in a separate change.

For a tagged release, the `v<semver>` tag must agree with the generated NuGet package version. The release workflow selects packages by their actual nuspec version, so a mismatched tag cannot silently publish a differently versioned package.

Expand Down
1 change: 1 addition & 0 deletions ed/Icod.LineEditor.Ed.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ItemGroup>
<ProjectReference Include="..\Icod.LineEditor.Ed.Shared\Icod.LineEditor.Ed.Shared.csproj" />
<PackageReference Include="Icod.CommandFramework" Version="2.1.0" />
<PackageReference Include="Icod.Expressions" Version="0.1.0-alpha.1" Aliases="Expressions" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ErrorReport>prompt</ErrorReport>
Expand Down
2 changes: 1 addition & 1 deletion ed/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ Editor-command errors can interact with `--loose-exit-status` as described above

## PLATFORM NOTES

The project targets .NET 10 with C# 13 and is tested on Windows, Linux, and macOS. Neutral command-line, regular-expression, process, record, filesystem, and transactional-replacement mechanics come from the published `Icod.CommandFramework` package. Mutable Ed-family behavior remains in `Icod.LineEditor.Ed.Shared`.
The project targets .NET 10 with C# 13 and is tested on Windows, Linux, and macOS. GNU regular-expression matching comes from `Icod.Expressions`; neutral command-line, process, record, filesystem, and transactional-replacement mechanics remain in `Icod.CommandFramework`. Mutable Ed-family behavior remains in `Icod.LineEditor.Ed.Shared`.

## AUTHORS

Expand Down
4 changes: 3 additions & 1 deletion ed/src/Command.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
extern alias Expressions;

namespace Icod.LineEditor.Ed;

using System.Globalization;
using System.Text;
using Icod.CommandFramework.CommandLine;
using Icod.CommandFramework.Diagnostics;
using Icod.CommandFramework.Records;
using Icod.CommandFramework.RegularExpressions;
using Expressions::Icod.CommandFramework.RegularExpressions;

/// <summary>
/// Implements the GNU-compatible line editor over <see cref="EditorEngine"/>.
Expand Down
25 changes: 13 additions & 12 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ lineeditor packable as Icod.LineEditor.Tools
Therefore solution-wide `dotnet pack` must produce exactly the router package for the coordinated release version:

```text
Icod.LineEditor.Tools.1.1.0.nupkg
Icod.LineEditor.Tools.2.0.0-alpha.1.nupkg
```

The standalone `ed`, `red`, and `sed` commands remain release artifacts through the six RID ZIP archives; disabling NuGet packing does not remove them from builds, tests, or executable archive publication. `Icod.LineEditor.Ed.Shared` remains a repository-local implementation library.
Expand All @@ -54,16 +54,17 @@ The standalone `ed`, `red`, and `sed` commands remain release artifacts through
Repository versioning is centralized in the root `Directory.Build.props`:

```xml
<VersionPrefix>1.1.0</VersionPrefix>
<VersionPrefix>2.0.0</VersionPrefix>
<VersionSuffix>alpha.1</VersionSuffix>
```

`VersionPrefix` is the single authoritative release-version literal. The repository derives:
`VersionPrefix` and `VersionSuffix` prepare the prerelease. The repository derives:

```text
Version = 1.1.0
PackageVersion = 1.1.0
AssemblyVersion = 1.1.0.0
FileVersion = 1.1.0.0
Version = 2.0.0-alpha.1
PackageVersion = 2.0.0-alpha.1
AssemblyVersion = 2.0.0.0
FileVersion = 2.0.0.0
```

Production projects inherit these values unless a future project has an explicit reason to override them. Release tags must agree with the generated package version; `SelectReleasePackages.ps1` verifies the actual nuspec version before publication.
Expand Down Expand Up @@ -209,12 +210,12 @@ That `README.md` is sourced from the repository root and packed at the NuGet pac

## Release checklist

Before pushing release tag `v1.1.0`:
Before pushing release tag `v2.0.0-alpha.1`:

1. confirm `Directory.Build.props` still declares `VersionPrefix` `1.1.0`;
2. confirm solution-wide pack produces only `Icod.LineEditor.Tools.1.1.0.nupkg`;
3. confirm `lineeditor --version` reports `1.1.0` from assembly informational version metadata;
1. confirm `Directory.Build.props` declares `VersionPrefix` `2.0.0` and `VersionSuffix` `alpha.1`;
2. confirm solution-wide pack produces only `Icod.LineEditor.Tools.2.0.0-alpha.1.nupkg`;
3. confirm `lineeditor --version` reports `2.0.0-alpha.1` from assembly informational version metadata;
4. confirm the root README installation example and package identity are current;
5. confirm PR Staging validation is green;
6. merge to `main` and require the six-runner Release validation to pass; and
7. only then push tag `v1.1.0`.
7. only then push tag `v2.0.0-alpha.1`.
5 changes: 4 additions & 1 deletion packaging/SelectReleasePackages.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,17 @@ $packages = @(
)
foreach ($package in $packages) {
$metadata = Get-PackageMetadata -PackagePath $package.FullName
if ($metadata.Version -ne $ExpectedVersion) {
if ($metadata.Version -ne $ExpectedVersion -or $metadata.Id -ne 'Icod.LineEditor.Tools') {
continue
}
Copy-Item -LiteralPath $package.FullName -Destination (Join-Path $DestinationDirectory $package.Name)
$selected += $package.Name
}

$hasPackages = 0 -lt $selected.Count
if (1 -ne $selected.Count) {
throw "Expected exactly one Icod.LineEditor.Tools package for release $ExpectedVersion; selected $($selected.Count)."
}
if (-not [string]::IsNullOrWhiteSpace($GitHubOutputPath)) {
"has_packages=$($hasPackages.ToString().ToLowerInvariant())" >> $GitHubOutputPath
"package_count=$($selected.Count)" >> $GitHubOutputPath
Expand Down
1 change: 1 addition & 0 deletions packaging/VerifyPackageArtifact.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ foreach($package in $packages){
$archive=[System.IO.Compression.ZipFile]::OpenRead($package.FullName)
try{
if(-not [string]::IsNullOrWhiteSpace($metadata.Readme) -and $null -eq ($archive.Entries|Where-Object{$_.FullName -eq $metadata.Readme}|Select-Object -First 1)){throw "Package '$($package.Name)' declares a missing readme."}
if('Icod.LineEditor.Tools' -eq $metadata.Id -and $null -eq $archive.GetEntry('tools/net10.0/any/Icod.Expressions.dll')){throw "Package '$($package.Name)' is missing the Icod.Expressions runtime assembly."}
}finally{$archive.Dispose()}
}
if(-not [string]::IsNullOrWhiteSpace($GitHubOutputPath)){"package_count=$($packages.Count)" >> $GitHubOutputPath;"has_packages=$((0 -lt $packages.Count).ToString().ToLowerInvariant())" >> $GitHubOutputPath}
Expand Down
1 change: 1 addition & 0 deletions red/Icod.LineEditor.Red.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
<ItemGroup>
<ProjectReference Include="..\Icod.LineEditor.Ed.Shared\Icod.LineEditor.Ed.Shared.csproj" />
<PackageReference Include="Icod.CommandFramework" Version="2.1.0" />
<PackageReference Include="Icod.Expressions" Version="0.1.0-alpha.1" Aliases="Expressions" />
</ItemGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<ErrorReport>prompt</ErrorReport>
Expand Down
4 changes: 3 additions & 1 deletion red/src/Command.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
extern alias Expressions;

namespace Icod.LineEditor.Red;

using Icod.LineEditor.Ed;
Expand All @@ -7,7 +9,7 @@ namespace Icod.LineEditor.Red;
using Icod.CommandFramework.CommandLine;
using Icod.CommandFramework.Diagnostics;
using Icod.CommandFramework.Records;
using Icod.CommandFramework.RegularExpressions;
using Expressions::Icod.CommandFramework.RegularExpressions;

/// <summary>
/// Implements the GNU-compatible restricted line editor over <see cref="EditorEngine"/>.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<ItemGroup>
<ProjectReference Include="..\..\Icod.LineEditor.Ed.Shared\Icod.LineEditor.Ed.Shared.csproj" />
<PackageReference Include="Icod.CommandFramework" Version="2.1.0" />
<PackageReference Include="Icod.Expressions" Version="0.1.0-alpha.1" Aliases="Expressions" />
</ItemGroup>
<ItemGroup>
<None Update="fixtures\**\*" CopyToOutputDirectory="PreserveNewest" />
Expand Down
15 changes: 14 additions & 1 deletion tests/Ed.Shared.Tests/src/EditorEngineTests.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
extern alias Expressions;

namespace Icod.LineEditor.Ed.Shared.Tests;

using System.Text;
using Icod.CommandFramework.RegularExpressions;
using Expressions::Icod.CommandFramework.RegularExpressions;
using Icod.LineEditor.Ed;

public sealed class EditorEngineTests {
[Fact]
public void InjectableRegexProviderUsesExpressionsAssembly() {
var constructor = typeof( EditorEngine ).GetConstructors().Single(
candidate => candidate.GetParameters().Length == 4
);
Assert.Equal(
"Icod.Expressions",
constructor.GetParameters()[3].ParameterType.Assembly.GetName().Name
);
}

[Fact]
public async Task ExecutesMutationAddressMarkCutAndUndoCommands() {
var engine = CreateEngine();
Expand Down
4 changes: 3 additions & 1 deletion tests/Ed.Shared.Tests/src/SecurityAndCompatibilityTests.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
extern alias Expressions;

namespace Icod.LineEditor.Ed.Shared.Tests;

using System.Diagnostics;
using System.Text;
using Icod.CommandFramework.RegularExpressions;
using Expressions::Icod.CommandFramework.RegularExpressions;
using Icod.LineEditor.Ed;

public sealed class SecurityAndCompatibilityTests {
Expand Down
Loading