-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add @univerjs-pro/engine-formula
Showing
7 changed files
with
93 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
UNIVER_ENDPOINT=http://127.0.0.1:8000 | ||
UNIVER_CLIENT_LICENSE= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,3 +22,4 @@ dist-ssr | |
*.njsproj | ||
*.sln | ||
*.sw? | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { LogLevel, Univer } from '@univerjs/core' | ||
import { UniverProFormulaEnginePlugin } from '@univerjs-pro/engine-formula' | ||
import { UniverRPCWorkerThreadPlugin } from '@univerjs/rpc' | ||
import { UniverSheetsPlugin } from '@univerjs/sheets' | ||
import { UniverRemoteSheetsFormulaPlugin } from '@univerjs/sheets-formula' | ||
import { UniverLicensePlugin } from '@univerjs-pro/license' | ||
import { UniverSheetsPivotTablePlugin } from '@univerjs-pro/sheets-pivot' | ||
|
||
// Univer web worker is also a univer application. | ||
const univer = new Univer({ | ||
logLevel: LogLevel.VERBOSE, | ||
locales: {}, | ||
}) | ||
|
||
univer.registerPlugin(UniverLicensePlugin, { | ||
// if you want to use the no-limit business feature, you can get 30-day trial license from https://univer.ai/pro/license | ||
// eslint-disable-next-line node/prefer-global/process | ||
license: process.env.UNIVER_CLIENT_LICENSE || 'your license.txt', | ||
}) | ||
univer.registerPlugin(UniverSheetsPlugin, { onlyRegisterFormulaRelatedMutations: true }) | ||
univer.registerPlugin(UniverProFormulaEnginePlugin) | ||
univer.registerPlugin(UniverRPCWorkerThreadPlugin) | ||
univer.registerPlugin(UniverRemoteSheetsFormulaPlugin) | ||
|
||
univer.registerPlugin(UniverSheetsPivotTablePlugin, { | ||
notExecuteFormula: true, | ||
}) | ||
|
||
// eslint-disable-next-line ts/ban-ts-comment | ||
// @ts-expect-error | ||
globalThis.univer = univer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,29 @@ | ||
import { defineConfig } from 'vite' | ||
import process from 'node:process' | ||
import { defineConfig, loadEnv } from 'vite' | ||
|
||
export default defineConfig({ | ||
server: { | ||
cors: true, | ||
proxy: { | ||
'/universer-api': { | ||
target: 'http://127.0.0.1:8000', | ||
changeOrigin: true, | ||
ws: true, | ||
export default ({ mode }) => { | ||
const env = loadEnv(mode, process.cwd(), '') | ||
return defineConfig({ | ||
server: { | ||
cors: true, | ||
proxy: { | ||
'/universer-api': { | ||
target: env.UNIVER_ENDPOINT, | ||
changeOrigin: true, | ||
ws: true, | ||
}, | ||
}, | ||
}, | ||
}, | ||
define: { | ||
'process.env.UNIVER_CLIENT_LICENSE': '"%%UNIVER_CLIENT_LICENSE_PLACEHOLDER%%"', | ||
}, | ||
base: './', | ||
build: { | ||
rollupOptions: { | ||
output: { | ||
entryFileNames: 'main.js', | ||
define: { | ||
'process.env.UNIVER_CLIENT_LICENSE': `"${env.UNIVER_CLIENT_LICENSE}"` || '"%%UNIVER_CLIENT_LICENSE_PLACEHOLDER%%"', | ||
}, | ||
base: './', | ||
build: { | ||
rollupOptions: { | ||
output: { | ||
entryFileNames: 'main.js', | ||
}, | ||
}, | ||
}, | ||
}, | ||
}) | ||
}) | ||
} |