Skip to content

Commit 57a78df

Browse files
committed
chore(angular-jss): init new library angular-jss
1 parent 3b47144 commit 57a78df

18 files changed

+1033
-33
lines changed

libs/angular-jss/.browserslistrc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# This file is used by the build system to adjust CSS and JS output to support the specified browsers below.
2+
# For additional information regarding the format and rule options, please see:
3+
# https://github.com/browserslist/browserslist#queries
4+
5+
# For the full list of supported browsers by the Angular framework, please see:
6+
# https://angular.io/guide/browser-support
7+
8+
# You can see what browsers were selected by your queries by running:
9+
# npx browserslist
10+
11+
last 1 Chrome version
12+
last 1 Firefox version
13+
last 2 Edge major versions
14+
last 2 Safari major versions
15+
last 2 iOS major versions
16+
Firefox ESR

libs/angular-jss/.eslintrc.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"extends": ["../../.eslintrc.json"],
3+
"ignorePatterns": ["!**/*"],
4+
"overrides": [
5+
{
6+
"files": ["*.ts"],
7+
"extends": [
8+
"plugin:@nrwl/nx/angular",
9+
"plugin:@angular-eslint/template/process-inline-templates"
10+
],
11+
"rules": {
12+
"@angular-eslint/directive-selector": [
13+
"error",
14+
{
15+
"type": "attribute",
16+
"prefix": "ngJss",
17+
"style": "camelCase"
18+
}
19+
],
20+
"@angular-eslint/component-selector": [
21+
"error",
22+
{
23+
"type": "element",
24+
"prefix": "ng-jss",
25+
"style": "kebab-case"
26+
}
27+
]
28+
}
29+
},
30+
{
31+
"files": ["*.html"],
32+
"extends": ["plugin:@nrwl/nx/angular-template"],
33+
"rules": {}
34+
}
35+
]
36+
}

libs/angular-jss/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# angular-jss
2+
3+
This library was generated with [Nx](https://nx.dev).
4+
5+
## Running unit tests
6+
7+
Run `nx test angular-jss` to execute the unit tests.

libs/angular-jss/jest.config.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
module.exports = {
2+
displayName: 'angular-jss',
3+
preset: '../../jest.preset.js',
4+
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
5+
globals: {
6+
'ts-jest': {
7+
tsconfig: '<rootDir>/tsconfig.spec.json',
8+
stringifyContentPathRegex: '\\.(html|svg)$',
9+
},
10+
},
11+
coverageDirectory: '../../coverage/libs/angular-jss',
12+
transform: {
13+
'^.+\\.(ts|mjs|js|html)$': 'jest-preset-angular',
14+
},
15+
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
16+
snapshotSerializers: [
17+
'jest-preset-angular/build/serializers/no-ng-attributes',
18+
'jest-preset-angular/build/serializers/ng-snapshot',
19+
'jest-preset-angular/build/serializers/html-comment',
20+
],
21+
};

libs/angular-jss/ng-package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3+
"dest": "../../dist/libs/angular-jss",
4+
"lib": {
5+
"entryFile": "src/index.ts"
6+
}
7+
}

libs/angular-jss/package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"name": "@design4pro/angular-jss",
3+
"version": "0.0.1",
4+
"peerDependencies": {
5+
"@angular/common": "^13.2.0",
6+
"@angular/core": "^13.2.0"
7+
},
8+
"dependencies": {
9+
"tslib": "^2.3.0"
10+
}
11+
}

libs/angular-jss/project.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"projectType": "library",
3+
"root": "libs/angular-jss",
4+
"sourceRoot": "libs/angular-jss/src",
5+
"prefix": "ng-jss",
6+
"targets": {
7+
"build": {
8+
"executor": "@nrwl/angular:package",
9+
"outputs": ["dist/libs/angular-jss"],
10+
"options": {
11+
"project": "libs/angular-jss/ng-package.json"
12+
},
13+
"configurations": {
14+
"production": {
15+
"tsConfig": "libs/angular-jss/tsconfig.lib.prod.json"
16+
},
17+
"development": {
18+
"tsConfig": "libs/angular-jss/tsconfig.lib.json"
19+
}
20+
},
21+
"defaultConfiguration": "production"
22+
},
23+
"test": {
24+
"executor": "@nrwl/jest:jest",
25+
"outputs": ["coverage/libs/angular-jss"],
26+
"options": {
27+
"jestConfig": "libs/angular-jss/jest.config.js",
28+
"passWithNoTests": true
29+
}
30+
},
31+
"lint": {
32+
"executor": "@nrwl/linter:eslint",
33+
"options": {
34+
"lintFilePatterns": [
35+
"libs/angular-jss/src/**/*.ts",
36+
"libs/angular-jss/src/**/*.html"
37+
]
38+
}
39+
}
40+
},
41+
"tags": ["angular-jss"]
42+
}

libs/angular-jss/src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './lib/angular-jss.module';
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { async, TestBed } from '@angular/core/testing';
2+
import { AngularJssModule } from './angular-jss.module';
3+
4+
describe('AngularJssModule', () => {
5+
beforeEach(async(() => {
6+
TestBed.configureTestingModule({
7+
imports: [AngularJssModule],
8+
}).compileComponents();
9+
}));
10+
11+
// TODO: Add real tests here.
12+
//
13+
// NB: This particular test does not do anything useful.
14+
// It does NOT check for correct instantiation of the module.
15+
it('should have a module definition', () => {
16+
expect(AngularJssModule).toBeDefined();
17+
});
18+
});
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import { NgModule } from '@angular/core';
2+
import { CommonModule } from '@angular/common';
3+
4+
@NgModule({
5+
imports: [CommonModule],
6+
})
7+
export class AngularJssModule {}

0 commit comments

Comments
 (0)