Skip to content

Commit e11d746

Browse files
authored
Introduce nx workspace (#46)
* introduce NX Workspace * configure lint and test * update workflows and scripts
1 parent 9d07650 commit e11d746

101 files changed

Lines changed: 28483 additions & 23182 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.browserslistrc

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

.editorconfig

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Editor configuration, see https://editorconfig.org
1+
# Editor configuration, see http://editorconfig.org
22
root = true
33

44
[*]
@@ -8,9 +8,6 @@ indent_size = 2
88
insert_final_newline = true
99
trim_trailing_whitespace = true
1010

11-
[*.ts]
12-
quote_type = single
13-
1411
[*.md]
1512
max_line_length = off
1613
trim_trailing_whitespace = false

.eslintrc.json

Lines changed: 24 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,35 @@
11
{
22
"root": true,
3+
"ignorePatterns": ["**/*"],
4+
"plugins": ["@nrwl/nx"],
35
"overrides": [
46
{
5-
"files": [
6-
"*.ts",
7-
"*.tsx"
8-
],
9-
"extends": [
10-
"plugin:@typescript-eslint/recommended",
11-
"plugin:jasmine/recommended",
12-
"eslint:recommended",
13-
"plugin:import/recommended",
14-
"plugin:import/typescript"
15-
],
16-
"plugins": [
17-
"jasmine",
18-
"import"
19-
],
7+
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
208
"rules": {
21-
"prefer-const": "off",
22-
"@typescript-eslint/no-empty-function": "off", // temporary, should be ok for tests
23-
"@typescript-eslint/no-explicit-any": "off", // temporary, should be ok for tests
24-
"@typescript-eslint/explicit-function-return-type": [
9+
"@nrwl/nx/enforce-module-boundaries": [
2510
"error",
2611
{
27-
"allowExpressions": true
12+
"enforceBuildableLibDependency": true,
13+
"allow": [],
14+
"depConstraints": [
15+
{
16+
"sourceTag": "*",
17+
"onlyDependOnLibsWithTags": ["*"]
18+
}
19+
]
2820
}
29-
],
30-
"@typescript-eslint/ban-types": [
31-
"error",
32-
{
33-
"types": {
34-
"String": {
35-
"message": "Use string instead",
36-
"fixWith": "string"
37-
},
38-
"{}": false,
39-
"object": false
40-
}
41-
}
42-
],
43-
"no-console": "error",
44-
"no-unused-vars": "off",
45-
"no-undef": "off",
46-
"no-prototype-builtins": "off",
47-
"no-sparse-arrays": "off",
48-
"no-redeclare": "off",
49-
"getter-return": "off",
50-
"no-extra-boolean-cast": "off",
51-
"no-useless-escape": "off",
52-
"no-empty": "off",
53-
"semi": "error",
54-
"import/no-unresolved": "off"
21+
]
5522
}
56-
}
57-
],
58-
"settings": { // https://github.com/alexgorbatchev/eslint-import-resolver-typescript
59-
"import/parsers": {
60-
"@typescript-eslint/parser": [
61-
".ts",
62-
".tsx"
63-
]
6423
},
65-
"import/resolver": {
66-
"typescript": {
67-
"alwaysTryTypes": true // always try to resolve types under `<root>@types` directory even it doesn't contain any source code, like `@types/unist`
68-
}
24+
{
25+
"files": ["*.ts", "*.tsx"],
26+
"extends": ["plugin:@nrwl/nx/typescript"],
27+
"rules": {}
28+
},
29+
{
30+
"files": ["*.js", "*.jsx"],
31+
"extends": ["plugin:@nrwl/nx/javascript"],
32+
"rules": {}
6933
}
70-
}
71-
}
34+
]
35+
}

.firebaserc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"projects": {
3+
"default": "anecdotes-mfe-poc"
4+
},
5+
"targets": {
6+
"anecdotes-mfe-poc": {
7+
"hosting": {
8+
"develop": [
9+
"anecdotes-mfe-poc"
10+
]
11+
}
12+
}
13+
}
14+
}

.github/workflows/build-dynamic-form-develop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
run: npm ci
2121

2222
- name: Build
23-
run: npm run build dynamic-form
23+
run: npm run build
2424

2525
- name: Lint
2626
run: npm run lint
2727

2828
- name: Test
29-
run: npm run test dynamic-form -- -c=single-run
29+
run: npm run test-single-run

.github/workflows/dynamic-form-pr.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
run: npm ci
2121

2222
- name: Build
23-
run: npm run build dynamic-form
23+
run: npm run build
2424

2525
- name: Lint
2626
run: npm run lint
2727

2828
- name: Test
29-
run: npm run test dynamic-form -- -c=single-run
29+
run: npm run test-single-run

.gitignore

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@
44
/dist
55
/tmp
66
/out-tsc
7-
# Only exists if Bazel was run
8-
/bazel-out
97

108
# dependencies
119
/node_modules
1210

13-
# profiling files
14-
chrome-profiler-events*.json
15-
1611
# IDEs and editors
1712
/.idea
1813
.project
@@ -28,7 +23,6 @@ chrome-profiler-events*.json
2823
!.vscode/tasks.json
2924
!.vscode/launch.json
3025
!.vscode/extensions.json
31-
.history/*
3226

3327
# misc
3428
/.sass-cache

.prettierignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Add files here to ignore them from prettier formatting
2+
3+
/dist
4+
/coverage

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,19 @@
1-
# FormRendererRoot
1+
# WebCompApp
22

3-
This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 12.2.5.
3+
The app demonstrates of microfrontend implementation using Angular with NgRx shared state between micro apps.
44

5-
## Development server
5+
## Installling dependencies
66

7-
Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.
7+
`npm i`
88

9-
## Code scaffolding
9+
## Run Shell app
1010

11-
Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
11+
`nx run shell:serve-mfe`
1212

13-
## Build
13+
## Run Gallery app
1414

15-
Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
15+
`nx run gallery:serve`
1616

17-
## Running unit tests
17+
## Enjoy!
1818

19-
Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20-
21-
## Running end-to-end tests
22-
23-
Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
24-
25-
## Further help
26-
27-
To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
19+
If you learned anything new, follow me on [medium](https://medium.com/@easy-web) and [twitter](https://twitter.com/EasyWebOrg)

0 commit comments

Comments
 (0)