open-index/open-npm huggingface dataset:
npm package: @mincho-js/css-additional-types
Description: Additional typeScript types for style based on MDN data
Latest version: 0.1.0

# @mincho-js/css-additional-types

The @mincho-js/css-additional-types supplies types generated by the automation.

## Install

```shell
npm install @mincho-js/css-additional-types

# or
yarn add @mincho-js/css-additional-types

# or
pnpm install @mincho-js/css-additional-types
```

## API

The following is a list of extended types and predeclared objects.

### Types

1. `CamelPseudos`: Camelized pseudo selectors and pseudo elements instead of kebab-case
2. `SpacePropertiesKey`: Property keys with values that can be merged into Space
3. `CommaPropertiesKey`: Property keys with values that can be merged into Comma
4. `ShorthandProperties`: Shorthand properties
5. `NestedPropertiesMap`: When a shorthand property appears as a nested


### Objects

1. `shorthandProperties`: Actual value of `ShorthandProperties`
2. `nestedPropertiesMap`: Actual value of `NestedPropertiesMap`
npm package: @mincho-js/debug-log
Description: A utility library for easier console debugging and comparison of JavaScript object values
Latest version: 1.1.0

# @mincho-js/debug-log

This was created to make console debugging easier when you often need to compare JavaScript object values.

## Install

```shell
npm install @mincho-js/debug-log

# or
yarn add @mincho-js/debug-log

# or
pnpm install @mincho-js/debug-log
```

## API
### `debugLog`

The count is incremented automatically with each call.

