Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This fixes issue #issue 2651 #2656

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

MathioLucas
Copy link

@MathioLucas MathioLucas commented Dec 5, 2024

This fixes issue #issue 2651
a quick summary for file changes and additions
avatars.less

Replaced hardcoded avatar types with a single CSS class using variables.
avatars.json

Updated .typeXX classes to .vignette with a data-type attribute.

avatarLoader.js
Create this new file to dynamically assign avatar images.

Import avatarLoader.js.

To Automate the creation of avatars.json during build time.

new file to map avatar types to their image paths.
Instead of manually specifying a background-image for each type, the avatar image is assigned using JavaScript and the avatars.json file.
Handles dynamic assignment of avatar images using the avatars.json configuration.
Automatically generates avatars.json at build time by scanning the avatars folder.
Confirms avatars.json is generated correctly and included in the deployed build directory.
Copy link

vercel bot commented Dec 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
ancientbeast ✅ Ready (Inspect) Visit Preview Dec 19, 2024 2:53am

@DreadKnight
Copy link
Member

Heya! Thanks for the PR. Seems it fails to build. Also, please always ping issues using hashtag and then number: #2651

package.json Show resolved Hide resolved
@DreadKnight
Copy link
Member

@MathioLucas I've opened a review. "package.json" is the faulty file, very obvious problem there 🐻

@DreadKnight
Copy link
Member

@MathioLucas PR titles should be more descriptive, something like "auto-generated unit avatar grid at build time" in this case, as even if properly tagging the issue there, it won't be clickable (like it can be in description). Plus it's way more useful when stuff is reviewed and very importantly, when generating the list of changes for a new version release.

@DreadKnight DreadKnight marked this pull request as draft December 8, 2024 03:45
@DreadKnight
Copy link
Member

@MathioLucas Hey! Still waiting for a fix on this one 🐻

Thanks for the comments! I added the missing closing brace, removed the duplicate section and fix some formatting and comma placements.
There was a duplicate "avatarUrl
Was missing a semicolon
there was a stray 'e' here .then(avatars => { e document.querySelectorAll(".vignette")
small formating changes
@MathioLucas
Copy link
Author

Apologies for the long wait!

@DreadKnight
Copy link
Member

DreadKnight commented Dec 19, 2024

@MathioLucas All the avatars in the dash view show black and there are also errors during build process:

[04:43:05.085] Running build in Washington, D.C., USA (East) – iad1
[04:43:05.240] Cloning github.com/FreezingMoon/AncientBeast (Branch: master, Commit: 6aaf36f)
[04:43:08.199] Cloning completed: 2.958s
[04:43:08.725] Restored build cache from previous deployment (J6K3hYskmeuEeCk7RNfjU6XYxBAd)
[04:43:08.824] Running "vercel build"
[04:43:09.333] Vercel CLI 39.2.0
[04:43:10.441] Warning: Due to "engines": { "node": "20.x" } in your package.json file, the Node.js Version defined in your Project Settings ("18.x") will not apply, Node.js Version "20.x" will be used instead. Learn More: http://vercel.link/node-version
[04:43:10.449] Running "install" command: npm install...
[04:43:13.411]
[04:43:13.411] changed 2 packages, and audited 1071 packages in 3s
[04:43:13.412]
[04:43:13.412] 131 packages are looking for funding
[04:43:13.412] run npm fund for details
[04:43:13.421]
[04:43:13.421] 4 vulnerabilities (3 moderate, 1 high)
[04:43:13.421]
[04:43:13.421] To address all issues, run:
[04:43:13.421] npm audit fix
[04:43:13.421]
[04:43:13.421] Run npm audit for details.
[04:43:13.695]
[04:43:13.697] > [email protected] build:dev
[04:43:13.698] > webpack --mode=development
[04:43:13.698]
[04:43:14.315] Failed to load ./.env.
[04:43:39.278] assets by path assets/units/ 3.73 MiB 370 assets
[04:43:39.279] assets by path assets/autoload/phaser/ 421 KiB 73 assets
[04:43:39.279] assets by path assets/stats/ 172 KiB 38 assets
[04:43:39.279] assets by path assets/icons/ 57.1 KiB 34 assets
[04:43:39.280] assets by path assets/interface/ 685 KiB 24 assets
[04:43:39.280] assets by path .js 34.8 MiB 23 assets
[04:43:39.280] assets by path assets/music/ 62.4 MiB 17 assets
[04:43:39.280] assets by path assets/drops/stock/
.png 3.68 KiB 12 assets
[04:43:39.281] assets by path assets/sounds/*.ogg 252 KiB 9 assets
[04:43:39.281] assets by path assets/cards/ 110 KiB 9 assets
[04:43:39.281] assets by path assets/locations/ 791 KiB 4 assets
[04:43:39.281] assets by path assets/fonts/ 75.3 KiB 4 assets
[04:43:39.281] + 4 assets
[04:43:39.282] runtime modules 8.48 KiB 13 modules
[04:43:39.282] javascript modules 8.93 MiB
[04:43:39.282] modules by path ./node_modules/ 7.87 MiB 635 modules
[04:43:39.282] modules by path ./src/ 1020 KiB 71 modules
[04:43:39.282] ./assets/index.js 62.6 KiB [built] [code generated]
[04:43:39.282] asset modules 24.4 KiB (javascript) 68.7 MiB (asset) 595 modules
[04:43:39.283] json modules 37.7 KiB
[04:43:39.284] ./package.json 2.47 KiB [built] [code generated]
[04:43:39.284] ./node_modules/node-emoji/lib/emoji.json 35.2 KiB [built] [code generated]
[04:43:39.284]
[04:43:39.284] ERROR in /vercel/path0/src/avatarLoader.js
[04:43:39.284] 6:12-21
[04:43:39.284] [tsl] ERROR in /vercel/path0/src/avatarLoader.js(6,13)
[04:43:39.285] TS2451: Cannot redeclare block-scoped variable 'avatarUrl'.
[04:43:39.285] ts-loader-default_e3b0c44298fc1c14
[04:43:39.285]
[04:43:39.285] ERROR in /vercel/path0/src/avatarLoader.js
[04:43:39.285] 8:12-21
[04:43:39.285] [tsl] ERROR in /vercel/path0/src/avatarLoader.js(8,13)
[04:43:39.286] TS2451: Cannot redeclare block-scoped variable 'avatarUrl'.
[04:43:39.286] ts-loader-default_e3b0c44298fc1c14
[04:43:39.286]
[04:43:39.286] webpack 5.94.0 compiled with 2 errors in 24576 ms
[04:43:39.380] Error: Command "npm run build:dev" exited with 1
[04:43:39.646]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants