Repository navigation
Conversation
dwcVersion, rrfVersion and sbcDsfVersion are documented as minimums but checkVersion only tests for an equal version prefix, so "3.7" rejects 3.8 and "3.5.1" rejects 3.5.4. Rather than change what those fields mean for existing plugins, add dwcMinVersion, rrfMinVersion and sbcDsfMinVersion, checked with a real "this version or newer" comparison (src/plugins/version.ts). A minimum without a prerelease tag is met by the prereleases of that release line, so "3.7" installs on 3.7.0-rc.2. The install dialog and installPlugin read the fields from the raw plugin.json. The load-time check and the plugin list read them from the object model, which drops fields PluginManifest does not declare, so those two stay inert until @duet3d/objectmodel (and DSF for SBC installs) declare them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Collaborator
|
I am sorry but I cannot approve this PR at this point. We are very close to 3.7.0 stable and I cannot make deeper changes at this point. In addition, I will not accept minVersions because 3.7 and 3.8 are not guaranteed to be fully compatible. We can consider to allow a range of supported versions (changing the type of dwcVersion etc. from an atomic value to an array with the same check mechanism) but not more. TBD. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
PLUGINS.mddocumentsdwcVersion,rrfVersionandsbcDsfVersionas minimum versions, butcheckVersion(src/plugins/index.ts) only tests that the version segments up to the shorter string are equal. So they are "same version prefix" checks:3.73.73.7.03.5.13.7.0-rc.1That is a reasonable default for
dwcVersion(plugins compile against DWC internals and the externalised chunks, andauto-majorrelies on it). But there is currently no way for a plugin to say "3.6 or newer".Change
Adds three optional manifest fields, checked with a real "this version or newer" comparison, and leaves the existing three fields exactly as they are, so no installed plugin changes behaviour:
dwcMinVersion,rrfMinVersion,sbcDsfMinVersionsrc/plugins/version.ts(new, no imports):compareVersions,checkMinVersion,getMinVersion. A minimum without a prerelease tag is met by prereleases of that release line (so a plugin requiring3.7installs on3.7.0-rc.2); only a minimum that names a prerelease is compared prerelease by prerelease. Unparsable input fails.PluginInstallDialog.vue: reads the fields from the rawplugin.json, shows a "Requires X or newer" line under the RRF/DWC/DSF version, blocks the install when unmet. Combines with the existing prefix field if both are set.machineStore.installPlugin: rejects a plugin that needs a newer DWC.scripts/build-plugin.js:auto/auto-major/auto-minorare resolved in the new fields too.PLUGINS.md: new "Version requirements" section explaining prefix fields vs minimum fields.en.json/de.json: one new string.Limitation: this needs
@duet3d/objectmodeland DSF changes to be completePluginManifestin@duet3d/objectmodelonly keeps properties it declares (ModelObject.updateskips any key notin this). So a*MinVersionfield is dropped as soon as the manifest becomes aPluginmodel object:PollConnector.installPlugindoesinitObject(Plugin, ...)and savesJSON.stringify(plugins)to the plugins file, so the fields are not persisted.PUTto DSF, which (as far as I can tell; I have not read the DSF source) parsesplugin.jsonitself and serves the object model back.What that means for this PR:
installPlugin), because they read the rawplugin.jsonfrom the ZIP.loadExternalPluginand the requirements line in Settings → Plugins. Both read from the object model viagetMinVersion, so they start working as soon as the fields exist there. Nothing breaks in the meantime; they just find nothing to check.The upstream work is small: declare
dwcMinVersion,rrfMinVersionandsbcDsfMinVersion(string | null, defaultnull) onPluginManifestin@duet3d/objectmodel, and, on the DSF side, add the same three properties to the plugin manifest so it keeps and serves them (and, if you want it, checks them when installing a plugin itself). I have not looked at the DSF code yet, so the exact change there is for me to confirm. I'm happy to open PRs for both (and bump the@duet3d/objectmodeldependency here once it is released) if you want this direction. If you would rather keep the manifest as it is, or prefer a different shape (e.g. range syntax, or changing what the existing fields mean), tell me and I will rework it.Testing
vue-tsc --noEmitis clean for everything touched (checked it catches a deliberately wrong field name).version.tswas exercised with 44 cases (rc ordering such asrc.10vsrc.2,3.10vs3.9, the old3.4.0b3firmware spelling, empty/garbage input, the table above) and each of the comparison direction, the prerelease rule and the empty-minimum handling was broken in turn to confirm the cases fail. DWC has no unit-test runner, so these were ad hoc scripts and are not in the PR.resolveVersionPlaceholderschecked for the three new fields.Targets
v3.7-dev. It is additive and touches nothing in the load path for existing plugins, but I understand 3.7 is in its rc phase, so say if you would rather hold it.🤖 Generated with Claude Code