Commit 040664f3 authored by Anthony NAZE's avatar Anthony NAZE

Mise a jour du projet via le projet du prof

parent 709dfc16
node_modules/
node/
dist/
src/codegen/
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
{
"name": "not-alone-web",
"version": "0.0.0",
"scripts": {
"prebuild": "tslint -c tslint.json -p tsconfig.json --fix",
"build": "tsc",
"prestart": "npm run build",
"start": "node .",
"test": "echo \"Error: no test specified\" && exit 1",
"codegen": "\"./node_modules/.bin/thrift-typescript\" --target thrift-server --sourceDir \"../not-alone-core/src/main/thrift/\" --outDir \"./src/codegen/\""
},
"private": true,
"devDependencies": {
"@creditkarma/thrift-parser": "^1.2.0",
"@creditkarma/thrift-typescript": "^3.7.6",
"@types/thrift": "^0.10.10",
"codelyzer": "^6.0.1",
"tslint": "^6.1.3"
},
"dependencies": {
"@creditkarma/thrift-client": "^0.16.1",
"@creditkarma/thrift-server-core": "^0.16.1",
"@creditkarma/thrift-server-express": "^0.16.1"
},
"browser": {
"crypto": false,
"stream": false
}
}
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>not-alone</artifactId>
<groupId>fr.univnantes.alma</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>not-alone-player</artifactId>
<name>Not Alone Player Services</name>
<build>
<plugins>
<plugin>
<groupId>com.github.eirslett</groupId>
<artifactId>frontend-maven-plugin</artifactId>
<version>1.10.0</version>
<configuration>
<workingDirectory>./</workingDirectory>
<nodeVersion>v14.11.0</nodeVersion>
<npmVersion>7.0.10</npmVersion>
</configuration>
<executions>
<execution>
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm install</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>install</arguments>
</configuration>
<phase>generate-resources</phase>
</execution>
<execution>
<id>npm run build</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>code generation</id>
<phase>compile</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run codegen</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<resources>
<resource>
<directory>./dist/not-alone-web</directory>
<targetPath>static</targetPath>
</resource>
</resources>
</build>
</project>
import { IJoinRequest } from 'src/codegen/common';
import { IHandler } from '../codegen/common/GameService';
import { PlayerService } from '../player/player-service';
export class ClientServiceHandler<Context> implements IHandler<Context> {
private service: PlayerService;
constructor() {
this.service = new PlayerService();
}
public createGame(numberOfPlayers: number, context?: Context): number | Promise<number> {
throw new Error('Method not implemented.');
}
public join(gameId: number, request: IJoinRequest, context?: Context): number | Promise<number> {
throw new Error('Method not implemented.');
}
public startGame(gameId: number): void | Promise<void> {
return this.service.startGame(gameId);
}
}
export class PlayerService {
startGame(gameId: number): void {
console.log('Start game', gameId);
}
}
import { createHttpClient, HttpConnection } from '@creditkarma/thrift-client';
import * as request from 'request';
import { CoreOptions } from 'request';
import { Client } from '../codegen/common/GameService';
const CONFIG = {
hostName: 'localhost',
port: 8045,
};
const thriftClient: Client<CoreOptions> = createHttpClient(Client, CONFIG);
const id: Promise<Number> = thriftClient.createGame(8);
export class ThriftClient {}
import { GameService } from '../codegen/common/';
import { ClientServiceHandler } from '../handler/client-service-handler';
import * as express from 'express';
import { createThriftServer } from '@creditkarma/thrift-server-express';
const handler: ClientServiceHandler<express.Request> = new ClientServiceHandler<express.Request>();
const PORT = 8090;
export class ThriftServer {
private app: express.Application;
constructor() {
this.app = createThriftServer({
path: '/thrift',
thriftOptions: {
serviceName: 'calculator-service',
handler: new GameService.Processor(handler),
},
});
this.app.listen(PORT, () => {
console.log(`Express server listening on port: ${PORT}`);
});
}
}
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"module": "ES6",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "ES5",
"typeRoots": [
"node_modules/@types"
],
"lib": [
"es2017",
"dom"
],
"paths": {
"core-js/es7/reflect": [
"node_modules/core-js/proposals/reflect-metadata"
]
}
},
"include": ["target/generated-sources/thrift//**/*", "src/**/*"]
}
{
"rulesDirectory": [
"node_modules/codelyzer"
],
"rules": {
"arrow-return-shorthand": true,
"callable-types": true,
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"deprecation": {
"severity": "warn"
},
"eofline": true,
"forin": true,
"import-blacklist": [
true,
"rxjs/Rx"
],
"import-spacing": true,
"indent": [
true,
"spaces"
],
"interface-over-type-literal": true,
"label-position": true,
"max-line-length": [
true,
140
],
"member-access": false,
"member-ordering": [
true,
{
"order": [
"static-field",
"instance-field",
"static-method",
"instance-method"
]
}
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-super": true,
"no-empty": false,
"no-empty-interface": true,
"no-eval": true,
"no-inferrable-types": [
true,
"ignore-params"
],
"no-misused-new": true,
"no-non-null-assertion": true,
"no-redundant-jsdoc": true,
"no-shadowed-variable": true,
"no-string-literal": false,
"no-string-throw": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unnecessary-initializer": true,
"no-unused-expression": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"prefer-const": true,
"quotemark": [
true,
"single"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"unified-signatures": true,
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
],
"no-output-on-prefix": true,
"use-input-property-decorator": true,
"use-output-property-decorator": true,
"use-host-property-decorator": true,
"no-input-rename": true,
"no-output-rename": true,
"use-life-cycle-interface": true,
"use-pipe-transform-interface": true,
"component-class-suffix": true,
"directive-class-suffix": true
}
}
......@@ -7,38 +7,42 @@
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"codegen": "\"./node_modules/.bin/thrift-typescript\" --sourceDir \"../not-alone-core/src/main/thrift/\" --outDir \"./src/codegen/\""
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@creditkarma/thrift-client": "^0.16.1",
"@creditkarma/thrift-server-core": "^0.16.1",
"@creditkarma/thrift-typescript": "^3.7.6",
"@ngtools/webpack": "^10.1.3",
"@types/thrift": "^0.10.10",
"core-js": "^3.6.5",
"rxjs": "~6.6.3",
"thrift": "^0.13.0",
"zone.js": "^0.11.1"
"@angular/animations": "^6.1.0",
"@angular/common": "^6.1.0",
"@angular/compiler": "^6.1.0",
"@angular/core": "^6.1.0",
"@angular/forms": "^6.1.0",
"@angular/http": "^6.1.0",
"@angular/platform-browser": "^6.1.0",
"@angular/platform-browser-dynamic": "^6.1.0",
"@angular/router": "^6.1.0",
"core-js": "^3.8.0",
"rxjs": "~6.2.0",
"zone.js": "~0.8.26"
},
"devDependencies": {
"@angular/cli": "^11.0.2",
"@types/jasmine": "~3.5.14",
"@types/jasminewd2": "~2.0.8",
"@types/node": "~14.11.2",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~6.0.0",
"karma": "^5.2.3",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.3",
"karma-jasmine": "~4.0.1",
"karma-jasmine-html-reporter": "^1.5.4",
"protractor": "^7.0.0",
"shx": "^0.3.3",
"ts-node": "~9.0.0",
"tslint": "~5.20.1",
"typescript": "~4.0.3"
"@angular-devkit/build-angular": "~0.8.0",
"@angular/cli": "~6.2.5",
"@angular/compiler-cli": "^6.1.0",
"@angular/language-service": "^6.1.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.3.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~3.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~2.9.2"
}
}
......@@ -50,16 +50,7 @@
<arguments>run build</arguments>
</configuration>
</execution>
<execution>
<id>code generation</id>
<phase>compile</phase>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run codegen</arguments>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment