CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-vant--cli

A comprehensive TypeScript CLI tool for building Vue component libraries with development server, build pipeline, and documentation generation.

Pending
Overview
Eval results
Files

commands.mddocs/

CLI Commands

Primary interface for Vue component library development workflows. Provides seven core commands for development, building, testing, and publishing Vue component libraries.

Capabilities

Development Command

Starts a development server for the documentation site with hot reload support.

# Start development server
vant-cli dev

Usage:

vant-cli dev

Build Command

Compiles components in production mode with comprehensive build pipeline including multiple output formats.

# Build production package
vant-cli build

Build Pipeline Steps:

  1. Copy source code to es/ and lib/ directories
  2. Build package script entry points
  3. Build component style entries
  4. Build package style entry
  5. Build TypeScript declarations
  6. Build ESModule outputs
  7. Build CommonJS outputs
  8. Build bundled outputs
  9. Install dependencies automatically
  10. Generate WebStorm type definitions

Usage:

vant-cli build

Site Build Command

Compiles the documentation site in production mode for deployment.

# Build documentation site
vant-cli build-site

Usage:

vant-cli build-site

Clean Command

Removes all build output directories to ensure clean builds.

# Clean all build outputs
vant-cli clean

Usage:

vant-cli clean

Lint Command

Runs ESLint with automatic fixing on source files.

# Run ESLint with automatic fixing
vant-cli lint

Usage:

vant-cli lint

Release Command

Comprehensive package release workflow with version management, building, and publishing.

# Release package (interactive)
vant-cli release

# Release with specific options
vant-cli release --tag <tag> --gitTag

Release Workflow:

  1. Interactive version input via enquirer
  2. Automatic npm tag detection based on version (beta, alpha, rc, latest)
  3. Package version update in package.json
  4. Build package (if build script exists)
  5. Publish to npm with appropriate tag
  6. Git commit with version update
  7. Optional git tagging and push
  8. Rollback on build failures

Tag Detection:

  • 1.0.0-beta.1beta tag
  • 1.0.0-alpha.1alpha tag
  • 1.0.0-rc.1rc tag
  • 1.0.0latest tag

Usage:

vant-cli release                    # Basic release
vant-cli release --tag beta         # Force beta tag
vant-cli release --gitTag           # Create git tag
vant-cli release --tag beta --gitTag # Both options

Commit Lint Command

Validates commit messages against conventional commit format.

# Validate commit message
vant-cli commit-lint <git-params-file>

Supported Commit Types:

  • fix(Component): description - Bug fixes
  • feat(Component): description - New features
  • docs(Component): description - Documentation updates
  • perf(Component): description - Performance improvements
  • test(Component): description - Test additions
  • types(Component): description - Type definition updates
  • style(Component): description - Code style changes
  • build(Component): description - Build system changes
  • chore(Component): description - Maintenance tasks
  • release(Component): description - Release commits
  • refactor(Component): description - Code refactoring
  • breaking change(Component): description - Breaking changes
  • Merge branch 'foo' into 'bar' - Merge commits

Usage:

vant-cli commit-lint <git-params-file>

Environment Management

Commands automatically manage environment variables for consistent builds:

  • NODE_ENV - Set to 'development' or 'production' based on command
  • BABEL_MODULE - Set to 'esmodule' or 'commonjs' during compilation
  • BUILD_TARGET - Set to 'site' or 'package' based on build type
  • VANT_CLI_VERSION - Current CLI version

Error Handling

All commands implement consistent error handling:

  • Exit with code 1 on failures
  • Rollback mechanisms for build failures
  • Colored output using rslog for clear error reporting
  • Cross-platform compatibility using node:path

Install with Tessl CLI

npx tessl i tessl/npm-vant--cli

docs

build-system.md

commands.md

configuration.md

index.md

utilities.md

tile.json