# lerna-command-gpm-import

> import git repo like git submodule

Latest version **0.0.17** (published 2024-09-10) · 0 weekly downloads

## Install

```sh
npm install lerna-command-gpm-import
pnpm add lerna-command-gpm-import
yarn add lerna-command-gpm-import
bun add lerna-command-gpm-import
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.17 |
| Published | 2024-09-10 |
| First published | 2021-04-21 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 11 |
| Unpacked size | 22.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | imcuttle |
| Maintainers | moyuyc |
| Keywords | imcuttle, gpm-import, imcuttle, lerna, commands, lerna-commands |

## Links

- npm: https://www.npmjs.com/package/lerna-command-gpm-import
- Repository: https://github.com/imcuttle/lerna-gpm
- Homepage: https://github.com/imcuttle/lerna-gpm#readme
- Issues: https://github.com/imcuttle/lerna-gpm/issues
- npm.io page: https://npm.io/package/lerna-command-gpm-import

## Dependencies (11)

- [execa](https://npm.io/package/execa.md) ^5.0.0
- [json5](https://npm.io/package/json5.md) ^2.2.0
- [find-up](https://npm.io/package/find-up.md) ^5.0.0
- [@lerna/command](https://npm.io/package/@lerna/command.md) ^4.0.0
- [lerna-utils-gpm](https://npm.io/package/lerna-utils-gpm.md) ^0.0.13
- [lodash.template](https://npm.io/package/lodash.template.md) ^4.5.0
- [write-json-file](https://npm.io/package/write-json-file.md) ^4.3.0
- [@lerna/bootstrap](https://npm.io/package/@lerna/bootstrap.md) ^4.0.0
- [@lerna/validation-error](https://npm.io/package/@lerna/validation-error.md) ^4.0.0
- [lerna-command-gpm-alias](https://npm.io/package/lerna-command-gpm-alias.md) ^0.0.2
- [lerna-utils-git-command](https://npm.io/package/lerna-utils-git-command.md) ^0.0.12

## Recent versions

- 0.0.17 (latest) — 2024-09-10
- 0.0.16 — 2021-06-18
- 0.0.15 — 2021-05-20
- 0.0.14 — 2021-05-09
- 0.0.13 — 2021-04-29
- 0.0.12 — 2021-04-27
- 0.0.11 — 2021-04-27
- 0.0.10 — 2021-04-27
- 0.0.9 — 2021-04-27
- 0.0.8 — 2021-04-22
- 0.0.6 — 2021-04-22
- 0.0.5 — 2021-04-21
- 0.0.4 — 2021-04-21
- 0.0.3 — 2021-04-21

## README

# lerna-command-gpm-import

[![NPM version](https://img.shields.io/npm/v/lerna-command-gpm-import.svg?style=flat-square)](https://www.npmjs.com/package/lerna-command-gpm-import)
[![NPM Downloads](https://img.shields.io/npm/dm/lerna-command-gpm-import.svg?style=flat-square&maxAge=43200)](https://www.npmjs.com/package/lerna-command-gpm-import)
[![Prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://prettier.io/)
[![Conventional Commits](https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square)](https://conventionalcommits.org)

> import git repo like git submodule

## Usage

```bash
# 允许导入本地文件 或 远端giturl
lerna gpm-import <url_or_dir>
```

```json5
// lerna.json
{
  packages: ['packages/*'],
  extendCommands: ['@tutor/lerna-command-gpm-alias'],
  command: {
    'gpm-import': {}
  },
  version: '0.0.0',
  gpm: {}
}
```

### Options

#### `alias`

导入完成后，是否执行 gpm-alias

- Type: `boolean`
- Default: `true`

#### `bootstrap`

导入完成后，是否执行 lerna bootstrap

- Type: `boolean`
- Default: `true`

#### `remote`

Git remote name

- Type: `string`
- Default: `"origin"`

#### `branch`

Git branch name

- Type: `string`
- Default: `"master"`

#### `checkout`

Git checkout keyword, (eg. HEAD)

- Type: `string`

#### `name`

包名

- Type: `string`
- Default: 推导自 gpm `package.json`

#### `dest`

写入的文件夹

- Type: `string`
- Default: 推导自 `lerna.json` packages 配置

#### `nestedHoist`

当发生 gpm 资源嵌套，是否将嵌套 gpm 资源提升

- Type: `string`
- Default: `false`

#### `gitCloneUser`

执行 git clone 时，传入的 username；一般在需要权限的情况下传入

- Type: `string`

#### `gitCloneUserEnvName`

执行 git clone 时，传入的 username（来自于环境变量）；

- Type: `string`

#### `gitClonePassword`

执行 git clone 时，传入的 password；一般在需要权限的情况下传入

- Type: `string`

#### `gitClonePasswordEnvName`

执行 git clone 时，传入的 password（来自于环境变量）；

- Type: `string`

## Contributing

- Fork it!
- Create your new branch:  
  `git checkout -b feature-new` or `git checkout -b fix-which-bug`
- Start your magic work now
- Make sure npm test passes
- Commit your changes:  
  `git commit -am 'feat: some description (close #123)'` or `git commit -am 'fix: some description (fix #123)'`
- Push to the branch: `git push`
- Submit a pull request :)

## Authors

This library is written and maintained by [imcuttle](mailto:imcuttle@163.com).

## License

MIT - [imcuttle](mailto:imcuttle@163.com)

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