Skip to content

Commit

Permalink
chore: optimize packaging
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Apr 25, 2024
1 parent cdbcee4 commit f3f1b36
Show file tree
Hide file tree
Showing 11 changed files with 332 additions and 60 deletions.
34 changes: 34 additions & 0 deletions packages/sheets-filter-ui/README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# @univerjs/sheets-filter-ui

[![npm version](https://img.shields.io/npm/v/@univerjs/sheets-filter-ui)](https://npmjs.org/packages/@univerjs/sheets-filter-ui)
[![license](https://img.shields.io/npm/l/@univerjs/sheets-filter-ui)](https://img.shields.io/npm/l/@univerjs/sheets-filter-ui)
![CSS Included](https://img.shields.io/badge/CSS_Included-blue?logo=CSS3)
![i18n](https://img.shields.io/badge/zh--CN%20%7C%20en--US-cornflowerblue?label=i18n)

## 简介

`@univerjs/sheets-filter-ui` 为 sheets 提供了筛选功能的用户界面。

## 使用指南

你应该将此插件与 `@univerjs/sheets-filter` 包一起使用。

```ts
import '@univerjs/sheets-filter-ui/lib/index.css';

import { UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';
import { UniverSheetsFilterUIPlugin } from '@univerjs/sheets-filter-ui';

univer.registerPlugin(UniverSheetsFilterPlugin);
univer.registerPlugin(UniverSheetsFilterUIPlugin);
```

### 安装

```shell
# 使用 npm
npm install @univerjs/sheets-filter-ui

# 使用 pnpm
pnpm add @univerjs/sheets-filter-ui
```
26 changes: 22 additions & 4 deletions packages/sheets-filter-ui/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
# @univerjs/sheets-filter-ui

[![npm version](https://img.shields.io/npm/v/@univerjs/0.1.1)](https://npmjs.org/packages/@univerjs/0.1.1)
[![license](https://img.shields.io/npm/l/@univerjs/0.1.1)](https://img.shields.io/npm/l/@univerjs/0.1.1)
[![npm version](https://img.shields.io/npm/v/@univerjs/sheets-filter-ui)](https://npmjs.org/packages/@univerjs/sheets-filter-ui)
[![license](https://img.shields.io/npm/l/@univerjs/sheets-filter-ui)](https://img.shields.io/npm/l/@univerjs/sheets-filter-ui)
![CSS Included](https://img.shields.io/badge/CSS_Included-blue?logo=CSS3)
![i18n](https://img.shields.io/badge/zh--CN%20%7C%20en--US-cornflowerblue?label=i18n)

## Introduction

> TODO: Introduction
`@univerjs/sheets-filter-ui` provides a user interface for filtering in sheets.

## Usage

You should use this plugin with the `@univerjs/sheets-filter` package.

```ts
import '@univerjs/sheets-filter-ui/lib/index.css';

import { UniverSheetsFilterPlugin } from '@univerjs/sheets-filter';
import { UniverSheetsFilterUIPlugin } from '@univerjs/sheets-filter-ui';

univer.registerPlugin(UniverSheetsFilterPlugin);
univer.registerPlugin(UniverSheetsFilterUIPlugin);
```

### Installation

```shell
npm i @univerjs/0.1.1
# Using npm
npm install @univerjs/sheets-filter-ui

# Using pnpm
pnpm add @univerjs/sheets-filter-ui
```
26 changes: 13 additions & 13 deletions packages/sheets-filter-ui/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@univerjs/sheets-filter-ui",
"version": "0.0.1",
"private": true,
"description": "",
"version": "0.1.7",
"private": false,
"description": "Univer Sheets Filter UI",
"author": "DreamNum <developer@univer.ai>",
"license": "Apache-2.0",
"funding": {
Expand Down Expand Up @@ -67,14 +67,14 @@
"@univerjs/sheets-filter": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
"@wendellhu/redi": ">=0.12.13",
"clsx": ">=2.0.0",
"react": ">=16.9.0",
"@wendellhu/redi": "^0.13.3",
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0",
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/icons": "^0.1.42",
"rc-virtual-list": "^3.11.4"
"@univerjs/icons": "^0.1.44",
"rc-virtual-list": "^3.11.5"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand All @@ -85,13 +85,13 @@
"@univerjs/sheets-filter": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
"@wendellhu/redi": "^0.13.1",
"clsx": "^2.1.0",
"@wendellhu/redi": "^0.13.3",
"clsx": "^2.1.1",
"less": "^4.2.0",
"react": "^18.2.0",
"rxjs": "^7.8.1",
"typescript": "^5.3.3",
"vite": "^5.1.4",
"vitest": "^1.3.1"
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vitest": "^1.5.2"
}
}
22 changes: 22 additions & 0 deletions packages/sheets-filter/README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# @univerjs/sheets-filter

[![npm version](https://img.shields.io/npm/v/@univerjs/sheets-filter)](https://npmjs.org/packages/@univerjs/sheets-filter)
[![license](https://img.shields.io/npm/l/@univerjs/sheets-filter)](https://img.shields.io/npm/l/@univerjs/sheets-filter)

## 简介

`@univerjs/sheets-filter` 是 Univer Sheet 的筛选插件。

## 使用指南

你应该将此插件与 `@univerjs/sheets-filter-ui` 包一起使用。

### 安装

```shell
# 使用 npm
npm install @univerjs/sheets-filter

# 使用 pnpm
pnpm add @univerjs/sheets-filter
```
14 changes: 10 additions & 4 deletions packages/sheets-filter/README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
# @univerjs/sheets-filter

[![npm version](https://img.shields.io/npm/v/@univerjs/0.0.1)](https://npmjs.org/packages/@univerjs/0.0.1)
[![license](https://img.shields.io/npm/l/@univerjs/0.0.1)](https://img.shields.io/npm/l/@univerjs/0.0.1)
[![npm version](https://img.shields.io/npm/v/@univerjs/sheets-filter)](https://npmjs.org/packages/@univerjs/sheets-filter)
[![license](https://img.shields.io/npm/l/@univerjs/sheets-filter)](https://img.shields.io/npm/l/@univerjs/sheets-filter)

## Introduction

> TODO: Introduction
`@univerjs/sheets-filter` is a filter plugin for Univer Sheet.

## Usage

You should use this plugin with the `@univerjs/sheets-filter-ui` package.

### Installation

```shell
npm i @univerjs/0.0.1
# Using npm
npm install @univerjs/sheets-filter

# Using pnpm
pnpm add @univerjs/sheets-filter
```
20 changes: 9 additions & 11 deletions packages/sheets-filter/package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@univerjs/sheets-filter",
"version": "0.1.1",
"private": true,
"description": "",
"version": "0.1.7",
"private": false,
"description": "A library for filtering data in Univer Sheet",
"author": "DreamNum <developer@univer.ai>",
"license": "Apache-2.0",
"funding": {
Expand Down Expand Up @@ -58,21 +58,19 @@
},
"peerDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@wendellhu/redi": ">=0.12.13",
"@wendellhu/redi": "^0.13.3",
"rxjs": ">=7.0.0"
},
"dependencies": {
},
"dependencies": {},
"devDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@wendellhu/redi": "^0.13.1",
"@wendellhu/redi": "^0.13.3",
"rxjs": "^7.8.1",
"typescript": "^5.3.3",
"vite": "^5.1.4",
"vitest": "^1.3.1"
"typescript": "^5.4.5",
"vite": "^5.2.10",
"vitest": "^1.5.2"
}
}
21 changes: 20 additions & 1 deletion packages/umd/README-zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@

## 简介

`@univerjs/umd` 是 Univer 的 UMD 包。它是一个独立的库版本,可以在任何 web 项目中使用,无需模块打包工具。

## 使用指南

### 安装
您可以使用以下脚本标签在 HTML 文件中包含 UMD 包:

```html
<script src="https://unpkg.com/@univerjs/umd/lib/univer.full.umd.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@univerjs/umd/lib/univer.css">
```

如果您的项目中已经使用了 React、ReactDOM 和 RxJS,您可以选择 UMD 包的精简版本,该版本不包含这些依赖项。

```diff
+ <script src="https://unpkg.com/react/umd/react.production.min.js"></script>
+ <script src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"></script>
+ <script src="https://unpkg.com/rxjs/dist/bundles/rxjs.umd.min.js"></script>

- <script src="https://unpkg.com/@univerjs/umd/lib/univer.full.umd.js"></script>
+ <script src="https://unpkg.com/@univerjs/umd/lib/univer.slim.umd.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@univerjs/umd/lib/univer.css">
```
21 changes: 20 additions & 1 deletion packages/umd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@

## Introduction

`@univerjs/umd` is a UMD bundle for Univer. It is a standalone version of the library that can be used in any web project without the need for a module bundler.

## Usage

### Installation
You can include the UMD bundle in your HTML file using the following script tag:

```html
<script src="https://unpkg.com/@univerjs/umd/lib/univer.full.umd.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@univerjs/umd/lib/univer.css">
```

If you are already using React, ReactDOM, and RxJS in your project, you can opt for the slim version of the UMD bundle, which excludes these dependencies.

```diff
+ <script src="https://unpkg.com/react/umd/react.production.min.js"></script>
+ <script src="https://unpkg.com/react-dom/umd/react-dom.production.min.js"></script>
+ <script src="https://unpkg.com/rxjs/dist/bundles/rxjs.umd.min.js"></script>

- <script src="https://unpkg.com/@univerjs/umd/lib/univer.full.umd.js"></script>
+ <script src="https://unpkg.com/@univerjs/umd/lib/univer.slim.umd.js"></script>
<link rel="stylesheet" href="https://unpkg.com/@univerjs/umd/lib/univer.css">
```
2 changes: 2 additions & 0 deletions packages/umd/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
"@univerjs/sheets-conditional-formatting": "workspace:*",
"@univerjs/sheets-conditional-formatting-ui": "workspace:*",
"@univerjs/sheets-data-validation": "workspace:*",
"@univerjs/sheets-filter": "workspace:*",
"@univerjs/sheets-filter-ui": "workspace:*",
"@univerjs/sheets-find-replace": "workspace:*",
"@univerjs/sheets-formula": "workspace:*",
"@univerjs/sheets-numfmt": "workspace:*",
Expand Down
3 changes: 3 additions & 0 deletions packages/umd/scripts/index.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function buildCSS() {
'@univerjs/sheets-zen-editor',
'@univerjs/sheets-data-validation',
'@univerjs/sheets-conditional-formatting-ui',
'@univerjs/sheets-filter-ui',
'@univerjs/slides-ui',
'@univerjs/find-replace',
'@univerjs/uniscript',
Expand Down Expand Up @@ -112,6 +113,8 @@ function buildJS() {
'@univerjs/sheets-find-replace',
'@univerjs/data-validation',
'@univerjs/sheets-data-validation',
'@univerjs/sheets-filter',
'@univerjs/sheets-filter-ui',
'@univerjs/slides',
'@univerjs/slides-ui',
'@univerjs/rpc',
Expand Down
Loading

0 comments on commit f3f1b36

Please sign in to comment.