本文へスキップ
Skillpedia
WebサイトとUI(フロントエンド)6.2k · #14403

developing-data-apps-locally

できること

CLIで作成またはダウンロードしたLightdashのデータアプリのローカルでの編集を案内します。Lightdashの上にカスタムのデータアプリを作る開発者向けです。

使う場面

  • ✓自分のコンピューターでLightdashのデータアプリを編集したいとき。
  • ✓データアプリをビルド、プレビュー、アップロードする必要があるとき。
  • ✓外部のAPIを、リンク済みの接続を通じてデータアプリにつなぎたいとき。

スキルのリンク

https://github.com/lightdash/lightdash/blob/main/packages/cli/src/handlers/apps/authoring/developing-data-apps-locally/SKILL.md

コピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。

使い方

いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。

貼り付け用メッセージ

このスキルを使って手伝ってください:https://github.com/lightdash/lightdash/blob/main/packages/cli/src/handlers/apps/authoring/developing-data-apps-locally/SKILL.md このリンクのSKILL.mdファイルを読んで、私の作業でその指示に従ってください。
こういうスキルを、AIが自分で見つけてくれたら?無料のSkillpedia MCPをインストール。1行で、作業の前に15,000+のスキルから探してくれます。1分でインストール →

AIへの頼み方の例

“ダウンロードしたLightdashのデータアプリをローカルで設定して、プレビューし、動いたらアップロードしてください。”

毎週5つの新しいスキル。1分で読めます。

仕組み

スキルは、データへのアクセスはすべてQuery SDKを通じて行い、外部のAPIはリンク済みの接続を使うと説明します。そのあと、ビルド、プレビュー、アップロードの手順と、アップロードの出力に表示されるチェックを案内します。

技術的な内容(元のSKILL.md)

作者による元のテキスト(英語)をGitHubからそのまま表示しています。

Developing Lightdash Data Apps Locally

You are editing a Lightdash data app that was created or downloaded with the Lightdash CLI.

The only way to reach data is the SDK

  • All app data access goes through @lightdash/query-sdk. Deployed apps use Lightdash's postMessage bridge; lightdash apps preview uses a loopback proxy restricted to the same SDK routes and project. Do not add direct fetch or REST calls.
  • For the SDK surface (query builder, useLightdash, filters, downloads), read the lightdash-data-app skill in this folder.

External HTTP APIs go through linked connections

  • The one sanctioned path to a third-party API is lightdash.externalFetch('<alias>', ...) against an external connection a project admin configured and linked to this app (see the lightdash-data-app skill).
  • The app's links are declared in this folder's lightdash-app.yml under externalConnections (- alias: stripe / connectionSlug: stripe-api). When the key is present, upload reconciles the app's links to match it exactly — so to link a connection that already exists in the project, add its {alias, connectionSlug} entry and upload. Do not remove entries casually: an entry removed from the list (or an empty list) unlinks on upload, and a manifest without the key leaves links unchanged.
  • Watch the upload output: a connectionSlug that doesn't exist in the target project is skipped with a warning (the app uploads, but externalFetch on that alias fails at runtime). Linking requires either the admin-level manage:ExternalConnection permission or an admin-enabled connection plus permission to manage the target data app — if a link is skipped or forbidden, report it to the user instead of retrying.
  • If the app needs an API with no existing connection, stop and say so — do not vendor an HTTP client or try to reach it another way. An admin must create the connection first (in project settings, or as code: lightdash download --include-external-connections, edit lightdash/external-connections/<slug>.yml, lightdash upload with the secret in LIGHTDASH_EXTERNAL_CONNECTION_SECRET_<SLUG>); then it can be linked via the manifest as above.

Library boundaries — build with what's preinstalled

  • The app builds against a fixed template dependency set — see package.json (React, Recharts, d3 + d3-cloud/d3-sankey, Radix primitives, Tailwind, lucide-react, date-fns, html-to-image, jspdf, and more). Design within this set; it covers almost all data-app needs.
  • Adding new npm packages only works when the Lightdash organization has custom dependencies enabled — assume it does not. When disabled, upload rejects new dependency declarations. Do not attempt pnpm add to find out; ask the user whether their organization has custom dependencies enabled before considering a new library.
  • Do not work around a missing library by vendoring its source into src/, inlining minified code, or fetching code at runtime. If the template set genuinely cannot express what's asked, say so and let the user decide.

The edit → build → upload loop

Run these commands from this folder under apps/<slug>/. The upload path ../.. selects the Lightdash content root.

  1. Edit files under src/ only.
  2. Run lightdash apps validate to check the source, manifest, dependencies, external-connection aliases, and semantic references against the downloaded context. Use lightdash apps validate --build to add the Cloud-parity Vite production build; use --live to check against fresh project explores or --format json in CI. A green run reports any call sites it could not fully analyze instead of silently claiming complete coverage.
  3. lightdash upload --apps <slug> --path ../.. (the slug from this folder's lightdash-app.yml) — the server rebuilds and serves the app. The server rebuild remains the final result that ships.

Cloud-parity local builds

  • lightdash apps validate --build assembles src/ in an isolated copy of the CLI's trusted template and invokes bare vite build — it deliberately does not typecheck because the Cloud build does not typecheck.
  • Apps made with lightdash apps create already have the standard template dependencies installed. After lightdash download, run npm install before requesting --build if node_modules is absent. Validation does not install the standard dependency set implicitly.
  • Apps with custom dependencies are restored into the isolated build di
よくある質問

データに直接アクセスできますか?

いいえ。スキルは、すべてのデータアクセスがQuery SDKを通じて行われ、直接のリクエストは行わないと説明しています。

外部のAPIはどう動きますか?

管理者が外部の接続を設定し、アプリはそれをマニフェストファイルでリンクします。

アップロードの後に何を確認すべきですか?

アップロードの出力を読むよう説明されています。接続の名前が存在しない場合、警告が表示されます。

詳細

作者による元の説明

Use when editing a locally created or downloaded Lightdash data app — how local editing, building, and uploading work, and what is read-only.

repo: lightdash/lightdash

人気

GitHubのスター
6.2k
ランキング
#14403
ライセンス
—
更新日
2026/11/2

このスキルは役に立ちますか?

0

ログイン して投票しましょう。

コメント

  • …

このリポジトリの他のスキル

似ているスキル