Skip to content

Commit

Permalink
docs: Update README for development server instructions and build pro…
Browse files Browse the repository at this point in the history
…cess; enhance index.html and main.tsx with new UI components

- Clarified instructions in README for running the development server from the `js/src` directory.
- Added details on building JavaScript code for production and CI pipeline requirements.
- Updated index.html to include a stylesheet link and corrected the script source path.
- Refactored main.tsx to implement new UI components: NumberInput, Button, Tabs, and MapSelector, improving the app's functionality and user experience.
- Introduced state management for counter and selected values, enhancing interactivity within the application.
  • Loading branch information
Lasse-numerous committed Dec 16, 2024
1 parent d22261a commit 4f42560
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ Prerequisites:
- Node.js
- npm

To run the development server, from the `js` directory, run:
To run the development server, from the `js/src` directory, run:

```sh
npx vite
Expand All @@ -99,6 +99,10 @@ The widgets js folder are structured as React components, which are then importe

### Build

The Python package will use built JavaScript code from the `static` directory in production mode. When you have created a new widget you need to add it to the build scripts in the `build-widgets.ps1` and `build-widgets.sh` files.

When you have changed the widget code, you need to build the JavaScript code again. The CI pipeline will build the JavaScript code when you push to the repository, but only if you have added the widget to the build scripts.

To build the JavaScript code, from the `js` directory, run:

On windows, run:
Expand Down
3 changes: 2 additions & 1 deletion js/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="stylesheet" href="./css/styles.css">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/js/main.tsx"></script>
<script type="module" src="./main.tsx"></script>
</body>
</html>
2 changes: 1 addition & 1 deletion python/src/numerous/widgets/base/_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

# Development server configuration
DEV_SERVER = os.getenv("VITE_DEV_SERVER", "http://localhost:5173")
DEV_COMPONENT_PATH = f"{DEV_SERVER}/src/components/widgets"
DEV_COMPONENT_PATH = f"{DEV_SERVER}/components/widgets"

print(f"RUNNING NUMEROUS WIDGETS IN DEVELOPMENT MODE\n\nPlease ensure dev server running on {DEV_SERVER} using 'npx vite'\n")
else:
Expand Down

0 comments on commit 4f42560

Please sign in to comment.