Skip to content
Open
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
69 changes: 69 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI

on:
pull_request:
push:
branches:
- 'main'
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.15.0

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install modules
run: pnpm i

- name: Build app
run: SPRINGBOARD_PLATFORM_VARIANT=main pnpm run build

- name: Find and upload npm logs
if: failure()
run: |
mkdir -p artifacts/npm-logs
find ~/.npm/_logs -type f -name "*.log" -exec cp {} artifacts/npm-logs/ \;
shell: bash

- name: Upload npm logs artifact
if: failure()
uses: actions/upload-artifact@v4
with:
name: npm-logs
path: artifacts/npm-logs/

types:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10.15.0

- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'pnpm'

- name: Install modules
run: pnpm i

- name: Check Types
run: pnpm run check-types
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
dist
data
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node-linker=hoisted
49 changes: 49 additions & 0 deletions build_with_script.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import {buildApplication, platformBrowserBuildConfig, platformNodeBuildConfig, buildServer} from 'springboard-cli/src/build';

import sveltePlugin from '@springboardjs/plugin-svelte/plugin';
import {spawn} from 'child_process';
import fs from 'fs';

const watch = process.argv.includes('--watch');

setTimeout(async () => {
await buildApplication(platformBrowserBuildConfig, {
applicationEntrypoint: `${process.cwd()}/src/index.svelte`,
nodeModulesParentFolder: process.cwd(),
watch,
plugins: [
sveltePlugin.default(),
],
});

await buildApplication(platformNodeBuildConfig, {
watch,
applicationEntrypoint: `${process.cwd()}/src/index.svelte`,
nodeModulesParentFolder: process.cwd(),
plugins: [
sveltePlugin.default(),
],
});

await buildServer({
watch,
plugins: [
sveltePlugin.default(),
],
});

const file = 'dist/server/dist/local-server.cjs';
const args = [
...(watch ? ['--watch', '--watch-preserve-output'] : []),
file,
];

if (!fs.existsSync(file)) {
fs.writeFileSync(file, '', {flag: 'wx'});
}

spawn('node', args, {
stdio: 'inherit',
env: process.env,
});
});
40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "handraiser-svelte",
"version": "1.0.0",
"description": "Raise your hands",
"main": "index.js",
"scripts": {
"dev": "sb dev src/index.svelte --plugins svelte",
"build": "sb build src/index.svelte --plugins svelte",
"start": "sb start",
"build-with-script": "node build_with_script.mjs",
"check-types": "tsc --noEmit"
},
"dependencies": {
"@jamtools/core": "0.16.0",
"@springboardjs/platforms-browser": "0.16.0",
"@springboardjs/data-storage": "0.16.0",
"@springboardjs/platforms-node": "0.16.0",
"@springboardjs/plugin-svelte": "0.16.0",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"react-router": "^6.30.1",
"react-router-dom": "^6.30.1",
"springboard": "0.16.0",
"springboard-cli": "0.16.0",
"springboard-server": "0.16.0",
"svelte": "^5.34.7"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@types/node": "^24.0.3",
"@types/react": "^19.1.8",
"@types/react-dom": "^19.1.6",
"typescript": "^5.8.3"
},
"pnpm": {
"onlyBuiltDependencies": ["better-sqlite3"]
}
}
Loading