Skip to content

Commit 11eedbe

Browse files
committed
Deprecate CLI parameters for configuration
1 parent 10cf691 commit 11eedbe

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

README.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,27 +60,32 @@ npm install
6060

6161
By default, STAC Browser will let you browse all catalogs on STAC Index.
6262

63-
To browse only your own static STAC catalog or STAC API, set the `catalogUrl` CLI parameter when running the dev server.
63+
To browse only your own static STAC catalog or STAC API, set the [`catalogUrl`](docs/options.md#catalogurl) config parameter when running the dev server.
6464
In this example we point to EarthSearch (`https://earth-search.aws.element84.com/v1/`):
6565

6666
```bash
67-
npm start -- --open --catalogUrl="https://earth-search.aws.element84.com/v1/"
67+
# Linux / MacOS
68+
SB_catalogUrl="https://earth-search.aws.element84.com/v1/" npm start
69+
# Windows (PowerShell)
70+
$env:SB_catalogUrl="https://earth-search.aws.element84.com/v1/"; npm start
6871
```
6972

73+
This will start the development server on <http://localhost:8080>, which you can then open in your preferred browser.
74+
7075
To open a local file on your system, see the chapter [Using Local Files](docs/local_files.md).
7176

7277
If you'd like to publish the STAC Browser instance use the following command:
7378

7479
```bash
75-
npm run build -- --catalogUrl="https://earth-search.aws.element84.com/v1/"
80+
# Linux / MacOS
81+
SB_catalogUrl="https://earth-search.aws.element84.com/v1/" npm run build
82+
# Windows (PowerShell)
83+
$env:SB_catalogUrl="https://earth-search.aws.element84.com/v1/"; npm run build
7684
```
7785

7886
This will only work on the root path of your domain though. If you'd like to publish in a sub-folder,
7987
you can use the [`pathPrefix`](docs/options.md#pathprefix) option.
8088

81-
> [!NOTE]
82-
> If you are using a recent version of node/npm on Windows, you may need to use `npm run build -- -- ...` instead of `npm run build -- ...`, see <https://github.com/npm/cli/issues/7375> for details.
83-
8489
After building, `dist/` will contain all assets necessary
8590
host the browser. These can be manually copied to your web host of choice.
8691
**Important:** If `historyMode` is set to `history` (which is the default value), you'll need to add

docs/options.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,17 @@ The following options can be provided in various ways to STAC Browser, either wh
66
The following ways to set config options are possible:
77

88
- Customize the **[config file](../config.js)** (recommended)
9-
- Additionally, some options can be [provided through the **root catalog**](../README.md#customize-through-root-catalog) for consistency across multiple deployments (recommended)
10-
- Append them to the **CLI** command as parameter (see [Get Started](../README.md#get-started) for an example)
9+
- Additionally, some options can be [provided through the **root catalog**](../README.md#customize-through-root-catalog) for consistency across multiple deployments
1110
- Set **environment variables**, all options need a `SB_` prefix.
1211
So you could for example set the catalog URL via the environment variable `SB_catalogUrl`.
1312
- Optionally, you can also set options after the build, basically **at "runtime"**.
1413
Enable this by removing the `<!--` and `-->` around the `<script defer="defer" src="./config.js"></script>` in the [`public/index.html`](../public/index.html).
1514
Then run the build procedure and after completion, you can fill the `dist/config.js` with any options that you want to customize.
1615

16+
> [!WARNING]
17+
> Appending configuration options as CLI parameters to the CLI command (e.g. `npm run build -- --catalogUrl="https://example.com"`) is DEPRECATED and will be removed in STAC Browser v5.
18+
> Reason is that such parameters are [not suppored by Vite](https://github.com/vitejs/vite/issues/7065), which will be used in v5 instead of vue-cli.
19+
1720
## Table of Contents <!-- omit in toc -->
1821

1922
- [Basic configuration](#basic-configuration)
@@ -129,19 +132,17 @@ This also excludes hosting your STAC catalog in the STAC Browser (sub-)folders.
129132
#### `hash`
130133

131134
If your host/server doesn't support URL rewriting or you experience other related problems, you can enable *hash mode*.
132-
Either set this option to `hash` in the config file or append `--historyMode=hash` when running or building.
135+
Either set this option to `hash` in the config file or as environment variable (`SB_historyMode`) when running or building.
133136
Known hosts that require hash mode are Amazon S3 and GitHub Pages.
134137

135138
### pathPrefix
136139

137140
***build-only option***
138141

139142
If you don't deploy the STAC Browser instance at the root path of your (sub) domain, then you need to set the path prefix
140-
when building (or running) STAC Browser.
143+
when building (or running) STAC Browser. Known hosts that require hash mode are Amazon S3 and GitHub Pages.
141144

142-
```bash
143-
npm run build -- --pathPrefix="/browser/"
144-
```
145+
Either set this option to the respective path (e.g. `/browser/`) in the config file or as environment variable (`SB_pathPrefix`) when running or building.
145146

146147
This will build STAC Browser in a way that it can be hosted at `https://example.com/browser` for example.
147148
Using this parameter for the dev server will make STAC Browser available at `http://localhost:8080/browser`.

0 commit comments

Comments
 (0)