Skip to content

Commit

Permalink
ci(js-lib): bump version to rename exported object
Browse files Browse the repository at this point in the history
  • Loading branch information
jourdain committed Jun 5, 2024
1 parent 539f09f commit 557d1c4
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 105 deletions.
103 changes: 0 additions & 103 deletions js-lib/examples

This file was deleted.

17 changes: 17 additions & 0 deletions js-lib/examples/cdn/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Plain JS client

This example use CDN on the Js side to illustrate how to use the trame client in plain JavaScript.

## Trame setup

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install trame
```

## Running example

```bash
python ./server.py --content ./www
```
25 changes: 25 additions & 0 deletions js-lib/examples/cdn/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
from trame.app import get_server

server = get_server()
state, ctrl = server.state, server.controller

state.list = [
"a",
"b",
"c",
]

state.count = 1


@ctrl.trigger("add")
def add_to_count():
state.count += 1


@ctrl.trigger("subtract")
def subtract_to_count():
state.count += 1


server.start()
19 changes: 19 additions & 0 deletions js-lib/examples/cdn/www/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html><html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>My Trame Client</title>
</head>
<body>
<main>
<h1>Welcome to My Trame Client</h1>
<button class="add">Add</button>
<button class="subtract">Subtract</button>
<div class="count">from HTML</div>
</main>
<script crossorigin="anonymous" src="https://www.unpkg.com/@kitware/trame@0.0.1/dist/trame.umd.js"></script>
<script>
</script>
</body>
</html>
2 changes: 1 addition & 1 deletion js-lib/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@kitware/trame",
"version": "0.0.1",
"version": "0.0.2",
"license": "MIT",
"main": "./dist/trame.umd.js",
"unpkg": "./dist/trame.umd.js",
Expand Down
2 changes: 1 addition & 1 deletion js-lib/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default {
build: {
lib: {
entry: "./src/main.js",
name: "trame",
name: "Trame",
formats: ["es", "umd"],
fileName: "trame",
},
Expand Down

0 comments on commit 557d1c4

Please sign in to comment.