feat: migrate custom extensions to scratch-vm monorepo (Phase 2)#1
Merged
Conversation
Migrated Smalruby-specific extensions and core file modifications from the standalone scratch-vm repository to the monorepo structure. ## Extensions Added ### High Priority Extensions - **scratch3_mesh_v2**: GraphQL/AppSync-based mesh networking - Mesh client, service, and rate limiter - GQL operations and utility functions - Environment variable configuration support - **microbitMore**: Enhanced micro:bit support - BLE and Serial communication - Tilt, touch, and gesture blocks - Extended sensor support ### Medium Priority Extensions - **scratch3_mesh**: Legacy mesh networking (P2P WebRTC) - Mesh host, peer, and service - Backward compatibility support - **koshien**: Koshien programming contest extension - Contest-specific blocks and functionality - **scratch3_smalrubot_s1**: Smalrubot S1 robot control - Robot control blocks and commands ## Core File Updates - **extension-manager.js**: Registered custom extensions - Added mesh, meshV2, smalrubotS1 to builtinExtensions - Added microbitMore and koshien with formatMessage support - **runtime.js**: Mesh functionality integration - Added BEFORE_STEP event - Added getPeripheralConnectedMessage method - Debug logging for broadcast events - **virtual-machine.js**: VM core functionality extensions - **block-utility.js**: Custom utility functions - **blocks.js**: Block processing extensions - **target.js**: Target management changes ## Utility Files - **debug-logger.js**: Debug logging utility - **task-queue.js**: Task queue implementation - Modified util files for Smalruby-specific needs ## Configuration - **.env.example**: Environment variable template - Mesh V2 GraphQL endpoint configuration - AppSync API key and AWS region - Data update and sync intervals ## Lint Fixes - Fixed all ESLint errors (102 → 0) - Added `/* global process */` comments for Node.js environment variables - Auto-fixed code style issues (indentation, formatting) - Remaining warnings are JSDoc-related (consistent with upstream) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Closed
90 tasks
Updated ESLint configuration to match upstream and reverted core files to upstream state, then re-applied only Smalruby-specific customizations. This ensures easier upstream tracking and reduces unnecessary diffs. ## Changes ### ESLint Configuration - Updated `eslint-config-scratch` from 12.0.44 to 12.0.45 (upstream version) - This aligns linting rules with upstream scratch-editor ### Core Files Alignment Reverted the following files to upstream state, then re-applied only Smalruby customizations: **block-utility.js** - Added `lastInstance` tracking for extension use **target.js** - Added `setVariableValue()` method **virtual-machine.js** - Modified PERIPHERAL_CONNECTED/DISCONNECTED event listeners to pass data - Removed EXTENSION_DATA_LOADING event listener - Added `getPeripheralConnectedMessage()` method **runtime.js** - Added `BEFORE_STEP` event constant - Removed `EXTENSION_DATA_LOADING` constant and related emit calls - Added `getPeripheralConnectedMessage()` method - Added `BEFORE_STEP` event emission in _step() method **blocks.js** - Fully reverted to upstream (no Smalruby customizations) ## Benefits - Upstream code style is preserved (no unnecessary parentheses removal, etc.) - Only Smalruby-specific functional changes remain in diffs - Future upstream merges will be cleaner and easier - Lint still passes with 0 errors, 753 warnings (same as upstream) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Removed src/util/task-queue.js as it is not used in the codebase. ## Reason - task-queue.js exists in upstream scratch-vm but is not actively used - The monorepo now has packages/task-herder with TaskQueue.ts (TypeScript implementation with enhanced features) - No references to task-queue.js found in scratch-vm source code - Keeping unused files makes upstream tracking harder ## Verification Confirmed no usage with: ```bash grep -r "task-queue" packages/scratch-vm/src --include="*.js" ``` Result: No matches (0 usage) Note: debug-logger.js is kept as it's used by Smalruby extensions: - scratch3_smalrubot_s1 - scratch3_mesh - scratch3_mesh/mesh-host - scratch3_mesh/mesh-service Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
takaokouji
pushed a commit
that referenced
this pull request
Mar 8, 2026
* fix: run stacks in response to stack click events * refactor: listen for regular click events to run block stacks
takaokouji
pushed a commit
that referenced
this pull request
Mar 8, 2026
…ty with patched scratch-blocks (#1)
takaokouji
added a commit
that referenced
this pull request
Apr 12, 2026
- Add next-steps guidance after student joins classroom (#1) - Add submit hint for students who haven't submitted yet (#2) - Add STAGE !== 'prod' failsafe for DEV_BYPASS_TOKEN (#3) - Add fullscreen tooltip to join code expand button (#4) - Improve member grid prompt to clarify clickable seats (#5) - Remove window._classroomIdToken debug variable (#8) Closes #495 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 17, 2026
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrated Smalruby-specific extensions and core file modifications from the standalone scratch-vm repository to the monorepo structure (Phase 2 of Issue #29).
Extensions Added
High Priority Extensions
scratch3_mesh_v2: GraphQL/AppSync-based mesh networking
microbitMore: Enhanced micro:bit support
Medium Priority Extensions
scratch3_mesh: Legacy mesh networking (P2P WebRTC)
koshien: Koshien programming contest extension
scratch3_smalrubot_s1: Smalrubot S1 robot control
Core File Updates
extension-manager.js
runtime.js
Other Core Files
Utility Files
Configuration
.env.example
Environment variable template for:
Lint Fixes
/* global process */comments for Node.js environment variablesTest Coverage
Build and lint passed successfully.
Changes
Related Issues
Part of #29 (Phase 2: scratch-vm migration)
🤖 Generated with Claude Code