Skip to content

Commit

Permalink
feat(ngx-pipes): start work to bring in ngx-pipes
Browse files Browse the repository at this point in the history
feat(ng2-search-filter): inital work for ng2-search-filter

Signed-off-by: Jordan Hall <[email protected]>
  • Loading branch information
Jordan-Hall committed Mar 19, 2024
1 parent 511d90a commit ea23492
Show file tree
Hide file tree
Showing 29 changed files with 431 additions and 0 deletions.
43 changes: 43 additions & 0 deletions angular-pkgs/ng2-search-filter/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"extends": ["../../.eslintrc.base.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "ngxMaintenance",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "ngx-maintenance",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
7 changes: 7 additions & 0 deletions angular-pkgs/ng2-search-filter/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ng2-search-filter

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

## Running unit tests

Run `nx test ng2-search-filter` to execute the unit tests.
22 changes: 22 additions & 0 deletions angular-pkgs/ng2-search-filter/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'ng2-search-filter',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/angular-pkgs/ng2-search-filter',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
7 changes: 7 additions & 0 deletions angular-pkgs/ng2-search-filter/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/angular-pkgs/ng2-search-filter",
"lib": {
"entryFile": "src/index.ts"
}
}
12 changes: 12 additions & 0 deletions angular-pkgs/ng2-search-filter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@ngx-maintenance/ng2-search-filter",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^17.1.0",
"@angular/core": "^17.1.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"sideEffects": false
}
26 changes: 26 additions & 0 deletions angular-pkgs/ng2-search-filter/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "ng2-search-filter",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "angular-pkgs/ng2-search-filter/src",
"prefix": "ngx-maintenance",
"tags": [],
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {
"project": "angular-pkgs/ng2-search-filter/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "angular-pkgs/ng2-search-filter/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "angular-pkgs/ng2-search-filter/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
}
}
}
1 change: 1 addition & 0 deletions angular-pkgs/ng2-search-filter/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/ng2-search-filter/ng2-search-filter.component';
8 changes: 8 additions & 0 deletions angular-pkgs/ng2-search-filter/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
};
import 'jest-preset-angular/setup-jest';
29 changes: 29 additions & 0 deletions angular-pkgs/ng2-search-filter/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"compilerOptions": {
"target": "es2022",
"useDefineForClassFields": false,
"forceConsistentCasingInFileNames": true,
"strict": true,
"noImplicitOverride": true,
"noPropertyAccessFromIndexSignature": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true
},
"files": [],
"include": [],
"references": [
{
"path": "./tsconfig.lib.json"
},
{
"path": "./tsconfig.spec.json"
}
],
"extends": "../../tsconfig.base.json",
"angularCompilerOptions": {
"enableI18nLegacyMessageIdFormat": false,
"strictInjectionParameters": true,
"strictInputAccessModifiers": true,
"strictTemplates": true
}
}
17 changes: 17 additions & 0 deletions angular-pkgs/ng2-search-filter/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",
"declaration": true,
"declarationMap": true,
"inlineSources": true,
"types": []
},
"exclude": [
"src/**/*.spec.ts",
"src/test-setup.ts",
"jest.config.ts",
"src/**/*.test.ts"
],
"include": ["src/**/*.ts"]
}
9 changes: 9 additions & 0 deletions angular-pkgs/ng2-search-filter/tsconfig.lib.prod.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "./tsconfig.lib.json",
"compilerOptions": {
"declarationMap": false
},
"angularCompilerOptions": {
"compilationMode": "partial"
}
}
16 changes: 16 additions & 0 deletions angular-pkgs/ng2-search-filter/tsconfig.spec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": "../../dist/out-tsc",
"module": "commonjs",
"target": "es2016",
"types": ["jest", "node"]
},
"files": ["src/test-setup.ts"],
"include": [
"jest.config.ts",
"src/**/*.test.ts",
"src/**/*.spec.ts",
"src/**/*.d.ts"
]
}
43 changes: 43 additions & 0 deletions angular-pkgs/ngx-pipes/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"extends": ["../../.eslintrc.base.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"extends": [
"plugin:@nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "ngxMaintenance",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "ngx-maintenance",
"style": "kebab-case"
}
]
}
},
{
"files": ["*.html"],
"extends": ["plugin:@nx/angular-template"],
"rules": {}
},
{
"files": ["*.json"],
"parser": "jsonc-eslint-parser",
"rules": {
"@nx/dependency-checks": "error"
}
}
]
}
7 changes: 7 additions & 0 deletions angular-pkgs/ngx-pipes/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ngx-pipes

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

