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

refactor: use the new getVersion function #590

Merged
merged 1 commit into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion demo/static/js/use-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class UseCase {
_displayVersionInfoInFooter() {
const footerElt = document.querySelector('footer');
if (footerElt) {
const version = this._bpmnVisualization.getVersion();
const version = bpmnvisu.getVersion();
footerElt.innerText = `bpmn-visualization@${version.lib}`;
}
}
Expand Down
4 changes: 2 additions & 2 deletions projects/javascript-vanilla-with-webpack/src/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BpmnVisualization, FitType } from 'bpmn-visualization';
import { BpmnVisualization, FitType, getVersion } from 'bpmn-visualization';
// this is simple example of the BPMN diagram, loaded as string. Load support provided by Webpack.
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from './diagram.bpmn';
Expand Down Expand Up @@ -66,7 +66,7 @@ registry.addOverlays('Activity_083jf01',

// display the bpmn-visualization version in the footer
const footer = document.querySelector("footer");
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString}`;
4 changes: 2 additions & 2 deletions projects/typescript-vanilla-with-parcel/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mxgraph, BpmnVisualization, FitType } from "bpmn-visualization";
import { mxgraph, BpmnVisualization, FitType, getVersion } from 'bpmn-visualization';
// BPMN diagram content conveniently retrieved with parcel (as string)
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from "bundle-text:./diagram.bpmn";
Expand All @@ -12,7 +12,7 @@ const bpmnVisualization = new BpmnVisualization({

// display the bpmn-visualization version in the footer
const footer = document.querySelector("footer")!;
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString} | direct usage of mxGraph@${mxgraph.mxClient.VERSION}`;
Expand Down
4 changes: 2 additions & 2 deletions projects/typescript-vanilla-with-rollup/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {BpmnVisualization} from "bpmn-visualization";
import { BpmnVisualization, getVersion } from 'bpmn-visualization';
// this is simple example of the BPMN diagram, loaded as string. Load support provided by rollup-plugin-string.
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from "./diagram.bpmn";
Expand Down Expand Up @@ -82,7 +82,7 @@ registry.addOverlays('Activity_083jf01',

// display the bpmn-visualization version in the footer
const footer = document.querySelector<HTMLElement>("footer")!;
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString}`;
4 changes: 2 additions & 2 deletions projects/typescript-vanilla-with-vitejs/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import './style.css';
// this is simple example of the BPMN diagram, loaded as string. The '?.raw' extension support is provided by Vite.
// for other load methods, see https://github.com/process-analytics/bpmn-visualization-examples
import diagram from './diagram.bpmn?raw';
import { BpmnVisualization, FitType, mxgraph } from 'bpmn-visualization';
import { BpmnVisualization, FitType, getVersion, mxgraph } from 'bpmn-visualization';

// instantiate BpmnVisualization, pass the container HTMLElement - present in index.html
const bpmnVisualization = new BpmnVisualization({
Expand Down Expand Up @@ -68,7 +68,7 @@ registry.addOverlays('Activity_083jf01',

// display the bpmn-visualization version in the footer
const footer = document.querySelector<HTMLElement>('footer')!;
const version = bpmnVisualization.getVersion();
const version = getVersion();
const versionAsString = `bpmn-visualization@${version.lib}`;
const dependenciesAsString = [...version.dependencies].map(([name, version]) => `${name}@${version}`).join('/');
footer.innerText = `${versionAsString} with ${dependenciesAsString} | direct usage of mxGraph@${mxgraph.mxClient.VERSION}`;
Loading