-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
224 changed files
with
9,128 additions
and
2,185 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Ignore everything in this directory | ||
* | ||
# Except this file | ||
!.gitignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "DexieNETTest", | ||
"type": "blazorwasm", | ||
"request": "launch", | ||
"cwd": "${workspaceFolder}/DexieNETTest/Client" | ||
}, | ||
{ | ||
"type": "blazorwasm", | ||
"name": "DexieNETCloudSample", | ||
"request": "launch", | ||
"url": "http://localhost:5223", | ||
"cwd": "${workspaceFolder}/DexieNETCloudSample" | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"dotnet.defaultSolution": "DexieNET.sln" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using System.Diagnostics.CodeAnalysis; | ||
using DexieNET; | ||
|
||
namespace DexieCloudNET.Component | ||
{ | ||
public class DexieCloudNET<T>(string cloudURL) : ComponentBase where T : DBBase, IDBBase | ||
{ | ||
[Inject] | ||
protected IDexieNETService<T>? DexieNETService { get; set; } | ||
|
||
[NotNull] // OnInitializedAsync will throw | ||
public T? Dexie { get; private set; } | ||
|
||
protected async override Task OnInitializedAsync() | ||
{ | ||
if (DexieNETService is not null) | ||
{ | ||
DexieCloudOptions cloudOptions = new(cloudURL); | ||
|
||
Dexie = await DexieNETService.DexieNETFactory.Create(true); | ||
|
||
if (Dexie is null) | ||
{ | ||
throw new InvalidOperationException("Can not create database."); | ||
} | ||
|
||
Dexie.ConfigureCloud(cloudOptions); | ||
} | ||
|
||
await base.OnInitializedAsync(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
<Project Sdk="Microsoft.NET.Sdk.Razor"> | ||
<PropertyGroup> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<Title>DexieCloudNET</Title> | ||
<Description>A .NET wrapper for dexie.js minimalist wrapper for IndexedDB with cloud support.</Description> | ||
<Authors>Bernhard Straub</Authors> | ||
<Copyright>Bernhard Straub</Copyright> | ||
<PackageProjectUrl>https://github.com/b-straub/DexieNET</PackageProjectUrl> | ||
<RepositoryUrl>https://github.com/b-straub/DexieNET</RepositoryUrl> | ||
<PackageReadmeFile>README.md</PackageReadmeFile> | ||
<RepositoryType>git</RepositoryType> | ||
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression> | ||
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||
<PackageTags>Dexie, Dexie Cloud, IndexedDB</PackageTags> | ||
<GeneratePackageOnBuild>true</GeneratePackageOnBuild> | ||
<PackageOutputPath>..\.nuget</PackageOutputPath> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<SupportedPlatform Include="browser" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="README.md" Pack="true" PackagePath="." /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<None Include="yarn\package.json" Pack="false" /> | ||
<None Include="yarn\tsconfig.json" Pack="false" /> | ||
<Content Include="yarn\src\*.js" Pack="false" /> | ||
<Content Include="yarn\src\*.map" Pack="false" Condition="'$(Configuration)' == 'Debug'" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Microsoft.AspNetCore.Components.Web" Version="8.0.4" /> | ||
|
||
<PackageReference Include="System.Reactive" Version="6.0.0" /> | ||
|
||
<PackageReference Include="Microsoft.TypeScript.MSBuild" Version="5.4.4"> | ||
<PrivateAssets>all</PrivateAssets> | ||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> | ||
</PackageReference> | ||
|
||
<ProjectReference Include="..\DexieNET\DexieNET.csproj" /> | ||
</ItemGroup> | ||
|
||
<PropertyGroup> | ||
<!-- File with mtime of last successful npm install --> | ||
<YarnInstallStampFile>npm/node_modules/.install-stamp</YarnInstallStampFile> | ||
<Authors>Bernhard Straub</Authors> | ||
</PropertyGroup> | ||
|
||
<Target Name="DeleteJSFiles" BeforeTargets="BeforeBuild"> | ||
<Delete Files="wwwroot\js\*.*" /> | ||
</Target> | ||
|
||
<Target Name="YarnInstall" BeforeTargets="BeforeBuild" Inputs="yarn/package.json" Outputs="$(YarnInstallStampFile)"> | ||
<Exec Command="yarn install" WorkingDirectory="yarn" /> | ||
<Touch Files="$(NpmInstallStampFile)" AlwaysCreate="true" /> | ||
</Target> | ||
|
||
<Target Name="YarnCommandsDebug" AfterTargets="Build" Condition="'$(Configuration)' == 'Debug'"> | ||
<Exec Command="yarn run buildDebug" WorkingDirectory="yarn" /> | ||
</Target> | ||
|
||
<Target Name="YarnCommandsRelease" AfterTargets="Build" Condition="'$(Configuration)' == 'Release'"> | ||
<Exec Command="yarn run buildRelease" WorkingDirectory="yarn" /> | ||
</Target> | ||
|
||
</Project> |
Oops, something went wrong.