![debugLog](https://github.com/user-attachments/assets/a0a2b545-be99-4db2-98d9-cc4535563d8a)

```typescript
debugLog();
console.log("test");

debugLog("with title debugLog");
console.log("test2");
```

### `jsonLog`

Output JSON with the debug log.
If you just want to print JSON purely, use `jsonPrint`.

![image](https://github.com/user-attachments/assets/e5bb7c93-baec-419c-8472-19b014d72ce0)

```typescript
jsonLog({ key1: true, key2: 1, key3: null, key4: "string" });
jsonLog("with title jsonLog", { others: undefined });
```

### `jsonExpect`

Compare the JSON and show the differences.

![image](https://github.com/user-attachments/assets/941dc0a8-aa9a-4196-877d-417a912e81d1)

```typescript
jsonExpect({ a: 1 }, { a: 2 });
jsonExpect("with title jsonExpect", { b: 1 }, { c: "1" });
```
npm package: @mincho-js/pretify-deep-diff
Description: A utility to prettify the results of deep-diff with emojis and localization support.
Author: sharkaev.ph@gmail.com
Latest version: 1.0.5

# pretify-deep-diff

A utility to prettify the results of `deep-diff` with emojis and localization support.

## Installation

To install the package, use npm:

```bash
npm install pretify-deep-diff
```

## Usage

Here's an example of how to use `pretify-deep-diff`:

```javascript
const diff = require("deep-diff");
const pretifyDeepDiff = require("pretify-deep-diff");

const lhs = {
  name: "John",
  age: 30,
  pets: ["dog", "cat"],
  address: {
    city: "Chicago",
    street: "Main St",
  },
};

const rhs = {
  name: "Jane",
  age: 31,
  pets: ["dog", "parrot"],
  city: "New York",
};

const changes = diff(lhs, rhs);

console.log(pretifyDeepDiff(changes, { locale: "ru" }));
```

### Output

```text
 Добавлено:
➕ Добавлено: city = "New York"
❌ Удалено:
❌ Удалено: address
✏️ Изменено:
✏️ Изменено: name с "John" на "Jane"
✏️ Изменено: age с 30 на 31
✏️ Изменено: pets.1 с "cat" на "parrot"
```

## Options

- `locale`: Specify the locale (`en` or `ru`). Default is `en`.
- `customTexts`: An object to customize text templates.

## Localization

The library supports localization through JSON files in the `locales` directory.
npm package: @mincho-js/transform-to-vanilla
Description: Convert objects that need preprocessing into Vanilla Extract object
Latest version: 0.2.2

# @mincho-js/transform-to-vanilla

CSS in JS syntax converter for [Vanilla Extract](https://github.com/vanilla-extract-css/vanilla-extract)

## Install

```shell
npm install @mincho-js/transform-to-vanilla

# or
yarn add @mincho-js/transform-to-vanilla

# or
pnpm install @mincho-js/transform-to-vanilla
```

## API

### transform

Convert to a vanilla extract object according to the [CSS Literals](https://github.com/mincho-js/working-group/blob/main/text/000-css-literals.md) and [CSS Nesting](https://github.com/mincho-js/working-group/blob/main/text/001-css-nesting.md) RFCs.

```typescript
import { transform } from "@mincho-js/transform-to-vanilla";

transform(styleObj);
transform(styleObj, context);
```

### TransformContext

The context type of the `transform`.

```typescript
import type { TransformContext } from "@mincho-js/transform-to-vanilla";

const initTransformContext: TransformContext = {
  result: {},
  basedKey: "",
  parentSelector: "",
  parentAtRules: {
    "@media": "",
    "@supports": "",
    "@container": "",
    "@layer": ""
  },
  propertyReference: {},
  variantMap: {},
  variantReference: {}
};
```
npm package: @minchopm/ngx-json-viewer
Description: JSON formatter / viewer for Angular
Author: Mincho Milev
Latest version: 3.2.2

# NgxJsonViewer

This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 11.2.14.

## Code scaffolding

Run `ng generate component component-name --project ngx-json-viewer` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project ngx-json-viewer`.
> Note: Don't forget to add `--project ngx-json-viewer` or else it will be added to the default project in your `angular.json` file. 

## Build

Run `ng build ngx-json-viewer` to build the project. The build artifacts will be stored in the `dist/` directory.

## Publishing

After building your library with `ng build ngx-json-viewer`, go to the dist folder `cd dist/ngx-json-viewer` and run `npm publish`.

## Running unit tests

Run `ng test ngx-json-viewer` to execute the unit tests via [Karma](https://karma-runner.github.io).

## Further help

To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
npm package: @mincloud/cli
Description: 基于知晓云生态的命令行工具，旨在提供一种简单、快捷的方式，帮助开发者快速处理知晓云相关的业务。
Author: anran758
Latest version: 0.0.3
Deprecated: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

# @mincloud/cli

[![npm version](https://badge.fury.io/js/%40mincloud%2Fcli.svg)](https://badge.fury.io/js/%40mincloud%2Fcli)
[![GitHub](https://img.shields.io/github/license/anran758/mincloud)](https://github.com/anran758/mincloud/blob/master/LICENSE)

> :loudspeaker: 迁移通知：由于 mincloud 和知晓云官方脚手架 faas-cli 提供的 `mincloud` command 重名，因此后续迭代都将在 [@mincloudx/cli](https://www.npmjs.com/package/@mincloudx/cli) 中继续迭代。

基于知晓云生态的命令行工具，旨在提供一种简单、快捷的方式，帮助开发者快速处理知晓云相关的业务。

**Table of Contents**

- [Installation](#installation)
- [Usage](#usage)
- [Commands](#commands)
  - [login](#login)
  - [type](#type)
  - [help](#help)
- [Development](#development)

## Installation

可以通过 yarn 或 npm 安装：

```bash
# 通过 yarn 安装
yarn add @mincloud/cli -D

# 通过 npm 安装
npm install @mincloud/cli -D
```

## Usage

```bash
min-cloud [command] [options]
```

| Commands        | Description                   |
| --------------- | ----------------------------- |
| [login](#login) | 登录知晓云                    |
| [type](#type)   | 将知晓云数据表转换 TypeScript |
| [help](#help)   | 输出命令的帮助信息。          |

**Global Options:**

- `-V, --version`：输出版本号
- `--envId <envId>`：设置环境 ID
- `-h, --help`：输出帮助信息

## Commands

### login

```bash
min-cloud login [options] <clientSecret> [clientId]
```

**Parameter:**

- `clientSecret`: 知晓云应用的密钥。
- `clientId`: 知晓云应用的 clint_id，默认从 rc 文件中读取。

**Example:**

```bash
min-cloud login myClientSecret myClientId
```

### type

```bash
min-cloud type [options]
```

根据知晓云数据表转换成对应的 TypeScript 的 .d.ts 类型文件

- `--fromMinCloud`: 通过读取线上的知晓云数据表信息来转换类型文件。默认为 false。
- `-f, --schemaFile <path>`: 解析本地的 JSON 数据表文件来转换 TypeScript。默认为 "./\_schema.json"。
- `--outputDir <path>`: 类型文件的输出目录。默认为 "./typings"。
- `--outputFileName <fileName>`: 类型文件的文件名。默认为 "schema"。

---

转换知晓云的数据表结构为 `.d.ts` 文件主要有两种方案：

**第一种**: 登录知晓云账号后，直接读取线上最新的数据表记录来转换

```bash
min-cloud type --fromMinCloud
```

**第二种**： 若顾虑安全问题或其他因素考虑，还可以通过直接读取本地的 schema JSON 文件来转换：

进入知晓云控制面板后，打开浏览器开发者工具，在 network 找到 `dserve/v1.8/schema/?offset=0&limit=200` 这条请求，并将 response 保存为 `_schema.json` 文件放置与 package.json 同级目录中。

![copy response](static/network-save-response.png)

```bash
# 生成类型，默认读取当前目录下的 _schema.json 文件来生成 TypeScript 类型文件
min-cloud type --schemaFile ./_schema.json
```

### help

输出命令的帮助信息。

**Parameter:**

- `command`: 要输出帮助信息的命令名称

**Example:**

```bash
# 查看 type 命令的使用方式
min-cloud help type
```

## Development

运行以下命令进行开发：

```shell
# 监听项目中的文件变化
yarn watch

# 执行本地编译后的 cli 文件
yarn test
```

项目初始化使用 `yarn install` 或 `yarn` 安装依赖时会自动将 bin 安装到 node_modules 中。

若在开发过程中修改了 bin 名称，可在对应 package 中先通过 `yarn unlink` 取消关联，再通过 `yarn link` 重新关联。
npm package: @mincloudx/faas
Description: A more user-friendly Node.js cloud function development framework.
Author: anran758
Latest version: 0.4.2

# @mincloudx/faas

![Version](https://badgen.net/npm/v/@mincloudx/faas)
![TypeScript](https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555)

> A more user-friendly Node.js cloud function development framework, designed to simplify interactions with Backend-as-a-Service (BaaS) and ensure consistent response structures.

## Features

- **Default Parameter Handling**: Automatically transforms `null` or missing `event.data` into an empty object, ensuring your function always receives a valid event object.
- **Unified Return Format**: Standardizes the return format of cloud functions. Non-object returns are wrapped as `{data: value}`, while object returns are passed through as-is.
- **BaaS SDK Version Management**: By default, uses the latest SDK version available but allows for explicit version setting or opting out of version updates.

## Usage

### Installation

```bash
pnpm install @mincloudx/faas
```

### Creating a Cloud Function

In your cloud function file, import and use `createFaas` to wrap your main function. This not only standardizes the behavior of your cloud function but also handles BaaS SDK version management and event data preprocessing.

```ts
import { createFaas, FAAS_LATEST_SDK_VERSION } from '@mincloudx/faas';

async function main(event) {
  // Your function logic here
  console.log(`event:`, event);

  return { status: 'ok' };
}

export default createFaas(main, {
  updateVersion: true, // Optional: Ensures the BaaS SDK is always up-to-date. Default is true.
  version: 'specific-version', // Optional: Set a specific BaaS SDK version if required.
});
```

### Test

Ensure the reliability and correctness of your functions by testing with Jest. The framework provides a streamlined way to test various scenarios, such as default parameter handling, unified return format, and BaaS SDK version management.

```bash
pnpm run test
```

## Development

### Compiling TypeScript

Prepare your package for use by compiling TypeScript files.

```bash
pnpm run tsc
```

### Watch Mode

Automatically recompile TypeScript files upon changes for efficient development.

```bash
pnpm run watch
```

---

This improved README incorporates details from the test cases, emphasizing the utility and flexibility of `createFaas`. It clarifies how users can manage BaaS SDK versions and the behavior of cloud functions with respect to input and return values, providing a comprehensive guide for both usage and development.
npm package: @mincloudx/io
Description: A more convenient tool for MinCloud IO requests, optimized for ease of use and efficiency.
Author: anran758
Latest version: 0.4.2

# @mincloudx/io

The `@mincloudx/io` package simplifies CRUD (Create, Read, Update, Delete) operations on database tables, offering a streamlined interface for table management with minimal setup.

## Installation

Install `@mincloudx/io` in your project using npm or pnpm:

```bash
npm install @mincloudx/io
# or
pnpm add @mincloudx/io
```

## Usage

Begin by importing `createIo` and specifying your tables in the `tables` option to register them. This setup enables CRUD operations on the registered tables.

```javascript
const { createIo } = require('@mincloudx/io');

// Registering tables
const tables = ['channel', 'product'];
const io = createIo({ tables });
```

Access a registered table by appending its name to `io`, such as `io.channel` or `io.product`.

### query

In batch lookup, update, delete, and other operations, the Query object is needed. It is used to describe the characteristics of the data rows that need to be matched.

We can generate and obtain an instance of a `Query` object by reading `io.query`.

```ts
const query = io.product.query;
query.compare('name', '=', 'book');
```

In most cases of query requests, many scenarios involve comparing values to see if they match. `io.getQuery` supports a more convenient way to generate a Query instance. The example code below is equivalent to the one above:

```ts
const query = io.getQuery({ name: 'book' });
```

### create record

create a record:

```ts
const product = await io.product.create({ name: 'New product' });
```

create many record:

```ts
const dataList = [
  { name: 'Product 1', value: 100 },
  { name: 'Product 2', value: 200 },
  { name: 'Product 3', value: 300 },
];

const { operation_result } = await io.product.createMany(dataList);
console.log('result: ', operation_result);

// or
const result = await io.product.createMany(dataList, { plain: false });
console.log('result: ', result.data.operation_result);
```

### update record

```ts
const product = await io.product.update('productId', { name: 'product 2' });
```

### read record

fetch record:

```ts
const product = await io.product.get('recordId');
```

fetch list:

```ts
const query = io.query.compare('deleted', '=', false);
const list = await io.channel.find(query, { offset: 0, limit: 20 });
```

### delete record

delete a record:

```ts
const result = await io.channel.delete('recordId', { offset: 0, limit: 20 });
```

delete many record

```ts
const query = io.query.compare('deleted', '=', true);
const result = await io.channel.deleteMany(query, { offset: 0, limit: 20 });
```

### count

fetch record count:

```ts
const query = io.getQuery({ deleted: false });
const count = await io.channel.deleteMany(query);
```

## Development

```bash
# local develop
pnpm watch

# build package
pnpm build

# run test case
pnpm test
```
npm package: @mincloudx/types
Description: Common TypeScript types in MinCloud.
Author: anran758
Latest version: 0.4.2

# @mincloudx/types

![Version](https://badgen.net/npm/v/@mincloudx/types)
![TypeScript](https://badgen.net/badge/-/TypeScript?icon=typescript&label&labelColor=blue&color=555555)

Common TypeScript types in MinCloud.

## Usage

```bash
pnpm install @mincloudx/types

# or use npm
npm install @mincloudx/types
```

When we need to import the corresponding types, we can do so through the import statement:

```ts
import type { FaaS } from '@mincloudx/types';

interface EventData {
  productId: string;
  name?: string;
}

export default async function userDefinedFunctionProxy(
  evt: FaaS.Event<EventData>,
) {
  const { productId, name = 'mincloudx' } = evt.data;

  return `${name}_${productId}`;
}
```