Add node vs2022 project

This commit is contained in:
Merijn Hendriks 2021-12-28 22:56:56 +01:00
parent a6d03de761
commit 88e301fdec
7 changed files with 145 additions and 50 deletions

22
.vscode/launch.json vendored
View File

@ -1,22 +0,0 @@
{
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Server",
"runtimeExecutable": "npm",
"runtimeArgs": [
"run-script",
"debug"
],
"cwd": "${workspaceFolder}",
"outFiles": [
"${workspaceFolder}/out/**/*.js"
],
"skipFiles": [
"**/node_modules/**"
]
}
]
}

25
.vscode/tasks.json vendored
View File

@ -2,7 +2,30 @@
"version": "2.0.0",
"tasks": [
{
"label": "something"
"label": "release: server",
"type": "shell",
"linux": {
"command": "npm --prefix Server run release:any"
},
"osx": {
"command": "npm --prefix Server run release:any"
},
"windows": {
"command": "npm --prefix Server run release:win"
}
},
{
"label": "release: launcher",
"type": "shell",
"linux": {
"command": "dotnet publish Launcher/Launcher.csproj --nologo --verbosity minimal --runtime linux-x64 --configuration Release -p:PublishSingleFile=true --no-self-contained"
},
"osx": {
"command": "dotnet publish Launcher/Launcher.csproj --nologo --verbosity minimal --runtime osx-x64 --configuration Release -p:PublishSingleFile=true --no-self-contained"
},
"windows": {
"command": "dotnet publish Launcher/Launcher.csproj --nologo --verbosity minimal --runtime win-x64 --configuration Release -p:PublishSingleFile=true --no-self-contained"
}
}
]
}

View File

@ -1,22 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30114.105
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Launcher", "Launcher\Launcher.csproj", "{748D03B7-017B-47D7-81B3-BAD2E6AD4C11}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Launcher", "Launcher\Launcher.csproj", "{748D03B7-017B-47D7-81B3-BAD2E6AD4C11}"
EndProject
Project("{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}") = "Server", "Server\Server.njsproj", "{90A39E90-902C-4E2C-B0E5-F8645DBC2C56}"
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
{748D03B7-017B-47D7-81B3-BAD2E6AD4C11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{748D03B7-017B-47D7-81B3-BAD2E6AD4C11}.Debug|Any CPU.Build.0 = Debug|Any CPU
{748D03B7-017B-47D7-81B3-BAD2E6AD4C11}.Release|Any CPU.ActiveCfg = Release|Any CPU
{748D03B7-017B-47D7-81B3-BAD2E6AD4C11}.Release|Any CPU.Build.0 = Release|Any CPU
{90A39E90-902C-4E2C-B0E5-F8645DBC2C56}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{90A39E90-902C-4E2C-B0E5-F8645DBC2C56}.Debug|Any CPU.Build.0 = Debug|Any CPU
{90A39E90-902C-4E2C-B0E5-F8645DBC2C56}.Release|Any CPU.ActiveCfg = Release|Any CPU
{90A39E90-902C-4E2C-B0E5-F8645DBC2C56}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8340C7D5-1B75-46FD-B60B-3039AD5A9136}
EndGlobalSection
EndGlobal

View File

@ -9,23 +9,18 @@ It does not aim at being correct, fast or moddable but instead to be simple.
## Requirements
- dotnet 6.0 sdk
- node 14.0.0 (or newer)
- npm
- visual studio 2022
- node.js workload
- .net desktop workload
## Setup
`npm install`
VSCode > Terminal > Run Task > npm > npm: install
## Run
## Build
```bash
# server
npm run release:all # or release:win
# launcher
dotnet build
```
1. VSCode > Terminal > Run Task > release: launcher
2. VSCode > Terminal > Run Task > release: server
## License

87
Server/Server.njsproj Normal file
View File

