Skip to content

Build your own AI office with Univer Office SDK. Bring editing, calculation, collaboration, and file processing into your product for people and AI agents. Built on an extensible open-source core.

ci: circle ci => github actions (#100)

白熱e99e2449213e
diff --git a/.circleci/config.yml b/.circleci/config.yml
deleted file mode 100644
index 839e6960f0..0000000000
--- a/.circleci/config.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-version: 2.1
-
-defaults: &defaults
- docker:
- - image: cimg/node:16.20.0
-
-commands:
- prepare: &prepare
- steps:
- - checkout
- - run:
- name: Install pnpm
- command: npm install -g pnpm
- - run:
- name: Install dependencies
- command: pnpm install
-
-jobs:
- lint:
- <<: *defaults
- steps:
- - prepare
- - run:
- name: Lint
- command: pnpm run lint
-
- test:
- <<: *defaults
- steps:
- - prepare
- - run:
- name: Unit test
- command: pnpm run test
-
-workflows:
- lint_and_build:
- jobs:
- - lint
- - test
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
new file mode 100644
index 0000000000..b269389e6a
--- /dev/null
+++ b/.github/workflows/ci.yml
@@ -0,0 +1,94 @@
+name: CI
+
+on:
+ push:
+ branches: [main, dev]
+ pull_request:
+ branches: [main, dev]
+
+permissions:
+ contents: read
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ env:
+ TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
+ TURBO_TEAM: ${{ vars.TURBO_TEAM }}
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Install Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+
+ - name: Install pnpm
+ uses: pnpm/action-setup@v2
+ with:
+ version: 8
+ run_install: false
+
+ - name: Get pnpm store directory
+ shell: bash
+ run: |
+ echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
+
+ - name: Setup pnpm cache
+ uses: actions/cache@v3
+ with:
+ path: ${{ env.STORE_PATH }}
+ key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
+ restore-keys: |
+ ${{ runner.os }}-pnpm-store-
+ - name: Install dependencies
+ run: pnpm install
+
+ - name: Build
+ run: pnpm run build
+
+ - name: Build demo
+ run: pnpm run build:demo
+
+ - name: Deploy to Vercel
+ uses: amondnet/vercel-action@v25
+ id: vercel-action
+ with:
+ vercel-token: ${{ secrets.VERCEL_TOKEN }}
+ vercel-org-id: ${{ secrets.ORG_ID}}
+ vercel-project-id: ${{ secrets.PROJECT_ID}}
+
+ - name: Discord Notification
+ uses: sarisia/actions-status-discord@v1
+ if: ${{ success() }}
+ with:
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: ${{ job.status }}
+ description: |
+ CI Pipeline: Success 🏆
+ **[View Deployment]**
+ - [Doc](${{ steps.vercel-action.outputs.preview-url }}/doc/)
+ - [Sheet](${{ steps.vercel-action.outputs.preview-url }}/sheet/)
+ - [Slide](${{ steps.vercel-action.outputs.preview-url }}/slide/)
+ nofail: false
+ nodetail: false
+ color: 0x00b894
+ username: GitHub Actions
+
+ - name: Discord Notification
+ uses: sarisia/actions-status-discord@v1
+ if: ${{ failure() }}
+ with:
+ webhook: ${{ secrets.DISCORD_WEBHOOK }}
+ status: ${{ job.status }}
+ description: |
+ CI Pipeline: Unsuccessful 📛
+ **[View PR]**
+ [click here](${{ github.event.pull_request.html_url }})
+ nofail: false
+ nodetail: false
+ color: 0xd63031
+ username: GitHub Actions
diff --git a/.github/workflows/pr-title-lint.yml b/.github/workflows/pr-title-lint.yml
new file mode 100644
index 0000000000..bf8440c65b
--- /dev/null
+++ b/.github/workflows/pr-title-lint.yml
@@ -0,0 +1,26 @@
+name: PR Title Lint
+
+on:
+ pull_request:
+ types:
+ - opened
+ - edited
+ - synchronize
+
+permissions:
+ contents: read
+
+jobs:
+ check-pull-request-title:
+ name: Check pull request title
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v3
+
+ - name: Install Node.js
+ uses: actions/setup-node@v3
+ with:
+ node-version: 16
+
+ - run: echo "${{ github.event.pull_request.title }}" | npx commitlint -g ./commitlint.config.js
diff --git a/.gitignore b/.gitignore
index 84eb62246d..a038368a6e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -100,3 +100,4 @@ doc
# turbo
.turbo
+.vercel
diff --git a/examples/univer-doc-ts/esbuild.config.js b/examples/univer-doc-ts/esbuild.config.js
new file mode 100644
index 0000000000..a43cbc28d9
--- /dev/null
+++ b/examples/univer-doc-ts/esbuild.config.js
@@ -0,0 +1,29 @@
+require('esbuild').build({
+ bundle: true,
+ color: true,
+ alias: { react: 'preact/compat' },
+ loader: { '.svg': 'file' },
+ sourcemap: false,
+ plugins: [
+ require('esbuild-plugin-clean').clean({
+ patterns: ['./local'],
+ }),
+ require('esbuild-plugin-copy').copy({
+ assets: {
+ from: ['./public/*'],
+ to: ['./'],
+ },
+ }),
+ require('esbuild-style-plugin')({
+ cssModulesOptions: {
+ localsConvention: 'camelCaseOnly',
+ generateScopedName: 'univer-[local]',
+ },
+ renderOptions: {
+ lessOptions: { rewriteUrls: 'all' },
+ },
+ }),
+ ],
+ entryPoints: ['./src/main.tsx'],
+ outdir: './local',
+});
diff --git a/examples/univer-doc-ts/package.json b/examples/univer-doc-ts/package.json
index 8f7bcfeef4..97817c5499 100644
--- a/examples/univer-doc-ts/package.json
+++ b/examples/univer-doc-ts/package.json
@@ -14,14 +14,9 @@
"private": true,
"scripts": {
"test": "jest",
- "dev": "vite",
- "build": "tsc && vite build",
- "build:demo": "vite build -c vite.demo.config.ts",
- "watch": "vite build",
- "serve": "vite preview"
+ "esbuild:demo": "node ./esbuild.config.js"
},
"devDependencies": {
- "@preact/preset-vite": "2.0.0",
"@testing-library/preact": "^2.0.1",
"@types/jest": "^27.5.2",
"@types/node": "^18.14.0",
@@ -34,9 +29,7 @@
"prettier": "^2.3.2",
"ts-jest": "29.0.1",
"ts-node": "^10.9.1",
- "typescript": "^4.4.1-rc",
- "vite": "^2.4.4",
- "vite-plugin-external": "1.2.3"
+ "typescript": "^4.4.1-rc"
},
"dependencies": {
"@univerjs/base-docs": "workspace:^0.0.1",
diff --git a/examples/univer-doc-ts/vite.config.ts b/examples/univer-doc-ts/vite.config.ts
deleted file mode 100644
index bb48384b5b..0000000000
--- a/examples/univer-doc-ts/vite.config.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { defineConfig } from 'vite';
-import path from 'path';
-import preact from '@preact/preset-vite';
-import { name, version } from './package.json';
-import createExternal from 'vite-plugin-external';
-
-const resolve = (url: string) => path.resolve(__dirname, url);
-
-export default defineConfig({
- build: {
- lib: {
- entry: resolve('src/index.ts'),
- name: 'UniverDocTs',
- formats: ['es', 'cjs', 'umd', 'iife'],
- fileName: 'univer-doc-ts',
- },
- outDir: './lib',
- },
- define: {
- pkgJson: { name, version },
- },
- css: {
- modules: {
- localsConvention: 'camelCaseOnly', // dash to camelCase conversion// .apply-color -> applyColor
- generateScopedName: 'univer-[local]', // custom prefix class name
- },
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- },
- },
- },
- server: {
- port: 3103,
- open: true, // Automatically open the app in the browser on server start.
- },
- plugins: [
- preact(),
- // legacy({
- // targets: ['ie >= 11'],
- // additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
- // }),
- createExternal({
- externals: {
- // '@univerjs/core': '@univerjs/core',
- // '@univerjs/style-univer': '@univerjs/style-univer',
- // preact: 'preact',
- // react: 'react',
- },
- }),
- ],
-});
diff --git a/examples/univer-doc-ts/vite.demo.config.ts b/examples/univer-doc-ts/vite.demo.config.ts
deleted file mode 100644
index cbb1575e1a..0000000000
--- a/examples/univer-doc-ts/vite.demo.config.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { defineConfig } from 'vite';
-import path from 'path';
-import preact from '@preact/preset-vite';
-import legacy from '@vitejs/plugin-legacy';
-import { name, version } from '../../packages/base-sheets/package.json';
-import createExternal from 'vite-plugin-external';
-
-const resolve = (url: string) => path.resolve(__dirname, url);
-
-export default defineConfig({
- base: '',
- build: {
- rollupOptions: {
- output: {
- entryFileNames: `assets/[name].js`,
- chunkFileNames: `assets/[name].js`,
- assetFileNames: `assets/[name].[ext]`,
- },
- },
- },
- define: {
- pkgJson: { name, version },
- },
- css: {
- modules: {
- localsConvention: 'camelCaseOnly', // dash to camelCase conversion// .apply-color -> applyColor
- generateScopedName: 'univer-[local]', // custom prefix class name
- },
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- },
- },
- },
- // resolve: {
- // alias: [
- // {
- // find: '@',
- // replacement: path.resolve(__dirname, './node_modules')
- // }
- // ],
- // },
- server: {
- port: 3103,
- open: true, // Automatically open the app in the browser on server start.
- hmr: true,
- },
- plugins: [
- preact(),
- // legacy({
- // targets: ['ie >= 11'],
- // additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
- // }),
- createExternal({
- externals: {
- // '@univerjs/core': '@univerjs/core',
- // '@univerjs/base-render': '@univerjs/base-render',
- // '@univerjs/base-ui': '@univerjs/base-ui',
- // '@univerjs/style-univer': '@univerjs/style-univer',
- // 'css-vars-ponyfill': 'css-vars-ponyfill',
- // preact: 'preact',
- // react: 'react',
- },
- }),
- ],
- resolve: {
- // preserveSymlinks: true,
- // alias: [
- // {
- // find: '@Basics',
- // replacement: path.resolve('..', '/src/Basics'),
- // },
- // ],
- // alias: [
- // {
- // find: /^@([^univer].*)$/,
- // replacement: path.resolve(__dirname, './src/$1'),
- // },
- // ],
- },
-});
diff --git a/examples/univer-sheet-ts/esbuild.config.js b/examples/univer-sheet-ts/esbuild.config.js
new file mode 100644
index 0000000000..a43cbc28d9
--- /dev/null
+++ b/examples/univer-sheet-ts/esbuild.config.js
@@ -0,0 +1,29 @@
+require('esbuild').build({
+ bundle: true,
+ color: true,
+ alias: { react: 'preact/compat' },
+ loader: { '.svg': 'file' },
+ sourcemap: false,
+ plugins: [
+ require('esbuild-plugin-clean').clean({
+ patterns: ['./local'],
+ }),
+ require('esbuild-plugin-copy').copy({
+ assets: {
+ from: ['./public/*'],
+ to: ['./'],
+ },
+ }),
+ require('esbuild-style-plugin')({
+ cssModulesOptions: {
+ localsConvention: 'camelCaseOnly',
+ generateScopedName: 'univer-[local]',
+ },
+ renderOptions: {
+ lessOptions: { rewriteUrls: 'all' },
+ },
+ }),
+ ],
+ entryPoints: ['./src/main.tsx'],
+ outdir: './local',
+});
diff --git a/examples/univer-sheet-ts/local/index.html b/examples/univer-sheet-ts/local/index.html
deleted file mode 100644
index c804d874ee..0000000000
--- a/examples/univer-sheet-ts/local/index.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-
-<head>
- <meta charset="utf-8" />
- <meta content="width=device-width, initial-scale=1" name="viewport" />
- <title>Univer Sheet</title>
-
- <link rel="stylesheet" href="./main.css" />
- <style>
- html,
- body {
- height: 100%;
- margin: 0;
- }
- </style>
-
-
- <script>
- new EventSource('/esbuild').addEventListener('change', () => {
- console.info('reload--')
- location.reload()
- })
- </script>
-</head>
-
-<body style="overflow: hidden;">
- <div id="app" style="z-index: 1; position: fixed; font-size: 20px; color: green;"></div>
- <!-- <div id="universheet" style="height: 225px;width: 400px;"></div> -->
- <div id="universheet" style="height: 100%;"></div>
-
- <script src="./main.js"></script>
-</body>
-
-</html>
\ No newline at end of file
diff --git a/examples/univer-sheet-ts/package.json b/examples/univer-sheet-ts/package.json
index 86b1e17449..b25b3a4347 100644
--- a/examples/univer-sheet-ts/package.json
+++ b/examples/univer-sheet-ts/package.json
@@ -11,17 +11,10 @@
"private": true,
"scripts": {
"test": "jest",
- "dev": "vite",
- "build": "tsc && vite build",
- "build:demo": "vite build -c vite.demo.config.ts",
- "watch": "vite build",
- "serve": "vite preview",
- "start": "ts-node --transpile-only ./scripts/start.ts",
- "build:esbuild": "ts-node --transpile-only ./scripts/build.ts"
+ "esbuild:demo": "node ./esbuild.config.js"
},
"devDependencies": {
"@playwright/test": "^1.18.1",
- "@preact/preset-vite": "2.0.0",
"@testing-library/preact": "^2.0.1",
"@types/jest": "^27.5.2",
"@types/node": "^18.14.0",
@@ -36,9 +29,7 @@
"prettier": "^2.3.2",
"ts-jest": "29.0.1",
"ts-node": "^10.9.1",
- "typescript": "^4.4.1-rc",
- "vite": "^2.4.4",
- "vite-plugin-external": "1.2.3"
+ "typescript": "^4.4.1-rc"
},
"dependencies": {
"@univerjs/base-render": "workspace:^0.0.1",
diff --git a/examples/univer-sheet-ts/vite.config.ts b/examples/univer-sheet-ts/vite.config.ts
deleted file mode 100644
index 13a5493b98..0000000000
--- a/examples/univer-sheet-ts/vite.config.ts
+++ /dev/null
@@ -1,53 +0,0 @@
-import { defineConfig } from 'vite';
-import path from 'path';
-import preact from '@preact/preset-vite';
-import { name, version } from './package.json';
-import createExternal from 'vite-plugin-external';
-
-
-const resolve = (url: string) => path.resolve(__dirname, url);
-
-export default defineConfig({
- build: {
- lib: {
- entry: resolve('src/main.tsx'),
- name: 'UniverSheetTs',
- formats: ['es'],
- fileName: 'univer-sheet-ts',
- },
- outDir: './lib',
- },
- define: {
- pkgJson: { name, version },
- },
- css: {
- modules: {
- localsConvention: 'camelCaseOnly', // dash to camelCase conversion// .apply-color -> applyColor
- generateScopedName: 'univer-[local]', // custom prefix class name
- },
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- },
- },
- },
- server: {
- port: 3103,
- open: true, // Automatically open the app in the browser on server start.
- },
- plugins: [
- preact(),
- // legacy({
- // targets: ['ie >= 11'],
- // additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
- // }),
- createExternal({
- externals: {
- // '@univerjs/core': '@univerjs/core',
- // '@univerjs/style-univer': '@univerjs/style-univer',
- // preact: 'preact',
- // react: 'react',
- },
- }),
- ],
-});
diff --git a/examples/univer-sheet-ts/vite.demo.config.ts b/examples/univer-sheet-ts/vite.demo.config.ts
deleted file mode 100644
index cbb1575e1a..0000000000
--- a/examples/univer-sheet-ts/vite.demo.config.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { defineConfig } from 'vite';
-import path from 'path';
-import preact from '@preact/preset-vite';
-import legacy from '@vitejs/plugin-legacy';
-import { name, version } from '../../packages/base-sheets/package.json';
-import createExternal from 'vite-plugin-external';
-
-const resolve = (url: string) => path.resolve(__dirname, url);
-
-export default defineConfig({
- base: '',
- build: {
- rollupOptions: {
- output: {
- entryFileNames: `assets/[name].js`,
- chunkFileNames: `assets/[name].js`,
- assetFileNames: `assets/[name].[ext]`,
- },
- },
- },
- define: {
- pkgJson: { name, version },
- },
- css: {
- modules: {
- localsConvention: 'camelCaseOnly', // dash to camelCase conversion// .apply-color -> applyColor
- generateScopedName: 'univer-[local]', // custom prefix class name
- },
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- },
- },
- },
- // resolve: {
- // alias: [
- // {
- // find: '@',
- // replacement: path.resolve(__dirname, './node_modules')
- // }
- // ],
- // },
- server: {
- port: 3103,
- open: true, // Automatically open the app in the browser on server start.
- hmr: true,
- },
- plugins: [
- preact(),
- // legacy({
- // targets: ['ie >= 11'],
- // additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
- // }),
- createExternal({
- externals: {
- // '@univerjs/core': '@univerjs/core',
- // '@univerjs/base-render': '@univerjs/base-render',
- // '@univerjs/base-ui': '@univerjs/base-ui',
- // '@univerjs/style-univer': '@univerjs/style-univer',
- // 'css-vars-ponyfill': 'css-vars-ponyfill',
- // preact: 'preact',
- // react: 'react',
- },
- }),
- ],
- resolve: {
- // preserveSymlinks: true,
- // alias: [
- // {
- // find: '@Basics',
- // replacement: path.resolve('..', '/src/Basics'),
- // },
- // ],
- // alias: [
- // {
- // find: /^@([^univer].*)$/,
- // replacement: path.resolve(__dirname, './src/$1'),
- // },
- // ],
- },
-});
diff --git a/examples/univer-slide-ts/esbuild.config.js b/examples/univer-slide-ts/esbuild.config.js
new file mode 100644
index 0000000000..a43cbc28d9
--- /dev/null
+++ b/examples/univer-slide-ts/esbuild.config.js
@@ -0,0 +1,29 @@
+require('esbuild').build({
+ bundle: true,
+ color: true,
+ alias: { react: 'preact/compat' },
+ loader: { '.svg': 'file' },
+ sourcemap: false,
+ plugins: [
+ require('esbuild-plugin-clean').clean({
+ patterns: ['./local'],
+ }),
+ require('esbuild-plugin-copy').copy({
+ assets: {
+ from: ['./public/*'],
+ to: ['./'],
+ },
+ }),
+ require('esbuild-style-plugin')({
+ cssModulesOptions: {
+ localsConvention: 'camelCaseOnly',
+ generateScopedName: 'univer-[local]',
+ },
+ renderOptions: {
+ lessOptions: { rewriteUrls: 'all' },
+ },
+ }),
+ ],
+ entryPoints: ['./src/main.tsx'],
+ outdir: './local',
+});
diff --git a/examples/univer-slide-ts/package.json b/examples/univer-slide-ts/package.json
index b456a6e8f7..b612c94828 100644
--- a/examples/univer-slide-ts/package.json
+++ b/examples/univer-slide-ts/package.json
@@ -11,14 +11,9 @@
"private": true,
"scripts": {
"test": "jest",
- "dev": "vite",
- "build": "tsc && vite build",
- "build:demo": "vite build -c vite.demo.config.ts",
- "watch": "vite build",
- "serve": "vite preview"
+ "esbuild:demo": "node ./esbuild.config.js"
},
"devDependencies": {
- "@preact/preset-vite": "2.0.0",
"@testing-library/preact": "^2.0.1",
"@types/jest": "^27.5.2",
"@types/node": "^18.14.0",
@@ -31,9 +26,7 @@
"prettier": "^2.3.2",
"ts-jest": "29.0.1",
"ts-node": "^10.9.1",
- "typescript": "^4.4.1-rc",
- "vite": "^2.4.4",
- "vite-plugin-external": "1.2.3"
+ "typescript": "^4.4.1-rc"
},
"dependencies": {
"@univerjs/base-render": "workspace:^0.0.1",
diff --git a/examples/univer-slide-ts/vite.config.ts b/examples/univer-slide-ts/vite.config.ts
deleted file mode 100644
index 9f1c6729b7..0000000000
--- a/examples/univer-slide-ts/vite.config.ts
+++ /dev/null
@@ -1,52 +0,0 @@
-import { defineConfig } from 'vite';
-import path from 'path';
-import preact from '@preact/preset-vite';
-import { name, version } from './package.json';
-import createExternal from 'vite-plugin-external';
-
-const resolve = (url: string) => path.resolve(__dirname, url);
-
-export default defineConfig({
- build: {
- lib: {
- entry: resolve('src/index.ts'),
- name: 'UniverSlideTs',
- formats: ['es', 'cjs', 'umd', 'iife'],
- fileName: 'univer-slide-ts',
- },
- outDir: './lib',
- },
- define: {
- pkgJson: { name, version },
- },
- css: {
- modules: {
- localsConvention: 'camelCaseOnly', // dash to camelCase conversion// .apply-color -> applyColor
- generateScopedName: 'univer-[local]', // custom prefix class name
- },
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- },
- },
- },
- server: {
- port: 3103,
- open: true, // Automatically open the app in the browser on server start.
- },
- plugins: [
- preact(),
- // legacy({
- // targets: ['ie >= 11'],
- // additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
- // }),
- createExternal({
- externals: {
- // '@univerjs/core': '@univerjs/core',
- // '@univerjs/style-univer': '@univerjs/style-univer',
- // preact: 'preact',
- // react: 'react',
- },
- }),
- ],
-});
diff --git a/examples/univer-slide-ts/vite.demo.config.ts b/examples/univer-slide-ts/vite.demo.config.ts
deleted file mode 100644
index cbb1575e1a..0000000000
--- a/examples/univer-slide-ts/vite.demo.config.ts
+++ /dev/null
@@ -1,81 +0,0 @@
-import { defineConfig } from 'vite';
-import path from 'path';
-import preact from '@preact/preset-vite';
-import legacy from '@vitejs/plugin-legacy';
-import { name, version } from '../../packages/base-sheets/package.json';
-import createExternal from 'vite-plugin-external';
-
-const resolve = (url: string) => path.resolve(__dirname, url);
-
-export default defineConfig({
- base: '',
- build: {
- rollupOptions: {
- output: {
- entryFileNames: `assets/[name].js`,
- chunkFileNames: `assets/[name].js`,
- assetFileNames: `assets/[name].[ext]`,
- },
- },
- },
- define: {
- pkgJson: { name, version },
- },
- css: {
- modules: {
- localsConvention: 'camelCaseOnly', // dash to camelCase conversion// .apply-color -> applyColor
- generateScopedName: 'univer-[local]', // custom prefix class name
- },
- preprocessorOptions: {
- less: {
- javascriptEnabled: true,
- },
- },
- },
- // resolve: {
- // alias: [
- // {
- // find: '@',
- // replacement: path.resolve(__dirname, './node_modules')
- // }
- // ],
- // },
- server: {
- port: 3103,
- open: true, // Automatically open the app in the browser on server start.
- hmr: true,
- },
- plugins: [
- preact(),
- // legacy({
- // targets: ['ie >= 11'],
- // additionalLegacyPolyfills: ['regenerator-runtime/runtime'],
- // }),
- createExternal({
- externals: {
- // '@univerjs/core': '@univerjs/core',
- // '@univerjs/base-render': '@univerjs/base-render',
- // '@univerjs/base-ui': '@univerjs/base-ui',
- // '@univerjs/style-univer': '@univerjs/style-univer',
- // 'css-vars-ponyfill': 'css-vars-ponyfill',
- // preact: 'preact',
- // react: 'react',
- },
- }),
- ],
- resolve: {
- // preserveSymlinks: true,
- // alias: [
- // {
- // find: '@Basics',
- // replacement: path.resolve('..', '/src/Basics'),
- // },
- // ],
- // alias: [
- // {
- // find: /^@([^univer].*)$/,
- // replacement: path.resolve(__dirname, './src/$1'),
- // },
- // ],
- },
-});
diff --git a/package.json b/package.json
index 9999001773..cce5dc4a1d 100644
--- a/package.json
+++ b/package.json
@@ -20,6 +20,7 @@
"lighthouse-dev": "start /B node scripts/dev && lighthouse http://127.0.0.1:3103 --output html --output-path ./report.html",
"build:legacy": "node scripts/build.js",
"build": "turbo esbuild",
+ "build:demo": "turbo esbuild:demo",
"build:sheet": "pnpm run --filter univer-sheet-ts build:demo",
"build:doc": "pnpm run --filter univer-doc-ts build:demo",
"build:slide": "pnpm run --filter univer-slide-ts build:demo",
@@ -54,6 +55,7 @@
"cross-env": "^7.0.3",
"esbuild": "^0.19.2",
"esbuild-plugin-clean": "^1.0.1",
+ "esbuild-plugin-copy": "^2.1.1",
"esbuild-style-plugin": "^1.6.2",
"eslint": "^8.35.0",
"eslint-config-airbnb-base": "^15.0.0",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 5dcc59975a..a8ed3f6003 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -54,6 +54,9 @@ importers:
esbuild-plugin-clean:
specifier: ^1.0.1
version: 1.0.1([email protected])
+ esbuild-plugin-copy:
+ specifier: ^2.1.1
+ version: 2.1.1([email protected])
esbuild-style-plugin:
specifier: ^1.6.2
version: 1.6.2
@@ -157,9 +160,6 @@ importers:
specifier: ^10.12.1
version: 10.17.1
devDependencies:
- '@preact/preset-vite':
- specifier: 2.0.0
'@testing-library/preact':
specifier: ^2.0.1
version: 2.0.1([email protected])
@@ -199,12 +199,6 @@ importers:
typescript:
specifier: ^4.4.1-rc
version: 4.7.2
- vite:
- specifier: ^2.4.4
- version: 2.4.4
- vite-plugin-external:
- specifier: 1.2.3
- version: 1.2.3
examples/univer-preact-ts:
dependencies:
@@ -351,9 +345,6 @@ importers:
'@playwright/test':
specifier: ^1.18.1
version: 1.18.1
- '@preact/preset-vite':
- specifier: 2.0.0
'@testing-library/preact':
specifier: ^2.0.1
version: 2.0.1([email protected])
@@ -399,12 +390,6 @@ importers:
typescript:
specifier: ^4.4.1-rc
version: 4.7.2
- vite:
- specifier: ^2.4.4
- version: 2.4.4
- vite-plugin-external:
- specifier: 1.2.3
- version: 1.2.3
examples/univer-slide-ts:
dependencies:
@@ -430,9 +415,6 @@ importers:
specifier: ^10.12.1
version: 10.17.1
devDependencies:
- '@preact/preset-vite':
- specifier: 2.0.0
'@testing-library/preact':
specifier: ^2.0.1
version: 2.0.1([email protected])
@@ -472,12 +454,6 @@ importers:
typescript:
specifier: ^4.4.1-rc
version: 4.7.2
- vite:
- specifier: ^2.4.4
- version: 2.4.4
- vite-plugin-external:
- specifier: 1.2.3
- version: 1.2.3
examples/univer-vanilla-ts:
dependencies:
@@ -5822,6 +5798,18 @@ packages:
esbuild: 0.19.2
dev: true
+ resolution: {integrity: sha512-Bk66jpevTcV8KMFzZI1P7MZKZ+uDcrZm2G2egZ2jNIvVnivDpodZI+/KnpL3Jnap0PBdIHU7HwFGB8r+vV5CVw==}
+ peerDependencies:
+ esbuild: '>= 0.14.0'
+ dependencies:
+ chalk: 4.1.2
+ chokidar: 3.5.3
+ esbuild: 0.19.2
+ fs-extra: 10.1.0
+ globby: 11.1.0
+ dev: true
+
resolution: {integrity: sha512-t5ZtQyGKNiM8DLedz+iwFH0LPWLnMmaEQ2RnnP1ppFHq35najxqJHAhUVVSbTFm5cR2ZumGdBMqnmuKBRBMvDw==}
dependencies:
diff --git a/turbo.json b/turbo.json
index 0d2b54c597..df1aa21601 100644
--- a/turbo.json
+++ b/turbo.json
@@ -3,6 +3,9 @@
"pipeline": {
"esbuild": {
},
+ "esbuild:demo": {
+ "cache": false
+ },
"dev": {
"cache": false,
"persistent": true