agilgur5 / agilgur5/ts-library-base
Split configs into their own presets (where possible)
- Dominant language
- TypeScript
- Stars
- 2
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Been meaning to do this for quite a while, so adding a TODO
- [x] `tsconfig.json` -- [`@agilgur5/tsconfig`](https://github.com/agilgur5/tsconfig)
- [ ] `rollup.config.js` -- `@agilgur5/rollup-config`
- There's no standard or convention for this in Rollup (see also https://github.com/jaredpalmer/tsdx/issues/635), but I think I'll just split off a plain config into its own library. That can have all the Rollup plugins as deps so that way the new library only needs to install `rollup` and `@agilgur5/rollup-config`
- If the new library doesn't need to make any adjustments to the config, it could just directly use the config [from a package in `node_modules`](https://rollupjs.org/guide/en/#loading-a-configuration-from-a-node-package) (also, per that doc, `rollup-config-*` seems like the conventional prefix)
- If it does need to make adjustments, can do them in TS and `@agilgur5/rollup-config` can include rpt2 for use as a `configPlugin` for consumers even if it doesn't itself use it.
- Can have multiple configs in that "preset". Default might be ESM-only for LTS Node versions (so no need for multi-format bundles, just one ESM), then a ESM+CJS for libs that need backward-compat or aren't ready to make a breaking change to ESM-only, then a ESM+CJS+min UMD for universal ones with legacy compat (i.e. the same config that's currently here).
- [ ] `babel.config.js` -- `@agilgur5/babel-preset`
- This could also hold library and non-library/[app config](https://github.com/agilgur5/front-end-base) (default for libraries)
- [ ] `jest.config.js` -- `@agilgur5/jest-preset`
- I don't have that much Jest config right now, so this may not be worth at this time
- [ ] `eslint.config.js` -- `@agilgur5/eslint-config`
- I use [`ts-standard`](https://github.com/standard/ts-standard) for now, but may want to add more rules etc on top (e.g. React ones) or add Prettier as well. Could also make my own CLI on top of `standard-engine` as it's relatively easy. Also could just install `ts-standard` for all the deps, but then run `eslint` directly on a config
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.