Skip to content

Commit d4348f2

Browse files
DanieliverantDaniel Liverant
andauthored
feat(ui): create lib & move scss (#77)
Co-authored-by: Daniel Liverant <daniel.liverant@hibob.com>
1 parent c89acbd commit d4348f2

26 files changed

+1885
-717
lines changed

apps/cli-gui/project.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
"styles": ["apps/cli-gui/src/styles.scss"],
2020
"scripts": [],
2121
"stylePreprocessorOptions": {
22-
"includePaths": ["apps/cli-gui/src/styles"]
22+
"includePaths": ["libs/ui/src/lib"]
2323
}
2424
},
2525
"configurations": {

apps/cli-gui/src/styles.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
/* You can add global styles to this file, and also import other style files */
2-
@import './styles/material';
3-
@import './styles/core/reset';
4-
@import './styles/core/variables';
2+
@import 'ui-styles';
53

64
html,
75
body {
@@ -12,3 +10,5 @@ body {
1210
margin: 0;
1311
font-family: Roboto, 'Helvetica Neue', sans-serif;
1412
}
13+
14+
@include material-theme();

apps/cli-gui/src/styles/material/core.scss

Lines changed: 0 additions & 5 deletions
This file was deleted.

apps/cli-gui/src/styles/material/index.scss

Lines changed: 0 additions & 1 deletion
This file was deleted.

libs/ui/.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+
"rules": {
8+
"@angular-eslint/directive-selector": [
9+
"error",
10+
{
11+
"type": "attribute",
12+
"prefix": "cli",
13+
"style": "camelCase"
14+
}
15+
],
16+
"@angular-eslint/component-selector": [
17+
"error",
18+
{
19+
"type": "element",
20+
"prefix": "cli",
21+
"style": "kebab-case"
22+
}
23+
]
24+
},
25+
"extends": [
26+
"plugin:@nrwl/nx/angular",
27+
"plugin:@angular-eslint/template/process-inline-templates"
28+
]
29+
},
30+
{
31+
"files": ["*.html"],
32+
"extends": ["plugin:@nrwl/nx/angular-template"],
33+
"rules": {}
34+
}
35+
]
36+
}

libs/ui/README.md

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

libs/ui/jest.config.ts

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

libs/ui/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/ui",
4+
"lib": {
5+
"entryFile": "src/index.ts"
6+
}
7+
}

libs/ui/package.json

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

libs/ui/project.json

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

0 commit comments

Comments
 (0)