Skip to content

RFC: TypeScript + ESM/CJS Hybrid Modules with tshy #369

@lukekarrys

Description

@lukekarrys

What

tshy takes almost all the configuration out of publishing TypeScript + CJS/ESM Hybrid packages.

I propose the template-oss detect package.json#devDependencies.tshy and if it exists sets a bunch of configuration automatically. This is a non-exhaustive list of what I can think of right now:

  • Change lib/ directory to src/
  • Don't write package.json#files
  • Adds package.json#prepare: tshy
  • Use .cjs extension for commitlintrc and eslintrc
  • Change content to allow requiring or dynamic import of supplied context/index.js file
  • Adds typescript, @typescript-eslint/parser (and maybe other lint deps) as required devDependencies
  • Creates tsconfig.json (and merges it with any existing file similar to package.json now)
  • Fix issue with testing in lower bound of 16 and 18. Either polyfill is builtin OR always change lower bound to 16.17.0 and 18.6.0.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions