Rename logic.mjs to logic.js so static hosts serve a JavaScript MIME type

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Aqua 2026-11-04 21:34:34 +00:00
commit 45f62277f0
6 changed files with 7 additions and 7 deletions

View file

@ -16,7 +16,7 @@ the patch through the same faustwasm runtime the page loads (`node test.mjs`, 15
rattle layers only; the rumble (tone) is untouched, so lowering it moves the mix tone-forward. That reading of
"tone-forward mix" is this author's; at 100 the signal equals the thruster (asserted sample for sample).
Variants: rpm 600, noise 100 / 50 / 20 / 0. Not loudness-matched, so level and noise are confounded by design.
- `logic.mjs`: design, statistics, validation and export shape (shared by page and tests).
- `logic.js`: design, statistics, validation and export shape (shared by page and tests).
- `analyze.mjs`: dependency-free. `node analyze.mjs export1.json [export2.json ...]` prints per-variant n, mean,
sd, min/max, peak, rms, words, and whether peak / rms predicted the ratings (Spearman rho, permutation p;
"predicts" means |rho| >= 0.5 and p < 0.05, fixed before any data).

View file

@ -4,7 +4,7 @@
// Pure functions are exported for test.mjs; the CLI runs only when this file is the entry point.
import { readFileSync } from "node:fs";
import { pathToFileURL } from "node:url";
import { rng, shuffle, SCHEMA } from "./logic.mjs";
import { rng, shuffle, SCHEMA } from "./logic.js";
export const mean = (xs) => xs.reduce((a, b) => a + b, 0) / xs.length;
export const sd = (xs) => (xs.length < 2 ? NaN : Math.sqrt(xs.reduce((a, x) => a + (x - mean(xs)) ** 2, 0) / (xs.length - 1)));

View file

@ -1,4 +1,4 @@
// Assembles dist/ (the static trial site): web/, logic.mjs, the trial patch, and the faustwasm runtime copied from
// Assembles dist/ (the static trial site): web/, logic.js, the trial patch, and the faustwasm runtime copied from
// the sibling aqua-playground's node_modules (run `npm install` there first). Prints a content hash for the
// publish path: minds.gamecult.org/aqua/trial-<hash>/. Usage: node build.mjs [outDir]
import { cpSync, mkdirSync, readFileSync, readdirSync, rmSync, statSync } from "node:fs";
@ -13,7 +13,7 @@ const fw = join(play, "node_modules/@grame/faustwasm");
rmSync(out, { recursive: true, force: true });
mkdirSync(join(out, "vendor/faustwasm"), { recursive: true });
cpSync(join(here, "web"), out, { recursive: true });
cpSync(join(here, "logic.mjs"), join(out, "logic.mjs"));
cpSync(join(here, "logic.js"), join(out, "logic.js"));
cpSync(join(here, "thruster-trial.dsp"), join(out, "thruster-trial.dsp"));
cpSync(join(play, "web/ui.js"), join(out, "ui.js"));
cpSync(join(fw, "dist/esm/index.js"), join(out, "vendor/faustwasm/index.js"));

View file

@ -5,7 +5,7 @@ import assert from "node:assert/strict";
import { readFileSync } from "node:fs";
import { dirname, join, resolve } from "node:path";
import { fileURLToPath, pathToFileURL } from "node:url";
import { makeDesign, variants, stats, cleanWord, validRating, buildExport, renderVariant, rng, shuffle, SCHEMA, PATCH } from "./logic.mjs";
import { makeDesign, variants, stats, cleanWord, validRating, buildExport, renderVariant, rng, shuffle, SCHEMA, PATCH } from "./logic.js";
import { analyze, format, mean, sd, spearman, ranks, pearson } from "./analyze.mjs";
const here = dirname(fileURLToPath(import.meta.url));

View file

@ -1,9 +1,9 @@
// Browser glue for the listening trial. The decisions (design, statistics, validation, export shape) live in
// ../logic.mjs and are tested in node; this file only touches the DOM, the AudioContext and the download.
// ../logic.js and are tested in node; this file only touches the DOM, the AudioContext and the download.
// Nothing here makes a network request after the page assets load, and nothing is written to storage.
import { instantiateFaustModuleFromFile, LibFaust, FaustCompiler, FaustMonoDspGenerator } from "./vendor/faustwasm/index.js";
import { controlsOf } from "./ui.js";
import { variants, makeDesign, renderVariant, cleanWord, validRating, buildExport, PATCH } from "./logic.mjs";
import { variants, makeDesign, renderVariant, cleanWord, validRating, buildExport, PATCH } from "./logic.js";
const $ = (s, root = document) => root.querySelector(s);
const status = (t) => { $("#status").textContent = t; };