@vlr/ts-reexports

generates index.ts with reexports

package @vlr/bucket-gen was designed to replace this one
Last updated a year ago by vlr .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @vlr/ts-reexports 
SYNC missed versions from official npm registry.

ts-reexports

functionality

Searches recursively through folders in provided path, finds .ts and .tsx files with lines like "export interface" or "export const a = " etc. and produces index.ts in that folder containing following lines ``` export * from './file' ```

Mind the following

  1. Regex is very simple, so if these lines are found inside comments, files gets reexportes just the same. Do not comment out your code. Never. Regardless of.
  2. Inside string lines as well, so pay attention.
  3. If anything other than reexport is found in index.ts, including comments and empty semicolons, file is considered off-limits, i.e. user managed.

usage

create gulp task with code like this, and run it either manually or within gulp-watch
const gulp = require('gulp');
const generator = require('@vlr/ts-reexports')

const options = { lineFeed: '\r\n', quotes: '"', typesOnly: true };

gulp.task('generate-reexports', function (done) {
  generator.generateReexports('./src', options)
    .then(done);
});

lineFeed and quotes are symbols used in corresponding places of generated file, types only = false will work with all .ts and .tsx files in specified folder, recursively, types only = true will only work with .type.ts files This option is meant for the projects where all the interfaces, enums and types are created in files having that extra extension

Current Tags

  • 2.1.1                                ...           latest (a year ago)

7 Versions

  • 2.1.1 [deprecated]           ...           a year ago
  • 2.1.0 [deprecated]           ...           a year ago
  • 2.0.4 [deprecated]           ...           a year ago
  • 2.0.3 [deprecated]           ...           a year ago
  • 2.0.2 [deprecated]           ...           a year ago
  • 2.0.1 [deprecated]           ...           a year ago
  • 2.0.0 [deprecated]           ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 0
Dependencies (5)
Dev Dependencies (13)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |