diff --git a/.vscode/launch.json b/.vscode/launch.json deleted file mode 100644 index 7eddf58..0000000 --- a/.vscode/launch.json +++ /dev/null @@ -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/**" - ] - } - ] -} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 808e579..9df32ef 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -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" + } } ] } \ No newline at end of file diff --git a/Haru.sln b/Haru.sln index 04452dd..1050d16 100644 --- a/Haru.sln +++ b/Haru.sln @@ -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 diff --git a/README.md b/README.md index 442125a..d6b24d1 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/Server/Server.njsproj b/Server/Server.njsproj new file mode 100644 index 0000000..cd19b94 --- /dev/null +++ b/Server/Server.njsproj @@ -0,0 +1,87 @@ + + + 14.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + Server + Server + True + + + + Debug + 2.0 + 90a39e90-902c-4e2c-b0e5-f8645dbc2c56 + . + obj/server.js + False + + + . + . + v4.0 + {3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD} + true + False + + + true + + + true + + + + + + + + + + + + + + + + + + + + + + + False + True + 0 + / + http://localhost:48022/ + False + True + http://localhost:1337 + False + + + + + + + CurrentPage + True + False + False + False + + + + + + + + + False + False + + + + + \ No newline at end of file diff --git a/package.json b/Server/package.json similarity index 73% rename from package.json rename to Server/package.json index bd75160..88b8753 100644 --- a/package.json +++ b/Server/package.json @@ -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", diff --git a/Server/tsconfig.json b/Server/tsconfig.json index 0f042a3..5c20d2d 100644 --- a/Server/tsconfig.json +++ b/Server/tsconfig.json @@ -7,9 +7,12 @@ "inlineSources": true, "strict": true, "forceConsistentCasingInFileNames": true, - "outDir": "./obj/ts" + "outDir": "obj/ts" }, "include": [ "./src" + ], + "exclude": [ + "node_modules" ] } \ No newline at end of file