BUILD SYSTEM IMMEDIATE FIXES
Comprehensive guidelines for AI-assisted development within the Editor platform
Build System - Immediate Fixes Implementation
Date: October 20, 2025
Priority: ๐ด CRITICAL
Status: ๐ง IN PROGRESS
๐ฏ Objective
Fix critical path issues and update outdated defaults to prevent build failures.
๐จ Critical Fix #1: Package.json Path Corrections
Current State (โ BROKEN)
"build": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/build-scripts/build-all.js",
"build:dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/build-scripts/build-all.js --dev",
"build:libs": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/build-scripts/build-libs.js",
"build:apps": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/build-scripts/build-apps.js",
"build:quick": "node tools/build-scripts/build-all.js --no-clean --skip-nx-cache"
Fixed State (โ WORKING)
"//9": "=== BUILD COMMANDS ===",
"build": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/scripts/build-scripts/build-all.js",
"build:dev": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/scripts/build-scripts/build-all.js --dev",
"build:libs": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/scripts/build-scripts/build-libs.js",
"build:apps": "NODE_OPTIONS=\"--max-old-space-size=8192\" node tools/scripts/build-scripts/build-apps.js",
"build:quick": "node tools/scripts/build-scripts/build-all.js --no-clean --skip-nx-cache"
Changes:
tools/build-scripts/โtools/scripts/build-scripts/
๐ง Fix #2: Update generate-lib.js Defaults
Issue
New libraries are generated with declarationMap: false and sourceMap: false, but we just fixed the build system to enable these!
Current Code (โ OUTDATED)
tsconfig.compilerOptions = {
...tsconfig.compilerOptions,
baseUrl: '.',
outDir: `../../dist/libs/${config.name}`,
rootDir: './src',
declaration: true,
declarationMap: false, // โ Should be true!
sourceMap: false, // โ Should be true!
composite: false,
types: ['node'],
moduleResolution: 'node',
module: 'commonjs',
target: 'es2016',
lib: ['es2016', 'dom'],
skipLibCheck: true
};
Fixed Code (โ CORRECT)
tsconfig.compilerOptions = {
...tsconfig.compilerOptions,
baseUrl: '.',
outDir: `../../dist/libs/${config.name}`,
rootDir: './src',
declaration: true,
declarationMap: true, // โ
Enable for "Go to Definition"
sourceMap: true, // โ
Enable for debugging
composite: false,
types: ['node'],
moduleResolution: 'node',
module: 'commonjs',
target: 'es2016',
lib: ['es2016', 'dom'],
skipLibCheck: true
};
๐ Fix #3: Update fix-all-libraries.js Defaults
Issue
Same issue - when fixing libraries, we should enable declaration maps.
Current Code (โ OUTDATED)
const criticalSettings = {
outDir: `../../dist/libs/${libName}`,
rootDir: './src',
declaration: true,
skipLibCheck: true
};
Fixed Code (โ CORRECT)
const criticalSettings = {
outDir: `../../dist/libs/${libName}`,
rootDir: './src',
declaration: true,
declarationMap: true, // โ
Enable for "Go to Definition"
sourceMap: true, // โ
Enable for debugging
skipLibCheck: true
};
๐งช Verification Steps
After applying fixes:
1. Test Package.json Scripts
# These should now work without errors:
yarn build --help
yarn build:libs --help
yarn build:apps --help
yarn build:quick --help
2. Test Library Generation
# Generate a test library
yarn create:lib test-library --dry-run
# Check the generated tsconfig
# Should have declarationMap: true and sourceMap: true
3. Test Library Fixing
# Run library fixer in preview mode
yarn fix:libs:preview
# Verify it suggests enabling declaration maps
โ Implementation Checklist
- Fix package.json paths (5 scripts)
- Update generate-library.js defaults
- Update fix-all-libraries.js defaults
- Test yarn build command
- Test yarn create:lib command
- Test yarn fix:libs command
- Update BUILD-SYSTEM-COMPREHENSIVE-AUDIT.md status
- Commit changes with descriptive message
๐ฏ Expected Outcomes
After implementing these fixes:
- โ All yarn build commands work - No more "file not found" errors
- โ New libraries have correct defaults - Declaration maps enabled
- โ Library fixer updates correctly - Enables declaration maps
- โ "Go to Definition" works - For all future libraries
- โ Build system is consistent - All configs match
๐ Post-Fix Actions
Once these immediate fixes are applied:
- Test thoroughly - Run full build cycle
- Update documentation - Mark audit as "Issues Resolved"
- Announce changes - Let team know build commands are fixed
- Monitor for issues - Watch for any edge cases
Status: Ready to implement - See below for actual implementation.