@apache-superset/core

中文文档
0.1.0发布于 2026/05/12Apache-2.0TypeScriptCommonJS零依赖近 30 天下载 3463

This package contains UI elements, APIs, and utility functions used by Superset.

原始使用文档
文档目录9 节
  1. 📦 Installation
  2. 🏗️ Package Structure
  3. 🚀 Quick Start
  4. Views
  5. Commands
  6. Menus
  7. Editors
  8. 📄 License
  9. 🔗 Links

@apache-superset/core

npm version License

The official core package for building Apache Superset extensions and integrations. This package provides essential building blocks including shared UI components, utility functions, APIs, and type definitions for both the host application and extensions.

📦 Installation

npm install @apache-superset/core

🏗️ Package Structure

The source is organized into focused namespaces, each in its own directory:

src/
├── authentication/
├── commands/
├── common/
├── components/
├── contributions/
├── editors/
├── extensions/
├── menus/
├── sqlLab/
├── theme/
├── translation/
├── utils/
├── views/
└── index.ts

🚀 Quick Start

Frontend contributions are registered as module-level side effects from your extension's entry point.

Views

Add custom panels or UI components at specific locations in the application:

import { views } from '@apache-superset/core';
import MyPanel from './MyPanel';

views.registerView(
  { id: 'my-extension.main', name: 'My Panel Name' },
  'sqllab.panels',
  () => <MyPanel />,
);

Commands

Define named actions that can be triggered from menus, keyboard shortcuts, or code:

import { commands } from '@apache-superset/core';

commands.registerCommand(
  {
    id: 'my-extension.copy-query',
    title: 'Copy Query',
    icon: 'CopyOutlined',
    description: 'Copy the current query to clipboard',
  },
  () => {
    /* implementation */
  },
);

Menus

Attach commands to primary, secondary, or context menus at a given location:

import { menus } from '@apache-superset/core';

menus.registerMenuItem(
  { view: 'sqllab.editor', command: 'my-extension.copy-query' },
  'sqllab.editor',
  'primary',
);

Editors

Replace the default text editor for one or more languages:

import { editors } from '@apache-superset/core';
import MonacoSQLEditor from './MonacoSQLEditor';

editors.registerEditor(
  {
    id: 'my-extension.monaco-sql',
    name: 'Monaco SQL Editor',
    languages: ['sql'],
  },
  MonacoSQLEditor,
);

📄 License

Licensed under the Apache License, Version 2.0. See LICENSE for details.

版本与发布记录

@apache-superset/core 共发布 15 个版本,首次发布于 2025/08/27;过去 12 个月发布了 10 个版本。

版本发布日期距今
0.1.0latest2026/05/125 个月前
0.1.0-rc32026/05/016 个月前
0.1.0-rc22026/04/166 个月前
0.1.0-rc12026/03/097 个月前
0.0.1-rc112026/02/118 个月前
0.0.1-rc102026/02/079 个月前

关于 @apache-superset/core 的常见问题

@apache-superset/core 是什么?

This package contains UI elements, APIs, and utility functions used by Superset.

如何安装 @apache-superset/core?

在项目目录运行 npm install @apache-superset/core,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@emotion/cache(^11.4.0)、@emotion/react(^11.4.1)、@emotion/styled(^11.14.1)、@fontsource/ibm-plex-mono(^5.2.7)、@fontsource/inter(^5.2.6)、nanoid(^5.0.9)、react(^17.0.2)、react-dom(^17.0.2)、react-loadable(^5.5.0)、tinycolor2(*)、lodash(^4.17.21)、antd(^5.26.0)、jed(^1.1.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@apache-superset/core 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@apache-superset/core 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@apache-superset/core 可以商用吗?

@apache-superset/core 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@apache-superset/core 的下载量有多少?

根据 npm 官方下载统计,@apache-superset/core 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,463 次,日均约 115 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@apache-superset/core 还在维护吗?

最新版本 0.1.0 发布于 2026/05/12(5 个月前);至今共发布 15 个版本,其中过去 12 个月发布了 10 个;首次发布于 2025/08/27。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。