@gxp-dev/tools 2.0.5 → 2.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/dist/tui/App.d.ts +13 -0
  2. package/dist/tui/App.d.ts.map +1 -0
  3. package/dist/tui/App.js +480 -0
  4. package/dist/tui/App.js.map +1 -0
  5. package/dist/tui/components/CommandInput.d.ts +13 -0
  6. package/dist/tui/components/CommandInput.d.ts.map +1 -0
  7. package/dist/tui/components/CommandInput.js +180 -0
  8. package/dist/tui/components/CommandInput.js.map +1 -0
  9. package/dist/tui/components/GeminiPanel.d.ts +7 -0
  10. package/dist/tui/components/GeminiPanel.d.ts.map +1 -0
  11. package/dist/tui/components/GeminiPanel.js +99 -0
  12. package/dist/tui/components/GeminiPanel.js.map +1 -0
  13. package/dist/tui/components/Header.d.ts +6 -0
  14. package/dist/tui/components/Header.d.ts.map +1 -0
  15. package/dist/tui/components/Header.js +6 -0
  16. package/dist/tui/components/Header.js.map +1 -0
  17. package/dist/tui/components/LogPanel.d.ts +8 -0
  18. package/dist/tui/components/LogPanel.d.ts.map +1 -0
  19. package/dist/tui/components/LogPanel.js +89 -0
  20. package/dist/tui/components/LogPanel.js.map +1 -0
  21. package/dist/tui/components/TabBar.d.ts +9 -0
  22. package/dist/tui/components/TabBar.d.ts.map +1 -0
  23. package/dist/tui/components/TabBar.js +23 -0
  24. package/dist/tui/components/TabBar.js.map +1 -0
  25. package/dist/tui/components/WelcomeScreen.d.ts +2 -0
  26. package/dist/tui/components/WelcomeScreen.d.ts.map +1 -0
  27. package/dist/tui/components/WelcomeScreen.js +14 -0
  28. package/dist/tui/components/WelcomeScreen.js.map +1 -0
  29. package/dist/tui/index.d.ts +8 -0
  30. package/dist/tui/index.d.ts.map +1 -0
  31. package/dist/tui/index.js +47 -0
  32. package/dist/tui/index.js.map +1 -0
  33. package/dist/tui/package.json +1 -0
  34. package/dist/tui/services/ExtensionService.d.ts +11 -0
  35. package/dist/tui/services/ExtensionService.d.ts.map +1 -0
  36. package/dist/tui/services/ExtensionService.js +101 -0
  37. package/dist/tui/services/ExtensionService.js.map +1 -0
  38. package/dist/tui/services/GeminiService.d.ts +40 -0
  39. package/dist/tui/services/GeminiService.d.ts.map +1 -0
  40. package/dist/tui/services/GeminiService.js +327 -0
  41. package/dist/tui/services/GeminiService.js.map +1 -0
  42. package/dist/tui/services/ServiceManager.d.ts +40 -0
  43. package/dist/tui/services/ServiceManager.d.ts.map +1 -0
  44. package/dist/tui/services/ServiceManager.js +283 -0
  45. package/dist/tui/services/ServiceManager.js.map +1 -0
  46. package/dist/tui/services/SocketService.d.ts +19 -0
  47. package/dist/tui/services/SocketService.d.ts.map +1 -0
  48. package/dist/tui/services/SocketService.js +163 -0
  49. package/dist/tui/services/SocketService.js.map +1 -0
  50. package/dist/tui/services/ViteService.d.ts +8 -0
  51. package/dist/tui/services/ViteService.d.ts.map +1 -0
  52. package/dist/tui/services/ViteService.js +89 -0
  53. package/dist/tui/services/ViteService.js.map +1 -0
  54. package/dist/tui/services/index.d.ts +6 -0
  55. package/dist/tui/services/index.d.ts.map +1 -0
  56. package/dist/tui/services/index.js +6 -0
  57. package/dist/tui/services/index.js.map +1 -0
  58. package/package.json +11 -1
  59. package/.github/workflows/npm-publish.yml +0 -48
  60. package/CLAUDE.md +0 -400
  61. package/REFACTOR_PLAN.md +0 -194
  62. package/docs/DOCUSAURUS_IMPORT.md +0 -378
  63. package/docs/_category_.json +0 -8
  64. package/docs/app-manifest.md +0 -272
  65. package/docs/building-for-platform.md +0 -315
  66. package/docs/dev-tools.md +0 -291
  67. package/docs/getting-started.md +0 -180
  68. package/docs/gxp-store.md +0 -305
  69. package/docs/index.md +0 -44
  70. package/tsconfig.tui.json +0 -21
  71. package/vite.config.js +0 -164
