From f1ebe93b1275f066e17d669bb997d62c9fba0cd2 Mon Sep 17 00:00:00 2001 From: Jack Hsu Date: Thu, 12 Dec 2024 13:58:59 -0500 Subject: [PATCH] chore(misc): 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 --- .../src/generators/application/application.spec.ts | 1 - .../nest/src/generators/application/application.spec.ts | 1 - .../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 +- 8 files changed, 12 insertions(+), 11 deletions(-) diff --git a/packages/express/src/generators/application/application.spec.ts b/packages/express/src/generators/application/application.spec.ts index 67fa145aa223b..7de92c58e455d 100644 --- a/packages/express/src/generators/application/application.spec.ts +++ b/packages/express/src/generators/application/application.spec.ts @@ -178,7 +178,6 @@ describe('app', () => { "name": "myapp", "projectType": "application", "sourceRoot": "myapp/src", - "tags": [], "targets": { "build": { "configurations": { diff --git a/packages/nest/src/generators/application/application.spec.ts b/packages/nest/src/generators/application/application.spec.ts index 801c741cf13a2..de6999353a90c 100644 --- a/packages/nest/src/generators/application/application.spec.ts +++ b/packages/nest/src/generators/application/application.spec.ts @@ -212,7 +212,6 @@ describe('application generator', () => { "name": "myapp", "projectType": "application", "sourceRoot": "myapp/src", - "tags": [], "targets": { "build": { "configurations": { diff --git a/packages/node/src/generators/application/application.spec.ts b/packages/node/src/generators/application/application.spec.ts index 7a3049351082e..3c64143e1b473 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 1f44a2e982cad..44fb0732210c9 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 1c7a3d88c0472..1087bbfc17a11 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 fcddea4516e19..7aa6caa4ff498 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 620a57f34dc23..79ebba4e39a17 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 cae4042fc8951..6b286ae765240 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);