Skip to content

Commit

Permalink
refactor(utils): split client-util into smaller libraries (#792)
Browse files Browse the repository at this point in the history
- [x] distribute client utils across several libraries;
  • Loading branch information
rfprod authored Nov 18, 2023
1 parent 38234b7 commit 5d1faf2
Show file tree
Hide file tree
Showing 52 changed files with 473 additions and 66 deletions.
18 changes: 9 additions & 9 deletions .eslint/.eslintrc.module-boundaries.backend.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
*/
exports.constraints = [
{
sourceTag: 'scope:server-dev',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:server-dev',
},
{
sourceTag: 'scope:server-prod',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:server-prod',
},
{
sourceTag: 'scope:api',
onlyDependOnLibsWithTags: [
'scope:backend-auth',
'scope:backend-diagnostics',
Expand All @@ -21,29 +20,30 @@ exports.constraints = [
'scope:backend-logger',
'scope:proto',
],
sourceTag: 'scope:api',
},
{
sourceTag: 'scope:backend-auth',
onlyDependOnLibsWithTags: ['scope:backend-interfaces', 'scope:proto'],
sourceTag: 'scope:backend-auth',
},
{
sourceTag: 'scope:backend-diagnostics',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:backend-diagnostics',
},
{
sourceTag: 'scope:backend-grpc',
onlyDependOnLibsWithTags: ['scope:backend-interfaces', 'scope:proto'],
sourceTag: 'scope:backend-grpc',
},
{
sourceTag: 'scope:backend-gql',
onlyDependOnLibsWithTags: ['scope:backend-interfaces'],
sourceTag: 'scope:backend-gql',
},
{
sourceTag: 'scope:backend-interfaces',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:backend-interfaces',
},
{
sourceTag: 'scope:backend-logger',
onlyDependOnLibsWithTags: ['scope:proto'],
sourceTag: 'scope:backend-logger',
},
];
93 changes: 54 additions & 39 deletions .eslint/.eslintrc.module-boundaries.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
*/
exports.constraints = [
{
sourceTag: 'scope:documentation',
onlyDependOnLibsWithTags: [
'scope:client-material',
'scope:client-pwa-offline',
Expand All @@ -12,34 +11,39 @@ exports.constraints = [
'scope:client-service-worker',
'scope:client-util',
'scope:client-util-ngrx',
'scope:client-util-security'
],
sourceTag: 'scope:documentation',
},
{
sourceTag: 'scope:documentation-e2e',
onlyDependOnLibsWithTags: ['scope:client-testing-e2e', 'scope:client-util'],
sourceTag: 'scope:documentation-e2e',
},
{
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-util-animations',
},
{
sourceTag: 'scope:client-testing-unit',
onlyDependOnLibsWithTags: ['scope:client-material', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-testing-unit',
},
{
sourceTag: 'scope:client-testing-e2e',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-testing-e2e',
},
{
sourceTag: 'scope:client-material',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-material',
},
{
sourceTag: 'scope:client-pwa-offline',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-pwa-offline',
},
{
sourceTag: 'scope:client-core',
onlyDependOnLibsWithTags: ['scope:client-store', 'scope:client-util'],
sourceTag: 'scope:client-core',
},
{
sourceTag: 'scope:client-store',
onlyDependOnLibsWithTags: [
'scope:client-store-chatbot',
'scope:client-store-feature-access',
Expand All @@ -53,60 +57,60 @@ exports.constraints = [
'scope:client-util',
'scope:proto',
],
sourceTag: 'scope:client-store',
},
{
sourceTag: 'scope:client-store-chatbot',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-store-chatbot',
},
{
sourceTag: 'scope:client-store-feature-access',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-store-feature-access',
},
{
sourceTag: 'scope:client-store-http-api',
onlyDependOnLibsWithTags: [
'scope:client-store-http-progress',
'scope:client-translate',
'scope:client-testing-unit',
'scope:client-util',
'scope:client-util-ngrx',
],
sourceTag: 'scope:client-store-http-api',
},
{
sourceTag: 'scope:client-store-http-progress',
onlyDependOnLibsWithTags: ['scope:client-translate', 'scope:client-testing-unit', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-store-http-progress',
},
{
sourceTag: 'scope:client-store-router',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-store-router',
},
{
sourceTag: 'scope:client-store-sidebar',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-store-sidebar',
},
{
sourceTag: 'scope:client-store-theme',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-store-theme',
},
{
sourceTag: 'scope:client-store-user',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util', 'scope:client-util-ngrx'],
sourceTag: 'scope:client-store-user',
},
{
sourceTag: 'scope:client-store-diagnostics',
onlyDependOnLibsWithTags: [
'scope:client-store-http-progress',
'scope:client-testing-unit',
'scope:client-util',
'scope:client-util-ngrx',
],
sourceTag: 'scope:client-store-diagnostics',
},
{
sourceTag: 'scope:client-service-worker',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-service-worker',
},
{
sourceTag: 'scope:client-componnents',
onlyDependOnLibsWithTags: [
'scope:client-core',
'scope:client-material',
Expand All @@ -117,45 +121,45 @@ exports.constraints = [
'scope:client-testing-unit',
'scope:client-util',
],
sourceTag: 'scope:client-componnents',
},
{
sourceTag: 'scope:client-dashboards',
onlyDependOnLibsWithTags: ['scope:client-directives', 'scope:client-testing-unit', 'scope:client-util'],
sourceTag: 'scope:client-dashboards',
},
{
sourceTag: 'scope:client-diagnostics',
onlyDependOnLibsWithTags: [
'scope:client-d3-charts',
'scope:client-store-diagnostics',
'scope:client-store-http-api',
'scope:client-store-user',
'scope:client-testing-unit',
],
sourceTag: 'scope:client-diagnostics',
},
{
sourceTag: 'scope:client-diagnostics-e2e',
onlyDependOnLibsWithTags: ['scope:client-testing-e2e', 'scope:client-util'],
sourceTag: 'scope:client-diagnostics-e2e',
},
{
sourceTag: 'scope:client-directives',
onlyDependOnLibsWithTags: ['scope:client-testing-unit'],
sourceTag: 'scope:client-directives',
},
{
sourceTag: 'scope:client-gql',
onlyDependOnLibsWithTags: [
'scope:client-store-http-progress',
'scope:client-store-user',
'scope:client-testing-unit',
'scope:client-util',
'scope:proto',
],
sourceTag: 'scope:client-gql',
},
{
sourceTag: 'scope:client-grpc',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util', 'scope:proto'],
sourceTag: 'scope:client-grpc',
},
{
sourceTag: 'scope:client-chatbot',
onlyDependOnLibsWithTags: [
'scope:client-directives',
'scope:client-material',
Expand All @@ -164,42 +168,50 @@ exports.constraints = [
'scope:client-util-eliza',
'scope:client-testing-unit',
],
sourceTag: 'scope:client-chatbot',
},
{
sourceTag: 'scope:client-d3-charts',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-d3-charts',
},
{
sourceTag: 'scope:client-sidebar',
onlyDependOnLibsWithTags: [
'scope:client-store',
'scope:client-store-http-progress',
'scope:client-store-sidebar',
'scope:client-testing-unit',
],
sourceTag: 'scope:client-sidebar',
},
{
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-util',
},
{
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-util-decorators'
},
{
sourceTag: 'scope:client-util-eliza',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-util-eliza',
},
{
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-util-ngrx',
},
{
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:client-util-security',
},
{
sourceTag: 'scope:client-util-sentry',
onlyDependOnLibsWithTags: ['scope:client-testing-unit', 'scope:client-util'],
sourceTag: 'scope:client-util-sentry',
},
{
sourceTag: 'scope:client-translate',
onlyDependOnLibsWithTags: ['scope:client-material', 'scope:client-util'],
sourceTag: 'scope:client-translate',
},
{
sourceTag: 'scope:client',
onlyDependOnLibsWithTags: [
'scope:client-chatbot',
'scope:client-core',
Expand All @@ -225,47 +237,50 @@ exports.constraints = [
'scope:client-util',
'scope:client-util-eliza',
'scope:client-util-ngrx',
'scope:client-util-security',
'scope:client-util-sentry',
],
sourceTag: 'scope:client',
},
{
sourceTag: 'scope:client-core-components',
onlyDependOnLibsWithTags: [
'scope:client-material',
'scope:client-store-feature-access',
'scope:client-store-sidebar',
'scope:client-testing-unit',
'scope:client-util',
],
sourceTag: 'scope:client-core-components',
},
{
sourceTag: 'scope:client-e2e',
onlyDependOnLibsWithTags: ['scope:client-testing-e2e', 'scope:client-util'],
sourceTag: 'scope:client-e2e',
},
{
sourceTag: 'scope:client-core-components-e2e',
onlyDependOnLibsWithTags: ['scope:client-testing-e2e', 'scope:client-util'],
sourceTag: 'scope:client-core-components-e2e',
},
{
sourceTag: 'scope:elements',
onlyDependOnLibsWithTags: [
'scope:client-elements',
'scope:client-core',
'scope:client-testing-unit',
'scope:client-util',
'scope:client-util-security',
'scope:client-util-sentry',
],
sourceTag: 'scope:elements',
},
{
sourceTag: 'scope:elements-e2e',
onlyDependOnLibsWithTags: ['scope:client-testing-e2e', 'scope:client-util'],
sourceTag: 'scope:elements-e2e',
},
{
sourceTag: 'scope:elements-testing',
onlyDependOnLibsWithTags: [],
sourceTag: 'scope:elements-testing',
},
{
sourceTag: 'scope:client-elements',
onlyDependOnLibsWithTags: ['scope:client-chatbot', 'scope:client-testing-unit', 'scope:client-util', 'scope:client-util-eliza'],
sourceTag: 'scope:client-elements',
},
];
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Add files here to ignore them from prettier formatting

/.nx/cache
/.nx/cache
.angular/cache
2 changes: 1 addition & 1 deletion apps/client/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'hammerjs';

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { applicationIsFramed } from '@app/client-util';
import { applicationIsFramed } from '@app/client-util-security';
import { initializeSentry } from '@app/client-util-sentry';

import { AppClientModule } from './app/client.module';
Expand Down
2 changes: 1 addition & 1 deletion apps/documentation/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'hammerjs';

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { applicationIsFramed } from '@app/client-util';
import { applicationIsFramed } from '@app/client-util-security';

import { AppDocModule } from './app/doc.module';
import { environment } from './environments/environment';
Expand Down
2 changes: 1 addition & 1 deletion apps/elements/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'hammerjs';

import { enableProdMode } from '@angular/core';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
import { applicationIsFramed } from '@app/client-util';
import { applicationIsFramed } from '@app/client-util-security';
import { initializeSentry } from '@app/client-util-sentry';

import { AppModule } from './app/app.module';
Expand Down
4 changes: 4 additions & 0 deletions libs/client-util-animations/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"extends": ["../../.eslintrc.js", "../../.eslintrc.angular.js"],
"ignorePatterns": ["!**/*"]
}
Loading

0 comments on commit 5d1faf2

Please sign in to comment.