the-simian / gulp-concat-filenames

A simple gulp plugin to take a list of files, and rather than concatenating their contents into a singular file, you concat their file names into a file, with, template, prefix and suffix options
MIT License
4 stars 5 forks source link

Thanks and please take this... #12

Closed svallory closed 8 years ago

svallory commented 8 years ago

Thank you for this plugin! I'm using it to generate index.ts files for every folder in my project. Here is something in return...

A typescript declaration file you can save as index.d.ts and add "typings": "index.d.ts". That way it will be easier for devs using TS to use your plugin :)

declare module "gulp-concat-filenames" {

  import { Duplex } from 'stream';

  interface IConcatFilenameOptions {
    // The character to use in place of '\n'' for a newline. The default value will be '\n'
    newline?: string;
    // Some text to prepend to every entry in the list of filenames
    prepend?: string;
    // Some text to append to every intry in the list of filenames
    append?: string;
    // A function that takes one parameter (the file name) and returns the string after some formatting. Can be used in addition to, or instead of, append and prepend
    template?: (filename: string) => string;
    // the root folder. Including this argument will return a list of relative paths instead of absolute paths.
    root?: string;
  }

  export default function concatFilenames(filename: string, options: IConcatFilenameOptions): Duplex;
}

EDIT: I just updated the declarations to something that actually works :)

the-simian commented 8 years ago

hello! you're welcome to open a pull request! actually, do that- and I'll pull it in, and I'll put it out in the next release as well. don't forget to add your name to the contributors :)

I'm so glad to hear this plugin has been useful for you! Thank you!

svallory commented 8 years ago

Sorry, just updated th decl again. Now it's a 100%. I would normally make a pull request, but I''m over my head with work and I'll probably forget :/ So I thought I should at least share it.

Anyways, I'll do it next to week if I have the time and remeber. Thanks again!

the-simian commented 8 years ago

Ok, that sounds fine. I don't mind waiting for you. I'll publish my new version with the null file fix that got submitted, and when you'd like you can submit a PR. If you don't mind either way I'll update it sometime when I can. Thanks again :)

the-simian commented 8 years ago

ref #13