npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

com.xmobitea.changx.mini-autogenerate

v1.5.2

Published

XmobiTea Unity Toolkit packages

Readme

XmobiTea AutoGenerate

Editor-only Unity helper package for writing generated text files and normalizing names into restricted ASCII tokens that callers can reuse in generated code.

AI Entry Points

Use the smallest file for the task.

| Need | Use | | --- | --- | | Generate editor code or sanitize a constant name | AI_USAGE.md | | Exact signatures, namespace, assembly, menu/MCP availability | AI_API_REFERENCE.md | | Path, overwrite, refresh, and sanitization edge cases | AI_BEHAVIOR.md | | Package-level rules and maintenance checklist | AGENTS.md | | Missing or conflicting detail | Editor/AutoGenerate.cs |

Core Contract

  • Editor-only; do not reference from Runtime/player code.
  • Namespace: XmobiTea.MiniAutoGenerate.Editor.
  • Main class: AutoGenerate.
  • Public methods:
    • GenerateFile(string fileName, StringBuilder contentBuilder, string fullPath)
    • GetConstantName(string name)
  • GenerateFile(...) creates fullPath when needed, then writes caller-provided content to fullPath + fileName.
  • GenerateFile(...) deletes any existing target before writing the new file, so a failed write can leave the target missing or partially recreated.
  • GenerateFile(...) refreshes the AssetDatabase only after a successful write.
  • GetConstantName(...) keeps only ASCII letters/digits and may prepend _.
  • GetConstantName(...) does not preserve _, does not handle C# keywords, and does not prevent collisions after normalization.
  • No scene setup, settings asset, menu item, editor window, runtime pipeline, or MCP Unity server entrypoint.

Common Calls

using System.Text;
using UnityEditor;
using UnityEngine;
using XmobiTea.MiniAutoGenerate.Editor;

public static class ExampleGenerator
{
    [MenuItem("Tools/Generate ExampleIds.cs")]
    public static void Generate()
    {
        var contentBuilder = new StringBuilder();
        contentBuilder.AppendLine("public static class ExampleIds");
        contentBuilder.AppendLine("{");
        contentBuilder.AppendLine("\tpublic const string Demo = \"Demo\";");
        contentBuilder.AppendLine("}");

        AutoGenerate.GenerateFile(
            "ExampleIds.cs",
            contentBuilder,
            Application.dataPath + "/XmobiTea-constant/Scripts/");
    }
}
using XmobiTea.MiniAutoGenerate.Editor;

string id = AutoGenerate.GetConstantName("123 Player-Name");
// "_123PlayerName"
string keyword = AutoGenerate.GetConstantName("class");
// "class" -- still a C# keyword, so callers generating members must handle this case

Source Files

| File | Purpose | | --- | --- | | Editor/AutoGenerate.cs | editor-only helper implementation | | Editor/com.xmobitea.changx.mini-autogenerator.editor.asmdef | editor-only assembly definition |

Package Metadata

  • Package name: com.xmobitea.changx.mini-autogenerate
  • Editor assembly: com.xmobitea.changx.mini-autogenerator.editor
  • Unity version: 2022.3+
  • License: Apache-2.0

Hard No

  • Do not call from runtime assemblies.
  • Do not omit the trailing separator in fullPath.
  • Do not expect delete-then-write behavior to preserve the old file when generation fails.
  • Do not expect underscores, symbols, or non-ASCII letters to survive GetConstantName(...).
  • Do not expect GetConstantName(...) to produce a unique or keyword-safe C# member name by itself.
  • Do not treat this as a full code-generation framework.