Skip to content

Commit b241e47

Browse files
docs: review README including options (#19)
1 parent f216071 commit b241e47

File tree

2 files changed

+35
-30
lines changed

2 files changed

+35
-30
lines changed

plugins/nextjs-plugin/README.md

+20-15
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,7 @@ The plugin automatically loads your Satellite and Orbiter IDs.
1717
With these values, you can instantiate Juno in your code without the need to manually define environment variables.
1818

1919
```javascript
20-
await Promise.all([
21-
initJuno({
22-
satelliteId: process.env.NEXT_PUBLIC_SATELLITE_ID
23-
}),
24-
initOrbiter({
25-
satelliteId: process.env.NEXT_PUBLIC_SATELLITE_ID,
26-
orbiterId: process.env.NEXT_PUBLIC_ORBITER_ID
27-
})
28-
]);
20+
await Promise.all([initSatellite(), initOrbiter()]);
2921
```
3022

3123
## Environment variables
@@ -73,14 +65,19 @@ export default withJuno({nextConfig});
7365

7466
## Options
7567

76-
The plugins can be initialized with the following options:
68+
The plugin can be customized using the optional `juno` configuration object. This allows you to control how the Juno Docker container is used in your project, especially during local development or end-to-end (E2E) testing.
7769

78-
- `juno.container`: `true` to use [Juno Docker](https://github.com/junobuild/juno-docker) with default options, or specify an object.
70+
### `juno.container`
7971

80-
The object accepts the following parameters:
72+
Use the container option to enable, disable, or fine-tune the use of [Juno Docker](https://github.com/junobuild/juno-docker).
8173

82-
- An optional `url` as `string`, representing the container URL including the port, e.g. `http://127.0.0.1:8000`.
83-
- An optional list of `modes` for which the container should be used.
74+
You can provide:
75+
76+
- `false` — to disable the container entirely.
77+
- `true` — to enable the container with default settings (only in development mode), which is also the default behavior.
78+
- An object with the following fields:
79+
- `url` (`string`, optional): A custom container URL, including the port. Example: http://127.0.0.1:8000
80+
- `modes` (`string[]`, optional): An array of modes (e.g., ['development', 'test']) during which the container should be used.
8481

8582
By default, the container is mounted only in `development` mode.
8683

@@ -92,7 +89,15 @@ const nextConfig = {
9289
output: 'export'
9390
};
9491

95-
export default withJuno({nextConfig, juno: {container: true}});
92+
export default withJuno({
93+
nextConfig,
94+
juno: {
95+
container: {
96+
url: 'http://127.0.0.1:8000',
97+
modes: ['development', 'test']
98+
}
99+
}
100+
});
96101
```
97102

98103
## License

plugins/vite-plugin/README.md

+15-15
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,7 @@ The plugin automatically loads your Satellite and Orbiter IDs.
1717
With these values, you can instantiate Juno in your code without the need to manually define environment variables.
1818

1919
```javascript
20-
await Promise.all([
21-
initJuno({
22-
satelliteId: import.meta.env.VITE_SATELLITE_ID
23-
}),
24-
initOrbiter({
25-
satelliteId: import.meta.env.VITE_SATELLITE_ID,
26-
orbiterId: import.meta.env.VITE_ORBITER_ID
27-
})
28-
]);
20+
await Promise.all([initSatellite(), initOrbiter()]);
2921
```
3022

3123
## Environment variables
@@ -61,14 +53,19 @@ export default defineConfig({
6153

6254
## Options
6355

64-
The plugins can be initialized with the following options:
56+
The plugin can be customized using the optional `juno` configuration object. This allows you to control how the Juno Docker container is used in your project, especially during local development or end-to-end (E2E) testing.
6557

66-
- `container`: `true` to use [Juno Docker](https://github.com/junobuild/juno-docker) with default options, or specify an object.
58+
### `juno.container`
6759

68-
The object accepts the following parameters:
60+
Use the container option to enable, disable, or fine-tune the use of [Juno Docker](https://github.com/junobuild/juno-docker).
6961

70-
- An optional `url` as `string`, representing the container URL including the port, e.g. `http://127.0.0.1:8000`.
71-
- An optional list of `modes` for which the container should be used.
62+
You can provide:
63+
64+
- `false` — to disable the container entirely.
65+
- `true` — to enable the container with default settings (only in development mode), which is also the default behavior.
66+
- An object with the following fields:
67+
- `url` (`string`, optional): A custom container URL, including the port. Example: http://127.0.0.1:8000
68+
- `modes` (`string[]`, optional): An array of modes (e.g., ['development', 'test']) during which the container should be used.
7269

7370
By default, the container is mounted only in `development` mode.
7471

@@ -79,7 +76,10 @@ import juno from '@junobuild/vite-plugin';
7976
export default defineConfig({
8077
plugins: [
8178
juno({
82-
container: true
79+
container: {
80+
url: 'http://127.0.0.1:8000',
81+
modes: ['development', 'test']
82+
}
8383
})
8484
]
8585
});

0 commit comments

Comments
 (0)