Skip to content

Commit

Permalink
Solution wide restructure
Browse files Browse the repository at this point in the history
When I started this project I had alot of ideas and tried different approaches structuring the app. I hadn't fully determined how the pieces will fit together yet. But I knew I wanted to work towards these minimum requirements:

1. Must support Windows, macOS and Linux
2. Must support at least .NET 6 or higher
3. Must run with as little hassle as possible for end users.

I opted to split the solution into many smaller projects to help paint a map of the different components I'll need and nudge me to think deliberately about the dependency graph. I think it has served its purpose at this point. This restructure aimed to:

1. Make the solution easier to maintain by reducing separation between components and bringing more related functionality together.
2. Make the solution easier to review by the community and easier to understand and contribute to

I plan to add documentation soon explaining the high level concepts and structure of the solution to help facilitate review and contribution.

Some notable technical changes:

- Reduced number of projects. Most of the core functionality of NetPad is now in a new NetPad.Runtime project
- The concept of a "ScriptRuntime" is now called a "ScriptRunner" and is part of the "Execution Model"
- No refactoring was done to the JS app
- Fix web version 'process' pollyfill
- Use Directory.Build.props file and convert to use primary
- Passing --swagger flag to NetPad.Apps.App generates Swagger client code

Refactoring that is also planned soon:
  - Refactoring of the JS app
  - Changing the name of the NetPad.Apps.App project and the folder containing the JS client app, currently named "App"
  • Loading branch information
tareqimbasher committed Jun 28, 2024
1 parent 23f6b3c commit d9096a9
Show file tree
Hide file tree
Showing 571 changed files with 5,045 additions and 6,822 deletions.
1 change: 0 additions & 1 deletion src/.editorconfig → .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ trim_trailing_whitespace = false

[*.{razor,cshtml}]
charset = utf-8-bom

9 changes: 4 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ BenchmarkDotNet.Artifacts/
project.lock.json
project.fragment.lock.json
artifacts/
**/Properties/launchSettings.json

# optional local settings
appsettings.Local.json
Expand Down Expand Up @@ -225,7 +224,7 @@ ClientBin/
*.publishsettings
orleans.codegen.cs

# Including strong name files can present a security risk
# Including strong name files can present a security risk
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
#*.snk

Expand Down Expand Up @@ -321,7 +320,7 @@ __pycache__/
# OpenCover UI analysis results
OpenCover/

# Azure Stream Analytics local run output
# Azure Stream Analytics local run output
ASALocalRun/

# MSBuild Binary and Structured Log
Expand All @@ -330,7 +329,7 @@ ASALocalRun/
# NVidia Nsight GPU debugger configuration file
*.nvuser

# MFractors (Xamarin productivity tool) working folder
# MFractors (Xamarin productivity tool) working folder
.mfractor/

*.DS_Store
Expand All @@ -348,4 +347,4 @@ src/Apps/Web/Blink.Apps.WebApp/global.json
NuGetScratch/
VBCSCompiler/
.dotnet/
dist/
dist/
13 changes: 13 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<Project>
<PropertyGroup>
<DefaultTargetFramework>net6.0</DefaultTargetFramework>
<EarliestSupportedTargetFramework>net6.0</EarliestSupportedTargetFramework>
<LangVersion>latest</LangVersion>
<Deterministic>True</Deterministic>
<Nullable>Enable</Nullable>
<TreatWarningsAsErrors>True</TreatWarningsAsErrors>
<PackageProjectUrl>https://github.com/tareqimbasher/netpad</PackageProjectUrl>
<RepositoryUrl>https://github.com/tareqimbasher/netpad</RepositoryUrl>
<Authors>Tareq Imbasher</Authors>
</PropertyGroup>
</Project>
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"version": "8.0.0",
"rollForward": "latestMinor"
}
}
13 changes: 8 additions & 5 deletions src/Apps/NetPad.Apps.App/App/src/core/@common/utils/system.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as process from "process";

export class System {
/**
* Opens a URL in system-configured default browser.
Expand All @@ -15,9 +13,14 @@ export class System {
}

public static getPlatform() {
try {
return process.platform;
} catch {
if (this.isRunningInElectron()) {
try {
// eslint-disable-next-line @typescript-eslint/no-var-requires
return require("process").platform;
} catch {
return undefined;
}
} else {
return undefined;
}
}
Expand Down
Loading

0 comments on commit d9096a9

Please sign in to comment.