noe reading correctly
This commit is contained in:
1
dist/index.d.ts
vendored
Normal file
1
dist/index.d.ts
vendored
Normal file
@ -0,0 +1 @@
|
||||
export * from './smartgulp.gulpapi';
|
7
dist/index.js
vendored
Normal file
7
dist/index.js
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
"use strict";
|
||||
function __export(m) {
|
||||
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
|
||||
}
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
__export(require("./smartgulp.gulpapi"));
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLHlDQUFtQyJ9
|
10
dist/smartgulp.classes.gulpstream.d.ts
vendored
Normal file
10
dist/smartgulp.classes.gulpstream.d.ts
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
/// <reference types="node" />
|
||||
import { Smartfile } from 'smartfile';
|
||||
import { Transform } from 'stream';
|
||||
export declare class GulpStream {
|
||||
stream: Transform;
|
||||
/**
|
||||
* allows you to pipe a SmartfileArray into the stream
|
||||
*/
|
||||
pipeSmartfileArray(smartfileArray: Smartfile[]): Promise<void>;
|
||||
}
|
43
dist/smartgulp.classes.gulpstream.js
vendored
Normal file
43
dist/smartgulp.classes.gulpstream.js
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
"use strict";
|
||||
// this file contains the code to generate and handle the stream
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const plugins = require("./smartgulp.plugins");
|
||||
const stream_1 = require("stream");
|
||||
class GulpStream {
|
||||
constructor() {
|
||||
this.stream = new stream_1.Transform({ objectMode: true });
|
||||
}
|
||||
/**
|
||||
* allows you to pipe a SmartfileArray into the stream
|
||||
*/
|
||||
pipeSmartfileArray(smartfileArray) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
// ensure what we get is an array
|
||||
if (!Array.isArray(smartfileArray)) {
|
||||
throw new Error('fileArg has unknown format');
|
||||
}
|
||||
for (let smartfile of smartfileArray) {
|
||||
let hasWritten = this.stream.push(smartfile);
|
||||
if (!hasWritten) {
|
||||
yield plugins.smartevent.once(this.stream, 'drain');
|
||||
}
|
||||
else {
|
||||
// iterate
|
||||
}
|
||||
}
|
||||
;
|
||||
// signal end of stream;
|
||||
this.stream.push(null);
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.GulpStream = GulpStream;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRndWxwLmNsYXNzZXMuZ3VscHN0cmVhbS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3NtYXJ0Z3VscC5jbGFzc2VzLmd1bHBzdHJlYW0udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLGdFQUFnRTs7Ozs7Ozs7OztBQUVoRSwrQ0FBOEM7QUFHOUMsbUNBQWtDO0FBRWxDO0lBQUE7UUFDRSxXQUFNLEdBQUcsSUFBSSxrQkFBUyxDQUFDLEVBQUUsVUFBVSxFQUFFLElBQUksRUFBRSxDQUFDLENBQUE7SUFzQjlDLENBQUM7SUFwQkM7O09BRUc7SUFDRyxrQkFBa0IsQ0FBQyxjQUEyQjs7WUFDbEQsaUNBQWlDO1lBQ2pDLEVBQUUsQ0FBQyxDQUFDLENBQUMsS0FBSyxDQUFDLE9BQU8sQ0FBQyxjQUFjLENBQUMsQ0FBQyxDQUFDLENBQUM7Z0JBQ25DLE1BQU0sSUFBSSxLQUFLLENBQUMsNEJBQTRCLENBQUMsQ0FBQTtZQUMvQyxDQUFDO1lBQ0QsR0FBRyxDQUFDLENBQUMsSUFBSSxTQUFTLElBQUksY0FBYyxDQUFDLENBQUMsQ0FBQztnQkFDckMsSUFBSSxVQUFVLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQyxJQUFJLENBQUMsU0FBUyxDQUFDLENBQUE7Z0JBQzVDLEVBQUUsQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQztvQkFDaEIsTUFBTSxPQUFPLENBQUMsVUFBVSxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsTUFBTSxFQUFFLE9BQU8sQ0FBQyxDQUFBO2dCQUNyRCxDQUFDO2dCQUFDLElBQUksQ0FBQyxDQUFDO29CQUNOLFVBQVU7Z0JBQ1osQ0FBQztZQUNILENBQUM7WUFBQSxDQUFDO1lBQ0Ysd0JBQXdCO1lBRXhCLElBQUksQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFBO1FBQ3hCLENBQUM7S0FBQTtDQUNGO0FBdkJELGdDQXVCQyJ9
|
4
dist/smartgulp.gulpapi.d.ts
vendored
Normal file
4
dist/smartgulp.gulpapi.d.ts
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
/// <reference types="node" />
|
||||
import { Transform } from 'stream';
|
||||
export declare let src: (minimatchPathArrayArg: string[]) => Transform;
|
||||
export declare let dest: () => void;
|
31
dist/smartgulp.gulpapi.js
vendored
Normal file
31
dist/smartgulp.gulpapi.js
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
"use strict";
|
||||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
||||
return new (P || (P = Promise))(function (resolve, reject) {
|
||||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
||||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
||||
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
|
||||
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
||||
});
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
// this file contains the implementation of the standard gulp api
|
||||
const plugins = require("./smartgulp.plugins");
|
||||
const smartgulp_classes_gulpstream_1 = require("./smartgulp.classes.gulpstream");
|
||||
exports.src = (minimatchPathArrayArg) => {
|
||||
let gulpStream = new smartgulp_classes_gulpstream_1.GulpStream();
|
||||
let handleFiles = () => __awaiter(this, void 0, void 0, function* () {
|
||||
let smartfileArray = [];
|
||||
for (let minimatchPath of minimatchPathArrayArg) {
|
||||
let localSmartfileArray = yield plugins.smartfile.fs.fileTreeToObject(process.cwd(), minimatchPath);
|
||||
smartfileArray = plugins.lodash.concat(smartfileArray, localSmartfileArray);
|
||||
}
|
||||
gulpStream.pipeSmartfileArray(smartfileArray);
|
||||
});
|
||||
handleFiles().catch(err => {
|
||||
console.log(err);
|
||||
});
|
||||
return gulpStream.stream;
|
||||
};
|
||||
exports.dest = () => {
|
||||
};
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRndWxwLmd1bHBhcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGd1bHAuZ3VscGFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsaUVBQWlFO0FBQ2pFLCtDQUE4QztBQUM5QyxpRkFBMkQ7QUFLaEQsUUFBQSxHQUFHLEdBQUcsQ0FBQyxxQkFBK0I7SUFDL0MsSUFBSSxVQUFVLEdBQUcsSUFBSSx5Q0FBVSxFQUFFLENBQUE7SUFDakMsSUFBSSxXQUFXLEdBQUc7UUFDaEIsSUFBSSxjQUFjLEdBQWdCLEVBQUUsQ0FBQTtRQUNwQyxHQUFHLENBQUMsQ0FBQyxJQUFJLGFBQWEsSUFBSSxxQkFBcUIsQ0FBQyxDQUFDLENBQUM7WUFDaEQsSUFBSSxtQkFBbUIsR0FBRyxNQUFNLE9BQU8sQ0FBQyxTQUFTLENBQUMsRUFBRSxDQUFDLGdCQUFnQixDQUFDLE9BQU8sQ0FBQyxHQUFHLEVBQUUsRUFBRSxhQUFhLENBQUMsQ0FBQTtZQUNuRyxjQUFjLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxNQUFNLENBQUMsY0FBYyxFQUFFLG1CQUFtQixDQUFDLENBQUE7UUFDN0UsQ0FBQztRQUNELFVBQVUsQ0FBQyxrQkFBa0IsQ0FBQyxjQUFjLENBQUMsQ0FBQTtJQUMvQyxDQUFDLENBQUEsQ0FBQTtJQUNELFdBQVcsRUFBRSxDQUFDLEtBQUssQ0FBQyxHQUFHO1FBQ3JCLE9BQU8sQ0FBQyxHQUFHLENBQUMsR0FBRyxDQUFDLENBQUE7SUFDbEIsQ0FBQyxDQUFDLENBQUE7SUFDRixNQUFNLENBQUMsVUFBVSxDQUFDLE1BQU0sQ0FBQTtBQUMxQixDQUFDLENBQUE7QUFFVSxRQUFBLElBQUksR0FBRztBQUVsQixDQUFDLENBQUEifQ==
|
5
dist/smartgulp.plugins.d.ts
vendored
Normal file
5
dist/smartgulp.plugins.d.ts
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
import * as smartevent from 'smartevent';
|
||||
import * as smartfile from 'smartfile';
|
||||
import * as smartstream from 'smartstream';
|
||||
import * as lodash from 'lodash';
|
||||
export { lodash, smartevent, smartfile, smartstream };
|
11
dist/smartgulp.plugins.js
vendored
Normal file
11
dist/smartgulp.plugins.js
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const smartevent = require("smartevent");
|
||||
exports.smartevent = smartevent;
|
||||
const smartfile = require("smartfile");
|
||||
exports.smartfile = smartfile;
|
||||
const smartstream = require("smartstream");
|
||||
exports.smartstream = smartstream;
|
||||
const lodash = require("lodash");
|
||||
exports.lodash = lodash;
|
||||
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic21hcnRndWxwLnBsdWdpbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9zbWFydGd1bHAucGx1Z2lucy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUFBLHlDQUF3QztBQU90QyxnQ0FBVTtBQU5aLHVDQUFzQztBQU9wQyw4QkFBUztBQU5YLDJDQUEwQztBQU94QyxrQ0FBVztBQU5iLGlDQUFnQztBQUc5Qix3QkFBTSJ9
|
Reference in New Issue
Block a user