rubicon

0.3.0 • Public • Published

Rubicon

Tool for merging typescript interfaces and generate PropTypes used for BEM projects.

Install

npm i -D rubicon

Commands

merge

rubicon merge --module=library-name

Options

  • target: Target for merging (default: library)
  • tech: Technology extension (default: d.ts)
  • output: Output path for declare file (default: /index.d.ts)
  • module: Module name for declare

Example

We have some interface placed on our file system:

// common.blocks/a/a.d.ts
interface AComponentProps {
  a: string
}
 
// common.blocks/a/_mod/a_mod.d.ts
interface AComponentProps {
  b: string
}
 
// common.blocks/b/b.d.ts
interface BComponentProps {
  a: string
  b: number
}

After merging:

declare module 'library-name' {
  interface AComponentProps {
    a: string
  }
 
  interface AComponentProps {
    b: string
  }
 
  interface BComponentProps {
    a: string
    b: number
  }
}

Readme

Keywords

Package Sidebar

Install

npm i rubicon

Weekly Downloads

7

Version

0.3.0

License

none

Unpacked Size

31.6 kB

Total Files

28

Last publish

Collaborators

  • yarastqt