• Scratch GUI


    原文地址: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/.

    Scratch editor diagram

    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

  • 相关阅读:
    dsadsad
    线程池,封装使用,实现控制子线程
    如何能很好地安排好自己的时间?
    中文验证码
    海量数据处理专题(七)——数据库索引及优化
    java tree jtree的使用
    基于Cookie的单点登录(SSO)系统介绍
    急求VS2010的Cookie解决方法
    微软企业库5.0 学习之路系列文章索引
    Net 4.0 Parallel编程(八)Task中的数据共享(中)
  • 原文地址:https://www.cnblogs.com/xbzhu/p/10404966.html
Copyright © 2020-2023  润新知