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
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ updates:
prefix: "chore"
include: "scope"
# @types/node major versions track the Node.js runtime (see shared CI default).
# Bump TemplateSingleSim and repos together when CI node-version changes.
# Bump SceneryStackTemplate and repos together when CI node-version changes.
ignore:
- dependency-name: "@types/node"
update-types: ["version-update:semver-major"]
Expand Down
6 changes: 3 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# CLAUDE.md — Sim Template
# CLAUDE.md — SceneryStack Template

Sim-specific context for AI assistants. General SceneryStack guidance: [OpenPhysics/.github/CLAUDE.md](https://github.com/OpenPhysics/.github/blob/main/CLAUDE.md).

## Project

Reusable single-screen SceneryStack template and **canonical accessibility reference** for
Reusable SceneryStack template (one or N screens) and **canonical accessibility reference** for
OpenPhysics sims. Prefer `Baton/scripts/create-sim.sh` (or GitHub **Use this template** +
`npm run rename` + `npm run scaffold-screens`) to fork it. For multi-screen sims, see
[`doc/multi-screen.md`](doc/multi-screen.md).
Expand Down Expand Up @@ -166,7 +166,7 @@ owns screen folders (fleet naming: `src/intro/`, not `intro-screen/`).

### Manual checklist (if not using the scripts)

1. **Rename** — replace `sim-template` / `Sim Template` / `Sim` prefix in `init.ts`, `brand.ts`, `package.json`, Colors/Namespace/Preferences
1. **Rename** — replace `scenerystack-template` / `SceneryStack Template` / `Sim` prefix in `init.ts`, `brand.ts`, `package.json`, Colors/Namespace/Preferences
2. **Screens** — run `scaffold-screens` or mirror `sim-screen/` into kebab folders
3. **Locale** — add `strings_XX.json`, register in `StringManager`, add locale to `init.ts` `availableLocales`
4. **Icon** — edit `public/icons/icon.svg`, run `npm run icons`; match theme color in `index.html` / `vite.config.ts`
Expand Down
4 changes: 2 additions & 2 deletions CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Credits — TemplateSingleSim
# Credits — SceneryStackTemplate

Reusable single-screen SceneryStack simulation template with Vite, TypeScript, Biome, PWA support, and i18n scaffolding.
Reusable SceneryStack simulation template (one or N screens) with Vite, TypeScript, Biome, PWA support, and i18n scaffolding.

## License

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Sim Template
# SceneryStack Template

A reusable single-screen simulation template built with [SceneryStack](https://scenerystack.org/),
Vite 8, TypeScript 7, and Biome 2.
A reusable SceneryStack simulation template for one or N screens, built with
[SceneryStack](https://scenerystack.org/), Vite 8, TypeScript 7, and Biome 2.

## Features

- Single-screen SceneryStack scaffold with model/view separation
- SceneryStack scaffold with model/view separation (`rename` + `scaffold-screens` for one or N screens)
- English, Spanish, and French localization via `StringManager`
- Default and projector color profiles
- Progressive Web App (installable, offline-capable)
Expand Down
6 changes: 3 additions & 3 deletions doc/implementation-notes.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Implementation Notes - Sim Template
# Implementation Notes - SceneryStack Template

Developer-facing notes on the **TemplateSingleSim** scaffold. **Replace and expand this file when
Developer-facing notes on the **SceneryStackTemplate** scaffold. **Replace and expand this file when
forking** to describe your sim's real architecture (see Stern Gerlach or Light Propagation for
target quality). Until then, this documents what the template provides out of the box.

## Architecture Overview

TemplateSingleSim is the fleet-canonical starting point for new single-screen SceneryStack sims.
SceneryStackTemplate is the fleet-canonical starting point for new SceneryStack sims (one or N screens).
It demonstrates Model–View separation, color profiles, localization, reset behavior, accessibility
reference wiring, and reusable common components — **without** domain physics.

Expand Down
2 changes: 1 addition & 1 deletion doc/model.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Model - Sim Template
# Model - SceneryStack Template

This document describes the model (the underlying physics, math, and behavior) for the simulation, in
terms appropriate for an educator. It is the companion to
Expand Down
2 changes: 1 addition & 1 deletion doc/multi-screen.md
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ To pull template improvements back into an existing fork:

```sh
# One-time: add the template as a remote
git remote add template https://github.com/OpenPhysics/TemplateSingleSim.git
git remote add template https://github.com/OpenPhysics/SceneryStackTemplate.git

# Pull template changes into a branch for review
git fetch template
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<link rel="icon" href="./favicon.ico" sizes="any" />
<link rel="icon" href="./icons/icon.svg" type="image/svg+xml" />
<link rel="apple-touch-icon" href="./icons/apple-touch-icon.png" />
<title>Sim Template</title>
<title>SceneryStack Template</title>
</head>
<body style="background-color: black">
<script type="module" src="./src/main.ts"></script>
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "sim-template",
"name": "scenerystack-template",
"private": true,
"version": "0.0.0",
"type": "module",
"description": "GitHub template for OpenPhysics SceneryStack sims (rename + scaffold-screens for one or N screens).",
"license": "AGPL-3.0-or-later",
"repository": {
"type": "git",
"url": "https://github.com/OpenPhysics/TemplateSingleSim.git"
"url": "https://github.com/OpenPhysics/SceneryStackTemplate.git"
},
"keywords": [
"template",
Expand Down
12 changes: 6 additions & 6 deletions scripts/rename-sim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ const REPLACEMENTS: ReadonlyArray<[string, string]> = [
// camelCase identifier
["simQueryParameters", `${newCamel}QueryParameters`],
// Display strings (all locales + PWA)
["Sim Template", newName],
["SceneryStack Template", newName],
["Plantilla de Simulación", newName],
["Modèle de Simulation", newName],
["SimTemplate", newPrefix],
["A SceneryStack single-screen simulation template.", `A SceneryStack simulation: ${newName}.`],
["A single-screen SceneryStack simulation template", `A SceneryStack simulation: ${newName}`],
["A SceneryStack simulation template for one or N screens.", `A SceneryStack simulation: ${newName}.`],
["A SceneryStack simulation template for one or N screens", `A SceneryStack simulation: ${newName}`],
// Kebab package id
["sim-template", newId],
["scenerystack-template", newId],
];

// ── Utilities ─────────────────────────────────────────────────────────────────
Expand Down Expand Up @@ -158,8 +158,8 @@ function collectRenames(dir: string, renameOps: RenameOp[]): void {
// ── Main ──────────────────────────────────────────────────────────────────────

console.log("\nRenaming sim template →", newName);
console.log(` id: sim-template → ${newId}`);
console.log(` name: Sim Template → ${newName}`);
console.log(` id: scenerystack-template → ${newId}`);
console.log(` name: SceneryStack Template → ${newName}`);
console.log(` prefix: Sim → ${newPrefix}`);
console.log(` camel: sim → ${newCamel}`);
console.log(" (screen packages left as sim-screen/ for scaffold-screens)");
Expand Down
4 changes: 2 additions & 2 deletions scripts/scaffold-screens.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,14 @@ function parseScreens(raw: string | undefined): ScreenSpec[] {
name?: string;
description?: string;
};
const id = pkg.name && pkg.name !== "sim-template" ? pkg.name : "sim";
const id = pkg.name && pkg.name !== "scenerystack-template" ? pkg.name : "sim";
const titleGuess =
// Prefer vite/html title already rewritten by rename
(() => {
try {
const html = readFileSync(join(ROOT, "index.html"), "utf8");
const m = html.match(/<title>([^<]+)<\/title>/);
if (m?.[1] && m[1] !== "Sim Template") {
if (m?.[1] && m[1] !== "SceneryStack Template") {
return m[1].trim();
}
} catch {
Expand Down
2 changes: 1 addition & 1 deletion src/SimNamespace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
*/
import { Namespace } from "scenerystack/phet-core";

const SimNamespace = new Namespace("sim-template");
const SimNamespace = new Namespace("scenerystack-template");

export default SimNamespace;
2 changes: 1 addition & 1 deletion src/i18n/strings_en.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"title": "Sim Template",
"title": "SceneryStack Template",
"screens": {
"sim": "Sim"
},
Expand Down
2 changes: 1 addition & 1 deletion src/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { init, madeWithSceneryStackSplashDataURI } from "scenerystack/init";
init({
// Internal identifier used by SceneryStack for URL parameters and phetmarks.
// Use kebab-case matching the package.json "name" field.
name: "sim-template",
name: "scenerystack-template",

// Displayed in the About dialog (Help menu → About).
version: "0.0.0",
Expand Down
2 changes: 1 addition & 1 deletion src/sim-screen/view/SimScreenView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export class SimScreenView extends ScreenView {

// ── Placeholder label ─────────────────────────────────────────────────────
// Replace this with your actual simulation content.
const placeholderText = new Text("Sim Template", {
const placeholderText = new Text("SceneryStack Template", {
font: "bold 36px sans-serif",
fill: SimColors.textColorProperty,
center: this.layoutBounds.center,
Expand Down
2 changes: 1 addition & 1 deletion tests/fuzz/fuzz.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Optional Playwright fuzz smoke for the single-sim template.
* Optional Playwright fuzz smoke for the SceneryStack template.
*
* Usage:
* npm run test:fuzz
Expand Down
2 changes: 1 addition & 1 deletion tests/memory-leak.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Fleet-standard memory-leak regression suite (TemplateSingleSim / QubitSketch pattern).
* Fleet-standard memory-leak regression suite (SceneryStackTemplate / QubitSketch pattern).
*
* Creates a disposable model object inside a function boundary, disposes it, forces
* garbage collection via global.gc (--expose-gc in vitest.config.ts), then asserts via
Expand Down
2 changes: 1 addition & 1 deletion tests/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ import { init, madeWithSceneryStackSplashDataURI } from "scenerystack/init";

init({
// Change to match your package.json "name" when forking the template.
name: "sim-template",
name: "scenerystack-template",
version: "1.0.0-test",
brand: "made-with-scenerystack",
locale: "en",
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,10 @@ export default defineConfig(({ mode }) => {
registerType: "autoUpdate",
includeAssets: ["favicon.ico", "icons/apple-touch-icon.png"],
manifest: {
name: "Sim Template",
name: "SceneryStack Template",
// biome-ignore lint/style/useNamingConvention: Web App Manifest spec requires snake_case keys
short_name: "SimTemplate",
description: "A single-screen SceneryStack simulation template",
description: "A SceneryStack simulation template for one or N screens",
// biome-ignore lint/style/useNamingConvention: Web App Manifest spec requires snake_case keys
theme_color: "#1a1a2e",
// biome-ignore lint/style/useNamingConvention: Web App Manifest spec requires snake_case keys
Expand Down