Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanJereb2 authored Dec 15, 2023
2 parents 491be32 + 60c9d11 commit 5631cf9
Show file tree
Hide file tree
Showing 270 changed files with 64,509 additions and 2,641 deletions.
75 changes: 75 additions & 0 deletions .astro/types.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
declare module 'astro:content' {
export { z } from 'astro/zod';
export type CollectionEntry<C extends keyof typeof entryMap> =
(typeof entryMap)[C][keyof (typeof entryMap)[C]] & Render;

type BaseSchemaWithoutEffects =
| import('astro/zod').AnyZodObject
| import('astro/zod').ZodUnion<import('astro/zod').AnyZodObject[]>
| import('astro/zod').ZodDiscriminatedUnion<string, import('astro/zod').AnyZodObject[]>
| import('astro/zod').ZodIntersection<
import('astro/zod').AnyZodObject,
import('astro/zod').AnyZodObject
>;

type BaseSchema =
| BaseSchemaWithoutEffects
| import('astro/zod').ZodEffects<BaseSchemaWithoutEffects>;

type BaseCollectionConfig<S extends BaseSchema> = {
schema?: S;
slug?: (entry: {
id: CollectionEntry<keyof typeof entryMap>['id'];
defaultSlug: string;
collection: string;
body: string;
data: import('astro/zod').infer<S>;
}) => string | Promise<string>;
};
export function defineCollection<S extends BaseSchema>(
input: BaseCollectionConfig<S>
): BaseCollectionConfig<S>;

type EntryMapKeys = keyof typeof entryMap;
type AllValuesOf<T> = T extends any ? T[keyof T] : never;
type ValidEntrySlug<C extends EntryMapKeys> = AllValuesOf<(typeof entryMap)[C]>['slug'];

export function getEntryBySlug<
C extends keyof typeof entryMap,
E extends ValidEntrySlug<C> | (string & {})
>(
collection: C,
// Note that this has to accept a regular string too, for SSR
entrySlug: E
): E extends ValidEntrySlug<C>
? Promise<CollectionEntry<C>>
: Promise<CollectionEntry<C> | undefined>;
export function getCollection<C extends keyof typeof entryMap, E extends CollectionEntry<C>>(
collection: C,
filter?: (entry: CollectionEntry<C>) => entry is E
): Promise<E[]>;
export function getCollection<C extends keyof typeof entryMap>(
collection: C,
filter?: (entry: CollectionEntry<C>) => unknown
): Promise<CollectionEntry<C>[]>;

type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
Required<ContentConfig['collections'][C]>['schema']
>;

type Render = {
render(): Promise<{
Content: import('astro').MarkdownInstance<{}>['Content'];
headings: import('astro').MarkdownHeading[];
remarkPluginFrontmatter: Record<string, any>;
}>;
};

const entryMap: {
"translations": {
},

};

type ContentConfig = never;
}
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/sprikipedia.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Sprikipedia
about: Errors and suggestions for Sprikipedia
title: ''
labels: sprikipedia
assignees: LucasHT22

---

<!--
Describe what feature you'd like to see and.
Describe the bug with a clear and concise description of what the bug is.
Please include any relevant screenshots or context.
If you have multiple suggestions/errors, please make them as separate issues.
Thank you!
-->
11 changes: 11 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# This configuration file was automatically generated by Gitpod.
# Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml)
# and commit this file to your remote git repository to share the goodness with others.

# Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart

tasks:
- init: yarn install && yarn run build
command: yarn run start


3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"deno.enable": false
}
69 changes: 56 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# :leaves: Hack Club Sprig :leaves:
# 🍃 Hack Club Sprig 🍃

