-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial commit. * Beta 1. * Updated README.md * Added process limit in cli. * 1.0.0
- Loading branch information
1 parent
170a3b9
commit 1e44a85
Showing
23 changed files
with
636 additions
and
733 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { OptionsDto } from "./options"; | ||
export interface Arguments { | ||
pattern: string; | ||
options: OptionsDto; | ||
uglifyProcessLimit: number; | ||
} | ||
declare const _default: Arguments; | ||
export default _default; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import { OptionsDto } from "./options"; | ||
export declare class GlobsUglifyJs { | ||
constructor(globPattern: string, options?: OptionsDto); | ||
private globOptions; | ||
private globPattern; | ||
private options; | ||
private filesList; | ||
private filesDetails; | ||
private uglified; | ||
GetFilesList(): Promise<string[]>; | ||
Uglify(processLimit?: number): Promise<void>; | ||
private handlerInfo; | ||
private handleStarter(processLimit); | ||
private tryToStartHandle(); | ||
private onFileHandled(); | ||
private startHandlingFile(index); | ||
private handleError(error); | ||
private removeSources(successFiles); | ||
private uglifyItem(file); | ||
private buildOutFilePath(filePath); | ||
private uglifyFile(file, options?); | ||
/** | ||
* Asynchronously return files list by pattern. | ||
* | ||
* @param {string} pattern | ||
* @param {glob.IOptions} [options={}] | ||
*/ | ||
private getGlobFilesList(pattern, options?); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export declare function Exists(path: string): Promise<boolean>; | ||
export declare function RemoveEmptyDirectories(directoryPath: string): Promise<void>; | ||
export declare function MakeTree(filePath: string): Promise<string>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,22 @@ | ||
#!/usr/bin/env node | ||
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 arguments_1 = require("./arguments"); | ||
const main_1 = require("./main"); | ||
new main_1.GlobsUglifyJs(arguments_1.default.pattern, arguments_1.default.options || {}); | ||
function CliStarter() { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
if (arguments_1.default.uglifyProcessLimit <= 0) { | ||
throw new Error("Uglify process limit must be at least 1."); | ||
} | ||
const globUglifier = new main_1.GlobsUglifyJs(arguments_1.default.pattern, arguments_1.default.options || {}); | ||
yield globUglifier.Uglify(arguments_1.default.uglifyProcessLimit); | ||
}); | ||
} | ||
CliStarter(); |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.