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

Improvements to the library #55

Merged
merged 193 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
193 commits
Select commit Hold shift + click to select a range
977dd60
Server project.
SebastianStehle Oct 1, 2023
c7ccc46
Cache documents.
SebastianStehle Oct 1, 2023
6a1ef6b
Just some progress.
SebastianStehle Oct 1, 2023
c939fe8
Some improvements.
SebastianStehle Oct 1, 2023
6504795
Test
SebastianStehle Oct 2, 2023
1afecfd
Service extensions.
SebastianStehle Oct 2, 2023
db32c18
Rename file.
SebastianStehle Oct 2, 2023
24906be
Temp.
SebastianStehle Oct 2, 2023
7f937d2
Deadlock test
SebastianStehle Oct 2, 2023
381990b
Styling.
SebastianStehle Oct 2, 2023
b6c37fc
Fix deadlock and implement listener.
SebastianStehle Oct 2, 2023
5f5ebf1
Batching.
SebastianStehle Oct 3, 2023
91ef442
Simplified code.
SebastianStehle Oct 3, 2023
cf7f48b
Add support for MongoDB.
SebastianStehle Oct 3, 2023
c17df4c
Fix project name.
SebastianStehle Oct 3, 2023
c1be45a
Extension project.
SebastianStehle Oct 3, 2023
94d1af8
Setup to test more providers and authentication.
SebastianStehle Oct 3, 2023
6ae4978
Several fixed and simplifications.
SebastianStehle Oct 3, 2023
18c6b9b
Fixes
SebastianStehle Oct 4, 2023
59e8c88
Fix To method.
SebastianStehle Oct 4, 2023
f5b5182
Small fixes.
SebastianStehle Oct 4, 2023
722f509
Fix sync.
SebastianStehle Oct 5, 2023
afc9498
Test
SebastianStehle Oct 6, 2023
5f0d3ec
Remove patch.
SebastianStehle Oct 6, 2023
4211db9
Build props.
SebastianStehle Oct 6, 2023
7c19046
Checkout everything.
SebastianStehle Oct 6, 2023
ed64a0e
Upload nuget packages.
SebastianStehle Oct 6, 2023
d49fb9e
Fix pack?
SebastianStehle Oct 6, 2023
a87701b
Another test
SebastianStehle Oct 6, 2023
aa105d4
Fix path
SebastianStehle Oct 6, 2023
c31c1d5
Try to run tests
SebastianStehle Oct 6, 2023
01205eb
Fix yaml
SebastianStehle Oct 6, 2023
9288cde
Fix path
SebastianStehle Oct 6, 2023
9edbcb1
Cp
SebastianStehle Oct 6, 2023
393d462
Fix library name.
SebastianStehle Oct 6, 2023
82254cc
Print out files.
SebastianStehle Oct 6, 2023
2a3e772
Another test
SebastianStehle Oct 6, 2023
ebf8770
Test linux.
SebastianStehle Oct 6, 2023
bc5b219
Test build.
SebastianStehle Oct 6, 2023
f8605bf
Do not fail fast.
SebastianStehle Oct 6, 2023
1434f26
Do not run arm tests.
SebastianStehle Oct 6, 2023
41e275c
Set environment variable.
SebastianStehle Oct 6, 2023
1575ee3
better result types.
SebastianStehle Oct 6, 2023
73889c6
Fix build.
SebastianStehle Oct 6, 2023
c46271f
Fix check.
SebastianStehle Oct 6, 2023
b6be727
Fix tests
SebastianStehle Oct 6, 2023
82c54c7
More test fixes.
SebastianStehle Oct 6, 2023
8b4577d
Array tests
SebastianStehle Oct 6, 2023
b4a3ae8
Check some offset thing.
SebastianStehle Oct 6, 2023
02b2848
Fix tests.
SebastianStehle Oct 6, 2023
9319f53
Revert struct.
SebastianStehle Oct 6, 2023
24cb3ef
Check tests
SebastianStehle Oct 7, 2023
a650a5f
simple run
SebastianStehle Oct 7, 2023
7ecd927
File was not saved.
SebastianStehle Oct 7, 2023
2b85333
t
SebastianStehle Oct 7, 2023
dab981d
Test
SebastianStehle Oct 7, 2023
7b23e7f
Run tests again.
SebastianStehle Oct 7, 2023
019d9c6
Test
SebastianStehle Oct 7, 2023
d9ec714
Test field offset.
SebastianStehle Oct 7, 2023
8567f28
Remove protocol
SebastianStehle Oct 1, 2023
6034663
Fix workflow.
SebastianStehle Oct 7, 2023
1ad9611
Test.
SebastianStehle Oct 7, 2023
f414080
Test struct.
SebastianStehle Oct 7, 2023
c1fd782
Read pointers manually.
SebastianStehle Oct 7, 2023
d02a9fa
Test pointers.
SebastianStehle Oct 7, 2023
af57e79
Fix
SebastianStehle Oct 7, 2023
f2f0eda
Use pointer again.
SebastianStehle Oct 7, 2023
e8f36a3
Test field offset.
SebastianStehle Oct 7, 2023
df4eb1d
Test.
SebastianStehle Oct 7, 2023
20661f5
Test struct.
SebastianStehle Oct 7, 2023
b0e9b4c
Read pointers manually.
SebastianStehle Oct 7, 2023
4c60206
Test pointers.
SebastianStehle Oct 7, 2023
1eb16c5
Fix
SebastianStehle Oct 7, 2023
45e373a
Use pointer again.
SebastianStehle Oct 7, 2023
bd8f98b
Remove console out
SebastianStehle Oct 7, 2023
31ebcb9
Make struct internal.
SebastianStehle Oct 7, 2023
b8284f2
Improve output.
SebastianStehle Oct 8, 2023
7a7ba2e
Fix warnings.
SebastianStehle Oct 8, 2023
4e49be5
Fix output.
SebastianStehle Oct 8, 2023
d49784b
Fix output.
SebastianStehle Oct 8, 2023
9c82b52
Simplify clustering.
SebastianStehle Oct 8, 2023
5842048
Remove test project.
SebastianStehle Oct 8, 2023
013271c
Push test to nuget.
SebastianStehle Oct 10, 2023
973d981
Fix package id.
SebastianStehle Oct 10, 2023
fd2e207
Test
SebastianStehle Oct 10, 2023
6bf613a
A lot of stuff.
SebastianStehle Oct 11, 2023
81077e0
Xml comment fixes.
SebastianStehle Oct 11, 2023
043a87a
Tests
SebastianStehle Oct 12, 2023
743b120
Add doc everywhere.
SebastianStehle Oct 12, 2023
f49127f
Improve stuff.
SebastianStehle Oct 12, 2023
af9ad36
Refactoring.
SebastianStehle Oct 12, 2023
2160032
Just some stuff.
SebastianStehle Oct 13, 2023
c2dc276
Fix dispose.
SebastianStehle Oct 13, 2023
71e86e9
Several small fixes.
SebastianStehle Oct 13, 2023
b6df02b
Fix dispose.
SebastianStehle Oct 14, 2023
98ad237
More tests.
SebastianStehle Oct 14, 2023
ab4c99e
Merge branch 'improve-output' into server
SebastianStehle Oct 14, 2023
b08ff29
Merge branch 'main' of github.com:SebastianStehle/ydotnet into server
SebastianStehle Oct 14, 2023
d474147
Ignore buggy tests.
SebastianStehle Oct 14, 2023
ad4ac80
Fix sample.
SebastianStehle Oct 14, 2023
0a81e15
Increase version.
SebastianStehle Oct 14, 2023
b17bda5
Merge pull request #1 from SebastianStehle/server
SebastianStehle Oct 14, 2023
9d0db00
Another version update.
SebastianStehle Oct 14, 2023
2d3e0a1
Fix build
SebastianStehle Oct 14, 2023
991dd6e
Fixes.
SebastianStehle Oct 15, 2023
e5c2f93
Event manager
SebastianStehle Oct 15, 2023
0227eae
Unsubscribe on explicit dispose only.
SebastianStehle Oct 15, 2023
fcaf0e3
Guard for open transactions.
SebastianStehle Oct 15, 2023
02604ef
Improve ToJson.
SebastianStehle Oct 16, 2023
a1dac8b
Fix tests
SebastianStehle Oct 16, 2023
2915eee
Prepare for PR.
SebastianStehle Oct 16, 2023
dc41423
Merge branch 'main' of github.com:LSViana/ydotnet into for-pr
SebastianStehle Oct 16, 2023
5aa115c
Add factory.
SebastianStehle Oct 16, 2023
be1ddd1
make input factory public.
SebastianStehle Oct 16, 2023
d7bbc0c
Fix awareness.
SebastianStehle Oct 16, 2023
3180381
Fix client ID.
SebastianStehle Oct 16, 2023
e02978d
docs(improvements): rename decision.md
LSViana Oct 16, 2023
69172e3
docs(improvements): improve the decision log about documentation
LSViana Oct 16, 2023
86232eb
docs(improvements): improve the formatting and items in the decision …
LSViana Oct 17, 2023
6f7f579
ci(improvements): simplify the `build` (now `test` workflow)
LSViana Oct 17, 2023
da810c4
ci(improvements): introduce the `publish` workflow
LSViana Oct 17, 2023
a4eb8dd
ci(improvements): simplify the `build-binaries` workflow
LSViana Oct 17, 2023
99d44fd
ci(improvements): fix the `publish` job definition
LSViana Oct 17, 2023
9b18064
fix(improvements): add dynamic library files to the list of files cop…
LSViana Oct 17, 2023
c57aa7e
ci(improvements): fix the `publish` job definition
LSViana Oct 17, 2023
d01b247
Remove clustering for now
SebastianStehle Oct 17, 2023
d486009
Merge branch 'for-pr' of github.com:SebastianStehle/ydotnet into for-pr
SebastianStehle Oct 17, 2023
1821215
ci(improvements): make the `publish` workflow run for version tags
LSViana Oct 20, 2023
03bb432
docs(improvements): fix typo, format, and improve documentation for t…
LSViana Oct 20, 2023
877427b
refactor(improvements): rename `DisposableHandles` and the head handl…
LSViana Oct 21, 2023
b97a0e6
refactor(improvements): fix typos and adapt `Input` to the new API of…
LSViana Oct 21, 2023
2f00203
style(improvements): format and remove unnecessary disabled rules fro…
LSViana Oct 21, 2023
8ea4792
style(improvements): format `JsonArray`
LSViana Oct 21, 2023
efe2d73
style(improvements): format `JsonObject` and turn `MapEntryNative.Key…
LSViana Oct 21, 2023
3249f6f
style(improvements): format and scope `pragma` to `Output.Boolean` pr…
LSViana Oct 21, 2023
95d2828
refactor(improvements): format, move, and simplify `ThrowHelper`
LSViana Oct 21, 2023
fd62ae0
refactor(improvements): rename `ThrowHelper.InternalError()` to `Null…
LSViana Oct 21, 2023
e47776d
refactor(improvements): rename and move `Extensions` class to `IntPtr…
LSViana Oct 21, 2023
ca7eb15
refactor(improvements): drop unused `enum OutputType`
LSViana Oct 21, 2023
b66afb3
refactor(improvements): drop `ThrowHelper.YDotNetException()` since i…
LSViana Oct 21, 2023
60d71a8
refactor(improvements): format and update `Transaction`
LSViana Oct 21, 2023
4ffae97
refactor(improvements): format and update `TypeCache`
LSViana Oct 21, 2023
93faab7
refactor(improvements): format, simplify, and update `Output`
LSViana Oct 21, 2023
2df883f
refactor(improvements): update `using` statements of `MemoryReader`
LSViana Oct 21, 2023
cb6159b
refactor(improvements): format and remove unused values from `enum Ou…
LSViana Oct 21, 2023
f64f1ef
refactor(improvements): remove unnecessary `continue` statement from …
LSViana Oct 22, 2023
f687af6
refactor(improvements): fix typos and format `EventSubscriber`
LSViana Oct 22, 2023
b081e75
refactor(improvements): format `Doc` and `SubDocsEvent`
LSViana Oct 22, 2023
9d02309
refactor(improvements): add missing references to use `Checked()` ext…
LSViana Oct 22, 2023
46e4d04
refactor(improvements): move initializers of `DocOptions` to the defa…
LSViana Oct 22, 2023
78027d0
refactor(improvements): fix warnings on `*Enumerator` classes
LSViana Oct 22, 2023
bf942cb
refactor(improvements): fix warnings on `*Iterator` classes
LSViana Oct 22, 2023
feb56f5
refactor(improvements): fix warnings and rename `CreateValue` in the …
LSViana Oct 22, 2023
1f88eb9
refactor(improvements): format the `Branch` class
LSViana Oct 22, 2023
8045292
refactor(improvements): fix warnings on `XmlTreeWalker` class
LSViana Oct 22, 2023
07d219e
refactor(improvements): fix warnings on `UndoManager` class
LSViana Oct 22, 2023
480b3e4
refactor(improvements): fix warnings on `Doc` class
LSViana Oct 22, 2023
9c6c1a1
refactor(improvements): rename `ClientId` to `ClientIdGenerator` sinc…
LSViana Oct 22, 2023
a77b22b
refactor(improvements): fix warnings on `TypeCache` class
LSViana Oct 22, 2023
84c163c
refactor(improvements): restore `.editorconfig` for the `Native` name…
LSViana Oct 22, 2023
0170b57
refactor(improvements): enable suggestion for some documentation rule…
LSViana Oct 22, 2023
712d954
refactor(improvements): fix typos, format files, and smaller fixes th…
LSViana Oct 22, 2023
e24ed7f
Merge branch 'main' into for-pr
LSViana Oct 22, 2023
63ab9e4
Added new method.
SebastianStehle Oct 22, 2023
92b2e19
Build on older linux version.
SebastianStehle Oct 23, 2023
53636d9
Update version.
SebastianStehle Oct 23, 2023
79bd53e
refactor(improvements): move `ITypeBase` interface to its own file
LSViana Oct 29, 2023
51b9a40
refactor(improvements): make `TypeBase` extend from `UnmanagedResource`
LSViana Oct 29, 2023
dff9f3f
refactor(improvements): remove the `TypeBase` and `ITypeBase` types
LSViana Oct 29, 2023
f6961ad
refactor(improvements): add `Resource.MarkDisposed()` to allow settin…
LSViana Oct 29, 2023
055eece
refactor(improvements): adapt `UnmanagedResource` to call `Resource` …
LSViana Oct 29, 2023
08eb334
refactor(improvements): adapt `TypeCache` to work with `UnmanagedReso…
LSViana Oct 29, 2023
0335241
refactor(improvements): extend from `UnmanagedResource` in `Doc` and …
LSViana Oct 29, 2023
1cc8db7
refactor(improvements): add `TODO` comment in `Doc.NotifyTransactionS…
LSViana Oct 29, 2023
d55104b
refactor(improvements): adapt classes that implement `Resource` and `…
LSViana Oct 29, 2023
95e7cd0
refactor(improvements): remove unused method `TypeCache.Delete()`
LSViana Oct 29, 2023
4a621fd
docs(improvements): fix typo in `decisions.md`
LSViana Oct 29, 2023
1aae9e8
docs(improvements): include examples to make it clearer when to use p…
LSViana Oct 29, 2023
443209c
ci(improvements): fix tag pattern to trigger `publish.yml`
LSViana Oct 29, 2023
d830096
test(improvements): rename the `ClientIdTests` to `ClientIdGeneratorT…
LSViana Oct 29, 2023
274831c
Fixes to the server project.
SebastianStehle Oct 30, 2023
b631b39
Fix warnings in my code.
SebastianStehle Oct 30, 2023
7880e05
feat(improvements): fix the `Output.BuildValue()` method to handle `N…
LSViana Oct 31, 2023
e8e5da5
feat(improvements): add the `Output.Undefined` and `Output.Null` prop…
LSViana Oct 31, 2023
50929b1
test(improvements): update the `Output.Get()` tests to check the `Out…
LSViana Oct 31, 2023
90d91e0
test(improvements): fix the `Transaction.StateDiffV1()` tests
LSViana Oct 31, 2023
e7e2c77
fix(improvements): update `Transaction.StateDiffV2()` to support null…
LSViana Oct 31, 2023
3494b2e
refactor(improvements): make the `stateVector` parameter optional for…
LSViana Oct 31, 2023
02549b0
test(improvements): fix the `Transaction.StateDiffV2()` tests
LSViana Oct 31, 2023
48d7258
fix(improvements): fix the `MapEvent` class to read `Path` from the c…
LSViana Oct 31, 2023
45f3eab
fix(improvements): fix the type of the `TextChunkNative.Data` property
LSViana Oct 31, 2023
2366e0f
fix(improvements): fix the reading of the `Output` cell in `TextChunk`
LSViana Oct 31, 2023
0dbb59c
test(improvements): fix tests for `Redo` and `Undo` in the `UndoManag…
LSViana Oct 31, 2023
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
11 changes: 9 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ tab_width = 4
end_of_line = lf
insert_final_newline = true

# C# preferences
csharp_style_namespace_declarations = file_scoped

# StyleCop rules (https://dotnetanalyzers.github.io/StyleCopAnalyzers/)

# Special rules
Expand All @@ -23,7 +26,7 @@ dotnet_diagnostic.SA1008.severity = suggestion # Opening parenthesis should be s
dotnet_diagnostic.SA1009.severity = suggestion # Closing parenthesis should be spaced correctly

# Readability rules
dotnet_diagnostic.SA1101.severity = suggestion # Prefix local calls with this
dotnet_diagnostic.SA1101.severity = none # Prefix local calls with this

# Ordering rules
dotnet_diagnostic.SA1200.severity = suggestion # Using directives should be placed correctly
Expand All @@ -37,4 +40,8 @@ dotnet_diagnostic.SA1413.severity = suggestion # Use trailing comma in multi-lin
dotnet_diagnostic.SA1500.severity = suggestion # Braces for multi-line statements should not share line

# Documentation rules
dotnet_diagnostic.SA1633.severity = suggestion # File should have header
dotnet_diagnostic.SA1600.severity = suggestion # Elements should be documented
dotnet_diagnostic.SA1601.severity = suggestion # Partial elements should be documented
dotnet_diagnostic.SA1602.severity = suggestion # Enumeration items should be documented
dotnet_diagnostic.SA1633.severity = none # File should have header

12 changes: 6 additions & 6 deletions .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,40 @@ jobs:

# Linux
- build: linux-x64
os: ubuntu-latest
os: ubuntu-20.04
rust: stable
target: x86_64-unknown-linux-gnu
cross: false

- build: linux-x64-musl
os: ubuntu-latest
os: ubuntu-20.04
rust: stable
target: x86_64-unknown-linux-musl
cross: false

- build: linux-armv7
os: ubuntu-latest
os: ubuntu-20.04
rust: stable
target: armv7-unknown-linux-gnueabihf
linker: gcc-arm-linux-gnueabihf
cross: true

- build: linux-armv7-musl
os: ubuntu-latest
os: ubuntu-20.04
rust: stable
target: armv7-unknown-linux-musleabihf
linker: gcc-arm-linux-gnueabihf
cross: true

- build: linux-arm64
os: ubuntu-latest
os: ubuntu-20.04
rust: stable
target: aarch64-unknown-linux-gnu
linker: gcc-aarch64-linux-gnu
cross: true

- build: linux-arm64-musl
os: ubuntu-latest
os: ubuntu-20.04
rust: stable
target: aarch64-unknown-linux-musl
linker: gcc-aarch64-linux-gnu
Expand Down
38 changes: 38 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish

on:
push:
branches:
- 'main'
- 'for-pr'
tags:
- 'v*.*.*'

jobs:
pack-nuget:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Download artifacts
uses: dawidd6/action-download-artifact@v2
with:
path: ./output
workflow: build-binaries.yml
workflow_conclusion: success

- name: Nuget pack
run: |
dotnet pack -c Release

- name: Nuget publish
run: |
dotnet nuget push **/*.nupkg --source 'https://api.nuget.org/v3/index.json' --skip-duplicate -k ${{ secrets.nuget }}

- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
path: |
**/*.nupkg
10 changes: 5 additions & 5 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: Build
name: Test

on:
push:
branches:
- 'main'
- '34-investigate-possible-memory-leaks'
- 'for-pr'

jobs:
test:
runs-on: ${{matrix.os}}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

Expand All @@ -28,7 +28,7 @@ jobs:
# macOS
- build: macos
os: macos-latest

steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -41,7 +41,7 @@ jobs:
workflow_conclusion: success
name: ${{ matrix.build }}
name_is_regexp: true

- name: Copy binaries
run: |
cp output/${{ matrix.build }}/*.* YDotNet
Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bld/
[Bb]in/
[Oo]bj/
[Oo]ut/
[Oo]utput/
msbuild.log
msbuild.err
msbuild.wrn
Expand All @@ -39,3 +40,10 @@ msbuild.wrn
# Project-specific files
*.dll
*.dylib

# Node
node_modules

apSettings.Development.json

launchSettings.json
97 changes: 97 additions & 0 deletions Demo/Callback.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
using System.Text.Json.Serialization;
using YDotNet.Document.Types.Events;
using YDotNet.Extensions;
using YDotNet.Server;

namespace Demo;

public sealed class Callback : IDocumentCallback
{
private readonly ILogger<Callback> log;

public Callback(ILogger<Callback> log)
{
this.log = log;
}

public ValueTask OnDocumentLoadedAsync(DocumentLoadEvent @event)
{
if (@event.Context.DocumentName == "notifications")
{
return default;
}

var map = @event.Document.Map("increment");

map?.ObserveDeep(changes =>
{
foreach (var change in changes)
{
var key = change.MapEvent?.Keys.FirstOrDefault(x => x.Key == "value" && x.Tag != EventKeyChangeTag.Remove);

if (key != null)
{
var valueOld = key.OldValue?.Double;
var valueNew = key.NewValue?.Double;

if (valueOld == valueNew)
{
continue;
}

log.LogInformation("Counter updated from {oldValue} to {newValue}.", valueOld, valueNew);
}
}
});

var chat = @event.Document.Array("stream");

chat?.ObserveDeep(async changes =>
{
var newNotificationsRaw =
changes
.Where(x => x.Tag == EventBranchTag.Array)
.Select(x => x.ArrayEvent)
.SelectMany(x => x.Delta.Where(x => x.Tag == EventChangeTag.Add))
.SelectMany(x => x.Values)
.ToArray();

if (newNotificationsRaw.Length == 0)
{
return;
}

await Task.Delay(100);

var notificationCtx = new DocumentContext("notifications", 0);

await @event.Source.UpdateDocAsync(notificationCtx, (doc) =>
{
List<Notification> notifications;

using (var transaction = @event.Document.ReadTransaction())
{
notifications = newNotificationsRaw.Select(x => x.To<Notification>(transaction)).ToList();
}

var array = doc.Array("stream");

notifications = notifications.Select(x => new Notification { Text = $"You got the follow message: {x.Text}" }).ToList();

using (var transaction = doc.WriteTransaction() ?? throw new InvalidOperationException("Failed to open transaction."))
{
array.InsertRange(transaction, array.Length, notifications.Select(x => x.ToInput()).ToArray());
}
});
});


return default;
}

public sealed class Notification
{
[JsonPropertyName("text")]
public string? Text { get; set; }
}
}
23 changes: 23 additions & 0 deletions Demo/Client/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'@typescript-eslint/semi': 'error',
'@typescript-eslint/indent': [
'warn',
4
]
}
}
24 changes: 24 additions & 0 deletions Demo/Client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 3 additions & 0 deletions Demo/Client/.vite/deps_temp_bce6eb42/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"type": "module"
}
27 changes: 27 additions & 0 deletions Demo/Client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# React + TypeScript + Vite

This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

Currently, two official plugins are available:

- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

## Expanding the ESLint configuration

If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

- Configure the top-level `parserOptions` property like this:

```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
15 changes: 15 additions & 0 deletions Demo/Client/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>YJS</title>

<link rel="stylesheet" type="text/css" href="https://prosemirror.net/css/editor.css">
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
Loading