**[💻 Online Editor: Make a game](https://sprig.hackclub.com/editor)** | **[👀 Gallery: Find games](https://sprig.hackclub.com/gallery)** | **[🕸 Website](https://sprig.hackclub.com)** | **[🎮 Firmware](https://github.com/hackclub/spade)** | **[See Game Submissions](https://github.com/hackclub/sprig/pulls)**
**[💻 Online Editor: Make a game](https://sprig.hackclub.com/editor)** | **[👀 Gallery: Find games](https://sprig.hackclub.com/gallery)** | **[🕸 Landing Page](https://sprig.hackclub.com)** | **[🎮 Firmware](https://github.com/hackclub/spade)** | **[👾 Engine](https://github.com/hackclub/sprig-engine)**

[Sprig](https://sprig.hackclub.com) is a game console where **every user is a creator**. It can only be obtained by building a tile-based game in the [web-based game editor](https://sprig.hackclub.com/editor) and shipping it in the [community gallery](https://sprig.hackclub.com/gallery). It's made by [Hack Club](https://hackclub.com).

Expand All @@ -12,25 +12,25 @@

You should be able to get started in Sprig with very little programming experience. Even if you're an expert, you should still be able to have fun. Sprig games are designed to be shared and hacked on with friends. Every game submitted is easily viewable and editable in our gallery allowing people to learn from and build off each other.

## Sprig is a
## Sprig is a...

**custom handheld game console** built by Hack Club. Fall of 2022, we are giving a Sprig (valued at over $100 in components alone) to every teenage hacker that successfully shares a game they create in our [community gallery](https://sprig.hackclub.com/gallery).
...**custom handheld game console** built by Hack Club. Fall of 2022, we are giving a Sprig (valued at over $100 in components alone) to every teenage hacker that successfully shares a game they create in our [community gallery](https://sprig.hackclub.com/gallery).

<p align="left">
<a>
<img width="500" alt="Screen Shot 2022-08-22 at 4 02 04 PM" src="https://sprig.hackclub.com/stories-tiny/sprig-back.jpeg">
</a>
</p>

**[web-based game editor](https://sprig.hackclub.com/editor)** that transforms learning to code from studying language syntax to making small creative projects. The Sprig game engine exposes a small construction kit for making tile-based games. This construction kit helps you focus on being creative instead of learning big APIs. The games are just JavaScript and we built a custom system to run that same JavaScript on the microcontroller!
...**[web-based game editor](https://sprig.hackclub.com/editor)** that transforms learning to code from studying language syntax to making small creative projects. The Sprig game engine exposes a small construction kit for making tile-based games. This construction kit helps you focus on being creative instead of learning big APIs. The games are just JavaScript and we built a custom system to run that same JavaScript on the microcontroller!

<p align="left">
<a href="https://sprig.hackclub.com/editor">
<img width="500" alt="Screen Shot 2022-03-07 at 6 21 27 PM" src="https://cloud-l94lfbasw-hack-club-bot.vercel.app/0image.png">
</a>
</p>

**[hardware development kit](https://github.com/hackclub/sprig/blob/main/docs/ASSEMBLY.md)**. It’s not just for gaming! The Sprig console is designed to be assembled and disassembled. Each kit includes parts needed for getting started with hardware engineering and embedded systems programming. This includes a Raspberry Pi Pico, a TFT7735 screen, a MAX98357A I2S class D audio amplifier, a whole bunch of buttons, LEDs, a speaker, and a carrier board which wires all these components together while exposing the remaining pins on the microcontroller. It’s a complete system for generating graphics, sound, and handling tactile inputs which is reprogrammable at the touch of a button.
...**[hardware development kit](https://github.com/hackclub/sprig/blob/main/docs/ASSEMBLY.md)**. It’s not just for gaming! The Sprig console is designed to be assembled and disassembled. Each kit includes parts needed for getting started with hardware engineering and embedded systems programming. This includes a Raspberry Pi Pico, a TFT7735 screen, a MAX98357A I2S class D audio amplifier, a whole bunch of buttons, LEDs, a speaker, and a carrier board which wires all these components together while exposing the remaining pins on the microcontroller. It’s a complete system for generating graphics, sound, and handling tactile inputs which is reprogrammable at the touch of a button.

<p align="left">
<a href="https://sprig.hackclub.com">
Expand All @@ -40,7 +40,9 @@ You should be able to get started in Sprig with very little programming experien

## Fully open source

**Sprig is open source**. Shipping a game to the Sprig Gallery is contributing to an open-source project. Everything about Sprig is transparent and editable. That includes the [hardware designs](https://github.com/hackclub/sprig-hardware), the game engine for the web (this repo), the [embedded game engine for the RP2040 chip](https://github.com/hackclub/spade), and the web-editor itself (this repo)! We did some fun engineering to get Sprig to work and to make your games run the same on your desktop computer and a $4 microcontroller. That involved custom JS runtimes with optimizations in C and even PIO assembly. We also documented some [behind-the-scenes](https://github.com/hackclub/sprig/tree/main/docs).
**Sprig is open source**. Shipping a game to the Sprig Gallery is contributing to an open-source project. Everything about Sprig is transparent and editable. That includes the [hardware designs](https://github.com/hackclub/sprig-hardware), the [game engine](https://github.com/hackclub/sprig-engine), the [embedded game engine for the RP2040 chip](https://github.com/hackclub/spade), and the editor and website itself (this repo)!

We did some fun engineering to get Sprig to work and to make your games run the same on your desktop computer and a $4 microcontroller. That involved custom JS runtimes with optimizations in C and even PIO assembly. We also documented some [behind-the-scenes](https://github.com/hackclub/sprig/tree/main/docs).

## You Ship, We Ship

Expand All @@ -58,15 +60,29 @@ People learn best when they make things that they care about, which they can the

## Tutorials

To get started you can follow [this challenge in the editor](https://sprig.hackclub.com/gallery/getting_started), check out some [Sprig workshops](https://workshops.hackclub.com#sprig) or watch some short videos to get acquainted with Sprig:

<!-- [This video shows a quick overview of the editor.](https://youtu.be/GEbDRR_cqJI)
[This video shows making a simple example "game".](https://youtu.be/1UTLS4aO9bQ) -->
To get started you can follow [this challenge in the editor](https://sprig.hackclub.com/gallery/getting_started), check out some [Sprig workshops](https://workshops.hackclub.com#sprig) or [Sprig jams](https://jams.hackclub.com/batch/sprig).

## Development

Join the `#sprig` channel on the [Hack Club Slack](https://hackclub.com/slack/) where you can join the development discussion and ask for help, and to learn more about how to make games with Sprig check out the [docs](https://github.com/hackclub/sprig/tree/main/docs).
Join the `#sprig` channel on the [Hack Club Slack](https://hackclub.com/slack/) where you can join the development discussion and ask for help. We also have other channels for Sprig specific stuff:

- `#sprig-platform`: For discussion of development of the Sprig platform as a whole.
- `#sprig-gaming-controller`: Building a case for the Sprig console to make it a portable gaming controller.
- `#sprig-emulator`: Development of emulator.
- `#sprig-multiplayer`: Development of multiplayer support.
- `#sprig-lora`: Development of Sprig-Lora communicator.
- `#sdsprig`: Development of Sprig loading from an SD Card.
- `#sprig-minecraft`: Development of Minecraft for Sprig.
- `#sprig-ios-app`: Development of iOS app.
- `#sprig-engagement`: Development of a bot to post every new game to `#sprig`.
- `#vs-sprig`: Development of Sprig extension for VS Code.
- `#stationary-sprig`: Making Sprig a home console.
- `#spriggy-doom`: Development of a clone of Doom.
- `#sprigos-development`: Development of the sprigOS, the sprig game that acts like an operating system.
- `#spade`: For discussions of Spade firmware/OS of the Sprig.
- `#spaint`: Make art with your sprig with sPaint and share.

Learn more about how to make games with Sprig check out the [docs](https://github.com/hackclub/sprig/tree/main/docs).

Sprig's editor and site pages are built with [Astro](https://astro.build/) using [Preact](https://preactjs.com/) for rendering. Perhaps somewhat unusually, we predominantly use [Preact Signals](https://preactjs.com/guide/v10/signals/) for state management. The project structure is as follows:

Expand Down Expand Up @@ -106,12 +122,39 @@ Next, you'll want to give Sprig access to the Firebase credentials you created.

To start the dev server, run `yarn dev` and visit <http://localhost:3000> in your web browser! Please create a GitHub issue if you cannot get something to work properly.

### Engine Development

All *engine code* (responsible for running games, playing tunes, etc.) is in a different repo: <https://github.com/hackclub/sprig-engine/>.

If you want to work on the engine and test out your changes in the context of this repo, you'll want to use a feature called linking.

First set up the engine repo:

```
git clone https://github.com/hackclub/sprig-engine/
cd sprig-engine
yarn install
yarn link
```

Then, in this website's repo:

```
yarn link sprig
```

Now, run `yarn dev` in the engine repo to start the TypeScript build process.

## Acknowledgements

The Sprig was developed by a team at Hack Club with assistance from Brian Silverman (who helped develop Scratch and the precursor to Lego Mindstorms), Vadim Gerasimov (engineer at Google who helped create Tetris when he was 15), and Quentin Bolsée (researcher at MIT and Vrije University Brussels), and dozens contributions from teenage open-source developers!

We're also grateful for amazing open-source projects that make this possible like [Kaluma](https://kalumajs.org/), [JerryScript](https://jerryscript.net/), [uhtml](https://github.com/WebReflection/uhtml), and [CodeMirror](https://codemirror.net/).

## Responsibilities

Please refer to [this document](./RESPONSIBILITIES.md) for a list of current team members who are accountable for maintaining certain aspects of the Sprig platform.

## License

The Hack Club Sprig is open source and licensed under the [MIT License](./LICENSE). Fork, remix, and make it your own! Pull requests and other contributions greatly appreciated.
51 changes: 51 additions & 0 deletions RESPONSIBILITIES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Sprig Project Responsibilities

## Synopsis
The goal of this document is to make ownership of responsibilities / decision-making on the Sprig project crystal clear.
## Product
**Owner**: Leo\
**Responsibilities**:
* approves/denies of all end-user-facing Sprig and Spade features
* works with contributors to refine their product idea(s) into concrete form before they start coding
* responds to github issue assignments that have a feature-request tag
* can provide input (verbal/written or via github metadata) re: priorities of github issues / feature importance
* is responsible for defining/approving the long-term Sprig product vision
* has final say on all things within the product domain

## Engineering
**Owner**: Graham\
**Responsibilities**:
* defines the method/process of how code lands to the Sprig, sprig-engine, and spade github repositories
* defines the cadence and process through which code is published to end-users
* is accountable for the uptime / functionality of the Sprig website and stability of the Spade firmware
* will be accountable for issue/PR triage and direct Slack customer support (and will assign GH issues to other teams when appropriate)
* will be accountable for the overall health and proper functioning of the codebases
* has final say on all things within the engineering domain

## Operations
**Owner**: Shawn\
**Responsibilities**:
* is responsible for mailing new Sprig shipments to Hack Clubbers
* maintaining a stock of devices and components to be sent
* supports the process of obtaining replacement parts for Hack Clubbers

## Communications and Marketing
**Owner**: Kara\
**Responsibilities**:
* evangelizes to the public on behalf of the team
* ensures team aligns with the public messaging being made
* distills complex information from other team members into digestible material
* conveys community feedback to the rest of the team via stories & submitting github issues
* publicizes roles that need filling by the community

## App Review
**Owner**: Lucas\
**Responsibilities**:
* responsible for welcoming newcomers (Sprig app authors) to the Sprig project warmly when they send their initial pull requests
* ensuring that games are submitted in the proper format and according to defined policies
* maintains a high bar of quality on submitted games
* ensures that authors of Sprig games are marked for the Sprig hardware grant award when appropriate
* answers questions relating to App Review in Slack chat


### ***NOTE***: If there’s ever any disagreement between teams, blurry lines, whatever - we will have Zach dictate a compromise / solution.
11 changes: 11 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## Reporting Security Issues ✍️
This document will cover:

- [Reporting a security bug 🕵️‍♂️](https://github.com/hackclub/sprig/edit/main/SECURITY.md#reporting-a-security-bug)
- [Suggestions to improve reporting 💬](https://github.com/hackclub/sprig/edit/main/SECURITY.md#suggestions-to-improve-reporting)

### Reporting a security bug 🕵️‍♂️
Hi there 👋 Thanks for taking the time to report a potential security flaw! By doing this, you help make Sprig much safer 🔐 To report a bug, kindly contact the Hack Club team at `[email protected]`.

### Suggestions to improve reporting 💬
Everything can be made better ✨ Even the way bugs can be reported 🪲 If you think a better way could be used to report security flaws then create an issue on the repo ✍️
6 changes: 0 additions & 6 deletions deno.json

This file was deleted.

2 changes: 2 additions & 0 deletions docs/GET_A_SPRIG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ There are only a few requirements to get a Sprig console:
3. Your game has a minimum of 5 mins of gameplay
4. Your game is original

Note: for games made by a group, we only ship ONE device. (One device per PR / game).

<small>(* Our aim is to ship everywhere except US-sanctioned and trade-/mail-restricted nations.)</small>

Happy hacking!
2 changes: 2 additions & 0 deletions docs/UPLOAD.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,6 @@ cp -X ~/Downloads/pico-os.uf2 /Volumes/RPI-RP2

Open up your game in the editor, click the "Run on Device" button in the top right, and select the Sprig from the menu (again, like a USB device.)

*Note: Make sure you're using a Chromium-based browser such as Edge or Chrome. On Linux you will also need to add your user to the `dialout` group*

That's it! You're done :)
Binary file added docs/assets/rollback01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/assets/rollback02.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 5631cf9

Please sign in to comment.