Skip to content

Commit b29aae8

Browse files
committed
Merge branch 'main' into generators
2 parents abf30c9 + ff35b30 commit b29aae8

File tree

83 files changed

+25
-15
lines changed

Some content is hidden

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

83 files changed

+25
-15
lines changed

Diff for: autoverify.ps1

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
Get-ChildItem test -Filter "*.verified.*" -Recurse | Remove-Item -Force
2+
Get-ChildItem test/Html/* -Directory | Remove-Item -Recurse -Force
23
dotnet test -e GQLPLUS_AUTOVERIFY=true -l "trx;LogFileName=TestResults.trx" -f net9.0
34
Write-Host "`n"
45
./make-summary.ps1 -NoCoverage
6+
Start-Process test/Html/index.html

Diff for: collect-samples.ps1

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[CmdletBinding()]
22
param (
3-
$SpecPath = "../graphql-plus.github.io"
3+
[switch]$AutoVerify = $false,
4+
$SpecPath = "../graphql-plus.github.io"
45
)
56

67
$source = Join-Path $SpecPath "samples"
@@ -23,4 +24,8 @@ Get-ChildItem $source -Recurse -Exclude "*.md","*.yml" | ForEach-Object {
2324
$relative = Resolve-Path -RelativeBasePath $source -Relative $_
2425
$to = Join-Path $dest $relative
2526
Copy-Item $_ $to -Force
26-
}
27+
}
28+
29+
if ($AutoVerify) {
30+
./autoverify.ps1
31+
}

Diff for: report.ps1

+1
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ $report += "riskHotspotsAnalysisThresholds:metricThresholdForCyclomaticComplexit
1010

1111
dotnet tool restore
1212
dotnet reportgenerator @report
13+
Start-Process test/Html/index.html
1314
livereloadserver coverage --port 5300

Diff for: test/GqlPlus.ComponentTestBase/TestSchemaInputs.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public async Task Test_Spec(string sample)
4747
{
4848
string schema = await ReadSchema(sample, "Specification");
4949

50-
await Label_Input("Schema", schema, ["Schema", "Specification"], sample);
50+
await Label_Input("Spec", schema, ["Schema", "Specification"], sample);
5151
}
5252

5353
protected abstract Task Label_Input(string label, string input, string[] dirs, string test, string section = "");

Diff for: test/GqlPlus.Modeller.ComponentTests/BuiltInTests.cs

+9-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@ public class BuiltInTests(IModelAndRender renderer)
1111
[Theory]
1212
[ClassData(typeof(BuiltInBasicData))]
1313
public void HtmlBasicTypes(string type)
14-
=> RenderTypeHtml(BuiltInData.BasicMap[type], []);
14+
=> RenderTypeHtml("Basic", BuiltInData.BasicMap[type], []);
1515

1616
[Theory]
1717
[ClassData(typeof(BuiltInInternalData))]
1818
public void HtmlInternalTypes(string type)
19-
=> RenderTypeHtml(BuiltInData.InternalMap[type], BuiltIn.Internal);
19+
=> RenderTypeHtml("Internal", BuiltInData.InternalMap[type], BuiltIn.Internal);
2020

2121
[Fact]
2222
public void HtmlAllBasicTypes()
@@ -38,11 +38,14 @@ public void HtmlAllInternalTypes()
3838
RenderSchemaHtml(schema, "!Internal");
3939
}
4040

41+
private readonly string[] _sections = ["!Basic", "!Internal"];
42+
4143
[Fact]
4244
public void Html_Index()
4345
{
4446
Structured result = new Map<Structured>() {
4547
["title"] = "BuiltIn",
48+
["items"] = _sections.Render(),
4649
["groups"] = new Map<Structured>() {
4750
["Basic"] = BuiltIn.Basic.Render(t => t.Name),
4851
["Internal"] = BuiltIn.Internal.Render(t => t.Name),
@@ -110,7 +113,7 @@ private void ModelType(IGqlpType type, IGqlpType[] extras)
110113
context.Errors.ShouldBeEmpty(type?.Label);
111114
}
112115

113-
private void RenderTypeHtml(IGqlpType type, IGqlpType[] extras)
116+
private void RenderTypeHtml(string section, IGqlpType type, IGqlpType[] extras)
114117
{
115118
Assert.SkipWhen(type is null, "type is null");
116119

@@ -122,13 +125,13 @@ private void RenderTypeHtml(IGqlpType type, IGqlpType[] extras)
122125
Declarations = [.. extras.Where(e => e != type)]
123126
};
124127

125-
RenderSchemaHtml(schema, type.Name, extrasSchema);
128+
RenderSchemaHtml(schema, type.Name, section, extrasSchema);
126129
}
127130

128-
private void RenderSchemaHtml(SchemaAst schema, string filename, SchemaAst? extras = null)
131+
private void RenderSchemaHtml(SchemaAst schema, string filename, string section = "", SchemaAst? extras = null)
129132
{
130133
Structured result = renderer.RenderAst(schema, renderer.Context(), extras);
131134

132-
result.WriteHtmlFile("BuiltIn", filename);
135+
result.WriteHtmlFile("BuiltIn" + section.Prefixed("/"), filename);
133136
}
134137
}

Diff for: test/GqlPlus.Modeller.ComponentTests/Models/index.liquid

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
{%- endfor %}
3636
</div>
3737
</article>
38-
{%- else -%}
38+
{%- endif -%}
3939
{%- for group in groups %}
4040
<article>
4141
<header>
@@ -50,7 +50,6 @@
5050
</div>
5151
</article>
5252
{%- endfor %}
53-
{%- endif -%}
5453
</main>
5554
</body>
5655
</html>

Diff for: test/GqlPlus.Modeller.ComponentTests/Sample/HtmlSchemaTests.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ public async Task Index_Samples()
1616
IEnumerable<string> objects = await ReplaceSchemaKeys("Objects");
1717
Structured result = new Map<Structured>() {
1818
["title"] = "Samples",
19+
["items"] = all.Render(),
1920
["groups"] = new Map<Structured>() {
20-
["All"] = all.Render(),
2121
["Globals"] = SamplesSchemaGlobalsData.Strings.Render(),
2222
["Merges"] = merges.Render(),
2323
["Objects"] = objects.Render(),

Diff for: update.ps1

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ $clean = -not (git status -s)
22
dotnet outdated .\ -vl minor -u
33
if ($clean) {
44
git commit -a -m "Update packages to latest patch version"
5-
dotnet outdated .\ -vl major -u
5+
dotnet outdated .\ -vl major -u -exc CodeAnalysis
66
} else {
7-
dotnet outdated .\ -vl major
7+
dotnet outdated .\ -vl major -exc CodeAnalysis
88
}
99

1010
dotnet tool update --all
1111

1212
dotnet list package --deprecated
1313
dotnet list package --vulnerable --include-transitive
14-
dotnet outdated .\
14+
dotnet outdated .\ -exc CodeAnalysis

0 commit comments

Comments
 (0)