Skip to content

Commit 561d62b

Browse files
authored
feat: update project configuration and tools to net10 (#143)
* feat: update project configuration and tools - Add global.json for SDK versioning - Update Directory.Build.props to include versioning - Modify Perla.fsproj to target net10.0 and add runtime identifiers - Refactor tools.fsx to correct project references and streamline NuGet packaging * chore: formatting * fix(ProxyService): handle multipart/form-data requests - Added check for multipart/form-data in Content-Type header. - Implemented handling of form fields and file uploads in multipart requests. - Updated content assignment based on request type. * chore(launch.json): update configurations - Changed preLaunchTask from "build" to "Build: Perla.fsproj" - Updated program path to use net10.0 instead of net9.0 - Modified cwd for "Perla serve" configuration * fix(ProxyService): improve header writing and add cancellation support - Ensure proper handling of exceptions during stream transfer. * fix(ProxyService): enhance header writing and support for chunked transfer - Added `writeHeaders` function to handle response headers. - Implemented `transferChunkedPipe` and `transferPlainPipe` for streaming responses. - Updated logic to check for chunked responses and handle them appropriately. - Improved header handling for various request types. * feat(Commands, Handlers, Program): Enable interactive mode - Renamed 'Install' command to 'Restore' for clarity. - Added aliases for commands to improve usability. - Introduced interactive mode for command execution. - Updated logging for command success and failure. * refactor(Interactive): simplify command execution logic * refactor(descriptions.json): update schema and improve descriptions - Replaced outdated keys and descriptions with updated schema versioning. - Enhanced clarity of configuration options for better understanding. - Deprecated several keys and added new ones for improved functionality. * chore: bump the dotnet version * feat: don't make the dotnet tool run self-contained
1 parent 6ac787e commit 561d62b

File tree

23 files changed

+521
-253
lines changed

23 files changed

+521
-253
lines changed

.vscode/launch.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@
1313
"name": "Perla serve",
1414
"type": "coreclr",
1515
"request": "launch",
16-
"preLaunchTask": "build",
17-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
16+
"preLaunchTask": "Build: Perla.fsproj",
17+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
1818
"args": ["serve"],
1919
"cwd": "${workspaceFolder}/docs",
2020
"stopAtEntry": false,
@@ -24,8 +24,8 @@
2424
"name": "Perla install",
2525
"type": "coreclr",
2626
"request": "launch",
27-
"preLaunchTask": "build",
28-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
27+
"preLaunchTask": "Build: Perla.fsproj",
28+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
2929
"args": ["install"],
3030
"cwd": "${workspaceFolder}/sample",
3131
"stopAtEntry": false,
@@ -35,19 +35,19 @@
3535
"name": "Perla build",
3636
"type": "coreclr",
3737
"request": "launch",
38-
"preLaunchTask": "build",
39-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
38+
"preLaunchTask": "Build: Perla.fsproj",
39+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
4040
"args": ["build"],
41-
"cwd": "${workspaceFolder}/docs",
41+
"cwd": "${workspaceFolder}/sample",
4242
"stopAtEntry": false,
4343
"console": "integratedTerminal"
4444
},
4545
{
4646
"name": "Perla new",
4747
"type": "coreclr",
4848
"request": "launch",
49-
"preLaunchTask": "build",
50-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
49+
"preLaunchTask": "Build: Perla.fsproj",
50+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
5151
"args": ["new", "samplixor"],
5252
"cwd": "${workspaceFolder}/../",
5353
"stopAtEntry": false,
@@ -57,8 +57,8 @@
5757
"name": "Perla test",
5858
"type": "coreclr",
5959
"request": "launch",
60-
"preLaunchTask": "build",
61-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
60+
"preLaunchTask": "Build: Perla.fsproj",
61+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
6262
"args": ["test"],
6363
"cwd": "${workspaceFolder}/sample",
6464
"stopAtEntry": false,
@@ -68,8 +68,8 @@
6868
"name": "Perla test watch headless false",
6969
"type": "coreclr",
7070
"request": "launch",
71-
"preLaunchTask": "build",
72-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
71+
"preLaunchTask": "Build: Perla.fsproj",
72+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
7373
"args": ["test", "--headless", "false", "-w"],
7474
"cwd": "${workspaceFolder}/sample",
7575
"stopAtEntry": false,
@@ -79,8 +79,8 @@
7979
"name": "Perla serve docs",
8080
"type": "coreclr",
8181
"request": "launch",
82-
"preLaunchTask": "build",
83-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
82+
"preLaunchTask": "Build: Perla.fsproj",
83+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
8484
"args": ["serve"],
8585
"cwd": "${workspaceFolder}/docs",
8686
"stopAtEntry": false,
@@ -90,8 +90,8 @@
9090
"name": "Perla add @shoelace-style/shoelace",
9191
"type": "coreclr",
9292
"request": "launch",
93-
"preLaunchTask": "build",
94-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
93+
"preLaunchTask": "Build: Perla.fsproj",
94+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
9595
"args": ["add", "@shoelace-style/shoelace"],
9696
"cwd": "${workspaceFolder}/docs",
9797
"stopAtEntry": false,
@@ -101,8 +101,8 @@
101101
"name": "Build Docs",
102102
"type": "coreclr",
103103
"request": "launch",
104-
"preLaunchTask": "build",
105-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
104+
"preLaunchTask": "Build: Perla.fsproj",
105+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
106106
"args": ["build"],
107107
"cwd": "${workspaceFolder}/docs",
108108
"stopAtEntry": false,
@@ -112,8 +112,8 @@
112112
"name": "Describe ",
113113
"type": "coreclr",
114114
"request": "launch",
115-
"preLaunchTask": "build",
116-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
115+
"preLaunchTask": "Build: Perla.fsproj",
116+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
117117
"args": [
118118
"describe",
119119
"fable",
@@ -132,8 +132,8 @@
132132
"name": "Describe Current",
133133
"type": "coreclr",
134134
"request": "launch",
135-
"preLaunchTask": "build",
136-
"program": "${workspaceFolder}/src/Perla/bin/Debug/net9.0/Perla.dll",
135+
"preLaunchTask": "Build: Perla.fsproj",
136+
"program": "${workspaceFolder}/src/Perla/bin/Debug/net10.0/Perla.dll",
137137
"args": ["describe", "--current"],
138138
"cwd": "${workspaceFolder}/sample",
139139
"stopAtEntry": false,

docs/assets/content/migrate.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,9 +308,9 @@ Options:
308308

309309
Commands:
310310
create, generate, n, new <name> Creates a new project based on the selected template if it exists
311-
install Installs the project dependencies from the perla.json file
312-
add <packages> Adds a package to the project dependencies
313-
remove <packages> Removes a package from the project dependencies
311+
r, restore Restores the project dependencies from the perla.json file
312+
a, add, i, install <packages> Adds a package to the project dependencies
313+
remove, rm <packages> Removes a package from the project dependencies
314314
list, ls Lists the current dependencies in a table or an npm style json string
315315
s, serve, start Starts the development server and if fable projects are present it also takes
316316
care of it.

docs/assets/docs/v1/features/fable.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ Your HTML file should look along these lines
138138

139139
5. Install your dependencies. Example:
140140

141-
- `dotnet perla add react react-dom react-dom/client`
141+
- `perla add react react-dom react-dom/client`
142142

143143
To identify which dependencies are the ones you actually need, they are usually in the `dependencies` object inside your `package.json`
144144

docs/assets/docs/v1/features/package-manager.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,12 @@ When removing a package, Perla will:
112112

113113
Note that when using `useLocalPkgs: true`, Perla will regenerate the import map with the remaining packages to ensure consistency between your `perla.json` and the local `node_modules` directory.
114114

115-
## Install Packages
115+
## Restore Packages
116116

117-
To install or reinstall all dependencies listed in your `perla.json` file, run:
117+
To restore or reinstall all dependencies listed in your `perla.json` file, run:
118118

119119
```bash
120-
perla install
120+
perla restore
121121
```
122122

123123
This command will:
@@ -126,18 +126,18 @@ This command will:
126126
2. Generate an import map for all dependencies
127127
3. If `useLocalPkgs` is `true`, download all package files and create a local `node_modules` structure
128128

129-
### Installation Options
129+
### Restore Options
130130

131-
You can modify the installation behavior with these flags however, to make them permanent you have to update the perla.json configuration file:
131+
You can modify the restore behavior with these flags however, to make them permanent you have to update the perla.json configuration file:
132132

133133
```bash
134-
# Change the provider for this installation
135-
perla install --source jspm # Use JSPM (default)
136-
perla install --source unpkg # Use Unpkg
137-
perla install --source jsdelivr # Use JsDelivr
134+
# Change the provider for this restore
135+
perla restore --source jspm # Use JSPM (default)
136+
perla restore --source unpkg # Use Unpkg
137+
perla restore --source jsdelivr # Use JsDelivr
138138

139139
# Control offline mode
140-
perla install --offline # Enable local packages mode
140+
perla restore --offline # Enable local packages mode
141141
```
142142

143143
These options can also be configured in your `perla.json` file:

docs/assets/docs/v1/reference/cli.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,11 @@ Removes a package from the project dependencies.
4747

4848
- `packages`: One or more package names to remove (required)
4949

50-
### Install - `perla install`
50+
### Restore - `perla restore`
5151

52-
Installs the project dependencies from the perla.json file.
52+
Restores the project dependencies from the perla.json file.
5353

54-
- `-o`, `--offline`: Install packages without network access
54+
- `-o`, `--offline`: Restore packages without network access
5555
- `-s`, `--source <provider>`: The source to download packages from (jspm.io, unpkg, jsdelivr)
5656

5757
### List - `perla list`

docs/perla.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
"$schema": "../perla.schema.json",
33
"schema-version": "2025-07",
44
"provider": "jspm",
5-
"plugins": ["perla-esbuild-plugin", "markdown-plugin"],
5+
"plugins": [
6+
"perla-esbuild-plugin",
7+
"markdown-plugin"
8+
],
69
"useLocalPkgs": true,
710
"mountDirectories": {
811
"/": "./sw",
@@ -14,7 +17,10 @@
1417
"jsxImportSource": "preact"
1518
},
1619
"build": {
17-
"includes": ["lfs:**/src/*.ico", "vfs:**/assets/**/*.html"]
20+
"includes": [
21+
"lfs:**/src/*.ico",
22+
"vfs:**/assets/**/*.html"
23+
]
1824
},
1925
"dependencies": {
2026
"@ctrl/tinycolor": "4.1.0",
@@ -48,4 +54,4 @@
4854
"preact/jsx-runtime": "10.26.9",
4955
"qr-creator": "1.0.0"
5056
}
51-
}
57+
}

