GitXplorerGitXplorer
t

autobarrel

public
2 stars
0 forks
16 issues

Commits

List of commits on branch master.
Unverified
01c1b5b9725b0fff0a598bbde10948f34443bf16

v1.2.0

ttgriesser committed 3 years ago
Unverified
af8404b2d17a8914e26de7ace2b558968c88d2c1

feat: fallback to tsconfig.json if autobarrel not present

ttgriesser committed 3 years ago
Unverified
e53425dabf891618ff6e9624885f7e221c985715

v1.1.0

ttgriesser committed 3 years ago
Unverified
09960a87910a6a9ee0206b4da965a16564feefc3

feat: add optional prefix

ttgriesser committed 3 years ago
Unverified
517969f25c881d02c5ee5e47a2fda8bd246cf307

chore: Fix snaphshots after newline change

ttgriesser committed 5 years ago
Unverified
2bfa8e97d38843bafaf56470f902a064826aff33

fix: prepublishOnly -> prepublish

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