Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds buildable library - ui-kit/core #271

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ testem.log
# System Files
.DS_Store
Thumbs.db

.angular
2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Add files here to ignore them from prettier formatting

.angular
36 changes: 36 additions & 0 deletions libs/ui-kit/core/core/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"extends": ["../../../../.eslintrc.json"],
"ignorePatterns": ["!**/*"],
"overrides": [
{
"files": ["*.ts"],
"rules": {
"@angular-eslint/directive-selector": [
"error",
{
"type": "attribute",
"prefix": "uiKit",
"style": "camelCase"
}
],
"@angular-eslint/component-selector": [
"error",
{
"type": "element",
"prefix": "ui-kit",
"style": "kebab-case"
}
]
},
"extends": [
"plugin:@nrwl/nx/angular",
"plugin:@angular-eslint/template/process-inline-templates"
]
},
{
"files": ["*.html"],
"extends": ["plugin:@nrwl/nx/angular-template"],
"rules": {}
}
]
}
7 changes: 7 additions & 0 deletions libs/ui-kit/core/core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ui-kit-core-core

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

## Running unit tests

Run `nx test ui-kit-core-core` to execute the unit tests.
22 changes: 22 additions & 0 deletions libs/ui-kit/core/core/jest.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* eslint-disable */
export default {
displayName: 'ui-kit-core-core',
preset: '../../../../jest.preset.js',
setupFilesAfterEnv: ['<rootDir>/src/test-setup.ts'],
coverageDirectory: '../../../../coverage/libs/ui-kit/core/core',
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 libs/ui-kit/core/core/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/ui-kit/core/core",
"lib": {
"entryFile": "src/index.ts"
}
}
12 changes: 12 additions & 0 deletions libs/ui-kit/core/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@ui-kit/core",
"version": "0.0.1",
"peerDependencies": {
"@angular/common": "^15.2.0",
"@angular/core": "^15.2.0"
},
"dependencies": {
"tslib": "^2.3.0"
},
"sideEffects": false
}
50 changes: 50 additions & 0 deletions libs/ui-kit/core/core/project.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
{
"name": "ui-kit-core-core",
"$schema": "../../../../node_modules/nx/schemas/project-schema.json",
"sourceRoot": "libs/ui-kit/core/core/src",
"prefix": "ui-kit",
"tags": [],
"projectType": "library",
"targets": {
"build": {
"executor": "@nrwl/angular:package",
"outputs": ["{workspaceRoot}/dist/{projectRoot}"],
"options": {
"project": "libs/ui-kit/core/core/ng-package.json"
},
"configurations": {
"production": {
"tsConfig": "libs/ui-kit/core/core/tsconfig.lib.prod.json"
},
"development": {
"tsConfig": "libs/ui-kit/core/core/tsconfig.lib.json"
}
},
"defaultConfiguration": "production"
},
"test": {
"executor": "@nrwl/jest:jest",
"outputs": ["{workspaceRoot}/coverage/{projectRoot}"],
"options": {
"jestConfig": "libs/ui-kit/core/core/jest.config.ts",
"passWithNoTests": true
},
"configurations": {
"ci": {
"ci": true,
"codeCoverage": true
}
}
},
"lint": {
"executor": "@nrwl/linter:eslint",
"outputs": ["{options.outputFile}"],
"options": {
"lintFilePatterns": [
"libs/ui-kit/core/core/**/*.ts",
"libs/ui-kit/core/core/**/*.html"
]
}
}
}
}
1 change: 1 addition & 0 deletions libs/ui-kit/core/core/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib/ui-kit-core-core.module';
10 changes: 10 additions & 0 deletions libs/ui-kit/core/core/src/lib/ui-kit-core-core.module.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { UiKitCoreCoreModule as UiKitNoCore } from '@ui-kit/core';

console.log(UiKitNoCore);

@NgModule({
imports: [CommonModule],
})
export class UiKitCoreCoreModule {}
1 change: 1 addition & 0 deletions libs/ui-kit/core/core/src/test-setup.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import 'jest-preset-angular/setup-jest';
29 changes: 29 additions & 0 deletions libs/ui-kit/core/core/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 libs/ui-kit/core/core/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 libs/ui-kit/core/core/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 libs/ui-kit/core/core/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"
]
}
6 changes: 6 additions & 0 deletions nx.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,22 @@
},
"generators": {
"@nrwl/angular:application": {
"style": "css",
"linter": "eslint",
"unitTestRunner": "jest",
"e2eTestRunner": "cypress"
},
"@nrwl/angular:library": {
"linter": "eslint",
"unitTestRunner": "jest"
},
"@nrwl/angular": {
"convert-tslint-to-eslint": {
"removeTSLintIfNoMoreTSLintTargets": true
}
},
"@nrwl/angular:component": {
"style": "css"
}
},
"defaultProject": "products",
Expand Down
Loading