Skip to content

Commit

Permalink
chore(misc): Update packages/vue/src/generators/library/library.ts
Browse files Browse the repository at this point in the history
Co-authored-by: Leosvel Pérez Espinosa <[email protected]>
  • Loading branch information
jaysoo and leosvelperez committed Dec 12, 2024
1 parent e6beac1 commit f1ebe93
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@ describe('app', () => {
"name": "myapp",
"projectType": "application",
"sourceRoot": "myapp/src",
"tags": [],
"targets": {
"build": {
"configurations": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,6 @@ describe('application generator', () => {
"name": "myapp",
"projectType": "application",
"sourceRoot": "myapp/src",
"tags": [],
"targets": {
"build": {
"configurations": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,6 @@ describe('app', () => {
"name": "myapp",
"projectType": "application",
"sourceRoot": "myapp/src",
"tags": [],
"targets": {
"serve": {
"configurations": {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/generators/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
},
Expand Down
9 changes: 5 additions & 4 deletions packages/vite/src/utils/generator-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
Expand Down
5 changes: 4 additions & 1 deletion packages/vue/src/generators/library/library.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
});
"
Expand Down
2 changes: 1 addition & 1 deletion packages/vue/src/generators/library/library.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f1ebe93

Please sign in to comment.