Skip to content

Commit a632d63

Browse files
committed
fix export default and add jsdelivr test
1 parent 12550cf commit a632d63

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
# tlmviewer
22

3+
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/victorpoughon/tlmviewer/node.js.yml)
4+
35
Three.js based 3D viewer for [torchlensmaker](https://github.com/victorpoughon/torchlensmaker).

public/test_jsdelivr.html

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<title>tlmviewer example</title>
6+
7+
<script type="module">
8+
import tlmviewer from 'https://cdn.jsdelivr.net/npm/tlmviewer/+esm';
9+
tlmviewer.loadAll();
10+
</script>
11+
12+
<style>
13+
.tlmviewer {
14+
height: 600px;
15+
aspect-ratio: 1.5;
16+
}
17+
</style>
18+
</head>
19+
<body>
20+
<div class="tlmviewer" data-url="./testsEmbed/landscape.json"></div>
21+
</body>
22+
</html>

src/gui.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ export class TLMGui {
8686

8787
// If 'object' variable is available, default to it for valid and output rays
8888
if (this.scene.variables.includes("object")) {
89-
console.log("setting obejct var");
9089
this.controller.validColor = this.colorOptions["object"];
9190
this.controller.outputColor = this.colorOptions["object"];
9291
}

src/main.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,11 @@ async function loadAll(): Promise<Promise<void>[]> {
296296
return promises;
297297
}
298298

299-
export const tlmviewer = {
299+
export default {
300300
embed: embed,
301301
load: load,
302302
loadAll: loadAll,
303303
};
304304

305-
console.log("tlmviewer loaded");
305+
// @ts-ignore
306+
console.log(`tlmviewer-${import.meta.env.PACKAGE_VERSION} loaded`);

test/test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { tlmviewer } from "../src/main.ts";
1+
import tlmviewer from "../src/main.ts";
22

33
const embed_tests = [
44
"/tests2D/test_controls.json",

0 commit comments

Comments
 (0)