Skip to content

first#461

Merged
ignatandrei merged 3 commits intomainfrom
TypedPaths
Apr 2, 2026
Merged

first#461
ignatandrei merged 3 commits intomainfrom
TypedPaths

Conversation

@ignatandrei
Copy link
Copy Markdown
Owner

@ignatandrei ignatandrei commented Apr 2, 2026

Summary by CodeRabbit

  • New Features

    • Added TypedPaths as the 259th RSCG example, including comprehensive documentation, example code snippets, setup instructions, and usage demonstrations.
  • Bug Fixes

    • Improved robustness of NuGet API response parsing with error handling and detailed logging for debugging.

Copilot AI review requested due to automatic review settings April 2, 2026 18:59
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 2, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Added a new RSCG (Roslyn Source Code Generator) example titled "TypedPaths" to the documentation catalog. Updated example count from 258 to 259 across README, metadata, and site documentation. Added TypedPaths example code, configuration, tours, and comprehensive documentation in multiple formats.

Changes

Cohort / File(s) Summary
Core Documentation Updates
README.md, later.md
Updated example count from 258 to 259 and changed "Latest Update" date from 2026-03-18 to 2026-04-01 in README and timestamp metadata.
TypedPaths Example Implementation
v2/rscg_examples/TypedPaths/src/FolderToCode.slnx, v2/rscg_examples/TypedPaths/src/FolderToCode/FolderToCode.csproj, v2/rscg_examples/TypedPaths/src/FolderToCode/Program.cs
Added complete example project with solution descriptor, project file referencing TypedPaths.Generator v1.3.0, and sample program demonstrating generated path usage.
TypedPaths Metadata & Documentation
v2/rscg_examples/TypedPaths/description.json, v2/rscg_examples/TypedPaths/nuget.txt, v2/rscg_examples/TypedPaths/readme.txt, v2/.tours/TypedPaths.tour, v2/rscg_examples/TypedPaths/video.json
Added metadata, descriptions, CodeTour walkthrough, and video script for TypedPaths generator showcasing folder-to-typed-paths conversion functionality.
Site Documentation Pages
v2/book/examples/TypedPaths.html, v2/book/list.html, v2/book/pandocHTML.yaml
Added HTML example page for TypedPaths, updated list header count to 259, and included new page in pandoc build configuration.
Docusaurus Documentation
v2/rscg_examples_site/docs/RSCG-Examples/TypedPaths.md, v2/rscg_examples_site/docs/RSCG-Examples/index.md, v2/rscg_examples_site/docs/about.md, v2/rscg_examples_site/docs/indexRSCG.md, v2/rscg_examples_site/docs/Authors/Alex_Chim.md
Added TypedPaths documentation page, updated index to count 259 examples, added author page for Alex Chim, and updated count references across site documentation.
Category Documentation
v2/rscg_examples_site/docs/Categories/FilesToCode.md, v2/rscg_examples_site/docs/Categories/_PrimitiveFilesToCode.mdx
Updated FilesToCode category to list TypedPaths as entry #17 (bumping Weave to #18) with adjusted entry count from 17 to 18.
Site Metadata & Configuration
v2/RSCGExamplesData/GeneratorDataRec.json, v2/rscg_examples_site/static/exports/RSCG.json, v2/rscg_examples_site/src/components/HomepageFeatures/index.js
Added TypedPaths entry to JSON data exports with category, date, and metadata; updated feature count from 258 to 259 in homepage component.
Error Handling Improvement
v2/Generator/MultiGeneratorV2.cs
Wrapped NuGet API response JSON parsing in try/catch block to log parsing failures and return empty string instead of throwing unhandled exception.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐰 ✨ A twisty path through folders deep,
Now counted strong, from 258 to 259 we leap!
TypedPaths hops in, with classes typed so true,
And Alex Chim's creation brings fresh code review.
Hop along, dear RSCG, to build something new! 🌱

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Title check ❓ Inconclusive The title 'first' is vague and generic, providing no meaningful information about the changeset which adds the 259th RSCG example (TypedPaths generator) with comprehensive documentation and configuration files. Replace with a descriptive title that reflects the main change, such as 'Add TypedPaths RSCG example (#259)' or 'Add TypedPaths generator documentation and example'.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch TypedPaths

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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

