Skip to content

Commit 21beae4

Browse files
committed
Updating from source commit 013de403673a15a7cccbb5f60add13845df1f77e on 2025-08-01T13:22:55-07:00
1 parent 4f6e15a commit 21beae4

File tree

11 files changed

+30
-21
lines changed

11 files changed

+30
-21
lines changed

Codex.xln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<!-- Allow all projects -->
44
<SolutionSaveLocation>$(MSBuildThisFileDirectory)\src\Codex.sln</SolutionSaveLocation>
55
<ProjectFilterLocal>$(ProjectFilter)</ProjectFilterLocal>
6-
<DisplayName>$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName($(MSBuildThisFileFullPath)))))</DisplayName>
6+
<SolutionDisplayName>$([System.IO.Path]::GetFileName($([System.IO.Path]::GetDirectoryName($(MSBuildThisFileFullPath)))))</SolutionDisplayName>
77
</PropertyGroup>
88

99
<ItemDefinitionGroup>

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,17 @@ http://ref12.github.io/Codex
2424

2525
3. Deploy the wasm binaries
2626

27-
` ./deploywasm.ps1 ` - deploys static site to `bin\wasm` folder by default
27+
` ./deploywasm.ps1 ` - deploys static site to `bin/web` folder by default
2828

2929
4. Build repo and generate binlog: ` ./build.ps1 `
3030

3131
5. Analyze repo and binlogs to produce analysis outputs: ` ./analyze.ps1 `
3232

33-
6. Create or update index ` ./ingest.ps1 `
33+
6. Create or update index ` ./ingest.ps1 -OutputDir bin/web/index`
3434

3535
7. Test locally using ` dotnet serve `
3636

37-
`dotnet serve --directory bin/wasm`
37+
`dotnet serve -p 58226 -S --directory bin/web`
3838

3939
## Features
4040
* Semantic analysis of C#, VB, and MSBuild

deploywasm.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ param(
77
[string[]]$RemainingArgs
88
)
99

10-
& "$CodexExeDir/Codex.exe" deployweb -s "$WasmPublishDir/wwwroot" -t "$OutputDir" -h pages -m wasm -i index @RemainingArgs
10+
& "$CodexExeDir/Codex.exe" deployweb -s "$WasmPublishDir/wwwroot" -t "$OutputDir" -h pages -m wasm -i "index" @RemainingArgs

src/Codex.Application/Verbs/DeployWebOperation.cs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,24 +117,33 @@ protected void CopyFile(string source, string? target = null, Func<string, strin
117117

118118
var targetFile = Path.Combine(TargetDirectory, target);
119119

120-
Logger.WriteLine($"Copying '{source}' to '{target}'...");
120+
Logger.WriteLine($"Copying '{source}' to '{targetFile}'...");
121121
if (transformText != null)
122122
{
123123
var text = SourceFs.FS.OpenFile(source).ReadAllText();
124124
text = transformText.Invoke(text);
125125
File.WriteAllText(targetFile, text);
126126
}
127+
else
128+
{
129+
using var sourceStream = SourceFs.FS.OpenFile(source);
130+
using var targetStream = File.OpenWrite(targetFile);
131+
sourceStream.CopyTo(targetStream, 1 << 16);
132+
}
127133

128-
Logger.WriteLine($"Copied '{source}' to '{target}'.");
134+
Logger.WriteLine($"Copied '{source}' to '{targetFile}'.");
129135

130136
if (generateCompressionVariants)
131137
{
132138
void compress(Func<Stream, Stream> getCompressionStream, string ext)
133139
{
140+
var cmpTargetFile = $"{targetFile}.{ext}";
134141
using var sourceStream = File.OpenRead(targetFile);
135-
using var targetStream = getCompressionStream(File.OpenWrite($"{targetFile}.{ext}"));
142+
using var targetStream = getCompressionStream(File.OpenWrite(cmpTargetFile));
136143

137144
sourceStream.CopyTo(targetStream, 1 << 16);
145+
146+
Logger.WriteLine($"Created compressed file: '{cmpTargetFile}'.");
138147
}
139148

140149
compress(s => new BrotliStream(s, CompressionLevel.Optimal), "br");

src/Codex.Integration.Tests/AnalyzeTestProjectBase.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,18 @@ public Task<IngestOperation> RunAnalyzeTestProject(bool searchOnly, bool cleanIn
8080
});
8181
}
8282

83+
protected virtual void PreconfigureOptions(AnalyzeTestProjectOptions options)
84+
{
85+
86+
}
87+
8388
public async Task<AnalyzeOperation> RunAnalyzeTestProjectAnalysis(
8489
Func<AnalyzeTestProjectOptions, AnalyzeTestProjectOptions> configureOptions = null,
8590
AsyncOut<AnalyzeTestProjectOptions> optionsOut = null,
8691
[CallerMemberName] string caller = null)
8792
{
8893
var options = new AnalyzeTestProjectOptions();
94+
PreconfigureOptions(options);
8995
options = configureOptions?.Invoke(options) ?? options;
9096
optionsOut?.Set(options);
9197

src/Codex.Integration.Tests/CodexTestBase.cs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,21 +180,16 @@ public CodexPage CreateCodexApp(string indexDirectory,
180180
var options = new CodexAppOptions();
181181
options = updateOptions?.Invoke(options) ?? options;
182182

183-
if (indexDirectory.StartsWith("https://"))
183+
if (PathUtilities.ToUriOrPath(indexDirectory, out var uri, out var path))
184184
{
185+
// For uri's we need to use paging logic
185186
options.UsePaging = true;
186187
options.ConfigurePaging = options.ConfigurePaging.ApplyBefore(pc => pc with
187188
{
188189
CacheLimit = 100_000,
189190
});
190191
}
191192

192-
if (PathUtilities.ToUriOrPath(indexDirectory, out var uri, out var path))
193-
{
194-
// For uri's we need to use paging logic
195-
options.UsePaging = true;
196-
}
197-
198193
ICodex getCodex()
199194
{
200195
{

src/Codex.Lucene/Paging/PagingHelpers.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ IHttpClient getClient(string directoryOrUrl, HttpClientKind kind)
154154

155155
private static Url GetAddress(Uri uri)
156156
{
157-
Url result = uri;
157+
Url result = uri.EnsureTrailingSlash();
158158
return result;
159159
}
160160

File renamed without changes.

src/Codex.Web.Wasm/wwwroot/home.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<div style="pointer-events: all; overflow: auto; height: 100%">
2-
<link rel="stylesheet" href="/styles.css" />
3-
<!--<link rel="stylesheet" href="./content/styles.css" />-->
2+
<link rel="stylesheet" href="content/home.html.css" />
43
<link href="content/dark.css" rel="stylesheet" media="(prefers-color-scheme: dark)" />
54

65
<div class="homeRoot">

src/Codex.Web.Wasm/wwwroot/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
3838

3939
<link rel="icon" href="content/images/icon16.png" type="image/png" />
40-
<link href="/css/bootstrap/bootstrap.min.css" rel="stylesheet" />
40+
<link href="css/bootstrap/bootstrap.min.css" rel="stylesheet" />
4141

42-
<link href="/css/app.css" rel="stylesheet" />
42+
<link href="css/app.css" rel="stylesheet" />
4343

4444
<link href="content/body.css" rel="stylesheet" />
4545
<link href="content/results.css" rel="stylesheet" />

0 commit comments

Comments
 (0)