Home

Awesome

TheAngryByrd.TypeSafeInternals

What

This uses Myriad to generate type safe reflection calls to internal functions/properties/methods.

Why

Sometimes you have to use reflection and there's no simple way around it. When creating reflection calls to internal/private functions/properties/methods, the underlying function may change when you go to upgrade the dependency. With TypeSafeInternals, it will re-generate the code for the calls so you would get a compile error if the API has drifted.

See also:

How

  1. Install TheAngryByrd.Myriad.Plugins.TypeSafeInternals via Nuget or Paket.

  2. Create an empty myriad.toml file next to your fsproj file.

  3. Add this xml snippet to your fsproj file.

    <Compile Include="Generated.fs">
        <MyriadFile>TypeSafeInternals.txt</MyriadFile>
    </Compile>
    
  4. Create TypeSafeInternals.txt next to you fsproj file.

  5. Add the name of the Nuget package (such as Npgsql.FSharp) to TypeSafeInternals.txt.

  6. run dotnet build

Features


Maintainers


Builds

GitHub Actions
GitHub Actions
Build History

NuGet

PackageStablePrerelease
TheAngryByrd.TypeSafeInternalsNuGet BadgeNuGet Badge
TheAngryByrd.Myriad.Plugins.TypeSafeInternalsNuGet BadgeNuGet Badge

Developing

Make sure the following requirements are installed on your system:

or


Environment Variables


Building

> build.cmd <optional buildtarget> // on windows
$ ./build.sh  <optional buildtarget>// on unix

The bin of your library should look similar to:

$ tree src/MyCoolNewLib/bin/
src/MyCoolNewLib/bin/
└── Debug
    └── net50
        ├── MyCoolNewLib.deps.json
        ├── MyCoolNewLib.dll
        ├── MyCoolNewLib.pdb
        └── MyCoolNewLib.xml


Build Targets


Releasing

git add .
git commit -m "Scaffold"
git remote add origin https://github.com/user/MyCoolNewLib.git
git push -u origin master

NOTE: Its highly recommend to add a link to the Pull Request next to the release note that it affects. The reason for this is when the RELEASE target is run, it will add these new notes into the body of git commit. GitHub will notice the links and will update the Pull Request with what commit referenced it saying "added a commit that referenced this pull request". Since the build script automates the commit message, it will say "Bump Version to x.y.z". The benefit of this is when users goto a Pull Request, it will be clear when and which version those code changes released. Also when reading the CHANGELOG, if someone is curious about how or why those changes were made, they can easily discover the work and discussions.

Here's an example of adding an "Unreleased" section to a CHANGELOG.md with a 0.1.0 section already released.

## [Unreleased]

### Added
- Does cool stuff!

### Fixed
- Fixes that silly oversight

## [0.1.0] - 2017-03-17
First release

### Added
- This release already has lots of features

[Unreleased]: https://github.com/user/MyCoolNewLib.git/compare/v0.1.0...HEAD
[0.1.0]: https://github.com/user/MyCoolNewLib.git/releases/tag/v0.1.0

macOS/Linux Parameter:

./build.sh Release 0.2.0

macOS/Linux Environment Variable:

RELEASE_VERSION=0.2.0 ./build.sh Release