@kontest/gamelift-pb
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -22,1 +22,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(AcceptPlayerSession.$type); | ||
//# sourceMappingURL=accept-player-session.js.map |
@@ -20,1 +20,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(ActivateGameSession.$type); | ||
//# sourceMappingURL=activate-game-session.js.map |
@@ -31,1 +31,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(AttributeValue.$type); | ||
//# sourceMappingURL=attribute-value.js.map |
@@ -29,1 +29,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(BackfillMatchmakingRequest.$type); | ||
//# sourceMappingURL=backfill-matchmaking-request.js.map |
@@ -34,1 +34,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(DescribePlayerSessionsRequest.$type); | ||
//# sourceMappingURL=describe-player-sessions-request.js.map |
@@ -23,1 +23,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(DescribePlayerSessionsResponse.$type); | ||
//# sourceMappingURL=describe-player-sessions-response.js.map |
@@ -22,1 +22,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(GameProperty.$type); | ||
//# sourceMappingURL=game-property.js.map |
@@ -25,1 +25,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(GameSessionActivate.$type); | ||
//# sourceMappingURL=game-session-activate.js.map |
@@ -19,1 +19,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(GameSessionTerminate.$type); | ||
//# sourceMappingURL=game-session-terminate.js.map |
@@ -62,1 +62,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(GameSession.$type); | ||
//# sourceMappingURL=game-session.js.map |
@@ -37,1 +37,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(GameLiftResponse.$type); | ||
//# sourceMappingURL=gamelift-response.js.map |
@@ -31,1 +31,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(GetInstanceCertificateResponse.$type); | ||
//# sourceMappingURL=get-instance-certificate-response.js.map |
@@ -19,1 +19,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(GetInstanceCertificate.$type); | ||
//# sourceMappingURL=get-instance-certificate.js.map |
@@ -50,1 +50,2 @@ "use strict"; | ||
Object.defineProperty(exports, "UpdatePlayerSessionCreationPolicy", { enumerable: true, get: function () { return update_player_session_creation_policy_1.UpdatePlayerSessionCreationPolicy; } }); | ||
//# sourceMappingURL=index.js.map |
@@ -23,1 +23,2 @@ "use strict"; | ||
exports.pbufferNamespace = exports.comNamespace.lookup("amazon.whitewater.auxproxy.pbuffer"); | ||
//# sourceMappingURL=namespace.js.map |
@@ -49,1 +49,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(PlayerSession.$type); | ||
//# sourceMappingURL=player-session.js.map |
@@ -29,1 +29,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(Player.$type); | ||
//# sourceMappingURL=player.js.map |
@@ -19,1 +19,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(ProcessEnding.$type); | ||
//# sourceMappingURL=process-ending.js.map |
@@ -29,1 +29,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(ProcessReady.$type); | ||
//# sourceMappingURL=process-ready.js.map |
@@ -22,1 +22,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(RemovePlayerSession.$type); | ||
//# sourceMappingURL=remove-player-session.js.map |
@@ -19,1 +19,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(ReportHealth.$type); | ||
//# sourceMappingURL=report-health.js.map |
@@ -25,1 +25,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(StopMatchmakingRequest.$type); | ||
//# sourceMappingURL=stop-matchmaking-request.js.map |
@@ -19,1 +19,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(TerminateProcess.$type); | ||
//# sourceMappingURL=terminate-process.js.map |
@@ -26,1 +26,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(UpdateGameSession.$type); | ||
//# sourceMappingURL=update-game-session.js.map |
@@ -22,1 +22,2 @@ "use strict"; | ||
namespace_1.pbufferNamespace.add(UpdatePlayerSessionCreationPolicy.$type); | ||
//# sourceMappingURL=update-player-session-creation-policy.js.map |
{ | ||
"name": "@kontest/gamelift-pb", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "NodeJS addon for Protocol Buffer objects used in AWS Gamelift", | ||
"main": "dist/index.js", | ||
"scripts": { | ||
"prepublish": "npm run build", | ||
"build": "tsc", | ||
"build:test": "cmake-js build --target gamelift-pb-wire-test", | ||
"prepare": "npm run build", | ||
"clean": "rimraf dist/", | ||
"build": "npm run clean && tsc", | ||
"build:test": "npm run clean && npm run build && cmake-js build --target gamelift-pb-wire-test --cmake-path \"$CMAKE_PATH\"", | ||
"pretest": "npm run build:test", | ||
"test": "mocha", | ||
"coverage": "nyc mocha --require source-map-support/register", | ||
"coverage:report": "nyc report --reporter=lcov", | ||
"docs": "typedoc --options typedoc.json --stripInternal", | ||
@@ -29,2 +32,5 @@ "docs:internal": "typedoc --options typedocs.json", | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"author": "therealsamf", | ||
@@ -37,3 +43,4 @@ "license": "MIT", | ||
"files": [ | ||
"dist", | ||
"dist/*.js", | ||
"dist/*.d.ts", | ||
"LICENSE", | ||
@@ -43,2 +50,3 @@ "README.md" | ||
"devDependencies": { | ||
"@istanbuljs/nyc-config-typescript": "^1.0.1", | ||
"@types/faker": "^4.1.12", | ||
@@ -58,3 +66,6 @@ "@types/mocha": "^8.0.3", | ||
"node-addon-api": "^3.0.0", | ||
"nyc": "^15.1.0", | ||
"prettier": "^2.1.1", | ||
"rimraf": "^3.0.2", | ||
"source-map-support": "^0.5.19", | ||
"ts-node": "^9.0.0", | ||
@@ -61,0 +72,0 @@ "typedoc": "^0.18.0", |
gamelift-pb | ||
=========== | ||
[](https://travis-ci.org/therealsamf/gamelift-pb) | ||
[](https://codecov.io/gh/therealsamf/gamelift-pb) | ||
[](https://snyk.io/test/github/therealsamf/gamelift-pb) | ||
[Protocol Buffer] messages used in the [AWS GameLift] Server SDK usable in a NodeJS environment. | ||
@@ -10,7 +15,7 @@ | ||
These message definitions aren't really meant to be used directly. Head over to [`@kontest/gamelift`](https://github.com/therealsamf/gamelift) for a guide and examples on how to get started with a NodeJS server running on AWS GameLift. | ||
These message definitions aren't meant to be used directly. Head over to [`@kontest/gamelift`](https://github.com/therealsamf/gamelift) for a guide and examples on how to get started with a NodeJS server running on AWS GameLift. | ||
# Development | ||
This library is essentially Protocol Buffer definitions implemented in [TypeScript] & [protobuf.js] reflection capability. | ||
This library contains Protocol Buffer definitions implemented in [TypeScript] & [protobuf.js] reflection capability. | ||
@@ -22,3 +27,3 @@ ## Motivation | ||
1. Create a [NodeJS C++ addon](https://nodejs.org/api/addons.html) with some "glue" using the [N-API](https://nodejs.org/api/addons.html#addons_n_api) to traverse the C++/NodeJS language barrier. | ||
* There's other ways of implementing the specifics of this; N-API isn't specifically required. But all such solutions would require native "glue" code between NodeJS and Protocol Buffer messages compiled by `protoc` so that they're usable from JavaScript. | ||
* There are other ways of implementing the specifics of this; N-API isn't specifically required. But all such solutions would require native "glue" code between NodeJS and Protocol Buffer messages compiled by `protoc` so that they're usable from JavaScript. | ||
2. Recreate the message definitions in a way that NodeJS can use without touching native code. | ||
@@ -30,6 +35,6 @@ * This could writing out the *.proto* files themselves and using `protoc` to generate NodeJS code, defining them with protobuf.js's reflection capability, or any other method for re-creating the messages in pure JavaScript. | ||
* Easier to deploy: When you start deploying native code you have to build for multiple platforms. | ||
* Inline documentation & type safety: Using TypeScript is advantageous since I can run [TypeDoc](https://typedoc.org/) over the files and easily generate documentation. I'm also able to utilize the static type checking with TypeScript. | ||
* Inline documentation & type safety: Using TypeScript is advantageous since [TypeDoc](https://typedoc.org/) can be used to easily generate documentation. Static type checking with TypeScript is also an advantage. | ||
* I could still write native code while getting the benefits of TypeScript with a [declaration file](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). However, writing TypeScript in the first place reduces the amount of code to write. | ||
* Easier to extend: AWS GameLift SDK includes some model definitions which provides some helper methods on top of the fields already present in the Protocol Buffer messages. Using [protobuf.js decorator's capability](https://github.com/protobufjs/protobuf.js#using-decorators) the classes in this library fully implement GameLift's message defintiions while still being as extendable as any class in JavaScript. | ||
* Native code could be written while getting the benefits of TypeScript with a [declaration file](https://www.typescriptlang.org/docs/handbook/declaration-files/introduction.html). However, writing TypeScript in the first place reduces the amount of code to write. | ||
* Easier to extend: AWS GameLift SDK includes some model definitions which provides some helper methods on top of the fields already present in the Protocol Buffer messages. Using [protobuf.js decorator's capability](https://github.com/protobufjs/protobuf.js#using-decorators), the classes in this library fully implement GameLift's message defintiions while still being as extendable as any class in JavaScript. | ||
@@ -42,7 +47,7 @@ ## Contributing | ||
In order to successfully fix bugs or add new features to this library you'll need to be able to run the test suite. Since the only reference for these Protocol Buffer messages are the original C++ class definitions generated by `protoc` the test functions & assertions are mainly written in C++. This means you'll need a toolchain capable of building native code for your development environment. | ||
In order to successfully fix bugs or add new features to this library you'll need to be able to run the test suite. Since the only reference for these Protocol Buffer messages are the original C++ class definitions generated by `protoc` the test functions & assertions are mainly written in C++. This implies a toolchain is required that is capable of building native code for your development environment. | ||
The build tool this project interfaces with directly is [`cmake-js`](https://github.com/cmake-js/cmake-js). You'll also need to install [CMake](https://cmake.org/) itself. *This project has only been tested with CMake version 3.16*. I'm sure that other versions will work, but they are not tested. | ||
The build tool this project interfaces with directly is [`cmake-js`](https://github.com/cmake-js/cmake-js). You'll also need to install [CMake](https://cmake.org/) itself. *This project has only been tested with CMake version 3.16*. Other versions will probably work, but they are not tested. | ||
You'll also need the C/C++ compiler for your platform. See the [`cmake-js` project's README.md](https://github.com/cmake-js/cmake-js/blob/master/README.md) for some links on where to acquire those tools. | ||
A C/C++ compiler for your platform is also required. See the [`cmake-js` project's README.md](https://github.com/cmake-js/cmake-js/blob/master/README.md) for some links on where to acquire those tools. | ||
@@ -69,3 +74,3 @@ The rest of the development dependencies can be conveniently installed like any other NodeJS project: | ||
This project utilizes [`eslint`](https://eslint.org/) for code quality. The script you'll want to run to lint your changes is `npm run lint`. | ||
This project utilizes [`eslint`](https://eslint.org/) for code quality. The script to run to lint your changes is `npm run lint`. | ||
@@ -72,0 +77,0 @@ ### Formatting |
55699
87
22