v0.13.0 — Tabular Editor cleanup script alongside the AI prompt#107
Merged
Conversation
v0.12.0 shipped an AI prompt for users who run cleanup through Claude Code with the pbi-desktop plugin. Many BI devs live in Tabular Editor instead — this release generates a paste-into-TE C# script as a second output format from the same audit data, no AI loop required. Same input (FullData + category), same filtering (EXTERNALMEASURE proxies + auto-date excluded, Stage 1 / Stage 2 ordering), different output. The two formats serve different users; both ship today. - src/ai-prompts.ts: new buildTabularEditorScript(data, category) next to buildCleanupPrompt. Anonymous-type target entries (C# 3.0- compatible) for portability across TE2 (free) and TE3 (paid). Static EXTERNALMEASURE filter plus a runtime guard in the script body as defence-in-depth. Skip-and-continue pattern for missing tables / measures so the script is safe to re-run after partial saves. - Modal: segmented "AI prompt (.md) | Tabular Editor script (.csx)" toggle at the top of the body. Toggle re-renders the body, swaps the hint text, and updates the download button label / filename extension. - CLI: `--format ai-prompt | te-script` flag added to the prompt subcommand. Default is ai-prompt (backwards compatible). Unknown values fail loudly. - Tests: 9 new TE-script unit cases + 2 new CLI cases. 311/311 pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.12.0 shipped an AI prompt for users who run cleanup through Claude Code with the
pbi-desktopplugin. Many BI devs live in Tabular Editor instead — v0.13.0 generates a paste-into-TE C#.csxscript as a second output format from the same audit data, no AI loop required.Same input (FullData + category), same filtering (EXTERNALMEASURE proxies + auto-date excluded, Stage 1 / Stage 2 ordering), different output. The two formats serve different users; both ship today.
What changes
--format ai-prompt | te-scriptflag added topowerbi-lineage prompt. Default isai-prompt, fully backwards compatible with v0.12.0. Unknown values fail loudly.Script anatomy
The TE script (works in both TE2 free and TE3 paid):
{ Table, Measure, Stage }— C# 3.0 syntax, portable across every TE version.EXTERNALMEASUREin expression → skip (defence-in-depth on top of the static filter).m.Delete()only after all three guards pass.Tests
--format.Test plan
Automated (already green locally):
npm test— 311/311npm run build— cleanManual (defer to merge / pre-tag):
.pbipwith the dashboard. Confirm modal opens in AI-prompt view by default. Toggle to Tabular Editor script — body, hint, download button label, and filename extension all switch. Toggle back — same..csx. Paste into TE2 or TE3 Advanced Scripting tab. Press F5 against a sacrificial model. Confirm the listed measures get deleted (and EXTERNALMEASURE-bound ones, if any, get skipped with the runtime guard).node dist/app.js prompt --category measures-all --format te-script --report <path>emits a script.--formatomitted defaults to the markdown prompt (backwards compat smoke).🤖 Generated with Claude Code