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
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@
tests/Golden/*.json -text
tests/Golden/PublicApi-*.txt -text
tests/RandomNameGeneratorLibrary.GoldenTests/Exceptions/*.json -text
# The Unity package carries the nuget.org assembly and its XML docs byte for byte (tools/UnityPackage/sync.py --check).
Packages/*/Runtime/*.dll binary
Packages/*/Runtime/*.xml -text
2 changes: 2 additions & 0 deletions .github/images/banner.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

`banner.jpg` is the picture at the top of the README. It was generated locally with Z-Image Turbo (bf16) in ComfyUI: 1536x640, 9 steps, cfg 1.0, sampler res_multistep, scheduler simple, seed 2480512915, then resized to 1280x533 and saved as JPEG. The same prompt and seed give the same picture.

`openupm-cover.jpg` is the OpenUPM listing's cover: the middle 1066x533 (2:1) of `banner.jpg`, cropped with Pillow and saved at JPEG quality 90.

Prompt:

> a hand-drawn map of a fictional land dotted with many little towns under a starry night sky, a spinning wheel of blank name cards in front, wide cinematic banner illustration, painterly digital art, soft volumetric light, rich but muted colour palette, detailed, storybook atmosphere, no text, no letters, no words, no logos, no watermark
Binary file added .github/images/openupm-cover.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The NuGet package `RandomNameGeneratorLibrary` (namespace `RandomNameGeneratorLi
- **Targets.** The library multi-targets `netstandard2.0` and `net10.0`: no net5+ APIs (`ArgumentNullException.ThrowIfNull`, `HashCode`) without an `#if` or a polyfill. The net10.0 build is trim and AOT compatible.
- **Tests cover every artifact.** Golden, unit, package validation at pack time, the consumers in `tests/consumers/run.sh` (packed package in CI, nuget.org in `verify-published.yml`). A behaviour change lands with its test. Tests never touch the network.
- **Nothing reaches nuget.org without the maintainer.** No API key is stored anywhere; `release.yml` publishes through Trusted Publishing from a job that waits at the `nuget` environment for the maintainer's approval. Never push a package from a machine.
- **Releases follow one ritual.** Update `CHANGELOG.md` (a release heading carries its date), set `<Version>` in `RandomNameGeneratorLibrary/RandomNameGeneratorLibrary.csproj`, merge, wait for `ci` to be green on `master`, then tag `v<version>` and push the tag. `release.yml` builds, tests, packs, attests, waits for the approval, pushes and creates the GitHub Release. Then run `verify-published` with the version. Tag only after green: a tag on a failing commit burns the version number, because tags are not force-pushed here.
- **Releases follow one ritual.** Update `CHANGELOG.md` (a release heading carries its date), set `<Version>` in `RandomNameGeneratorLibrary/RandomNameGeneratorLibrary.csproj`, merge, wait for `ci` to be green on `master`, then tag `v<version>` and push the tag. `release.yml` builds, tests, packs, attests, waits for the approval, pushes and creates the GitHub Release. Then run `verify-published` with the version, and bring the Unity package along: `python tools/UnityPackage/sync.py <version>`, merge, tag the merge commit `upm/<version>` and push that tag (OpenUPM builds from it; `release.yml` ignores it). Tag only after green: a tag on a failing commit burns the version number, because tags are not force-pushed here.
- **Dependencies.** The library has none; keep it that way. Lock files are committed (`RestorePackagesWithLockFile`); run plain `dotnet restore` after changing a PackageReference and commit the lock file; CI restores with `--locked-mode`. Dependabot opens weekly pull requests (nuget, dotnet-sdk, github-actions); merge when `ci` is green. Actions are pinned to commit SHAs; keep it that way. New package versions wait seven days before Dependabot proposes them, and three days before an agent installs them by hand.
- **Research beats recall.** SDK, package and action versions change; re-verify any version older than three months.
- **Document for handoff.** Anything learned, decided or built goes into `ai-docs/` before you finish; rewrite `ai-docs/HANDOFF.md` when work is left unfinished.
Expand All @@ -39,6 +39,7 @@ bash tests/consumers/run.sh VERSION artifacts # fresh consumers of the pac
- The Visual Studio `.gitignore` ignores every `log/` folder; everlast's `ai-docs/log.md` is a file and is unaffected.
- The publish job has no checkout, so it pins `dotnet-version` instead of reading `global.json`.
- After a release, set `PackageValidationBaselineVersion` to the released version.
- `Packages/com.m4bwav.random-name-generator` is the Unity package (OpenUPM). Its `Runtime/` DLL and XML are copied from the nuget.org package by `tools/UnityPackage/sync.py`, never built here, and `.gitattributes` keeps them byte for byte; `sync.py --check` proves it. Unity can't compile the source because the name lists are embedded resources. Keep the `.meta` files: Unity ignores files without one in a registry package. OpenUPM (`data/packages/com.m4bwav.random-name-generator.yml` in openupm/openupm) uses `gitTagPrefix: upm/`, so the `v*` NuGet tags never reach it. Web (WebGL) builds drop embedded resources unless `PlayerSettings.WebGL.useEmbeddedResources` is on; `Editor/WebGLEmbeddedResourcesCheck.cs` logs an error when it is off. Details: `ai-docs/notes/2026-10-11-openupm-unity-package.md`.

## everlast (session knowledge, load on demand)

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to RandomNameGeneratorLibrary. The format follows [Keep a Ch

## [Unreleased]

### Added

- A Unity package, `com.m4bwav.random-name-generator` (OpenUPM), in `Packages/com.m4bwav.random-name-generator`. It carries the published 2.3.0 `netstandard2.0` assembly byte for byte, so the NuGet package is unchanged. `tools/UnityPackage/sync.py` copies each new release's assembly from nuget.org; OpenUPM builds from `upm/<version>` tags. Web builds need Player Settings > Use Embedded Resources; an editor script in the package logs an error when a Web build has it off.

## [2.3.0] - 2026-09-28

2.3.0 answers every call as 2.2.0 did, on .NET Framework and on .NET, except for place names: `tests/Golden` holds 426 calls recorded from the published 2.2.0 on each runtime, and the golden tests replay them against every build. The 35 calls per runtime that draw from the place list are the one exception, pinned separately. No public type, member or parameter name changed.
Expand Down
8 changes: 8 additions & 0 deletions Packages/com.m4bwav.random-name-generator/Editor.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"name": "RandomNameGenerator.Editor",
"rootNamespace": "RandomNameGeneratorLibrary.Editor",
"references": [],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": [],
"versionDefines": [],
"noEngineReferences": false
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

namespace RandomNameGeneratorLibrary.Editor
{
// The name lists are embedded resources in RandomNameGeneratorLibrary.dll. Web builds leave embedded resources out
// unless Player Settings > Publishing Settings > Use Embedded Resources is on, and every generator then throws
// InvalidOperationException ("Embedded resource ... was not found") at runtime. Other platforms keep them.
internal sealed class WebGLEmbeddedResourcesCheck : IPreprocessBuildWithReport
{
public int callbackOrder => 0;

public void OnPreprocessBuild(BuildReport report)
{
if (report.summary.platform == BuildTarget.WebGL && !PlayerSettings.WebGL.useEmbeddedResources)
{
Debug.LogError("Random Name Generator: turn on Player Settings > Publishing Settings > Use Embedded Resources "
+ "(PlayerSettings.WebGL.useEmbeddedResources) for Web builds. Without it the name lists are left out "
+ "and every generator throws InvalidOperationException at runtime.");
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions Packages/com.m4bwav.random-name-generator/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2014-2026 Mark Rogers

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
7 changes: 7 additions & 0 deletions Packages/com.m4bwav.random-name-generator/LICENSE.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Packages/com.m4bwav.random-name-generator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Random Name Generator for Unity

Random person and place names drawn from US census data, and the names of real stars. This is the NuGet package [RandomNameGeneratorLibrary](https://www.nuget.org/packages/RandomNameGeneratorLibrary/) for Unity: `Runtime/RandomNameGeneratorLibrary.dll` is its `netstandard2.0` assembly, byte for byte as nuget.org serves it.

```csharp
using RandomNameGeneratorLibrary;

var people = new PersonNameGenerator(42); // same seed, same names on every platform
string name = people.GenerateRandomFirstAndLastName();
string place = new PlaceNameGenerator().GenerateRandomPlaceName();
string star = new StarNameGenerator().GenerateRandomStarName();
```

**Web builds:** turn on Player Settings > Publishing Settings > Use Embedded Resources. Unity leaves embedded resources out of Web builds otherwise, so the name lists are missing and every generator throws `InvalidOperationException`. The package's editor script logs an error when a Web build has the setting off. Other platforms, IL2CPP included, need nothing.

One generator per thread. The full guide, the method list and the seeding rules are in the [repository README](https://github.com/m4bwav/DotNetRandomNameGenerator#readme) and the [wiki](https://github.com/m4bwav/DotNetRandomNameGenerator/wiki).
7 changes: 7 additions & 0 deletions Packages/com.m4bwav.random-name-generator/README.md.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions Packages/com.m4bwav.random-name-generator/Runtime.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading