Skip to content

Commit 220667f

Browse files
committed
chore: migrate to NX
1 parent 76942fb commit 220667f

File tree

137 files changed

+11887
-160
lines changed

Some content is hidden

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

137 files changed

+11887
-160
lines changed

.circleci/config.yml

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
key: *cache_key
1818
- run:
1919
name: install-dependencies
20-
command: yarn --frozen-lockfile
20+
command: yarn --frozen-lockfile --non-interactive
2121
- save_cache:
2222
key: *cache_key
2323
paths:
@@ -31,19 +31,9 @@ jobs:
3131
key: *cache_key
3232
- run:
3333
name: lint
34-
command: yarn lint
34+
command: yarn affected:lint
3535

36-
test-lib:
37-
<<: *job_defaults
38-
steps:
39-
- checkout
40-
- restore_cache:
41-
key: *cache_key
42-
- run:
43-
name: test
44-
command: yarn test --maxWorkers=1 --ci
45-
46-
build-lib:
36+
build:
4737
<<: *job_defaults
4838
steps:
4939
- checkout
@@ -56,18 +46,18 @@ jobs:
5646
key: *dist_key
5747
paths:
5848
- dist
49+
- store_artifacts:
50+
path: dist
5951

60-
test-app:
52+
test:
6153
<<: *job_defaults
6254
steps:
6355
- checkout
6456
- restore_cache:
6557
key: *cache_key
66-
- restore_cache:
67-
key: *dist_key
6858
- run:
6959
name: test
70-
command: yarn test:app --maxWorkers=1 --ci
60+
command: yarn affected:test --ci --code-coverage
7161

7262
release:
7363
<<: *job_defaults
@@ -101,26 +91,22 @@ workflows:
10191
- lint:
10292
requires:
10393
- install
104-
- test-lib:
105-
requires:
106-
- install
107-
- build-lib:
94+
- build:
10895
requires:
10996
- lint
110-
- test-lib
111-
- test-app:
97+
- test:
11298
requires:
113-
- build-lib
99+
- build
114100
- release:
115101
requires:
116-
- test-app
102+
- test
117103
filters:
118104
branches:
119105
only:
120106
- master
121107
- release-beta:
122108
requires:
123-
- test-app
109+
- test
124110
filters:
125111
branches:
126112
only:

angular.json

