Skip to content

v0.13.0 — Tabular Editor cleanup script alongside the AI prompt#107

Merged
jonathan-pap merged 1 commit into
mainfrom
feat/tabular-editor-script
May 18, 2026
Merged

v0.13.0 — Tabular Editor cleanup script alongside the AI prompt#107
jonathan-pap merged 1 commit into
mainfrom
feat/tabular-editor-script

Conversation

@jonathan-pap
Copy link
Copy Markdown
Owner

Summary

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 — v0.13.0 generates a paste-into-TE C# .csx 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.

What changes

Surface Change
Modal New segmented toggle at the top: AI prompt (.md) | Tabular Editor script (.csx). Body, hint text, and download button label switch in place when toggled.
CLI --format ai-prompt | te-script flag added to powerbi-lineage prompt. Default is ai-prompt, fully backwards compatible with v0.12.0. Unknown values fail loudly.
Improvements MD embed Unchanged — AI prompt only. TE users live in TE, not in the wiki.
Unused-tab toolbar button Unchanged — opens modal; user toggles format inside.

Script anatomy

The TE script (works in both TE2 free and TE3 paid):

  1. Hardcodes the target list as anonymous-type entries { Table, Measure, Stage } — C# 3.0 syntax, portable across every TE version.
  2. Iterates with safety guards: missing table → skip · missing measure → skip (idempotent) · EXTERNALMEASURE in expression → skip (defence-in-depth on top of the static filter).
  3. Calls m.Delete() only after all three guards pass.
  4. Prints a tally and reminds the user to Ctrl+S — TE doesn't auto-save.

Tests

  • 311/311 pass (was 299): 9 new for the TE-script generator (header, target entries, EXTERNALMEASURE static + runtime, Stage ordering, auto-date exclusion, no-op empty case, C# string escaping, trailing newline, Ctrl+S reminder), 2 new CLI cases for --format.
  • No new runtime dependencies.

Test plan

Automated (already green locally):

  • npm test — 311/311
  • npm run build — clean
  • Inline-script parse-check on the generated HTML still passes

Manual (defer to merge / pre-tag):

  • Open a real .pbip with 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.
  • Download .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).
  • CLI: node dist/app.js prompt --category measures-all --format te-script --report <path> emits a script. --format omitted defaults to the markdown prompt (backwards compat smoke).
  • Re-open the project in Lineage after running the script — confirm the audit shrinks.

🤖 Generated with Claude Code

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>
@jonathan-pap jonathan-pap merged commit 84b5b7d into main May 18, 2026
3 checks passed
@jonathan-pap jonathan-pap deleted the feat/tabular-editor-script branch May 18, 2026 18:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant