Skip to content

Commit

Permalink
Update to Vite for build (#14)
Browse files Browse the repository at this point in the history
* Update to Vite for build

* Remove unused packages

* Downgrade Vite to fix watch bug

* Address review comments, add lerna
  • Loading branch information
mattrunyon authored Apr 11, 2023
1 parent 2d2477b commit 44217ca
Show file tree
Hide file tree
Showing 58 changed files with 20,480 additions and 25,154 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules/
dist/
13 changes: 13 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
module.exports = {
root: true,
extends: ['@deephaven/eslint-config'],
overrides: [
{
files: ['**/*.@(ts|tsx)'],
parserOptions: {
project: ['./tsconfig.json'],
tsconfigRootDir: __dirname,
},
},
],
};
31 changes: 26 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,36 @@ This folder contains internally developed JS Plugin modules. Each plugin should
- Based off the [JS Module Plugin template](https://github.com/deephaven/deephaven-js-plugin-template/)
- Package name `@deephaven/js-plugin-<folderName>`
- Independent versioning, `npm install`, `npm run build`
- Exported as a CJS bundle
- Externalize `react`, `react-dom`, `redux`, and `react-redux` if used

## Development

Start by building the plugins from the root directory of this repo:
First run `npm install` to install dependencies.

You can build the plugin(s) in watch mode from the root directory of this repo by using the following commands:

```shell
npm start # starts all plugins in watch mode
# OR
cd plugins/plugin
npm start # starts just the current directory plugin in watch mode
```
npm install
npm build

This will rebuild the plugin(s) any time the source changes. Changes can be reflected by refreshing the Deephaven web IDE page after the build finishes.

To build for publishing, run

```shell
npm run build
```

Next, create a `manifest.json` file in the root directory of this project.

In it, there should be JSON containing a plugins object. This plugins object contains of list of plugins with their name, version, and location (main).

For example, if using matplotlib and plotly plugins with version 0.1.0, the file looks like this:

```
{
"plugins": [
Expand All @@ -31,25 +47,30 @@ For example, if using matplotlib and plotly plugins with version 0.1.0, the file
Then, build [deephaven-core](https://github.com/deephaven/deephaven-core). The directions below are relative to the root directory of your deephaven-core repo, but you can create the venv elsewhere if you'd like.

Within the deephaven-core repo, create a venv.

```
python -m venv .venv
source .venv/bin/activate
```

Then, build and install the python server wheels. The version number will depend on which release `deephaven-core` is currently on.

```
./gradlew :py-server:assemble :py-embedded-server:assemble
pip install py/server/build/wheel/deephaven_core-0.20.0-py3-none-any.whl py/embedded-server/build/wheel/deephaven_server-0.20.0-py3-none-any.whl
pip install py/server/build/wheel/deephaven_core-0.20.0-py3-none-any.whl py/embedded-server/build/wheel/deephaven_server-0.20.0-py3-none-any.whl
```

Finally, install the plugin wheels for the plugins, plotly and matplotlib in this example. See directions in the repos for the python plugins you're working with to learn how to build the wheels. Substitute in your local wheel locations.

```
pip install <plotly-plugin-path>/deephaven-plugin-plotly/dist/deephaven_plugin_plotly-0.0.1.dev2-py3-none-any.whl <matplotlib-plugin-path>/deephaven-plugin-matplotlib/dist/deephaven_plugin_matplotlib-0.1.1-py3-none-any.whl
```

Using the path to your local deephaven-js-plugins repo where the manifest.json is contained, start the server with the following command:

```
START_OPTS="-Ddeephaven.jsPlugins.resourceBase=<js-plugins-path>/deephaven-js-plugins" ./gradlew server-jetty-app:run
```
The deephaven IDE can then be opened at http://localhost:10000/ide/, with your plugins ready to use.

The deephaven IDE can then be opened at http://localhost:10000/ide/, with your plugins ready to use.
19 changes: 0 additions & 19 deletions babel.config.js

This file was deleted.

92 changes: 0 additions & 92 deletions dashboard-object-viewer/package.json

This file was deleted.

1 change: 0 additions & 1 deletion dashboard-object-viewer/src/DashboardPlugin/index.ts

This file was deleted.

2 changes: 0 additions & 2 deletions dashboard-object-viewer/src/index.ts

This file was deleted.

60 changes: 0 additions & 60 deletions dashboard-object-viewer/webpack.config.js

This file was deleted.

7 changes: 7 additions & 0 deletions lerna.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "node_modules/lerna/schemas/lerna-schema.json",
"useWorkspaces": true,
"useNx": true,
"version": "independent",
"packages": ["plugins/*"]
}
101 changes: 0 additions & 101 deletions matplotlib/package.json

This file was deleted.

Loading

0 comments on commit 44217ca

Please sign in to comment.