project initialized

This commit is contained in:
richard-loafle
2020-03-27 17:39:01 +09:00
commit b39312afb8
664 changed files with 38721 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
# ProtocolFile
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 protocol-file` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project protocol-file`.
> Note: Don't forget to add `--project protocol-file` or else it will be added to the default project in your `angular.json` file.
## Build
Run `ng build protocol-file` to build the project. The build artifacts will be stored in the `dist/` directory.
## Publishing
After building your library with `ng build protocol-file`, go to the dist folder `cd dist/protocol-file` and run `npm publish`.
## Running unit tests
Run `ng test protocol-file` 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/protocol-file'),
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/protocol-file",
"lib": {
"entryFile": "src/public-api.ts",
"umdModuleIds": {
"@ucap/protocol-file": "@ucap/protocol-file",
"@ucap/ng-protocol": "@ucap/ng-protocol"
}
}
}

View File

@@ -0,0 +1,15 @@
{
"name": "@ucap/ng-protocol-file",
"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/protocol-file": "~0.0.1",
"@ucap/ng-protocol": "~0.0.1",
"rxjs": "~6.5.4",
"tslib": "^1.10.0"
}
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,14 @@
import { Injectable } from '@angular/core';
import { FileProtocolService as UcapFileProtocolService } from '@ucap/protocol-file';
import { ProtocolService } from '@ucap/ng-protocol';
@Injectable({
providedIn: 'root'
})
export class FileProtocolService extends UcapFileProtocolService {
constructor(protocolService: ProtocolService) {
super(protocolService);
}
}

View File

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

View File

@@ -0,0 +1,26 @@
// 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,23 @@
{
"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,17 @@
{
"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,17 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [
true,
"attribute",
"lib",
"camelCase"
],
"component-selector": [
true,
"element",
"lib",
"kebab-case"
]
}
}