Skip to content

Conversation

@Fabrimat
Copy link
Member

@Fabrimat Fabrimat commented Jan 26, 2026

This pull request introduces several significant updates to the project, primarily focused on improving TypeScript/Deno integration, updating Regolith configuration for new modular filters, and enhancing developer tooling. The changes include new scripts for code consistency, VSCode and Deno configuration improvements, and a substantial reorganization and update of Regolith filter profiles and mappings.

Tooling and Developer Experience Improvements:

  • Added a PowerShell script .scripts/add-ts-extensions.ps1 to automatically append .ts extensions to all relative imports in TypeScript files, ensuring compatibility with Deno and improving code consistency.
  • Updated .vscode/settings.json to better support Deno in the modular_mc folder, set import specifier preferences to relative, and configured the Deno extension as the default TypeScript formatter in relevant areas.
  • Introduced regolith/deno.json to define Deno import mappings for dependencies such as @minecraft/server and others, streamlining Deno usage.
  • Modified .scripts/install_dependencies.ps1 to use deno install and simplify dependency installation steps.

Regolith Configuration and Filter Updates:

  • Updated regolith/config.json to add and configure new filters: modular_mc (version 1.1.0) and subfunctions (version 2.1.2). The default and educator_tools profiles were reorganized and now use the new modular_mc filter with updated settings, including a new whitelist and esbuild configuration. [1] [2] [3] [4] [5]
  • Adjusted filter order and settings for the system_template filter in the more_letter_blocks profile for improved prioritization.

TypeScript Migration and Mapping Updates:

  • Added new TypeScript mapping files for modular filters, such as regolith/filters_data/modular_mc/addon_setup/educator_tools/_map.ts, and migrated/renamed mapping files for more_letter_blocks from Python to TypeScript to support the modular approach. [1] [2] [3]

Fixes #35

