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

[enhancement]: Consider adding optionalDependencies property to io-package.json #2970

Open
1 task done
mcm1957 opened this issue Nov 17, 2024 · 2 comments
Open
1 task done

Comments

@mcm1957
Copy link
Contributor

mcm1957 commented Nov 17, 2024

No existing issues.

  • There is no existing issue for my request.

Description

Please consider / discuss the introduction of optionalDependencies at io-package.json.

optionalDependencies should allow an installtion if either NO release of dependent adapter xyz ist installed or the installed release of xyz satosfy the version requirment specified.

Why?

Some adapters may work if another adapter is not installed. But if the related adapter is installed it must have a minimum version to provide the required functionality. If a non matching (too old) version of the related adapter is installed, this might lead to crashes in the worst scenario.

The concrete example is an adapter providing functionality for vis but requires a minimum vis release. The adapter can alos work if no vis is installed. This requirement cannot be specified with current options.

How?

add new property optionalDependencies to io-package.json analog to dependencies and process the specified requirement if the soecified adapter is installed.

@mcm1957 mcm1957 changed the title [enhancement]: Consider optionalDependencies [enhancement]: Consider adding optionalDependencies property to io-package.json Nov 17, 2024
@foxriver76
Copy link
Collaborator

Hm at least this is not how optional dependencies work in npm. I am also not sure, because if optional anyway than it doesn’t matter if not installed or wrong version installed the feature will not work.

@mcm1957
Copy link
Contributor Author

mcm1957 commented Nov 18, 2024

Thanks for clarification. I had a wrong knowledge of optionalDependencies.

When comparing with npm das ioBroker dependencies support expressions,i.e. <1.0.0 || >= 2.5.0 ? If it does does semver / ioBroker support null or <0.0.0 or such a condition? Maybe we not need any new property.

In generl: If effort seems to be too big feel free to close. I just want to init a consideration of this situation.

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

No branches or pull requests

2 participants