From a728bb6929174c36350417b763552a6b1a48aebd Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Thu, 12 Dec 2024 13:58:59 -0500 Subject: [PATCH] Update packages/vue/src/generators/library/library.ts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Leosvel PĂ©rez Espinosa --- .../node/src/generators/application/application.spec.ts | 1 - packages/react/src/generators/library/library.spec.ts | 2 +- packages/vite/src/utils/generator-utils.ts | 9 +++++---- .../vue/src/generators/application/application.spec.ts | 2 +- packages/vue/src/generators/library/library.spec.ts | 5 ++++- packages/vue/src/generators/library/library.ts | 2 +- 6 files changed, 12 insertions(+), 9 deletions(-) diff --git a/packages/node/src/generators/application/application.spec.ts b/packages/node/src/generators/application/application.spec.ts index 7a3049351082e0..3c64143e1b4732 100644 --- a/packages/node/src/generators/application/application.spec.ts +++ b/packages/node/src/generators/application/application.spec.ts @@ -606,7 +606,6 @@ describe('app', () => { "name": "myapp", "projectType": "application", "sourceRoot": "myapp/src", - "tags": [], "targets": { "serve": { "configurations": { diff --git a/packages/react/src/generators/library/library.spec.ts b/packages/react/src/generators/library/library.spec.ts index 1f44a2e982cadb..44fb0732210c91 100644 --- a/packages/react/src/generators/library/library.spec.ts +++ b/packages/react/src/generators/library/library.spec.ts @@ -981,7 +981,7 @@ module.exports = withNx( include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], coverage: { - reportsDirectory: '../coverage/mylib', + reportsDirectory: './test-output/vitest/coverage', provider: 'v8', } }, diff --git a/packages/vite/src/utils/generator-utils.ts b/packages/vite/src/utils/generator-utils.ts index 1c7a3d88c04721..1087bbfc17a110 100644 --- a/packages/vite/src/utils/generator-utils.ts +++ b/packages/vite/src/utils/generator-utils.ts @@ -460,10 +460,11 @@ export function createOrEditViteConfig( ); } - const reportsDirectory = - projectRoot === '.' - ? `./coverage/${options.project}` - : `${offsetFromRoot(projectRoot)}coverage/${projectRoot}`; + const reportsDirectory = isUsingTsPlugin + ? './test-output/vitest/coverage' + : projectRoot === '.' + ? `./coverage/${options.project}` + : `${offsetFromRoot(projectRoot)}coverage/${projectRoot}`; const testOption = options.includeVitest ? ` test: { diff --git a/packages/vue/src/generators/application/application.spec.ts b/packages/vue/src/generators/application/application.spec.ts index fcddea4516e19a..7aa6caa4ff4982 100644 --- a/packages/vue/src/generators/application/application.spec.ts +++ b/packages/vue/src/generators/application/application.spec.ts @@ -163,7 +163,7 @@ describe('application generator', () => { include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], coverage: { - reportsDirectory: '../coverage/test', + reportsDirectory: './test-output/vitest/coverage', provider: 'v8', }, }, diff --git a/packages/vue/src/generators/library/library.spec.ts b/packages/vue/src/generators/library/library.spec.ts index 620a57f34dc238..79ebba4e39a17b 100644 --- a/packages/vue/src/generators/library/library.spec.ts +++ b/packages/vue/src/generators/library/library.spec.ts @@ -485,7 +485,10 @@ module.exports = [ environment: 'jsdom', include: ['src/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'], reporters: ['default'], - coverage: { reportsDirectory: '../coverage/my-lib', provider: 'v8' }, + coverage: { + reportsDirectory: './test-output/vitest/coverage', + provider: 'v8', + }, }, }); " diff --git a/packages/vue/src/generators/library/library.ts b/packages/vue/src/generators/library/library.ts index cae4042fc89514..6b286ae765240c 100644 --- a/packages/vue/src/generators/library/library.ts +++ b/packages/vue/src/generators/library/library.ts @@ -130,7 +130,7 @@ export async function libraryGeneratorInternal(tree: Tree, schema: Schema) { }); } - if (options.bundler === 'none' && options.addPlugin) { + if (options.bundler === 'none') { const nxJson = readNxJson(tree); ensureProjectIsExcludedFromPluginRegistrations(nxJson, options.projectRoot); updateNxJson(tree, nxJson);