@zthun/romulator-web 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [1.3.1](https://github.com/zthun/romulator/compare/v1.3.0...v1.3.1) (2025-07-01)
7
+
8
+ **Note:** Version bump only for package @zthun/romulator-web
9
+
10
+
11
+
12
+
13
+
6
14
  ## [1.3.0](https://github.com/zthun/romulator/compare/v1.2.0...v1.3.0) (2025-06-29)
7
15
 
8
16
  **Note:** Version bump only for package @zthun/romulator-web
@@ -51750,22 +51750,14 @@ function ZRomulatorSystemAvatarCard(props) {
51750
51750
  });
51751
51751
  }
51752
51752
 
51753
- class ZRomulatorEnvironmentService {
51754
- read() {
51755
- return Promise.resolve(new ZRomulatorEnvironmentBuilder().build());
51756
- }
51757
- }
51758
-
51759
51753
  class ZRomulatorSystemsService {
51760
- _env;
51761
51754
  _rest;
51762
- async endpoint() {
51763
- const env = await this._env.read();
51764
- return new ZUrlBuilder().parse(env.api).append("systems").build();
51755
+ endpoint() {
51756
+ const { api } = new ZRomulatorEnvironmentBuilder().build();
51757
+ return new ZUrlBuilder().parse(api).append("systems").build();
51765
51758
  }
51766
- constructor(_http, _env){
51767
- this._env = _env;
51768
- this._rest = new ZLazy(async ()=>Promise.resolve(new ZRestfulService(_http, await this.endpoint())));
51759
+ constructor(_http){
51760
+ this._rest = new ZLazy(async ()=>Promise.resolve(new ZRestfulService(_http, this.endpoint())));
51769
51761
  }
51770
51762
  async retrieve(request) {
51771
51763
  return (await this._rest.get()).retrieve(request);
@@ -51778,7 +51770,7 @@ class ZRomulatorSystemsService {
51778
51770
  }
51779
51771
  }
51780
51772
  function createDefaultSystemsService() {
51781
- return new ZRomulatorSystemsService(new ZHttpService(), new ZRomulatorEnvironmentService());
51773
+ return new ZRomulatorSystemsService(new ZHttpService());
51782
51774
  }
51783
51775
  const ZRomulatorSystemsServiceContext = /*#__PURE__*/ reactExports.createContext(createDefaultSystemsService());
51784
51776
  const useSystemsService = ()=>reactExports.useContext(ZRomulatorSystemsServiceContext);
@@ -51833,7 +51825,9 @@ function ZRomulatorSystemsPage() {
51833
51825
  }
51834
51826
  `);
51835
51827
  const renderTile = (system)=>{
51836
- const wheel = `/systems/wheel/${system.id}.png`;
51828
+ const { api } = new ZRomulatorEnvironmentBuilder().build();
51829
+ const id = `${system.id}-wheel`;
51830
+ const wheel = `${api}/media/${id}`;
51837
51831
  return /*#__PURE__*/ jsxRuntimeExports.jsx(ZBox, {
51838
51832
  className: "ZRomulatorSystemsPage-tile",
51839
51833
  fashion: body,
package/dist/index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <title>Romulator: Organize your Games</title>
7
- <script type="module" crossorigin src="/assets/index-Dla_HUr2.js"></script>
7
+ <script type="module" crossorigin src="/assets/index-Dsf8H9t4.js"></script>
8
8
  </head>
9
9
  <body>
10
10
  <div id="zthunworks-romulator"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zthun/romulator-web",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Romulator frontend",
5
5
  "author": "Anthony Bonta",
6
6
  "license": "MIT",
@@ -29,7 +29,7 @@
29
29
  "@zthun/helpful-query": "^9.4.0",
30
30
  "@zthun/helpful-react": "^9.4.1",
31
31
  "@zthun/janitor-build-config": "^19.2.6",
32
- "@zthun/romulator-client": "^1.3.0",
32
+ "@zthun/romulator-client": "^1.3.1",
33
33
  "@zthun/webigail-http": "^4.0.4",
34
34
  "@zthun/webigail-rest": "^4.0.4",
35
35
  "@zthun/webigail-url": "^4.0.4",
@@ -44,5 +44,5 @@
44
44
  "vitest": "^3.2.4",
45
45
  "vitest-mock-extended": "^3.1.0"
46
46
  },
47
- "gitHead": "07a97ff0c9df05eca1879b00dfce1a159be7d521"
47
+ "gitHead": "d4a87d541e1a587abd3a7e483555e9a6a7bb58d1"
48
48
  }
@@ -16,6 +16,7 @@ import { css, cssJoinDefined, ZOrientation } from "@zthun/helpful-fn";
16
16
  import { ZDataRequestBuilder, ZSortBuilder } from "@zthun/helpful-query";
17
17
  import type { IZRomulatorSystem } from "@zthun/romulator-client";
18
18
  import { useState } from "react";
19
+ import { ZRomulatorEnvironmentBuilder } from "../environment/environment.mjs";
19
20
  import { useSystemsService } from "./systems-service.mjs";
20
21
 
21
22
  const DefaultSystemSortOrder = new ZSortBuilder()
@@ -40,7 +41,10 @@ export function ZRomulatorSystemsPage() {
40
41
  `);
41
42
 
42
43
  const renderTile = (system: IZRomulatorSystem) => {
43
- const wheel = `/systems/wheel/${system.id}.png`;
44
+ const { api } = new ZRomulatorEnvironmentBuilder().build();
45
+ const id = `${system.id}-wheel`;
46
+ const wheel = `${api}/media/${id}`;
47
+
44
48
  return (
45
49
  <ZBox
46
50
  className="ZRomulatorSystemsPage-tile"
@@ -8,7 +8,7 @@ import type { IZRestfulGet, IZRestfulService } from "@zthun/webigail-rest";
8
8
  import { ZRestfulService } from "@zthun/webigail-rest";
9
9
  import { ZUrlBuilder } from "@zthun/webigail-url";
10
10
  import { createContext, useContext } from "react";
11
- import { ZRomulatorEnvironmentService } from "../environment/environment-service.mjs";
11
+ import { ZRomulatorEnvironmentBuilder } from "../environment/environment.mjs";
12
12
 
13
13
  export interface IZRomulatorSystemsService
14
14
  extends IZRestfulGet<IZRomulatorSystem>,
@@ -17,17 +17,14 @@ export interface IZRomulatorSystemsService
17
17
  export class ZRomulatorSystemsService implements IZRomulatorSystemsService {
18
18
  private _rest: ZLazy<IZRestfulService<IZRomulatorSystem>>;
19
19
 
20
- public async endpoint() {
21
- const env = await this._env.read();
22
- return new ZUrlBuilder().parse(env.api).append("systems").build();
20
+ public endpoint() {
21
+ const { api } = new ZRomulatorEnvironmentBuilder().build();
22
+ return new ZUrlBuilder().parse(api).append("systems").build();
23
23
  }
24
24
 
25
- public constructor(
26
- _http: IZHttpService,
27
- private readonly _env: ZRomulatorEnvironmentService,
28
- ) {
25
+ public constructor(_http: IZHttpService) {
29
26
  this._rest = new ZLazy(async () =>
30
- Promise.resolve(new ZRestfulService(_http, await this.endpoint())),
27
+ Promise.resolve(new ZRestfulService(_http, this.endpoint())),
31
28
  );
32
29
  }
33
30
 
@@ -45,10 +42,7 @@ export class ZRomulatorSystemsService implements IZRomulatorSystemsService {
45
42
  }
46
43
 
47
44
  export function createDefaultSystemsService(): IZRomulatorSystemsService {
48
- return new ZRomulatorSystemsService(
49
- new ZHttpService(),
50
- new ZRomulatorEnvironmentService(),
51
- );
45
+ return new ZRomulatorSystemsService(new ZHttpService());
52
46
  }
53
47
 
54
48
  export const ZRomulatorSystemsServiceContext = createContext(
@@ -14,11 +14,7 @@ import {
14
14
  } from "@zthun/webigail-http";
15
15
  import { ZRestfulUrlBuilder } from "@zthun/webigail-rest";
16
16
  import { ZUrlBuilder } from "@zthun/webigail-url";
17
- import type { Mocked } from "vitest";
18
17
  import { afterEach, beforeEach, describe, expect, it } from "vitest";
19
- import { mock } from "vitest-mock-extended";
20
- import type { IZRomulatorEnvironmentService } from "../environment/environment-service.mjs";
21
- import { ZRomulatorEnvironmentBuilder } from "../environment/environment.mjs";
22
18
  import type { IZRomulatorSystemsService } from "./systems-service.mjs";
23
19
  import {
24
20
  useSystemsService,
@@ -27,7 +23,6 @@ import {
27
23
 
28
24
  describe("SystemsService", () => {
29
25
  let _http: ZHttpServiceMock;
30
- let _env: Mocked<IZRomulatorEnvironmentService>;
31
26
 
32
27
  const nes = new ZRomulatorSystemBuilder()
33
28
  .id(ZRomulatorSystemId.Nintendo)
@@ -39,11 +34,9 @@ describe("SystemsService", () => {
39
34
 
40
35
  beforeEach(async () => {
41
36
  _http = new ZHttpServiceMock();
42
- _env = mock<IZRomulatorEnvironmentService>();
43
- _env.read.mockResolvedValue(new ZRomulatorEnvironmentBuilder().build());
44
37
  });
45
38
 
46
- const createTestTarget = () => new ZRomulatorSystemsService(_http, _env);
39
+ const createTestTarget = () => new ZRomulatorSystemsService(_http);
47
40
 
48
41
  describe("Read", () => {
49
42
  it("should retrieve a list of systems", async () => {
@@ -52,7 +45,7 @@ describe("SystemsService", () => {
52
45
  const request = new ZDataRequestBuilder().build();
53
46
 
54
47
  _http.set(
55
- await target.endpoint(),
48
+ target.endpoint(),
56
49
  ZHttpMethod.Get,
57
50
  new ZHttpResultBuilder(
58
51
  new ZPageBuilder<IZRomulatorSystem>().all(systems).build(),
@@ -71,19 +64,13 @@ describe("SystemsService", () => {
71
64
  const target = createTestTarget();
72
65
 
73
66
  _http.set(
74
- new ZUrlBuilder()
75
- .parse(await target.endpoint())
76
- .append(nes.id)
77
- .build(),
67
+ new ZUrlBuilder().parse(target.endpoint()).append(nes.id).build(),
78
68
  ZHttpMethod.Get,
79
69
  new ZHttpResultBuilder(nes).build(),
80
70
  );
81
71
 
82
72
  _http.set(
83
- new ZUrlBuilder()
84
- .parse(await target.endpoint())
85
- .append(snes.id)
86
- .build(),
73
+ new ZUrlBuilder().parse(target.endpoint()).append(snes.id).build(),
87
74
  ZHttpMethod.Get,
88
75
  new ZHttpResultBuilder(snes).build(),
89
76
  );
@@ -104,7 +91,7 @@ describe("SystemsService", () => {
104
91
  const target = createTestTarget();
105
92
 
106
93
  _http.set(
107
- new ZRestfulUrlBuilder(await target.endpoint()).count().build(),
94
+ new ZRestfulUrlBuilder(target.endpoint()).count().build(),
108
95
  ZHttpMethod.Get,
109
96
  new ZHttpResultBuilder(
110
97
  new ZPageBuilder<IZRomulatorSystem>()
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,19 +0,0 @@
1
- /* istanbul ignore file -- @preserve */
2
- import type { IZRomulatorEnvironment } from "./environment.mjs";
3
- import { ZRomulatorEnvironmentBuilder } from "./environment.mjs";
4
-
5
- export interface IZRomulatorEnvironmentService {
6
- read(): Promise<IZRomulatorEnvironment>;
7
- }
8
-
9
- export class ZRomulatorEnvironmentService
10
- implements IZRomulatorEnvironmentService
11
- {
12
- public read(): Promise<IZRomulatorEnvironment> {
13
- return Promise.resolve(new ZRomulatorEnvironmentBuilder().build());
14
- }
15
- }
16
-
17
- export function createDefaultEnvironmentService(): IZRomulatorEnvironmentService {
18
- return new ZRomulatorEnvironmentService();
19
- }