Repository navigation
feat: support rc files - #1067
Conversation
| 'oclif.config.js', | ||
| 'oclif.config.ts', | ||
| 'oclif.config.mjs', | ||
| 'oclif.config.cjs', |
There was a problem hiding this comment.
Is there a good use-case to support so many filetypes here? I feel like just supporting .oclifrc.json would be plenty. Then we could get rid off the cosmicconfig package.
There was a problem hiding this comment.
js and ts files offer several benefits:
- comments
- dynamically set props
- use types
| debug(`found oclif config for ${path}: %O`, result) | ||
| return { | ||
| ...pjson, | ||
| oclif: result?.config ?? pjson.oclif ?? {}, |
There was a problem hiding this comment.
It doesn't look like we will ever return pjson.oclif here since it is returned above if it is found:
| const debug = makeDebug('read-pjson') | ||
|
|
||
| /** | ||
| * Read the package.json file from a given path and merge with the config found by cosmiconfig. |
There was a problem hiding this comment.
This is slightly misleading. It makes it sound like we are merging pjson.oclif config with with additional config discovered by cosmicconfig.
There was a problem hiding this comment.
Yeah I think "merge" as in, "put an oclif prop in the package.json"... I'll clarify it
|
In my initial attempt to use a stand-alone config file, i copied the entire |
QA NOTESQA looks good
|
* chore: bump major version * feat: slimmer ux (#1056) * chore: bump major version * feat: slimmer ux module * test: no fancy-tests * chore(release): 4.0.0-v4.0 [skip ci] * chore: code review * chore(release): 4.0.0-v4.1 [skip ci] * chore(release): 4.0.0-beta.1 [skip ci] * chore: remove duplicate dep * test: windows unit tests * test: windows unit tests --------- Co-authored-by: svc-cli-bot <Svc_cli_bot@salesforce.com> * chore(release): 4.0.0-beta.2 [skip ci] * feat: add customizable logger * feat: remove native error logger * fix: cache child loggers * chore(release): 4.0.0-beta.3 [skip ci] * chore(release): 4.0.0-beta.4 [skip ci] * feat: support rc files (#1067) * feat: support rc files * chore: code review * chore(release): 4.0.0-beta.5 [skip ci] * chore(release): 4.0.0-beta.6 [skip ci] * fix: revert ignoreDuplicates in warn * chore(release): 4.0.0-beta.7 [skip ci] * feat: improved types and top-level exports (#1076) * feat: improved PJSON type * feat: enable exactOptionalPropertyTypes * feat: theme can be object or file path * feat: support target and identifier for helpClass * chore: add jsdocs to Configuration type * fix: add back scope to pjson type * feat: top level exports * fix: simplify ux export * chore: cleanup * feat: export logger too * chore(release): 4.0.0-beta.8 [skip ci] * feat: remove baseFlags * test: use oclif/test v4 and improve test coverage * fix: clarify types * test: use default sinon sandbox * test: use new major of oclif/test * test: add interop test for core v3 * test: skip spinner test on windows * chore: code review * chore(release): 4.0.0-beta.9 [skip ci] * fix: restore baseFlags support (#1085) * chore(release): 4.0.0-beta.10 [skip ci] * fix: improve types and ProdOnlyCache * chore(release): 4.0.0-beta.11 [skip ci] * fix: update hook type * chore(release): 4.0.0-beta.12 [skip ci] * fix: allow empty ux.stdout * chore(release): 4.0.0-beta.13 [skip ci] * chore: add ux README * fix: check supports-color in colorize * chore(release): 4.0.0-beta.14 [skip ci] * feat: support tsx for runtime transpilation * chore(release): 4.0.0-beta.15 [skip ci] * chore(release): 4.0.0-beta.16 [skip ci] --------- Co-authored-by: svc-cli-bot <Svc_cli_bot@salesforce.com> Co-authored-by: Steve Hetzel <shetzel@salesforce.com> Co-authored-by: Willie Ruemmele <willieruemmele@gmail.com>
Use cosmiconfig to support rc files, which will allow consumers to use an rc file to configure oclif instead of using the package.json.
Important to note that oclif will still be dependent on the package.json to get the
name,version, anddependenciesThe following files are supported:
@W-15470586@