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

Expose iTwin.js Core Version for extensions/embed-api #3287

Merged
merged 3 commits into from
Mar 11, 2022
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
3 changes: 3 additions & 0 deletions common/api/core-frontend.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5335,6 +5335,9 @@ export interface ITwinIdArg {
readonly iTwinId?: GuidString;
}

// @public (undocumented)
export const ITWINJS_CORE_VERSION: string;

// @public
export enum KeyinParseError {
MismatchedQuotes = 4,
Expand Down
1 change: 1 addition & 0 deletions common/api/summary/core-frontend.exports.csv
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,7 @@ public;isTextInputFormatPropEditorSpec: (item: CustomFormatPropEditorSpec) => it
public;isTextSelectFormatPropEditorSpec: (item: CustomFormatPropEditorSpec) => item is TextSelectFormatPropEditorSpec
alpha;ItemField
beta;ITwinIdArg
public;ITWINJS_CORE_VERSION: string
public;KeyinParseError
internal;KeyinStatus
beta;LengthDescription
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@itwin/core-frontend",
"comment": "Expose iTwin.js Core Version for extensions",
"type": "none"
}
],
"packageName": "@itwin/core-frontend"
}
7 changes: 5 additions & 2 deletions core/frontend/src/IModelApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
* @module IModelApp
*/

const copyrightNotice = 'Copyright © 2017-2022 <a href="https://www.bentley.com" target="_blank" rel="noopener noreferrer">Bentley Systems, Inc.</a>';
/** @public */
// eslint-disable-next-line @typescript-eslint/no-var-requires
export const ITWINJS_CORE_VERSION = require("../../package.json").version as string; // require resolves from the lib/{cjs,esm} dir
const COPYRIGHT_NOTICE = 'Copyright © 2017-2022 <a href="https://www.bentley.com" target="_blank" rel="noopener noreferrer">Bentley Systems, Inc.</a>';

import { TelemetryManager } from "@itwin/core-telemetry";
import { UiAdmin } from "@itwin/appui-abstract";
Expand Down Expand Up @@ -688,7 +691,7 @@ export class IModelApp {
return this.makeLogoCard({
iconSrc: `${this.publicPath}images/about-imodeljs.svg`,
heading: `<span style="font-weight:normal">${this.localization.getLocalizedString("iModelJs:Notices.PoweredBy")}</span>&nbsp;iTwin.js`,
notice: `${require("../../package.json").version}<br>${copyrightNotice}`, // eslint-disable-line @typescript-eslint/no-var-requires
notice: `${ITWINJS_CORE_VERSION}<br>${COPYRIGHT_NOTICE}`,
});
}

Expand Down