Skip to content

Commit

Permalink
Merge branch 'master' into ListExtension
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyMakesThings authored Aug 23, 2023
2 parents e0a8b38 + b867f37 commit 7e619b0
Show file tree
Hide file tree
Showing 5 changed files with 609 additions and 12 deletions.
20 changes: 8 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ Every merged extension is more code that we will be expected to maintain indefin

We're all volunteers who all have lives outside of Scratch extensions. Many have full time jobs or are full time students. We'll get to you as soon as we can, so please be patient.

Every extension is also covered under [our bug bounty](https://github.com/TurboWarp/extensions/security/policy), so mindlessly merging things will have a direct impact on my wallet.

## Writing extensions

Extension source code goes in the [`extensions`](extensions) folder. For example, an extension placed at `extensions/hello-world.js` would be accessible at [http://localhost:8000/hello-world.js](http://localhost:8000/hello-world.js) using our development server.
Expand All @@ -51,7 +53,7 @@ The header comments look like this:
// Original: TestMuffin
```

Remember, this has to be the *very first* thing in the JS file. `Name`, `Description`, and `ID` are required. Make sure that `ID` exactly matches what you return in `getInfo()`. You can have zero or more `By` and `Original`. Put credit links in `<angled brackets>` if you have one. It must point to a Scratch user profile. The parser is pretty loose, but try not to deviate too far from this format.
Remember, this has to be the *very first* thing in the JS file. `Name`, `Description`, and `ID` are required. Make sure that `ID` exactly matches what you return in `getInfo()`. You can have zero or more `By` and `Original`. Put credit links in `<angled brackets>` if you have one. It must point to a Scratch user profile. This metadata is parsed by a script to generate the website and extension library. It tries to be pretty loose, but don't deviate too far. You must use `//`, not `/* */`.

New extensions do not *need* images, but they are highly encouraged. Save the image in the `images` folder with the same folder name and file name (but different file extension) as the extension's source code. For example, if your extension is located in `extensions/TestMuffin/fetch.js`, save the image as `images/TestMuffin/fetch.svg` or `images/TestMuffin/fetch.png`. The homepage generator will detect it automatically. Images are displayed in a 2:1 aspect ratio. SVG (preferred), PNG, or JPG are accepted. PNG or JPG should be 600x300 in resolution. Please add proper attribution to `images/README.md` for *any* resources that were not made by you.

Expand Down Expand Up @@ -123,13 +125,13 @@ If you encounter a TypeScript error, as long as you understand the error, feel f

All pull requests are automatically checked by a combination of custom validation scripts, [ESLint](https://eslint.org/), and [Prettier](https://prettier.io/). Don't worry about passing these checks on the first attempt -- most don't. That's why we have these checks.

Our custom validation scripts do things like making sure you have the correct headers at the start of your extension and that the images are the right size. You can run them locally with:
Our custom validation scripts do things like making sure you have the correct headers at the start of your extension and that the images are the right size. **Your extension must pass validation.** You can run them locally with:

```bash
npm run validate
```

ESLint detects common JavaScript errors such as referencing non-existant variables. You can run it locally with:
ESLint detects common JavaScript errors such as referencing non-existant variables. **Your extension must pass linting.** You can run it locally with:

```bash
npm run lint
Expand All @@ -139,20 +141,14 @@ You are allowed to [disable ESLint warnings and errors](https://eslint.org/docs/

When including third-party code, especially minified code, you may use `/* eslint-disable*/` and `/* eslint-enable */` markers to disable linting for that entire section.

ESLint can automatically fix certain issues. You can run this with:

```bash
npm run fix
```

We use Prettier to ensure consistent code formatting. You can format your code automatically with:
We use Prettier to ensure consistent code formatting. **Your extension does not need to pass format; we will fix it for you if linting and validation pass.** You can format your code automatically with:

```bash
npm run format
```

To just check formatting instead, use:
To just check formatting, use:

```bash
npm run check-format
```
```
Loading

0 comments on commit 7e619b0

Please sign in to comment.