diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..4cab270 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,109 @@ +# EditorConfig is awesome:http://EditorConfig.org + +# top-most EditorConfig file +root = true + +# Don't use tabs for indentation. +[*] +indent_style = space +# (Please don't specify an indent_size here; that has too many unintended consequences.) + +# Code files +[*.{cs,csx,vb,vbx}] +indent_size = 4 + +# Xml project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj,props,targets}] +indent_size = 2 + +# Xml config files +[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct}] +indent_size = 2 + +# YAML files +[*.{yaml,yml}] +indent_size = 2 + +# JSON files +[*.json] +indent_size = 2 + +# Dotnet code style settings: +[*.{cs,vb}] +# Sort using and Import directives with System.* appearing first +dotnet_sort_system_directives_first = true +# Avoid "this." and "Me." if not necessary +dotnet_style_qualification_for_field = false:suggestion +dotnet_style_qualification_for_property = false:suggestion +dotnet_style_qualification_for_method = false:suggestion +dotnet_style_qualification_for_event = false:suggestion + +# Use language keywords instead of framework type names for type references +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion + +# Suggest more modern language features when available +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion + +# CSharp code style settings: + +# IDE0040: Add accessibility modifiers +dotnet_style_require_accessibility_modifiers = omit_if_default:error + +# IDE0040: Add accessibility modifiers +dotnet_diagnostic.IDE0040.severity = error + +[*.cs] +# Top-level files are definitely OK +csharp_using_directive_placement = outside_namespace:silent +csharp_style_namespace_declarations = block_scoped:silent +csharp_prefer_simple_using_statement = true:suggestion +csharp_prefer_braces = true:silent + +# Prefer "var" everywhere +csharp_style_var_for_built_in_types = true:suggestion +csharp_style_var_when_type_is_apparent = true:suggestion +csharp_style_var_elsewhere = true:suggestion + +# Prefer method-like constructs to have an expression-body +csharp_style_expression_bodied_methods = true:none +csharp_style_expression_bodied_constructors = true:none +csharp_style_expression_bodied_operators = true:none + +# Prefer property-like constructs to have an expression-body +csharp_style_expression_bodied_properties = true:none +csharp_style_expression_bodied_indexers = true:none +csharp_style_expression_bodied_accessors = true:none + +# Suggest more modern language features when available +csharp_style_pattern_matching_over_is_with_cast_check = true:error +csharp_style_pattern_matching_over_as_with_null_check = true:error +csharp_style_inlined_variable_declaration = true:suggestion +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion + +# Newline settings +csharp_new_line_before_open_brace = all +csharp_new_line_before_else = true +csharp_new_line_before_catch = true +csharp_new_line_before_finally = true +csharp_new_line_before_members_in_object_initializers = true +csharp_new_line_before_members_in_anonymous_types = true + +# Test settings +[**/*Tests*/**{.cs,.vb}] +# xUnit1013: Public method should be marked as test. Allows using records as test classes +dotnet_diagnostic.xUnit1013.severity = none + +# CS9113: Parameter is unread (usually, ITestOutputHelper) +dotnet_diagnostic.CS9113.severity = none + +# Default severity for analyzer diagnostics with category 'Style' +dotnet_analyzer_diagnostic.category-Style.severity = none + +# VSTHRD200: Use "Async" suffix for async methods +dotnet_diagnostic.VSTHRD200.severity = none diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..4f89148 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,8 @@ +# normalize by default +* text=auto encoding=UTF-8 +*.sh text eol=lf + +# These are windows specific files which we may as well ensure are +# always crlf on checkout +*.bat text eol=crlf +*.cmd text eol=crlf diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..c95eb73 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,40 @@ +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: +- package-ecosystem: nuget + directory: / + schedule: + interval: daily + groups: + Azure: + patterns: + - "Azure*" + - "Microsoft.Azure*" + Identity: + patterns: + - "System.IdentityModel*" + - "Microsoft.IdentityModel*" + System: + patterns: + - "System*" + exclude-patterns: + - "System.IdentityModel*" + Extensions: + patterns: + - "Microsoft.Extensions*" + Web: + patterns: + - "Microsoft.AspNetCore*" + Tests: + patterns: + - "Microsoft.NET.Test*" + - "xunit*" + - "coverlet*" + ThisAssembly: + patterns: + - "ThisAssembly*" + ProtoBuf: + patterns: + - "protobuf-*" diff --git a/.github/release.yml b/.github/release.yml new file mode 100644 index 0000000..c178589 --- /dev/null +++ b/.github/release.yml @@ -0,0 +1,32 @@ +changelog: + exclude: + labels: + - bydesign + - dependencies + - duplicate + - question + - invalid + - wontfix + - need info + - techdebt + authors: + - devlooped-bot + - dependabot + - github-actions + categories: + - title: ✨ Implemented enhancements + labels: + - enhancement + - title: πŸ› Fixed bugs + labels: + - bug + - title: πŸ“ Documentation updates + labels: + - docs + - documentation + - title: πŸ”¨ Other + labels: + - '*' + exclude: + labels: + - dependencies diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..a109549 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,102 @@ +ο»Ώ# Builds and runs tests in all three supported OSes +# Pushes CI feed if secrets.SLEET_CONNECTION is provided + +name: build +on: + workflow_dispatch: + inputs: + configuration: + type: choice + description: Configuration + options: + - Release + - Debug + push: + branches: [ main, dev, 'dev/*', 'feature/*', 'rel/*' ] + paths-ignore: + - changelog.md + - readme.md + pull_request: + types: [opened, synchronize, reopened] + +env: + DOTNET_NOLOGO: true + PackOnBuild: true + GeneratePackageOnBuild: true + VersionPrefix: 42.42.${{ github.run_number }} + VersionLabel: ${{ github.ref }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + MSBUILDTERMINALLOGGER: auto + Configuration: ${{ github.event.inputs.configuration || 'Release' }} + +defaults: + run: + shell: bash + +jobs: + os-matrix: + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.lookup.outputs.matrix }} + steps: + - name: 🀘 checkout + uses: actions/checkout@v4 + + - name: πŸ”Ž lookup + id: lookup + shell: pwsh + run: | + $path = './.github/workflows/os-matrix.json' + $os = if (test-path $path) { cat $path } else { '["ubuntu-latest"]' } + echo "matrix=$os" >> $env:GITHUB_OUTPUT + + build: + needs: os-matrix + name: build-${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: ${{ fromJSON(needs.os-matrix.outputs.matrix) }} + steps: + - name: 🀘 checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: πŸ™ build + run: dotnet build -m:1 -bl:build.binlog + + - name: πŸ§ͺ test + run: | + dotnet tool update -g dotnet-retest + dotnet retest -- --no-build + + - name: πŸ› logs + uses: actions/upload-artifact@v3 + if: runner.debug && always() + with: + name: logs + path: '*.binlog' + + - name: πŸš€ sleet + env: + SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} + if: env.SLEET_CONNECTION != '' + run: | + dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r) + sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found" + + dotnet-format: + runs-on: ubuntu-latest + steps: + - name: 🀘 checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: βœ“ ensure format + run: | + dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget + dotnet format style --verify-no-changes -v:diag --exclude ~/.nuget diff --git a/.github/workflows/changelog.config b/.github/workflows/changelog.config new file mode 100644 index 0000000..e47bccd --- /dev/null +++ b/.github/workflows/changelog.config @@ -0,0 +1,9 @@ +usernames-as-github-logins=true +issues_wo_labels=true +pr_wo_labels=true +exclude-labels=bydesign,dependencies,duplicate,discussion,question,invalid,wontfix,need info,docs +enhancement-label=:sparkles: Implemented enhancements: +bugs-label=:bug: Fixed bugs: +issues-label=:hammer: Other: +pr-label=:twisted_rightwards_arrows: Merged: +unreleased=false diff --git a/.github/workflows/changelog.yml b/.github/workflows/changelog.yml new file mode 100644 index 0000000..ca50e5a --- /dev/null +++ b/.github/workflows/changelog.yml @@ -0,0 +1,39 @@ +ο»Ώname: changelog +on: + workflow_dispatch: + release: + types: [released] + +jobs: + changelog: + runs-on: ubuntu-latest + steps: + - name: πŸ€– defaults + uses: devlooped/actions-bot@v1 + with: + name: ${{ secrets.BOT_NAME }} + email: ${{ secrets.BOT_EMAIL }} + gh_token: ${{ secrets.GH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: 🀘 checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main + token: ${{ env.GH_TOKEN }} + + - name: βš™ ruby + uses: ruby/setup-ruby@v1 + with: + ruby-version: 3.0.3 + + - name: βš™ changelog + run: | + gem install github_changelog_generator + github_changelog_generator --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token $GH_TOKEN --o changelog.md --config-file .github/workflows/changelog.config + + - name: πŸš€ changelog + run: | + git add changelog.md + (git commit -m "πŸ–‰ Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done" \ No newline at end of file diff --git a/.github/workflows/dotnet-file.yml b/.github/workflows/dotnet-file.yml new file mode 100644 index 0000000..95f6228 --- /dev/null +++ b/.github/workflows/dotnet-file.yml @@ -0,0 +1,87 @@ +# Synchronizes .netconfig-configured files with dotnet-file +name: dotnet-file +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + push: + branches: [ 'dotnet-file' ] + +env: + DOTNET_NOLOGO: true + +jobs: + sync: + runs-on: windows-latest + continue-on-error: true + steps: + - name: πŸ€– defaults + uses: devlooped/actions-bot@v1 + with: + name: ${{ secrets.BOT_NAME }} + email: ${{ secrets.BOT_EMAIL }} + gh_token: ${{ secrets.GH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: 🀘 checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: main + token: ${{ env.GH_TOKEN }} + + - name: βŒ› rate + shell: pwsh + if: github.event_name != 'workflow_dispatch' + run: | + # add random sleep since we run on fixed schedule + sleep (get-random -max 60) + # get currently authenticated user rate limit info + $rate = gh api rate_limit | convertfrom-json | select -expandproperty rate + # if we don't have at least 100 requests left, wait until reset + if ($rate.remaining -lt 10) { + $wait = ($rate.reset - (Get-Date (Get-Date).ToUniversalTime() -UFormat %s)) + echo "Rate limit remaining is $($rate.remaining), waiting for $($wait / 1000) seconds to reset" + sleep $wait + $rate = gh api rate_limit | convertfrom-json | select -expandproperty rate + echo "Rate limit has reset to $($rate.remaining) requests" + } + + - name: πŸ”„ sync + shell: pwsh + run: | + dotnet tool update -g dotnet-gcm + dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN + gh auth status + + dotnet tool update -g dotnet-file + dotnet file sync -c:$env:TEMP\dotnet-file.md + if (test-path $env:TEMP\dotnet-file.md) { + echo 'CHANGES<> $env:GITHUB_ENV + cat $env:TEMP\dotnet-file.md >> $env:GITHUB_ENV + echo 'EOF' >> $env:GITHUB_ENV + cat $env:TEMP\dotnet-file.md + } else { + echo 'No changelog was generated' + } + + - name: +Mᐁ includes + uses: devlooped/actions-include@v1 + with: + validate: false + + - name: ✍ pull request + uses: peter-evans/create-pull-request@v6 + with: + base: main + branch: dotnet-file-sync + delete-branch: true + labels: dependencies + author: ${{ env.BOT_AUTHOR }} + committer: ${{ env.BOT_AUTHOR }} + commit-message: ⬆️ Bump files with dotnet-file sync + + ${{ env.CHANGES }} + title: "⬆️ Bump files with dotnet-file sync" + body: ${{ env.CHANGES }} + token: ${{ env.GH_TOKEN }} diff --git a/.github/workflows/includes.yml b/.github/workflows/includes.yml new file mode 100644 index 0000000..15a781e --- /dev/null +++ b/.github/workflows/includes.yml @@ -0,0 +1,44 @@ +name: +Mᐁ includes +on: + workflow_dispatch: + push: + branches: + - 'main' + paths: + - '**.md' + - '!changelog.md' + +jobs: + includes: + runs-on: ubuntu-latest + steps: + - name: πŸ€– defaults + uses: devlooped/actions-bot@v1 + with: + name: ${{ secrets.BOT_NAME }} + email: ${{ secrets.BOT_EMAIL }} + gh_token: ${{ secrets.GH_TOKEN }} + github_token: ${{ secrets.GITHUB_TOKEN }} + + - name: 🀘 checkout + uses: actions/checkout@v4 + with: + token: ${{ env.GH_TOKEN }} + + - name: +Mᐁ includes + uses: devlooped/actions-includes@v1 + + - name: ✍ pull request + uses: peter-evans/create-pull-request@v6 + with: + add-paths: '**.md' + base: main + branch: markdown-includes + delete-branch: true + labels: docs + author: ${{ env.BOT_AUTHOR }} + committer: ${{ env.BOT_AUTHOR }} + commit-message: +Mᐁ includes + title: +Mᐁ includes + body: +Mᐁ includes + token: ${{ env.GH_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..ae4240f --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,57 @@ +ο»Ώ# Builds a final release version and pushes to nuget.org +# whenever a release is published. +# Requires: secrets.NUGET_API_KEY + +name: publish +on: + release: + types: [prereleased, released] + +env: + DOTNET_NOLOGO: true + Configuration: Release + PackOnBuild: true + GeneratePackageOnBuild: true + VersionLabel: ${{ github.ref }} + GH_TOKEN: ${{ secrets.GH_TOKEN }} + MSBUILDTERMINALLOGGER: auto + +jobs: + publish: + runs-on: ${{ vars.PUBLISH_AGENT || 'ubuntu-latest' }} + steps: + - name: 🀘 checkout + uses: actions/checkout@v4 + with: + submodules: recursive + fetch-depth: 0 + + - name: πŸ™ build + run: dotnet build -m:1 -bl:build.binlog + + - name: πŸ§ͺ test + run: | + dotnet tool update -g dotnet-retest + dotnet retest -- --no-build + + - name: πŸ› logs + uses: actions/upload-artifact@v3 + if: runner.debug && always() + with: + name: logs + path: '*.binlog' + + - name: πŸš€ nuget + env: + NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} + if: ${{ env.NUGET_API_KEY != '' && github.event.action != 'prereleased' }} + working-directory: bin + run: dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate + + - name: πŸš€ sleet + env: + SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }} + if: env.SLEET_CONNECTION != '' + run: | + dotnet tool update sleet -g --allow-downgrade --version $(curl -s --compressed ${{ vars.SLEET_FEED_URL }} | jq '.["sleet:version"]' -r) + sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found" diff --git a/.github/workflows/triage.yml b/.github/workflows/triage.yml new file mode 100644 index 0000000..56ff299 --- /dev/null +++ b/.github/workflows/triage.yml @@ -0,0 +1,103 @@ +name: 'triage' +on: + schedule: + - cron: '42 0 * * *' + + workflow_dispatch: + # Manual triggering through the GitHub UI, API, or CLI + inputs: + daysBeforeClose: + description: "Days before closing stale or need info issues" + required: true + default: "30" + daysBeforeStale: + description: "Days before labeling stale" + required: true + default: "180" + daysSinceClose: + description: "Days since close to lock" + required: true + default: "30" + daysSinceUpdate: + description: "Days since update to lock" + required: true + default: "30" + +permissions: + actions: write # For managing the operation state cache + issues: write + contents: read + +jobs: + stale: + # Do not run on forks + if: github.repository_owner == 'devlooped' + runs-on: ubuntu-latest + steps: + - name: βŒ› rate + shell: pwsh + if: github.event_name != 'workflow_dispatch' + env: + GH_TOKEN: ${{ secrets.DEVLOOPED_TOKEN }} + run: | + # add random sleep since we run on fixed schedule + $wait = get-random -max 180 + echo "Waiting random $wait seconds to start" + sleep $wait + # get currently authenticated user rate limit info + $rate = gh api rate_limit | convertfrom-json | select -expandproperty rate + # if we don't have at least 100 requests left, wait until reset + if ($rate.remaining -lt 100) { + $wait = ($rate.reset - (Get-Date (Get-Date).ToUniversalTime() -UFormat %s)) + echo "Rate limit remaining is $($rate.remaining), waiting for $($wait / 1000) seconds to reset" + sleep $wait + $rate = gh api rate_limit | convertfrom-json | select -expandproperty rate + echo "Rate limit has reset to $($rate.remaining) requests" + } + + - name: ✏️ stale labeler + # pending merge: https://github.com/actions/stale/pull/1176 + uses: kzu/stale@c8450312ba97b204bf37545cb249742144d6ca69 + with: + ascending: true # Process the oldest issues first + stale-issue-label: 'stale' + stale-issue-message: | + Due to lack of recent activity, this issue has been labeled as 'stale'. + It will be closed if no further activity occurs within ${{ fromJson(inputs.daysBeforeClose || 30 ) }} more days. + Any new comment will remove the label. + close-issue-message: | + This issue will now be closed since it has been labeled 'stale' without activity for ${{ fromJson(inputs.daysBeforeClose || 30 ) }} days. + days-before-stale: ${{ fromJson(inputs.daysBeforeStale || 180) }} + days-before-close: ${{ fromJson(inputs.daysBeforeClose || 30 ) }} + days-before-pr-close: -1 # Do not close PRs labeled as 'stale' + exempt-all-milestones: true + exempt-all-assignees: true + exempt-issue-labels: priority,sponsor,backed + exempt-authors: kzu + + - name: 🀘 checkout actions + uses: actions/checkout@v4 + with: + repository: 'microsoft/vscode-github-triage-actions' + ref: v42 + + - name: βš™ install actions + run: npm install --production + + - name: πŸ”’ issues locker + uses: ./locker + with: + token: ${{ secrets.DEVLOOPED_TOKEN }} + ignoredLabel: priority + daysSinceClose: ${{ fromJson(inputs.daysSinceClose || 30) }} + daysSinceUpdate: ${{ fromJson(inputs.daysSinceUpdate || 30) }} + + - name: πŸ”’ need info closer + uses: ./needs-more-info-closer + with: + token: ${{ secrets.DEVLOOPED_TOKEN }} + label: 'need info' + closeDays: ${{ fromJson(inputs.daysBeforeClose || 30) }} + closeComment: "This issue has been closed automatically because it needs more information and has not had recent activity.\n\nHappy Coding!" + pingDays: 80 + pingComment: "Hey @${assignee}, this issue might need further attention.\n\n@${author}, you can help us out by closing this issue if the problem no longer exists, or adding more information." \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ac54a7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +bin +obj +artifacts +pack +TestResults +results +BenchmarkDotNet.Artifacts +/app +.vs +.vscode +.genaiscript +.idea +local.settings.json + +*.suo +*.sdf +*.userprefs +*.user +*.nupkg +*.metaproj +*.tmp +*.log +*.cache +*.binlog +*.zip +__azurite*.* +__*__ + +.nuget +*.lock.json +*.nuget.props +*.nuget.targets + +node_modules +_site +.jekyll-metadata +.jekyll-cache +.sass-cache +Gemfile.lock +package-lock.json diff --git a/.netconfig b/.netconfig new file mode 100644 index 0000000..7737ced --- /dev/null +++ b/.netconfig @@ -0,0 +1,122 @@ +[file] + url = https://github.com/devlooped/oss +[file ".netconfig"] + url = https://github.com/devlooped/oss/blob/main/.netconfig + skip +[file "readme.md"] + url = https://github.com/devlooped/oss/blob/main/readme.md + skip +[file ".github/workflows/combine-prs.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/combine-prs.yml + skip +[file "src/kzu.snk"] + url = https://github.com/devlooped/oss/blob/main/src/kzu.snk + skip +[file ".editorconfig"] + url = https://github.com/devlooped/oss/blob/main/.editorconfig + sha = e81ab754b366d52d92bd69b24bef1d5b1c610634 + + etag = 7298c6450967975a8782b5c74f3071e1910fc59686e48f9c9d5cd7c68213cf59 + weak +[file ".gitattributes"] + url = https://github.com/devlooped/oss/blob/main/.gitattributes + sha = 5f92a68e302bae675b394ef343114139c075993e + + etag = 338ba6d92c8d1774363396739c2be4257bfc58026f4b0fe92cb0ae4460e1eff7 + weak +[file ".github/dependabot.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml + sha = 49661dbf0720cde93eb5569be7523b5912351560 + + etag = c147ea2f3431ca0338c315c4a45b56ee233c4d30f8d6ab698d0e1980a257fd6a + weak +[file ".github/release.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/release.yml + sha = 0c23e24704625cf75b2cb1fdc566cef7e20af313 + + etag = 310df162242c95ed19ed12e3c96a65f77e558b46dced676ad5255eb12caafe75 + weak +[file ".github/workflows/build.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml + sha = 5e17ad62ebb5241555a7a4d29e3ab15e5ba120d2 + + etag = f358acb1e45596bf0aad49996017da44939de30b805289c4ad205a7ccb6f99cb + weak +[file ".github/workflows/changelog.config"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.config + sha = 08d83cb510732f861416760d37702f9f55bd7f9e + + etag = 556a28914eeeae78ca924b1105726cdaa211af365671831887aec81f5f4301b4 + weak +[file ".github/workflows/changelog.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.yml + sha = 5fb172362c767bef7c36478f1a6bdc264723f8f9 + + etag = ad1efa56d6024ee1add2bcda81a7e4e38d0e9069473c6ff70374d5ce06af1f5a + weak +[file ".github/workflows/dotnet-file.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file.yml + sha = 7afe350f7e80a230e922db026d4e1198ba15cae1 + + etag = 65e9794df6caff779eb989c8f71ddf4d4109b24a75af79e4f8d0fe6ba7bd9702 + weak +[file ".github/workflows/includes.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/includes.yml + sha = d152e7437fd0d6f6d9363d23cb3b78c07335ea49 + + etag = ec40db34f379d0c6d83b2ec15624f330318a172cc4f85b5417c63e86eaf601df + weak +[file ".github/workflows/publish.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml + sha = 5e17ad62ebb5241555a7a4d29e3ab15e5ba120d2 + + etag = 2cc96046d8f28e7cbcde89ed56d3d89e1a70fb0de7846ee1827bee66b7dfbcf1 + weak +[file ".github/workflows/triage.yml"] + url = https://github.com/devlooped/oss/blob/main/.github/workflows/triage.yml + sha = 33000c0c4ab4eb4e0e142fa54515b811a189d55c + + etag = 013a47739e348f06891f37c45164478cca149854e6cd5c5158e6f073f852b61a + weak +[file ".gitignore"] + url = https://github.com/devlooped/oss/blob/main/.gitignore + sha = e0be248fff1d39133345283b8227372b36574b75 + + etag = c449ec6f76803e1891357ca2b8b4fcb5b2e5deeff8311622fd92ca9fbf1e6575 + weak +[file "Directory.Build.rsp"] + url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp + sha = 0f7f7f7e8a29de9b535676f75fe7c67e629a5e8c + + etag = 0ccae83fc51f400bfd7058170bfec7aba11455e24a46a0d7e6a358da6486e255 + weak +[file "_config.yml"] + url = https://github.com/devlooped/oss/blob/main/_config.yml + sha = fa83a5161ba52bc5d510ce0ba75ee0b1f8d4bc63 + + etag = 9139148f845adf503fd3c3c140eb64421fc476a1f9c027fc50825c0efb05f557 + weak +[file "assets/css/style.scss"] + url = https://github.com/devlooped/oss/blob/main/assets/css/style.scss + sha = 9db26e2710b084d219d6355339d822f159bf5780 + + etag = f710d8919abfd5a8d00050b74ba7d0bb05c6d02e40842a3012eb96555c208504 + weak +[file "license.txt"] + url = https://github.com/devlooped/oss/blob/main/license.txt + sha = 0683ee777d7d878d4bf013d7deea352685135a05 + + etag = 2c6335b37e4ae05eea7c01f5d0c9d82b49c488f868a8b5ba7bff7c6ff01f3994 + weak +[file "src/Directory.Build.props"] + url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props + sha = b76de49afb376aa48eb172963ed70663b59b31d3 + + etag = c8b56f3860cc7ccb8773b7bd6189f5c7a6e3a2c27e9104c1ee201fbdc5af9873 + weak +[file "src/Directory.Build.targets"] + url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets + sha = a8b208093599263b7f2d1fe3854634c588ea5199 + + etag = 19087699f05396205e6b050d999a43b175bd242f6e8fac86f6df936310178b03 + weak diff --git a/Directory.Build.rsp b/Directory.Build.rsp new file mode 100644 index 0000000..509cc66 --- /dev/null +++ b/Directory.Build.rsp @@ -0,0 +1,5 @@ +# See https://docs.microsoft.com/en-us/visualstudio/msbuild/msbuild-response-files +-nr:false +-m:1 +-v:m +-clp:Summary;ForceNoAlign diff --git a/StructId.sln b/StructId.sln new file mode 100644 index 0000000..10ec0c3 --- /dev/null +++ b/StructId.sln @@ -0,0 +1,31 @@ +ο»Ώ +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.13.35507.96 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructId", "src\StructId\StructId.csproj", "{32E82BDE-70EE-401F-B2E5-DFD2A8B00073}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "StructId.Tests", "src\StructId.Tests\StructId.Tests.csproj", "{4616804F-CDBE-47A2-B03E-2D87F2088A69}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {32E82BDE-70EE-401F-B2E5-DFD2A8B00073}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {32E82BDE-70EE-401F-B2E5-DFD2A8B00073}.Debug|Any CPU.Build.0 = Debug|Any CPU + {32E82BDE-70EE-401F-B2E5-DFD2A8B00073}.Release|Any CPU.ActiveCfg = Release|Any CPU + {32E82BDE-70EE-401F-B2E5-DFD2A8B00073}.Release|Any CPU.Build.0 = Release|Any CPU + {4616804F-CDBE-47A2-B03E-2D87F2088A69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4616804F-CDBE-47A2-B03E-2D87F2088A69}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4616804F-CDBE-47A2-B03E-2D87F2088A69}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4616804F-CDBE-47A2-B03E-2D87F2088A69}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {0E266CBC-4B54-4C08-97D8-855C72500754} + EndGlobalSection +EndGlobal diff --git a/_config.yml b/_config.yml new file mode 100644 index 0000000..a61f7e0 --- /dev/null +++ b/_config.yml @@ -0,0 +1,3 @@ +theme: jekyll-theme-slate + +exclude: [ 'src/', '*.sln', 'Gemfile*', '*.rsp' ] \ No newline at end of file diff --git a/assets/css/style.scss b/assets/css/style.scss new file mode 100644 index 0000000..5e165a3 --- /dev/null +++ b/assets/css/style.scss @@ -0,0 +1,26 @@ +--- +--- + +@import "jekyll-theme-slate"; + +.inner { + max-width: 960px; +} + +pre, code { + background-color: unset; + font-size: unset; +} + + code { + font-size: 0.80em; +} + +h1 > img { + border: unset; + box-shadow: unset; + vertical-align: middle; + -moz-box-shadow: unset; + -o-box-shadow: unset; + -ms-box-shadow: unset; +} diff --git a/license.txt b/license.txt new file mode 100644 index 0000000..83969dc --- /dev/null +++ b/license.txt @@ -0,0 +1,22 @@ +The MIT License (MIT) + +Copyright (c) Daniel Cazzulino and Contributors + +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. + diff --git a/src/Directory.Build.props b/src/Directory.Build.props new file mode 100644 index 0000000..381c383 --- /dev/null +++ b/src/Directory.Build.props @@ -0,0 +1,159 @@ + + + + + false + + true + + + + + $(CI) + + + + Daniel Cazzulino + Copyright (C) Daniel Cazzulino and Contributors. All rights reserved. + false + MIT + + + icon.png + readme.md + + icon.png + readme.md + + true + true + + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\bin')) + + + true + true + + + true + + + + Release + Latest + + + false + + embedded + true + enable + + strict + + + $(MSBuildProjectName) + $(MSBuildProjectName.IndexOf('.')) + $(MSBuildProjectName.Substring(0, $(RootNamespaceDot))) + + + $(DefaultItemExcludes);*.binlog;*.zip;*.rsp;*.items;**/TestResults/**/*.* + + true + true + true + true + + + true + + + false + + + NU5105;$(NoWarn) + + true + + + true + + + LatestMinor + + + + + $(MSBuildThisFileDirectory)kzu.snk + + 002400000480000094000000060200000024000052534131000400000100010051155fd0ee280be78d81cc979423f1129ec5dd28edce9cd94fd679890639cad54c121ebdb606f8659659cd313d3b3db7fa41e2271158dd602bb0039a142717117fa1f63d93a2d288a1c2f920ec05c4858d344a45d48ebd31c1368ab783596b382b611d8c92f9c1b3d338296aa21b12f3bc9f34de87756100c172c52a24bad2db + 00352124762f2aa5 + true + + + + + 42.42.42 + + + + <_VersionLabel>$(VersionLabel.Replace('refs/heads/', '')) + <_VersionLabel>$(_VersionLabel.Replace('refs/tags/v', '')) + + + <_VersionLabel Condition="$(_VersionLabel.Contains('refs/pull/'))">$(VersionLabel.TrimEnd('.0123456789')) + + <_VersionLabel>$(_VersionLabel.Replace('refs/pull/', 'pr')) + + <_VersionLabel>$(_VersionLabel.Replace('/merge', '')) + + <_VersionLabel>$(_VersionLabel.Replace('/', '-')) + + + $(_VersionLabel) + + $(_VersionLabel) + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Directory.Build.targets b/src/Directory.Build.targets new file mode 100644 index 0000000..6232750 --- /dev/null +++ b/src/Directory.Build.targets @@ -0,0 +1,188 @@ + + + + + CI;$(DefineConstants) + + + + + false + false + true + + + + true + true + + + + + false + true + + + + + + + + + + + + + + + + + + + + 1.0.0 + $(VersionPrefix)-$(VersionSuffix) + $(VersionPrefix) + + + + + $(PackFolder) + $(PackFolderPath.Replace('\$(TargetFramework)', '')) + $(IntermediateOutputPath)$(PackFolderPath)\ + $(OutputPath)$(PackFolderPath)\ + $(OutputPath) + + + + + pr$(GITHUB_REF.Replace('refs/pull/', '').Replace('/merge', '')) + $(GITHUB_REF.Replace('refs/heads/', '').Replace('refs/tags/', '')) + + $(BUILD_SOURCEBRANCH.Replace('refs/heads/', '').Replace('refs/tags/', '')) + + pr$(APPVEYOR_PULL_REQUEST_NUMBER) + $(APPVEYOR_REPO_TAG_NAME) + $(APPVEYOR_REPO_BRANCH) + + $(TEAMCITY_BUILD_BRANCH) + + pr$(TRAVIS_PULL_REQUEST) + $(TRAVIS_BRANCH) + + pr$(CIRCLE_PR_NUMBER) + $(CIRCLE_TAG) + $(CIRCLE_BRANCH) + + $(CI_COMMIT_TAG) + pr$(CI_MERGE_REQUEST_IID) + pr$(CI_EXTERNAL_PULL_REQUEST_IID) + $(CI_COMMIT_BRANCH) + + pr$(BUDDY_EXECUTION_PULL_REQUEST_NO) + $(BUDDY_EXECUTION_TAG) + $(BUDDY_EXECUTION_BRANCH) + + + + + CoreResGen;$(CoreCompileDependsOn) + + + + + + + + + $(IntermediateOutputPath)\$([MSBuild]::ValueOrDefault('%(RelativeDir)', '').Replace('\', '.').Replace('/', '.'))%(Filename).g$(DefaultLanguageSourceExtension) + $(Language) + $(RootNamespace) + $(RootNamespace).$([MSBuild]::ValueOrDefault('%(RelativeDir)', '').Replace('\', '.').Replace('/', '.').TrimEnd('.')) + %(Filename) + + + + + + + + + + + + + + + + + + + + + + + + $(PrivateRepositoryUrl) + + + + $(SourceRevisionId) + $(SourceRevisionId.Substring(0, 9)) + + $(RepositorySha) + + + + + <_GitSourceRoot Include="@(SourceRoot -> WithMetadataValue('SourceControl', 'git'))" /> + + + + @(_GitSourceRoot) + + + + + + + $(RepositoryUrl) + $(Description) + $(RepositoryUrl)/blob/main/changelog.md + + + + + + + + diff --git a/src/Directory.props b/src/Directory.props new file mode 100644 index 0000000..23ee86d --- /dev/null +++ b/src/Directory.props @@ -0,0 +1,10 @@ + + + + Preview + false + false + true + + + \ No newline at end of file diff --git a/src/StructId.Tests/Misc.cs b/src/StructId.Tests/Misc.cs new file mode 100644 index 0000000..d65067f --- /dev/null +++ b/src/StructId.Tests/Misc.cs @@ -0,0 +1,10 @@ +namespace StructId; + +public class Misc +{ + [Fact] + public void Test1() + { + + } +} \ No newline at end of file diff --git a/src/StructId.Tests/StructId.Tests.csproj b/src/StructId.Tests/StructId.Tests.csproj new file mode 100644 index 0000000..ecbb055 --- /dev/null +++ b/src/StructId.Tests/StructId.Tests.csproj @@ -0,0 +1,23 @@ +ο»Ώ + + + net8.0 + enable + true + + + + + + + + + + + + + + + + + diff --git a/src/StructId/IStructId.cs b/src/StructId/IStructId.cs new file mode 100644 index 0000000..e188e7e --- /dev/null +++ b/src/StructId/IStructId.cs @@ -0,0 +1,6 @@ +ο»Ώnamespace ROOTNAMESPACE; + +partial interface IStructId where T : struct +{ + T Value { get; } +} diff --git a/src/StructId/StructId.csproj b/src/StructId/StructId.csproj new file mode 100644 index 0000000..ee9deb9 --- /dev/null +++ b/src/StructId/StructId.csproj @@ -0,0 +1,25 @@ +ο»Ώ + + + netstandard2.0 + analyzers/dotnet/roslyn4.8/cs + true + + + true + + + + + + + + + + + + + + + +