diff --git a/.gitignore b/.gitignore index 3804cd921..513cc372b 100644 --- a/.gitignore +++ b/.gitignore @@ -22,9 +22,230 @@ depots public/sitemap* /firebase.json target -# packages/core/src/protos/*.ts /.vercel /.astro .vercel -/src -/packages/bot/src/prisma \ No newline at end of file +/packages/bot/src/prisma + +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates +*.userprefs +mono_crash.* +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +[Aa][Rr][Mm]64[Ee][Cc]/ +bld/ +[Bb]in/ +[Oo]bj/ +[Oo]ut/ +[Ll]og/ +[Ll]ogs/ +.vs/ +Generated\ Files/ +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* +*.VisualState.xml +TestResult.xml +nunit-*.xml +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c +BenchmarkDotNet.Artifacts/ +project.lock.json +project.fragment.lock.json +artifacts/ +ScaffoldingReadMe.txt +StyleCopReport.xml +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.idb +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +!Directory.Build.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc +_Chutzpah* +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb +*.psess +*.vsp +*.vspx +*.sap +*.e2e +$tf/ +*.gpState +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user +_TeamCity* +*.dotCover +.axoCover/* +!.axoCover/settings.json +coverage*.json +coverage*.xml +coverage*.info +*.coverage +*.coveragexml +_NCrunch_* +.NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* +*.mm.* +AutoTest.Net/ +.sass-cache/ +[Ee]xpress/ +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html +publish/ +*.[Pp]ublish.xml +*.azurePubxml +*.pubxml +*.publishproj +PublishScripts/ +*.nupkg +*.snupkg +**/[Pp]ackages/* +!**/[Pp]ackages/build/ +*.nuget.props +*.nuget.targets +csx/ +*.build.csdef +ecf/ +rcf/ +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload +*.[Cc]ache +!?*.[Cc]ache/ +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +Generated_Code/ +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak +*.mdf +*.ldf +*.ndf +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl +FakesAssemblies/ +*.GhostDoc.xml +.ntvs_analysis.dat +node_modules/ +*.plg +*.opt +*.vbw +*.vbp +*.dsw +*.dsp +*.ncb +*.aps +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions +.paket/paket.exe +paket-files/ +.fake/ +.cr/personal +__pycache__/ +*.pyc + +*.tss +*.jmconfig +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs +OpenCover/ +ASALocalRun/ +*.binlog +.aws-sam +*.nvuser +.mfractor/ +.localhistory/ +.vshistory/ +healthchecksdb +MigrationBackup/ +.ionide/ +FodyWeavers.xsd +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace +.history/ +*.cab +*.msi +*.msix +*.msm +*.msp +*.sln.iml \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 000000000..98ad19c2a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/BlitzKit.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/BlitzKit.sln", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/BlitzKit.sln" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/BlitzKit.sln b/BlitzKit.sln new file mode 100644 index 000000000..5c42778f9 --- /dev/null +++ b/BlitzKit.sln @@ -0,0 +1,27 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.0.31903.59 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{F23F76D4-C350-4BBA-9DF1-E67C5CD391B1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BlitzKit.FFI", "src\BlitzKit.FFI\BlitzKit.FFI.csproj", "{8E798C66-C863-4A67-87EA-853109EEE037}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {8E798C66-C863-4A67-87EA-853109EEE037}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8E798C66-C863-4A67-87EA-853109EEE037}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8E798C66-C863-4A67-87EA-853109EEE037}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8E798C66-C863-4A67-87EA-853109EEE037}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {8E798C66-C863-4A67-87EA-853109EEE037} = {F23F76D4-C350-4BBA-9DF1-E67C5CD391B1} + EndGlobalSection +EndGlobal diff --git a/bun.lockb b/bun.lockb index a9bea9ac7..ce79beddc 100644 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index ca1be902f..9171bf7e0 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,10 @@ "preview:website": "cd packages/website && bun run preview", "build:reviews": "cd packages/scripts && bun build:reviews", "build:ids": "cd packages/scripts && bun build:ids", - "prunestrings": "cd packages/scripts && bun prunestrings" + "prunestrings": "cd packages/scripts && bun prunestrings", + "build:ffi": "bun build:windows:ffi", + "build:windows:ffi": "dotnet publish src/BlitzKit.FFI -r win-x64 /p:PublishAot=true", + "build:linux:ffi": "dotnet publish src/BlitzKit.FFI -r linux-x64 /p:PublishAot=true" }, "license": "MIT", "dependencies": { diff --git a/packages/website-ue/package.json b/packages/website-ue/package.json index 56ea0302e..1994f4136 100644 --- a/packages/website-ue/package.json +++ b/packages/website-ue/package.json @@ -20,18 +20,22 @@ "@radix-ui/themes": "^3.1.4", "@react-three/drei": "^9.115.0", "@react-three/fiber": "^8.17.10", + "@types/ffi-napi": "^4.0.10", "@types/lodash-es": "^4.17.12", "@types/react": "^19.1.5", "@types/react-dom": "^19.1.5", + "@types/ref-napi": "^3.0.12", "@types/semver": "^7.7.0", "@types/three": "^0.160.0", "astro": "^5.8.0", + "ffi-napi": "^4.0.3", "fuzzysort": "^3.1.0", "immer": "^10.1.1", "lodash-es": "^4.17.21", "minimatch": "^10.0.1", "react": "^19.1.0", "react-dom": "^19.1.0", + "ref-napi": "^3.0.3", "semver": "^7.7.2", "sharp": "^0.34.2", "three": "^0.169.0", diff --git a/packages/website-ue/src/pages/internal/_index.tsx b/packages/website-ue/src/pages/internal/_index.tsx index de16e041a..3b93d6e01 100644 --- a/packages/website-ue/src/pages/internal/_index.tsx +++ b/packages/website-ue/src/pages/internal/_index.tsx @@ -22,6 +22,15 @@ export function Page() { + + + Client + + + Location and information of the currently mounted client + + + Bindings diff --git a/packages/website-ue/src/pages/internal/ffi/_index.tsx b/packages/website-ue/src/pages/internal/ffi/_index.tsx index b8672cf94..ce63d776a 100644 --- a/packages/website-ue/src/pages/internal/ffi/_index.tsx +++ b/packages/website-ue/src/pages/internal/ffi/_index.tsx @@ -1,9 +1,11 @@ import { PageWrapper } from 'packages/website-ue/src/components/PageWrapper'; +import { ffi } from 'packages/website-ue/src/core/blitzkit/ffi'; export function Page() { return ( - 🔴 Unmounted + 🟢 {ffi.echo(new Date().toLocaleString())} + ); } diff --git a/src/BlitzKit.FFI/BlitzKit.FFI.csproj b/src/BlitzKit.FFI/BlitzKit.FFI.csproj new file mode 100644 index 000000000..d2f72c49d --- /dev/null +++ b/src/BlitzKit.FFI/BlitzKit.FFI.csproj @@ -0,0 +1,10 @@ + + + Library + net9.0 + true + true + win-x64 + true + + diff --git a/src/BlitzKit.FFI/FFI.cs b/src/BlitzKit.FFI/FFI.cs new file mode 100644 index 000000000..84446b30c --- /dev/null +++ b/src/BlitzKit.FFI/FFI.cs @@ -0,0 +1,15 @@ +using System; +using System.Runtime.InteropServices; + +namespace BlitzKit.FFI; + +public static class FFI +{ + [UnmanagedCallersOnly(EntryPoint = "echo")] + public static IntPtr Echo(IntPtr inputPtr) + { + var input = Marshal.PtrToStringAnsi(inputPtr); + var result = $"BlitzKit FFI echo: {input}"; + return Marshal.StringToHGlobalAnsi(result); + } +}