Skip to content

Convert indexer script into CLI package #67

@ArrayKnight

Description

@ArrayKnight

It would be nice to be able to use the indexer script in a slightly more generic manner which is targeted at JS/TS export collating.

My desired features:

  • Accept a config file (CLI flags remain an option)
  • Accept output file path
  • Accept an include glob / glob array for target files to import into output file
  • Input target files are relative to output file
  • Accept banner (in place of hardcoded header, but current value can be default)
  • Accept exclude glob / glob array. Yes, glob negation in includes would work. But this option is more targeted something that might be external or as a shared set of exclude between multiple configs
  • Add in a deduping function that renders // __private-exports unnecessary

Examples:

O: src/index.ts I: **/*.{ts,tsx}
O: src/index.ts I: **/index.{ts,tsx} (similar to current --barrel flag)
O: src/components/index.ts I: */index.ts
O: src/vanilla.ts I: **/*.css.ts, **/types.ts, ./types/*.ts, ./styles/*.ts, ./utils/css.ts
exclude: ['**/*.{spec,stories,test}.*']

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions