From 9611401e1c34147265bc3d24f271051832aec954 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Fri, 1 Dec 2017 10:31:04 -0500 Subject: [PATCH 1/2] Move pen and wedo into extensions folder --- src/extension-support/extension-manager.js | 4 ++-- .../scratch3_pen/index.js} | 16 ++++++++-------- .../scratch3_wedo2/index.js} | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) rename src/{blocks/scratch3_pen.js => extensions/scratch3_pen/index.js} (98%) rename src/{blocks/scratch3_wedo2.js => extensions/scratch3_wedo2/index.js} (99%) diff --git a/src/extension-support/extension-manager.js b/src/extension-support/extension-manager.js index c3346a22d..af0dce066 100644 --- a/src/extension-support/extension-manager.js +++ b/src/extension-support/extension-manager.js @@ -6,8 +6,8 @@ const BlockType = require('./block-type'); // These extensions are currently built into the VM repository but should not be loaded at startup. // TODO: move these out into a separate repository? // TODO: change extension spec so that library info, including extension ID, can be collected through static methods -const Scratch3PenBlocks = require('../blocks/scratch3_pen'); -const Scratch3WeDo2Blocks = require('../blocks/scratch3_wedo2'); +const Scratch3PenBlocks = require('../extensions/scratch3_pen'); +const Scratch3WeDo2Blocks = require('../extensions/scratch3_wedo2'); const Scratch3MusicBlocks = require('../extensions/scratch3_music'); const builtinExtensions = { pen: Scratch3PenBlocks, diff --git a/src/blocks/scratch3_pen.js b/src/extensions/scratch3_pen/index.js similarity index 98% rename from src/blocks/scratch3_pen.js rename to src/extensions/scratch3_pen/index.js index 37609952f..8b6e51cbb 100644 --- a/src/blocks/scratch3_pen.js +++ b/src/extensions/scratch3_pen/index.js @@ -1,11 +1,11 @@ -const ArgumentType = require('../extension-support/argument-type'); -const BlockType = require('../extension-support/block-type'); -const Cast = require('../util/cast'); -const Clone = require('../util/clone'); -const Color = require('../util/color'); -const MathUtil = require('../util/math-util'); -const RenderedTarget = require('../sprites/rendered-target'); -const log = require('../util/log'); +const ArgumentType = require('../../extension-support/argument-type'); +const BlockType = require('../../extension-support/block-type'); +const Cast = require('../../util/cast'); +const Clone = require('../../util/clone'); +const Color = require('../../util/color'); +const MathUtil = require('../../util/math-util'); +const RenderedTarget = require('../../sprites/rendered-target'); +const log = require('../../util/log'); /** * Icon svg to be displayed at the left edge of each extension block, encoded as a data URI. diff --git a/src/blocks/scratch3_wedo2.js b/src/extensions/scratch3_wedo2/index.js similarity index 99% rename from src/blocks/scratch3_wedo2.js rename to src/extensions/scratch3_wedo2/index.js index 1fefe0e16..ad1fd14d0 100644 --- a/src/blocks/scratch3_wedo2.js +++ b/src/extensions/scratch3_wedo2/index.js @@ -1,7 +1,7 @@ -const ArgumentType = require('../extension-support/argument-type'); -const BlockType = require('../extension-support/block-type'); -const color = require('../util/color'); -const log = require('../util/log'); +const ArgumentType = require('../../extension-support/argument-type'); +const BlockType = require('../../extension-support/block-type'); +const color = require('../../util/color'); +const log = require('../../util/log'); /** * Icon svg to be displayed at the left edge of each extension block, encoded as a data URI. From ae38ace665a97d72d18f7d27b58be7f0d150dac5 Mon Sep 17 00:00:00 2001 From: Eric Rosenbaum Date: Fri, 1 Dec 2017 10:32:32 -0500 Subject: [PATCH 2/2] Fix path in pen test --- test/integration/pen.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/integration/pen.js b/test/integration/pen.js index 7df798e7b..bb9f7c828 100644 --- a/test/integration/pen.js +++ b/test/integration/pen.js @@ -2,7 +2,7 @@ const Worker = require('tiny-worker'); const path = require('path'); const test = require('tap').test; -const Scratch3PenBlocks = require('../../src/blocks/scratch3_pen'); +const Scratch3PenBlocks = require('../../src/extensions/scratch3_pen/index.js'); const VirtualMachine = require('../../src/index'); const dispatch = require('../../src/dispatch/central-dispatch');