Skip to content

Remove id meta tag and validate mod ID #51

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

Merged
merged 3 commits into from
Jan 16, 2023

Conversation

ithinkandicode
Copy link
Collaborator

Changes:

  • Removes extra.godot.id
  • Validates that the mod ID is {namespace}-{name}. The mod won't load if it doesn't match

This works towards #20 (this comment):

tightly coupling the mod ID to package ID end to end would be great (so making them match with Thunderstore IDs to benefit from the ecosystem guarantees)

Logged error:

mod-id-warning--lb

^ note: I added that line break afterwards, to make it easier to preview here. There's no line break in the actual code

@ithinkandicode ithinkandicode mentioned this pull request Jan 16, 2023
5 tasks
@ithinkandicode ithinkandicode requested a review from Qubus0 January 16, 2023 19:46
Copy link
Collaborator

@Qubus0 Qubus0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a good start.
as per the info by thunderstore, a "full id" would be {namespace}-{name}-{version_number}
I'm not sure what we would call this id, maybe something like "full_name_id"?

the validation does address the composition, but not the elements of that composition. following thunderstore,
namespace and name are are validated with this ^[a-zA-Z0-9_]$ (where _ can only be replaced with space for display purposes)
and the version_number with this ^[0-9]+\.[0-9]+\.[0-9]+$
Godot does have a regex class you can use

@ithinkandicode
Copy link
Collaborator Author

this is a good start. as per the info by thunderstore, a "full id" would be {namespace}-{name}-{version_number} I'm not sure what we would call this id, maybe something like "full_name_id"?

the validation does address the composition, but not the elements of that composition. following thunderstore, namespace and name are are validated with this ^[a-zA-Z0-9_]$ (where _ can only be replaced with space for display purposes) and the version_number with this ^[0-9]+\.[0-9]+\.[0-9]+$ Godot does have a regex class you can use

Maybe something for a subsequent PR?

@ithinkandicode ithinkandicode requested a review from Qubus0 January 16, 2023 21:11
Copy link
Collaborator

@Qubus0 Qubus0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alright, to get on with the rest

@ithinkandicode ithinkandicode merged commit c4458b7 into GodotModding:main Jan 16, 2023
@ithinkandicode ithinkandicode deleted the remove-id-meta-tag branch January 16, 2023 21:29
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.

3 participants