## Running unit tests

Run `nx test ngx-pipes` to execute the unit tests.
22 changes: 22 additions & 0 deletions angular-pkgs/ngx-pipes/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'ngx-pipes',
preset: '../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../coverage/angular-pkgs/ngx-pipes',
transform: {
'^.+\\.(ts|mjs|js|html)$': [
'jest-preset-angular',
{
tsconfig: '<rootDir>/tsconfig.spec.json',
stringifyContentPathRegex: '\\.(html|svg)$',
},
],
},
transformIgnorePatterns: ['node_modules/(?!.*\\.mjs$)'],
snapshotSerializers: [
'jest-preset-angular/build/serializers/no-ng-attributes',
'jest-preset-angular/build/serializers/ng-snapshot',
'jest-preset-angular/build/serializers/html-comment',
],
};
7 changes: 7 additions & 0 deletions angular-pkgs/ngx-pipes/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/angular-pkgs/ngx-pipes",
"lib": {
"entryFile": "src/index.ts"
}
}
12 changes: 12 additions & 0 deletions angular-pkgs/ngx-pipes/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@ngx-maintenance/ngx-pipes",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^17.1.0",
"@angular/core": "^17.1.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"sideEffects": false
}
26 changes: 26 additions & 0 deletions angular-pkgs/ngx-pipes/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "ngx-pipes",
"$schema": "../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "angular-pkgs/ngx-pipes/src",
"prefix": "ngx-maintenance",
"tags": [],
"projectType": "library",
"targets": {
"build": {
"executor": "@nx/angular:package",
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {
"project": "angular-pkgs/ngx-pipes/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "angular-pkgs/ngx-pipes/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "angular-pkgs/ngx-pipes/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
}
}
}
1 change: 1 addition & 0 deletions angular-pkgs/ngx-pipes/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/ngx-pipes/ngx-pipes.component';
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<p>ngx-pipes works!</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { ComponentFixture, TestBed } from '@angular/core/testing';
import { NgxPipesComponent } from './ngx-pipes.component';

describe('NgxPipesComponent', () => {
let component: NgxPipesComponent;
let fixture: ComponentFixture<NgxPipesComponent>;

beforeEach(async () => {
await TestBed.configureTestingModule({
imports: [NgxPipesComponent],
}).compileComponents();

fixture = TestBed.createComponent(NgxPipesComponent);
component = fixture.componentInstance;
fixture.detectChanges();
});

it('should create', () => {
expect(component).toBeTruthy();
});
});
11 changes: 11 additions & 0 deletions angular-pkgs/ngx-pipes/src/lib/ngx-pipes/ngx-pipes.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';

@Component({
selector: 'ngx-maintenance-ngx-pipes',
standalone: true,
imports: [CommonModule],
templateUrl: './ngx-pipes.component.html',
styleUrl: './ngx-pipes.component.css',
})
export class NgxPipesComponent {}
8 changes: 8 additions & 0 deletions angular-pkgs/ngx-pipes/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// @ts-expect-error https://thymikee.github.io/jest-preset-angular/docs/getting-started/test-environment
globalThis.ngJest = {
testEnvironmentOptions: {
errorOnUnknownElements: true,
errorOnUnknownProperties: true,
},
};
import 'jest-preset-angular/setup-jest';
Loading

0 comments on commit ea23492

Please sign in to comment.