原文地址:https://github.com/LLK/scratch-gui/wiki/Getting-Started

Getting Started

 
Bryce Taylor edited this page on 13 Sep 2018 · 8 revisions

[Smokey needs Your help to keep this documentation up to date!]

The staging version of the Scratch GUI, a.k.a. the to-be-released Scratch 3.0 Editor, can be viewed at https://llk.github.io/scratch-gui/.

The Scratch editor is built up modularly from several repos. Each can stand alone, but for development purposes you may need to make dependent changes in multiple repos at once. This guide covers how to link repos.

Repos

You probably won't need all the repos. Clone the repo for the issue you are working on, and clone and link other repos as you need them.

The main ones are:

  • GUI - the React-based front end
  • VM - Manages state and does business logic. It sends the state to the GUI.
  • Scratch Blocks - branched from Blockly. This repo handles both the UI and logic for the portions of the editor that blocks appear in. Talks to the GUI, which often pipes things through to the VM.
  • Renderer - WebGL-based handler of what appears in the stage area. The GUI tells this what to do.

There are also others, like scratch-storage and scratch-audio.

Prereqs:

  • Node 8 (e.g. brew install node)

  • Git (e.g. brew install git)
  • GitHub account with SSH key set up

Getting the GUI

  1. Make a fork of GUI
  2. git clone your fork and cd into it
  3. git remote add upstream https://github.com/LLK/scratch-gui.git
  4. git config branch.develop.remote upstream (develop will be where you pull in changes from the official repo)
  5. npm install - gets dependencies
  6. npm start - starts local server which is hot reloaded
  7. Open http://localhost:8601

Getting the VM

  1. Make a fork of VM
  2. git clone your fork and cd into it
  3. git remote add upstream https://github.com/LLK/scratch-vm.git
  4. git config branch.develop.remote upstream (develop will be where you pull in changes from the official repo)
  5. npm install - gets dependencies
  6. npm run watch - starts local server, and also will tell gui to reload if it changes
  7. Playground which doesn't use GUI available at http://localhost:8073/playground/

Same process as VM for render, audio, etc.

Slightly different for scratch-blocks

  1. Make a fork of Scratch blocks
  2. git clone your fork and cd into it
  3. git remote add upstream https://github.com/LLK/scratch-blocks.git
  4. git config branch.develop.remote upstream (develop will be where you pull in changes from the official repo)
  5. npm install - gets dependencies -- If you run into the error 'Closure not found', follow the instructions on the scratch-blocks wiki to install the closure library.
  6. npm link
  7. INSTEAD OF npm run watch, you need to run npm run prepublish each time you make a change to scratch blocks that should be reflected in the GUI, then hard refresh. (No hot reloading)
  8. INSTEAD OF having to run a server for testing, simply open file:////tests/vertical_playground.html in a browser

Linking repos

  1. cd the dependency repo and run npm link
  2. cd the GUI and run npm link <dependency>

Example (Scratch GUI, VM and Blocks linked):

mkdir Scratch

cd Scratch

git clone https://github.com/llk/scratch-gui # if making changes fork the project and check out your copy

git clone https://github.com/llk/scratch-vm # if making changes fork the project and check out your copy

git clone https://github.com/llk/scratch-blocks # if making changes fork the project and check out your copy

cd scratch-vm

npm install

npm link

npm run watch

cd ../scratch-blocks

npm install

npm link

cd ../scratch-gui

npm install

npm link scratch-vm scratch-blocks

npm start

http://localhost:8601

