Skip to content
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
.git
dist
.astro
10 changes: 5 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ on: # This workflow should run on...
push: # a push...
branches: # to one of these branches:
- 'main'
- 'add-ci' # TEMP for testing
workflow_dispatch: # or when manually triggered
pull_request: # or when a pull request is opened against main
branches:
- 'main'
pull_request:

permissions:
contents: read

defaults:
run:
Expand All @@ -29,7 +29,7 @@ jobs:
run: cd ~/sprig/firmware/spade && python3 gardenshed.py build

- name: 'Upload artifact'
uses: 'actions/upload-artifact@v4'
uses: 'actions/upload-artifact@v7'
with:
name: 'firmware.uf2'
path: '~/sprig/firmware/spade/firmware.uf2'
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Docker Build

on: # This workflow should run on...
push: # a push...
branches: # to one of these branches:
- 'main'
workflow_dispatch: # or when manually triggered
pull_request:

permissions:
contents: read

jobs:
docker-build:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout Code
uses: actions/checkout@v6

- name: Build Docker Image
run: docker build -t sprig-ci .

- name: Start Container
run: |
docker run -d \
--name sprig-ci \
-p 4321:4321 \
-e NODE_OPTIONS="--max-old-space-size=4096" \
sprig-ci

- name: Wait for Server to Start
run: |
echo "Waiting for Astro dev server to start..."
for i in $(seq 1 15); do
if curl -sf -o /dev/null http://localhost:4321; then
echo "Server is up after ${i}s!"
exit 0
fi
sleep 1
done
echo "Server failed to respond within 15s"
docker logs sprig-ci
exit 1

- name: Show Container Logs on Failure
if: failure()
run: docker logs sprig-ci
24 changes: 18 additions & 6 deletions .github/workflows/test-game.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
name: test-game

on:
on:
push:
branches:
- 'main'
workflow_dispatch:
pull_request:
branches:
- main
paths:
- 'games/**.js'

Expand All @@ -19,7 +20,7 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

Expand All @@ -35,7 +36,7 @@ jobs:

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41.0.1
uses: tj-actions/changed-files@v47
with:
files: |
games/**.js
Expand All @@ -45,8 +46,19 @@ jobs:
echo "Changed Files:"
echo "${{ steps.changed-files.outputs.all_changed_files }}"

- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: 24

- name: Build Engine
run: |
yarn install --frozen-lockfile
yarn build
working-directory: engine

- name: Setup Deno
uses: denoland/setup-deno@v1.1.3
uses: denoland/setup-deno@v2

- name: Check Games
run: deno run --allow-read tests/sprigfuzzy_workflow.js ${{ steps.changed-files.outputs.all_changed_files }}
27 changes: 0 additions & 27 deletions .github/workflows/typescript_check.yml

This file was deleted.

16 changes: 11 additions & 5 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
name: Unit Tests

on:
on: # This workflow should run on...
push: # a push...
branches: # to one of these branches:
- 'main'
workflow_dispatch: # or when manually triggered
pull_request:
types: [opened, reopened, edited, synchronize]

permissions:
contents: read

env:
PUBLIC_MAX_LOOP_TIME_MS: 1500
Expand All @@ -14,12 +20,12 @@ jobs:

strategy:
matrix:
node-version: [20.x]
node-version: [24.x]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v6
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v6
with:
node-version: ${{ matrix.node-version }}
cache: "yarn"
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Use Node.js 20 with Alpine as the base image
FROM node:20-alpine
# Use Node.js 24 with Alpine as the base image
FROM node:24-alpine

# Set working directory in the container
WORKDIR /app
Expand All @@ -14,7 +14,7 @@ RUN yarn install --frozen-lockfile
COPY . .

# Expose the default Astro port
EXPOSE 3000
EXPOSE 4321

# Default command to start the Astro app
CMD ["yarn", "dev", "--host"]
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
context: .
dockerfile: Dockerfile
ports:
- "9996:3000"
- "9996:4321"
environment:
- NODE_ENV=production
- NODE_OPTIONS=--max-old-space-size=4096 # Increase to 4GB
Expand Down
2 changes: 1 addition & 1 deletion games/8-Sprig.js
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ function startGame() {
}

// special level switcher logic
function next level() {
function nextLevel() {
setSolids([]) // allow block collisions temporarily to allow setting random puzzle config

if (speedrun === true) { // actually switch levels since we are in speedrun mode
Expand Down
3 changes: 2 additions & 1 deletion games/Mario_Kart.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
/*
@title: Mario_Kart
@description: Mario_Kart is an arcade-style game with a Mario theme where the player must jump over incoming blocks to earn points. As more blocks are successfully jumped over, the score increases. The game features a simple jumping mechanic to test the player's timing and reflexes in an endless format.
@author: nucleiav */
@author: nucleiav
@tags: ['endless']
@addedOn: 2023-01-13
*/

let n = 0;

Expand Down
3 changes: 2 additions & 1 deletion games/gravity-flipper-with-twist.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/*
@title: gravity flipper with a twist
@author: manikanta vasamsetti
@tags: [gravity,platformer,block]
@tags: ['gravity','platformer','block']
@addedOn: 2026-03-19
@description: A gravity-flipping platformer where you navigate through levels by toggling gravity to activate different platforms and avoid spikes.
*/

const player = "p";
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"react-icons": "^4.7.1",
"rehype-external-links": "^2.0.1",
"sass": "^1.58.0",
"svelte": "^3.54.0",
"svelte": "^4.0.0",
"three": "^0.149.0",
"throttle-debounce": "^5.0.0",
"tinykeys": "^1.4.0",
Expand All @@ -66,6 +66,7 @@
"@types/three": "^0.149.0",
"@types/throttle-debounce": "^5.0.0",
"@types/w3c-web-serial": "^1.0.3",
"typescript": "^6.0.2",
"vitest-canvas-mock": "^0.3.3"
}
}
3 changes: 2 additions & 1 deletion src/lib/codemirror/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { foldable, foldEffect } from '@codemirror/language'
import type { Text } from '@codemirror/state'
import { EditorView, WidgetType } from '@codemirror/view'
import type { SyntaxNodeRef, Tree } from '@lezer/common'
import { ComponentType, h, render } from 'preact'
import { h, render } from 'preact'
import type { ComponentType } from 'preact'

export function getTag(name: string, node: SyntaxNodeRef, syntax: Tree, doc: Text) {
if (node.name !== 'TaggedTemplateExpression') return
Expand Down
3 changes: 2 additions & 1 deletion src/lib/game-saving/account.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import type { AstroCookies } from 'astro'
import admin from 'firebase-admin'
import { initializeApp } from 'firebase-admin/app'
import { FieldPath, getFirestore, Timestamp, WhereFilterOp } from 'firebase-admin/firestore'
import { FieldPath, getFirestore, Timestamp } from 'firebase-admin/firestore'
import type { WhereFilterOp } from 'firebase-admin/firestore'
import { customAlphabet } from 'nanoid/async'
import { lazy } from '../utils/lazy'
import { generateGameName } from '../words'
Expand Down
2 changes: 1 addition & 1 deletion tests/sprigfuzzy_workflow.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { baseEngine } from "npm:sprig@latest/base"
import { baseEngine } from "../engine/dist/base/index.js"
// import { iterateReader } from "https://deno.land/std@0.162.0/streams/conversion.ts";
// import * as pathUtils from "https://deno.land/std/path/mod.ts";

Expand Down
Loading
Loading