@@ -1,48 +0,0 @@
1
- name: Patch and Publish to GitHub Packages
2
-
3
- on:
4
- push:
5
- branches:
6
- - main
7
-
8
- jobs:
9
- publish:
10
- runs-on: ubuntu-latest
11
- permissions:
12
- contents: write
13
- packages: write
14
- steps:
15
- - uses: actions/checkout@v4
16
- with:
17
- fetch-depth: 0
18
-
19
- - name: Configure Git
20
- run: |
21
- git config user.name github-actions
22
- git config user.email github-actions@github.com
23
- - name: Force git pull and overwrite local files
24
- run: |
25
- # DANGER! This wipes any local changes and untracked files
26
- git fetch --all
27
- git reset --hard origin/${{ github.ref_name }}
28
- git pull
29
- - uses: actions/setup-node@v4
30
- with:
31
- node-version: "22.x"
32
- registry-url: "https://registry.npmjs.org"
33
-
34
- - name: Install dependencies
35
- run: npm ci
36
- - name: Build the TUI
37
- run: npm run build:tui
38
-
39
- - name: Patch version
40
- run: |
41
- npm version patch
42
- git push
43
- git push --tags
44
-
45
- - name: Publish to NPM Packages
46
- run: npm publish
47
- env:
48
- NODE_AUTH_TOKEN: ${{ secrets.NPM_DEPLOY_TOKEN }}
package/CLAUDE.md DELETED
@@ -1,400 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## Project Overview
6
-
7
- GxP Dev Devtools (`@gramercytech/gx-devtools`) is an npm package for creating platform plugins for the GxP kiosk platform. It provides:
8
-
9
- ## Quick Start (New Developer)
10
-
11
- ```bash
12
- # 1. Clone and install dependencies
13
- git clone <repo>
14
- cd gx-devtools
15
- npm install
16
-
17
- # 2. Build the TUI (required for CLI to work)
18
- npm run build:tui
19
-
20
- # 3. Link the package globally for local development
21
- npm link
22
-
23
- # 4. Create a new test project
24
- mkdir ~/test-plugin && cd ~/test-plugin
25
- gxdev init my-plugin
26
-
27
- # 5. Start development
28
- gxdev dev --no-https # or just: npm run dev-http
29
- ```
30
-
31
- ## Features
32
-
33
- GxP Dev Devtools provides:
34
- - CLI tool (`gxdev`) for project scaffolding and development
35
- - Interactive TUI (Terminal UI) for managing dev services
36
- - Vite-based development server with HTTPS support
37
- - Socket.IO server for real-time event simulation
38
- - Browser extensions (Chrome/Firefox) for testing plugins in production environments
39
- - Project templates with Vue 3 and Pinia integration
40
- - GxP Strings Plugin for reactive string/asset replacement
41
-
42
- ## Common Commands
43
-
44
- ```bash
45
- # Development
46
- npm run dev # Start HTTPS dev server with Socket.IO
47
- npm run dev-app # Start HTTPS dev server only
48
- npm run dev-http # Start HTTP dev server (no SSL)
49
- npm run build # Build plugin for production
50
-
51
- # SSL Setup
52
- npm run setup-ssl # Generate SSL certificates via mkcert
53
-
54
- # CLI Commands (gxdev)
55
- gxdev # Launch interactive TUI
56
- gxdev init [name] # Create new project or update existing
57
- gxdev dev # Start dev server (launches TUI + auto-starts Vite)
58
- gxdev dev --no-https # Start without SSL
59
- gxdev dev --with-socket # Start with Socket.IO server
60
- gxdev dev --chrome # Start dev server and launch Chrome with extension
61
- gxdev dev --firefox # Start dev server and launch Firefox with extension
62
- gxdev build # Build for production
63
- gxdev publish <file> # Copy package files to local project
64
-
65
- # Datastore Management
66
- gxdev datastore list # List store variables
67
- gxdev datastore add # Add new variable
68
- gxdev datastore scan-strings # Scan components for hardcoded strings
69
-
70
- # Socket Simulation
71
- gxdev socket list # List available socket events
72
- gxdev socket send --event <EventName> # Send test socket event
73
-
74
- # Asset Management
75
- gxdev assets list # List development assets
76
- gxdev assets init # Initialize asset directories
77
- gxdev assets generate --size 400x300 --name placeholder # Generate placeholder images
78
-
79
- # Browser Extensions
80
- gxdev ext:firefox # Launch Firefox with extension
81
- gxdev ext:chrome # Launch Chrome with extension
82
- gxdev ext:build # Build extensions for distribution
83
- ```
84
-
85
- ## Architecture
86
-
87
- ### Directory Structure
88
- ```
89
- gx-devtools/
90
- ├── bin/ # CLI tool
91
- │ ├── gx-devtools.js # Main CLI entry point
92
- │ └── lib/
93
- │ ├── cli.js # Yargs CLI setup and command routing
94
- │ ├── constants.js # Shared constants (dependencies, scripts, ports)
95
- │ ├── commands/ # Command modules (init, dev, build, etc.)
96
- │ ├── utils/ # Utility modules (paths, ssl, files, prompts)
97
- │ └── tui/ # Interactive Terminal UI (TypeScript/Ink)
98
- │ ├── index.tsx # TUI entry point
99
- │ ├── App.tsx # Main Ink application
100
- │ ├── components/ # UI components (Header, TabBar, LogPanel, etc.)
101
- │ ├── services/ # Service managers (Vite, Socket, Extensions)
102
- │ └── commands/ # TUI slash command handlers
103
- ├── runtime/ # Files used from node_modules (NOT copied to projects)
104
- │ ├── PortalContainer.vue # Platform emulator
105
- │ ├── server.js # Socket.IO server
106
- │ ├── gxpStringsPlugin.js # Vue plugin for gxp-string/gxp-src directives
107
- │ ├── dev-tools/ # In-browser development tools
108
- │ │ ├── DevToolsModal.vue
109
- │ │ ├── StoreInspector.vue # Store inspector with element highlighting
110
- │ │ ├── LayoutSwitcher.vue
111
- │ │ ├── SocketSimulator.vue
112
- │ │ └── MockDataEditor.vue
113
- │ └── stores/
114
- │ └── gxpPortalConfigStore.js # Core Pinia store
115
- ├── template/ # Files copied to new projects during `gxdev init`
116
- │ ├── src/
117
- │ │ ├── Plugin.vue # User's app entry point
118
- │ │ ├── DemoPage.vue # Example component with gxp-string usage
119
- │ │ └── stores/ # Store setup
120
- │ ├── theme-layouts/ # Layout components (System, Private, Public)
121
- │ ├── dev-assets/images/ # Placeholder images for development
122
- │ ├── main.js # Dev entry point
123
- │ ├── vite.config.js # Project vite config
124
- │ ├── app-manifest.json # Configuration manifest (settings, strings, assets)
125
- │ └── index.html # Dev HTML template
126
- ├── socket-events/ # Socket event templates for simulation
127
- ├── browser-extensions/ # Chrome and Firefox extensions
128
- │ ├── chrome/ # Manifest V3 extension with DevTools panel
129
- │ └── firefox/ # Firefox-compatible extension
130
- ├── scripts/ # Browser extension launch/pack scripts
131
- └── dist/ # Compiled TUI output
132
- ```
133
-
134
- ### Key Concepts
135
-
136
- **Runtime vs Template:**
137
- - `/runtime/` - Files that stay in node_modules and are imported at runtime
138
- - `/template/` - Files copied to user projects during `gxdev init`
139
-
140
- **Plugin Architecture:**
141
- 1. **PortalContainer.vue** (runtime) - Platform emulator with mock router, theme, data
142
- 2. **Plugin.vue** (template) - User's app entry point, compiled for production
143
- 3. Props injected by platform: `pluginVars`, `dependencyList`, `assetUrls`, `stringsList`, `permissionFlags`, `theme`, `router`
144
-
145
- **Vite Aliases (in template/vite.config.js):**
146
- - `@` → Project's `src/` directory
147
- - `@layouts` → Project's `theme-layouts/` directory
148
- - `@gx-runtime` → Devtools's `runtime/` directory (from node_modules)
149
-
150
- ## App Manifest Configuration
151
-
152
- The `app-manifest.json` file in the project root configures the plugin:
153
-
154
- ```json
155
- {
156
- "settings": {
157
- "primary_color": "#FFD600",
158
- "background_color": "#ffffff",
159
- "custom_setting": "value"
160
- },
161
- "strings": {
162
- "default": {
163
- "welcome_title": "Welcome to My Plugin",
164
- "button_text": "Click Me"
165
- }
166
- },
167
- "assets": {
168
- "hero_image": "/dev-assets/images/hero.jpg",
169
- "logo": "/dev-assets/images/logo.png"
170
- },
171
- "triggerState": {
172
- "is_active": true,
173
- "current_step": 1
174
- },
175
- "dependencies": [],
176
- "permissions": []
177
- }
178
- ```
179
-
180
- The manifest is hot-reloaded during development - changes are reflected immediately without page refresh.
181
-
182
- ## GxP Strings Plugin
183
-
184
- The devtools provides Vue directives for reactive string and asset replacement from the store.
185
-
186
- ### String Directives
187
-
188
- ```html
189
- <!-- Replace text content with value from stringsList -->
190
- <h1 gxp-string="welcome_title">Default Welcome</h1>
191
-
192
- <!-- Replace text with value from pluginVars (settings) -->
193
- <span gxp-string="company_name" gxp-settings>Default Company</span>
194
-
195
- <!-- Replace text with value from assetList -->
196
- <span gxp-string="logo_url" gxp-assets>/default/logo.png</span>
197
-
198
- <!-- Replace text with value from triggerState -->
199
- <span gxp-string="current_status" gxp-state>idle</span>
200
- ```
201
-
202
- ### Asset/Image Directives
203
-
204
- ```html
205
- <!-- Replace src attribute with value from assetList (default) -->
206
- <img gxp-src="hero_image" src="/dev-assets/placeholder.jpg" />
207
-
208
- <!-- Replace src with value from triggerState -->
209
- <img gxp-src="dynamic_image" gxp-state src="/dev-assets/placeholder.jpg" />
210
- ```
211
-
212
- ### How It Works
213
- 1. Elements store their original content as the default fallback
214
- 2. The plugin looks up the key in the appropriate store section
215
- 3. Content/attribute is replaced if a value exists
216
- 4. Falls back to original if no value found
217
- 5. Watches for store changes and updates reactively
218
-
219
- ## GxP Store (gxpPortalConfigStore.js)
220
-
221
- The Pinia store provides reactive state management:
222
-
223
- ### Store Sections
224
- - `pluginVars` - Plugin settings/configuration
225
- - `stringsList` - Translatable strings
226
- - `assetList` - Asset URLs
227
- - `triggerState` - Dynamic state values
228
- - `dependencyList` - External dependencies
229
- - `permissionFlags` - Feature permissions
230
-
231
- ### Getter Methods
232
- ```javascript
233
- const store = useGxpStore();
234
- store.getString('welcome_title', 'Default');
235
- store.getSetting('primary_color', '#000');
236
- store.getAsset('hero_image', '/fallback.jpg');
237
- store.getState('is_active', false);
238
- store.hasPermission('admin');
239
- ```
240
-
241
- ### Update Methods (for programmatic updates)
242
- ```javascript
243
- store.updateString('welcome_title', 'New Title');
244
- store.updateSetting('primary_color', '#FF0000');
245
- store.updateAsset('hero_image', '/new-image.jpg');
246
- store.updateState('is_active', true);
247
- store.addDevAsset('logo', 'logo.png'); // Adds with dev server URL prefix
248
- ```
249
-
250
- ### API Client
251
- ```javascript
252
- await store.apiGet('/endpoint', { params });
253
- await store.apiPost('/endpoint', data);
254
- await store.apiPut('/endpoint', data);
255
- await store.apiDelete('/endpoint');
256
- ```
257
-
258
- ### Socket Methods
259
- ```javascript
260
- store.emitSocket('primary', 'event-name', data);
261
- store.listenSocket('primary', 'event-name', callback);
262
- store.useSocketListener('dependency-id', 'updated', callback);
263
- ```
264
-
265
- ## Dev Tools
266
-
267
- ### In-Browser Dev Tools (Ctrl+Shift+D)
268
- - **Store Inspector** - View/edit store state with element highlighting
269
- - Hover over keys to highlight matching elements on the page
270
- - Double-click values to edit them in real-time
271
- - **Layout Switcher** - Toggle between Public, Private, and System layouts
272
- - **Socket Simulator** - Send test socket events
273
- - **Mock Data Editor** - Edit theme colors, navigation, permissions
274
-
275
- ### Console API
276
- ```javascript
277
- window.gxDevTools.open() // Open dev tools
278
- window.gxDevTools.close() // Close dev tools
279
- window.gxDevTools.toggle() // Toggle dev tools
280
- window.gxDevTools.store() // Access the GxP store
281
- window.gxDevTools.setLayout('private') // Change layout
282
- window.gxDevTools.getLayout() // Get current layout name
283
- ```
284
-
285
- ## Browser Extensions
286
-
287
- The browser extensions provide a DevTools panel for inspecting Vue components and GxP elements.
288
-
289
- ### Features
290
- - **Element Selection** - Click to select elements on the page
291
- - **Visual Highlighting** - Hover shows orange dashed border, selected shows cyan pulsing glow
292
- - **Smart Labels** - Format: `ComponentName::element::gxp-string-key`
293
- - Example: `DemoPage::h1::welcome_title`
294
- - **String Extraction** - Extract hardcoded strings to gxp-string attributes
295
- - **Component Inspector** - View Vue component props and data
296
-
297
- ### Extension Launch
298
- Extensions automatically open to the dev server URL when launched:
299
- ```bash
300
- gxdev dev --chrome # Launches Chrome to https://localhost:3060
301
- gxdev dev --firefox # Launches Firefox to https://localhost:3060
302
- gxdev dev --no-https --chrome # Launches to http://localhost:3060
303
- ```
304
-
305
- ### Reloading Extensions
306
- After modifying extension code in `browser-extensions/`:
307
- - Chrome: Go to `chrome://extensions`, click refresh on GxP Inspector
308
- - Firefox: Go to `about:debugging`, reload the extension
309
-
310
- ## Interactive TUI
311
-
312
- The `gxdev` command launches an interactive terminal UI:
313
-
314
- ### TUI Slash Commands
315
- - `/dev` - Start Vite dev server
316
- - `/dev --no-https` - Start without SSL
317
- - `/socket` - Start Socket.IO server
318
- - `/ext chrome` - Launch Chrome extension
319
- - `/ext firefox` - Launch Firefox extension
320
- - `/stop <service>` - Stop a running service
321
- - `/clear` - Clear current tab's logs
322
- - `/quit` - Exit application
323
-
324
- ### Keyboard Shortcuts
325
- - `Ctrl+1/2/3...` - Switch between service tabs
326
- - `Ctrl+L` - Clear current log
327
- - `Ctrl+C` - Exit application
328
- - `Up/Down` - Scroll log panel
329
- - `Tab` - Focus next element
330
-
331
- ## Environment Configuration
332
-
333
- Key environment variables (set in `.env`):
334
- - `NODE_PORT` - Development server port (default: 3060)
335
- - `SOCKET_IO_PORT` - Socket.IO server port (default: 3069)
336
- - `COMPONENT_PATH` - Main component path (default: `./src/Plugin.vue`)
337
- - `USE_HTTPS` - Enable HTTPS (default: true)
338
- - `CERT_PATH`, `KEY_PATH` - SSL certificate paths
339
-
340
- ## Key Dependencies
341
- - Vue 3 with Composition API
342
- - Pinia for state management
343
- - Vite for building
344
- - Socket.IO for real-time communication
345
- - Ink (React-based TUI framework) for CLI interface
346
- - `@gramercytech/gx-componentkit` - Component library for kiosk UI
347
-
348
- ## Building the Devtools
349
-
350
- ```bash
351
- # Build the TUI (TypeScript → JavaScript)
352
- npm run build:tui
353
-
354
- # Watch mode for TUI development
355
- npm run dev:tui
356
-
357
- # Build browser extensions for distribution
358
- npm run ext:build
359
-
360
- # Full build
361
- npm run build
362
- ```
363
-
364
- ## Customizing Runtime Files
365
-
366
- If you need to customize files from the runtime directory:
367
- ```bash
368
- gxdev publish server.js # Copy server.js to project root
369
- gxdev publish gxpPortalConfigStore.js # Copy store to src/stores/
370
- ```
371
- The CLI will automatically update imports when publishing.
372
-
373
- ## Testing Plugins
374
-
375
- 1. Run `npm run dev` or `gxdev dev` to start the development server
376
- 2. Use browser extensions (`gxdev dev --chrome` or `gxdev dev --firefox`) to inject and test plugins
377
- 3. Use `gxdev socket send --event <name>` to simulate real-time events
378
- 4. Edit `app-manifest.json` to test different configurations (hot-reloaded)
379
- 5. Use Dev Tools (Ctrl+Shift+D) to inspect and modify store state in real-time
380
-
381
- ## Troubleshooting
382
-
383
- ### Strings not updating from manifest
384
- - Ensure `app-manifest.json` exists in project root
385
- - Check that string keys match between manifest and gxp-string attributes
386
- - The manifest is loaded asynchronously - first render may show defaults
387
-
388
- ### Browser extension not highlighting elements
389
- - Reload the extension after code changes
390
- - Ensure the inspector is injected (check console for `[GxP Inspector] Loaded`)
391
- - The page must be the dev server URL for the inspector to work
392
-
393
- ### SSL certificate errors
394
- - Run `npm run setup-ssl` to generate certificates with mkcert
395
- - Accept the certificate in your browser when prompted
396
-
397
- ### Hot reload not working
398
- - Check that Vite is running (look for `VITE ready` in logs)
399
- - Ensure file is within the watched directories
400
- - Try a full page refresh if HMR fails
package/REFACTOR_PLAN.md DELETED
@@ -1,194 +0,0 @@
1
- # GxP Toolkit Refactoring Plan
2
-
3
- ## Status: COMPLETED
4
-
5
- All major refactoring phases have been completed. This document is kept for reference.
6
-
7
- ---
8
-
9
- ## Phase 1: CLI Refactoring ✅ COMPLETED
10
-
11
- ### Goal
12
- Break `bin/gx-devtools.js` (2407 lines) into focused modules while maintaining backward compatibility.
13
-
14
- ### Final Structure
15
- ```
16
- bin/
17
- ├── gx-devtools.js # Entry point (~25 lines) - delegates to lib/cli.js
18
- └── lib/
19
- ├── cli.js # Yargs command definitions
20
- ├── constants.js # Dependencies, scripts, ports
21
- ├── commands/
22
- │ ├── init.js # gxdev init
23
- │ ├── dev.js # gxdev dev
24
- │ ├── build.js # gxdev build
25
- │ ├── publish.js # gxdev publish
26
- │ ├── ssl.js # gxdev setup-ssl
27
- │ ├── datastore.js # gxdev datastore <action>
28
- │ ├── socket.js # gxdev socket <action>
29
- │ ├── assets.js # gxdev assets <action>
30
- │ ├── extensions.js # gxdev ext:*
31
- │ └── index.js # Re-exports all commands
32
- └── utils/
33
- ├── paths.js # Path resolution (findProjectRoot, resolveGxPaths, etc.)
34
- ├── ssl.js # SSL certificate management
35
- ├── files.js # File operations (safeCopyFile, etc.)
36
- ├── prompts.js # User prompts (promptUser)
37
- └── index.js # Re-exports all utilities
38
- ```
39
-
40
- ### Completed Tasks
41
- - [x] Create `bin/lib/` directory structure
42
- - [x] Extract path resolution utilities to `utils/paths.js`
43
- - [x] Extract SSL management to `utils/ssl.js`
44
- - [x] Extract file utilities to `utils/files.js`
45
- - [x] Extract prompts to `utils/prompts.js`
46
- - [x] Extract dependency constants to `constants.js`
47
- - [x] Create individual command modules
48
- - [x] Update main entry point to use modular CLI
49
- - [x] Test all commands work identically
50
- - [x] Renamed CLI command from `gxto` to `gxdev`
51
-
52
- ---
53
-
54
- ## Phase 2: Folder Structure Cleanup ✅ COMPLETED
55
-
56
- ### Goal
57
- Clean up the template system and establish clear boundaries.
58
-
59
- ### Final Structure
60
- ```
61
- gx-devtools/
62
- ├── bin/ # CLI (refactored)
63
- │ └── lib/ # Modular CLI components
64
- ├── template/ # Files copied to new projects during init
65
- │ ├── src/
66
- │ │ ├── Plugin.vue # User's entry point (editable)
67
- │ │ ├── DemoPage.vue # Example component (editable)
68
- │ │ └── stores/ # Store templates
69
- │ ├── theme-layouts/ # Layout templates (editable)
70
- │ ├── dev-assets/ # Placeholder images
71
- │ ├── main.js # Dev entry point (imports from @gx-runtime)
72
- │ ├── index.html
73
- │ ├── vite.config.js # Project vite config with aliases
74
- │ ├── app-manifest.json
75
- │ ├── env.example
76
- │ ├── gitignore
77
- │ └── README.md
78
- ├── runtime/ # Files used from node_modules (NOT copied)
79
- │ ├── PortalContainer.vue # Platform emulator (immutable)
80
- │ ├── server.js # Socket.IO server
81
- │ ├── dev-tools/ # In-browser dev tools
82
- │ │ ├── DevToolsModal.vue
83
- │ │ ├── StoreInspector.vue
84
- │ │ ├── LayoutSwitcher.vue
85
- │ │ ├── SocketSimulator.vue
86
- │ │ └── MockDataEditor.vue
87
- │ └── stores/
88
- │ └── gxpPortalConfigStore.js
89
- ├── socket-events/ # Event templates (single source of truth)
90
- ├── browser-extensions/ # Chrome/Firefox extensions
91
- └── scripts/ # Build/launch scripts
92
- ```
93
-
94
- ### Completed Tasks
95
- - [x] Create `/runtime/` directory
96
- - [x] Move PortalContainer.vue to /runtime/
97
- - [x] Move server.js to /runtime/
98
- - [x] Move gxpPortalConfigStore.js to /runtime/stores/
99
- - [x] Consolidate socket-events to single location
100
- - [x] Update CLI path resolution
101
- - [x] Update template/main.js to import from @gx-runtime
102
- - [x] Update template/vite.config.js with aliases (@, @layouts, @gx-runtime)
103
- - [x] Test `gxdev init` creates correct project structure
104
-
105
- ---
106
-
107
- ## Phase 3: PortalContainer Immutability ✅ COMPLETED
108
-
109
- ### Goal
110
- Make PortalContainer.vue truly hidden from client projects while still functional for development.
111
-
112
- ### Implementation
113
- - PortalContainer.vue is in `/runtime/` (NOT copied during init)
114
- - Client's main.js imports via Vite alias: `import App from "@gx-runtime/PortalContainer.vue"`
115
- - Vite config defines `@gx-runtime` alias pointing to toolkit's runtime directory
116
-
117
- ### Completed Tasks
118
- - [x] Move PortalContainer.vue to /runtime/
119
- - [x] Update template/main.js import path
120
- - [x] Update template/vite.config.js with @gx-runtime alias
121
- - [x] Test development server loads PortalContainer from node_modules
122
- - [x] Document this architecture in CLAUDE.md
123
-
124
- ---
125
-
126
- ## Phase 4: Dev Tools Configuration Modal ✅ COMPLETED
127
-
128
- ### Goal
129
- Create an in-browser development tools modal.
130
-
131
- ### Features Implemented
132
- 1. **Store Inspector** - View/edit pluginVars, stringsList, assetList, triggerState, dependencyList
133
- 2. **Layout Switcher** - Toggle between System/Private/Public layouts
134
- 3. **Socket Simulator** - Send test socket events with JSON editor
135
- 4. **Mock Data Editor** - Edit theme colors, navigation items, user session, permissions
136
-
137
- ### Triggers
138
- - **Keyboard shortcut:** `Ctrl+Shift+D` (or `Cmd+Shift+D` on Mac)
139
- - **Floating button:** Gear icon in bottom-right corner
140
- - **Console API:** `window.gxDevTools.open()` / `.close()` / `.toggle()`
141
-
142
- ### Files Created
143
- ```
144
- runtime/dev-tools/
145
- ├── DevToolsModal.vue # Main modal with tabs
146
- ├── StoreInspector.vue # Store state viewer/editor
147
- ├── LayoutSwitcher.vue # Layout toggle
148
- ├── SocketSimulator.vue # Socket event sender
149
- ├── MockDataEditor.vue # Theme/nav/permissions editor
150
- └── index.js # Exports
151
- ```
152
-
153
- ### Completed Tasks
154
- - [x] Create DevToolsModal.vue with tabbed interface
155
- - [x] Implement StoreInspector with collapsible sections
156
- - [x] Implement LayoutSwitcher
157
- - [x] Implement SocketSimulator with event log
158
- - [x] Implement MockDataEditor
159
- - [x] Add keyboard shortcut handling
160
- - [x] Add console command API
161
- - [x] Add floating trigger button
162
- - [x] Integrate into PortalContainer.vue
163
- - [x] Document in CLAUDE.md
164
-
165
- ---
166
-
167
- ## Phase 5: Cleanup & Polish ✅ COMPLETED
168
-
169
- ### Completed Tasks
170
- - [x] Update CLAUDE.md with new structure and dev tools docs
171
- - [x] Update template/README.md with gxdev commands
172
- - [x] Rename CLI from `gxto` to `gxdev`
173
- - [x] Update all code references and documentation
174
- - [x] Add .gitignore template file
175
- - [x] Fix init command paths for new folder structure
176
-
177
- ---
178
-
179
- ## Summary of Changes
180
-
181
- ### CLI Command Rename
182
- - Old: `gxto`
183
- - New: `gxdev`
184
-
185
- ### Key Architecture Changes
186
- 1. **Monolithic CLI** → **Modular structure** in `bin/lib/`
187
- 2. **Mixed config/** → **Separate template/ and runtime/ directories**
188
- 3. **Exposed PortalContainer** → **Hidden in runtime/, accessed via @gx-runtime alias**
189
- 4. **No dev tools** → **Full dev tools modal with 4 panels**
190
-
191
- ### Vite Aliases (in projects)
192
- - `@` → Project's `src/` directory
193
- - `@layouts` → Project's `theme-layouts/` directory
194
- - `@gx-runtime` → Toolkit's `runtime/` directory (from node_modules)