Add issues/11256 behavior to track the version of extension#67
Merged
offtherailz merged 2 commits intogeosolutions-it:masterfrom Dec 15, 2025
Merged
Add issues/11256 behavior to track the version of extension#67offtherailz merged 2 commits intogeosolutions-it:masterfrom
offtherailz merged 2 commits intogeosolutions-it:masterfrom
Conversation
12 tasks
offtherailz
previously approved these changes
Dec 11, 2025
offtherailz
reviewed
Dec 11, 2025
| new CopyPlugin([ | ||
| { from: path.resolve(__dirname, "..", "..", "assets", "translations"), to: "translations" }, | ||
| { from: path.resolve(__dirname, "..", "..", "assets", "index.json"), to: "index.json" } | ||
| { from: tmpIndex, to: 'index.json' }, |
Member
There was a problem hiding this comment.
Suggested change
| { from: tmpIndex, to: 'index.json' }, | |
| { from: tmpIndex, to: 'index.json' } |
offtherailz
reviewed
Dec 11, 2025
Member
offtherailz
left a comment
There was a problem hiding this comment.
See my comments.
The PR is good anyway, so it is ok for me to approve it, just suggesting this improvemnt
offtherailz
reviewed
Dec 11, 2025
Comment on lines
12
to
27
| // read version.txt and produce a temporary updated index.json | ||
| const versionFile = path.resolve(__dirname, "..", "..", "version.txt"); | ||
| const indexSrc = path.resolve(__dirname, "..", "..", "assets", "index.json"); | ||
| const tmpIndex = path.resolve(__dirname, "..", "..", "assets", "index.json.tmp"); | ||
|
|
||
| try { | ||
| const versionText = fs.readFileSync(versionFile, 'utf8').trim().split('-')[1]; | ||
| const indexContent = JSON.parse(fs.readFileSync(indexSrc, 'utf8')); | ||
| if (Array.isArray(indexContent.plugins)) { | ||
| indexContent.plugins = indexContent.plugins.map(p => p && p.name === name ? { ...p, version: versionText } : p); | ||
| } | ||
| fs.writeFileSync(tmpIndex, JSON.stringify(indexContent, null, 4), 'utf8'); | ||
| } catch (e) { | ||
| // keep behavior silent here; build will fail later if necessary | ||
| console.error('Error updating index.json from version.txt:', e); | ||
| } |
Member
There was a problem hiding this comment.
Suggested change
| // read version.txt and produce a temporary updated index.json | |
| const versionFile = path.resolve(__dirname, "..", "..", "version.txt"); | |
| const indexSrc = path.resolve(__dirname, "..", "..", "assets", "index.json"); | |
| const tmpIndex = path.resolve(__dirname, "..", "..", "assets", "index.json.tmp"); | |
| try { | |
| const versionText = fs.readFileSync(versionFile, 'utf8').trim().split('-')[1]; | |
| const indexContent = JSON.parse(fs.readFileSync(indexSrc, 'utf8')); | |
| if (Array.isArray(indexContent.plugins)) { | |
| indexContent.plugins = indexContent.plugins.map(p => p && p.name === name ? { ...p, version: versionText } : p); | |
| } | |
| fs.writeFileSync(tmpIndex, JSON.stringify(indexContent, null, 4), 'utf8'); | |
| } catch (e) { | |
| // keep behavior silent here; build will fail later if necessary | |
| console.error('Error updating index.json from version.txt:', e); | |
| } | |
| // read version and produce a temporary updated index.json | |
| const { version: versionText } = require('../../package.json'); | |
| const indexSrc = path.resolve(__dirname, "..", "..", "assets", "index.json"); | |
| const tmpIndex = path.resolve(__dirname, "..", "..", "assets", "index.json.tmp"); | |
| try { | |
| const indexContent = JSON.parse(fs.readFileSync(indexSrc, 'utf8')); | |
| if (Array.isArray(indexContent.plugins)) { | |
| indexContent.plugins = indexContent.plugins.map(p => p && p.name === name ? { ...p, version: versionText } : p); | |
| } | |
| fs.writeFileSync(tmpIndex, JSON.stringify(indexContent, null, 4), 'utf8'); | |
| } catch (e) { | |
| // keep behavior silent here; build will fail later if necessary | |
| console.error('Error updating index.json from version.txt:', e); | |
| } | |
Contributor
Author
There was a problem hiding this comment.
Ok this is a correct behabior.
Just a question about the version.txt file presents at root folder : What is the usage or the aim of this file ?
From my understanding, this file contained the plugin version. This information is redundant with information in package.json version.
May be we could remove the version.txt file ?
offtherailz
approved these changes
Dec 15, 2025
Member
|
Very good 🚀 !! |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In coherence with the geosolutions-it/MapStore2#11256 issue which provide a way to display version of a deploy plugin in contexte creation, the proposal :
Fix geosolutions-it/MapStore2#11256