Skip to content

Commit

Permalink
Updated start script + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
bmingles committed Dec 12, 2023
1 parent 40edd32 commit 68c7a1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 30 deletions.
31 changes: 3 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ Run `npm install` to install js dependencies.
You can build the js 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
npm start # starts all plugins in watch mode and serves the plugins directory
# OR
cd plugins/plugin
npm start # starts just the current directory plugin in watch mode
Expand All @@ -96,34 +96,9 @@ This will rebuild the plugin(s) any time the source changes. If you are mapping

##### Serve Plugins

Vite supports a proxy configuration that can be used to point local DHC or DHE to another url when loading plugins. This has the benefit of not requiring a server restart when developing plugins. If you would like to use this option, you can run:
Running `npm start` will also will also serve the `plugins` directory using Vite's local dev server. The default host + port is `http://localhost:4100`, but the port can be configured via the `PORT` env variable.

```shell
npm run serve
```

This will serve the `plugins` directory at `http://localhost:4100` by default. The port can be configured via the `PORT` env variable.

The vite proxy can be configured in DHC with something like:

```typescript
proxy['/js-plugins'] = {
target: 'http://localhost:4100',
changeOrigin: true,
rewrite: path => path.replace(/^\/js-plugins/, ''),
};
```

The proxy can be configured in DHE for DeephavenCommunity worker with:

```typescript
proxy['/iriside/worker-kind/DeephavenCommunity/plugins'] = {
target: 'http://localhost:4100',
changeOrigin: true,
rewrite: path =>
path.replace(/^\/iriside\/worker-kind\/DeephavenCommunity\/plugins/, ''),
};
```
DHC and DHE can be configured when running locally to target the local `plugins` server. This has the benefit of not requiring a server restart when developing plugins. See [DHC](https://github.com/deephaven/web-client-ui/blob/main/README.md#local-plugin-development) or [DHE](https://github.com/deephaven-ent/iris/blob/rc/grizzly/web/client-ui/README.md#local-plugin-development) README for details on using this configuration.

#### Running deephaven-core

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
],
"scripts": {
"docker": "docker compose up --build",
"start": "lerna run start --stream",
"start": "run-p start:packages serve:plugins",
"build": "lerna run build --stream",
"serve": "run-p start serve:plugins",
"serve:plugins": "vite",
"start:packages": "lerna run start --stream",
"test": "jest --watch --changedSince origin/main",
"test:unit": "jest --config jest.config.unit.cjs",
"test:lint": "jest --config jest.config.lint.cjs",
Expand Down

0 comments on commit 68c7a1c

Please sign in to comment.