@ -0,0 +1,87 @@
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
<Name>Server</Name>
<RootNamespace>Server</RootNamespace>
<SaveNodeJsSettingsInProjectFile>True</SaveNodeJsSettingsInProjectFile>
</PropertyGroup>
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>90a39e90-902c-4e2c-b0e5-f8645dbc2c56</ProjectGuid>
<ProjectHome>.</ProjectHome>
<StartupFile>obj/server.js</StartupFile>
<StartWebBrowser>False</StartWebBrowser>
<SearchPath>
</SearchPath>
<WorkingDirectory>.</WorkingDirectory>
<OutputPath>.</OutputPath>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
<EnableTypeScript>true</EnableTypeScript>
<StartWebBrowser>False</StartWebBrowser>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Content Include="package.json" />
<Content Include="tsconfig.json" />
</ItemGroup>
<ItemGroup>
<Folder Include="src\" />
</ItemGroup>
<ItemGroup>
<TypeScriptCompile Include="src\Haru.Eft.Models.ts" />
<TypeScriptCompile Include="src\Haru.Eft.Servers.ts" />
<TypeScriptCompile Include="src\Haru.Eft.Services.ts" />
<TypeScriptCompile Include="src\Haru.Http.ts" />
<TypeScriptCompile Include="src\Haru.ts" />
<TypeScriptCompile Include="src\Haru.Utils.ts" />
<TypeScriptCompile Include="src\main.ts" />
</ItemGroup>
<Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsToolsV2.targets" />
<ProjectExtensions>
<VisualStudio>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
<WebProjectProperties>
<UseIIS>False</UseIIS>
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>0</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:48022/</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>True</UseCustomServer>
<CustomServerUrl>http://localhost:1337</CustomServerUrl>
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
</WebProjectProperties>
</FlavorProperties>
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}" User="">
<WebProjectProperties>
<StartPageUrl>
</StartPageUrl>
<StartAction>CurrentPage</StartAction>
<AspNetDebugging>True</AspNetDebugging>
<SilverlightDebugging>False</SilverlightDebugging>
<NativeDebugging>False</NativeDebugging>
<SQLDebugging>False</SQLDebugging>
<ExternalProgram>
</ExternalProgram>
<StartExternalURL>
</StartExternalURL>
<StartCmdLineArguments>
</StartCmdLineArguments>
<StartWorkingDirectory>
</StartWorkingDirectory>
<EnableENC>False</EnableENC>
<AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
</WebProjectProperties>
</FlavorProperties>
</VisualStudio>
</ProjectExtensions>
</Project>

View File

@ -3,17 +3,17 @@
"author": "senko-san",
"version": "1.0.0",
"license": "NCSA",
"main": "Server/src/main.ts",
"scripts": {
"build:ts": "npx babel Server/src --extensions \".ts\" --out-dir Server/obj/babel",
"build:bundle": "npx browserify --debug --node Server/obj/babel/main.js > Server/obj/server.js",
"build:exe": "npx nexe -t x64-14.15.3 -i Server/obj/server.js -o Server/bin/Server.exe",
"build:icon": "cd node_modules/rcedit/bin && rcedit-x64.exe ../../../Server/bin/Server.exe --set-icon ../../../Server/assets/images/favicon.ico",
"launch": "node --trace-warnings Server/obj/server.js",
"build:babel": "npx babel src --extensions \".ts\" --out-dir obj/babel",
"build:bundle": "npx browserify --debug --node obj/babel/main.js > obj/server.js",
"build:exe": "npx nexe -t x64-14.15.3 -i obj/server.js -o bin/Server.exe",
"build:icon": "cd node_modules/rcedit/bin && rcedit-x64.exe ../../../bin/Server.exe --set-icon ../../../assets/images/favicon.ico",
"build": "tsc --build",
"lint:fix": "npx eslint --fix \"./src/**/*.ts\"",
"lint:check": "npx eslint \"./src/**/*.ts\"",
"debug": "npm run build:ts && npm run build:bundle && npm run launch",
"release:all": "npm run build:ts && npm run build:bundle && npm run build:exe",
"release:win": "npm run release:all && npm run build:icon"
"release:any": "npm run build:babel && npm run build:bundle && npm run build:exe",
"release:win": "npm run release:any && npm run build:icon"
},
"dependencies": {
"source-map-support": "^0.5.0",

View File

@ -7,9 +7,12 @@
"inlineSources": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"outDir": "./obj/ts"
"outDir": "obj/ts"
},
"include": [
"./src"
],
"exclude": [
"node_modules"
]
}