Skip to content

chore(cli): use 'vite test' replace 'vitest' command#206

Merged
fengmk2 merged 1 commit intomainfrom
09-26-feat_cli_use_vite_test_replace_vitest_command
Sep 26, 2025
Merged

chore(cli): use 'vite test' replace 'vitest' command#206
fengmk2 merged 1 commit intomainfrom
09-26-feat_cli_use_vite_test_replace_vitest_command

Conversation

@fengmk2
Copy link
Copy Markdown
Member

@fengmk2 fengmk2 commented Sep 26, 2025

TL;DR

Improved monorepo template scripts and added silent flag to npm install tests.

What changed?

  • Updated monorepo template scripts in package.json to use more descriptive names:
    • Changed prepublishOnly to build:all
    • Changed test to test:all
    • Updated the ready script to use the new script names
  • Added --silent flag to npm install commands in snap tests to reduce output verbosity
  • Enhanced the fixPackageJsonForVitePlus function to properly update test scripts
  • Simplified the monorepo template's vite.config.ts by replacing the test projects configuration with commented placeholders
  • Updated snap tests to display package.json contents for better verification
  • Changed vitest config import to use @voidzero-dev/vite-plus

How to test?

  1. Create a new monorepo project: vp new my-monorepo --template monorepo
  2. Verify the root package.json has the updated script names
  3. Add a new library: vp new --lib packages/my-lib --template react
  4. Check that the library's package.json has the correct test script
  5. Run the CLI snap tests: vite test packages/cli/snap-tests/npm-install-with-options

Why make this change?

The script naming improvements make the monorepo template more intuitive and consistent. The build:all and test:all names better reflect their purpose of running these commands across all packages. Adding the silent flag to npm install tests reduces noise in test output, making it easier to focus on relevant information. The package.json display in snap tests provides better verification of template generation.

Copy link
Copy Markdown
Member Author

fengmk2 commented Sep 26, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@fengmk2 fengmk2 self-assigned this Sep 26, 2025
@fengmk2 fengmk2 changed the title feat(cli): use 'vite test' replace 'vitest' command chore(cli): use 'vite test' replace 'vitest' command Sep 26, 2025
@fengmk2 fengmk2 marked this pull request as ready for review September 26, 2025 02:30
Copilot AI review requested due to automatic review settings September 26, 2025 02:30
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the monorepo template by updating script names for clarity and standardizing the test command across the codebase to use 'vite test' instead of 'vitest'.

  • Updated monorepo template scripts to use more descriptive names (test:all, build:all)
  • Replaced 'vitest' commands with 'vite test' throughout the codebase
  • Enhanced snap tests with silent flags and better package.json verification

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
vitest.config.ts Changed import from vitest/config to @voidzero-dev/vite-plus
packages/global/templates/monorepo/vite.config.ts Replaced test projects config with commented placeholders
packages/global/templates/monorepo/package.json Updated script names to test:all and build:all for clarity
packages/global/src/new.ts Added logic to replace vitest commands with 'vite test'
packages/global/snap-tests/new-monorepo/steps.json Enhanced test verification by displaying package.json contents
packages/global/snap-tests/new-monorepo/snap.txt Updated expected output with new script names and package.json display
packages/cli/snap-tests/npm-install-with-options/steps.json Added --silent flag to npm install commands
packages/cli/snap-tests/npm-install-with-options/snap.txt Updated expected output with reduced verbosity from silent flag

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread packages/global/src/new.ts
Comment thread packages/global/templates/monorepo/vite.config.ts Outdated
@fengmk2 fengmk2 force-pushed the 09-26-feat_cli_use_vite_test_replace_vitest_command branch from 40d7e08 to c95b8b3 Compare September 26, 2025 03:33
@fengmk2 fengmk2 merged commit 4d4d4d9 into main Sep 26, 2025
16 of 17 checks passed
Copy link
Copy Markdown
Member Author

fengmk2 commented Sep 26, 2025

Merge activity

@fengmk2 fengmk2 deleted the 09-26-feat_cli_use_vite_test_replace_vitest_command branch September 26, 2025 03:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants