brouberol / 5esheets Goto Github PK
View Code? Open in Web Editor NEWVisualize and update your D&D 5e character sheets in your browser
License: MIT License
Visualize and update your D&D 5e character sheets in your browser
License: MIT License
Right now, the alembic.ini
file isn't included in the Docker image, and migrations are left as an exercise to the user. We need to include the config file, and make sure the migrations are run fully automatically at startup.
Whether we use SASS or LESS is left to @etnbrd to decide <3 Once a decision has been made, we should make sure to integrate it in the build step.
Setup a basic Svelte application and integrate it with the FastAPI app, as well as the Makefile/Dockerfile.
Now that the authentication mechanism is implemented backend-side (see #100), we need to make sure the 5esheet generated API client supports it. Namely, we need to:
POST
request to /api/login/token
, which (if the username/password are correct) will return set-cookie
headers containing the JWT access token, as well as a CSRF tokenX-CSRF-TOKEN
headerTwo players can have a character with the same name, but one player can't.
We need to implement the spell book part of the character sheet, allowing us to list all the spells the character knows, the spells they have prepared for you spell DC, the number of prepared spells per day etc.
The login API will take a username/password, and return a JWT with a given TTL. Any subsequent API calls will need to use the JWT has a bearer token.
Actually checking the presence of the JWT on the API calls will be done later.
We should rely on https://fastapi.tiangolo.com/lo/tutorial/security/oauth2-jwt/
We’ll need to reimplement the whole page layout and data update logic in the Svelte app. This is probably a non trivial project that will take time to get right.
Let’s replace Caribou by alembic to enable the automatic generation of migrations as the SQLAlchemy models evolve.
Steps to reproduce:
@int_mod
in a textarea (ex: Features)@int_mod
has now be replaced by the associated value in DBThis will allow us to use asynchronous API handlers, in turn allowing us to serve many requests with little horse power.
The way this worked in the previous, vanilla-JS app, was:
focusin
event was triggered, the div was hidden, and the text field was shownfocusout
event was triggered, the text field was hidden, and the div was shownThe trick was to make the text field part of the overall form, but not the div. This allowed us to evaluate and render mini macros, such as @int_mod
on the fly, and not have the rendered value be saved to DB at the next form submit.
Ex: cleric divine interventions, paladin’s divine smite, artificer canon uses, etc.
We could leverage https://gitlab.com/baktov.sugar/foundryvtt-dnd5e-lang-fr-fr/-/blob/master/dnd5e_fr-FR/compendium/dnd5e.items.json to match each item with their associated translations, and fallback to English if it’s not found.
Note: some spells or items don’t yet have an official translation, so the general experience when leveraging recent compendium elements is to have some of them translated and some of them not.
This will make sure that the token isn't stored in the browser's localStorage and thus be exposed to the outside world. By having the cookie be httponly
, we will also restrict the JS code from accessing it.
We could/should replace our semi-custom JWT implementation by https://indominusbyte.github.io/fastapi-jwt-auth/usage/jwt-in-cookies/
This will also make sure that the client can authenticate transparently, as the backend will answer with a set-cookie
HTTP Response header.
We need to replace peewee by SQLAlchemy to support asynchronous queries (and thus asynchronous API request handling) in the future.
black
for formattingruff
for lintingmypy
for typesClick
comes along with Flask, when typer
is provided by Fastapi. We need to convert the flask db populate
command from click
to typer
.
The same way we have imported items to database, we should import all the non-spells along with their translations, so that we can easily link the spell book of one character to actual spell references in the database. This should make it easier for players to add spells to their spell book.
This model will be used to represent items hold / equipped by a character. New homebrew items could be created, and we'll need to import the SRD 5e items.
As 5e SRD items are now Creative Commons and that the OGL is no longer in jeopardy, we can safely import them to database for further use by the player.
Avoid SQLAlchemy/Alembic, as they pull way too much complexity fir this project. Would https://github.com/clutchski/caribou work?
We could rely on ETag
headers to force browsers to rely on their own cache to avoid having the server recompute a resource when it hasn't changed.
💡 We could rely on the hash of the last update timestamp of each resource, for example.
We should leverage https://fastapi.tiangolo.com/advanced/settings/
We’d need to make sure that the default behavior when create_session
is used as a context manager is:
Right now I’m not sure we do 2.
$ NODE_ENV=prod npm run test 12:04:43 PM
> test
> vitest --run
RUN v0.32.4 /Users/br/code/5esheets/dnd5esheets/front
✓ src/effects/parser/index.test.ts (10)
❯ src/effects/index.test.ts (18)
❯ apply effect (18)
✓ applies a static effect
✓ applies a derived effect
× applies a derived effect which updates from its dependency
✓ applies a nested derived effect
× applies a nested derived effect which updates from its dependency
✓ applies a deeply nested derived effect
× applies a nested derived effect which updates from its dependency
✓ applies a non-computed nested derived effect
× applies a non-computed nested derived effect which updates from its dependency
✓ applies a non-computed deeply nested derived effect
× applies a non-computed deeply nested derived effect which updates from its dependency
✓ applies an effect containing a function
✓ applies a derived effect containing a function
× applies a derived effect containing a function which updates from its dependency
× applies a somewhat complex effect which updates from its dependency
× applies a somewhat complex effect on a nested target which updates from its dependency
× applies a nested derived effect on a sibling target which updates from its dependency
↓ applies a derived effect containing a function which updates from its dependency [skipped]
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 9 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL src/effects/index.test.ts > apply effect > applies a derived effect which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 2
+ 1
❯ src/effects/index.test.ts:40:25
38| setContext("a", 2);
39| expect(context.a).toBe(2);
40| expect(context.b).toBe(context.a);
| ^
41| }));
42|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:35:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[1/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a nested derived effect which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 2
+ 1
❯ src/effects/index.test.ts:55:25
53| applyEffect("b := nested.a", context, setContext);
54| setContext("nested", "a", 2);
55| expect(context.b).toBe(context.nested.a);
| ^
56| }));
57|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:51:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[2/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a nested derived effect which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 2
+ 1
❯ src/effects/index.test.ts:74:25
72| applyEffect("b := deeply.nested.a", context, setContext);
73| setContext("deeply", "nested", "a", 2);
74| expect(context.b).toBe(context.deeply.nested.a);
| ^
75| }));
76|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:68:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[3/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a non-computed nested derived effect which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 2
+ 1
❯ src/effects/index.test.ts:89:25
87| applyEffect("b := nested[key]", context, setContext);
88| setContext("nested", "a", 2);
89| expect(context.b).toBe(context.nested.a);
| ^
90| }));
91|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:85:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[4/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a non-computed deeply nested derived effect which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 2
+ 1
❯ src/effects/index.test.ts:112:25
110| applyEffect("b := nested[key_][key__]", context, setContext);
111| setContext("nested", "a_", "a__", 2);
112| expect(context.b).toBe(context.nested.a_.a__);
| ^
113| }));
114|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:104:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[5/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a derived effect containing a function which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 2
+ 1
❯ src/effects/index.test.ts:134:25
132| applyEffect("b := id(a)", context, setContext);
133| setContext("a", 2);
134| expect(context.b).toBe(context.a);
| ^
135| }));
136|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:130:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[6/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a somewhat complex effect which updates from its dependency
AssertionError: expected 3 to be 4 // Object.is equality
- Expected
+ Received
- 4
+ 3
❯ src/effects/index.test.ts:150:25
148| );
149| setContext("nested", "a", 2);
150| expect(context.d).toBe(4);
| ^
151| }));
152|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:138:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[7/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a somewhat complex effect on a nested target which updates from its dependency
AssertionError: expected 3 to be 4 // Object.is equality
- Expected
+ Received
- 4
+ 3
❯ src/effects/index.test.ts:167:32
165| );
166| setContext("nested", "a", 2);
167| expect(context.effect.d).toBe(4);
| ^
168| }));
169|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:154:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[8/9]⎯
FAIL src/effects/index.test.ts > apply effect > applies a nested derived effect on a sibling target which updates from its dependency
AssertionError: expected 1 to be 2 // Object.is equality
- Expected
+ Received
- 2
+ 1
❯ src/effects/index.test.ts:179:32
177| applyEffect("nested.d := nested.a", context, setContext);
178| setContext("nested", "a", 2);
179| expect(context.nested.d).toBe(context.nested.a);
| ^
180| }));
181|
❯ src/effects/index.test.ts:11:7
❯ Module.createRoot node_modules/solid-js/dist/server.js:53:14
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:171:5
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯[9/9]⎯
Test Files 1 failed | 1 passed (2)
Tests 9 failed | 18 passed | 1 skipped (28)
Start at 12:06:33
Duration 506ms (transform 91ms, setup 0ms, collect 193ms, tests 20ms, environment 414ms, prepare 111ms)
This way, we can expose asynchronous FastAPI endpoints, which is natively handled by uvicorn
(the blessed [ASGI](https://asgi.readthedocs.io/en/latest/ server to run FastAPI apps).
We don't need dev dependencies to be installed in the image, as it will only contain the compiled js.
By implementing an SSE endpoint, we could propagate an update on multiple screens looking at the same resource pretty much immediately.
fastapi-auth-jwt
is unmaintained, and collides with pydantic>=2.0.0
.
Running npm run test
fails to run the tests defined in src/effects/index.test.ts
:
$ npm run test
> test
> vitest --run
RUN v0.32.4 /Users/br/code/5esheets/dnd5esheets/front
✓ src/effects/parser/index.test.ts (10)
❯ src/effects/index.test.ts (18)
❯ apply effect (18)
× applies a static effect
× applies a derived effect
× applies a derived effect which updates from its dependency
× applies a nested derived effect
× applies a nested derived effect which updates from its dependency
× applies a deeply nested derived effect
× applies a nested derived effect which updates from its dependency
× applies a non-computed nested derived effect
× applies a non-computed nested derived effect which updates from its dependency
× applies a non-computed deeply nested derived effect
× applies a non-computed deeply nested derived effect which updates from its dependency
× applies an effect containing a function
× applies a derived effect containing a function
× applies a derived effect containing a function which updates from its dependency
× applies a somewhat complex effect which updates from its dependency
× applies a somewhat complex effect on a nested target which updates from its dependency
× applies a nested derived effect on a sibling target which updates from its dependency
↓ applies a derived effect containing a function which updates from its dependency [skipped]
⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯ Failed Tests 17 ⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯
FAIL src/effects/index.test.ts > apply effect > applies a static effect
TypeError: Cannot read properties of undefined (reading 'registerGraph')
❯ Module.createStore node_modules/solid-js/store/dist/dev.js:213:9
❯ src/effects/index.test.ts:21:37
❯ src/effects/index.test.ts:11:7
❯ updateFn node_modules/solid-js/dist/dev.js:180:17
❯ runUpdates node_modules/solid-js/dist/dev.js:800:17
❯ Module.createRoot node_modules/solid-js/dist/dev.js:185:12
❯ src/effects/index.test.ts:10:5
❯ inRoot src/effects/index.test.ts:9:9
❯ src/effects/index.test.ts:20:5
...
However the tests are run when defining NODE_ENV=prod
.
This will allow us to communicate between Svelte and the backend, delegating data rendering and update to the JS code.
The goal here is to come up with a proof of concept or a spec of a system that would allow users to define effects, whether they would apply on items, spells equipment or something else, and have that effect be evaluated at runtime.
For example, we could define an armour with an effect of add +3 to your AC
, and how the AC is calculated, its score, etc, will all be dynamically evaluated.
Let's figure out the syntax of that system, and its limits
The CSS I started with was a compiled version of a SASS codebase. I could remove a lot of useless style by adding some components (score block, rounded box, etc).
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.