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

Feature request: determine name from resource manifest #1571

Closed
matsn0w opened this issue Aug 13, 2022 · 6 comments
Closed

Feature request: determine name from resource manifest #1571

matsn0w opened this issue Aug 13, 2022 · 6 comments
Labels
stale Issue or PR has remained open with no activity and has become stale.

Comments

@matsn0w
Copy link

matsn0w commented Aug 13, 2022

Hello there,

I happened to come across a flaw while developing a server resource and I may have a fix for it right away.

Background

I am trying to develop a resource which is dependent on another resource. That's totally possible with a dependency key in my resource manifest, but that is assuming that the name of the dependent resource isn't changed by the server owner.

As far as I know, a resource is given a name based on it's folder (containing fxmanifest.lua).

Because of this, I am not 100% sure that dependency Y is available to resource X. It might be, but with a different name (read: folder path)!

Proposal

My idea for fixing the described issue is by simply adding a name key to the resource manifest spec, specifiying a unique 'resource id' that can be used for identifying this particular resource. This can be useful for things like dependencies and there may be more applications.

What do you think? Am I missing something? Am I thinking too easy?

Let me know!

Cheers,
matsn0w

@Mycroft-Studios
Copy link

if the server owner changes resource names and it breaks, surely its on them for changing it?

@AvarianKnight
Copy link
Contributor

They can fix the issue themselves by just "providing" for the other resource name, seems like wasted effort to add a name field when they will likely just change that too and complain about it being broken

provides {
	'mysql-async'
}

@matsn0w
Copy link
Author

matsn0w commented Aug 13, 2022

if the server owner changes resource names and it breaks, surely its on them for changing it?

Well, you are definately right. I can totally put a warning in the docs, but... People don't read docs. Maybe we can prevent such issues? Make things foolproof so to say ;)

They can fix the issue themselves by just "providing" for the other resource name, seems like wasted effort to add a name field when they will likely just change that too and complain about it being broken

Yeah, good point. However, changing 'code' is a step further IMO.

@Blumlaut
Copy link

They can fix the issue themselves by just "providing" for the other resource name

that does imply a certain level of awareness when a resource name is changed/nonstandard, which most amateurish server owners just don't have imho, many just click the "download as zip" button on GitHub and drag&drop the folders, without actually paying attention to the resource name.

On the flip side, it seems to me that using provide does work, even if the resource is named the exact same. so as a resource developer this may be a thing you'd want to implement by default, quickly testing it on EasyAdmin shows that it still works as intended, although if this is intentional is another thing altogether..

@xDope7137
Copy link

They can fix the issue themselves by just "providing" for the other resource name, seems like wasted effort to add a name field when they will likely just change that too and complain about it being broken

provides {
	'mysql-async'
}

I wish this "provides" would also work for exports. So if people are renaming their scripts, and have the original script name in "provides", it will directly link the exports to that renamed script.

That would help people renaming the qb-core scripts and other creators needing to create separate configs for custom script names.

@gottfriedleibniz
Copy link
Contributor

Closing this issue as stale. If this feature request/RFC needs to be revived the forums would be the place to have it.

The discussion here has been productive.

@gottfriedleibniz gottfriedleibniz added the stale Issue or PR has remained open with no activity and has become stale. label Feb 6, 2024
@gottfriedleibniz gottfriedleibniz closed this as not planned Won't fix, can't repro, duplicate, stale Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stale Issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

6 participants