Skip to content

Commit 60fce74

Browse files
committed
chore: added shared models
1 parent 5e11f63 commit 60fce74

File tree

13 files changed

+146
-0
lines changed

13 files changed

+146
-0
lines changed

angular.json

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,31 @@
183183
}
184184
}
185185
}
186+
},
187+
"shared-util-models": {
188+
"projectType": "library",
189+
"root": "libs/shared/util-models",
190+
"sourceRoot": "libs/shared/util-models/src",
191+
"prefix": "pt-starter",
192+
"architect": {
193+
"lint": {
194+
"builder": "@nrwl/linter:eslint",
195+
"options": {
196+
"lintFilePatterns": [
197+
"libs/shared/util-models/src/**/*.ts",
198+
"libs/shared/util-models/src/**/*.html"
199+
]
200+
}
201+
},
202+
"test": {
203+
"builder": "@angular-devkit/build-angular:karma",
204+
"options": {
205+
"main": "libs/shared/util-models/src/test.ts",
206+
"tsConfig": "libs/shared/util-models/tsconfig.spec.json",
207+
"karmaConfig": "libs/shared/util-models/karma.conf.js"
208+
}
209+
}
210+
}
186211
}
187212
},
188213
"cli": {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"extends":["../../../.eslintrc.json"],"ignorePatterns":["!**/*"],"overrides":[{"files":["*.ts"],"extends":["plugin:@nrwl/nx/angular","plugin:@angular-eslint/template/process-inline-templates"],"parserOptions":{"project":["libs/shared/util-models/tsconfig.*?.json"]},"rules":{"@angular-eslint/directive-selector":["error",{"type":"attribute","prefix":"ptStarter","style":"camelCase"}],"@angular-eslint/component-selector":["error",{"type":"element","prefix":"pt-starter","style":"kebab-case"}]}},{"files":["*.html"],"extends":["plugin:@nrwl/nx/angular-template"],"rules":{}}]}

libs/shared/util-models/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# shared-util-models
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
6+
## Running unit tests
7+
8+
Run `nx test shared-util-models` to execute the unit tests.
9+
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Karma configuration file, see link for more information
2+
// https://karma-runner.github.io/1.0/config/configuration-file.html
3+
4+
const { join } = require('path');
5+
const getBaseKarmaConfig = require('../../../karma.conf');
6+
7+
module.exports = function(config) {
8+
const baseConfig = getBaseKarmaConfig();
9+
config.set({
10+
...baseConfig,
11+
coverageIstanbulReporter: {
12+
...baseConfig.coverageIstanbulReporter,
13+
dir: join(__dirname, '../../../coverage/libs/shared/util-models')
14+
}
15+
});
16+
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
2+
export * from './lib/shared-util-models.module';
3+
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './user';
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export interface User {
2+
id: string;
3+
email: string;
4+
name?: string;
5+
permissions: [];
6+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// This file is required by karma.conf.js and loads recursively all the .spec and framework files
2+
3+
import 'zone.js/dist/zone';
4+
5+
import 'zone.js/dist/zone-testing';
6+
import { getTestBed } from '@angular/core/testing';
7+
import {
8+
BrowserDynamicTestingModule,
9+
platformBrowserDynamicTesting
10+
} from '@angular/platform-browser-dynamic/testing';
11+
12+
declare const require: any;
13+
14+
// First, initialize the Angular testing environment.
15+
getTestBed().initTestEnvironment(
16+
BrowserDynamicTestingModule,
17+
platformBrowserDynamicTesting()
18+
);
19+
// Then we find all the tests.
20+
const context = require.context('./', true, /\.spec\.ts$/);
21+
// And load the modules.
22+
context.keys().map(context);
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"extends": "../../../tsconfig.base.json",
3+
"files": [],
4+
"include": [],
5+
"references": [
6+
{
7+
"path": "./tsconfig.lib.json"
8+
},
9+
{
10+
"path": "./tsconfig.spec.json"
11+
}
12+
]
13+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../../../dist/out-tsc",
5+
"target": "es2015",
6+
"declaration": true,
7+
"declarationMap": true,
8+
"inlineSources": true,
9+
"types": [],
10+
"lib": [
11+
"dom",
12+
"es2018"
13+
]
14+
},
15+
"angularCompilerOptions": {
16+
"skipTemplateCodegen": true,
17+
"strictMetadataEmit": true,
18+
"enableResourceInlining": true
19+
},
20+
"exclude": [
21+
"src/test.ts",
22+
"**/*.spec.ts"
23+
],
24+
"include": [
25+
"**/*.ts"
26+
]
27+
}

0 commit comments

Comments
 (0)