Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split configs into their own presets (where possible) #4

Open
1 of 5 tasks
agilgur5 opened this issue Jun 14, 2022 · 0 comments
Open
1 of 5 tasks

Split configs into their own presets (where possible) #4

agilgur5 opened this issue Jun 14, 2022 · 0 comments
Labels
kind: internal Changes only affect the internal API scope: dependencies Issues or PRs about updating a dependency

Comments

@agilgur5
Copy link
Owner

agilgur5 commented Jun 14, 2022

Been meaning to do this for quite a while, so adding a TODO

  • tsconfig.json -- @agilgur5/tsconfig
  • rollup.config.js -- @agilgur5/rollup-config
    • There's no standard or convention for this in Rollup (see also [RFC] Shareable Plugins (for TSDX Build/Config, i.e. tsdx.config.js or Rollup in general) jaredpalmer/tsdx#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 (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 (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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: internal Changes only affect the internal API scope: dependencies Issues or PRs about updating a dependency
Projects
None yet
Development

No branches or pull requests

1 participant