{"id":20163712,"url":"https://github.com/emik03/emik.morsels","last_synced_at":"2025-04-10T00:44:17.641Z","repository":{"id":65600389,"uuid":"569156605","full_name":"Emik03/Emik.Morsels","owner":"Emik03","description":"C# code bits of internal implementations that are shared in projects. Meant to be used alongside Absence.Fody.","archived":false,"fork":false,"pushed_at":"2025-03-14T01:13:58.000Z","size":9290,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-10T00:44:10.499Z","etag":null,"topics":["algorithms","bridge","config","csharp","fsharp","helper","metaproject","morsels","performance","polyfill","props","superproject","symlink","targets","unmanaged-memory","utility"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Emik03.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"Emik03","custom":"https://paypal.me/emik03"}},"created_at":"2022-11-22T07:53:07.000Z","updated_at":"2025-03-14T01:14:01.000Z","dependencies_parsed_at":"2024-03-25T05:28:28.731Z","dependency_job_id":"d55652b2-4398-4fb1-a3c2-ea6769a7eca3","html_url":"https://github.com/Emik03/Emik.Morsels","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emik03%2FEmik.Morsels","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emik03%2FEmik.Morsels/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emik03%2FEmik.Morsels/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Emik03%2FEmik.Morsels/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Emik03","download_url":"https://codeload.github.com/Emik03/Emik.Morsels/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248137998,"owners_count":21053775,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["algorithms","bridge","config","csharp","fsharp","helper","metaproject","morsels","performance","polyfill","props","superproject","symlink","targets","unmanaged-memory","utility"],"created_at":"2024-11-14T00:31:17.703Z","updated_at":"2025-04-10T00:44:17.620Z","avatar_url":"https://github.com/Emik03.png","language":"C#","funding_links":["https://github.com/sponsors/Emik03","https://paypal.me/emik03"],"categories":[],"sub_categories":[],"readme":"# Emik.Morsels\n\n[![License](https://img.shields.io/github/license/Emik03/Emik.Morsels.svg?color=6272a4\u0026style=for-the-badge)](https://github.com/Emik03/Emik.Morsels/blob/main/LICENSE)\n\n---\n\n- [About](#about)\n- [Usage](#usage)\n- [Family](#family)\n- [Tree Shaking](#tree-shaking)\n- [Supported Frameworks](#supported-frameworks)\n- [Modified Standard Library](#modified-standard-library)\n- [Contribute](#contribute)\n- [License](#license)\n\n---\n\n## About\n\nInspired by [Code](https://github.com/shaynevanasperen/Code/); This is a project that contains utility code that don't belong together in a monolithic library. However, as opposed to [Code](https://github.com/shaynevanasperen/Code/), this repository has no source generators or roslyn analyzers to add these files. Instead, these are configurations which can be applied and synced to multiple projects simultaneously. This means that there is no need to add references, or figure out whether some type is needed or not, as all of them are added automatically.\n\n## Usage\n\n1. Download the [.NET 9 SDK](https://dotnet.microsoft.com/en-us/download/dotnet/9.0).\n2. Download/clone the repository: `git clone https://github.com/Emik03/Emik.Morsels.git`\n3. Copy-paste [Directory.Build.local.props.template](https://raw.githubusercontent.com/Emik03/Emik.Morsels/main/Content/Properties/Directory.Build.local.props.template) and name the new duplicate `Directory.Build.local.props`.\n4. Modify the [PropertyGroup](https://learn.microsoft.com/en-us/visualstudio/msbuild/propertygroup-element-msbuild?view=vs-2022) of `Directory.Build.local.props`, which contains absolute paths that are system-dependent.\n5. Execute [this command on Windows](https://github.com/Emik03/Emik.Morsels/blob/main/Shell/symlink.bat) or [this command on Mac/Linux](https://github.com/Emik03/Emik.Morsels/blob/main/Shell/symlink.sh) with each [Emik.Morsels](https://github.com/Emik03/Emik.Morsels) project as the working directory to symlink everything together.\n    - You can alternatively have a folder for `Emik.Morsels` projects, and all projects simply reside in nested folders. This way, you only need to set up the symlinks a single time on the root folder since [search scope applies to parent folders](https://learn.microsoft.com/en-us/visualstudio/msbuild/customize-your-build?view=vs-2022#search-scope) as well.\n\n## Family\n\nThe following block contains officially maintained projects that implement [Emik.Morsels](https://github.com/Emik03/Emik.Morsels):\n\n[![Absence.Fody](https://img.shields.io/github/last-commit/Emik03/Absence.Fody?style=for-the-badge\u0026logo=GitHub\u0026label=Absence.Fody\u0026color=ffb86c)](https://github.com/Emik03/Absence.Fody)\n[![Divorce.Fody](https://img.shields.io/github/last-commit/Emik03/Divorce.Fody?style=for-the-badge\u0026logo=GitHub\u0026label=Divorce.Fody\u0026color=f1fa8c)](https://github.com/Emik03/Divorce.Fody)\n[![Emik.Analyzers.Matches](https://img.shields.io/github/last-commit/Emik03/Emik.Analyzers.Matches?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Analyzers.Matches\u0026color=ffb86c)](https://github.com/Emik03/Emik.Analyzers.Matches)\n[![Emik.Kebnekaise.Gramophones](https://img.shields.io/github/last-commit/Emik03/Emik.Kebnekaise.Gramophones?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Kebnekaise.Gramophones\u0026color=f1fa8c)](https://github.com/Emik03/Emik.Kebnekaise.Gramophones)\n[![Emik.Kebnekaise.Pistons](https://img.shields.io/github/last-commit/Emik03/Emik.Kebnekaise.Pistons?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Kebnekaise.Pistons\u0026color=ffb86c)](https://github.com/Emik03/Emik.Kebnekaise.Pistons)\n[![Emik.Morsels.ProjectTemplates](https://img.shields.io/github/last-commit/Emik03/Emik.Morsels.ProjectTemplates?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Morsels.ProjectTemplates\u0026color=f1fa8c)](https://github.com/Emik03/Emik.Morsels.ProjectTemplates)\n[![Emik.Numerics.Fractions](https://img.shields.io/github/last-commit/Emik03/Emik.Numerics.Fractions?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Numerics.Fractions\u0026color=ffb86c)](https://github.com/Emik03/Emik.Numerics.Fractions)\n[![Emik.Results](https://img.shields.io/github/last-commit/Emik03/Emik.Results?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Results\u0026color=f1fa8c)](https://github.com/Emik03/Emik.Results)\n[![Emik.Rhainterop](https://img.shields.io/github/last-commit/Emik03/Emik.Rhainterop?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Rhainterop\u0026color=ffb86c)](https://github.com/Emik03/Emik.Rhainterop)\n[![Emik.Rubbish](https://img.shields.io/github/last-commit/Emik03/Emik.Rubbish?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Rubbish\u0026color=f1fa8c)](https://github.com/Emik03/Emik.Rubbish)\n[![Emik.SourceGenerators.Choices](https://img.shields.io/github/last-commit/Emik03/Emik.SourceGenerators.Choices?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.SourceGenerators.Choices\u0026color=ffb86c)](https://github.com/Emik03/Emik.SourceGenerators.Choices)\n[![Emik.SourceGenerators.Implicit](https://img.shields.io/github/last-commit/Emik03/Emik.SourceGenerators.Implicit?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.SourceGenerators.Implicit\u0026color=f1fa8c)](https://github.com/Emik03/Emik.SourceGenerators.Implicit)\n[![Emik.SourceGenerators.Tattoo](https://img.shields.io/github/last-commit/Emik03/Emik.SourceGenerators.Tattoo?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.SourceGenerators.Tattoo\u0026color=ffb86c)](https://github.com/Emik03/Emik.SourceGenerators.Tattoo)\n[![Emik.SourceGenerators.TheSquareHole](https://img.shields.io/github/last-commit/Emik03/Emik.SourceGenerators.TheSquareHole?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.SourceGenerators.TheSquareHole\u0026color=f1fa8c)](https://github.com/Emik03/Emik.SourceGenerators.TheSquareHole)\n[![Emik.Unions](https://img.shields.io/github/last-commit/Emik03/Emik.Unions?style=for-the-badge\u0026logo=GitHub\u0026label=Emik.Unions\u0026color=ffb86c)](https://github.com/Emik03/Emik.Unions)\n[![ScreenShakeService](https://img.shields.io/github/last-commit/Emik03/ScreenShakeService?style=for-the-badge\u0026logo=GitHub\u0026label=ScreenShakeService\u0026color=f1fa8c)](https://github.com/Emik03/ScreenShakeService)\n[![wawa](https://img.shields.io/github/last-commit/Emik03/wawa?style=for-the-badge\u0026logo=GitHub\u0026label=wawa\u0026color=ffb86c)](https://github.com/Emik03/wawa)\n\n## Tree Shaking\n\nOf course, if you add every type, it often means that a lot of unnecessary code is shipped along with your assembly, which is especially not ideal if you only require a single function from the set of all types. To counteract this, an additional dependency is placed on [Absence.Fody](https://github.com/Emik03/Absence.Fody/) which automatically looks for unused types that aren't explicitly marked as either [CompilerGeneratedAttribute](https://learn.microsoft.com/en-us/dotnet/api/system.runtime.compilerservices.compilergeneratedattribute?view=net-7.0) or [ImplicitlyUsedAttribute](https://www.jetbrains.com/help/resharper/Reference__Code_Annotation_Attributes.html#UsedImplicitlyAttribute). As a result, any unused types outside of [Emik.Morsels](https://github.com/Emik03/Emik.Morsels) within the project will also be discarded during compile-time.\n\n## Supported Frameworks\n\nEmik.Morsels currently supports the following frameworks:\n\n- .NET Framework: 2.0 - 4.8.1\n- .NET Standard: 1.0 - 2.1\n- .NET Core: 1.0 - 3.1\n- .NET: 5.0 - 9.0\n\nDifferent scripts and configurations within this repository will act accordingly to the current framework, such as polyfills, or by taking advantage of .NET 6+'s [`static abstract`](https://learn.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/static-abstract-interface-methods) features.\n\n## Modified Standard Library\n\nEmik.Morsels also contains an IL-modified version of the .NET Framework 3.5 reference assembly. This is a reference assembly that has a weaved `System.Type.op_Equality`, allowing you to use record types without [Emik.Net20Records](https://github.com/Emik03/Emik.Net20Records).\n\nThis method is attributed with [`InlineAttribute`](https://github.com/oleg-st/InlineMethod.Fody) to ensure removal to the modified reference, changing it to a simple `ceq` (`(object)lh == rh`) instruction.\n\nThe code that was used to generate this assembly can be found [here](https://gist.github.com/Emik03/d88efe49a874b7d5f45e4bfb96fa541f).\n\nThere are also symlinks for `System.dll` and `System.Numerics.dll` that both point to said standard library, meant as a silly workaround for expecting those two files when compiling in F#, since `System.Numerics` doesn't exist in .NET 3.5.\n\n## Contribute\n\nDespite the types being marked internal, all scripts here act as an evolving API. As a result, feedback is much more likely to be applied as breaking changes can be more easily made without breaking preexisting code.\n\nIssues and pull requests are welcome to help this repository be the best it can be.\n\n## License\n\nThis repository — which includes every source file separately — fall under the [MPL-2 license](https://www.mozilla.org/en-US/MPL/2.0/).\n\nYou may copy individual or multiple source files, granted that you keep the copyright license, and disclose the source back to this repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femik03%2Femik.morsels","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femik03%2Femik.morsels","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femik03%2Femik.morsels/lists"}