cli-compile-surface-hardening
Keep migrated Blazor output compiling when more Web Forms artifacts stay on the generated compile surface
适合你,如果正在将 Web Forms 迁移到 Blazor 并遇到编译错误
/ 通过 npx 安装 校验哈希
npx oh-my-skill add fritzandfriends/blazorwebformscomponents/cli-compile-surface-hardening/ 通过 bash 安装
curl -fsSL https://oh-my-skill.com/install.sh | bash -s -- fritzandfriends/blazorwebformscomponents/cli-compile-surface-hardening/ 已经装过?验证本机副本,不用重装
npx oh-my-skill verify fritzandfriends/blazorwebformscomponents/cli-compile-surface-hardening安装目标可用 --agent / --scope 或 --to 明确指定;省略时只会在唯一已存在的 agent 目录上自动选择,零命中或多命中会停止并提示。content_hash 缺失或不一致均拒装。
449GitHub stars
~448上下文体积 · 单文件
索引托管
怎么用
技能原文 SKILL.md
Context
Use this when the migration CLI starts emitting more generated .razor.cs files or copying more legacy source into the output project. The goal is to preserve deterministic L1 behavior while preventing compile failures from style analyzers, generic Razor component inference, or unresolved markup references.
Patterns
- In generated migration projects, prefer
<EnforceCodeStyleInBuild>false</EnforceCodeStyleInBuild>over broad warning suppression when copied legacy files would otherwise fail repo-level IDE analyzers. - Add validator generic arguments with the BWFC component's actual generic parameter name, not an assumed
TValuealias: RequiredFieldValidator→Type="string"CompareValidator/RangeValidator→InputType="string"- Run markup-driven member stub generation after the main code-behind transforms, using transformed Razor markup (
metadata.MarkupContent) as the source of truth. - Stub only the deterministic missing-member shapes that are safe to infer mechanically:
@MethodName()→ render-method stub returningobject?@_fieldName→ privateobject?fieldOnClick="@HandlerName"and similar →void HandlerName(object? sender, EventArgs e)- Register new transforms in both production DI (
src\BlazorWebFormsComponents.Cli\Program.cs) andtests\BlazorWebFormsComponents.Cli.Tests\TestHelpers.csso the lightweight and full pipelines stay aligned.
Examples
src\BlazorWebFormsComponents.Cli\Transforms\Markup\ValidatorGenericTypeTransform.cssrc\BlazorWebFormsComponents.Cli\Transforms\CodeBehind\MarkupReferencedMemberStubTransform.cstests\BlazorWebFormsComponents.Cli.Tests\TransformUnit\CompiledCodeBehindStubPipelineTests.cs
Anti-Patterns
- Suppressing all warnings/errors in the generated project when only code-style analyzers are the problem.
- Injecting
TValue="string"into BWFC validators that actually exposeTypeorInputTypegeneric parameters. - Generating markup-reference stubs before markup transforms run, or reading original Web Forms markup instead of the transformed Razor output.
- Emitting placeholder stubs for every
@Identifiertoken; restrict deterministic generation to the specific reference shapes you can classify safely.
按 MIT 许可原样转载,未经改动 · 在 GitHub 查看 →
评论
登录即可评论;带「已验证安装」的,是发布者名下有本店的安装或持有记录。
…