Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TypeScript Parser Implementation #54

Merged
merged 25 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
bb0d294
Multi-targeting with .NET 8.
IEvangelist Oct 13, 2023
805cfef
Fix test path...
IEvangelist Oct 13, 2023
f240ad3
Gen AI triple slash...
IEvangelist Oct 13, 2023
b55a9c8
Fix the publish bits.
IEvangelist Oct 13, 2023
da91a52
Remove legacy switch
IEvangelist Oct 13, 2023
407d40e
Upgrade to .NET 8.0, and use Central Package Management.
IEvangelist Nov 17, 2023
3c8fc17
Fix merge issues.
IEvangelist Nov 17, 2023
b41b494
Upgrade a few versions...
IEvangelist Nov 17, 2023
8075e5a
Merge branch 'main' into 'new-parser'
Denny09310 Jul 2, 2024
e3e29ed
chore: remove globals.json
Denny09310 Jul 2, 2024
bdd211c
fix: merge issues
Denny09310 Jul 2, 2024
f11467c
feat: start using Typescript AST
Jul 12, 2024
c950ac0
chore: remove regex parsing for source, use new AST. For now use old …
Denny09310 Jul 15, 2024
7007138
chore: deep cleanup, apply sonar lint performance suggestions. Tests …
Denny09310 Jul 15, 2024
24cc118
fix: source generator not finding reference assembly
Denny09310 Jul 15, 2024
f5438d0
chore: code formatting
Denny09310 Jul 16, 2024
090bd49
feat: implmented AST into the parser and source writer
Denny09310 Jul 16, 2024
1d7e801
chore: updated some test to match the output
Denny09310 Jul 16, 2024
530e4b4
chore: split main into method, code readability
Denny09310 Jul 16, 2024
360ca0d
Merge branch 'feature/csharp-ast-parser' into develop
Denny09310 Jul 16, 2024
c91b1f6
fix: generic type not analyzed both for parses and builder, missing n…
Denny09310 Jul 16, 2024
e763e42
feat: remove all regexes
Denny09310 Jul 16, 2024
85b72e5
fix: url double encoded
Denny09310 Jul 16, 2024
bc34712
chore: split GetNodeText into function, add types examples of to handle
Denny09310 Jul 16, 2024
4b9cc7d
chore: create singleton for primitive mapping
Denny09310 Jul 16, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ file_header_template = Copyright (c) David Pine. All rights reserved.\nLicensed
indent_size = 4
tab_width = 4
trim_trailing_whitespace = true
end_of_line = lf

###############################
# .NET Coding Conventions #
Expand Down
1 change: 0 additions & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
10 changes: 5 additions & 5 deletions .github/workflows/build-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ jobs:
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Setup .NET 7.0
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Restore dependencies for ${{ matrix.project }}
run: |
Expand All @@ -59,10 +59,10 @@ jobs:
steps:
- uses: actions/checkout@main

- name: Setup .NET 7.0
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Run tests
run: |
Expand All @@ -74,7 +74,7 @@ jobs:

- name: Install Playwright dependencies
run: |
pwsh ./tests/Blazor.ExampleConsumer.EndToEndTests/bin/Release/net7.0/playwright.ps1 install --with-deps
pwsh ./tests/Blazor.ExampleConsumer.EndToEndTests/bin/Release/net8.0/playwright.ps1 install --with-deps

- name: Run end-to-end tests
run: |
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Test
run: dotnet test --filter "Category!=EndToEnd" --configuration Release

Expand All @@ -22,7 +22,7 @@ jobs:

- name: Install Playwright dependencies
run: |
pwsh ./tests/Blazor.ExampleConsumer.EndToEndTests/bin/Release/net7.0/playwright.ps1 install --with-deps
pwsh ./tests/Blazor.ExampleConsumer.EndToEndTests/bin/Release/net8.0/playwright.ps1 install --with-deps

- name: Run end-to-end tests
run: |
Expand Down Expand Up @@ -65,11 +65,11 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x

- name: Restore dependencies for ${{ matrix.project }}
run: |
dotnet restore ./src/${{ matrix.project }}/${{ matrix.project }}.csproj --configuration Release
dotnet restore ./src/${{ matrix.project }}/${{ matrix.project }}.csproj

- name: Build ${{ matrix.project }}
run: |
Expand Down
74 changes: 37 additions & 37 deletions .github/workflows/publish-to-gh-pages.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,47 @@
name: publish demo
on:
push:
branches: [ main ]
name: publish demo
on:
push:
branches: [ main ]
paths:
- 'samples/**'
- 'samples/**'
workflow_dispatch:
inputs:
reason:
description: 'The reason for running the workflow'
required: true
default: 'Manual run'
jobs:
deploy-to-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
default: 'Manual run'
jobs:
deploy-to-github-pages:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: 'Print manual run reason'
if: ${{ github.event_name == 'workflow_dispatch' }}
run: |
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Setup .NET Core SDK
uses: actions/setup-dotnet@main
with:
dotnet-version: 7.0.x
- name: Publish .NET Core Project
run: dotnet publish samples/Blazor.ExampleConsumer/Blazor.ExampleConsumer.csproj -c Release -o release --nologo
# Changes the base-tag in index.html from '/' to '/blazorators' to match GitHub Pages repository subdirectory
- name: Change base-tag in index.html from / to /blazorators
run: sed -i 's/<base href="\/" \/>/<base href="\/blazorators\/" \/>/g' release/wwwroot/index.html
# Copy index.html to 404.html to serve the same file when a file is not found
- name: copy index.html to 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html
# Add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project.
# Allow files and folders starting with an underscore
- name: Add .nojekyll file
run: touch release/wwwroot/.nojekyll
- name: Commit wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
echo 'Reason: ${{ github.event.inputs.reason }}'
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: 8.0.x
- name: Publish .NET Core Project
run: dotnet publish samples/Blazor.ExampleConsumer/Blazor.ExampleConsumer.csproj -c Release -o release --nologo

