Skip to content

Commit

Permalink
Update scratch-* packages now that merge-upstream is approaching comp…
Browse files Browse the repository at this point in the history
…letion
  • Loading branch information
GarboMuffin committed Jan 11, 2024
1 parent f6db725 commit d49a5d7
Show file tree
Hide file tree
Showing 6 changed files with 144 additions and 103 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,14 @@ We strive to make the packager easy to fork, even for mods that aren't based on

### Packages

If you want to change the VM/renderer/etc. used, just `npm install` or `npm link` a different scratch-vm/scratch-render/etc. and rebuild. You can even install a vanilla scratch-vm and all core functionality will still work (but optional features such as interpolation, high quality pen, stage size, etc. may not work)
If you want to change the scratch-vm/scratch-render/scratch-audio/scratch-storage/etc. used, this is simple:

If you encounter errors about dependencies missing, usually these will be fixed after running another `npm install`.
- `npm install` or `npm link` your package. The package name does not matter.
- Update src/scaffolding/scratch-libraries.js to import the packages with the name you have. (some of our packages are prefixed with `@turbowarp/` while others are still just `scratch-vm` -- just make sure they match yours)

Then just rebuild. You can even install a vanilla scratch-vm and all core functionality will still work (but optional features such as interpolation, high quality pen, stage size, etc. may not work)

Note that npm is a very buggy piece of software and our dependency tree is very large. Occasionally you might get errors about missing dependencies, which should go away if you run `npm install`.

### Deployment

Expand Down
202 changes: 113 additions & 89 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@
"devDependencies": {
"@babel/core": "^7.16.5",
"@babel/preset-env": "^7.16.5",
"@turbowarp/scratch-storage": "^0.0.0-development-202401111301-7559569",
"@turbowarp/scratch-svg-renderer": "^1.0.0-202401111326-62c0f26",
"babel-jest": "^27.4.5",
"babel-loader": "^8.2.3",
"comlink": "^4.3.1",
Expand All @@ -54,12 +56,10 @@
"html-webpack-plugin": "^4.5.2",
"jest": "^27.4.5",
"rimraf": "^2.7.1",
"scratch-audio": "git+https://github.com/TurboWarp/scratch-audio.git",
"scratch-render": "git+https://github.com/TurboWarp/scratch-render.git#develop",
"scratch-render-fonts": "^1.0.0-prerelease.20210401210003",
"scratch-storage": "git+https://github.com/TurboWarp/scratch-storage.git#develop",
"scratch-svg-renderer": "git+https://github.com/TurboWarp/scratch-svg-renderer.git#develop",
"scratch-vm": "git+https://github.com/TurboWarp/scratch-vm.git#develop",
"scratch-audio": "github:TurboWarp/scratch-audio#develop",
"scratch-render": "github:TurboWarp/scratch-render#develop",
"scratch-render-fonts": "^1.0.0-prerelease.20231017225105",
"scratch-vm": "github:TurboWarp/scratch-vm#develop",
"style-loader": "^2.0.0",
"svelte": "^3.44.3",
"svelte-loader": "^3.1.2",
Expand Down
7 changes: 2 additions & 5 deletions src/scaffolding/scaffolding.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import VM from 'scratch-vm';
import Renderer from 'scratch-render';
import Storage from './storage';
import AudioEngine from 'scratch-audio';
import {BitmapAdapter} from 'scratch-svg-renderer';
import JSZip from 'jszip';

import {VM, Renderer, AudioEngine, BitmapAdapter} from './scratch-libraries';
import Storage from './storage';
import {EventTarget} from '../common/event-target';
import VideoProvider from './video';
import Cloud from './cloud';
Expand Down
15 changes: 15 additions & 0 deletions src/scaffolding/scratch-libraries.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// If your package names don't match ours, just update them here and it will all just work

import VM from 'scratch-vm';
import Renderer from 'scratch-render';
import ScratchStorage from '@turbowarp/scratch-storage';
import AudioEngine from 'scratch-audio';
import {BitmapAdapter} from '@turbowarp/scratch-svg-renderer';

export {
VM,
Renderer,
ScratchStorage,
AudioEngine,
BitmapAdapter
};
2 changes: 1 addition & 1 deletion src/scaffolding/storage.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import ScratchStorage from 'scratch-storage';
import {ScratchStorage} from './scratch-libraries';

class StorageWithProgress extends ScratchStorage {
constructor () {
Expand Down

0 comments on commit d49a5d7

Please sign in to comment.