You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by mi...@apache.org on 2025/09/01 12:27:46 UTC

(superset) 02/06: chore: Adds a README and CHANGELOG to @apache-superset/core (#34866)

This is an automated email from the ASF dual-hosted git repository.

michaelsmolina pushed a commit to branch 5.0-extensions
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 9b5634356ad000fe0d0e139bc052aeec827ee42f
Author: Michael S. Molina <70...@users.noreply.github.com>
AuthorDate: Wed Aug 27 15:49:11 2025 -0300

    chore: Adds a README and CHANGELOG to @apache-superset/core (#34866)
    
    (cherry picked from commit d8a3d29ad911c7ac4e202058406b5b0c82657add)
---
 .../packages/superset-core/CHANGELOG.md            |  22 ++++
 superset-frontend/packages/superset-core/README.md | 116 +++++++++++++++++++++
 .../packages/superset-core/package.json            |   4 +-
 3 files changed, 140 insertions(+), 2 deletions(-)

diff --git a/superset-frontend/packages/superset-core/CHANGELOG.md b/superset-frontend/packages/superset-core/CHANGELOG.md
new file mode 100644
index 0000000000..c6db81dd39
--- /dev/null
+++ b/superset-frontend/packages/superset-core/CHANGELOG.md
@@ -0,0 +1,22 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+
+## Change Log
+
+Changelogs will be added once we have the first stable release.
diff --git a/superset-frontend/packages/superset-core/README.md b/superset-frontend/packages/superset-core/README.md
new file mode 100644
index 0000000000..2705bf33d9
--- /dev/null
+++ b/superset-frontend/packages/superset-core/README.md
@@ -0,0 +1,116 @@
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you 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.
+-->
+
+# @apache-superset/core
+
+[![npm version](https://badge.fury.io/js/%40apache-superset%2Fcore.svg)](https://badge.fury.io/js/%40apache-superset%2Fcore)
+[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
+
+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
+
+```bash
+npm install @apache-superset/core
+```
+
+## 🏗️ Architecture
+
+The package is organized into logical namespaces, each providing specific functionality:
+
+- **`authentication`** - User authentication and authorization APIs
+- **`commands`** - Command registration and execution system
+- **`contributions`** - UI contribution points and customization APIs
+- **`core`** - Fundamental types, utilities, and lifecycle management
+- **`environment`** - Environment detection and configuration APIs
+- **`extensions`** - Extension management and metadata APIs
+- **`sqlLab`** - SQL Lab integration and event handling
+
+## 🚀 Quick Start
+
+### Basic Extension Structure
+
+```typescript
+import {
+  core,
+  commands,
+  sqlLab,
+  authentication,
+} from '@apache-superset/core';
+
+export function activate(context: core.ExtensionContext) {
+  // Register a command to save current query
+  const commandDisposable = commands.registerCommand(
+    'my_extension.save_query',
+    async () => {
+      const currentTab = sqlLab.getCurrentTab();
+      if (currentTab?.editor.content) {
+        const token = await authentication.getCSRFToken();
+        // Use token for secure API calls
+        console.log('Saving query with CSRF token:', token);
+      }
+    },
+  );
+
+  // Listen for query execution events
+  const eventDisposable = sqlLab.onDidQueryRun(editor => {
+    console.log('Query executed:', editor.content.substring(0, 50) + '...');
+  });
+
+  // Register a simple view
+  const viewDisposable = core.registerViewProvider(
+    'my_extension.panel',
+    () => (
+      <div>
+        <h3>My Extension</h3>
+        <button onClick={() => commands.executeCommand('my_extension.save_query')}>
+          Save Query
+        </button>
+      </div>
+    )
+  );
+
+  // Cleanup registration
+  context.subscriptions.push(commandDisposable, eventDisposable, viewDisposable);
+}
+
+export function deactivate() {
+  // Cleanup handled automatically via disposables
+}
+```
+
+## 🤝 Contributing
+
+We welcome contributions! Please see the [Contributing Guide](https://github.com/apache/superset/blob/master/CONTRIBUTING.md) for details.
+
+## 📄 License
+
+Licensed under the Apache License, Version 2.0. See [LICENSE](https://github.com/apache/superset/blob/master/LICENSE.txt) for details.
+
+## 🔗 Links
+
+- [Apache Superset](https://superset.apache.org/)
+- [Documentation](https://superset.apache.org/docs/)
+- [Community](https://superset.apache.org/community/)
+- [GitHub Repository](https://github.com/apache/superset)
+- [Extension Development Guide](https://superset.apache.org/docs/extensions/)
+
+---
+
+**Note**: This package is currently in release candidate status. APIs may change before the 1.0.0 release. Please check the [changelog](CHANGELOG.md) for breaking changes between versions.
diff --git a/superset-frontend/packages/superset-core/package.json b/superset-frontend/packages/superset-core/package.json
index 9397a4aa55..869e2242e6 100644
--- a/superset-frontend/packages/superset-core/package.json
+++ b/superset-frontend/packages/superset-core/package.json
@@ -1,6 +1,6 @@
 {
-  "name": "superset-core",
-  "version": "0.0.1",
+  "name": "@apache-superset/core",
+  "version": "0.0.1-rc2",
   "description": "This package contains UI elements, APIs, and utility functions used by Superset.",
   "sideEffects": false,
   "main": "lib/index.js",