# pac-cli

> 开发sdk以及vue组件的脚手架

Latest version **1.0.3** (published 2019-04-30) · ISC license · 0 weekly downloads

## Install

```sh
npm install pac-cli
pnpm add pac-cli
yarn add pac-cli
bun add pac-cli
```

Provides the command `pac`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-04-30 |
| First published | 2019-04-27 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 14 |
| Unpacked size | 9.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | 崔海峰 |
| Maintainers | haifengcui |
| Keywords | pac-cli, pac, cli, sdk-cli, sdk |

## Links

- npm: https://www.npmjs.com/package/pac-cli
- Repository: https://github.com/13916253446/pac-cli
- Homepage: https://github.com/13916253446/pac-cli#readme
- Issues: https://github.com/13916253446/pac-cli/issues
- npm.io page: https://npm.io/package/pac-cli

## Dependencies (14)

- [ora](https://npm.io/package/ora.md) ^3.4.0
- [kopy](https://npm.io/package/kopy.md) ^8.3.1
- [chalk](https://npm.io/package/chalk.md) ^2.4.2
- [enquirer](https://npm.io/package/enquirer.md) ^2.3.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^7.0.1
- [async-git](https://npm.io/package/async-git.md) ^1.5.0
- [commander](https://npm.io/package/commander.md) ^2.20.0
- [lru-cache](https://npm.io/package/lru-cache.md) ^5.1.1
- [release-easy](https://npm.io/package/release-easy.md) ^1.1.1
- [child_process](https://npm.io/package/child_process.md) ^1.0.2
- [remote-origin-url](https://npm.io/package/remote-origin-url.md) ^2.0.0
- [github-download-parts](https://npm.io/package/github-download-parts.md) ^2.1.0
- [jstransformer-handlebars](https://npm.io/package/jstransformer-handlebars.md) ^1.1.0
- [validate-npm-package-name](https://npm.io/package/validate-npm-package-name.md) ^3.0.0

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.0.3 (latest) — 2019-04-30
- 1.0.2 — 2019-04-30
- 1.0.1 — 2019-04-30
- 1.0.0 — 2019-04-27

## README

# 特色

1、采用`babel7`新选项`usage`，可以不用手动引入垫片，不用担心引入过多的垫片导致包体积变大，可以放心的使用**ES6+**

2、采用`core-js3`，更优的代码，更多的方法可以使用，比如以下这些：

- 装饰器

```javascript
class MyClass {
  @decorator
  method() {}
}
```

- 私有属性和方法

```javascript
class C {
  static #foo = "bar";
}

class Person {
  #age = 19;

  #increaseAge() {
    this.#age++;
  }

  birthday() {
    this.#increaseAge();
    alert("Happy Birthday!");
  }
}
```

- 管道符

# 关于编译后的代码

为了适配各种环境，分别打出了多个包。

### sdk包的目录结构

```javascript
├── dist
│   ├── *.cjs.js // commonjs规范的包
│   ├── *.es.js // ES Module规范的包
│   ├── *.min.js // IIFE规范的包，可以直接通过<script></script>引入
│   └── *.umd.js // umd规范的包
```

`main`指向的是`*.umd.js`，`module`指向的是`*.es.js`，如果有特殊需求可以直接指定文件来引入

### vue组件包的目录结构

```javascript
├── dist
│   ├── lib-px // 样式单位是px
│   │   ├── *.es.js
│   │   └── *.umd.js
│   ├── lib-rem // 样式单位是rem
│   │   ├── *.es.js
│   │   └── *.umd.js
│   └── lib-vw // 样式单位是vw
│       ├── *.es.js
│       └── *.umd.js
```

`main`指向的是`lib-px/*.umd.js`，`module`指向的是`lib/*.es.js`，如果有特殊需求可以直接指定文件来引入，例如：

```javascript
import Test from 'test/dist/lib-rem/test.es.js'
```

# 用法

脚手架只提供创建项目的能力，打包编译的能力是由创建出来的项目提供的。

```javascript
// 安装脚手架
npm install -g pac-cli

// 创建项目
pac create name
```

```
Options:
  -V, --version      output the version number
  -h, --help         output usage information

Commands:
  create <app-name>  通过pac脚手架创建一个可以快速开发sdk以及vue组件的项目
```

如果在现有的git目录创建项目，可以传递`<app-name>`为`.`，就可以了。

```shell
pac create .
```

---
_Source: https://npm.io/package/pac-cli · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
