Skip to content

Commit 345beea

Browse files
committed
add version handling
1 parent bf2b2a6 commit 345beea

8 files changed

+17
-13
lines changed

.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
"no-await-in-loop": "off",
2727
"no-empty": "off",
2828
"no-nested-ternary": "off",
29-
"prefer-arrow-callback": "off"
29+
"prefer-arrow-callback": "off",
30+
"no-undef": "off"
3031
}
3132
}

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/globals.d.ts

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// globals.d.ts
2+
declare const __APP_VERSION__: string;
3+
declare const __DNA_VERSION__: string;

ui/package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
"description": "Webcomponent lit-element following open-wc recommendations",
44
"license": "MIT",
55
"author": "lit-element",
6-
"version": "0.0.0",
6+
"version": "0.10.0",
7+
"dnaVersion": "0.2.0",
78
"scripts": {
89
"start": "vite --port $UI_PORT --clearScreen false",
910
"build": "vite build",
@@ -19,7 +20,7 @@
1920
"@holochain-syn/core": "^0.400.0-dev.0",
2021
"@holochain-syn/text-editor": "^0.400.0-dev.0",
2122
"@holochain/client": "^0.18.0-dev.0",
22-
"@lightningrodlabs/we-applet": "^0.17.0-dev.1",
23+
"@lightningrodlabs/we-applet": "^0.17.0-dev.3",
2324
"@lightningrodlabs/we-elements": "^0.6.0-dev.0",
2425
"@lit/context": "^1.0.0",
2526
"@lit/localize": "^0.12.0",

ui/src/notebooks-app.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ import { appletServices } from "./we-applet.js";
6969
import { NoteMeta, NoteWorkspace, Notebook, noteMetaB64ToRaw, noteMetaToB64 } from "./types.js";
7070
import { deserializeExport, exportNotes } from "./export.js";
7171
import { NotebooksStore, notebooksContext } from "./store.js";
72-
import { renderAsyncStatus } from "./utils.js";
7372

7473
// @ts-ignore
7574
const appPort = import.meta.env.VITE_APP_PORT ? import.meta.env.VITE_APP_PORT : 8888
@@ -555,7 +554,7 @@ export class NotebooksApp extends LitElement {
555554
}
556555

557556
return html`
558-
<sl-dialog label="Notebooks: UI v0.2.10 for DNA v0.2.0" id="about-dialog" width={600} >
557+
<sl-dialog label="Notebooks: UI v${__APP_VERSION__} for DNA v${__DNA_VERSION__}" id="about-dialog" width={600} >
559558
<div class="about">
560559
<p>Notebooks is a demonstration Holochain app built by Lighning Rod Labs.</p>
561560
<p> <b>Developers:</b>

ui/src/utils.ts

-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import { Document } from "@holochain-syn/core";
33
import { Marked, Renderer } from "@ts-stack/markdown";
44
import hljs from 'highlight.js';
55
import Automerge from 'automerge';
6-
7-
86
import { html, TemplateResult } from "lit";
97
import { AsyncStatus } from "@holochain-open-dev/stores";
108

ui/tsconfig.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"inlineSources": true,
1616
"rootDir": "./src",
1717
"incremental": true,
18-
"skipLibCheck": true
18+
"skipLibCheck": true,
1919
},
20-
"include": ["src/**/*.ts"]
20+
"include": ["src/**/*.ts", "globals.d.ts"]
2121
}

ui/vite.config.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import path from "path";
22
import { defineConfig } from "vite";
33
import checker from "vite-plugin-checker";
44
import { viteStaticCopy } from "vite-plugin-static-copy";
5+
import { version, dnaVersion } from './package.json'; // Import version from package.json
56

67
const components = [
78
"dialog",
@@ -29,8 +30,9 @@ const exclude = components.map(
2930
(c) => `@shoelace-style/shoelace/dist/components/${c}/${c}.js`
3031
);
3132
export default defineConfig({
32-
build: {
33-
minify: false
33+
define: {
34+
'__APP_VERSION__': JSON.stringify(version), // Define a global constant
35+
'__DNA_VERSION__': JSON.stringify(dnaVersion) // Define a global constant
3436
},
3537

3638
optimizeDeps: {

0 commit comments

Comments
 (0)