Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ AppKit's power comes from its plugin system. Each plugin adds a focused capabili

## Getting started

Follow the [Getting Started](https://databricks.github.io/appkit/docs/) guide to get started with AppKit.
Follow the [Getting Started](https://www.databricks.com/devhub/docs/appkit/v0/) guide to get started with AppKit.

🤖 For AI/code assistants, see the [AI-assisted development](https://databricks.github.io/appkit/docs/development/ai-assisted-development) guide.
🤖 For AI/code assistants, see the [AI-assisted development](https://www.databricks.com/devhub/docs/appkit/v0/development/ai-assisted-development) guide.

## Documentation

📖 For full AppKit documentation, visit the [AppKit Documentation](https://databricks.github.io/appkit/) website.
📖 For full AppKit documentation, visit the [AppKit Documentation](https://www.databricks.com/devhub/docs/appkit/v0/) website.

## Contributing

Expand Down
16 changes: 5 additions & 11 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,10 @@ This command generates static content into the `build` directory and can be serv

## Deployment

Using SSH:
Documentation is published on [DevHub](https://www.databricks.com/devhub/docs/appkit/v0/). GitHub Pages (`databricks.github.io/appkit/`) automatically redirects all existing URLs to DevHub via `.github/workflows/docs-deploy.yml`.

```bash
USE_SSH=true pnpm deploy
```

Not using SSH:

```bash
GIT_USER=<Your GitHub username> pnpm deploy
```
The `pnpm build` command:
1. Runs `docusaurus build` — generates HTML, `llms.txt`, and `.md` files
2. Runs `apply-redirects` — replaces HTML pages with redirect pages pointing to DevHub

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
Static files remain served from GitHub Pages: JSON schemas (`/schemas/`), `llms.txt`, and `.md` files (used by `npx @databricks/appkit docs` for npm-bundled documentation).
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
"scripts": {
"docusaurus": "docusaurus",
"dev": "pnpm run gen && docusaurus start --no-open",
"build": "pnpm run gen && docusaurus build",
"build": "pnpm run gen && docusaurus build && pnpm run apply-redirects",
"apply-redirects": "tsx scripts/apply-redirects.ts",
"gen": "pnpm run build-appkit-ui-styles && pnpm run generate-component-docs && pnpm run copy-schemas",
"build-appkit-ui-styles": "tsx scripts/build-appkit-ui-styles.ts",
"copy-schemas": "tsx scripts/copy-schemas.ts",
Expand Down
91 changes: 91 additions & 0 deletions docs/scripts/apply-redirects.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
/**
* Replaces all generated HTML pages with redirect pages pointing to DevHub.
* Run AFTER `docusaurus build` so that llms.txt and .md files are generated
* from the original HTML content first.
*
* Static files (schemas, llms.txt, .md) are left untouched.
*/

import { existsSync, readdirSync, statSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";

const __dirname = dirname(fileURLToPath(import.meta.url));
const BUILD_DIR = join(__dirname, "../build");
const DEVHUB_BASE = "https://www.databricks.com/devhub/docs/appkit/v0";

function generateRedirectHtml(targetUrl: string): string {
return `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Redirecting&hellip;</title>
<link rel="canonical" href="${targetUrl}" />
<meta http-equiv="refresh" content="0; url=${targetUrl}" />
</head>
<body>
<p>This page has moved. Redirecting to <a href="${targetUrl}">${targetUrl}</a>&hellip;</p>
</body>
</html>`;
}

function findHtmlFiles(dir: string): string[] {
const results: string[] = [];
for (const entry of readdirSync(dir)) {
const fullPath = join(dir, entry);
if (statSync(fullPath).isDirectory()) {
results.push(...findHtmlFiles(fullPath));
} else if (entry === "index.html") {
results.push(fullPath);
}
}
return results;
}

if (!existsSync(BUILD_DIR)) {
console.error(`Build directory not found: ${BUILD_DIR}`);
console.error("Run 'docusaurus build' first.");
process.exit(1);
}

console.log("Applying DevHub redirects to HTML pages...");

const htmlFiles = findHtmlFiles(BUILD_DIR);
let count = 0;

for (const htmlPath of htmlFiles) {
// Get path relative to build dir, e.g. "/docs/plugins/lakebase"
const relativePath = htmlPath
.slice(BUILD_DIR.length)
.replace(/\/index\.html$/, "");

// Map /docs/{path} → devhub /{path} (devhub flattens the /docs/ prefix)
const pathWithoutDocs = relativePath.replace(/^\/docs\/?/, "/");
const devhubUrl = `${DEVHUB_BASE}${pathWithoutDocs || "/"}`;

writeFileSync(htmlPath, generateRedirectHtml(devhubUrl));
count++;
}

// Catch-all 404.html for paths not matching a generated route
const notFoundHtml = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Redirecting&hellip;</title>
<script>
(function() {
var path = window.location.pathname.replace(/^\\/appkit\\/?/, '/');
path = path.replace(/^\\/docs\\/?/, '/');
var target = "${DEVHUB_BASE}" + path + window.location.search + window.location.hash;
window.location.replace(target);
})();
</script>
</head>
<body>
<p>Redirecting to <a href="${DEVHUB_BASE}/">AppKit Documentation</a>&hellip;</p>
</body>
</html>`;
writeFileSync(join(BUILD_DIR, "404.html"), notFoundHtml);

console.log(`Done! Replaced ${count} HTML page(s) with redirects.`);
4 changes: 3 additions & 1 deletion packages/appkit/src/registry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export { ResourceRegistry } from "./resource-registry";
export * from "./types";

/**
* URL to the plugin manifest JSON Schema hosted on GitHub Pages.
* URL to the plugin manifest JSON Schema.
* Can be used for validation or referenced in manifest files.
*
* @example
Expand All @@ -28,6 +28,8 @@ export * from "./types";
* ...
* }
* ```
*
* @see {@link https://www.databricks.com/devhub/docs/appkit/v0/ | AppKit Documentation}
*/
// TODO: We may want to open a PR to https://github.com/SchemaStore/schemastore
// export const MANIFEST_SCHEMA_ID =
Expand Down
4 changes: 2 additions & 2 deletions template/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{.projectName}}

A Databricks App powered by [AppKit](https://databricks.github.io/appkit/), featuring React, TypeScript, and Tailwind CSS.
A Databricks App powered by [AppKit](https://www.databricks.com/devhub/docs/appkit/v0/), featuring React, TypeScript, and Tailwind CSS.

**Enabled plugins:**
{{- if .plugins.analytics}}
Expand Down Expand Up @@ -41,7 +41,7 @@ DATABRICKS_APP_PORT=8000

#### Lakebase Configuration

The Lakebase plugin requires additional environment variables for PostgreSQL connectivity. To learn how to configure the Lakebase plugin, see the [Lakebase plugin documentation](https://databricks.github.io/appkit/docs/plugins/lakebase).
The Lakebase plugin requires additional environment variables for PostgreSQL connectivity. To learn how to configure the Lakebase plugin, see the [Lakebase plugin documentation](https://www.databricks.com/devhub/docs/appkit/v0/plugins/lakebase).
{{- end}}

### CLI Authentication
Expand Down
2 changes: 1 addition & 1 deletion template/client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ function HomePage() {
</li>
<li>
<a
href="https://databricks.github.io/appkit/"
href="https://www.databricks.com/devhub/docs/appkit/v0/"
target="_blank"
rel="noopener noreferrer"
className="text-primary underline underline-offset-4 hover:text-primary/80"
Expand Down
2 changes: 1 addition & 1 deletion template/server/routes/lakebase/todo-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export async function setupSampleLakebaseRoutes(appkit: AppKitWithLakebase) {
} catch (err) {
console.warn('[lakebase] Database setup failed:', (err as Error).message);
console.warn('[lakebase] Routes will be registered but may return errors');
console.warn('[lakebase] See https://databricks.github.io/appkit/docs/plugins/lakebase#database-permissions for troubleshooting');
console.warn('[lakebase] See https://www.databricks.com/devhub/docs/appkit/v0/plugins/lakebase#database-permissions for troubleshooting');
}

appkit.server.extend((app) => {
Expand Down
Loading