Skip to content

docs: document alternative approach for local development #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -43,8 +43,7 @@ Then go to [http://localhost:8601/](http://localhost:8601/) - the playground out

## Developing alongside other Scratch repositories

### Getting another repo to point to this code

### Getting another repo to point to this code (using `npm link`)

If you wish to develop `scratch-gui` alongside other scratch repositories that depend on it, you may wish
to have the other repositories use your local `scratch-gui` build instead of fetching the current production
@@ -82,6 +81,31 @@ If you can't get linking to work right, try:
repositories, make sure to use the same node version in all of them.
* If nothing else works, unlink the repositories by running `npm unlink` in both, and start over.

##### Getting another repo to point to this code (using `npm pack`)

If you struggle to get npm link working then this alternative approach might be for you.

1. Make your code changes to the scratch-gui code.
2. Rebuild the scratch-gui project:

```
BUILD_MODE=dist npm run build
```

3. Build the scratch-gui npm package locally (this will create a gzipped tarball e.g ScratchFoundation-scratch-gui-4.1.0-beta.1.tgz).

```
npm pack
```

4. npm install and rebuild your other project (using the gzipped tarball):

```
cd ../other-project
npm install ../scratch-gui/RaspberryPiFoundation-scratch-gui-4.1.0-beta.1.tgz --force
npm run build
```

## Testing

### Documentation

Unchanged files with check annotations Beta

import React from "react";

Check failure on line 1 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

Strings must use singlequote
import ReactDOM from "react-dom";

Check failure on line 2 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

Strings must use singlequote
import PropTypes from "prop-types";

Check failure on line 3 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

Strings must use singlequote
import Draggable from "react-draggable";

Check failure on line 4 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

Strings must use singlequote
import { FormattedMessage } from "react-intl";

Check failure on line 5 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

There should be no space after '{'

Check failure on line 5 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

There should be no space before '}'

Check failure on line 5 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

Strings must use singlequote
import { ContextMenuTrigger } from "react-contextmenu";

Check failure on line 6 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

There should be no space after '{'

Check failure on line 6 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

There should be no space before '}'

Check failure on line 6 in src/components/monitor/monitor.jsx

GitHub Actions / ci-cd

Strings must use singlequote
import {
BorderedMenuItem,
ContextMenu,