Scratch GUI的更多相关文章

  1. Scratch Blocks本地环境搭建

    关于Scratch Blocks环境的搭建,大家在实现的过程中还是有很多的问题,目前谷歌和MIT的工程师也在进一步完善.可以通过以下方式,简单快捷的导出Scratch Blocks对应的index.h ...

  2. JAVA GUI编程学习笔记目录

    2014年暑假JAVA GUI编程学习笔记目录 1.JAVA之GUI编程概述 2.JAVA之GUI编程布局 3.JAVA之GUI编程Frame窗口 4.JAVA之GUI编程事件监听机制 5.JAVA之 ...

  3. 如何通过Git GUI将自己本地的项目上传至Github

    最近在学习node.js和react,顺便复习了下AngluarJS相关的东西,写了些小demo想放在GitHub上,之前仅限于只申请了GitHub账号从没用过,今天花半天时间查资料认真学习Githu ...

  4. git图像化界面GUI的使用

    GIT学习笔记 一.        基础内容 1.git是一个版本控制软件,与svn类似,特点是分布式管理,不需要中间总的服务器,可以增加很多分支. 2.windows下的git叫msysgit,下载 ...

  5. egret GUI 和 egret Wing 是我看到h5 最渣的设计

    一个抄袭FlexLite抄的连自己思想都没有,别人精髓都不懂的垃圾框架.也不学学MornUI,好歹有点自己想法. 先来个最小可用集合吧: 1. egret create legogame --type ...

  6. [C#] 走进异步编程的世界 - 在 GUI 中执行异步操作

    走进异步编程的世界 - 在 GUI 中执行异步操作 [博主]反骨仔 [原文地址]http://www.cnblogs.com/liqingwen/p/5877042.html 序 这是继<开始接 ...

  7. 1.JAVA之GUI编程概述

          下列内容为本人看毕向东老师java视频教程学习笔记! JAVA GUI图形用户界面编程: Windows 操作系统提供两种操作方式:                             ...

  8. 2.JAVA之GUI编程布局

    布局管理器 容器中的组件排放方式,就是布局 常见的布局管理器: **************************************************** 1.FlowLayout(流式 ...

  9. 3.JAVA之GUI编程Frame窗口

    创建图形化界面思路: 1.创建frame窗体: 2.对窗体进行基本设置: 比如大小.位置.布局 3.定义组件: 4.将组件通过add方法添加到窗体中: 5.让窗体显示,通过setVisible(tur ...

随机推荐

  1. python安装及配置

     1.进入python官网https://www.python.org/2.导航栏选择Download -> Windows3.按照系统版本点击选择32.64位安装包64 Windows x86 ...

  2. MongoDB数据库及其Python用法

    一 .命令行模式 mongo # 进入mongodb命令行模式 show dbs use taobao # 进入该数据库,如不存在则创建之 show tables # 条件操作符 (>) 大于 ...

  3. java突破------一撸到底(做Java开发,遇到瓶颈是保持现状还是寻求突破?)

    java突破------一撸到底(做Java开发,遇到瓶颈是保持现状还是寻求突破?) 很多人做Java开发2.3年之后,都会觉得自己遇到了瓶颈.什么都会又什么都不会,如何改变困境,为什么很多人写了7. ...

  4. 草稿-把vim变成IDE

    从昨天下午到现在一直在研究vim,初学者,从vim最基本的命令开始看起的.是通过vimtutor学习的. 看到最后一章的时候,发现原来vimtutor中的知识知识vim中的冰山一角,vim真正的强大之 ...

  5. 前端自动化Gulp工具常用插件

    npm init命令初始化当前文件夹后,在当前文件夹新建gulpfile.js文件.当前目录下的所有操作流都在gulpfile.js文件中定义. gulp自动化 gulp-uglify (JS压缩) ...

  6. 【转】WinForm窗体显示和窗体间传值

    以前对WinForm窗体显示和窗体间传值了解不是很清楚 最近做了一些WinForm项目,把用到的相关知识整理如下 A.WinForm中窗体显示 显示窗体可以有以下2种方法: Form.ShowDial ...

  7. 【C#】RGB转CMYK

    由于目前印兔项目中的在线设计功能设计出来的产品颜色模式不确定,但是客户设计出来的产品需要发送到印厂的客户端去下载并且印刷,只有CMYK颜色模式的产品才能正确印刷,所以需要判断产品的颜色模式是否为CMY ...

  8. mysql索引对单表查询的影响

    索引被用来快速找出在一个列上用一特定值的行.没有索引,MySQL不得不首先以第一条记录开始并然后读完整个表直到它找出相关的行.表越大,花费时间越多. 如果表对于查询的列有一个索引,MySQL能快速到达 ...

  9. 如何在没有https环境下使用webrtc

    新版本的webrtc使用需要Https,但是在内网开发调试时,要配置Https环境比较麻烦,下面的方法是教你如何在http下使用webrtc 1,点桌面上的Chrome图票,右键->属性,把目票 ...

  10. Hive & SparkSQL 比较

    Hive 在  Hadoop 集群上所有数据的访问都是通过 Java 编写的 MapReduce 作业来完成的,这些让 Java 程序员来完成没有问题. 但是对 SQL 程序员来说,写 MapRedu ...