Added the modular_mc filter to regolith/config.json with version 1.1.0. Introduced auto-map.ts in filters_data/modular_mc, providing a comprehensive mapping of file extensions to Bedrock project structure paths, supporting both JSON and Python source files, and utilizing the scope namespace for dynamic path resolution.
Moved the 'default' profile below 'bedrock' and above 'educator_tools' for better organization. Adjusted the order of 'scope', 'scope_path', and 'prioritized_systems' in relevant profiles to improve consistency.
Introduces a new modular_mc/letter_blocks system for generating Minecraft letter blocks, including TypeScript scripts, block/item/loot/texture definitions, font assets, and a plugin for automated image generation. Updates dependencies to include 'canvas' and '@types/node' for image processing support.
Replaced Python-style template expressions with JavaScript-style template literals and mapping functions in all letter block resource files. This change improves consistency and aligns with the new templating approach for generating block, item, and texture definitions.
Removed 'canvas' and '@types/node' from filters_data/package.json and added them to the new regolith/package.json. Introduced regolith/package-lock.json to manage dependencies for the new regolith package.
Changed the safe_name for the underscore character from '_' to 'underscore' in the letter_blocks scope definition for consistency and clarity.
Deleted the entire letter_blocks system template, including all related scripts, configuration, assets, and font files. Also removed the 'letter_blocks' entry from the systems list in regolith/config.json. This cleans up unused or deprecated resources from the project.
Introduced a new filter entry 'modular_mc' in the configuration to support additional filtering options.
Replaces Node.js dependencies with Deno equivalents, adds deno.json and deno.lock, and removes package.json. Updates imports and font handling in letter block generation to use Deno's canvas library. Also adds conflict merge handling in educator_tools/_map.py and reorders modular_mc filter in config.json.
Added the 'subfunctions' filter to regolith config and pipeline. Refactored letter_block.mcfunction to use text templates for dynamic function generation. Introduced a scope file for subfunctions.
Relocated the scripting_setup filter from system_template to modular_mc, renaming and moving manifest.json accordingly. Converted _map.py to _map.ts, removing Python-specific fields and updating the format. Deleted obsolete README.md and _scope.json files from the old location.
Moved more_letter_blocks filter data from system_template to modular_mc, introducing a modular structure with new TypeScript-based mapping and letter image generation scripts. Added new block, item, and texture templates, updated loot and attachable definitions to use template syntax, and provided a comprehensive scope.ts for letter sets. This change enables easier extension, automation, and customization of letter block assets.
Renamed the file from Python (.py) to TypeScript (.ts) to reflect a change in language or project requirements. No code changes were made.
Moved addon_setup files for educator_tools and more_letter_blocks from system_template to modular_mc, renaming and converting _map.py files to _map.ts. Removed unused _scope.json files. This improves organization and updates mapping scripts to TypeScript.
Moved assignment_item assets and configuration from system_template to modular_mc/educator_tools. Replaced the Python _map.py with a new TypeScript _map.ts file for mapping configuration, and removed the obsolete _scope.json.
Introduces a 'whitelist' array under the 'settings' for the 'modular_mc' filter in regolith/config.json, specifying allowed modules such as 'educator_tools', 'letter_blocks', 'scripting_setup', and 'addon_setup/educator_tools'.
Moved educator_tools item files from system_template to modular_mc directory. Replaced the Python _map.py with a new TypeScript _map.ts file, and removed the unused _scope.json.
Added missing quotes around the :autoFlat value in the target property to correct a syntax error in the MAP array.
Replaces 'on_conflict' with 'onConflict' in mapping objects for consistency. Also updates formatting in _map.ts files for improved readability.
The system_template filter and its settings have been commented out in regolith/config.json, likely to temporarily disable its processing without removing the configuration.
Moved educator_tools/timer assets from system_template to modular_mc, replacing Python-based templates with TypeScript and JavaScript equivalents. Updated timer.behavior.json to use JavaScript template expressions instead of Python, and removed obsolete Python mapping and scope files.
Cleaned up the README.md file by removing unnecessary trailing whitespace from the last line.
Relocates educator_tools/custom_ui files from system_template to modular_mc, preserving all assets and configuration. Adds a new _map.ts file for dynamic UI file mapping and updates _ui_defs.json to use a template variable. Removes the old Python-based _ui_defs.json.
Deleted regolith/filters_data/modular_mc/educator_tools/custom_ui/_map.py as part of cleaning up unused or obsolete configuration files related to UI mapping.
Moved educator_tools/feedback_prompt data from system_template to modular_mc, converting configuration from Python/JSON to TypeScript. Updated dialogue files to use '::feedback_url' syntax and added new _map.ts and scope.ts files. Removed obsolete _map.py and _scope.json.
Relocated translation files from system_template to modular_mc/educator_tools/translations. Added _map.ts to define translation file handling and languages.json for language metadata.
All educator tools icon assets were relocated from system_template to modular_mc for better organization. Added a new _map.ts file to define icon mapping for the modular_mc educator_tools icons.
Moved educator tools scripts from system_template to modular_mc/educator_tools/logic, including all subscripts and modules. Updated config.json to remove system_template and esbuild filters, adding modular_mc esbuild settings. Added new _map.ts for script discovery and main.js entry point. Cleaned up obsolete files and dependencies.
Updated all TypeScript files to use explicit .ts extensions in relative import paths for Deno compatibility. Added a PowerShell script to automate this process and updated VSCode settings for Deno support. Removed package.json and package-lock.json as part of migration.
Exclude the /regolith/.modular_mc file from version control to prevent accidental commits of generated or local files.
Added new npm imports to regolith/deno.json for Bedrock and Minecraft packages. Simplified .scripts/install_dependencies.ps1 by removing npm install steps and using deno install. Updated regolith/deno.lock to reflect new dependencies.
Fabrimat and others added 13 commits January 26, 2026 17:20
Removed unused or redundant dependency entries and updated the lockfile to reflect current package versions and dependency structure.
The 'dev' task was removed from the deno.json configuration, possibly to simplify the file or because it is no longer needed.
Set the 'deno.config' option in .vscode/settings.json to specify the Deno configuration file location for the project.
Specified the output file path for esbuild in config.json to 'BP/scripts/edu_tools/main.js' to control where the built JavaScript file is generated.
…eration

