Skip to content

Typescript refactor, support for building more types of packages

Choose a tag to compare

@pastelsky pastelsky released this 17 Oct 12:54
· 126 commits to master since this release

Breaking

The getPackageStats function is now exported as a named export instead of a default export.

const getPackageStats = require('package-build-stats') // v6

const { getPackageStats } = require('package-build-stats') // v7

Features

  • We now ship with typescript declarations
  • Added support for compilation of vue packages — which used to fail earlier.
  • Added experimental support for compilation of svelte packages.
  • The package now exports error types as first-class exports.

Fixes

  • Building of packages that export a main file with a min.js extension, and ship with ES5+ features no longer fail to build.
  • Handled a few cases in code which could have caused uncaught exceptions for some packages (suggested errors during the typescript refactor)
  • Improved AST traversing for finding public exports of a module. We now reliably detect some more ways of detecting exports like —
// * re-exports
export * as new from './some-file'

// destructured array or object exports
export const [arr1,arr2, [nestedArr], {obj1, ...objRest}, assignedArr=3, ...restArr] = o

Performance

  • Upgraded to terser v5. Minification of source files now happens in an-async manner parallely, improving minification times significantly, especially for larger packages.

Internal

  • Package refactored to use typescript.
  • Upgraded most build dependencies (babels/loaders) to their latest available versions