Skip to content

Commit

Permalink
feat(umd): create all-in-one UMD bundle (#2062)
Browse files Browse the repository at this point in the history
* feat(umd): create all-in-one UMD bundle

* chore: optimize packaging
  • Loading branch information
jikkai committed Apr 25, 2024
1 parent 1f03b7a commit e76fe4e
Show file tree
Hide file tree
Showing 24 changed files with 2,130 additions and 1,362 deletions.
45 changes: 0 additions & 45 deletions .github/workflows/ci-lint.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/ci-test.yml
Expand Up @@ -29,3 +29,37 @@ jobs:
uses: codecov/codecov-action@v3
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

eslint:
runs-on: ubuntu-latest

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/setup-node

- name: 🌡️ Run ESLint
run: pnpm lint --quiet

typecheck:
runs-on: ubuntu-latest

env:
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
TURBO_TEAM: ${{ vars.TURBO_TEAM }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: ./.github/actions/setup-node

- name: 🧼 Type checking
run: pnpm lint:types
4 changes: 2 additions & 2 deletions .github/workflows/playwright.yml
Expand Up @@ -26,14 +26,14 @@ jobs:
uses: ./.github/actions/setup-node

- name: Install Playwright Browsers
run: pnpm exec playwright install --with-deps
run: pnpm dlx playwright install --with-deps

# build the example locally and run from the built files
- name: Build E2E Client
run: pnpm build:e2e

- name: Run Playwright Tests
run: pnpm exec playwright test
run: pnpm dlx playwright test

- uses: actions/upload-artifact@v3
if: always()
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Expand Up @@ -104,7 +104,7 @@ jobs:
- name: 🚚 Install dependencies and build
run: |
pnpm install
pnpm run build
pnpm build
- name: Install Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:

# ================= Deploy Demo =================
- name: 📦 Build demo
run: pnpm run build:demo
run: pnpm build:demo

- name: Copy demo to workspace
run: |
Expand Down
5 changes: 3 additions & 2 deletions common/storybook/.storybook/main.ts
Expand Up @@ -39,8 +39,9 @@ const config: StorybookConfig = {
const rootDir = resolve(__dirname, rootPath);
if (existsSync(rootDir)) {
readdirSync(rootDir).forEach((pkg) => {
const pkgDir = resolve(rootDir, pkg, 'package.json');
if (existsSync(pkgDir)) {
const pkgPath = resolve(rootDir, pkg, 'package.json');
const srcDir = resolve(rootDir, pkg, 'src');
if (existsSync(pkgPath) && existsSync(srcDir)) {
stories.push({
directory: `${rootPath}/${pkg}/src`,
files: '**/*.stories.@(js|jsx|mjs|ts|tsx)',
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -30,7 +30,7 @@
"lint:types": "turbo lint:types",
"test": "turbo test -- --passWithNoTests",
"coverage": "turbo coverage -- --passWithNoTests",
"build": "turbo build",
"build": "turbo build && pnpm --filter @univerjs/umd build:umd",
"build:demo": "turbo build:demo",
"build:e2e": "pnpm --filter univer-examples build:e2e",
"serve:e2e": "serve ./examples/local",
Expand Down
3 changes: 1 addition & 2 deletions packages/core/package.json
Expand Up @@ -2,7 +2,6 @@
"name": "@univerjs/core",
"version": "0.1.7",
"private": false,
"packageManager": "pnpm@9.0.5",
"description": "Core library for Univer.",
"author": "DreamNum <developer@univer.ai>",
"license": "Apache-2.0",
Expand Down Expand Up @@ -68,7 +67,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "^0.1.19",
"@univerjs/protocol": "^0.1.20",
"nanoid": "5.0.7",
"numeral": "^2.0.6"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/data-validation/package.json
Expand Up @@ -68,7 +68,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "^0.1.19"
"@univerjs/protocol": "^0.1.20"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/sheets-conditional-formatting/package.json
Expand Up @@ -73,7 +73,7 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "^0.1.19"
"@univerjs/protocol": "^0.1.20"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
34 changes: 34 additions & 0 deletions packages/sheets-filter-ui/README-zh.md
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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"
}
}
1 change: 0 additions & 1 deletion packages/sheets-formula/package.json
Expand Up @@ -65,7 +65,6 @@
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-numfmt": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
"@wendellhu/redi": "^0.13.3",
Expand Down

0 comments on commit e76fe4e

Please sign in to comment.