Skip to content

Modernize API, enhance testing, and restructure workspace#12

Merged
HannoZ merged 22 commits into
masterfrom
modernize
Apr 29, 2026
Merged

Modernize API, enhance testing, and restructure workspace#12
HannoZ merged 22 commits into
masterfrom
modernize

Conversation

@HannoZ
Copy link
Copy Markdown
Owner

@HannoZ HannoZ commented Apr 28, 2026

This pull request introduces significant updates to the Lexicala.NET repository, focusing on modernizing the build system, updating documentation, and clarifying repository structure. The main highlights are the migration to .NET 10.0, removal of legacy packaging workflows, improved and expanded documentation, and the addition of new API game service contracts.

Build System Modernization and Cleanup:

  • All GitHub Actions workflows have been updated to use .NET 10.0 and the .slnx solution file, with the latest actions versions and improved YAML syntax. [1] [2] [3]
  • Legacy packaging workflows for Autofac and MicrosoftDependencyInjection have been removed, as those packages are no longer supported. [1] [2]

Documentation and Repository Information:

  • The README.md has been completely rewritten for clarity and completeness, including installation, configuration, code examples, API coverage, and frontend/backend integration instructions. It also reflects the removal of unsupported endpoints and legacy solution files.
  • A new .github/instructions/repository-information.instructions.md file has been added, providing canonical details on repository structure, supported frameworks, and project layout for consistent reference.
  • The changelog.md has been updated to document the 3.0.0 release, highlighting the migration to System.Text.Json, new ASP.NET Core Web API host, and .NET 10.0/8.0 support.

API and Game Service Additions:

  • New game service interfaces and contracts for "Sense Sprint" have been added to the demo API, supporting round creation, clue revealing, and guess submission for the game endpoints. [1] [2]

Most Important Changes

Build System Modernization

  • Updated all CI workflows to use .NET 10.0, the source/Lexicala.NET.slnx solution file, and the latest GitHub Actions versions for improved compatibility and future-proofing. [1] [2] [3]
  • Removed obsolete packaging workflows for Autofac and MicrosoftDependencyInjection, reflecting the removal of these packages from the project. [1] [2]

Documentation and Repository Structure

  • Completely rewrote README.md to provide modern, clear installation, usage, and API documentation, and removed references to deprecated endpoints and files.
  • Added .github/instructions/repository-information.instructions.md as the canonical source for repository structure and project layout information.
  • Updated changelog.md for the 3.0.0 release, summarizing all major breaking changes and improvements.

API and Demo Enhancements

  • Introduced new game service interfaces and contracts (ISenseSprintGameService, SenseSprintContracts.cs) to support the Sense Sprint game endpoints in the demo API. [1] [2]

HannoZ and others added 10 commits April 19, 2026 20:40
- Consolidated code review findings and resolved all identified issues.
- Implemented input validation for AdvancedSearch and FlukySearch methods, ensuring proper exception handling for invalid sources.
- Enhanced GetEntryAsync and GetSenseAsync methods to encode IDs in the request path.
- Improved concurrency handling in LexicalaSearchParser to respect rate limits and optimize entry fetching.
- Added comprehensive unit tests for AdvancedSearch and FlukySearch methods, covering edge cases and invalid inputs.
- Updated dependency registration to include Polly for resilient HTTP requests with retry policies.
- Removed legacy response models from the Me endpoint as they are no longer in use.
- Corrected XML documentation typos and ensured documentation parity with official Lexicala API.
- Updated README code samples to reflect recent changes and ensure accuracy.
- Added SVG assets for React and Vite logos.
- Created global CSS styles with custom variables and font imports.
- Set up main entry point for React application.
- Configured TypeScript settings for application and node environments.
- Established Vite configuration with proxy settings for development server.
@HannoZ HannoZ requested a review from Copilot April 28, 2026 18:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes the Lexicala.NET SDK and repo layout by migrating JSON handling to System.Text.Json, updating the public client surface (new endpoints + cancellation support), expanding tests, and introducing a demo ASP.NET Core host plus a small Sense Sprint game (backend + Vite/React frontend).

