snapshot of https://github.com/dream-num/univer.git (dev, 2026-09-16; blobs > 131072B omitted)
Some checks failed
📦 Build / build (push) Has been cancelled
🧪 CI Test / test shard (1/4) (push) Has been cancelled
🧪 CI Test / test shard (2/4) (push) Has been cancelled
🧪 CI Test / test shard (3/4) (push) Has been cancelled
🧪 CI Test / test shard (4/4) (push) Has been cancelled
🧪 CI Test / test (push) Has been cancelled
🧪 CI Test / eslint (push) Has been cancelled
🧪 CI Test / typecheck (push) Has been cancelled
🔫 Sync to Pro / dispatch-sync (push) Has been cancelled
🔮 Sync Mirror / sync (push) Has been cancelled

This commit is contained in:
upstream-mirror
2026-09-16 05:09:45 +05:00
commit bcf6ef63ad
7118 changed files with 1236854 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
# @univerjs/preset-docs-node-core
[![npm version](https://img.shields.io/npm/v/@univerjs/preset-docs-node-core?style=flat-square)](https://npmjs.com/package/@univerjs/preset-docs-node-core)
[![license](https://img.shields.io/npm/l/@univerjs/preset-docs-node-core?style=flat-square)](https://npmjs.com/package/@univerjs/preset-docs-node-core)
[![downloads](https://img.shields.io/npm/dm/@univerjs/preset-docs-node-core?style=flat-square)](https://npmjs.com/package/@univerjs/preset-docs-node-core)
`@univerjs/preset-docs-node-core` provides a preset for running Univer Docs on Node.js with core features.
## Package Overview
| Package | CSS | Locales | Facade entry |
| --------------------------------- | :-: | :-----: | :----------: |
| `@univerjs/preset-docs-node-core` | No | Yes | Yes |
## Installation
```sh
pnpm add @univerjs/preset-docs-node-core
# or
npm install @univerjs/preset-docs-node-core
```
Keep all `@univerjs/*` packages on the same version.
## Usage
```ts
import { UniverDocsNodeCorePreset } from '@univerjs/preset-docs-node-core';
// Use with createUniver:
// createUniver({ presets: [UniverDocsNodeCorePreset()] });
```
## Resources
- [Documentation](https://docs.univer.ai)
- [NPM package](https://npmjs.com/package/@univerjs/preset-docs-node-core)
- [GitHub repository](https://github.com/dream-num/univer)

View File

@@ -0,0 +1,86 @@
{
"name": "@univerjs/preset-docs-node-core",
"version": "1.0.0-rc.0",
"private": false,
"description": "Preset for running Univer Docs on Node.js with core features.",
"author": "DreamNum Co., Ltd. <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",
"univer-preset",
"docs",
"node",
"core"
],
"sideEffects": [
"*.css"
],
"exports": {
".": "./src/index.ts",
"./locales/*": "./src/locales/*.ts",
"./lib/*": "./lib/*"
},
"publishConfig": {
"access": "public",
"main": "./lib/es/index.js",
"module": "./lib/es/index.js",
"exports": {
".": {
"import": "./lib/es/index.js",
"require": "./lib/cjs/index.js",
"types": "./lib/types/index.d.ts"
},
"./locales/*": {
"import": "./lib/es/locales/*.js",
"require": "./lib/cjs/locales/*.js",
"types": "./lib/types/locales/*.d.ts"
},
"./lib/*": "./lib/*"
}
},
"main": "./src/index.ts",
"directories": {
"lib": "lib"
},
"types": "./lib/types/index.d.ts",
"files": [
"lib"
],
"scripts": {
"prepare": "univer-cli preset prepare",
"build:bundle": "univer-cli preset build --cleanup",
"build:types": "tsc -p tsconfig.node.json",
"build": "pnpm run build:bundle && pnpm run build:types",
"typecheck": "tsc --noEmit"
},
"peerDependencies": {
"rxjs": ">=7.0.0"
},
"dependencies": {
"@univerjs/docs": "workspace:*",
"@univerjs/docs-drawing": "workspace:*",
"@univerjs/docs-hyper-link": "workspace:*",
"@univerjs/engine-formula": "workspace:*",
"@univerjs/rpc-node": "workspace:*",
"@univerjs/thread-comment": "workspace:*"
},
"devDependencies": {
"@univerjs-infra/shared": "workspace:*",
"@univerjs/core": "workspace:*",
"@univerjs/presets": "workspace:*",
"rxjs": "^7.8.2",
"typescript": "^6.0.3"
}
}

View File

@@ -0,0 +1,17 @@
/**
* Copyright 2023-present DreamNum Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { default } from '@univerjs-infra/shared/postcss';

View File

@@ -0,0 +1,23 @@
/**
* Copyright 2023-present DreamNum Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export * from './preset';
export * from '@univerjs/docs';
export * from '@univerjs/docs-drawing';
export * from '@univerjs/docs-hyper-link';
export * from '@univerjs/engine-formula';
export * from '@univerjs/rpc-node';
export * from '@univerjs/thread-comment';

View File

@@ -0,0 +1,57 @@
/**
* Copyright 2023-present DreamNum Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { IPreset } from '@univerjs/presets';
import type { IUniverFormulaConfig } from './types';
import { UniverDocsPlugin } from '@univerjs/docs';
import { UniverDocsDrawingPlugin } from '@univerjs/docs-drawing';
import { UniverDocsHyperLinkPlugin } from '@univerjs/docs-hyper-link';
import { UniverFormulaEnginePlugin } from '@univerjs/engine-formula';
// import { UniverRPCNodeMainPlugin } from '@univerjs/rpc-node';
import { UniverThreadCommentPlugin } from '@univerjs/thread-comment';
import '@univerjs/engine-formula/facade';
export type * from '@univerjs/engine-formula/facade';
export interface IUniverDocsNodeCorePresetConfig {
/**
* The formula configuration.
*/
formula?: IUniverFormulaConfig;
}
export function UniverDocsNodeCorePreset(config: Partial<IUniverDocsNodeCorePresetConfig> = {}): IPreset {
const { formula } = config;
return {
plugins: [
// useWorker
// ? [UniverRPCNodeMainPlugin, { workerSrc }]
// : null,
[UniverFormulaEnginePlugin, {
// notExecuteFormula: useWorker,
function: formula?.function,
}],
UniverThreadCommentPlugin,
UniverDocsPlugin,
UniverDocsHyperLinkPlugin,
UniverDocsDrawingPlugin,
].filter((v) => !!v) as IPreset['plugins'],
};
}

View File

@@ -0,0 +1,25 @@
/**
* Copyright 2023-present DreamNum Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { IUniverEngineFormulaConfig } from '@univerjs/engine-formula';
export interface IUniverFormulaConfig extends
Pick<IUniverEngineFormulaConfig, 'function'> {
}
export interface IUniverFormulaWorkerConfig extends
Pick<IUniverEngineFormulaConfig, 'function'> {
}

View File

@@ -0,0 +1,27 @@
/**
* Copyright 2023-present DreamNum Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import type { Config } from 'tailwindcss';
import preset, { createTailwindContent } from '@univerjs-infra/shared/tailwind';
const config: Config = {
presets: [preset],
content: createTailwindContent(import.meta.url, {
includeStyleDependencies: true,
}),
};
export default config;

View File

@@ -0,0 +1,8 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/base",
"compilerOptions": {
"rootDir": "src",
"outDir": "lib/types"
},
"include": ["src", "../../common/shared/types/global.d.ts"]
}

View File

@@ -0,0 +1,18 @@
{
"extends": "@univerjs-infra/shared/tsconfigs/node",
"compilerOptions": {
"rootDir": "src",
"declaration": true,
"emitDeclarationOnly": true,
"noEmit": false,
"outDir": "lib/types"
},
"include": [
"src"
],
"exclude": [
"src/**/__tests__/**",
"src/**/*.spec.ts",
"src/**/*.test.ts"
]
}