# rush-archive-project-plugin

> Rush plugin to archive project

Latest version **1.2.2** (published 2024-10-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install rush-archive-project-plugin
pnpm add rush-archive-project-plugin
yarn add rush-archive-project-plugin
bun add rush-archive-project-plugin
```

Provides the command `rush-project-archiver`.

## Health

**Score 25/100 (F)** — status: maintenance-mode.

Positive: no vulnerabilities.

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

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.2 |
| Published | 2024-10-29 |
| First published | 2021-12-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Unpacked size | 78.4 KB |
| Known vulnerabilities | 0 (+13 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | chengcyber, tiktok-service |
| Keywords | rush, plugin, archive, project |

## Links

- npm: https://www.npmjs.com/package/rush-archive-project-plugin
- Repository: https://github.com/tiktok/rush-plugins
- Homepage: https://github.com/tiktok/rush-plugins#readme
- Issues: https://github.com/tiktok/rush-plugins/issues
- npm.io page: https://npm.io/package/rush-archive-project-plugin

## Dependencies (7)

- [ora](https://npm.io/package/ora.md) 5.4.1
- [tar](https://npm.io/package/tar.md) ~6.1.11
- [yargs](https://npm.io/package/yargs.md) ~17.3.0
- [json2md](https://npm.io/package/json2md.md) ~2.0.0
- [inquirer](https://npm.io/package/inquirer.md) ~8.2.0
- [@rushstack/rush-sdk](https://npm.io/package/@rushstack/rush-sdk.md) 5.62.4
- [@rushstack/node-core-library](https://npm.io/package/@rushstack/node-core-library.md) 3.62.0

## Recent versions

- 1.2.2 (latest) — 2024-10-29
- 1.1.5-pr51.0 (pr51) — 2023-01-04
- 1.2.1 — 2023-12-19
- 1.2.0 — 2023-09-26
- 1.1.7 — 2023-01-18
- 1.1.6 — 2023-01-16
- 1.1.5 — 2023-01-07
- 1.1.4 — 2022-08-31
- 1.1.3 — 2022-02-24
- 1.1.2 — 2022-02-24
- 1.1.1 — 2021-12-14
- 1.1.0 — 2021-12-14
- 1.0.1 — 2021-12-13
- 1.0.0 — 2021-12-12
- 0.1.0 — 2021-12-12

## README

# rush-archive-project-plugin

A rush plugin for archive/unarchive project source code in monorepo.

# Prerequisite

Rush.js >= 5.57.0

# Quick Start

1. Enabling this rush plugin

Please follow the [official doc](https://rushjs.io/pages/maintainer/using_rush_plugins/) to enable this plugin in your repo.


2. Running archive project command

```
rush archive-project --package-name <your_package_name>
```

> restoring your code by `rush unarchive-project --package-name <your_package_name>`

# Archive working process

1. Find project configuration by Rush.js SDK
2. Check whether there are projects depends on target project
3. Run `git clean -xdf` under project folder
4. Create a checkpoint branch with the name `${projectName}-checkpoint-${date}`
5. Update checkpoint branch information in `common/_graveyard/projectCheckpoints.json` file
6. Record project configuration into `rush-metadata.json` file
7. Create a tarball by running `tar -czf <unscoped_package_name>.tar.gz -C <project_folder> .`
8. Move the tarball to `common/_graveyard` folder
9. Remove project config to `rush.json`
10. Delete project folder

# Unarchive working process

1. Find the tarball by `packageName`
2. Extract the tarball by running `tar xf <package_name>.tar.gz`
3. Get project configuration by reading `rush-metadata.json`
4. Remove checkpoint branch information from checkpoint metadata file if it exists
5. Move the code to project folder
6. Restore project configuration into `rush.json`
7. Delete metadata file and tarball

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