Changes:

  • Migrate response models and custom converters from Newtonsoft.Json to System.Text.Json with centralized serializer defaults.
  • Expand ILexicalaClient API surface (RDF/search-entries/definitions/fluky, cancellation tokens) and add richer error/metadata handling.
  • Replace the legacy console app with an ASP.NET Core demo API + add a Sense Sprint game service and a Vite/React demo frontend; update CI to use .slnx and .NET 10.

Reviewed changes

Copilot reviewed 96 out of 103 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
source/Lexicala.NET/Response/Test/TestResponse.cs Switch to JsonPropertyName + add XML docs for test payload.
source/Lexicala.NET/Response/Search/Sense.cs Switch search sense model to System.Text.Json attributes.
source/Lexicala.NET/Response/Search/SearchResponseJsonConverter.cs Replace Newtonsoft settings with JsonSerializerOptions defaults.
source/Lexicala.NET/Response/Search/SearchResponse.cs Migrate to STJ + add response metadata property/docs.
source/Lexicala.NET/Response/Search/Result.cs Migrate search result model to STJ attributes.
source/Lexicala.NET/Response/Search/HeadwordObjectConverter.cs Port union-shape converter to System.Text.Json.
source/Lexicala.NET/Response/Search/HeadwordObject.cs Formatting/namespace cleanup for search headword union type.
source/Lexicala.NET/Response/Search/Headword.cs Migrate search headword model to STJ attributes.
source/Lexicala.NET/Response/ResponseMetadata.cs Clarify XML docs around header-derived metadata.
source/Lexicala.NET/Response/ResponseHeaders.cs Minor formatting/namespace cleanup.
source/Lexicala.NET/Response/RateLimits.cs Clarify XML docs for rate limit header semantics.
source/Lexicala.NET/Response/Me/Usage.cs Remove /me response model (endpoint removed).
source/Lexicala.NET/Response/Me/Today.cs Remove /me response model (endpoint removed).
source/Lexicala.NET/Response/Me/Permissions.cs Remove /me response model (endpoint removed).
source/Lexicala.NET/Response/Me/MeResponse.cs Remove /me response model (endpoint removed).
source/Lexicala.NET/Response/Me/Activation.cs Remove /me response model (endpoint removed).
source/Lexicala.NET/Response/Languages/Resources.cs Migrate language resources model to STJ attributes.
source/Lexicala.NET/Response/Languages/Resource.cs Migrate language resource model to STJ attributes.
source/Lexicala.NET/Response/Languages/LanguagesResponse.cs Migrate + add XML docs for languages endpoint payload.
source/Lexicala.NET/Response/Entries/TranslationObject.cs Add docs for union-shape translation wrapper.
source/Lexicala.NET/Response/Entries/Translation.cs Migrate translation model to STJ + add docs/cleanup.
source/Lexicala.NET/Response/Entries/Sense.cs Migrate entry sense model to STJ + add docs + metadata support.
source/Lexicala.NET/Response/Entries/PronunciationObject.cs Add docs for union-shape pronunciation wrapper.
source/Lexicala.NET/Response/Entries/Pronunciation.cs Migrate pronunciation model to STJ + add docs.
source/Lexicala.NET/Response/Entries/Pos.cs Add docs for union-shape POS wrapper.
source/Lexicala.NET/Response/Entries/JsonConverters/TranslationObjectConverter.cs Port union-shape converter to System.Text.Json.
source/Lexicala.NET/Response/Entries/JsonConverters/PronunciationObjectConverter.cs Port union-shape converter to System.Text.Json.
source/Lexicala.NET/Response/Entries/JsonConverters/PosConverter.cs Port POS converter to System.Text.Json.
source/Lexicala.NET/Response/Entries/JsonConverters/HeadwordObjectConverter.cs Port headword union converter to System.Text.Json.
source/Lexicala.NET/Response/Entries/JsonConverters/FlexibleIntConverter.cs Add converter to accept string-or-number ints.
source/Lexicala.NET/Response/Entries/JsonConverters/EntryResponseJsonConverter.cs Replace Newtonsoft settings with STJ options defaults.
source/Lexicala.NET/Response/Entries/JsonConverters/AlternativeScriptsObjectConverter.cs Port union-shape converter to System.Text.Json.
source/Lexicala.NET/Response/Entries/Inflection.cs Migrate inflection model to STJ + add docs.
source/Lexicala.NET/Response/Entries/HeadwordObject.cs Add docs for union-shape entry headword wrapper.
source/Lexicala.NET/Response/Entries/Headword.cs Migrate entry headword model to STJ + add normalization helpers/docs.
source/Lexicala.NET/Response/Entries/Example.cs Migrate examples model to STJ + add docs.
source/Lexicala.NET/Response/Entries/Entry.cs Migrate entry model to STJ + add metadata and headword normalization.
source/Lexicala.NET/Response/Entries/CompositionalPhrase.cs Migrate compositional phrase model to STJ + add docs.
source/Lexicala.NET/Response/Entries/AlternativeScriptsObject.cs Add docs for union-shape alternative scripts wrapper.
source/Lexicala.NET/Response/Entries/AlternativeScripts.cs Migrate alt scripts model to STJ + expand enum/docs.
source/Lexicala.NET/Request/Sources.cs Add Multigloss source constant (but currently has formatting issues).
source/Lexicala.NET/Request/AdvancedSearchRequest.cs Add synonyms/antonyms flags to advanced search request.
source/Lexicala.NET/Parsing/LexicalaSearchParser.cs Add input validation, translation filtering, and concurrency-controlled entry fetching.
source/Lexicala.NET/Parsing/ILexicalaSearchParser.cs Expand XML docs and exception contracts for parser APIs.
source/Lexicala.NET/Parsing/CollectionExtensions.cs Remove internal AddRange helper (no longer needed).
source/Lexicala.NET/LexicalaApiException.cs Introduce dedicated API exception type carrying status/content/metadata.
source/Lexicala.NET/Lexicala.NET.csproj Move to net10.0 + net8.0 and update package references; bump version to 3.0.0.
source/Lexicala.NET/JsonSerializerDefaults.cs Add centralized JsonSerializerOptions (naming policy + converters).
source/Lexicala.NET/InternalsVisibleTo.cs Allow tests to access internals.
source/Lexicala.NET/ILexicalaClient.cs Expand/modernize client surface (new endpoints, cancellation tokens, docs).
source/Lexicala.NET/DependencyRegistration.cs Improve DI registration, validate config, and add retry policy with 429 handling.
source/Lexicala.NET/Constants.cs Centralize endpoint path constants and request threshold constant.
source/Lexicala.NET.slnx Add .slnx solution for modern tooling/CI.
source/Lexicala.NET.sln Remove legacy .sln solution.
source/Lexicala.NET.Tests/Resources/me.json Remove /me test fixture.
source/Lexicala.NET.Tests/Resources/languages.json Update language fixture values/codes.
source/Lexicala.NET.Tests/LexicalaClientTestBase.cs Add shared HTTP handler mocking + fixture loader.
source/Lexicala.NET.Tests/LexicalaClientRdfTests.cs Add RDF endpoint tests.
source/Lexicala.NET.Tests/LexicalaClientHealthAndLanguagesTests.cs Add /test and /languages tests + error path coverage.
source/Lexicala.NET.Tests/LexicalaClientFlukySearchTests.cs Add fluky-search tests including validation and single-result mapping.
source/Lexicala.NET.Tests/LexicalaClientEntryTests.cs Add entry/sense tests incl. metadata and path encoding.
source/Lexicala.NET.Tests/LexicalaClientBasicSearchTests.cs Add basic search tests incl. validation, ETag, metadata.
source/Lexicala.NET.Tests/LexicalaClientAdvancedSearchTests.cs Add advanced search tests incl. query building + new params.
source/Lexicala.NET.Tests/Lexicala.NET.Tests.csproj Update tests to net10.0 and bump test dependencies.
source/Lexicala.NET.ConsoleApp/Program.cs Remove legacy console tester app.
source/Lexicala.NET.ConsoleApp/Lexicala.NET.ConsoleApp.csproj Remove legacy console tester project file.
source/Demo/sense-sprint-web/vite.config.ts Add Vite dev server config with proxy to backend.
source/Demo/sense-sprint-web/tsconfig.node.json Add TS config for node/Vite.
source/Demo/sense-sprint-web/tsconfig.json Add TS project references config.
source/Demo/sense-sprint-web/tsconfig.app.json Add TS config for React app.
source/Demo/sense-sprint-web/src/main.tsx Add React entrypoint.
source/Demo/sense-sprint-web/src/index.css Add global styling/theme for demo UI.
source/Demo/sense-sprint-web/src/assets/vite.svg Add Vite asset.
source/Demo/sense-sprint-web/src/assets/react.svg Add React asset.
source/Demo/sense-sprint-web/src/App.tsx Implement Sense Sprint UI + API calls + debug panel.
source/Demo/sense-sprint-web/src/App.css Add UI component styling/animations.
source/Demo/sense-sprint-web/public/icons.svg Add icon sprites.
source/Demo/sense-sprint-web/public/favicon.svg Add favicon.
source/Demo/sense-sprint-web/package.json Add frontend dependencies/scripts.
source/Demo/sense-sprint-web/index.html Add Vite HTML template.
source/Demo/sense-sprint-web/eslint.config.js Add ESLint flat config for TS/React.
source/Demo/sense-sprint-web/README.md Add default Vite template README.
source/Demo/sense-sprint-web/.gitignore Add frontend ignore rules.
source/Demo/Lexicala.NET.Demo.Api/appsettings.json Add demo API settings file placeholder.
source/Demo/Lexicala.NET.Demo.Api/Program.cs Add minimal API host with Swagger + game endpoints.
source/Demo/Lexicala.NET.Demo.Api/Lexicala.NET.Demo.Api.csproj Add demo host project targeting net10.0.
source/Demo/Lexicala.NET.Demo.Api/Game/SenseSprintGameService.cs Implement Sense Sprint game logic using Fluky Search + entries.
source/Demo/Lexicala.NET.Demo.Api/Game/SenseSprintContracts.cs Add DTO contracts for game endpoints.
source/Demo/Lexicala.NET.Demo.Api/Game/ISenseSprintGameService.cs Add game service abstraction.
changelog.md Document 3.0.0 release and normalize formatting.
README.md Rewrite docs for new structure, endpoints, and demo workflow (needs sample fixes).
.gitignore Update ignore rules for workspace tooling files.
.github/workflows/package-main.yml Update CI to .NET 10 + .slnx + newer actions.
.github/workflows/package-autofac.yml Remove obsolete package workflow.
.github/workflows/package-Ms_DI.yml Remove obsolete package workflow.
.github/workflows/build-test_pull-request.yml Update PR CI to .NET 10 + .slnx.
.github/workflows/build-on-push.yml Update push CI to .NET 10 + .slnx.
.github/instructions/repository-information.instructions.md Add canonical repository structure/reference instructions.
Files not reviewed (1)
  • source/Demo/sense-sprint-web/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/Lexicala.NET/Lexicala.NET.csproj
