open-index/open-npm huggingface dataset:
npm package: @obusk/pnpm-plugin-defaults
Description: oBusk defaults for pnpm
Latest version: 0.3.0

# @obusk/pnpm-plugin-defaults

[![NPM Version](https://img.shields.io/npm/v/%40obusk%2Fpnpm-plugin-defaults)](https://www.npmjs.com/package/@obusk/pnpm-plugin-defaults) [![Test](https://github.com/oBusk/pnpm-plugin-defaults/actions/workflows/test.yml/badge.svg)](https://github.com/oBusk/pnpm-plugin-defaults/actions/workflows/test.yml) [![Publish Package](https://github.com/oBusk/pnpm-plugin-defaults/actions/workflows/publish.yml/badge.svg)](https://github.com/oBusk/pnpm-plugin-defaults/actions/workflows/publish.yml)

> oBusk defaults for pnpm

## What it changes

- Sets ignoreWorkspaceRootCheck to `true`
- Sets [minimumReleaseAge](https://pnpm.io/settings#minimumreleaseage) to `4320` (72 hours)
- Sets [trustPolicy](https://pnpm.io/settings#trustpolicy) to `no-downgrade`
- Sets [hoistPattern](https://pnpm.io/settings#hoistpattern) to an empty array, disabling hoisting.
- Sets [ignorePatchFailures](https://pnpm.io/settings#ignorepatchfailures) to `false`.
- Sets [resolutionMode](https://pnpm.io/settings#resolutionmode) to `lowest-direct`.
- Sets [verifyDepsBeforeRun](https://pnpm.io/settings#verifydepsbeforerun) to `install`.
- Sets [blockExoticSubdeps](https://pnpm.io/settings#blockexoticsubdeps) to `true`.
- Sets [strictDepBuilds](https://pnpm.io/settings#strictdepbuilds) to `true`.

You can extend or override these settings in your own `.pnpmfile.cjs`.

## Installation

```
pnpm add --config @obusk/pnpm-plugin-defaults
```

This will add `@obusk/pnpm-plugin-defaults` to the [configDependencies](https://pnpm.io/config-dependencies) field in your `pnpm-workspace.yaml`.

## License

MIT
npm package: @obvcloud/request
Description: request-sdk
Latest version: 0.0.3

# @obvcloud/request

[![NPM version](https://img.shields.io/npm/v/@obvcloud/request.svg?style=flat)](https://npmjs.org/package/@obvcloud/request)
[![NPM downloads](http://img.shields.io/npm/dm/@obvcloud/request.svg?style=flat)](https://npmjs.org/package/@obvcloud/request)

## Install

```bash
$ pnpm install
```

```bash
$ npm run dev
$ npm run build
```

## Usage

1. 在请求文件中,例如 `src/service/api/request.ts` 文件中定义 `RequestInstance` 实例
RequestInstance配置项如下:

| 参数 | 说明 | 类型 | 默认值 |是否必填|
| --- | --- | --- | --- | --- |
| axiosConfig | 请求基础配置 |  axios 框架下AxiosRequestConfig | 无默认值,{baseURL:''} |必填|
| updateTokenCodes | 响应数据中对应更新token 的 code | (string \| number)[] | [66666] |非必填|
| updateTokenFunction |  用于更新token的回调方法 |  function | undefined,可参考下面的示例代码 |非必填|
| backendConfig | 响应数据格式 | object | {codeKey: 'code',dataKey: 'data',msgKey: 'message',successCode: 200} |非必填|
| isBigInt | 是否将响应数据中的bigint进行处理 转换为string | boolean | false |非必填|

示例代码如下:

```js
import { RequestInstance } from '@obvcloud/request';
export async function handleRefreshToken(axiosConfig: AxiosRequestConfig) {
	const { resetAuthStore } = useAuthStore();
	const refreshToken = localStg.get('refreshToken') || '';
	const { data } = await fetchUpdateToken(refreshToken);
	if (data) {
		localStg.set('token', data.token);
		localStg.set('refreshToken', data.refreshToken);

		const config = { ...axiosConfig };
		if (config.headers) {
			config.headers.Authorization = data.token;
		}
		return config;
	}

	resetAuthStore();
	return null;
}
// 初始化请求对象,设置更新 token 的函数
const { url } = getServiceEnvConfig(import.meta.env);
export const request = new RequestInstance({ baseURL: url }, undefined, handleRefreshToken);
```

2. 在接口文件中,例如 `src/service/api/user.ts` 文件中使用 `request` 实例(此文件可以通过 openapi-sdk 生成)

post代码实例

```js

import { request } from './src/service';
export async function postPostWithFormData(body: {
	/** 名称 */
	name?: string;
	/**  角色，来源：字典接口 type=role时获取 */
	role?: string;
}) {
	const formData = new FormData();

	Object.keys(body).forEach((ele) => {
		const item = (body as any)[ele];

		if (item !== undefined && item !== null) {
			if (typeof item === 'object' && !(item instanceof File)) {
				if (item instanceof Array) {
					item.forEach((f) => formData.append(ele, f || ''));
				} else {
					formData.append(ele, JSON.stringify(item));
				}
			} else {
				formData.append(ele, item);
			}
		}
	});

	return request.post<API.RespPostWithJson>('/system/test/postWithFormData', formData, {
		method: 'POST',
		data: formData
	});
}

```

get代码实例:
```js
import { request } from './src/service';
export async function getGetWithParam(
	// 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
	params: API.getGetWithParamParams
) {
	return request.get<API.RespPostWithJson>('/system/test/getWithParam', undefined, {
		method: 'GET',
		params: {
			...params
		}
	});
}

```

3. 调用接口返回数据code不为200需要进行处理时,响应数据中的StatusCode需返回200请求,才可以得到响应数据中的code进行业务处理.例如如下数据:
```json
{
	"code": 1200,
	"message": "success",
	"success": true,
	"data": {
	}
}
```
如需要获得1200,则返回响应的response的StatusCode要设置200
## 请求配置


## Options

TODO

## LICENSE

MIT
npm package: @obvcloud/unocss-preset
Description: UnocssUI css rules for unocss preset.
Author: hefx
Latest version: 0.0.1

# @unocss-ui/preset

The preset for UnocssUI. It's used as style support for components and also as a standalone package.

## Usage

Default, it's included in `unocss-ui`, you don't need to install it again.

For standalone usage, you can install it by:

```
pnpm add -D @unocss-ui/preset
```

Add preset into unocss config.

```ts
// uno.config.ts
import { defineConfig, presetUno } from 'unocss'
import { colors } from 'unocss/preset-mini'

// import { presetUnocssUI } from 'unocss-ui'
import { presetUnocssUI } from '@unocss-ui/preset'

export default defineConfig({
  theme: {
    colors: {
      primary: colors.red,
      secondary: colors.orange,
      accent: colors.yellow,
      success: colors.green,
      info: colors.blue,
      warning: colors.indigo,
      error: colors.violet,
    },
  },
  presets: [
    presetUno(),
    presetUnocssUI(),
  ],
})
```

Then you can use the css classes like this:

```html
<div class="bg-primary-500"> TEST </div>
<!-- Equivalent to -->
<div class="bg-red-500"> TEST </div>
```
npm package: @obvcloud/utils
Description: utils-sdk
Latest version: 0.0.3

# @obvcloud/utils

[![NPM version](https://img.shields.io/npm/v/@obvcloud/utils.svg?style=flat)](https://npmjs.org/package/@obvcloud/utils)
[![NPM downloads](http://img.shields.io/npm/dm/@obvcloud/utils.svg?style=flat)](https://npmjs.org/package/@obvcloud/utils)

## Install

```bash
$ pnpm install
```

```bash
$ npm run dev
$ npm run build
```

## Options

TODO

## LICENSE

MIT