Introduces a workingDir option to generateLetterImages for more robust relative path resolution, and updates all file and directory operations to use this base directory. Also improves background image and font loading logic, ensuring correct handling of absolute and relative paths, and updates the letter block image generation pipeline accordingly.
Replaces the batch letter image generator with an async function that generates images for individual letters. Updates the map and plugin code to use the new function, adjusts directory paths, and improves output file organization. This change enables more granular control and better integration with build processes.
Converted indentation from tabs to 2 spaces throughout the scope.ts file for consistency and improved readability. No functional changes were made.
Replace unreliable measureText actualBoundingBox metrics (undefined in
Deno canvas/skia) with a temporary canvas pixel scan approach, matching
the Pillow textbbox centering logic from the original Python script.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Modified item and terrain texture JSON files to remove the 'letter_blocks' subdirectory from texture paths, simplifying the directory structure for letter block textures.
Changed all getLetterBlockPngs calls to use the full path 'data/modular_mc/letter_blocks/letter_blocks' instead of 'letter_blocks'. This ensures correct file resolution for block, loot, item, and attachable definitions.
Improves readability of the draw position log by splitting the canvas dimensions onto separate lines. No functional changes to logic.
Replaces the batch generateLetterImages function with a new generateLetterImage function that generates images for individual letters asynchronously. Updates _map.ts to use the new function, changes file and directory paths to be more explicit, and improves centering and output logic for generated images. This refactor enables more granular control and better integration with the build process.
Updated all assignment-related scene files to use new icon paths by removing the '/icons' segment and standardizing to 'textures/edu_tools/ui/{module}/{icon}'. Also cleaned up imports and improved code consistency across assignment UI scenes.
@Fabrimat Fabrimat requested a review from Copilot January 27, 2026 15:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates the build system from System Template to Modular MC, updating the project structure, build configuration, and dependency management to align with the new framework.

Changes:

  • Migrated from System Template to Modular MC build system
  • Updated import paths to include .ts extensions throughout the codebase
  • Consolidated dependencies into deno.json and removed package.json

Reviewed changes

Copilot reviewed 134 out of 390 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
regolith/filters_data/package.json Removed legacy npm package.json (dependencies moved to deno.json)
regolith/filters_data/modular_mc/scripting_setup/_map.ts Added scripting setup map for manifest merging
regolith/filters_data/modular_mc/more_letter_blocks/plugins/generateLetters.ts Added letter image generation plugin for more_letter_blocks
regolith/filters_data/modular_mc/more_letter_blocks/block/*.json Added block definition templates for letter blocks
regolith/filters_data/modular_mc/more_letter_blocks/_map.ts Added map configuration for more_letter_blocks module
regolith/filters_data/modular_mc/letter_blocks/* Added letter_blocks module with scope and generation logic
regolith/filters_data/modular_mc/educator_tools/translations/_map.ts Added translation file mapping
regolith/filters_data/modular_mc/educator_tools/timer/* Updated timer entity configuration with template syntax changes
regolith/filters_data/modular_mc/educator_tools/logic/**/*.ts Added .ts extensions to all relative imports
regolith/filters_data/modular_mc/educator_tools/logic/_map.ts Added script file discovery for bundling
regolith/filters_data/modular_mc/educator_tools/*/_.map.ts Added map configurations for various educator_tools modules
regolith/filters_data/modular_mc/auto-map.ts Added automatic file extension to path mapping
regolith/filters_data/modular_mc/addon_setup/*/_map.ts Updated addon setup maps for new syntax
regolith/deno.json Added Deno configuration with dependencies
regolith/config.json Updated build profiles to use modular_mc filter
.vscode/settings.json Added Deno-specific editor configuration
.scripts/install_dependencies.ps1 Updated to use deno install instead of npm
.scripts/add-ts-extensions.ps1 Added script to automate .ts extension addition
Files not reviewed (1)
  • regolith/filters_data/package-lock.json: Language not supported

Deleted the python_modules filter and its requirements from the configuration and filesystem. Updated config.json to remove references to python_modules, system_template, and system_template_esbuild filters, streamlining the filter setup.
@Fabrimat Fabrimat linked an issue Jan 27, 2026 that may be closed by this pull request
Fabrimat and others added 2 commits January 27, 2026 16:52
Deleted the entry for the inverted question mark (¿) from the diacritic group in the letter_blocks scope definition.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@Fabrimat Fabrimat marked this pull request as ready for review January 27, 2026 15:53
Simplified the texture path in letter_block_placer.attachable.json by removing the 'letter_blocks' subdirectory. This change likely reflects a reorganization of texture assets.
Changed texture paths in item, attachable, and terrain JSON files to remove the 'letter_blocks' subdirectory. This streamlines texture references for letter blocks.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build Error of Educator Tool

2 participants