Skip to content

Commit

Permalink
Thread agnostic setup (v1) (#20)
Browse files Browse the repository at this point in the history
* 0.0.16

* first pass at thread agnostic build process

* success!

* update docs

* support buildonly again

* 1.0.0-0

* fix fs reference

* 1.0.0-1

* fix path reference. add eslint
  • Loading branch information
Ethan-Arrowood authored Jan 2, 2025
1 parent 450bf9a commit 8669f54
Show file tree
Hide file tree
Showing 6 changed files with 1,281 additions and 182 deletions.
24 changes: 15 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,18 @@ export default async function Dog({ params }) {
}
```

HarperDB relies on native dependencies and must be configured as an external package. In Next.js v14, update the next.config.js `webpack` option with:

```js
webpack: (config) => {
config.externals.push({
harperdb: 'commonjs harperdb',
});

return config;
},
```

## Options

> All configuration options are optional
Expand All @@ -102,23 +114,17 @@ Build the Next.js application and then exit (including shutting down HarperDB).

Enables Next.js dev mode. Defaults to `false`.

### `installCommand: string`

Specify an install command. Defaults to `npm install`.

> Note: the extension will skip installing dependencies if it detects a `node_modules` folder in the application component.
### `port: number`

Specify a port for the Next.js server. Defaults to `9926`.
Specify a port for the Next.js server. Defaults to the HarperDB default port (generally `9926`).

### `prebuilt: boolean`

When enabled, the extension will look for a `.next` directory in the root of the component and skip executing the `buildCommand`. Defaults to `false`.

### `subPath: string`
### `port: number`

Specify a sub path to route requests from. For example, with `subPath: 'harperdb'`, any requests within the Next.js app to that path, such as `/harperdb/image.png`, will be rerouted to `/image.png`. Defaults to `''`.
Specify a secure port for the Next.js server. Defaults to the HarperDB default secure port.

## CLI

Expand Down
1 change: 1 addition & 0 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ switch (command) {
break;
default:
console.log('Unknown command:', command);
// eslint-disable-next-line no-fallthrough
case 'help':
console.log(HELP);
break;
Expand Down
5 changes: 5 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import globals from 'globals';
import pluginJs from '@eslint/js';

/** @type {import('eslint').Linter.Config[]} */
export default [{ languageOptions: { globals: globals.node } }, pluginJs.configs.recommended];
Loading

0 comments on commit 8669f54

Please sign in to comment.