GitXplorerGitXplorer
t

autobarrel

public
2 stars
0 forks
16 issues

Commits

List of commits on branch master.
Unverified
6bd0e951c29143971095c31d7116f81176300ce4

v1.0.1

ttgriesser committed 5 years ago
Unverified
885ca34ef67205c19a146b0fa8c4c67305adccbb

fix: remove typesync postinstall, unused deps

ttgriesser committed 5 years ago
Unverified
d7509e4bf5f96c87705d838b1c5d36c6ee965613

fix: newline at EOF

ttgriesser committed 5 years ago
Unverified
8d4cf74910e92c5bff5f69710534899956cb130e

Initial release 1.0

ttgriesser committed 5 years ago
Unverified
e17578f4b6e6f49adac8d1ba9951f58e2c68e77c

chore: a bit more test/config cleanup

ttgriesser committed 5 years ago
Unverified
57f8a75ffe45e457c914442ec047be736045f0ae

chore: Fix tests & unlink pathing

ttgriesser committed 5 years ago

README

The README file for this repository.

autobarrel

Simple tool for creating "barrel" files in TypeScript

Caveats:

  • Has not been tested on Windows
  • Only meant for TypeScript, as TS will check that there are no conflicting exports
  • Assumes you do not export default or have specific exports in the index. If you need this, exclude and re-export from another module
  • Does not actually check files for the presence of export in ts files
    • Possibly in future scope, PRs welcome. In the meantime use the paths / exclude / ignored options

CLI Usage:

autobarrel [--config path/to/autobarrel.json] [--watch]

autobarrel.json:

{
  /**
   * Relative glob patterns we want to process
   */
  paths: string[]
  /**
   * Relative glob patterns we want to ignore entirely
   */
  ignore?: string[]
  /**
   * Relative glob patterns of files / directories we want to avoid re-exporting
   */
  exclude?: string[]
}

Programmatic Usage:

import { autobarrel, resolveAutobarrelConfig } from "autobarrel"

//
await autobarrel(
  // Converts relative paths to absolute paths for consistency
  await resolveAutobarrelConfig({
    path: path.join(__dirname, "testing", "autobarrel.json"),
  })
)

License

MIT