Skip to content

Commit

Permalink
feat(umd): create all-in-one UMD bundle
Browse files Browse the repository at this point in the history
  • Loading branch information
jikkai committed Apr 25, 2024
1 parent 63b1e83 commit f897cc4
Show file tree
Hide file tree
Showing 18 changed files with 445 additions and 82 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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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
1 change: 0 additions & 1 deletion packages/sheets-formula/package.json
Original file line number Diff line number Diff line change
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
1 change: 0 additions & 1 deletion packages/sheets-numfmt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"peerDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-numfmt": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@univerjs/sheets": "workspace:*",
Expand Down
3 changes: 2 additions & 1 deletion packages/sheets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,13 @@
"peerDependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-numfmt": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@wendellhu/redi": "^0.13.3",
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/protocol": "^0.1.19"
"@univerjs/protocol": "^0.1.20"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
Expand Down
10 changes: 10 additions & 0 deletions packages/umd/README-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @univerjs/umd

[![npm version](https://img.shields.io/npm/v/@univerjs/umd)](https://npmjs.org/package/@univerjs/umd)
[![license](https://img.shields.io/npm/l/@univerjs/umd)](https://img.shields.io/npm/l/@univerjs/umd)

## 简介

## 使用指南

### 安装
10 changes: 10 additions & 0 deletions packages/umd/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# @univerjs/umd

[![npm version](https://img.shields.io/npm/v/@univerjs/umd)](https://npmjs.org/package/@univerjs/umd)
[![license](https://img.shields.io/npm/l/@univerjs/umd)](https://img.shields.io/npm/l/@univerjs/umd)

## Introduction

## Usage

### Installation
79 changes: 79 additions & 0 deletions packages/umd/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
{
"name": "@univerjs/umd",
"version": "0.1.7",
"private": false,
"description": "UMD bundle for Univer",
"author": "DreamNum <developer@univer.ai>",
"license": "Apache-2.0",
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/univer"
},
"homepage": "https://univer.ai",
"repository": {
"type": "git",
"url": "https://github.com/dream-num/univer"
},
"bugs": {
"url": "https://github.com/dream-num/univer/issues"
},
"keywords": [
"univer"
],
"main": "./lib/univer.full.umd.js",
"publishConfig": {
"access": "public",
"exports": {
"./lib/*": "./lib/*"
}
},
"directories": {
"lib": "lib"
},
"files": [
"lib"
],
"engines": {
"node": ">=16.0.0",
"npm": ">=8.0.0"
},
"scripts": {
"build:umd": "node ./scripts/index.mjs"
},
"dependencies": {
"@univerjs/core": "workspace:*",
"@univerjs/data-validation": "workspace:*",
"@univerjs/design": "workspace:*",
"@univerjs/docs": "workspace:*",
"@univerjs/docs-ui": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/engine-numfmt": "workspace:*",
"@univerjs/engine-render": "workspace:*",
"@univerjs/facade": "workspace:*",
"@univerjs/find-replace": "workspace:*",
"@univerjs/image": "workspace:*",
"@univerjs/network": "workspace:*",
"@univerjs/protocol": "^0.1.20",
"@univerjs/rpc": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@univerjs/sheets-conditional-formatting": "workspace:*",
"@univerjs/sheets-conditional-formatting-ui": "workspace:*",
"@univerjs/sheets-data-validation": "workspace:*",
"@univerjs/sheets-find-replace": "workspace:*",
"@univerjs/sheets-formula": "workspace:*",
"@univerjs/sheets-numfmt": "workspace:*",
"@univerjs/sheets-ui": "workspace:*",
"@univerjs/sheets-zen-editor": "workspace:*",
"@univerjs/slides": "workspace:*",
"@univerjs/slides-ui": "workspace:*",
"@univerjs/ui": "workspace:*",
"@univerjs/uniscript": "workspace:*",
"@wendellhu/redi": "^0.13.3",
"clsx": "^2.1.1",
"dayjs": "^1.11.10",
"monaco-editor": "0.48.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"rxjs": "^7.8.1"
}
}
Loading

0 comments on commit f897cc4

Please sign in to comment.