Skip to content

oiij/oiic

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

3 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

OIIC

TypeScript tsdown Vitest pnpm ESLint VitePress License

A command-line tool to download template repositories from GitHub with ease.

Features

  • ๐Ÿš€ Easy to use - Interactive command-line interface
  • ๐Ÿ“ฆ Template management - Download templates from GitHub
  • ๐Ÿ”„ Remote template list - Fetch latest templates from remote server
  • ๐Ÿ›ก๏ธ Error handling - Robust error handling and user feedback
  • ๐ŸŽจ Colorful output - Beautiful and informative terminal output
  • ๐Ÿ“ TypeScript - Type-safe development

Quick Start

Prerequisites

  • Node.js >= 18
  • pnpm >= 8

Installation

# Install globally
pnpm add -g oiic

# Or install locally
pnpm add oiic

Usage

# Create a new project with interactive prompt
oiic create <project-name>

# Create a new project with force overwrite
oiic create <project-name> --force

Examples

Basic usage

# Create a new project
oiic create my-project

# Follow the interactive prompt to select a template
# ๐ŸŽฏ่ฏท้€‰ๆ‹ฉไธ€ไธช้กน็›ฎๆจกๆฟ่ฟ›่กŒๅˆ›ๅปบ~
# โฏ vue3-starter-simple
#   admin-starter
#   ts-starter
#   uni-app-starter

Force overwrite

# Create a new project with force overwrite
oiic create my-project -f

Commands

Command Description
oiic create Create a new project from template
oiic --version Show version information
oiic --help Show help information

Options

Option Description
-f, --force Force overwrite existing directory
-v, --version Show version information
-h, --help Show help information

Project Structure

oiic/
โ”œโ”€โ”€ src/              # Source code
โ”œโ”€โ”€ test/             # Test files
โ”œโ”€โ”€ docs/             # VitePress documentation
โ”œโ”€โ”€ dist/             # Build output
โ”œโ”€โ”€ package.json      # Package configuration
โ”œโ”€โ”€ store.json        # Default template store
โ”œโ”€โ”€ tsconfig.json     # TypeScript configuration
โ”œโ”€โ”€ tsdown.config.ts  # tsdown configuration
โ”œโ”€โ”€ vitest.config.ts  # Vitest configuration
โ””โ”€โ”€ eslint.config.js  # ESLint configuration

Template Store

The tool uses a template store to manage available templates. By default, it loads templates from store.json and tries to fetch the latest version from a remote server.

Adding Custom Templates

To add custom templates, edit the store.json file:

[
  {
    "name": "Template Name",
    "value": "github:username/repository"
  }
]

Development

# Clone the repository
git clone https://github.com/oiij/oiic.git
cd oiic

# Install dependencies
pnpm install

# Start development mode with watch
pnpm dev

# Run the source code directly
pnpm start

# Type checking
pnpm type:check

Building

# Build the project
pnpm build

The build output will be in the dist directory.

Testing

# Run tests
pnpm test

# Run tests with UI
pnpm test --ui

Linting

# Lint code
pnpm lint

# Fix linting issues
pnpm lint:fix

Documentation

# Start documentation site in development mode
pnpm docs:dev

# Build documentation site
pnpm docs:build

# Preview built documentation site
pnpm docs:preview

Committing Changes

This project uses conventional commits with commitlint and cz-git.

# Stage changes and commit with interactive prompt
pnpm commit

# Or use commitizen directly
pnpm cz

Publishing

# Bump version and publish to npm
pnpm release

Scripts

Script Description
pnpm dev Start development mode with watch
pnpm build Build the project
pnpm start Run source code directly
pnpm test Run tests
pnpm lint Lint code
pnpm lint:fix Fix linting issues
pnpm type:check Run TypeScript type checking
pnpm docs:dev Start documentation site
pnpm docs:build Build documentation site
pnpm commit Interactive commit with conventional commits
pnpm release Bump version and publish
pnpm update:deps Update dependencies interactively

License

MIT License ยฉ 2024 oiij

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (pnpm commit)
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Generated from oiij/ts-starter-old