Skip to content

Commit

Permalink
Remove import of package.json and replace with bumpver control (#141)
Browse files Browse the repository at this point in the history
Use a string through bumpver instead of dynamic import to get the
version
string.
  • Loading branch information
agjohnson authored Sep 20, 2023
1 parent 0beda3b commit 2cc9b0d
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 12 deletions.
3 changes: 3 additions & 0 deletions bumpver.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,6 @@ push = true
"bumpver.toml" = [
'current_version = "{version}"',
]
"src/utils.js" = [
'export const CLIENT_VERSION = "{version}";',
]
14 changes: 7 additions & 7 deletions dist/readthedocs-addons.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/readthedocs-addons.js.map

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions src/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
import packagejson from "../package.json";
export const ADDONS_API_VERSION = "0";
// This is managed by bumpver automatically
export const CLIENT_VERSION = "0.5.0";

export function isReadTheDocsEmbedPresent() {
const urls = [
Expand All @@ -10,9 +12,6 @@ export function isReadTheDocsEmbedPresent() {
}
}

export const CLIENT_VERSION = packagejson.version;
export const ADDONS_API_VERSION = "0";

export const domReady = new Promise((resolve) => {
if (
document.readyState === "interactive" ||
Expand Down

0 comments on commit 2cc9b0d

Please sign in to comment.