# Changes the base-tag in index.html from '/' to '/blazorators' to match GitHub Pages repository subdirectory
- name: Change base-tag in index.html from / to /blazorators
run: sed -i 's/<base href="\/" \/>/<base href="\/blazorators\/" \/>/g' release/wwwroot/index.html

# Copy index.html to 404.html to serve the same file when a file is not found
- name: copy index.html to 404.html
run: cp release/wwwroot/index.html release/wwwroot/404.html

# Add .nojekyll file to tell GitHub pages to not treat this as a Jekyll project.
# Allow files and folders starting with an underscore
- name: Add .nojekyll file
run: touch release/wwwroot/.nojekyll

- name: Commit wwwroot to GitHub Pages
uses: JamesIves/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages
FOLDER: release/wwwroot
3 changes: 2 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
</PropertyGroup>

<PropertyGroup>
<DefaultTargetFrameworks>net7.0</DefaultTargetFrameworks>
<DefaultTargetFrameworks>net7.0;net8.0</DefaultTargetFrameworks>
<LangVersion>preview</LangVersion>
</PropertyGroup>

<PropertyGroup>
Expand Down
38 changes: 38 additions & 0 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<Project>
<PropertyGroup>
<ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
</PropertyGroup>
<!-- Use these versions regardless of TFM -->
<ItemGroup>
<PackageVersion Include="Microsoft.SourceLink.GitHub" Version="8.0.0" />
<PackageVersion Include="MinVer" Version="5.0.0-beta.1" />
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.7.0" />
<PackageVersion Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" />
<PackageVersion Include="System.Reactive.Linq" Version="6.0.0" />
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.8.0" />
<PackageVersion Include="Microsoft.Playwright" Version="1.39.0" />
<PackageVersion Include="xunit" Version="2.6.1" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.5.3" />
<PackageVersion Include="coverlet.collector" Version="6.0.0" />
<PackageVersion Include="Basic.Reference.Assemblies" Version="1.4.5" />
<PackageVersion Include="Humanizer.Core" Version="2.14.1" />
</ItemGroup>
<!-- .NET 7.0 bits -->
<ItemGroup Condition="'$(TargetFramework)' == 'net7.0'">
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="7.0.14" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="7.0.0" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="7.0.0" />
<PackageVersion Include="Microsoft.JSInterop" Version="7.0.14" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.14" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.14" />
</ItemGroup>
<!-- .NET 8.0 bits -->
<ItemGroup Condition="'$(TargetFramework)' == 'net8.0'">
<PackageVersion Include="Microsoft.AspNetCore.Components.Web" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageVersion Include="Microsoft.Extensions.Primitives" Version="8.0.0" />
<PackageVersion Include="Microsoft.JSInterop" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageVersion Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" />
</ItemGroup>
</Project>
1 change: 0 additions & 1 deletion blazorators.sln
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
.editorconfig = .editorconfig
.gitignore = .gitignore
Directory.Build.props = Directory.Build.props
global.json = global.json
LICENSE = LICENSE
logo-large.png = logo-large.png
logo.png = logo.png
Expand Down
6 changes: 0 additions & 6 deletions global.json

This file was deleted.

36 changes: 18 additions & 18 deletions samples/Blazor.ExampleConsumer/Blazor.ExampleConsumer.csproj
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Humanizer.Core" Version="2.14.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.1" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Humanizer.Core" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\Blazor.Geolocation.WebAssembly\Blazor.Geolocation.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.LocalStorage.WebAssembly\Blazor.LocalStorage.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.Serialization\Blazor.Serialization.csproj" />
<ProjectReference Include="..\..\src\Blazor.SessionStorage.WebAssembly\Blazor.SessionStorage.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.SpeechRecognition.WebAssembly\Blazor.SpeechRecognition.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.SpeechSynthesis.WebAssembly\Blazor.SpeechSynthesis.WebAssembly.csproj" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\src\Blazor.Geolocation.WebAssembly\Blazor.Geolocation.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.LocalStorage.WebAssembly\Blazor.LocalStorage.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.Serialization\Blazor.Serialization.csproj" />
<ProjectReference Include="..\..\src\Blazor.SessionStorage.WebAssembly\Blazor.SessionStorage.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.SpeechRecognition.WebAssembly\Blazor.SpeechRecognition.WebAssembly.csproj" />
<ProjectReference Include="..\..\src\Blazor.SpeechSynthesis.WebAssembly\Blazor.SpeechSynthesis.WebAssembly.csproj" />
</ItemGroup>

</Project>
19 changes: 19 additions & 0 deletions samples/Blazor.ExampleConsumer/Components/Layout/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@using System.Runtime.InteropServices
@inherits LayoutComponentBase

<div class="page">
<div class="sidebar">
<NavMenu />
</div>

<main>
<div class="top-row px-4 text-muted">
Powered by @RuntimeInformation.FrameworkDescription
</div>

<article class="content px-4 col-xl-8">
@Body
</article>

</main>
</div>
Loading