Skip to content

Commit

Permalink
feat: lib added with nx
Browse files Browse the repository at this point in the history
  • Loading branch information
udayvunnam committed Jul 19, 2020
1 parent 0e12c35 commit 2c7d3bc
Show file tree
Hide file tree
Showing 17 changed files with 751 additions and 26 deletions.
40 changes: 40 additions & 0 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,46 @@
}
}
}
},
"xng-breadcrumb": {
"projectType": "library",
"root": "libs/xng-breadcrumb",
"sourceRoot": "libs/xng-breadcrumb/src",
"prefix": "xng",
"architect": {
"build": {
"builder": "@nrwl/angular:package",
"options": {
"tsConfig": "libs/xng-breadcrumb/tsconfig.lib.json",
"project": "libs/xng-breadcrumb/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/xng-breadcrumb/tsconfig.lib.prod.json"
}
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"libs/xng-breadcrumb/tsconfig.lib.json",
"libs/xng-breadcrumb/tsconfig.spec.json"
],
"exclude": ["**/node_modules/**", "!libs/xng-breadcrumb/**/*"]
}
},
"test": {
"builder": "@nrwl/jest:jest",
"options": {
"jestConfig": "libs/xng-breadcrumb/jest.config.js",
"tsConfig": "libs/xng-breadcrumb/tsconfig.spec.json",
"passWithNoTests": true,
"setupFile": "libs/xng-breadcrumb/src/test-setup.ts"
}
}
},
"schematics": {}
}
},
"cli": {
Expand Down
7 changes: 7 additions & 0 deletions libs/xng-breadcrumb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# xng-breadcrumb

This library was generated with [Nx](https://nx.dev).

## Running unit tests

Run `nx test xng-breadcrumb` to execute the unit tests.
10 changes: 10 additions & 0 deletions libs/xng-breadcrumb/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
name: 'xng-breadcrumb',
preset: '../../jest.config.js',
coverageDirectory: '../../coverage/libs/xng-breadcrumb',
snapshotSerializers: [
'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js',
'jest-preset-angular/build/AngularSnapshotSerializer.js',
'jest-preset-angular/build/HTMLCommentSerializer.js',
],
};
7 changes: 7 additions & 0 deletions libs/xng-breadcrumb/ng-package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
"dest": "../../dist/libs/xng-breadcrumb",
"lib": {
"entryFile": "src/index.ts"
}
}
9 changes: 9 additions & 0 deletions libs/xng-breadcrumb/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"name": "@xng/xng-breadcrumb",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^9.1.0",
"@angular/core": "^9.1.0",
"tslib": "^1.10.0"
}
}
1 change: 1 addition & 0 deletions libs/xng-breadcrumb/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/xng-breadcrumb.module';
7 changes: 7 additions & 0 deletions libs/xng-breadcrumb/src/lib/xng-breadcrumb.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

@NgModule({
imports: [CommonModule],
})
export class XngBreadcrumbModule {}
1 change: 1 addition & 0 deletions libs/xng-breadcrumb/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'jest-preset-angular';
7 changes: 7 additions & 0 deletions libs/xng-breadcrumb/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"types": ["node", "jest"]
},
"include": ["**/*.ts"]
}
17 changes: 17 additions & 0 deletions libs/xng-breadcrumb/tsconfig.lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"target": "es2015",
"declaration": true,
"inlineSources": true,
"types": [],
"lib": ["dom", "es2018"]
},
"angularCompilerOptions": {
"skipTemplateCodegen": true,
"strictMetadataEmit": true,
"enableResourceInlining": true
},
"exclude": ["src/test-setup.ts", "**/*.spec.ts"]
}
6 changes: 6 additions & 0 deletions libs/xng-breadcrumb/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "./tsconfig.lib.json",
"angularCompilerOptions": {
"enableIvy": false
}
}
10 changes: 10 additions & 0 deletions libs/xng-breadcrumb/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": ["**/*.spec.ts", "**/*.d.ts"]
}
10 changes: 10 additions & 0 deletions libs/xng-breadcrumb/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"extends": "../../tslint.json",
"rules": {
"directive-selector": [true, "attribute", "xng", "camelCase"],
"component-selector": [true, "element", "xng", "kebab-case"]
},
"linterOptions": {
"exclude": ["!**/*"]
}
}
3 changes: 3 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
"breadcrumb-demo-e2e": {
"tags": [],
"implicitDependencies": ["breadcrumb-demo"]
},
"xng-breadcrumb": {
"tags": ["xng-breadcrumb"]
}
}
}
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@
"@angular/platform-browser-dynamic": "^9.1.0",
"@angular/router": "^9.1.0",
"rxjs": "~6.5.4",
"tslib": "^1.10.0",
"zone.js": "^0.10.2"
},
"devDependencies": {
"@angular-devkit/build-ng-packagr": "~0.901.0",
"@angular/cli": "9.1.0",
"@nrwl/workspace": "9.5.1",
"@types/node": "~8.9.4",
"dotenv": "6.2.0",
"ng-packagr": "^9.0.0",
"ts-node": "~7.0.0",
"tslint": "~6.0.0",
"eslint": "6.8.0",
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@
"skipLibCheck": true,
"skipDefaultLibCheck": true,
"baseUrl": ".",
"paths": {}
"paths": {
"@xng/xng-breadcrumb": ["libs/xng-breadcrumb/src/index.ts"]
}
},
"exclude": ["node_modules", "tmp"]
}
Loading

0 comments on commit 2c7d3bc

Please sign in to comment.