bug fixed

This commit is contained in:
richard-loafle 2020-04-09 17:56:38 +09:00
parent d0fe9435d8
commit 3bdd6bac6c
20 changed files with 290 additions and 31 deletions

View File

@ -117,6 +117,44 @@
} }
} }
}, },
"web-socket": {
"projectType": "library",
"root": "projects/web-socket",
"sourceRoot": "projects/web-socket/src",
"prefix": "lib",
"architect": {
"build": {
"builder": "@angular-devkit/build-ng-packagr:build",
"options": {
"tsConfig": "projects/web-socket/tsconfig.lib.json",
"project": "projects/web-socket/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "projects/web-socket/tsconfig.lib.prod.json"
}
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "projects/web-socket/src/test.ts",
"tsConfig": "projects/web-socket/tsconfig.spec.json",
"karmaConfig": "projects/web-socket/karma.conf.js"
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"projects/web-socket/tsconfig.lib.json",
"projects/web-socket/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**"]
}
}
}
},
"i18n": { "i18n": {
"projectType": "library", "projectType": "library",
"schematics": { "schematics": {

25
package-lock.json generated
View File

@ -2289,9 +2289,8 @@
"dev": true "dev": true
}, },
"@ucap/ng-protocol": { "@ucap/ng-protocol": {
"version": "file:pack/ucap-ng-protocol-0.0.2.tgz", "version": "file:pack/ucap-ng-protocol-0.0.3.tgz",
"integrity": "sha512-fNbmiIrXECeKowvjGflx2lOcOCykH42QKSZzciOeoSxHF8HiFT8ORN5BlR6GOknUCXvGwVPDccNwUs0t1QCnjg==", "integrity": "sha512-9aGv4bDKfOjDXWD56THW/KPDdAp2ytaWZSFnbw3PMy8bKiyfRQH/UXrj9c9jrf2aNhnSVvYjh1ol4oXNL8EYMg=="
"dev": true
}, },
"@ucap/ng-protocol-authentication": { "@ucap/ng-protocol-authentication": {
"version": "file:pack/ucap-ng-protocol-authentication-0.0.3.tgz", "version": "file:pack/ucap-ng-protocol-authentication-0.0.3.tgz",
@ -2375,7 +2374,8 @@
}, },
"@ucap/ng-store-chat": { "@ucap/ng-store-chat": {
"version": "file:pack/ucap-ng-store-chat-0.0.5.tgz", "version": "file:pack/ucap-ng-store-chat-0.0.5.tgz",
"integrity": "sha512-FlvWI52w58jq/ZO8b8sk/MonY+TYKiEYlkyIfZWfFYOxlnKG0MkbpL0R+tiOFO9GLbBGEsXrzYtaDazrLk55ZQ==" "integrity": "sha512-FlvWI52w58jq/ZO8b8sk/MonY+TYKiEYlkyIfZWfFYOxlnKG0MkbpL0R+tiOFO9GLbBGEsXrzYtaDazrLk55ZQ==",
"dev": true
}, },
"@ucap/ng-store-group": { "@ucap/ng-store-group": {
"version": "file:pack/ucap-ng-store-group-0.0.6.tgz", "version": "file:pack/ucap-ng-store-group-0.0.6.tgz",
@ -2407,6 +2407,11 @@
"integrity": "sha512-vtgJBOsJj/S2GjP02PpBz9ebGikNtzdsC7JQc5HKkCZRC6JKkzZmWzcaFGlLPsh9dcWEeZuNhwnAZfmPXgz6Aw==", "integrity": "sha512-vtgJBOsJj/S2GjP02PpBz9ebGikNtzdsC7JQc5HKkCZRC6JKkzZmWzcaFGlLPsh9dcWEeZuNhwnAZfmPXgz6Aw==",
"dev": true "dev": true
}, },
"@ucap/ng-web-socket": {
"version": "file:pack/ucap-ng-web-socket-0.0.1.tgz",
"integrity": "sha512-8jJPuPfO9bqHeOMwNFg4+0nsuPyh5zL3c9z+Z/t02fx0CpXsFw30E6EU2fVi42w4JPC4B65MfIFJ2ai8KB9Org==",
"dev": true
},
"@ucap/ng-web-storage": { "@ucap/ng-web-storage": {
"version": "file:pack/ucap-ng-web-storage-0.0.3.tgz", "version": "file:pack/ucap-ng-web-storage-0.0.3.tgz",
"integrity": "sha512-ndPfCfmdARbeSnbFvagzKsIsjVmo1l0q6vSjFm9seUkZ7GkGyEdzD53XGmrfsO3WosC9uiL6z5etUcmkwJ0EaA==", "integrity": "sha512-ndPfCfmdARbeSnbFvagzKsIsjVmo1l0q6vSjFm9seUkZ7GkGyEdzD53XGmrfsO3WosC9uiL6z5etUcmkwJ0EaA==",
@ -2419,9 +2424,9 @@
"dev": true "dev": true
}, },
"@ucap/protocol": { "@ucap/protocol": {
"version": "0.0.8", "version": "0.0.10",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/protocol/-/protocol-0.0.8.tgz", "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/protocol/-/protocol-0.0.10.tgz",
"integrity": "sha512-cLFryVjd3VLAEJScJiZ2Dm+Uuo5uqX0BHE9ZIdu99BSoDMyODOuBxPFBXAWaxiqX0H5jJHAU3m6leGVv1P2alg==", "integrity": "sha512-tuH1S+K9bVCY2tu/+snHiffkFQLUyQfSWQMYEeMqomX3FiZTX6E9RtqgsxdQzCI/8RHHDUv9OHrIlDl20Aag7w==",
"dev": true "dev": true
}, },
"@ucap/protocol-authentication": { "@ucap/protocol-authentication": {
@ -2515,9 +2520,9 @@
"dev": true "dev": true
}, },
"@ucap/web-socket": { "@ucap/web-socket": {
"version": "0.0.2", "version": "0.0.5",
"resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/web-socket/-/web-socket-0.0.2.tgz", "resolved": "http://10.81.13.221:8081/nexus/repository/npm-all/@ucap/web-socket/-/web-socket-0.0.5.tgz",
"integrity": "sha512-hKAEsIzMhUuR8u26ENkuIAh4Xp8ltzBlZggxhqtLifP8KbgQdWD3w3+1M1697MPni8q42+Q/ZH/1IHLdi8KB7w==", "integrity": "sha512-BsdH5llLxlFGPjER3rvSLaNKtdQyXhhVyAbPStYJPstBNfcyq0Al8/C97aXFWlpLrmvib+s3AT7o1OmPhv8ZWw==",
"dev": true "dev": true
}, },
"@ucap/web-storage": { "@ucap/web-storage": {

View File

@ -36,7 +36,8 @@
"build:protocol-status": "node ./scripts/build.js protocol-status", "build:protocol-status": "node ./scripts/build.js protocol-status",
"build:protocol-sync": "node ./scripts/build.js protocol-sync", "build:protocol-sync": "node ./scripts/build.js protocol-sync",
"build:protocol-umg": "node ./scripts/build.js protocol-umg", "build:protocol-umg": "node ./scripts/build.js protocol-umg",
"build:util:all": "npm-run-all -s build:web-storage build:i18n", "build:util:all": "npm-run-all -s build:web-socket build:web-storage build:i18n",
"build:web-socket": "node ./scripts/build.js web-socket",
"build:web-storage": "node ./scripts/build.js web-storage", "build:web-storage": "node ./scripts/build.js web-storage",
"build:i18n": "node ./scripts/build.js i18n", "build:i18n": "node ./scripts/build.js i18n",
"build:store:all": "npm-run-all -s build:store-organization build:store-authentication build:store-group build:store-chat", "build:store:all": "npm-run-all -s build:store-organization build:store-authentication build:store-group build:store-chat",
@ -80,7 +81,8 @@
"publish:protocol-status": "cd ./dist/protocol-status && npm publish", "publish:protocol-status": "cd ./dist/protocol-status && npm publish",
"publish:protocol-sync": "cd ./dist/protocol-sync && npm publish", "publish:protocol-sync": "cd ./dist/protocol-sync && npm publish",
"publish:protocol-umg": "cd ./dist/protocol-umg && npm publish", "publish:protocol-umg": "cd ./dist/protocol-umg && npm publish",
"publish:util:all": "npm-run-all -s publish:web-storage publish:i18n", "publish:util:all": "npm-run-all -s publish:web-socket publish:web-storage publish:i18n",
"publish:web-socket": "cd ./dist/web-socket && npm publish",
"publish:web-storage": "cd ./dist/web-storage && npm publish", "publish:web-storage": "cd ./dist/web-storage && npm publish",
"publish:i18n": "cd ./dist/i18n && npm publish", "publish:i18n": "cd ./dist/i18n && npm publish",
"publish:store:all": "npm-run-all -s publish:store-organization publish:store-authentication publish:store-group publish:store-chat", "publish:store:all": "npm-run-all -s publish:store-organization publish:store-authentication publish:store-group publish:store-chat",
@ -149,7 +151,7 @@
"@ucap/ng-native": "file:pack/ucap-ng-native-0.0.1.tgz", "@ucap/ng-native": "file:pack/ucap-ng-native-0.0.1.tgz",
"@ucap/ng-native-browser": "file:pack/ucap-ng-native-browser-0.0.1.tgz", "@ucap/ng-native-browser": "file:pack/ucap-ng-native-browser-0.0.1.tgz",
"@ucap/ng-pi": "file:pack/ucap-ng-pi-0.0.1.tgz", "@ucap/ng-pi": "file:pack/ucap-ng-pi-0.0.1.tgz",
"@ucap/ng-protocol": "file:pack/ucap-ng-protocol-0.0.2.tgz", "@ucap/ng-protocol": "file:pack/ucap-ng-protocol-0.0.3.tgz",
"@ucap/ng-protocol-authentication": "file:pack/ucap-ng-protocol-authentication-0.0.3.tgz", "@ucap/ng-protocol-authentication": "file:pack/ucap-ng-protocol-authentication-0.0.3.tgz",
"@ucap/ng-protocol-buddy": "file:pack/ucap-ng-protocol-buddy-0.0.3.tgz", "@ucap/ng-protocol-buddy": "file:pack/ucap-ng-protocol-buddy-0.0.3.tgz",
"@ucap/ng-protocol-event": "file:pack/ucap-ng-protocol-event-0.0.3.tgz", "@ucap/ng-protocol-event": "file:pack/ucap-ng-protocol-event-0.0.3.tgz",
@ -173,9 +175,10 @@
"@ucap/ng-ui-authentication": "file:pack/ucap-ng-ui-authentication-0.0.15.tgz", "@ucap/ng-ui-authentication": "file:pack/ucap-ng-ui-authentication-0.0.15.tgz",
"@ucap/ng-ui-organization": "file:pack/ucap-ng-ui-organization-0.0.2.tgz", "@ucap/ng-ui-organization": "file:pack/ucap-ng-ui-organization-0.0.2.tgz",
"@ucap/ng-ui-skin-default": "file:pack/ucap-ng-ui-skin-default-0.0.1.tgz", "@ucap/ng-ui-skin-default": "file:pack/ucap-ng-ui-skin-default-0.0.1.tgz",
"@ucap/ng-web-socket": "file:pack/ucap-ng-web-socket-0.0.1.tgz",
"@ucap/ng-web-storage": "file:pack/ucap-ng-web-storage-0.0.3.tgz", "@ucap/ng-web-storage": "file:pack/ucap-ng-web-storage-0.0.3.tgz",
"@ucap/pi": "~0.0.5", "@ucap/pi": "~0.0.5",
"@ucap/protocol": "~0.0.8", "@ucap/protocol": "~0.0.10",
"@ucap/protocol-authentication": "~0.0.5", "@ucap/protocol-authentication": "~0.0.5",
"@ucap/protocol-buddy": "~0.0.5", "@ucap/protocol-buddy": "~0.0.5",
"@ucap/protocol-event": "~0.0.5", "@ucap/protocol-event": "~0.0.5",
@ -191,7 +194,7 @@
"@ucap/protocol-status": "~0.0.5", "@ucap/protocol-status": "~0.0.5",
"@ucap/protocol-sync": "~0.0.4", "@ucap/protocol-sync": "~0.0.4",
"@ucap/protocol-umg": "~0.0.5", "@ucap/protocol-umg": "~0.0.5",
"@ucap/web-socket": "~0.0.2", "@ucap/web-socket": "~0.0.5",
"@ucap/web-storage": "~0.0.5", "@ucap/web-storage": "~0.0.5",
"autolinker": "^3.13.0", "autolinker": "^3.13.0",
"axios": "^0.19.2", "axios": "^0.19.2",

View File

@ -1,6 +1,6 @@
{ {
"name": "@ucap/ng-protocol", "name": "@ucap/ng-protocol",
"version": "0.0.2", "version": "0.0.3",
"publishConfig": { "publishConfig": {
"registry": "http://10.81.13.221:8081/nexus/repository/npm-ucap/" "registry": "http://10.81.13.221:8081/nexus/repository/npm-ucap/"
}, },

View File

@ -2,20 +2,22 @@ import { Injectable, Inject } from '@angular/core';
import { import {
ModuleConfig, ModuleConfig,
ProtocolService as UcapProtocolService ProtocolService as UCAPProtocolService
} from '@ucap/protocol'; } from '@ucap/protocol';
import { LogService } from '@ucap/ng-logger'; import { LogService } from '@ucap/ng-logger';
import { WebSocketService } from '@ucap/ng-web-socket';
import { _MODULE_CONFIG } from '../config/token'; import { _MODULE_CONFIG } from '../config/token';
@Injectable({ @Injectable({
providedIn: 'root' providedIn: 'root'
}) })
export class ProtocolService extends UcapProtocolService { export class ProtocolService extends UCAPProtocolService {
constructor( constructor(
@Inject(_MODULE_CONFIG) moduleConfig: ModuleConfig, @Inject(_MODULE_CONFIG) moduleConfig: ModuleConfig,
webSocketService: WebSocketService,
logService: LogService logService: LogService
) { ) {
super(moduleConfig, logService); super(moduleConfig, webSocketService, logService);
} }
} }

View File

@ -0,0 +1,24 @@
# WebStorage
This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 9.0.2.
## Code scaffolding
Run `ng generate component component-name --project web-storage` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project web-storage`.
> Note: Don't forget to add `--project web-storage` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build web-storage` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build web-storage`, go to the dist folder `cd dist/web-storage` and run `npm publish`.
## Running unit tests
Run `ng test web-storage` to execute the unit tests via [Karma](https://karma-runner.github.io).
## Further help
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI README](https://github.com/angular/angular-cli/blob/master/README.md).

View File

@ -0,0 +1,32 @@
// Karma configuration file, see link for more information
// https://karma-runner.github.io/1.0/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['jasmine', '@angular-devkit/build-angular'],
plugins: [
require('karma-jasmine'),
require('karma-chrome-launcher'),
require('karma-jasmine-html-reporter'),
require('karma-coverage-istanbul-reporter'),
require('@angular-devkit/build-angular/plugins/karma')
],
client: {
clearContext: false // leave Jasmine Spec Runner output visible in browser
},
coverageIstanbulReporter: {
dir: require('path').join(__dirname, '../../coverage/web-storage'),
reports: ['html', 'lcovonly', 'text-summary'],
fixWebpackSourcePaths: true
},
reporters: ['progress', 'kjhtml'],
port: 9876,
colors: true,
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['Chrome'],
singleRun: false,
restartOnFileChange: true
});
};

View File

@ -0,0 +1,11 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/web-socket",
"lib": {
"entryFile": "src/public-api.ts",
"umdModuleIds": {
"@ucap/ng-logger": "@ucap/ng-logger",
"@ucap/web-socket": "@ucap/web-socket"
}
}
}

View File

@ -0,0 +1,13 @@
{
"name": "@ucap/ng-web-socket",
"version": "0.0.1",
"publishConfig": {
"registry": "http://10.81.13.221:8081/nexus/repository/npm-ucap/"
},
"peerDependencies": {
"@angular/common": "^9.0.2",
"@angular/core": "^9.0.2",
"@ucap/web-socket": "~0.0.1",
"tslib": "^1.10.0"
}
}

View File

@ -0,0 +1,5 @@
import { InjectionToken } from '@angular/core';
export const _MODULE_CONFIG = new InjectionToken(
'@ucap/ng-web-socket config of module'
);

View File

@ -0,0 +1,12 @@
import { TestBed } from '@angular/core/testing';
import { WebSocketService } from './web-socket.service';
describe('WebSocketService', () => {
beforeEach(() => TestBed.configureTestingModule({}));
it('should be created', () => {
const service: WebSocketService = TestBed.inject(WebSocketService);
expect(service).toBeTruthy();
});
});

View File

@ -0,0 +1,22 @@
import { Injectable, Inject } from '@angular/core';
import {
ModuleConfig,
WebSocketService as UCAPWebSocketService
} from '@ucap/web-socket';
import { LogService } from '@ucap/ng-logger';
import { _MODULE_CONFIG } from '../config/token';
@Injectable({
providedIn: 'root'
})
export class WebSocketService extends UCAPWebSocketService {
constructor(
@Inject(_MODULE_CONFIG) moduleConfig: ModuleConfig,
logService: LogService
) {
super(moduleConfig, logService);
}
}

View File

@ -0,0 +1,24 @@
import { NgModule, ModuleWithProviders } from '@angular/core';
import { ModuleConfig } from '@ucap/web-storage';
import { _MODULE_CONFIG } from './config/token';
import { WebSocketService } from './services/web-socket.service';
const SERVICES = [WebSocketService];
@NgModule({})
export class WebSocketRootModule {}
@NgModule({})
export class WebSocketModule {
public static forRoot(
config: ModuleConfig
): ModuleWithProviders<WebSocketRootModule> {
return {
ngModule: WebSocketRootModule,
providers: [{ provide: _MODULE_CONFIG, useValue: config }, ...SERVICES]
};
}
}

View File

@ -0,0 +1,7 @@
/*
* Public API Surface of web-socket
*/
export * from './lib/services/web-socket.service';
export * from './lib/web-storage.module';

View File

@ -0,0 +1,30 @@
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
import 'zone.js/dist/zone';
import 'zone.js/dist/zone-testing';
import { getTestBed } from '@angular/core/testing';
import {
BrowserDynamicTestingModule,
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';
declare const require: {
context(
path: string,
deep?: boolean,
filter?: RegExp
): {
keys(): string[];
<T>(id: string): T;
};
};
// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

View File

@ -0,0 +1,17 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/lib",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"exclude": ["src/test.ts", "**/*.spec.ts"]
}

View File

@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}

View File

@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"outDir": "../../out-tsc/spec",
"types": ["jasmine", "node"]
},
"files": ["src/test.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}

View File

@ -0,0 +1,7 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "lib", "camelCase"],
"component-selector": [true, "element", "lib", "kebab-case"]
}
}

View File

@ -12,22 +12,14 @@
"importHelpers": true, "importHelpers": true,
"esModuleInterop": true, "esModuleInterop": true,
"target": "es2015", "target": "es2015",
"typeRoots": [ "typeRoots": ["node_modules/@types"],
"node_modules/@types" "lib": ["es2018", "dom"],
],
"lib": [
"es2018",
"dom"
],
"paths": { "paths": {
"ui-skin-default": [ "ui-skin-default": [
"dist/ui-skin-default/ui-skin-default", "dist/ui-skin-default/ui-skin-default",
"dist/ui-skin-default" "dist/ui-skin-default"
], ],
"logger": [ "logger": ["dist/logger/logger", "dist/logger"]
"dist/logger/logger",
"dist/logger"
]
} }
}, },
"angularCompilerOptions": { "angularCompilerOptions": {