Fix #358: implement ag view — lightweight ejected-component viewer#361
Merged
roblevintennis merged 2 commits intomasterfrom Mar 10, 2026
Merged
Fix #358: implement ag view — lightweight ejected-component viewer#361roblevintennis merged 2 commits intomasterfrom
roblevintennis merged 2 commits intomasterfrom
Conversation
…iewer - New command: ag view [--port 7173] [--clean] [--no-open] - Generates .agnosticui-viewer/ Vite app per framework (React/Vue/Lit) - Always regenerates App entry on each run (keeps component list current) - Caches node_modules between runs; --clean for full rebuild - Two-pane layout: sidebar nav + main Preview/HTML/Info tabs using ag-* - Auto-imports ag-tokens.css, ag-tokens-dark.css, and ag-theme.css if present - Registers .agnosticui-viewer/ in .gitignore via ag init - Docs: ag view section added to installation.md and CLI README
…n ag view
- Alias user component imports that conflict with viewer chrome (CopyButton,
Header, Tabs) to avoid duplicate identifier errors in generated App files
- Add REACT_EXPORT_OVERRIDES and VUE_EXPORT_OVERRIDES for components whose
main React/Vue export name differs from React{Name}/Vue{Name} (e.g. Flex
uses ReactFlexRow/VueFlexRow, not ReactFlex/VueFlex which don't exist)
- Fall back to react/index when React{Name}.tsx/ts is missing in components dir
- Prevent double custom element registration in Lit viewer by only importing
chrome components from @ag-ref if they are not already in user components
- Bump CLI version to 2.0.0-alpha.17
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
Implements the
ag viewcommand as planned in issue #358.ag view [--port 7173] [--clean] [--no-open].agnosticui-viewer/— a Vite mini-app using the project's framework (React, Vue, or Lit/vanilla)ReactHeader+ReactTabs+ReactCopyButtonfrom@ag-ref; installed components rendered via inline JSXVueHeader+VueTabs+VueCopyButtonfrom@ag-ref; installed components via dynamic component map + per-componentv-ifblocksag-header+ag-tabs+ag-copy-buttonfrom@ag-ref; pure DOM /innerHTMLapproachnode_modulescached for fast restartsag view --cleannukes.agnosticui-viewer/and rebuilds fullyag-tokens.css,ag-tokens-dark.css) auto-imported;ag-theme.csspicked up automatically if presentag initnow adds.agnosticui-viewer/to.gitignoreinstallation.mdandcli/README.mdTesting
Closes #358