Skip to content

fix: swc targets#104

Merged
patricklafrance merged 12 commits intomainfrom
fix/swc-targets
Aug 30, 2023
Merged

fix: swc targets#104
patricklafrance merged 12 commits intomainfrom
fix/swc-targets

Conversation

@patricklafrance
Copy link
Member

@patricklafrance patricklafrance commented Aug 29, 2023

Changes to packages

@workleap/swc-configs

  • The SWC targets were invalid because the shared Browserslist configuration from @workleap/browserslist-config contains an extends keyword which is not supported by browserslist-rs (see https://github.com/browserslist/browserslist-rs#limitations). The fix has been to introduce a browserslistToSwc utility function which call the JavaScript version of browserslist and convert the returned browser versions into valid SWC targets.
  • The jsc.target property has been removed in favor of providing env.targets (view the previous change)
  • defineDevConfig and defineBuildConfig, browsers option has been renamed to targets.

@workleap/typescript-configs

  • With TS 5.2, the module property must now be set to NodeNext when moduleResolution is set to NodeNext. To accomodate this breaking change the core.ts file module property value is now NodeNext. The decision has been made to not set moduleResolution to Bundler because that would result in the file extensions not being required anymore for import statements.
  • Added documentation to specify how to configure TS for non ESM projects

@workleap/eslint-plugin

  • The shared configurations are now targetting es2024 instead of es6.

Miscellaneous

  • The "Target Environment" documentation section of every tool has been normalized.

Chore changes

browserslist-config, eslint-plugin, stylelint-configs

  • "moduleResolution": "Node" has been added to the tsconfig.json file because using module: "CommonJS" when the moduleResolution is set to NodeNext is now invalid with TS 5.2.
  • Since "moduleResolution": "Node" is the equivalent of a Node 10 environment, and Node 10 doesn't support the exports field in the package.json file, the types field has been added to the package.json file.

browserslist-config, swc-configs, tsup-configs,

  • tsup 7.2 introduced a breaking change that now emits distinct declaration files for CJS and EMS. In response to that change, our projects supporting dual module systems had to update their package.json file to map a specific type declaration file per module system (index.d.ts for CommonJS and index.d.mts for ESM).

webpack-configs

  • Webpack 5.88.1 release introduced many changes to the type system that required changes on our side, mostly null check.

Release:

  • Minor bump for @workleap/eslint-plugin
  • Minor bump for @workleap/swc-configs
  • Patch bump for @workleap/typescript-configs

patricklafrance and others added 2 commits August 30, 2023 11:49
Co-authored-by: Alexandre Beaudoin <alexandre.beaudoin@gsoft.com>
Co-authored-by: Alexandre Beaudoin <alexandre.beaudoin@gsoft.com>
@patricklafrance patricklafrance merged commit b6ae7fb into main Aug 30, 2023
@patricklafrance patricklafrance deleted the fix/swc-targets branch August 30, 2023 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants