Skip to content

Commit 21c9b62

Browse files
committed
refactor(pmp): scope of the libs within repository domain
refs #141 closes #141
1 parent dbeb370 commit 21c9b62

File tree

9 files changed

+73
-26
lines changed

9 files changed

+73
-26
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ A brilliant tool that will pimp your pull requests by collecting and presenting
1111
- copy `.env-sample` file as `.env` in project root
1212
- fill the `.env` file
1313
- install dependencies by `npm install` and run `node ./scripts/init.js`
14-
or manually copy all sample files under `libs/pmp-web/core/src/lib/environment/` directory
14+
or manually copy all sample files under `libs/pmp-web/core/src/lib/environmentSample/` directory
1515
without `.sample` key word and fill that files with proper configuration
1616

1717
Generate repository platform client credentials:

apps/pmp-web/src/environments/environment.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// This file can be replaced during build by using the `fileReplacements` array.
2-
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
2+
// `ng build --prod` replaces `environmentSample.ts` with `environmentSample.prod.ts`.
33
// The list of file replacements can be found in `angular.json`.
44

55
export const environment = {

libs/pmp-web/auth/login-feature/src/lib/containers/login-page/login-page.component.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Component, Inject } from '@angular/core';
22
import { AuthFacade } from '@pimp-my-pr/pmp-web/auth/data-access';
33
import {
44
bitbucketAuthConfig,
5-
environment,
5+
environmentSample,
66
githubAuthConfig
77
} from '@pimp-my-pr/pmp-web/shared/config';
88
import { Platform } from '@pimp-my-pr/shared/domain';
@@ -33,10 +33,10 @@ export class LoginPageComponent {
3333
login(system: string): void {
3434
switch (system) {
3535
case Platform.github:
36-
window.location.href = `${githubAuthConfig.authLink}?client_id=${environment.githubClientId}`;
36+
window.location.href = `${githubAuthConfig.authLink}?client_id=${environmentSample.githubClientId}`;
3737
break;
3838
case Platform.bitbucket:
39-
window.location.href = `${bitbucketAuthConfig.authLink}?client_id=${environment.bitbucketClientId}&response_type=code`;
39+
window.location.href = `${bitbucketAuthConfig.authLink}?client_id=${environmentSample.bitbucketClientId}&response_type=code`;
4040
break;
4141
}
4242
}
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from './lib/configs/bitbucket-auth.config';
22
export * from './lib/configs/github-auth.config';
3-
export * from './lib/environment/environment';
3+
export * from './lib/environment/environment.sample';
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
environment.ts
1+
environment.sample.ts
22
environment.prod.ts

libs/pmp-web/shared/config/src/lib/environment/environment.sample.ts

-5
This file was deleted.

nx.json

+10-10
Original file line numberDiff line numberDiff line change
@@ -63,28 +63,28 @@
6363
"tags": ["platform:web", "scope:repository", "type:data-access"]
6464
},
6565
"pmp-web-repository-repository-statistics-feature": {
66-
"tags": ["platform:web", "scope:repository", "type:feature"]
66+
"tags": ["platform:web", "scope:repository-statistics", "type:feature"]
6767
},
6868
"pmp-web-repository-repository-statistics-data-access": {
69-
"tags": ["platform:web", "scope:repository", "type:data-access"]
69+
"tags": ["platform:web", "scope:repository-statistics", "type:data-access"]
7070
},
7171
"pmp-web-repository-repositories-statistics-feature": {
72-
"tags": ["platform:web", "scope:repository", "type:feature"]
72+
"tags": ["platform:web", "scope:repositories-statistics", "type:feature"]
7373
},
7474
"pmp-web-repository-repositories-statistics-data-access": {
75-
"tags": ["platform:web", "scope:repository", "type:data-access"]
75+
"tags": ["platform:web", "scope:repositories-statistics", "type:data-access"]
7676
},
7777
"pmp-web-repository-reviewer-statistics-feature": {
78-
"tags": ["platform:web", "scope:repository", "type:feature"]
78+
"tags": ["platform:web", "scope:reviewer-statistics", "type:feature"]
7979
},
8080
"pmp-web-repository-reviewer-statistics-data-access": {
81-
"tags": ["platform:web", "scope:repository", "type:data-access"]
81+
"tags": ["platform:web", "scope:reviewer-statistics", "type:data-access"]
8282
},
8383
"pmp-web-repository-reviewers-statistics-feature": {
84-
"tags": ["platform:web", "scope:repository", "type:feature"]
84+
"tags": ["platform:web", "scope:reviewers-statistics", "type:feature"]
8585
},
8686
"pmp-web-repository-reviewers-statistics-data-access": {
87-
"tags": ["platform:web", "scope:repository", "type:data-access"]
87+
"tags": ["platform:web", "scope:reviewers-statistics", "type:data-access"]
8888
},
8989
"pmp-web-repository-domain": {
9090
"tags": ["platform:web", "scope:repository", "type:domain"]
@@ -93,10 +93,10 @@
9393
"tags": ["platform:web", "scope:repository", "type:shell"]
9494
},
9595
"pmp-web-repository-repository-settings-feature": {
96-
"tags": ["platform:web", "scope:repository", "type:feature"]
96+
"tags": ["platform:web", "scope:repository-settings", "type:feature"]
9797
},
9898
"pmp-web-repository-repository-settings-ui": {
99-
"tags": ["platform:web", "scope:repository", "type:ui"]
99+
"tags": ["platform:web", "scope:repository-settings", "type:ui"]
100100
},
101101
"server-repository-api-rest": {
102102
"tags": ["platform:server", "scope:repository", "type:api"]

scripts/init.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,17 @@ config();
66
const { GITHUB_CLIENT_ID, BITBUCKET_CLIENT_ID } = process.env;
77

88
function initPmpWebEnvironment(): void {
9-
const devEnvironmentFile = 'libs/pmp-web/shared/config/src/lib/environment/environment.ts';
10-
const prodEnvironmentFile = 'libs/pmp-web/shared/config/src/lib/environment/environment.prod.ts';
9+
const devEnvironmentFile =
10+
'libs/pmp-web/shared/config/src/lib/environmentSample/environment.sample.ts';
11+
const prodEnvironmentFile =
12+
'libs/pmp-web/shared/config/src/lib/environmentSample/environmentSample.prod.ts';
1113

1214
fs.copyFileSync(
13-
'libs/pmp-web/shared/config/src/lib/environment/environment.sample.ts',
15+
'libs/pmp-web/shared/config/src/lib/environmentSample/environmentSample.sample.ts',
1416
devEnvironmentFile
1517
);
1618
fs.copyFileSync(
17-
'libs/pmp-web/shared/config/src/lib/environment/environment.prod.sample.ts',
19+
'libs/pmp-web/shared/config/src/lib/environmentSample/environmentSample.prod.sample.ts',
1820
prodEnvironmentFile
1921
);
2022

tslint.json

+50
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,56 @@
6969
"name:auth-public"
7070
]
7171
},
72+
{
73+
"sourceTag": "scope:repository-statistics",
74+
"onlyDependOnLibsWithTags": [
75+
"name:user-public",
76+
"scope:repository",
77+
"scope:repository-statistics",
78+
"scope:shared",
79+
"name:auth-public"
80+
]
81+
},
82+
{
83+
"sourceTag": "scope:repositories-statistics",
84+
"onlyDependOnLibsWithTags": [
85+
"name:user-public",
86+
"scope:repository",
87+
"scope:repositories-statistics",
88+
"scope:shared",
89+
"name:auth-public"
90+
]
91+
},
92+
{
93+
"sourceTag": "scope:reviewer-statistics",
94+
"onlyDependOnLibsWithTags": [
95+
"name:user-public",
96+
"scope:repository",
97+
"scope:reviewer-statistics",
98+
"scope:shared",
99+
"name:auth-public"
100+
]
101+
},
102+
{
103+
"sourceTag": "scope:reviewers-statistics",
104+
"onlyDependOnLibsWithTags": [
105+
"name:user-public",
106+
"scope:repository",
107+
"scope:reviewers-statistics",
108+
"scope:shared",
109+
"name:auth-public"
110+
]
111+
},
112+
{
113+
"sourceTag": "scope:repository-settings",
114+
"onlyDependOnLibsWithTags": [
115+
"name:user-public",
116+
"scope:repository",
117+
"scope:repository-settings",
118+
"scope:shared",
119+
"name:auth-public"
120+
]
121+
},
72122
{
73123
"sourceTag": "scope:shared",
74124
"onlyDependOnLibsWithTags": ["scope:shared"]

0 commit comments

Comments
 (0)