16 Commits

Author SHA1 Message Date
roncodes
1f4b25faee feat: Clean up app/extensions directory before each build
Added directory cleanup logic to remove ./app/extensions before generating
new extension files. This prevents old/stale/removed extensions from
remaining in subsequent builds.

Changes:
- Added fs.rmSync to remove extensions directory if it exists
- Cleanup happens at the start of generateExtensionFiles()
- Directory is recreated during generation process
- Logs cleanup action for visibility

This ensures each build starts with a clean slate and only includes
currently installed extensions.
2025-12-05 07:20:24 -05:00
Ronald A. Richardson
9653cfcaf0 refactor of universe and lazy loading fix contd. 2025-12-03 09:55:12 +08:00
Ronald A. Richardson
ca3050905d feat: preparing for performance tweaking to page load sub 1s 2025-11-28 11:56:38 +08:00
roncodes
cf2ced1512 feat: Add ASCII logo header to generated files and improve console output
- Added Option 1 ASCII logo header to all generated files
- Header includes copyright notice and AGPL-3.0 license
- Improved console logging with [Fleetbase] prefix
- Better formatted output with separators and extension listing
- Cleaner file change notifications
- More professional and readable build output
2025-11-27 06:12:02 -05:00
roncodes
93b7224335 feat: Generate app/extensions/index.js with new format and cleanup
- Changed extension loader generation to create app/extensions/index.js
- New format uses direct imports instead of dynamic imports
- Added getExtensionLoader helper function
- Removed unused plugins directory
- Removed old extension-loaders.generated.js file
- Cleaner and simpler loader structure
2025-11-27 05:48:54 -05:00
roncodes
9a053cfd9f fix: Use exact working logic from prebuild.js in in-repo addon
- Copied all working functions from prebuild.js
- Adapted only for addon context (this.project.root instead of __dirname)
- No logic changes, just direct migration
- Should work exactly like prebuild.js did
2025-11-27 05:30:14 -05:00
roncodes
56897af057 Revert refactor - caused regression in extension discovery 2025-11-27 05:28:25 -05:00
roncodes
b27e485a44 fix: Router mount context issue and refactor into modular utilities
- Fixed 'this' context issue in addConsoleExtensions/addRootExtensions
- Refactored monolithic index.js into separate utility modules:
  - discover-extensions.js - Extension discovery logic
  - generate-extension-shims.js - Shim file generation
  - generate-extension-loaders.js - Loader map generation
  - generate-router.js - Router AST manipulation
  - generate-manifest.js - Manifest generation
  - watch-extensions.js - File watching logic
- Simplified index.js to orchestrate utilities
- Improved code organization and maintainability
2025-11-27 05:23:38 -05:00
Ronald A. Richardson
94c5407387 fix: syntax error in extensions generator lib 2025-11-27 18:15:27 +08:00
roncodes
54ac27b304 fix: Use correct router.map.js path (console/router.map.js not app/router.map.js) 2025-11-27 04:56:56 -05:00
roncodes
4fb596c866 fix: Router generation and add file watching for extension changes
**Router Generation Fixes:**
- Fix router.js parsing (was looking for non-existent router.map.js)
- Parse Router.map(function() {...}) structure correctly
- Fix console route detection (check for path: '/' config)
- Fix function expression location (3rd arg after path config)
- Fix root extensions to use this.mount() not router.mount()

**File Watching:**
- Add chokidar to watch extension.js files in development
- Regenerate shims and loaders when extension.js changes
- Cache discovered extensions for regeneration
- Only watch in development mode

**Issues Fixed:**
1. Router.js now properly contains engine mounts
2. Extension.js changes trigger automatic regeneration
2025-11-27 04:35:16 -05:00
roncodes
3f12e98448 refactor: Simplify extension generator to write directly to app directory
- Remove Broccoli tree complexity, use included() hook instead
- Write files directly to app/ using Node.js fs operations
- Generate extension shims in app/extensions/
- Generate extension loaders in app/utils/extension-loaders.generated.js
- Generate router.js with proper engine mounts using recast AST
- Generate extensions.json manifest in public/
- Add recast dependency for AST manipulation
- Much simpler and more reliable than Broccoli trees
2025-11-27 04:09:59 -05:00
roncodes
a1fc1e4ff8 fix: Correct Funnel srcDir configuration and add improved logging
- Fix BroccoliMergeTrees error by adding srcDir to Funnel calls
- extensionShims: srcDir 'extensions' (files in outputPath/extensions/)
- extensionLoaders: srcDir 'utils' (files in outputPath/utils/)
- routerGen: srcDir '/' (files at outputPath root)
- Add comprehensive debug logging to all plugins
- Add detailed logging to in-repo addon index.js
- Improves debugging and troubleshooting of build process
2025-11-27 03:25:56 -05:00
Ronald A. Richardson
d622b617c3 feat: migrate from plugins to in-app-repo with build hooks 2025-11-27 16:13:44 +08:00
Ronald A. Richardson
ffab66ac6c feat: refactoring extension build pipelines 2025-11-27 11:20:14 +08:00
Ronald A. Richardson
8c1f96ef0e console is no longer a submodule 🚀 2023-10-10 20:43:18 +08:00