alfa icon indicating copy to clipboard operation
alfa copied to clipboard

Modernize Typescript configuration

Open Jym77 opened this issue 8 months ago • 0 comments

Set up from 2017 doesn't work that well in modern development, see, e.g., Choosing compiler options. Alfa:

  • [x] Change TS module from commonjs to node16. This is the recommended setting for libraries. It will imply updating all internal imports to include extension.
  • [x] Add verbatimModuleSyntax to TS config.
  • [x] Change TS target to es2022. Features are supported by all browsers (except IE) since several versions ago.
  • [x] Generate files in dist rather than src. Seems to be better practice now 🤔
  • [x] Switch JS generation from CJS to ESM. ESM is part of the language specification, so should be used instead.
  • [x] Clean up jsxImportSource.
  • [x] Clean up import {h}, import … from "…/native" and others using dist. Clean up package.json exporting dist entry points.
  • [x] setup correct exports in alfa-web (native)
  • [ ] ~Consider using correct imports from self-module rather than ../dist in tests.~
  • [ ] ~Clean up knip config ignoring a file in alfa-cascade, likely due to a dist setup?~
  • [x] Update knip?
  • [x] Update chalk

Alfa-integrations:

  • [x] Change TS module from commonjs to node16. This is the recommended setting for libraries. It will imply updating all internal imports to include extension.
  • [x] Add verbatimModuleSyntax to TS config.
  • [x] Change TS target to es2022. Features are supported by all browsers (except IE) since several versions ago.
  • [x] Generate files in dist rather than src. Seems to be better practice now 🤔
  • [x] Switch JS generation from CJS to ESM. ESM is part of the language specification, so should be used instead.
  • [x] Clean up jsxImportSource.
  • [x] Clean up import {h}, import … from "…/native" and others using dist. Clean up package.json exporting dist entry points.
  • [ ] ~Consider using correct imports from self-module rather than ../dist in tests.~
  • [x] Update knip? => we need to have alfa-cli generates its files in another directory, which actually just means moving them to src and generate in bin where they already are.
  • [x] Re-enable TS config validation in validate-structure.

Alfa-companion:

  • [x] Change TS module from commonjs to node16. This is the recommended setting for libraries. It will imply updating all internal imports to include extension.
  • [x] Add verbatimModuleSyntax to TS config.
  • [x] Change TS target to es2022. Features are supported by all browsers (except IE) since several versions ago.
  • [x] Generate files in dist rather than src. Seems to be better practice now 🤔
  • [x] Switch JS generation from CJS to ESM. ESM is part of the language specification, so should be used instead.
  • [x] Clean up jsxImportSource.
  • [x] Clean up import {h}, import … from "…/native" and others using dist. Clean up package.json exporting dist entry points.
  • [ ] ~Consider using correct imports from self-module rather than ../dist in tests.~
  • [x] Update knip?

Alfa-examples:

  • [ ] Change TS module from commonjs to node16. This is the recommended setting for libraries. It will imply updating all internal imports to include extension.
  • [ ] Add verbatimModuleSyntax to TS config.
  • [ ] Change TS target to es2022. Features are supported by all browsers (except IE) since several versions ago.
  • [ ] Switch JS generation from CJS to ESM. ESM is part of the language specification, so should be used instead.
  • [ ] Clean up jsxImportSource.
  • [ ] Clean up import {h}, import … from "…/native" and others using dist. Clean up package.json exporting dist entry points.
  • [ ] ~Consider using correct imports from self-module rather than ../dist in tests.~
  • [x] Update knip?

Alfa-act-r:

  • [x] Change TS module from commonjs to node16. This is the recommended setting for libraries. It will imply updating all internal imports to include extension.
  • [x] Add verbatimModuleSyntax to TS config.
  • [x] Change TS target to es2022. Features are supported by all browsers (except IE) since several versions ago.
  • [x] Switch JS generation from CJS to ESM. ESM is part of the language specification, so should be used instead.
  • [x] Clean up jsxImportSource.
  • [x] Clean up import {h}, import … from "…/native" and others using dist. Clean up package.json exporting dist entry points.
  • [x] Update knip?

Jym77 avatar Jun 10 '24 07:06 Jym77