1
0

make import paths absolute

This commit is contained in:
Adrian Wannenmacher 2026-02-22 12:51:28 +01:00
parent 7df55afd1a
commit bb3ad61950
Signed by: tfld
GPG Key ID: 19D986ECB1E492D5
19 changed files with 49 additions and 59 deletions

View File

@ -7,8 +7,7 @@
// Setting up a second singleton instance for testing is possible, but would // Setting up a second singleton instance for testing is possible, but would
// not actually test the production variant. // not actually test the production variant.
import { Round } from "../models/round.js"; import WbDb from "/data/db.js";
import WbDb from "./db.js";
/** The instance used for the current test. /** The instance used for the current test.
* *

View File

@ -1,7 +1,7 @@
"use strict"; "use strict";
import Session from "../models/session.js"; import Session from "/models/session.js";
import WbDb from "./db.js"; import WbDb from "/data/db.js";
/** A transaction or known type that can be turned into a transaction. /** A transaction or known type that can be turned into a transaction.
* @typedef {IDBTransaction|IDBDatabase|WbDb=} Transactable * @typedef {IDBTransaction|IDBDatabase|WbDb=} Transactable

View File

@ -1,9 +1,9 @@
"use strict"; "use strict";
import { Team } from "../models/round.js"; import { Team } from "/models/round.js";
import Session from "../models/session.js"; import Session from "/models/session.js";
import WbDb from "./db.js"; import WbDb from "/data/db.js";
import SessionRepo from "./session_repo.js"; import SessionRepo from "/data/session_repo.js";
/** The instance used for the current test. /** The instance used for the current test.
* *

View File

@ -5,16 +5,16 @@
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" /> <meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Watterblock</title> <title>Watterblock</title>
<link rel="stylesheet" href="vendored/normalize-8.0.1.css"> <link rel="stylesheet" href="/vendored/normalize-8.0.1.css">
<link rel="stylesheet" href="style.css"> <link rel="stylesheet" href="/style.css">
<script src="vendored/mithril-2.3.8.js" defer></script> <script src="/vendored/mithril-2.3.8.js" defer></script>
<script type="module"> <script type="module">
// initialize DB early // initialize DB early
import WbDb from "./data/db.js"; import WbDb from "/data/db.js";
WbDb.get(); WbDb.get();
// mount app // mount app
import App from "./ui/app.js"; import App from "/ui/app.js";
m.mount(document.body, App); m.mount(document.body, App);
</script> </script>
</head> </head>

View File

@ -1,7 +1,7 @@
"use strict"; "use strict";
import { Round, Team } from "./round.js"; import { Round, Team } from "/models/round.js";
import RoundResult from "./round_result.js"; import RoundResult from "/models/round_result.js";
/** A single game of watten. /** A single game of watten.
* *

View File

@ -1,8 +1,8 @@
"use strict"; "use strict";
import { Round, Team } from "./round.js"; import { Round, Team } from "/models/round.js";
import RoundResult from "./round_result.js"; import RoundResult from "/models/round_result.js";
import Game from "./game.js"; import Game from "/models/game.js";
export default function() { export default function() {
QUnit.module("game", function() { QUnit.module("game", function() {

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
import { Round, Team } from "./round.js"; import { Round, Team } from "/models/round.js";
export default function() { export default function() {
QUnit.module("round", function() { QUnit.module("round", function() {

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
import { Round, Team } from "./round.js"; import { Team } from "/models/round.js";
/** A finished round of Watten. */ /** A finished round of Watten. */
export default class RoundResult { export default class RoundResult {

View File

@ -1,7 +1,7 @@
"use strict"; "use strict";
import { Team } from "./round.js"; import { Team } from "/models/round.js";
import RoundResult from "./round_result.js"; import RoundResult from "/models/round_result.js";
export default function() { export default function() {
QUnit.module("RoundResult", function() { QUnit.module("RoundResult", function() {

View File

@ -1,7 +1,7 @@
"use strict"; "use strict";
import Game from "./game.js"; import Game from "/models/game.js";
import { Team } from "./round.js"; import { Team } from "/models/round.js";
/** A session of Watten. /** A session of Watten.
* *

View File

@ -1,8 +1,8 @@
"use strict"; "use strict";
import { Round, Team } from "./round.js"; import { Team } from "/models/round.js";
import Game from "./game.js"; import Game from "/models/game.js";
import Session from "./session.js"; import Session from "/models/session.js";
export default function() { export default function() {
QUnit.module("session", function() { QUnit.module("session", function() {

View File

@ -4,14 +4,14 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>Watterblock Tests</title> <title>Watterblock Tests</title>
<link rel="stylesheet" href="vendored/qunit-2.25.0.css"> <link rel="stylesheet" href="/vendored/qunit-2.25.0.css">
</head> </head>
<body> <body>
<div id="qunit"></div> <div id="qunit"></div>
<div id="qunit-fixture"></div> <div id="qunit-fixture"></div>
<script src="vendored/qunit-2.25.0.js"></script> <script src="/vendored/qunit-2.25.0.js"></script>
<script src="test.js" type="module"></script> <script src="/test.js" type="module"></script>
</body> </body>
</html> </html>

12
test.js
View File

@ -1,12 +1,12 @@
"use strict"; "use strict";
import round from "./models/round.test.js"; import round from "/models/round.test.js";
import roundResult from "./models/round_result.test.js"; import roundResult from "/models/round_result.test.js";
import game from "./models/game.test.js"; import game from "/models/game.test.js";
import session from "./models/session.test.js"; import session from "/models/session.test.js";
import db from "./data/db.test.js"; import db from "/data/db.test.js";
import session_repo from "./data/session_repo.test.js"; import session_repo from "/data/session_repo.test.js";
QUnit.module("models", function() { QUnit.module("models", function() {
round(); round();

View File

@ -1,7 +1,7 @@
"use strict"; "use strict";
import WbDb from "../data/db.js"; import WbDb from "/data/db.js";
import Shell from "./shell.js"; import Shell from "/ui/shell.js";
export default class App { export default class App {
#needsHandler = true; #needsHandler = true;

View File

@ -1,15 +1,12 @@
"use strict"; "use strict";
import { Team } from "../models/round.js"; import { Team } from "/models/round.js";
import Game from "../models/game.js"; import Game from "/models/game.js";
import RoundView from "./round.js";
export default class GameView { export default class GameView {
/** @param {{ attrs: { model: Game } }} param The game model to use. */ /** @param {{ attrs: { model: Game } }} param The game model to use. */
view({ attrs: { model } }) { view({ attrs: { model } }) {
let { winner, points, ourPoints, theirPoints } = model.result; let { ourPoints, theirPoints } = model.result;
let markers = "•".repeat(points);
return m("[", [ return m("[", [
(model.rounds.length !== 0) (model.rounds.length !== 0)

View File

@ -1,17 +1,11 @@
"use strict"; "use strict";
import { Round, Team } from "../models/round.js"; import { Round, Team } from "/models/round.js";
export default class RoundView { export default class RoundView {
/** @param { { attrs: { model: Round } } } param The round model to use. */ /** @param { { attrs: { model: Round } } } param The round model to use. */
view({ attrs: { model } }) { view({ attrs: { model } }) {
let winner = "no koana";
if (model.winner === Team.We)
winner = "mia";
else if (model.winner === Team.They)
winner = "se";
return m("section.current-round", [ return m("section.current-round", [
m("span.current-points", `${model.points}`), m("span.current-points", `${model.points}`),
m("button.they-raise", m("button.they-raise",

View File

@ -1,8 +1,8 @@
"use strict"; "use strict";
import Session from "../models/session.js"; import Session from "/models/session.js";
import GameView from "./game.js"; import GameView from "/ui/game.js";
import RoundView from "./round.js"; import RoundView from "/ui/round.js";
export default class SessionView { export default class SessionView {
/** @param {{ attrs: { model: Session } }} param The session model to use. */ /** @param {{ attrs: { model: Session } }} param The session model to use. */

View File

@ -1,6 +1,6 @@
"use strict"; "use strict";
import Session from "../models/session.js"; import Session from "/models/session.js";
export default class SessionList { export default class SessionList {
/** @param {{ attrs: { models: Session[] } }} param The sessions to show. */ /** @param {{ attrs: { models: Session[] } }} param The sessions to show. */

View File

@ -1,9 +1,9 @@
"use strict"; "use strict";
import Session from "../models/session.js"; import Session from "/models/session.js";
import SessionRepo from "../data/session_repo.js"; import SessionRepo from "/data/session_repo.js";
import SessionList from "./session_list.js"; import SessionList from "/ui/session_list.js";
import SessionView from "./session.js"; import SessionView from "/ui/session.js";
export default class Shell { export default class Shell {
/** @type(?Session[]) */ /** @type(?Session[]) */