Files
cli/src/utilities/getConfig.ts
Jacob Nguyen 20364fa20d feat: plugin, no prompt, bug fixes (#139)
* high hopes

* s

* plugin calling

* add

* eol

* more progress

* fmt

* step 1

* refactor out

* /internal route

* prg

* write handler

* consolidate

* fix version gen

* prototype

* out

* fix merge

* bundle presence and event modules

* extrapolate into plugin

* pluginify and simplify

* fix up typing gen for process env and watch mode

* watch

* add nonpromptable plugins install

* fix regression and clean up publish script

* ea
2024-07-27 10:45:53 -05:00

28 lines
669 B
TypeScript

import { findUp } from 'find-up';
import { readFile } from 'node:fs/promises';
import assert from 'node:assert';
export async function getConfig(): Promise<SernConfig> {
const sernLocation = await findUp('sern.config.json');
assert(sernLocation, "Can't find sern.config.json");
const output = JSON.parse(await readFile(sernLocation, 'utf8')) as SernConfig;
assert(output, "Can't read your sern.config.json.");
return output;
}
export interface SernConfig {
language: 'typescript' | 'javascript';
defaultPrefix?: string;
paths: {
base: string;
commands: string;
events?: string;
};
build?: {
}
}