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:


๐Ÿ”ง 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


๐ŸŽฏ Expected Outcomes

After implementing these fixes:

  1. โœ… All yarn build commands work - No more "file not found" errors
  2. โœ… New libraries have correct defaults - Declaration maps enabled
  3. โœ… Library fixer updates correctly - Enables declaration maps
  4. โœ… "Go to Definition" works - For all future libraries
  5. โœ… Build system is consistent - All configs match

๐Ÿš€ Post-Fix Actions

Once these immediate fixes are applied:

  1. Test thoroughly - Run full build cycle
  2. Update documentation - Mark audit as "Issues Resolved"
  3. Announce changes - Let team know build commands are fixed
  4. Monitor for issues - Watch for any edge cases

Status: Ready to implement - See below for actual implementation.