Comment thread source/Lexicala.NET/Response/Search/SearchResponse.cs
Comment thread source/Lexicala.NET/Response/Search/Result.cs
Comment thread README.md
Comment thread README.md Outdated
Comment on lines +44 to +47
public async Task LexicalaClient_CanDeserializeEntry_ES_DE00008089()
{
await AssertEntryDeserializes("Entry_ES_DE00008088.json", "ES_DE00008088");
}
Copy link

Copilot AI Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test name suggests entry ES_DE00008089, but the assertion loads Entry_ES_DE00008088.json and uses ID ES_DE00008088. Rename the test or adjust the fixture/ID so the name matches what’s being validated (helps keep the suite searchable and avoids confusion when failures occur).

Copilot uses AI. Check for mistakes.
Comment thread source/Lexicala.NET/Response/Search/SearchResponseJsonConverter.cs Outdated
Comment thread README.md Outdated
Comment thread changelog.md Outdated
HannoZ and others added 6 commits April 28, 2026 20:47
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…package readme

Co-authored-by: Copilot <copilot@github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 97 out of 104 changed files in this pull request and generated 5 comments.

Files not reviewed (1)
  • source/Demo/sense-sprint-web/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/Lexicala.NET/Request/Sources.cs Outdated
Comment thread README.md Outdated
Comment thread README.md Outdated
Comment thread source/Lexicala.NET/Parsing/ILexicalaSearchParser.cs
HannoZ and others added 5 commits April 29, 2026 08:47
…modifiers to internal

Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@HannoZ HannoZ merged commit f17c66e into master Apr 29, 2026
1 check passed
@HannoZ HannoZ deleted the modernize branch April 29, 2026 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants