Skip to content

Latest commit

 

History

History
163 lines (132 loc) · 4.04 KB

README-zh_EN.md

File metadata and controls

163 lines (132 loc) · 4.04 KB
logo

SeaLion Client is a toolkit for building front-end projects and code


Static Badge Static Badge Static Badge Static Badge

English· 简体中文

Quick Start

Create project

slc create my-app
cd my-app
npm run dev

logo

Open http://localhost:5173 to view.
When you are ready to deploy to a production environment,Run npm run build to generate the compressed bundle.

Create React component

slc g -c my-component

logo


This creates the my-component component in the current directory.

Feature

  • Template technology stack: react + typescript + less;
  • You can choose vite or webpack as the packaging tool;
  • Basic component materials can be created quickly.

Install

# mac and ubuntu need to add sudo
npm install -g sea-lion-client

Function


Create app

slc create my-app

The project directory is as follows (the default template is used as an example to list common files)

my-app
├── env
├── mock
├── node_modules
├── public
├── script
├── vite.config.ts
├── index.html
└── src
    ├── assets          # Static resources
    ├── components      # Project Common Components
    ├── config          # Configuration files for similar permission functions
    ├── interceptors    # response & request middleware, based on axios development
    ├── layouts         # Layout components
    ├── locales         # Internationalized Text Materials
    ├── routes          # Routers
    ├── services        # Interface request function
    └── styles          # Project Common Style
    └── utils           # Tool Function
    └── app.tsx
    └── main.tsx       
    └── vite-env.d.ts

Use the template to create the app
# Create my-app using template @sea-lion/app-template
slc create my-app -t @sea-lion/app-vite-template

Template Options

Template Function Note
@sea-lion/app-vite-template Project development environment built with vite Default template, recommended
@sea-lion/lib-template Project development environment built with rollup
@sea-lion/app-template Project development environment built with webpack5 Stop Maintenance

Create component

cd ./src/components
slc g -c my-component

The generator is shown in the figure below. When using slc to create materials and projects, slc first performs a rename file validation in the current directory to avoid overwriting.




View Version

slc -v

Development

Install dependencies

lerna bootstrap

Run locally

node packages/sea-lion-client/bin/sea-lion-client.js create [app-name]