Skip to content

Commit 95e727d

Browse files
committed
Merge branch 'feat/js-config' into feat/config-intellisense
2 parents e11973d + 3dfa8c7 commit 95e727d

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

packages/launchpad/README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ graph LR
3131
## Getting Started
3232

3333
1. Install launchpad: `npm i @bluecadet/launchpad`
34-
2. Create a `launchpad.json` config (see [configuration](#configuration))
34+
2. Create a `launchpad.config.js` config (see [configuration](#configuration))
3535
3. *Optional: [Bootstrap](/packages/scaffold) your PC with `npx launchpad scaffold`*
3636
4. Run `npx launchpad`
3737

@@ -43,10 +43,10 @@ Run `npx launchpad --help` to see all available commands.
4343

4444
## Configuration
4545

46-
Each [launchpad package](#packages) is configured via its own section in `launchpad.json`. Below is a simple example that uses the [`content`](/packages/content) package to download JSON and images from Flickr and [`monitor`](/packages/monitor) to launch a single app:
46+
Each [launchpad package](#packages) is configured via its own section in `launchpad.config.js`. Below is a simple example that uses the [`content`](/packages/content) package to download JSON and images from Flickr and [`monitor`](/packages/monitor) to launch a single app:
4747

48-
```json
49-
{
48+
```js
49+
export default {
5050
"content": {
5151
"sources": [
5252
{
@@ -91,7 +91,7 @@ All available config settings across packages can be found in the links below:
9191

9292
### Config Loading
9393

94-
- By default, Launchpad looks for `launchpad.json` or `config.json` at the cwd (where you ran `npx launchpad`/`launchpad` from)
94+
- By default, Launchpad looks for `launchpad.config.js`, `launchpad.config.mjs`, `launchpad.json` or `config.json` at the cwd (where you ran `npx launchpad`/`launchpad` from)
9595
- You can change the default path with `--config=<YOUR_FILE_PATH>` (e.g. `npx launchpad --config=../settings/my-config.json`)
9696
- If no config is found, Launchpad will traverse up directories (up to 64) to find one
9797
- All config values can be overridden via `--foo=bar` (e.g. `--logging.level=debug`)

packages/utils/lib/config-manager.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export class ConfigManager {
7171
// if no config is specified, search current and parent directories for default config files.
7272
// Only the first found config will be loaded.
7373
for (const defaultPath of DEFAULT_CONFIG_PATHS) {
74-
const resolved = ConfigManager._fileExistsRecursive(defaultPath);
74+
const resolved = ConfigManager._findFirstFileRecursive(defaultPath);
7575

7676
if (resolved) {
7777
console.warn(`Found config at '${chalk.white(resolved)}'`);
@@ -120,7 +120,7 @@ export class ConfigManager {
120120
* @returns {string | null} The absolute path to the file or null if it doesn't exist.
121121
* @private
122122
*/
123-
static _fileExistsRecursive(filePath) {
123+
static _findFirstFileRecursive(filePath) {
124124
const maxDepth = 64;
125125

126126
let absPath = filePath;

packages/utils/lib/launch-from-cli.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const launchFromCli = async (importMeta, {
5353
*/
5454
const configManager = new ConfigManager();
5555

56-
await configManager.loadConfig(userConfig, parsedArgv.config);
56+
await configManager.loadConfig({ ...userConfig, ...parsedArgv }, parsedArgv.config);
5757
/** @type {any} TODO: figure out where to add this 'logging' property */
5858
const config = configManager.getConfig();
5959
LogManager.getInstance(config.logging || config);

0 commit comments

Comments
 (0)