docs/perla.json.importmap

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"imports": {
3-
"@ctrl/tinycolor": "/node_modules/@ctrl/tinycolor/dist/public_api.js",
3+
"@ctrl/tinycolor": "/node_modules/@ctrl/tinycolor/dist/module/public_api.js",
44
"@floating-ui/core": "/node_modules/@floating-ui/core/dist/floating-ui.core.mjs",
55
"@floating-ui/dom": "/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs",
66
"@floating-ui/utils": "/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs",

global.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"sdk": {
3+
"version": "10.0.100-preview.7.25380.108",
4+
"allowPrerelease": true,
5+
"rollForward": "latestFeature"
6+
}
7+
}

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
<WarnOn>3390;$(WarnOn)</WarnOn>
1414
<Nullable>enable</Nullable>
1515
<LangVersion>preview</LangVersion>
16+
<Version>1.0.0-rc-001</Version>
1617
</PropertyGroup>
1718
<ItemGroup>
1819
<None Include="$(MSBuildThisFileDirectory)\..\LICENSE" Pack="true" PackagePath="\"/>

src/Perla.Logger/Library.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ type SpectreSink() =
285285

286286
try
287287
AnsiConsole.MarkupLine
288-
$"[[[grey]{timestamp}[/] [{levelColor}]{levelString}[/] {prefix}]] {message}"
288+
$"[[[grey]{timestamp}[/] [{levelColor}]{levelString}[/] {prefix}]] {message.EscapeMarkup()}"
289289
with :? InvalidOperationException ->
290290
()
291291

0 commit comments

Comments
 (0)