Lines changed: 73 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
33
"version": 1,
4-
"newProjectRoot": "projects",
4+
"newProjectRoot": "",
55
"projects": {
6-
"testing-library-app": {
6+
"example-app": {
77
"root": "",
88
"sourceRoot": "src",
99
"projectType": "application",
@@ -14,13 +14,13 @@
1414
"builder": "@angular-devkit/build-angular:browser",
1515
"options": {
1616
"aot": true,
17-
"outputPath": "dist/testing-library-app",
18-
"index": "src/index.html",
19-
"main": "src/main.ts",
20-
"polyfills": "src/polyfills.ts",
21-
"tsConfig": "src/tsconfig.app.json",
22-
"assets": ["src/favicon.ico", "src/assets"],
23-
"styles": ["src/styles.css"],
17+
"outputPath": "dist/apps/example-app",
18+
"index": "apps/example-app/index.html",
19+
"main": "apps/example-app/main.ts",
20+
"polyfills": "apps/example-app/polyfills.ts",
21+
"tsConfig": "apps/example-app/tsconfig.json",
22+
"assets": ["apps/example-app/favicon.ico", "apps/example-app/assets"],
23+
"styles": ["apps/example-app/styles.css"],
2424
"scripts": []
2525
},
2626
"configurations": {
@@ -33,8 +33,8 @@
3333
],
3434
"fileReplacements": [
3535
{
36-
"replace": "src/environments/environment.ts",
37-
"with": "src/environments/environment.prod.ts"
36+
"replace": "apps/example-app/environments/environment.ts",
37+
"with": "apps/example-app/environments/environment.prod.ts"
3838
}
3939
],
4040
"optimization": true,
@@ -69,9 +69,17 @@
6969
"lint": {
7070
"builder": "@angular-devkit/build-angular:tslint",
7171
"options": {
72-
"tsConfig": ["src/tsconfig.app.json", "./tsconfig.spec.json"],
72+
"tsConfig": ["apps/example-app/tsconfig.json", "apps/example-app/tsconfig.spec.json"],
7373
"exclude": ["**/node_modules/**"]
7474
}
75+
},
76+
"test": {
77+
"builder": "@nrwl/jest:jest",
78+
"options": {
79+
"jestConfig": "apps/example-app/jest.config.js",
80+
"tsConfig": "apps/example-app/tsconfig.spec.json",
81+
"setupFile": "apps/example-app/setup-jest.ts"
82+
}
7583
}
7684
}
7785
},
@@ -89,17 +97,45 @@
8997
},
9098
"configurations": {
9199
"production": {
92-
"project": "projects/testing-library/ng-package.prod.json",
93-
"tsConfig": "projects/testing-library/tsconfig.lib.prod.json"
100+
"project": "projects/testing-library/ng-package.json",
101+
"tsConfig": "projects/testing-library/tsconfig.lib.json"
94102
}
95103
}
96104
},
97105
"lint": {
98106
"builder": "@angular-devkit/build-angular:tslint",
99107
"options": {
100-
"tsConfig": ["projects/testing-library/tsconfig.lib.json", "./tsconfig.spec.json"],
108+
"tsConfig": ["projects/testing-library/tsconfig.lib.json", "projects/testing-library/tsconfig.spec.json"],
101109
"exclude": ["**/node_modules/**"]
102110
}
111+
},
112+
"build-release": {
113+
"builder": "@nrwl/workspace:run-commands",
114+
"options": {
115+
"parallel": false,
116+
"commands": [
117+
{
118+
"command": "ng build testing-library"
119+
},
120+
{
121+
"command": "tsc -p ./projects/testing-library/migrations/tsconfig.migrations.json"
122+
},
123+
{
124+
"command": "cpy ./projects/testing-library/migrations/migration.json ./dist/@testing-library/angular/migrations"
125+
},
126+
{
127+
"command": "cpy ./README.md ./dist/@testing-library/angular"
128+
}
129+
]
130+
}
131+
},
132+
"test": {
133+
"builder": "@nrwl/jest:jest",
134+
"options": {
135+
"jestConfig": "projects/testing-library/jest.config.js",
136+
"tsConfig": "projects/testing-library/tsconfig.spec.json",
137+
"setupFile": "projects/testing-library/setup-jest.ts"
138+
}
103139
}
104140
}
105141
},
@@ -117,17 +153,36 @@
117153
},
118154
"configurations": {
119155
"production": {
120-
"project": "projects/jest-utils/ng-package.prod.json",
121-
"tsConfig": "projects/jest-utils/tsconfig.lib.prod.json"
156+
"project": "projects/jest-utils/ng-package.json",
157+
"tsConfig": "projects/jest-utils/tsconfig.lib.json"
122158
}
123159
}
124160
},
125161
"lint": {
126162
"builder": "@angular-devkit/build-angular:tslint",
127163
"options": {
128-
"tsConfig": ["projects/jest-utils/tsconfig.lib.json", "./tsconfig.spec.json"],
164+
"tsConfig": ["projects/jest-utils/tsconfig.lib.json", "projects/jest-utils/tsconfig.spec.json"],
129165
"exclude": ["**/node_modules/**"]
130166
}
167+
},
168+
"build-release": {
169+
"builder": "@nrwl/workspace:run-commands",
170+
"options": {
171+
"parallel": false,
172+
"commands": [
173+
{
174+
"command": "ng build jest-utils"
175+
}
176+
]
177+
}
178+
},
179+
"test": {
180+
"builder": "@nrwl/jest:jest",
181+
"options": {
182+
"jestConfig": "projects/jest-utils/jest.config.js",
183+
"tsConfig": "projects/jest-utils/tsconfig.spec.json",
184+
"setupFile": "projects/jest-utils/setup-jest.ts"
185+
}
131186
}
132187
}
133188
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
2+
<!doctype html>
3+
<html lang="en">
4+
5+
<head>
6+
<title>Code coverage report for app/examples/00-single-component.ts</title>
7+
<meta charset="utf-8" />
8+
<link rel="stylesheet" href="../../prettify.css" />
9+
<link rel="stylesheet" href="../../base.css" />
10+
<link rel="shortcut icon" type="image/x-icon" href="../../favicon.png" />
11+
<meta name="viewport" content="width=device-width, initial-scale=1" />
12+
<style type='text/css'>
13+
.coverage-summary .sorter {
14+
background-image: url(../../sort-arrow-sprite.png);
15+
}
16+
</style>
17+
</head>
18+
19+
<body>
20+
<div class='wrapper'>
21+
<div class='pad1'>
22+
<h1><a href="../../index.html">All files</a> / <a href="index.html">app/examples</a> 00-single-component.ts</h1>
23+
<div class='clearfix'>
24+
25+
<div class='fl pad1y space-right2'>
26+
<span class="strong">100% </span>
27+
<span class="quiet">Statements</span>
28+
<span class='fraction'>5/5</span>
29+
</div>
30+
31+
32+
<div class='fl pad1y space-right2'>
33+
<span class="strong">100% </span>
34+
<span class="quiet">Branches</span>
35+
<span class='fraction'>0/0</span>
36+
</div>
37+
38+
39+
<div class='fl pad1y space-right2'>
40+
<span class="strong">100% </span>
41+
<span class="quiet">Functions</span>
42+
<span class='fraction'>1/1</span>
43+
</div>
44+
45+
46+
<div class='fl pad1y space-right2'>
47+
<span class="strong">100% </span>
48+
<span class="quiet">Lines</span>
49+
<span class='fraction'>3/3</span>
50+
</div>
51+
52+
53+
</div>
54+
<p class="quiet">
55+
Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56+
</p>
57+
</div>
58+
<div class='status-line high'></div>
59+
<pre><table class="coverage">
60+
<tr><td class="line-count quiet"><a name='L1'></a><a href='#L1'>1</a>
61+
<a name='L2'></a><a href='#L2'>2</a>
62+
<a name='L3'></a><a href='#L3'>3</a>
63+
<a name='L4'></a><a href='#L4'>4</a>
64+
<a name='L5'></a><a href='#L5'>5</a>
65+
<a name='L6'></a><a href='#L6'>6</a>
66+
<a name='L7'></a><a href='#L7'>7</a>
67+
<a name='L8'></a><a href='#L8'>8</a>
68+
<a name='L9'></a><a href='#L9'>9</a>
69+
<a name='L10'></a><a href='#L10'>10</a>
70+
<a name='L11'></a><a href='#L11'>11</a>
71+
<a name='L12'></a><a href='#L12'>12</a>
72+
<a name='L13'></a><a href='#L13'>13</a>
73+
<a name='L14'></a><a href='#L14'>14</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
74+
<span class="cline-any cline-neutral">&nbsp;</span>
75+
<span class="cline-any cline-neutral">&nbsp;</span>
76+
<span class="cline-any cline-neutral">&nbsp;</span>
77+
<span class="cline-any cline-neutral">&nbsp;</span>
78+
<span class="cline-any cline-neutral">&nbsp;</span>
79+
<span class="cline-any cline-neutral">&nbsp;</span>
80+
<span class="cline-any cline-neutral">&nbsp;</span>
81+
<span class="cline-any cline-neutral">&nbsp;</span>
82+
<span class="cline-any cline-neutral">&nbsp;</span>
83+
<span class="cline-any cline-yes">1x</span>
84+
<span class="cline-any cline-yes">1x</span>
85+
<span class="cline-any cline-neutral">&nbsp;</span>
86+
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import { Component } from '@angular/core';
87+
&nbsp;
88+
@Component({
89+
selector: 'app-fixture',
90+
template: `
91+
&lt;button (click)="value = value - 1"&gt;Decrement&lt;/button&gt;
92+
&lt;span data-testid="value"&gt;{{ value }}&lt;/span&gt;
93+
&lt;button (click)="value = value + 1"&gt;Increment&lt;/button&gt;
94+
`,
95+
})
96+
export class SingleComponent {
97+
value = 0;
98+
}
99+
&nbsp;</pre></td></tr></table></pre>
100+
101+
<div class='push'></div><!-- for sticky footer -->
102+
</div><!-- /wrapper -->
103+
<div class='footer quiet pad2 space-top1 center small'>
104+
Code coverage generated by
105+
<a href="https://istanbul.js.org/" target="_blank">istanbul</a>
106+
at Thu Jun 25 2020 18:14:22 GMT+0200 (Central European Summer Time)
107+
</div>
108+
</div>
109+
<script src="../../prettify.js"></script>
110+
<script>
111+
window.onload = function () {
112+
prettyPrint();
113+
};
114+
</script>
115+
<script src="../../sorter.js"></script>
116+
<script src="../../block-navigation.js"></script>
117+
</body>
118+
</html>
119+

0 commit comments

Comments
 (0)