Skip to content

Commit 7dd58bd

Browse files
authored
Merge pull request #390 from ignatandrei/Blazor.TSRuntime
2 parents 8a52ba1 + b2d6373 commit 7dd58bd

File tree

100 files changed

+62439
-70
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+62439
-70
lines changed

README.md

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# RSCG - 212 Examples of Roslyn Source Code Generators / 14 created by Microsoft /
1+
# RSCG - 213 Examples of Roslyn Source Code Generators / 14 created by Microsoft /
22

3-
## Latest Update : 2025-08-01 => 01 August 2025
3+
## Latest Update : 2025-08-02 => 02 August 2025
44

55
If you want to see examples with code, please click ***[List V2](https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG)***
66

@@ -20,8 +20,30 @@ If you want to be notified each time I add a new RSCG example , please click htt
2020

2121
## Content
2222

23-
Those are the 212 Roslyn Source Code Generators that I have tested you can see and download source code example.
23+
Those are the 213 Roslyn Source Code Generators that I have tested you can see and download source code example.
2424
( including 14 from Microsoft )
25+
### 213. [Blazor.TSRuntime](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime) , in the [Blazor](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#blazor) category
26+
27+
Generated on : 2025-08-02 => 02 August 2025
28+
29+
<details>
30+
<summary>Expand</summary>
31+
32+
33+
34+
Author: Black White Yoshi
35+
36+
TSRuntime is an improved JSRuntime with automatic JS-module loading and caching, compile time errors instead of runtime errors and nice IntelliSense guidance.
37+
38+
Nuget: [https://www.nuget.org/packages/Blazor.TSRuntime/](https://www.nuget.org/packages/Blazor.TSRuntime/)
39+
40+
41+
Link: [https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime](https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime)
42+
43+
Source: [https://github.com/BlackWhiteYoshi/Blazor.TSRuntime](https://github.com/BlackWhiteYoshi/Blazor.TSRuntime)
44+
45+
</details>
46+
2547
### 212. [StackXML](https://ignatandrei.github.io/RSCG_Examples/v2/docs/StackXML) , in the [Serializer](https://ignatandrei.github.io/RSCG_Examples/v2/docs/rscg-examples#serializer) category
2648

2749
Generated on : 2025-08-01 => 01 August 2025

later.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Just later
22

3-
## Latest Update : 2025-08-01 => 01 August 2025
3+
## Latest Update : 2025-08-02 => 02 August 2025
44

55

66

v2/Generator/MultiGeneratorV2.cs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ public string[] SourceNoRSCG()
172172
text = text.Replace("(CopyTo)", $"({d.Generator!.Source}/CopyTo");
173173
text=text.Replace("(./docs/BenchmarksResults)", $"({d.Generator!.Source}/docs/BenchmarksResults");
174174
text = text.Replace("(sg_example.png", $"({d.Generator!.Source}/sg_example.png");
175+
text = text.Replace("(Readme_md/", $"({d.Generator!.Source}Readme_md/");
175176
text = text.Replace("(README.md)", $"({d.Generator!.Source}README.md");
176177
text = text.Replace("(src/samples/ConsoleSample)", $"({d.Generator!.Source}src/samples/ConsoleSample");
177178
text = text.Replace("(src/Jab.Performance/)", $"({d.Generator!.Source}src/Jab.Performance/");
@@ -923,7 +924,20 @@ private async Task<bool> WroteDocusaurus(Description it, string pathDocusaurus)
923924
var template = await File.ReadAllTextAsync("DocusaurusExample.txt");
924925
var templateScriban = Scriban.Template.Parse(template);
925926
var output = templateScriban.Render(new {Description=it, otherDesc, category}, member => member.Name);
926-
927+
output = output
928+
.Replace(" { ", " \\{ ")
929+
.Replace(" } ", " \\} ")
930+
.Replace("Action<>", "Action&lt;&gt;")
931+
.Replace("Func<>", "Func&lt;&gt;")
932+
.Replace("{Type}", "\\{Type}\\}")
933+
.Replace("{Name}", "\\{Name}\\}")
934+
.Replace("{PropertyName}", "\\{PropertyName}\\}")
935+
.Replace("{TypeName}", "\\{TypeName}\\}")
936+
.Replace("{NameOfProperty}", "\\{NameOfProperty}\\}")
937+
.Replace("{SingularName}", "\\{SingularName}\\}")
938+
.Replace("{get}", "\\{get}\\}")
939+
940+
;
927941
string folderToWrite = Path.Combine(pathDocusaurus, "docs", "RSCG-Examples");
928942
ArgumentNullException.ThrowIfNull(it.Generator);
929943
string file = it.Generator.Name+ ".md";

v2/Generator/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ await File.WriteAllTextAsync(Path.Combine(examples,"description.json"),
154154

155155
long nr = await m.GenerateMSFT();
156156
Console.WriteLine("RSCG used by MSFT :" + nr);
157-
var lastGenerator = "AssemblyVersionInfo";
157+
var lastGenerator = "Blazor.TSRuntime";
158158

159159
await m.WrotePost(lastGenerator);
160160
await m.WroteDocusaurusAll(lastGenerator);

v2/Generator/all.csv

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,3 +211,4 @@ Nr,Key,Source,Category
211211
210,AssemblyVersionInfo, https://github.com/BlackWhiteYoshi/AssemblyVersionInfo,EnhancementProject
212212
211,ShadowWriterNullobjects, https://github.com/StefanStolz/ShadowWriter,Interface
213213
212,StackXML, https://github.com/ZingBallyhoo/StackXML,Serializer
214+
213,Blazor.TSRuntime, https://github.com/BlackWhiteYoshi/Blazor.TSRuntime,Blazor

v2/RSCGExamplesData/GeneratorDataRec.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1280,5 +1280,11 @@
12801280
"Category": 16,
12811281
"dtStart": "2025-08-01T00:00:00",
12821282
"show": true
1283+
},
1284+
{
1285+
"ID":"Blazor.TSRuntime",
1286+
"Category": 21,
1287+
"dtStart": "2025-08-02T00:00:00",
1288+
"show": true
12831289
}
12841290
]
Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
2+
<h1>RSCG nr 213 : Blazor.TSRuntime</h1>
3+
4+
<h2>Info</h2>
5+
Nuget : <a href="https://www.nuget.org/packages/Blazor.TSRuntime/" target="_blank">https://www.nuget.org/packages/Blazor.TSRuntime/</a>
6+
7+
<p>You can find more details at : <a href="https://github.com/BlackWhiteYoshi/Blazor.TSRuntime" target="_blank"> https://github.com/BlackWhiteYoshi/Blazor.TSRuntime</a></p>
8+
9+
<p>Author :Black White Yoshi</p>
10+
11+
<p>Source: <a href="https://github.com/BlackWhiteYoshi/Blazor.TSRuntime" target="_blank">https://github.com/BlackWhiteYoshi/Blazor.TSRuntime</a> </p>
12+
13+
<h2>About</h2>
14+
15+
Generating C# Code for Blazor from javascript files
16+
17+
<h2>
18+
How to use
19+
</h2>
20+
<h3>
21+
Add reference to the <a href="https://www.nuget.org/packages/Blazor.TSRuntime/" target="_blank">Blazor.TSRuntime</a> in the csproj
22+
</h3>
23+
<img src="images/Blazor.TSRuntime/BlazorData.csproj.png" width="580" height="580" />
24+
25+
<h3>This was for me the <b>starting</b> code</h3>
26+
27+
<br />
28+
I have <b>coded</b> the file Program.cs
29+
<br />
30+
<img src="images/Blazor.TSRuntime/csFiles/Program.cs.png" width="580" height="580" />
31+
<hr />
32+
33+
<br />
34+
I have <b>coded</b> the file tsruntime.json
35+
<br />
36+
<img src="images/Blazor.TSRuntime/csFiles/tsruntime.json.png" width="580" height="580" />
37+
<hr />
38+
39+
<br />
40+
I have <b>coded</b> the file Home.razor
41+
<br />
42+
<img src="images/Blazor.TSRuntime/csFiles/Home.razor.png" width="580" height="580" />
43+
<hr />
44+
45+
<br />
46+
I have <b>coded</b> the file Home.razor.js
47+
<br />
48+
<img src="images/Blazor.TSRuntime/csFiles/Home.razor.js.png" width="580" height="580" />
49+
<hr />
50+
<h3>And here are the <i>generated</i> files</h3>
51+
52+
<br />
53+
The file <i>generated</i> is ITSRuntime_bootstrap.g.cs
54+
<br />
55+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap.g.cs.png" width="580" height="580" />
56+
57+
<br />
58+
The file <i>generated</i> is ITSRuntime_bootstrap_bundle.g.cs
59+
<br />
60+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_bundle.g.cs.png" width="580" height="580" />
61+
62+
<br />
63+
The file <i>generated</i> is ITSRuntime_bootstrap_bundle_min.g.cs
64+
<br />
65+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_bundle_min.g.cs.png" width="580" height="580" />
66+
67+
<br />
68+
The file <i>generated</i> is ITSRuntime_bootstrap_esm.g.cs
69+
<br />
70+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_esm.g.cs.png" width="580" height="580" />
71+
72+
<br />
73+
The file <i>generated</i> is ITSRuntime_bootstrap_esm_min.g.cs
74+
<br />
75+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_esm_min.g.cs.png" width="580" height="580" />
76+
77+
<br />
78+
The file <i>generated</i> is ITSRuntime_bootstrap_min.g.cs
79+
<br />
80+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_bootstrap_min.g.cs.png" width="580" height="580" />
81+
82+
<br />
83+
The file <i>generated</i> is ITSRuntime_Core.g.cs
84+
<br />
85+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_Core.g.cs.png" width="580" height="580" />
86+
87+
<br />
88+
The file <i>generated</i> is ITSRuntime_Home.g.cs
89+
<br />
90+
<img src="images/Blazor.TSRuntime/generated/ITSRuntime_Home.g.cs.png" width="580" height="580" />
91+
92+
<br />
93+
The file <i>generated</i> is TSRuntime.g.cs
94+
<br />
95+
<img src="images/Blazor.TSRuntime/generated/TSRuntime.g.cs.png" width="580" height="580" />
96+
97+
<br />
98+
The file <i>generated</i> is TSRuntime_ServiceExtension.g.cs
99+
<br />
100+
<img src="images/Blazor.TSRuntime/generated/TSRuntime_ServiceExtension.g.cs.png" width="580" height="580" />
101+
102+
<p>
103+
You can download the code and this page as pdf from
104+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime'>
105+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/Blazor.TSRuntime
106+
</a>
107+
</p>
108+
109+
110+
<p>
111+
You can see the whole list at
112+
<a target="_blank" href='https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG'>
113+
https://ignatandrei.github.io/RSCG_Examples/v2/docs/List-of-RSCG
114+
</a>
115+
</p>
116+

v2/book/list.html

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
</head>
1818
<body>
1919
<h1>
20-
This is the list of 212 RSCG with examples =>
20+
This is the list of 213 RSCG with examples =>
2121
</h1>
2222

2323
<table >
@@ -874,6 +874,10 @@ <h1>
874874
<td>212</td>
875875
<td><a href="examples/StackXML.html">StackXML</a></td>
876876
</tr>
877+
<tr>
878+
<td>213</td>
879+
<td><a href="examples/Blazor.TSRuntime.html">Blazor.TSRuntime</a></td>
880+
</tr>
877881
</table>
878882

879883

v2/book/pandocHTML.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ input-files:
226226
- examples/AssemblyVersionInfo.html
227227
- examples/ShadowWriterNullobjects.html
228228
- examples/StackXML.html
229+
- examples/Blazor.TSRuntime.html
229230

230231
# or you may use input-file: with a single value
231232
# defaults:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"generator":{
3+
"name":"Blazor.TSRuntime",
4+
"nuget":[
5+
"https://www.nuget.org/packages/Blazor.TSRuntime/"
6+
],
7+
"link":"https://github.com/BlackWhiteYoshi/Blazor.TSRuntime",
8+
"author":"Black White Yoshi",
9+
"source":"https://github.com/BlackWhiteYoshi/Blazor.TSRuntime"
10+
},
11+
"data":{
12+
"goodFor":["Generating C# Code for Blazor from javascript files"],
13+
"csprojDemo":"BlazorData.csproj",
14+
"csFiles":["Program.cs","tsruntime.json","Home.razor","Home.razor.js"],
15+
"excludeDirectoryGenerated":["Microsoft.CodeAnalysis.Razor.Compiler"],
16+
"includeAdditionalFiles":[""]
17+
},
18+
"links":{
19+
"blog":"",
20+
"video":""
21+
}
22+
}

0 commit comments

Comments
 (0)