Files
rspade_system/docs/jqhtml_migration_report.md
root f6fac6c4bc Fix bin/publish: copy docs.dist from project root
Fix bin/publish: use correct .env path for rspade_system
Fix bin/publish script: prevent grep exit code 1 from terminating script

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-21 02:08:33 +00:00

102 lines
3.5 KiB
Markdown
Executable File

# JQHTML Migration Report: Git Submodule to NPM Packages
## Migration Completed Successfully
### What Changed
#### 1. **Package Management**
- **Before**: JQHTML was managed as a git submodule at `internal-libs/jqhtml`
- **After**: JQHTML is now managed via NPM packages from private Verdaccio registry
#### 2. **NPM Packages Installed**
- `@jqhtml/core` - Core runtime library
- `@jqhtml/parser` - Template parser/compiler
- `@jqhtml/router` - SPA router functionality
- `@jqhtml/webpack-loader` - Webpack integration (for future use)
#### 3. **Path Updates**
All references have been updated from submodule paths to npm package paths:
| Component | Old Path | New Path |
|-----------|----------|----------|
| Runtime Bundle | `internal-libs/jqhtml/packages/core/dist/jqhtml-bundle.js` | `node_modules/@jqhtml/core/dist/jqhtml-core.esm.js` |
| Parser CLI | `internal-libs/jqhtml/compile-cli.js` | `bin/jqhtml-compile` (wrapper) |
| Router | `internal-libs/jqhtml/packages/router/dist/router-bundle.js` | `node_modules/@jqhtml/router/dist/index.js` |
#### 4. **Files Modified**
- `/app/RSpade/Services/JqhtmlCompiler.php` - Updated parser path
- `/app/RSpade/Integrations/Jqhtml/JqhtmlBundleModule.php` - Updated runtime paths
- `/app/RSpade/Integrations/Jqhtml/JqhtmlIntegration.php` - Updated config paths
- `/app/RSpade/Modules/External/JqhtmlModule.php` - Updated runtime path
- `/app/RSpade/Modules/External/JqhtmlSpaModule.php` - Updated router path
#### 5. **Files Created**
- `/.npmrc` - NPM registry configuration for @jqhtml scope
- `/bin/jqhtml-compile` - CLI wrapper for @jqhtml/parser
#### 6. **Files Removed**
- `/internal-libs/jqhtml/` - Entire git submodule removed
- `.gitmodules` entry for jqhtml removed
### Critical Changes Made
#### Removed ALL Fallback Code
Per project requirements, all fallback logic was removed. The system now fails loudly if required files are missing:
- No fallback file paths
- No alternative locations
- Throws `RuntimeException` if npm packages not found
- Clear error messages directing to run `npm install`
### Authentication Configuration
NPM is configured to authenticate with the private Verdaccio registry:
```
Registry: https://privatenpm.hanson.xyz/
Username: rspade
Auth Token: [configured in .npmrc]
```
### Testing Completed
**Manifest Build**: Successfully builds with new paths
**Bundle Compilation**: FrontendBundle compiles with JQHTML integration
**No Legacy References**: All `internal-libs/jqhtml` references removed (except historical docs)
### Next Steps for Webpack Integration
The `@jqhtml/webpack-loader` package is installed but not yet integrated. When ready to implement:
1. Configure webpack to use the loader for .jqhtml files
2. Remove the PHP-based compilation wrapper
3. Build-time compilation instead of runtime
### Migration Commands Used
```bash
# Install packages
npm install
# Remove git submodule
git submodule deinit -f internal-libs/jqhtml
rm -rf internal-libs/jqhtml
git rm internal-libs/jqhtml
# Test integration
php artisan rsx:manifest:build
php artisan rsx:bundle:compile FrontendBundle
```
### Impact
- **No breaking changes** to existing functionality
- **Improved dependency management** via npm versioning
- **Easier updates** via `npm update @jqhtml/*`
- **Version locking** via package-lock.json
- **No more submodule sync issues**
### Verification
The integration has been tested and verified working with:
- RSX manifest system recognizing JQHTML files
- Bundle compiler including JQHTML runtime
- All paths correctly updated
- System fails loud if packages missing (no silent fallbacks)