同步操作将从 Gitee 极速下载/scratch 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
Scratch 3.0 as a standalone desktop application
Let's assume that you want to make a new release, version 3.999.0
, corresponding to scratch-gui
version
0.1.0-prerelease.20yymmdd
.
scratch-gui
:
cd scratch-gui
git pull --all --tags
git checkout scratch-desktop
git merge 0.1.0-prerelease.20yymmdd
git tag scratch-desktop-v3.999.0
git push
git push --tags
scratch-desktop
:
cd scratch-desktop
git pull --all --tags
git checkout develop
npm install --save-dev 'scratch-gui@github:LLK/scratch-gui#scratch-desktop-v3.999.0'
git add package.json package-lock.json
git commit -m "bump scratch-gui to scratch-desktop-v3.999.0"
npm version 3.999.0
git push
git push --tags
scratch-gui
Eventually, the scratch-desktop
branch of the Scratch GUI repository will be merged with that repository's main
development line. For now, though, the scratch-desktop
branch holds a few changes that are necessary for the Scratch
app to function correctly but are not yet merged into the main development branch. If you only intend to build or work
on the scratch-desktop
repository then you can ignore this, but if you intend to work on scratch-gui
as well, make
sure you use the scratch-desktop
branch there.
Previously it was necessary to explicitly build scratch-gui
before building scratch-desktop
. This is no longer
necessary and the related build scripts, such as build-gui
, have been removed.
In the scratch-desktop
directory, run npm run fetch
. Re-run this any time you update scratch-gui
or make any
other changes which might affect the media libraries.
npm start
npm run dist
Node that on macOS this will require installing various certificates.
This section is relevant only to members of the Scratch Team.
By default all Windows installers are unsigned. An APPX package for the Microsoft Store shouldn't be signed: it will be signed automatically as part of the store submission process. On the other hand, the non-Store NSIS installer should be signed.
To generate a signed NSIS installer:
p12
file.WIN_CSC_LINK
to the path to your certificate file. For maximum compatibility I use forward slashes.
set WIN_CSC_LINK=C:/Users/You/Somewhere/Certificate.p12
$env:WIN_CSC_LINK = "C:/Users/You/Somewhere/Certificate.p12"
WIN_CSC_KEY_PASSWORD
to the password string associated with your P12 file.
set WIN_CSC_KEY_PASSWORD=superSecret
$env:WIN_CSC_KEY_PASSWORD = "superSecret"
npm run dist -- -w nsis
Sometimes the macOS build process will result in a build which crashes on startup. If this happens, check in Console
for an entry similar to this:
failed to parse entitlements for Scratch[12345]: OSUnserializeXML: syntax error near line 1
This appears to be an issue with codesign
itself. Rebooting your computer and trying to build again might help. Yes,
really.
See this issue for more detail: https://github.com/electron/electron-osx-sign/issues/218
This will simulate a packaged build without actually packaging it: instead the files will be copied to a subdirectory
of dist
.
npm run dist:dir
You can debug the renderer process by opening the Chromium development console. This should be the same keyboard shortcut as Chrome on your platform. This won't work on a packaged build.
You can debug the main process the same way as any Node.js process. I like to use Visual Studio Code with a configuration like this:
"launch": {
"version": "0.2.0",
"configurations": [
{
"name": "Desktop",
"type": "node",
"request": "launch",
"cwd": "${workspaceFolder:scratch-desktop}",
"runtimeExecutable": "npm",
"autoAttachChildProcesses": true,
"runtimeArgs": ["start", "--"],
"protocol": "inspector",
"skipFiles": [
// it seems like skipFiles only reliably works with 1 entry :(
//"<node_internals>/**",
"${workspaceFolder:scratch-desktop}/node_modules/electron/dist/resources/*.asar/**"
],
"sourceMaps": true,
"timeout": 30000,
"outputCapture": "std"
}
]
},
This application includes a telemetry system which is only active if the user opts in. When testing this system, it's
sometimes helpful to reset it by deleting the telemetry.json
file.
The location of this file depends on your operating system and whether or not you're running a packaged build. Running
from npm start
or equivalent is a non-packaged build.
In addition, macOS may store the file in one of two places depending on the OS version and a few other variables. If in doubt, I recommend removing both.
%APPDATA%\Scratch\telemetry.json
%APPDATA%\Electron\telemetry.json
~/Library/Application Support/Scratch/telemetry.json
or
~/Library/Containers/edu.mit.scratch.scratch-desktop/Data/Library/Application Support/Scratch/telemetry.json
~/Library/Application Support/Electron/telemetry.json
or
~/Library/Containers/edu.mit.scratch.scratch-desktop/Data/Library/Application Support/Electron/telemetry.json
Deleting this file will:
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。