Adds a new RSCG example entry for TypedPaths (FilesToCode category) and updates the generated site/book/export artifacts to include it as example #259.

Changes:

  • Add the TypedPaths example project + metadata (description, readme, NuGet blurb, downloadable zip, VS Code tour, and video script).
  • Update aggregated datasets/exports (JSON/XLSX/CSV) and docs indices/category pages to reflect 259 total examples.
  • Improve NuGet registration JSON parsing in the generator with error handling (and additional logging).

Reviewed changes

Copilot reviewed 25 out of 28 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
v2/RSCGExamplesData/GeneratorDataRec.json Adds TypedPaths entry to generator data list.
v2/rscg_examples/TypedPaths/video.json New video script for the TypedPaths example.
v2/rscg_examples/TypedPaths/src/FolderToCode/Program.cs Minimal demo usage of generated TypedPaths constants.
v2/rscg_examples/TypedPaths/src/FolderToCode/FolderToCode.csproj Demo project referencing TypedPaths.Generator and configuring TypedPathsFolder.
v2/rscg_examples/TypedPaths/src/FolderToCode/a/andrei.txt Input file used by the generator to produce a typed path.
v2/rscg_examples/TypedPaths/src/FolderToCode.slnx Solution wrapper for the demo project.
v2/rscg_examples/TypedPaths/readme.txt Captures upstream README content for documentation.
v2/rscg_examples/TypedPaths/nuget.txt Short NuGet description snippet for the example.
v2/rscg_examples/TypedPaths/description.json Example metadata (links, author, “good for”, demo files).
v2/rscg_examples_site/static/sources/TypedPaths.zip Downloadable zipped source for the TypedPaths example.
v2/rscg_examples_site/static/exports/RSCG.xlsx Regenerated Excel export including TypedPaths.
v2/rscg_examples_site/static/exports/RSCG.json Regenerated JSON export including TypedPaths.
v2/rscg_examples_site/src/components/HomepageFeatures/index.js Updates homepage example count (258 → 259).
v2/rscg_examples_site/docs/RSCG-Examples/TypedPaths.md New documentation page for TypedPaths example.
v2/rscg_examples_site/docs/RSCG-Examples/index.md Updates list-by-category page count and adds TypedPaths entry.
v2/rscg_examples_site/docs/indexRSCG.md Updates chronological list count and adds TypedPaths row (#259).
v2/rscg_examples_site/docs/Categories/FilesToCode.md Updates category count and adds TypedPaths to FilesToCode list.
v2/rscg_examples_site/docs/Categories/_PrimitiveFilesToCode.mdx Updates shared category snippet to include TypedPaths.
v2/rscg_examples_site/docs/Authors/Alex_Chim.md Adds new author page listing TypedPaths.
v2/rscg_examples_site/docs/about.md Updates “About” page count (258 → 259).
v2/Generator/MultiGeneratorV2.cs Adds logging + try/catch around NuGet JSON parsing.
v2/Generator/all.csv Adds TypedPaths row (#259) to generator input list.
v2/book/pandocHTML.yaml Includes TypedPaths HTML in pandoc input list.
v2/book/list.html Updates book list count and adds TypedPaths link.
v2/book/examples/TypedPaths.html Adds book HTML page for TypedPaths example.
v2/.tours/TypedPaths.tour Adds VS Code CodeTour for the TypedPaths example.
README.md Updates repo counts/latest update and adds TypedPaths summary section.
later.md Updates “Latest Update” date to 2026-04-01.

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

Comment on lines 334 to +342
var handler = new HttpClientHandler
{
AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate
};
HttpClient _client = new(handler);
Console.WriteLine($"grab data from {url}");
var response = await _client.GetAsync(url);
var data=await response.Content.ReadAsStringAsync();
var answer= JsonDocument.Parse(data);
Console.WriteLine($"{namePackage}: {data}");
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

HttpClient _client = new(handler); is created per package request but never disposed (and not reused). This can lead to socket exhaustion and unnecessary resource usage when iterating through many packages. Prefer reusing a single HttpClient instance for the generator run, or wrap this instance in a using/await using so it gets disposed after the request(s).

Copilot uses AI. Check for mistakes.
Comment on lines +343 to +347
JsonDocument answer;
try
{
answer = JsonDocument.Parse(data);
}
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

JsonDocument implements IDisposable, but answer is not disposed here. Use a using declaration (using var answer = JsonDocument.Parse(data);) so buffers are released promptly, especially since this runs in a loop across many packages.

Copilot uses AI. Check for mistakes.
Comment on lines +35 to +36
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/TypedPaths#download-example-net--c-",
SpeakTest=" "},
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This JSON is invalid: the object at the browser step is not closed correctly and SpeakTest=" " is not valid JSON syntax. This will fail any JSON parsing for video scripts. Make SpeakTest a quoted JSON property on the same object (or remove it) and ensure the browser step object is properly closed.

Suggested change
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/TypedPaths#download-example-net--c-",
SpeakTest=" "},
{"typeStep":"browser","arg":"https://ignatandrei.github.io/RSCG_Examples/v2/docs/TypedPaths#download-example-net--c-","SpeakTest":" "},

