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.

chore: move dayjs from dependencies to peerDependencies (#2051)

白熱0d978735b8dd
diff --git a/common/shared/vite/auto-externalize-dependency-plugin.js b/common/shared/vite/auto-externalize-dependency-plugin.js
index 5daec0ee67..c55142c51c 100644
--- a/common/shared/vite/auto-externalize-dependency-plugin.js
+++ b/common/shared/vite/auto-externalize-dependency-plugin.js
@@ -23,6 +23,11 @@ exports.autoExternalizeDependency = function autoExternalizeDependency() {
name: 'clsx',
version: '>=2.0.0',
},
+ dayjs: {
+ global: 'dayjs',
+ name: 'dayjs',
+ version: '>=1.11.0',
+ },
lodash: {
global: 'lodash',
name: 'lodash',
diff --git a/packages/core/package.json b/packages/core/package.json
index 3ea32f3879..b34e0f074c 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -69,7 +69,6 @@
},
"dependencies": {
"@univerjs/protocol": "^0.1.18",
- "dayjs": "^1.11.10",
"nanoid": "5.0.7",
"numeral": "^2.0.6"
},
@@ -77,6 +76,7 @@
"@types/numeral": "^2.0.5",
"@univerjs/shared": "workspace:*",
"@wendellhu/redi": "^0.13.1",
+ "dayjs": "^1.11.10",
"rxjs": "^7.8.1",
"typescript": "^5.4.5",
"vite": "^5.2.10",
diff --git a/packages/data-validation/package.json b/packages/data-validation/package.json
index 8c955036a7..d97a5441c2 100644
--- a/packages/data-validation/package.json
+++ b/packages/data-validation/package.json
@@ -68,12 +68,10 @@
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/protocol": "^0.1.18",
- "dayjs": "^1.11.10"
+ "@univerjs/protocol": "^0.1.18"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
- "@univerjs/protocol": "^0.1.14",
"@univerjs/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@wendellhu/redi": "^0.13.1",
diff --git a/packages/design/package.json b/packages/design/package.json
index ffe7257f1f..6e2a9fed5c 100644
--- a/packages/design/package.json
+++ b/packages/design/package.json
@@ -67,6 +67,7 @@
},
"peerDependencies": {
"clsx": ">=2.0.0",
+ "dayjs": ">=1.11.0",
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
"react-dom": "^16.9.0 || ^17.0.0 || ^18.0.0"
},
@@ -74,7 +75,6 @@
"@rc-component/color-picker": "^1.5.3",
"@rc-component/trigger": "^1.18.3",
"@univerjs/icons": "^0.1.44",
- "dayjs": "^1.11.10",
"rc-dialog": "^9.4.0",
"rc-dropdown": "^4.2.0",
"rc-input": "^1.4.5",
@@ -98,6 +98,7 @@
"@types/react-transition-group": "^4.4.10",
"@univerjs/shared": "workspace:*",
"clsx": "^2.1.1",
+ "dayjs": "^1.11.10",
"less": "^4.2.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/packages/sheets-conditional-formatting/package.json b/packages/sheets-conditional-formatting/package.json
index 902fea2cc4..df0f480c77 100644
--- a/packages/sheets-conditional-formatting/package.json
+++ b/packages/sheets-conditional-formatting/package.json
@@ -69,11 +69,11 @@
"@univerjs/engine-render": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@wendellhu/redi": "^0.13.1",
+ "dayjs": ">=1.11.0",
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/protocol": "^0.1.18",
- "dayjs": "^1.11.10"
+ "@univerjs/protocol": "^0.1.18"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
@@ -83,6 +83,7 @@
"@univerjs/shared": "workspace:*",
"@univerjs/sheets": "workspace:*",
"@wendellhu/redi": "^0.13.1",
+ "dayjs": "^1.11.10",
"rxjs": "^7.8.1",
"sharp": "^0.33.3",
"typescript": "^5.4.5",
diff --git a/packages/sheets-data-validation/package.json b/packages/sheets-data-validation/package.json
index f05c60db7f..fb461b1541 100644
--- a/packages/sheets-data-validation/package.json
+++ b/packages/sheets-data-validation/package.json
@@ -70,12 +70,12 @@
"@univerjs/ui": "workspace:*",
"@wendellhu/redi": "^0.13.1",
"clsx": ">=2.0.0",
+ "dayjs": ">=1.11.0",
"react": "^16.9.0 || ^17.0.0 || ^18.0.0",
"rxjs": ">=7.0.0"
},
"dependencies": {
- "@univerjs/icons": "^0.1.44",
- "dayjs": "^1.11.10"
+ "@univerjs/icons": "^0.1.44"
},
"devDependencies": {
"@univerjs/core": "workspace:*",
@@ -90,6 +90,7 @@
"@univerjs/ui": "workspace:*",
"@wendellhu/redi": "^0.13.1",
"clsx": "^2.1.1",
+ "dayjs": "^1.11.10",
"less": "^4.2.0",
"react": "^18.2.0",
"rxjs": "^7.8.1",
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index f435d870b7..5d15f2ebf3 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -331,9 +331,6 @@ importers:
'@univerjs/protocol':
specifier: ^0.1.18
version: 0.1.18(@grpc/[email protected])([email protected])
- dayjs:
- specifier: ^1.11.10
- version: 1.11.10
nanoid:
specifier: 5.0.7
version: 5.0.7
@@ -350,6 +347,9 @@ importers:
'@wendellhu/redi':
specifier: ^0.13.1
version: 0.13.1
+ dayjs:
+ specifier: ^1.11.10
+ version: 1.11.10
rxjs:
specifier: ^7.8.1
version: 7.8.1
@@ -368,9 +368,6 @@ importers:
'@univerjs/protocol':
specifier: ^0.1.18
version: 0.1.18(@grpc/[email protected])([email protected])
- dayjs:
- specifier: ^1.11.10
- version: 1.11.10
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -408,9 +405,6 @@ importers:
'@univerjs/icons':
specifier: ^0.1.44
- dayjs:
- specifier: ^1.11.10
- version: 1.11.10
rc-dialog:
specifier: ^9.4.0
@@ -475,6 +469,9 @@ importers:
clsx:
specifier: ^2.1.1
version: 2.1.1
+ dayjs:
+ specifier: ^1.11.10
+ version: 1.11.10
less:
specifier: ^4.2.0
version: 4.2.0
@@ -895,9 +892,6 @@ importers:
'@univerjs/protocol':
specifier: ^0.1.18
version: 0.1.18(@grpc/[email protected])([email protected])
- dayjs:
- specifier: ^1.11.10
- version: 1.11.10
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -920,6 +914,9 @@ importers:
'@wendellhu/redi':
specifier: ^0.13.1
version: 0.13.1
+ dayjs:
+ specifier: ^1.11.10
+ version: 1.11.10
rxjs:
specifier: ^7.8.1
version: 7.8.1
@@ -1026,9 +1023,6 @@ importers:
'@univerjs/icons':
specifier: ^0.1.44
- dayjs:
- specifier: ^1.11.10
- version: 1.11.10
devDependencies:
'@univerjs/core':
specifier: workspace:*
@@ -1066,6 +1060,9 @@ importers:
clsx:
specifier: ^2.1.1
version: 2.1.1
+ dayjs:
+ specifier: ^1.11.10
+ version: 1.11.10
less:
specifier: ^4.2.0
version: 4.2.0