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.

feat(workspace): npm run watch script

dushusir8997b1dc5170
diff --git a/cli/src/templates/base/package.json b/cli/src/templates/base/package.json
index a5a84dc35f..cb0fba2770 100644
--- a/cli/src/templates/base/package.json
+++ b/cli/src/templates/base/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/cli/src/templates/sheets-plugin/package.json b/cli/src/templates/sheets-plugin/package.json
index a5a84dc35f..cb0fba2770 100644
--- a/cli/src/templates/sheets-plugin/package.json
+++ b/cli/src/templates/sheets-plugin/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/examples/univer-preact-ts/package.json b/examples/univer-preact-ts/package.json
index 2f76f40f76..b1a44fdddb 100644
--- a/examples/univer-preact-ts/package.json
+++ b/examples/univer-preact-ts/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/examples/univer-vanilla-ts/package.json b/examples/univer-vanilla-ts/package.json
index 0466d3232e..aab86c9389 100644
--- a/examples/univer-vanilla-ts/package.json
+++ b/examples/univer-vanilla-ts/package.json
@@ -10,6 +10,7 @@
"test": "echo \"Error: run tests from root\" && exit 1",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-component/package.json b/packages/base-component/package.json
index fdcad7940f..81324594a1 100644
--- a/packages/base-component/package.json
+++ b/packages/base-component/package.json
@@ -27,6 +27,7 @@
"test:cover": "cross-env NODE_ENV=--experimental-vm-modules jest --coverage",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-docs/package.json b/packages/base-docs/package.json
index b706a83928..6943a77513 100644
--- a/packages/base-docs/package.json
+++ b/packages/base-docs/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-docs/src/View/UI/DocContainer/index.module.less b/packages/base-docs/src/View/UI/DocContainer/index.module.less
index 036457241b..a165caeff7 100644
--- a/packages/base-docs/src/View/UI/DocContainer/index.module.less
+++ b/packages/base-docs/src/View/UI/DocContainer/index.module.less
@@ -1,4 +1,4 @@
-@import '@univer/style-universheet/src/assets/css/skin/base.module.less';
+@import '@univer/style-universheet/assets/css/skin/base.module.less';
.layout-container {
// theme
diff --git a/packages/base-formula-engine/package.json b/packages/base-formula-engine/package.json
index 006b881566..5a93dddf3c 100644
--- a/packages/base-formula-engine/package.json
+++ b/packages/base-formula-engine/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-numfmt-engine/package.json b/packages/base-numfmt-engine/package.json
index 44669806c0..a5746da1ab 100644
--- a/packages/base-numfmt-engine/package.json
+++ b/packages/base-numfmt-engine/package.json
@@ -20,6 +20,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-render/package.json b/packages/base-render/package.json
index bd7a07afb4..dc1418bd68 100644
--- a/packages/base-render/package.json
+++ b/packages/base-render/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-sheets/package.json b/packages/base-sheets/package.json
index e40d0099a1..faed32dd85 100644
--- a/packages/base-sheets/package.json
+++ b/packages/base-sheets/package.json
@@ -26,6 +26,7 @@
"test:debug": "PWDEBUG=1 npx playwright test",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-sheets/src/View/UI/CountBar/index.module.less b/packages/base-sheets/src/View/UI/CountBar/index.module.less
index 0cdf00e935..52261afe93 100644
--- a/packages/base-sheets/src/View/UI/CountBar/index.module.less
+++ b/packages/base-sheets/src/View/UI/CountBar/index.module.less
@@ -1,4 +1,4 @@
-@import '@univer/style-universheet/src/assets/css/skin/base.module.less';
+@import '@univer/style-universheet/assets/css/skin/base.module.less';
.count-bar {
display: flex;
diff --git a/packages/base-sheets/src/View/UI/SheetContainer/index.module.less b/packages/base-sheets/src/View/UI/SheetContainer/index.module.less
index 036457241b..a165caeff7 100644
--- a/packages/base-sheets/src/View/UI/SheetContainer/index.module.less
+++ b/packages/base-sheets/src/View/UI/SheetContainer/index.module.less
@@ -1,4 +1,4 @@
-@import '@univer/style-universheet/src/assets/css/skin/base.module.less';
+@import '@univer/style-universheet/assets/css/skin/base.module.less';
.layout-container {
// theme
diff --git a/packages/base-slides/package.json b/packages/base-slides/package.json
index 650987fa2a..2cd1055a50 100644
--- a/packages/base-slides/package.json
+++ b/packages/base-slides/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/base-slides/src/View/UI/SlideContainer/index.module.less b/packages/base-slides/src/View/UI/SlideContainer/index.module.less
index 036457241b..a165caeff7 100644
--- a/packages/base-slides/src/View/UI/SlideContainer/index.module.less
+++ b/packages/base-slides/src/View/UI/SlideContainer/index.module.less
@@ -1,4 +1,4 @@
-@import '@univer/style-universheet/src/assets/css/skin/base.module.less';
+@import '@univer/style-universheet/assets/css/skin/base.module.less';
.layout-container {
// theme
diff --git a/packages/common-plugin-collaboration/package.json b/packages/common-plugin-collaboration/package.json
index 507dec62a1..a14c8ef08c 100644
--- a/packages/common-plugin-collaboration/package.json
+++ b/packages/common-plugin-collaboration/package.json
@@ -26,6 +26,7 @@
"test": "cross-env NODE_ENV=--experimental-vm-modules jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/common-plugin-data/package.json b/packages/common-plugin-data/package.json
index 7f598d680a..0f8dc3a519 100644
--- a/packages/common-plugin-data/package.json
+++ b/packages/common-plugin-data/package.json
@@ -26,6 +26,7 @@
"test": "cross-env NODE_ENV=--experimental-vm-modules jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/common-plugin-data/vite.config.ts b/packages/common-plugin-data/vite.config.ts
index 2e70dbe0b0..2fb50e0181 100644
--- a/packages/common-plugin-data/vite.config.ts
+++ b/packages/common-plugin-data/vite.config.ts
@@ -14,6 +14,15 @@ export default defineConfig({
// },
// outDir: './lib',
// },
+ build: {
+ lib: {
+ entry: resolve('src/index.ts'),
+ name: 'UniverCommonPluginData',
+ formats: ['es', 'umd'],
+ fileName: 'univer-common-plugin-data',
+ },
+ outDir: './lib',
+ },
define: {
pkgJson: { name, version },
},
diff --git a/packages/core/package.json b/packages/core/package.json
index 218ee14e5a..86065be1e3 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -25,6 +25,7 @@
"test": "cross-env NODE_ENV=--experimental-vm-modules jest --config=jest.config.js",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"api": "node ./api.js",
"tsc": "tsc",
diff --git a/packages/sheets-plugin-alternating-colors/package.json b/packages/sheets-plugin-alternating-colors/package.json
index 6cb982b130..3d02fd091b 100644
--- a/packages/sheets-plugin-alternating-colors/package.json
+++ b/packages/sheets-plugin-alternating-colors/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-clipboard/package.json b/packages/sheets-plugin-clipboard/package.json
index 29581c965a..b3c555ff93 100644
--- a/packages/sheets-plugin-clipboard/package.json
+++ b/packages/sheets-plugin-clipboard/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-comment/package.json b/packages/sheets-plugin-comment/package.json
index f30fda1818..7575af4a00 100644
--- a/packages/sheets-plugin-comment/package.json
+++ b/packages/sheets-plugin-comment/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-conditional-format/package.json b/packages/sheets-plugin-conditional-format/package.json
index 4d5fc06125..62aaa9138a 100644
--- a/packages/sheets-plugin-conditional-format/package.json
+++ b/packages/sheets-plugin-conditional-format/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-data-validation/package.json b/packages/sheets-plugin-data-validation/package.json
index 45dba17edc..9945b939c3 100644
--- a/packages/sheets-plugin-data-validation/package.json
+++ b/packages/sheets-plugin-data-validation/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-filter/package.json b/packages/sheets-plugin-filter/package.json
index 9c3cceaca9..9c4735cf44 100644
--- a/packages/sheets-plugin-filter/package.json
+++ b/packages/sheets-plugin-filter/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-find/package.json b/packages/sheets-plugin-find/package.json
index b6841a5351..73a0ecf22b 100644
--- a/packages/sheets-plugin-find/package.json
+++ b/packages/sheets-plugin-find/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-formula/package.json b/packages/sheets-plugin-formula/package.json
index 4ba78ead8c..5439f77c75 100644
--- a/packages/sheets-plugin-formula/package.json
+++ b/packages/sheets-plugin-formula/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-freeze/package.json b/packages/sheets-plugin-freeze/package.json
index d0eaad1cd4..211402fe0e 100644
--- a/packages/sheets-plugin-freeze/package.json
+++ b/packages/sheets-plugin-freeze/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-group/package.json b/packages/sheets-plugin-group/package.json
index f144b0e461..d00491401b 100644
--- a/packages/sheets-plugin-group/package.json
+++ b/packages/sheets-plugin-group/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-image/package.json b/packages/sheets-plugin-image/package.json
index 728e90d4a0..b78812add5 100644
--- a/packages/sheets-plugin-image/package.json
+++ b/packages/sheets-plugin-image/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-link/package.json b/packages/sheets-plugin-link/package.json
index 13278c3e57..12b2f6bb4a 100644
--- a/packages/sheets-plugin-link/package.json
+++ b/packages/sheets-plugin-link/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-numfmt/package.json b/packages/sheets-plugin-numfmt/package.json
index a5d2848197..203c55f4ca 100644
--- a/packages/sheets-plugin-numfmt/package.json
+++ b/packages/sheets-plugin-numfmt/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-pivot-table/package.json b/packages/sheets-plugin-pivot-table/package.json
index ce7af7703a..1db630fc94 100644
--- a/packages/sheets-plugin-pivot-table/package.json
+++ b/packages/sheets-plugin-pivot-table/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-print/package.json b/packages/sheets-plugin-print/package.json
index 8a9f3c45d9..225bfbe99a 100644
--- a/packages/sheets-plugin-print/package.json
+++ b/packages/sheets-plugin-print/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-protection/package.json b/packages/sheets-plugin-protection/package.json
index 9a27869d8a..c4d111f264 100644
--- a/packages/sheets-plugin-protection/package.json
+++ b/packages/sheets-plugin-protection/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-screenshot/package.json b/packages/sheets-plugin-screenshot/package.json
index 3d75a646e9..b0558c8a59 100644
--- a/packages/sheets-plugin-screenshot/package.json
+++ b/packages/sheets-plugin-screenshot/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-sort/package.json b/packages/sheets-plugin-sort/package.json
index 86aa6ae728..4e20e18555 100644
--- a/packages/sheets-plugin-sort/package.json
+++ b/packages/sheets-plugin-sort/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/sheets-plugin-split-column/package.json b/packages/sheets-plugin-split-column/package.json
index ed4885720a..4266ee340a 100644
--- a/packages/sheets-plugin-split-column/package.json
+++ b/packages/sheets-plugin-split-column/package.json
@@ -24,6 +24,7 @@
"test": "jest",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/style-universheet/package.json b/packages/style-universheet/package.json
index d9739ebe6d..09d9f76985 100644
--- a/packages/style-universheet/package.json
+++ b/packages/style-universheet/package.json
@@ -25,6 +25,7 @@
"test:cover": "cross-env NODE_ENV=--experimental-vm-modules jest --coverage",
"dev": "vite",
"build": "tsc && vite build",
+ "watch": "vite build",
"link": "pnpm link ./",
"serve": "vite preview"
},
diff --git a/packages/style-universheet/tsconfig.json b/packages/style-universheet/tsconfig.json
index 16be76be3d..a8c8f5d8ec 100644
--- a/packages/style-universheet/tsconfig.json
+++ b/packages/style-universheet/tsconfig.json
@@ -24,5 +24,5 @@
"strictPropertyInitialization": false,
"types": ["jest", "node", "@types/jest"]
},
- "include": ["src/**/*", "tests/**/*.(spec|test).(ts|tsx|js)", "../base-sheets/src/View/UI/FormulaBar", "../base-sheets/src/View/UI/RichText"]
+ "include": ["src/**/*", "tests/**/*.(spec|test).(ts|tsx|js)"]
}
diff --git a/packages/style-universheet/vite.config.ts b/packages/style-universheet/vite.config.ts
index d907ec1c91..3ad20614ec 100644
--- a/packages/style-universheet/vite.config.ts
+++ b/packages/style-universheet/vite.config.ts
@@ -32,6 +32,14 @@ export default defineConfig({
},
},
},
+ resolve: {
+ alias: [
+ {
+ find: '@',
+ replacement: path.resolve(__dirname, './node_modules')
+ }
+ ],
+ },
server: {
port: 3103,
// open: true, // Automatically open the app in the browser on server start.