ROpdebee / mb-userscripts

Collection of userscripts for MusicBrainz
MIT License
117 stars 9 forks source link

feat(caa dims): add support for new event art archive (EAA) #779

Closed jesus2099 closed 1 month ago

jesus2099 commented 1 month ago

@vzell request:

https://community.metabrainz.org/t/ropdebees-userscripts-support-thread/551947/182

Could the userscript MB: Display CAA image dimensions be extended to the new event-art-archive?

Tested on https://musicbrainz.org/event/d1bd6d40-55f6-4e1a-91df-4c9395f95401 and sub-pages (/event-art, /edits)

kellnerd commented 1 month ago

/deploy-preview

You can use npm run build to build the userscripts locally.

I will see if I find some time to review your PRs as ROpdebee seems to be busy.

github-actions[bot] commented 1 month ago

This PR changes 1 built userscript(s):

See all changes

jesus2099 commented 1 month ago

You can use npm run build to build the userscripts locally.

I didn't manage tu build (npm run build failed). :-/

$ npm run build

> mb-userscripts@1.0.0 build
> NODE_ENV=production tsx build/build.ts

'NODE_ENV' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

I tried some tips from stackoverflow but nevermind.

jesus2099 commented 1 month ago

P.S. There are a few more places where the wording could be changed from specifically CAA to the more general "image archives" (the name which is also used on MetaBrainz Jira), but that is not required here and I will leave that decision up to ROpdebee.

I renamed my made-up AA into IMG, like in https://tickets.metabrainz.org/projects/IMG Please check.

kellnerd commented 1 month ago

/deploy-preview

Looks good to me. I will give @ROpdebee a chance to react before I will merge, though.

I didn't manage tu build (npm run build failed). :-/

Your terminal does not support the NODE_ENV=production syntax before the actual command (which just sets an environment variable), this happens on Windows computers for example.

Alternatively you can also run npm run build-dev which is basically the same command but without the environment variable. The difference doesn't matter for local testing, it just skips minification of some code blocks IIRC. (And yes, you might have to run npm install if your node_modules/ folder is not up-to-date.)

jesus2099 commented 1 month ago

I forced-pushed an amended commit that is preserving original constant order. I don't remember why I swapped them, probably on oversight.

I failed building again. It seems not possible on Windows, even in git bash, like here:

$ npm run build-dev

> mb-userscripts@1.0.0 build-dev
> tsx build/build.ts

Building mb_caa_dimensions
Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only URLs with a scheme in: file, data, and node are supported by the default ESM loader. On Windows, absolute paths must be valid file:// URLs. Received protocol 'c:'
    at throwIfUnsupportedURLScheme (node:internal/modules/esm/load:236:11)
    at defaultLoad (node:internal/modules/esm/load:128:3)
    at nextLoad (node:internal/modules/esm/hooks:865:28)
    at Z (file:///C:/Users/▒▒▒▒▒▒▒/git/_forks/ROpdebee_mb-userscripts/node_modules/tsx/dist/esm/index.mjs:5:1650)
    at nextLoad (node:internal/modules/esm/hooks:865:28)
    at Hooks.load (node:internal/modules/esm/hooks:448:26)
    at MessagePort.handleMessage (node:internal/modules/esm/worker:196:24)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:814:20)
    at exports.emitMessage (node:internal/per_context/messageport:23:28) {
  code: 'PLUGIN_ERROR',
  pluginCode: 'ERR_UNSUPPORTED_ESM_URL_SCHEME',
  plugin: 'UserscriptPlugin',
  hook: 'transform',
  id: '\x00virtual:index.js'
}
github-actions[bot] commented 1 month ago

:rocket: Released 1 new userscript version(s):

jesus2099 commented 1 month ago

Which code cleanup?

kellnerd commented 1 month ago

Oh, maybe cleanup wasn't the best term, what I meant is rather renaming/rewording. Like updating all identifiers and comments which are still talking about CAA and releases but also cover EAA and events now.

jesus2099 commented 1 month ago

Ah OK! I forgot about that. :)