slpack is a powerful and simple command-line tool designed to quickly scaffold and initialize frontend projects. It supports multiple templates like React, Vue, TypeScript, and allows you to use either local or remote resources.
- Support for multiple project templates (React, Vue, Vanilla, etc.)
- Option to use local or remote templates
- Quickly generate project structure and initialize dependencies
-
Install slpack globally:
npm install -g slpack
-
Create a new project:
slpack create my-new-project
-
Choose a project template and complete the initialization. The project will be created in the current directory.
Specify the template to use for your project. Available options include:
react
: Standard React project.react-ts
: React project using TypeScript.vue
: Standard Vue project.vue-ts
: Vue project using TypeScript.vanilla
: Vanilla JavaScript project.vanilla-ts
: Vanilla JavaScript project using TypeScript.
If no template is specified, the CLI will prompt you to select one.
Use local template resources instead of fetching them from a remote source. Default is false
.
Here are some common usage examples:
Creating a React project
slpack create my-react-app -t react
Using local resources to create a Vue project
slpack create my-vue-app -t vue --local
We welcome any contributions to slpack! Here's how you can contribute:
git clone https://github.com/pgshaunl/slpack.git
cd slpack
npm install
The project is organized as follows:
├─ packages
│ ├─ cli
│ │ ├─ bin
│ │ │ └─ slpack
│ │ ├─ dist
│ │ │ └─ index.js
│ │ ├─ package.json
│ │ ├─ src
│ │ │ ├─ cli.ts
│ │ │ ├─ commands
│ │ │ │ ├─ base
│ │ │ │ │ ├─ build.ts
│ │ │ │ │ ├─ create.ts
│ │ │ │ │ ├─ info.ts
│ │ │ │ │ ├─ preview.ts
│ │ │ │ │ └─ serve.ts
│ │ │ │ ├─ index.ts
│ │ │ │ └─ registerCommand.ts
│ │ │ ├─ constants
│ │ │ │ └─ templates.ts
│ │ │ ├─ index.ts
│ │ │ ├─ types
│ │ │ │ └─ template.ts
│ │ │ └─ utils
│ │ │ ├─ loadTemplate.ts
│ │ │ ├─ logger.ts
This structure shows the following key parts:
bin/slpack
: Entry point for the CLI executable.src/commands
: Contains the CLI commands such ascreate
,build
,info
, etc.src/utils
: Utility functions for environment setup, logging, validation, and more.src/constants
: Contains template-related constants.
You can test your changes locally using npm link:
npm link
slpack create test-project
- Update documentation
- Small fix
- Initial release with support for React, Vue, and Vanilla templates
This project is licensed under the MIT License.