Copilot uses AI. Check for mistakes.
,{
"file": "rscg_examples/TypedPaths/src/FolderToCode/Program.cs",
"description": "File Program.cs \r\n>> dotnet run --project rscg_examples/TypedPaths/src/FolderToCode/FolderToCode.csproj ",
"pattern": "this is the code"
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

This CodeTour step uses "pattern": "this is the code", but the referenced Program.cs in this PR doesn’t contain that text, so the step likely won’t resolve/highlight anything. Update the pattern to match actual content (e.g., TypedPaths.Src) or switch to a line-based step.

Suggested change
"pattern": "this is the code"
"pattern": "TypedPaths.Src"

Copilot uses AI. Check for mistakes.
Comment on lines +4 to +6
<h2>Info</h2>
Nuget : <a href="https://www.nuget.org/packages/TypedPaths/" target="_blank">https://www.nuget.org/packages/TypedPaths/</a>

Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

The NuGet links and package name in this generated HTML point to https://www.nuget.org/packages/TypedPaths/, but the example and docs use TypedPaths.Generator (https://www.nuget.org/packages/TypedPaths.Generator/). This mismatch will send readers to the wrong package (or a non-existent one). Update the URL/text to the generator package.

Copilot uses AI. Check for mistakes.
const FeatureList = [
{
title: '258 Examples (16 from MSFT)',
title: '259 Examples (16 from MSFT)',
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Indentation for the title property is inconsistent with the surrounding object literal (it’s not aligned with Svg and description). If this repo enforces formatting (Prettier/ESLint), this can cause lint/format noise. Re-indent the title line to match the surrounding style.

Suggested change
title: '259 Examples (16 from MSFT)',
title: '259 Examples (16 from MSFT)',

Copilot uses AI. Check for mistakes.
var response = await _client.GetAsync(url);
var data=await response.Content.ReadAsStringAsync();
var answer= JsonDocument.Parse(data);
Console.WriteLine($"{namePackage}: {data}");
Copy link

Copilot AI Apr 2, 2026

Choose a reason for hiding this comment

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

Console.WriteLine($"{namePackage}: {data}"); logs the entire NuGet registration JSON for every package. This can be extremely large and will flood logs / slow down runs. Consider removing it, logging only on failures, or truncating/summarizing the payload (e.g., status code + first N chars).

Suggested change
Console.WriteLine($"{namePackage}: {data}");
Console.WriteLine($"{namePackage}: status {(int)response.StatusCode} ({response.StatusCode}), length {data.Length} chars");

Copilot uses AI. Check for mistakes.
@ignatandrei ignatandrei merged commit cf08505 into main Apr 2, 2026
6 of 7 checks passed
@ignatandrei ignatandrei deleted the TypedPaths branch April 2, 2026 19:04
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.

2 participants