Skip to content

Commit 6c1335a

Browse files
bekosvsavkin
authored andcommitted
feat(core): interpolated outputs & cache coverage folder
1 parent 1c3b215 commit 6c1335a

File tree

27 files changed

+316
-170
lines changed

27 files changed

+316
-170
lines changed

e2e/workspace/src/workspace.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -479,7 +479,7 @@ describe('print-affected', () => {
479479
target: 'test',
480480
},
481481
command: `npm run nx -- test ${myapp}`,
482-
outputs: [],
482+
outputs: [`coverage/apps/${myapp}`],
483483
},
484484
]);
485485
compareTwoArrays(resWithTarget.projects, [`${myapp}-e2e`, myapp]);

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"@types/jasmine": "~2.8.6",
9696
"@types/jasminewd2": "~2.0.3",
9797
"@types/jest": "26.0.8",
98+
"@types/lodash": "^4.14.165",
9899
"@types/node": "12.12.38",
99100
"@types/prettier": "2.0.0",
100101
"@types/react": "16.9.17",
@@ -181,6 +182,7 @@
181182
"less-loader": "5.0.0",
182183
"license-webpack-plugin": "2.1.2",
183184
"loader-utils": "1.2.3",
185+
"lodash": "^4.17.20",
184186
"memfs": "^3.0.1",
185187
"mime": "2.4.4",
186188
"mini-css-extract-plugin": "0.8.0",

packages/angular/src/schematics/application/__snapshots__/application.spec.ts.snap

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ Object {
8888
"jestConfig": "apps/my-dir/my-app/jest.config.js",
8989
"passWithNoTests": true,
9090
},
91+
"outputs": Array [
92+
"coverage/apps/my-dir/my-app",
93+
],
9194
},
9295
},
9396
"prefix": "proj",
@@ -221,6 +224,9 @@ Object {
221224
"jestConfig": "apps/my-app/jest.config.js",
222225
"passWithNoTests": true,
223226
},
227+
"outputs": Array [
228+
"coverage/apps/my-app",
229+
],
224230
},
225231
},
226232
"prefix": "proj",

packages/jest/src/schematics/jest-project/jest-project.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ describe('jestProject', () => {
6767
const workspaceJson = readJsonInTree(resultTree, 'workspace.json');
6868
expect(workspaceJson.projects.lib1.architect.test).toEqual({
6969
builder: '@nrwl/jest:jest',
70+
outputs: ['coverage/libs/lib1'],
7071
options: {
7172
jestConfig: 'libs/lib1/jest.config.js',
7273
passWithNoTests: true,

packages/jest/src/schematics/jest-project/lib/update-workspace.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ export function updateWorkspace(options: JestProjectSchema): Rule {
88
const projectConfig = json.projects[options.project];
99
projectConfig.architect.test = {
1010
builder: '@nrwl/jest:jest',
11+
outputs: [join(normalize('coverage'), normalize(projectConfig.root))],
1112
options: {
1213
jestConfig: join(normalize(projectConfig.root), 'jest.config.js'),
1314
passWithNoTests: true,

packages/nest/src/schematics/library/library.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('lib', () => {
2626
});
2727
expect(workspaceJson.projects['my-lib'].architect.test).toEqual({
2828
builder: '@nrwl/jest:jest',
29+
outputs: ['coverage/libs/my-lib'],
2930
options: {
3031
jestConfig: 'libs/my-lib/jest.config.js',
3132
passWithNoTests: true,

packages/nest/src/schematics/library/library.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ function addProject(options: NormalizedSchema): Rule {
183183
if (architect) {
184184
architect.build = {
185185
builder: '@nrwl/node:package',
186+
outputs: ['{options.outputPath}'],
186187
options: {
187188
outputPath: `dist/${libsDir(host)}/${options.projectDirectory}`,
188189
tsConfig: `${options.projectRoot}/tsconfig.lib.json`,

packages/next/src/schematics/application/lib/add-project.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ describe('addProject Rule', () => {
3838
const project = workspaceJson.projects[schema.name];
3939
expect(project.architect.build).toEqual({
4040
builder: '@nrwl/next:build',
41+
outputs: ['{options.outputPath}'],
4142
configurations: {
4243
production: {},
4344
},

packages/next/src/schematics/application/lib/add-project.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export function addProject(options: NormalizedSchema): Rule {
1111

1212
architect.build = {
1313
builder: '@nrwl/next:build',
14+
outputs: ['{options.outputPath}'],
1415
options: {
1516
root: options.appProjectRoot,
1617
outputPath: join(normalize('dist'), options.appProjectRoot),

packages/node/src/schematics/application/application.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('app', () => {
2626
expect.objectContaining({
2727
build: {
2828
builder: '@nrwl/node:build',
29+
outputs: ['{options.outputPath}'],
2930
options: {
3031
outputPath: 'dist/apps/my-node-app',
3132
main: 'apps/my-node-app/src/main.ts',

0 commit comments

Comments
 (0)