open-index/open-npm huggingface dataset:
npm package: @iicoding/release
Description: ## Setup
Author: iiCoding
Latest version: 0.0.18

# npm release util

## Setup

Install the dependencies:

```bash
pnpm install @iicoding/release
```

## Get started

release your npm library:

```bash
pnpm run icd-release [暂未实现]
```

手动调用方式
1. 根目录下新建 script 文件夹
2. script 文件夹下新建 index.ts
   ```bash
    # 进入到根目录
   mkdir script
   touch index.ts
   
   # or 手动新建
    ```
3. 从 @iicoding/release 中引入各个任务执行函数[每个函数被称为task]
   ```typescript
    import {
    eslint,
    gitPush,
    gitTag,
    executeEnd,
    publishAuth,
    publishAfter,
    publishBefore,
    updateVersion,
    publishing,
    getVersion,
    build,
    release,
    } from '@iicoding/release';

    const defaultTaskQueen = [
   // 该函数需要在这里执行，传入指定的配置文件。默认为[eslint.config.mjs]
    eslint({ configFile: './eslint.config.mjs' }),
    build,
    getVersion,
    updateVersion,
    publishAuth,
   // 发布之前的操作，提供了一个函数，返回 package 的配置项 如果需要求他操作，可以自定义 task
    publishBefore((record) => {
    const omitKeys = ['devDependencies', 'scripts'];
    const newRecord: Record<string, any> = {};
    
        Object.keys(record)
          .filter((key) => {
            return !omitKeys.includes(key);
          })
          .forEach((key) => {
            newRecord[key] = record[key];
          });
    
        return newRecord;
    }),
    publishing,
    publishAfter,
    gitPush,
    gitTag,
    executeEnd,
    ];
    
    const defaultTask = release(defaultTaskQueen);
    
    defaultTask();
    ```
4. 在 package.json 中 script 字段中 添加执行命令
    ```
   "release": "ts-node script/index.ts"
   ```
5. 自定义 task
    ```typescript
    import { NextMethod, NextParams } from "@iicoding/release"; 
    export const customTaskName = (
      next: NextMethod,
      params: NextParams
    ) => {
    // doSomething
    // 期望的执行成功之后，
    next(params);
    // 或者执行失败
   // 执行失败，如果需要回退版本，则调用下方函数,其他逻辑可自行定制
    params.getRegisterProps('rollbackPackage')(
      `发布失败即将进入回退操作 ${error.message}`,
    );
   }
   ```