From d2a8f922f21f2ce41952076e1aef68362184a65f Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Tue, 15 Oct 2019 11:01:09 +0100 Subject: [PATCH 01/31] [ parseImports ]: Fixed the region comments and added more doc comments. --- modules/buildModules/parseImports.js | 39 ++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index fa4fe13..d888218 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -54,7 +54,7 @@ module.exports = ( Path, Callback ) => { ++lineNum; - // #endregion + // #endregion IMPORT FROM RELATIVE PATH OR DIRECTORY // #region IMPORT FROM node_modules @@ -84,7 +84,7 @@ module.exports = ( Path, Callback ) => { ++lineNum; - // #endregion + // #endregion IMPORT FROM node_modules // #region IMPORT FROM AN URL @@ -104,6 +104,7 @@ module.exports = ( Path, Callback ) => { } //#region FROM GITHUB + // // %import< { } //#endregion - //#endregion + //#endregion FROM GITHUB //#region FROM A SPECIFIC URL + } else { let url = Utils.cleanImportFileInput( treatedLine ); const fileName = Utils.getFileNameFromUrl( url ); @@ -234,9 +236,11 @@ module.exports = ( Path, Callback ) => { } ++lineNum; - //#endregion - // #endregion + //#endregion FROM A SPECIFIC URL + + // #endregion IMPORT FROM AN URL + } try { @@ -262,6 +266,14 @@ module.exports = ( Path, Callback ) => { } ); }; +// #region HELPER FUNCTIONS + +/** + * + * @param { string } treatedLine + * + * @returns { boolean } + */ const ____pathIsDir = ( treatedLine ) => { return treatedLine.startsWith( '< { treatedLine.startsWith( '< { if ( !____pathIsDir( treatedLine ) ) return false; @@ -294,6 +315,12 @@ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine return true; }; +/** + * + * @param { string } fileName The file name where the error occured. + * + * @returns { void } Logs the error to the console. + */ const ____nodeModulesCreationError = ( fileName ) => { return console.error( style.styledError, @@ -309,3 +336,5 @@ const killProcess = () => { process.kill( process.pid, 'SIGKILL' ); }, 5000 ); }; + +// #endregion HELPER FUNCTIONS From 4122800e77f64978a6db53a1ad52a346357a9ab0 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Tue, 15 Oct 2019 11:03:37 +0100 Subject: [PATCH 02/31] [ package.json ] - Fixed the description. - Added more npm scripts: - "update". - "install": To be sure that the user istalls MergerJS globally. --- package.json | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b3e22fb..1d06898 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "merger-js", "displayName": "MergerJS", "version": "3.8.4", - "description": "Yet another lightweight and simple cross-platform CLI build tool to bundle JavaScript files, with file imports, ES6+ minification, auto build capabilities, and native OS notifications.", + "description": "Yet another simple cross-platform CLI build tool to bundle JavaScript files, with a custom file import syntax, ES8+ minification, auto build capabilities, and native OS notifications.", "readme": "https://github.com/joao-neves95/merger-js/blob/master/README.md", "main": "merger.js", "bin": { @@ -15,8 +15,10 @@ "npm": ">=6.4.0" }, "scripts": { + "install": "npm install -g", "start": "merger init", - "test": "npm audit && node tests/test.js" + "test": "npm audit && node tests/test.js", + "update": "merger update" }, "author": { "name": "shivayl", From edaafe42b16b106fe1329cf04669d5c0f1c8b428 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Tue, 15 Oct 2019 17:43:20 +0100 Subject: [PATCH 03/31] Added the import type enum --- enums/importType.js | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 enums/importType.js diff --git a/enums/importType.js b/enums/importType.js new file mode 100644 index 0000000..18be2ab --- /dev/null +++ b/enums/importType.js @@ -0,0 +1,10 @@ + +const ImportType = Object.freeze( { + Unknown: -1, + RelativePath: 1, + NodeModules: 2, + URL: 3, + GitHub: 4 +} ); + +module.exports = ImportType; From 0ea1b5f426c7b06fafde4a2c06ffb8b0464a4930 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Tue, 15 Oct 2019 17:44:10 +0100 Subject: [PATCH 04/31] Added the parsed line model --- models/parsedLineModel.js | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 models/parsedLineModel.js diff --git a/models/parsedLineModel.js b/models/parsedLineModel.js new file mode 100644 index 0000000..5d5ce07 --- /dev/null +++ b/models/parsedLineModel.js @@ -0,0 +1,39 @@ +const ImportType = require( '../enums/importType' ); + +class ParsedLine { + + constructor() { + /** + * @type { boolean } + */ + this.isComment = null; + + /** + * @type { boolean } + */ + this.isDir = false; + + /** ImportType enum + * @type { number } ImportType enum + */ + this.importType = ImportType.Unknown; + + /** + * @type { boolean } + */ + this.forceInstall = false; + + /** + * @type { string | null } + */ + this.path = null; + + /** + * @type { string | null } + */ + this.branchName = null; + } + +} + +module.exports = ParsedLine; From c75d27396f11d571bdbffb1ed74c496e61ec6255 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Tue, 15 Oct 2019 17:46:18 +0100 Subject: [PATCH 05/31] Refactoring the imports parser [ IN PROGRESS ] --- .../buildModules/importParser/importParser.js | 113 +++++++++++ modules/buildModules/parseImports.js | 185 +++++++++++------- 2 files changed, 229 insertions(+), 69 deletions(-) create mode 100644 modules/buildModules/importParser/importParser.js diff --git a/modules/buildModules/importParser/importParser.js b/modules/buildModules/importParser/importParser.js new file mode 100644 index 0000000..1136134 --- /dev/null +++ b/modules/buildModules/importParser/importParser.js @@ -0,0 +1,113 @@ +const ParsedLine = require( '../../../models/parsedLineModel' ); +const ImportType = require( '../../../enums/importType' ); + +class ImportParser { + + constructor() { + throw new Error( 'Can not intantiate a static class' ); + } + + /** + * + * @param { string } line + * + * @return { ParsedLine } + */ + static parseLine( line ) { + const parsedLine = new ParsedLine(); + parsedLine.isComment = line.trimStart().startsWith( '//' ); + + line = line.replace( /\s/g, '' ); + + if ( parsedLine.isComment ) { + return parsedLine; + } + + switch ( line ) { + + // #region IMPORT FROM RELATIVE PATH OR DIRECTORY + + case line.startsWith( '@import', 2 ) || line.startsWith( '@', 2 ): + parsedLine.importType = ImportType.RelativePath; + line = Utils.removeImportFromInput( line ); + parsedLine.isDir = ImportParser.__pathIsDir( line ); + break; + + // #endregion IMPORT FROM RELATIVE PATH OR DIRECTORY + + // #region IMPORT FROM node_modules + + case line.startsWith( '$import', 2 ) || line.startsWith( '$', 2 ): + parsedLine.importType = ImportType.NodeModules; + break; + + // #endregion IMPORT FROM node_modules + + case line.startsWith( '%import', 2 ) || line.startsWith( '%', 2 ) || line.startsWith( '%%', 2 ): + parsedLine.forceInstall = line.startsWith( '%%', 2 ); + line = Utils.removeImportFromInput( line ); + + // #region GITHUB SYNTAX DEFENITION COMMENTS + + // SINTAX: + // // %import< { rl.on( 'line', async ( line ) => { rl.pause(); - let thisFile; - let treatedLine = line.replace( /\s/g, '' ); + let thisFile = null; + /** + * @type { string } + */ + let directotyPath = null; + + const parsedLine = ImportParser.parseLine( line ); + + switch ( parsedLine.importType ) { + + case ImportType.RelativePath: + if ( parsedLine.isDir ) { + directotyPath = path; + + } else { + thisFile = Utils.cleanImportFileInput( treatedLine ); + } + + break; + + case ImportType.NodeModules: + + try { + const createdNodeModules = await Utils.createNodeModulesIfNeeded(); + if ( createdNodeModules ) { + NODE_MODULES_PATH = global.config.nodeModulesPath; + await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); + } + + // AN ENTIRE DIRECTORY. + if ( parsedLine.isDir ) { + directotyPath = NODE_MODULES_PATH; + + } else { + // A FILE. + thisFile = Utils.cleanImportFileInput( treatedLine ); + thisFile = path.join( NODE_MODULES_PATH, thisFile ); + } + + } catch ( e ) { + return ____nodeModulesCreationError( thisFile ); + } + + break; + + case ImportType.URL: + break; + + case ImportType.GitHub: + break; + + default: + break; + } + + if ( parsedLine.isDir ) { + await ____addAllDirectoryToBuildOrder( buildOrder, Path, treatedLine ); + } - lastLineWasComment = treatedLine.trimStart().startsWith( '//' ); + ++line; // #region IMPORT FROM RELATIVE PATH OR DIRECTORY - if ( treatedLine.startsWith( '@import', 2 ) || treatedLine.startsWith( '@', 2 ) ) { - treatedLine = Utils.removeImportFromInput( treatedLine ); + // if ( treatedLine.startsWith( '@import', 2 ) || treatedLine.startsWith( '@', 2 ) ) { + //treatedLine = Utils.removeImportFromInput( treatedLine ); // FROM A DIRECTORY. - const wasDir = await ____addAllDirectoryToBuildOrder( buildOrder, Path, treatedLine ); - if ( wasDir ) - thisFile = null; - else - // FROM A RELATIVE FILE PATH. - thisFile = Utils.cleanImportFileInput( treatedLine ); + //const wasDir = await ____addAllDirectoryToBuildOrder( buildOrder, Path, treatedLine ); + //if ( wasDir ) + // thisFile = null; + //else + // // FROM A RELATIVE FILE PATH. + // thisFile = Utils.cleanImportFileInput( treatedLine ); - ++lineNum; + //++lineNum; // #endregion IMPORT FROM RELATIVE PATH OR DIRECTORY // #region IMPORT FROM node_modules - } else if ( treatedLine.startsWith( '$import', 2 ) || treatedLine.startsWith( '$', 2 ) ) { - treatedLine = Utils.removeImportFromInput( treatedLine ); + //} else if ( treatedLine.startsWith( '$import', 2 ) || treatedLine.startsWith( '$', 2 ) ) { + //treatedLine = Utils.removeImportFromInput( treatedLine ); - try { - const createdNodeModules = await Utils.createNodeModulesIfNeeded(); - if ( createdNodeModules ) { - NODE_MODULES_PATH = global.config.nodeModulesPath; - await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); - } + //try { + // const createdNodeModules = await Utils.createNodeModulesIfNeeded(); + // if ( createdNodeModules ) { + // NODE_MODULES_PATH = global.config.nodeModulesPath; + // await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); + // } - // AN ENTIRE DIRECTORY. - const wasDir = await ____addAllDirectoryToBuildOrder( buildOrder, NODE_MODULES_PATH, treatedLine ); - if ( wasDir ) - thisFile = null; - else { - // A FILE. - thisFile = Utils.cleanImportFileInput( treatedLine ); - thisFile = path.join( NODE_MODULES_PATH, thisFile ); - } + // // AN ENTIRE DIRECTORY. + // const wasDir = await ____addAllDirectoryToBuildOrder( buildOrder, NODE_MODULES_PATH, treatedLine ); + // if ( wasDir ) + // thisFile = null; + // else { + // // A FILE. + // thisFile = Utils.cleanImportFileInput( treatedLine ); + // thisFile = path.join( NODE_MODULES_PATH, thisFile ); + // } - } catch ( e ) { - return ____nodeModulesCreationError( thisFile ); - } + //} catch ( e ) { + // return ____nodeModulesCreationError( thisFile ); + //} - ++lineNum; + //++lineNum; // #endregion IMPORT FROM node_modules // #region IMPORT FROM AN URL - } else if ( treatedLine.startsWith( '%import', 2 ) || treatedLine.startsWith( '%', 2 ) || treatedLine.startsWith( '%%', 2 ) ) { - const forceInstall = treatedLine.startsWith( '%%', 2 ); + // } else if ( treatedLine.startsWith( '%import', 2 ) || treatedLine.startsWith( '%', 2 ) || treatedLine.startsWith( '%%', 2 ) ) { + //const forceInstall = treatedLine.startsWith( '%%', 2 ); treatedLine = Utils.removeImportFromInput( treatedLine ); try { @@ -109,29 +167,30 @@ module.exports = ( Path, Callback ) => { // // %import< { /** * + * @param { string[] } buildOrder + * @param { string } thePath The path of the directory. * @param { string } treatedLine * - * @returns { boolean } - */ -const ____pathIsDir = ( treatedLine ) => { - return treatedLine.startsWith( '< { - if ( !____pathIsDir( treatedLine ) ) + // TODO: Refactor: mthe line is already treated. + if ( !ImportParser.__pathIsDir( treatedLine ) ) return false; treatedLine = Utils.removeDirTokenFromImport( treatedLine ); From d604a64a5b9bdf6a8608e9d54c341eb065673748 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Tue, 15 Oct 2019 21:25:58 +0100 Subject: [PATCH 06/31] Added lost enums --- models/configKeysEnum.js | 18 ++++++++++++++++++ models/promptResponseType.js | 14 ++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 models/configKeysEnum.js create mode 100644 models/promptResponseType.js diff --git a/models/configKeysEnum.js b/models/configKeysEnum.js new file mode 100644 index 0000000..f6a854a --- /dev/null +++ b/models/configKeysEnum.js @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const configKeys = Object.freeze( { + minify: 'uglify', + autoBuild: 'autoBuild', + notifs: 'notifications', + updateOnLaunch: 'updateOnLaunch', + lastUpdateCheck: 'lastUpdateCheck', + nodeModulesPath: 'nodeModulesPath' +} ); + +module.exports = configKeys; diff --git a/models/promptResponseType.js b/models/promptResponseType.js new file mode 100644 index 0000000..39be905 --- /dev/null +++ b/models/promptResponseType.js @@ -0,0 +1,14 @@ +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const promptResponseType = Object.freeze( { + Afirmative: 'Yes', + Negative: 'No' +} ); + +module.exports = promptResponseType; From 9725f14ae62deac05374b9c8e89a4c55382ab255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Tue, 15 Oct 2019 21:28:54 +0100 Subject: [PATCH 07/31] Changed the name of the ImportParser to ImportLineParser --- .../importParser.js => importLineParser.js} | 10 +++++----- modules/buildModules/parseImports.js | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) rename modules/buildModules/{importParser/importParser.js => importLineParser.js} (93%) diff --git a/modules/buildModules/importParser/importParser.js b/modules/buildModules/importLineParser.js similarity index 93% rename from modules/buildModules/importParser/importParser.js rename to modules/buildModules/importLineParser.js index 1136134..9c6ffb6 100644 --- a/modules/buildModules/importParser/importParser.js +++ b/modules/buildModules/importLineParser.js @@ -1,7 +1,7 @@ -const ParsedLine = require( '../../../models/parsedLineModel' ); -const ImportType = require( '../../../enums/importType' ); +const ParsedLine = require( '../../models/parsedLineModel' ); +const ImportType = require( '../../enums/importType' ); -class ImportParser { +class ImportLineParser { constructor() { throw new Error( 'Can not intantiate a static class' ); @@ -13,7 +13,7 @@ class ImportParser { * * @return { ParsedLine } */ - static parseLine( line ) { + static parse( line ) { const parsedLine = new ParsedLine(); parsedLine.isComment = line.trimStart().startsWith( '//' ); @@ -110,4 +110,4 @@ class ImportParser { } -module.exports = ImportParser; +module.exports = ImportLineParser; diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index 72b45e3..07431f8 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -11,7 +11,7 @@ const path = require('path'); const lineByLine = require( 'line-by-line' ); const fileDownloader = require( '../fileDownloader' ); const Utils = require( '../utils' ); -const ImportParser = require( './importParser/importParser' ); +const ImportLineParser = require( './importLineParser' ); const addPropertyToConfig = require( '../CLIModules/editConfigFile' ).addProperty; const ImportType = require( '../../enums/importType' ); const ConfigKeysType = require( '../../enums/configKeysEnum' ); @@ -42,7 +42,7 @@ module.exports = ( Path, Callback ) => { */ let directotyPath = null; - const parsedLine = ImportParser.parseLine( line ); + const parsedLine = ImportLineParser.parse( line ); switch ( parsedLine.importType ) { @@ -190,7 +190,7 @@ module.exports = ( Path, Callback ) => { // treatedLine = treatedLine.substring( branch.length ); //} - const isDir = ImportParser.__pathIsDir( treatedLine ); + const isDir = ImportLineParser.__pathIsDir( treatedLine ); treatedLine = Utils.removeDirTokenFromImport( treatedLine ); if ( treatedLine.startsWith( '::' ) ) @@ -338,7 +338,7 @@ module.exports = ( Path, Callback ) => { */ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine ) => { // TODO: Refactor: mthe line is already treated. - if ( !ImportParser.__pathIsDir( treatedLine ) ) + if ( !ImportLineParser.__pathIsDir( treatedLine ) ) return false; treatedLine = Utils.removeDirTokenFromImport( treatedLine ); From 57cbc5b8d8a6e2650e0d843572486d75d3b7af9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Tue, 15 Oct 2019 22:07:56 +0100 Subject: [PATCH 08/31] Refactoring the parseImports module [ IN PROGRESS ] --- enums/importType.js | 2 +- modules/buildModules/importLineParser.js | 16 +- modules/buildModules/parseImports.js | 180 +++++++---------------- 3 files changed, 70 insertions(+), 128 deletions(-) diff --git a/enums/importType.js b/enums/importType.js index 18be2ab..f2a8ba0 100644 --- a/enums/importType.js +++ b/enums/importType.js @@ -3,7 +3,7 @@ const ImportType = Object.freeze( { Unknown: -1, RelativePath: 1, NodeModules: 2, - URL: 3, + SpecificURL: 3, GitHub: 4 } ); diff --git a/modules/buildModules/importLineParser.js b/modules/buildModules/importLineParser.js index 9c6ffb6..bb95653 100644 --- a/modules/buildModules/importLineParser.js +++ b/modules/buildModules/importLineParser.js @@ -23,6 +23,7 @@ class ImportLineParser { return parsedLine; } + // TODO: Reduce code duplication. switch ( line ) { // #region IMPORT FROM RELATIVE PATH OR DIRECTORY @@ -39,10 +40,14 @@ class ImportLineParser { case line.startsWith( '$import', 2 ) || line.startsWith( '$', 2 ): parsedLine.importType = ImportType.NodeModules; + line = Utils.removeImportFromInput( line ); + parsedLine.isDir = ImportParser.__pathIsDir( line ); break; // #endregion IMPORT FROM node_modules + // #region IMPORT FROM AN URL + case line.startsWith( '%import', 2 ) || line.startsWith( '%', 2 ) || line.startsWith( '%%', 2 ): parsedLine.forceInstall = line.startsWith( '%%', 2 ); line = Utils.removeImportFromInput( line ); @@ -86,11 +91,14 @@ class ImportLineParser { } parsedLine.branchName = branchName; + parsedLine.isDir = ImportLineParser.__pathIsDir( line ); } else { - parsedLine.importType = ImportType.URL; + parsedLine.importType = ImportType.SpecificURL; } + // #ENDregion IMPORT FROM AN URL + break; default: @@ -99,6 +107,12 @@ class ImportLineParser { } + if ( parsedLine.isDir ) { + line = Utils.removeDirTokenFromImport( line ); + } + + parsedLine.path = Utils.cleanImportFileInput( line ); + } static __pathIsDir() { diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index 07431f8..5a2e290 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -34,54 +34,75 @@ module.exports = ( Path, Callback ) => { skipEmptyLines: true } ); + // TODO: Reduce code duplication. + // TODO: Changed the treatedLine logic. It is already treated in the ImportLineParser. rl.on( 'line', async ( line ) => { rl.pause(); let thisFile = null; - /** - * @type { string } - */ + /** @type { string } */ let directotyPath = null; const parsedLine = ImportLineParser.parse( line ); + switch ( parsedLine.importType ) { + case ImportType.NodeModules: + case ImportType.SpecificURL: + case ImportType.GitHub: + + try { + const createdNodeModules = await Utils.createNodeModulesIfNeeded(); + if ( createdNodeModules ) { + NODE_MODULES_PATH = global.config.nodeModulesPath; + await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); + } + + } catch ( e ) { + return ____nodeModulesCreationError( line ); + } + + break; + + default: + break; + } + switch ( parsedLine.importType ) { case ImportType.RelativePath: if ( parsedLine.isDir ) { directotyPath = path; - - } else { - thisFile = Utils.cleanImportFileInput( treatedLine ); } break; case ImportType.NodeModules: + // AN ENTIRE DIRECTORY. + if ( parsedLine.isDir ) { + directotyPath = NODE_MODULES_PATH; - try { - const createdNodeModules = await Utils.createNodeModulesIfNeeded(); - if ( createdNodeModules ) { - NODE_MODULES_PATH = global.config.nodeModulesPath; - await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); - } + } else { + // A FILE. + thisFile = path.join( NODE_MODULES_PATH, thisFile ); + } - // AN ENTIRE DIRECTORY. - if ( parsedLine.isDir ) { - directotyPath = NODE_MODULES_PATH; + break; - } else { - // A FILE. - thisFile = Utils.cleanImportFileInput( treatedLine ); - thisFile = path.join( NODE_MODULES_PATH, thisFile ); - } + case ImportType.SpecificURL: + const fileName = Utils.getFileNameFromUrl( parsedLine.path ); + let fileExists = true; + if ( !parsedLine.forceInstall ) + fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); - } catch ( e ) { - return ____nodeModulesCreationError( thisFile ); - } + if ( !fileExists || parsedLine.forceInstall ) { + try { + await fileDownloader.fromUrl( url ); - break; + } catch ( e ) { + console.error( style.styledError, `There was an error while downloading a file from url ("${url}")\n`, e ); + } + } - case ImportType.URL: + thisFile = path.join( NODE_MODULES_PATH, fileName ); break; case ImportType.GitHub: @@ -92,75 +113,16 @@ module.exports = ( Path, Callback ) => { } if ( parsedLine.isDir ) { - await ____addAllDirectoryToBuildOrder( buildOrder, Path, treatedLine ); + await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, treatedLine ); + + } else if ( file === null ) { + thisFile = Utils.cleanImportFileInput( treatedLine ); } ++line; - // #region IMPORT FROM RELATIVE PATH OR DIRECTORY - - // if ( treatedLine.startsWith( '@import', 2 ) || treatedLine.startsWith( '@', 2 ) ) { - //treatedLine = Utils.removeImportFromInput( treatedLine ); - - // FROM A DIRECTORY. - //const wasDir = await ____addAllDirectoryToBuildOrder( buildOrder, Path, treatedLine ); - //if ( wasDir ) - // thisFile = null; - //else - // // FROM A RELATIVE FILE PATH. - // thisFile = Utils.cleanImportFileInput( treatedLine ); - - //++lineNum; - - // #endregion IMPORT FROM RELATIVE PATH OR DIRECTORY - - // #region IMPORT FROM node_modules - - //} else if ( treatedLine.startsWith( '$import', 2 ) || treatedLine.startsWith( '$', 2 ) ) { - //treatedLine = Utils.removeImportFromInput( treatedLine ); - - //try { - // const createdNodeModules = await Utils.createNodeModulesIfNeeded(); - // if ( createdNodeModules ) { - // NODE_MODULES_PATH = global.config.nodeModulesPath; - // await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); - // } - - // // AN ENTIRE DIRECTORY. - // const wasDir = await ____addAllDirectoryToBuildOrder( buildOrder, NODE_MODULES_PATH, treatedLine ); - // if ( wasDir ) - // thisFile = null; - // else { - // // A FILE. - // thisFile = Utils.cleanImportFileInput( treatedLine ); - // thisFile = path.join( NODE_MODULES_PATH, thisFile ); - // } - - //} catch ( e ) { - // return ____nodeModulesCreationError( thisFile ); - //} - - //++lineNum; - - // #endregion IMPORT FROM node_modules - // #region IMPORT FROM AN URL - // } else if ( treatedLine.startsWith( '%import', 2 ) || treatedLine.startsWith( '%', 2 ) || treatedLine.startsWith( '%%', 2 ) ) { - //const forceInstall = treatedLine.startsWith( '%%', 2 ); - treatedLine = Utils.removeImportFromInput( treatedLine ); - - try { - const createdNodeModules = await Utils.createNodeModulesIfNeeded(); - if ( createdNodeModules ) { - NODE_MODULES_PATH = global.config.nodeModulesPath; - await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); - } - - } catch ( e ) { - return ____nodeModulesCreationError( line ); - } - //#region FROM GITHUB // // %import< { // treatedLine.startsWith( '< { //#region FROM A SPECIFIC URL - } else { - let url = Utils.cleanImportFileInput( treatedLine ); - const fileName = Utils.getFileNameFromUrl( url ); - let fileExists = true; - if ( !forceInstall ) - fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); - - if ( !fileExists || forceInstall ) { - try { - await fileDownloader.fromUrl( url ); - - } catch ( e ) { - console.error( style.styledError, `There was an error while downloading a file from url ("${url}")\n`, e ); - } - } - - thisFile = path.join( NODE_MODULES_PATH, fileName ); - } - - ++lineNum; - //#endregion FROM A SPECIFIC URL // #endregion IMPORT FROM AN URL From c9901febc00831af5642a1ccb72f9dc030c08836 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Wed, 16 Oct 2019 12:00:50 +0100 Subject: [PATCH 09/31] Refactoring the parseImports module [ IN PROGRESS ] --- models/parsedLineModel.js | 10 ++ modules/buildModules/importLineParser.js | 19 +-- modules/buildModules/parseImports.js | 201 +++++++---------------- 3 files changed, 79 insertions(+), 151 deletions(-) diff --git a/models/parsedLineModel.js b/models/parsedLineModel.js index 5d5ce07..b013a63 100644 --- a/models/parsedLineModel.js +++ b/models/parsedLineModel.js @@ -28,10 +28,20 @@ class ParsedLine { */ this.path = null; + /** + * @type { string | null } + */ + this.directory = null; + /** * @type { string | null } */ this.branchName = null; + + /** + * @type { boolean } + **/ + this.isGithubNewSyntax = false; } } diff --git a/modules/buildModules/importLineParser.js b/modules/buildModules/importLineParser.js index bb95653..82d1b46 100644 --- a/modules/buildModules/importLineParser.js +++ b/modules/buildModules/importLineParser.js @@ -1,4 +1,5 @@ -const ParsedLine = require( '../../models/parsedLineModel' ); +const path = require( 'path' ); +const ParsedLine = require( '../../models/parsedLineModel' ); const ImportType = require( '../../enums/importType' ); class ImportLineParser { @@ -67,37 +68,33 @@ class ImportLineParser { line.startsWith( '< { const parsedLine = ImportLineParser.parse( line ); - switch ( parsedLine.importType ) { + switch ( parsedLine.importType ) { case ImportType.NodeModules: case ImportType.SpecificURL: case ImportType.GitHub: @@ -58,54 +58,90 @@ module.exports = ( Path, Callback ) => { } catch ( e ) { return ____nodeModulesCreationError( line ); - } - - break; - - default: - break; + } + + break; + + default: + break; } switch ( parsedLine.importType ) { case ImportType.RelativePath: - if ( parsedLine.isDir ) { - directotyPath = path; - } - + directotyPath = path; break; case ImportType.NodeModules: - // AN ENTIRE DIRECTORY. - if ( parsedLine.isDir ) { - directotyPath = NODE_MODULES_PATH; - - } else { - // A FILE. - thisFile = path.join( NODE_MODULES_PATH, thisFile ); - } - + directotyPath = NODE_MODULES_PATH; break; case ImportType.SpecificURL: + directotyPath = NODE_MODULES_PATH; const fileName = Utils.getFileNameFromUrl( parsedLine.path ); let fileExists = true; - if ( !parsedLine.forceInstall ) + if ( !parsedLine.forceInstall ) { fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); + } if ( !fileExists || parsedLine.forceInstall ) { try { - await fileDownloader.fromUrl( url ); + fileName = await fileDownloader.fromUrl( parsedLine.path ); } catch ( e ) { console.error( style.styledError, `There was an error while downloading a file from url ("${url}")\n`, e ); } } - thisFile = path.join( NODE_MODULES_PATH, fileName ); break; case ImportType.GitHub: + const splitedPath = parsedLine.path.split( '/' ); + + /** + * The name of the folder where the file(s) will be stored on node_modules. + * @type { string } + */ + repoDirName = path.join( Utils.buildGithubRepoDirName( splitedPath[0], splitedPath[1] ) ); + directotyPath = path.join( NODE_MODULES_PATH, repoDirName ); + + if ( !parsedLine.isDir ) { + const fileName = path.basename( parsedLine.path ); + let alreadyDowloadedDeprecatedSyntax = false; + let alreadyDowloadedNewSyntax = false; + + if ( !parsedLine.forceInstall && parsedLine.isGithubNewSyntax ) { + alreadyDowloadedDeprecatedSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); + + // We need to check with the deprecated syntax, to avoid breaking changes. + } else if ( !parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) { + alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, repoDirName ) ); + } + + const pathToFile = splitedPath.slice( 2 ).join( '/' ); + + if ( ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) ) { + await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); + + // We need to use the deprecated method to avoid breaking changes. + } else if ( ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) ) { + await fileDownloader.fromGitHub_deprecated( parsedLine.path ); + } + + thisFile = parsedLine.isGithubNewSyntax ? path.join( directotyPath, pathToFile ) : + path.join( NODE_MODULES_PATH, fileName ); + + // For directories it is used exclusively the new syntax. + } else { + // TODO: Finish the GitHub directory downloads. + let alreadyDownloaded = false; + + if ( !parsedLine.forceInstall ) { + alreadyDownloaded = await Utils.dirExists( path.join( directotyPath, pathToFile ) ); + } + + } + break; default: @@ -113,123 +149,14 @@ module.exports = ( Path, Callback ) => { } if ( parsedLine.isDir ) { - await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, treatedLine ); + await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, parsedLine.path ); } else if ( file === null ) { - thisFile = Utils.cleanImportFileInput( treatedLine ); + thisFile = path.join( directotyPath, parsedLine.path ); } ++line; - // #region IMPORT FROM AN URL - - //#region FROM GITHUB - - // // %import< { * In case of exception, it kill the process and logs the error message. */ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine ) => { - // TODO: Refactor: mthe line is already treated. - if ( !ImportLineParser.__pathIsDir( treatedLine ) ) - return false; - - treatedLine = Utils.removeDirTokenFromImport( treatedLine ); - treatedLine = Utils.cleanImportFileInput( treatedLine ); // treatedLine now holds the directory inputed by the user. const thisDir = path.join( path.dirname( thePath ), treatedLine ); From 93030cc8d4c774de2ef567be9a0826af4990ac43 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Wed, 16 Oct 2019 12:02:36 +0100 Subject: [PATCH 10/31] [ fileDownloader ]: Removed unnecessary code from fromGitHub_deprecated --- modules/fileDownloader.js | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/modules/fileDownloader.js b/modules/fileDownloader.js index c216540..49e53fb 100644 --- a/modules/fileDownloader.js +++ b/modules/fileDownloader.js @@ -57,16 +57,11 @@ class FileDownloader { * @returns { Promise } * @deprecated */ - static fromGitHub_deprecated( path, branch, Callback ) { + static fromGitHub_deprecated( path, Callback ) { return new Promise( async ( resolve, reject ) => { - if ( path.startsWith( '/' ) ) + if ( path.startsWith( '/' ) ) { path = path.substring( 1 ); - - if ( branch !== '' ) { - path = path.split( '/' ); - path.splice( 2, 0, branch ); - path = path.join( '/' ); } let url = HOST_RAW_GITHUB + path; @@ -78,16 +73,19 @@ class FileDownloader { if ( fileContent.statusCode === 404 ) { path = path.split( '/' ); + // If the download was not successfull, try to add the master branch. path.splice( 2, 0, 'master' ); url = HOST_RAW_GITHUB + path.join( '/' ); try { fileContent = await httpClient.getAsync( url, false ); - if ( fileContent.statusCode === 404 ) + if ( fileContent.statusCode === 404 ) { FileDownloader.githubDownloadError( new URL( url ).pathname, 'The file was not found (404).' ); - else if ( fileContent.statusCode !== 200 ) + + } else if ( fileContent.statusCode !== 200 ) { FileDownloader.githubDownloadError( new URL( url ).pathname ); + } } catch ( e ) { FileDownloader.githubDownloadError( new URL( url ).pathname, e ); From a6f76452bcb8e5ab6631c5d275490aaa67d1dda4 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Wed, 16 Oct 2019 17:20:24 +0100 Subject: [PATCH 11/31] Refactoring the parseImports module [ IN PROGRESS ] --- models/parsedLineModel.js | 4 +- modules/buildModules/importLineParser.js | 114 ++++++++++++----------- modules/buildModules/parseImports.js | 101 +++++++++++++++----- modules/fileDownloader.js | 2 + 4 files changed, 139 insertions(+), 82 deletions(-) diff --git a/models/parsedLineModel.js b/models/parsedLineModel.js index b013a63..b3e6413 100644 --- a/models/parsedLineModel.js +++ b/models/parsedLineModel.js @@ -39,9 +39,9 @@ class ParsedLine { this.branchName = null; /** - * @type { boolean } + * @type { boolean | null } **/ - this.isGithubNewSyntax = false; + this.isGithubNewSyntax = null; } } diff --git a/modules/buildModules/importLineParser.js b/modules/buildModules/importLineParser.js index 82d1b46..ce837b1 100644 --- a/modules/buildModules/importLineParser.js +++ b/modules/buildModules/importLineParser.js @@ -1,4 +1,4 @@ -const path = require( 'path' ); +const Utils = require( '../utils' ); const ParsedLine = require( '../../models/parsedLineModel' ); const ImportType = require( '../../enums/importType' ); @@ -20,103 +20,105 @@ class ImportLineParser { line = line.replace( /\s/g, '' ); - if ( parsedLine.isComment ) { + if ( !parsedLine.isComment ) { return parsedLine; } // TODO: Reduce code duplication. - switch ( line ) { - // #region IMPORT FROM RELATIVE PATH OR DIRECTORY + // #region IMPORT FROM RELATIVE PATH OR DIRECTORY - case line.startsWith( '@import', 2 ) || line.startsWith( '@', 2 ): - parsedLine.importType = ImportType.RelativePath; - line = Utils.removeImportFromInput( line ); - parsedLine.isDir = ImportParser.__pathIsDir( line ); - break; + if ( line.startsWith( '@import', 2 ) || line.startsWith( '@', 2 ) ) { + parsedLine.importType = ImportType.RelativePath; + line = Utils.removeImportFromInput( line ); // #endregion IMPORT FROM RELATIVE PATH OR DIRECTORY // #region IMPORT FROM node_modules - case line.startsWith( '$import', 2 ) || line.startsWith( '$', 2 ): - parsedLine.importType = ImportType.NodeModules; - line = Utils.removeImportFromInput( line ); - parsedLine.isDir = ImportParser.__pathIsDir( line ); - break; + } else if ( line.startsWith( '$import', 2 ) || line.startsWith( '$', 2 ) ) { + parsedLine.importType = ImportType.NodeModules; + line = Utils.removeImportFromInput( line ); // #endregion IMPORT FROM node_modules // #region IMPORT FROM AN URL - case line.startsWith( '%import', 2 ) || line.startsWith( '%', 2 ) || line.startsWith( '%%', 2 ): - parsedLine.forceInstall = line.startsWith( '%%', 2 ); - line = Utils.removeImportFromInput( line ); + } else if ( line.startsWith( '%import', 2 ) || line.startsWith( '%', 2 ) || line.startsWith( '%%', 2 ) ) { + parsedLine.forceInstall = line.startsWith( '%%', 2 ); + line = Utils.removeImportFromInput( line ); - // #region GITHUB SYNTAX DEFENITION COMMENTS + // #region GITHUB SYNTAX DEFENITION COMMENTS - // SINTAX: - // // %import< { break; default: + ++line; + rl.resume(); break; } switch ( parsedLine.importType ) { case ImportType.RelativePath: - directotyPath = path; + directotyPath = Path; break; case ImportType.NodeModules: @@ -78,15 +80,15 @@ module.exports = ( Path, Callback ) => { case ImportType.SpecificURL: directotyPath = NODE_MODULES_PATH; - const fileName = Utils.getFileNameFromUrl( parsedLine.path ); + thisFile = Utils.getFileNameFromUrl( parsedLine.path ); let fileExists = true; if ( !parsedLine.forceInstall ) { - fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); + fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, thisFile ) ); } if ( !fileExists || parsedLine.forceInstall ) { try { - fileName = await fileDownloader.fromUrl( parsedLine.path ); + await fileDownloader.fromUrl( parsedLine.path ); } catch ( e ) { console.error( style.styledError, `There was an error while downloading a file from url ("${url}")\n`, e ); @@ -97,14 +99,17 @@ module.exports = ( Path, Callback ) => { case ImportType.GitHub: const splitedPath = parsedLine.path.split( '/' ); + const pathToFile = splitedPath.slice( 2 ).join( '/' ); /** * The name of the folder where the file(s) will be stored on node_modules. * @type { string } */ - repoDirName = path.join( Utils.buildGithubRepoDirName( splitedPath[0], splitedPath[1] ) ); + const repoDirName = path.join( Utils.buildGithubRepoDirName( splitedPath[0], splitedPath[1] ) ); directotyPath = path.join( NODE_MODULES_PATH, repoDirName ); + // #region GITHUB FILES + if ( !parsedLine.isDir ) { const fileName = path.basename( parsedLine.path ); let alreadyDowloadedDeprecatedSyntax = false; @@ -118,19 +123,30 @@ module.exports = ( Path, Callback ) => { alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, repoDirName ) ); } - const pathToFile = splitedPath.slice( 2 ).join( '/' ); - if ( ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) ) { + if ( + ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || + ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) + ) { await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); + // We need to use the deprecated method to avoid breaking changes. - } else if ( ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) ) { + } else if ( + ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || + ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) + ) { + console.log( 'parsedLine.path', parsedLine.path) await fileDownloader.fromGitHub_deprecated( parsedLine.path ); } thisFile = parsedLine.isGithubNewSyntax ? path.join( directotyPath, pathToFile ) : - path.join( NODE_MODULES_PATH, fileName ); + path.join( NODE_MODULES_PATH, fileName ); + // #endregion GITHUB FILES + + // #region GITHUB DIRECTORIES + // For directories it is used exclusively the new syntax. } else { // TODO: Finish the GitHub directory downloads. @@ -140,6 +156,34 @@ module.exports = ( Path, Callback ) => { alreadyDownloaded = await Utils.dirExists( path.join( directotyPath, pathToFile ) ); } + if ( !alreadyDownloaded || forceInstall ) { + const allFiles = await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); + buildOrder = buildOrder.concat( allFiles ); + + // This is to block adding any files to build order, + // bellow this switch. + parsedLine.isDir = false; + thisFile = ''; + + } else { + const allFilesFromRepoDir = await Utils.readDir( directotyPath ); + + for ( let i = 0; i < allFilesFromRepoDir.length; ++i ) { + if ( path.extname( allFilesFromRepoDir[i] ) !== '.js' ) { + continue; + } + + buildOrder.push( path.join( directotyPath, allFilesFromRepoDir[i] ) ); + } + + // This is to block adding any files to build order, + // bellow this switch. + parsedLine.isDir = false; + thisFile = ''; + } + + // #endregion GITHUB DIRECTORIES + } break; @@ -151,27 +195,32 @@ module.exports = ( Path, Callback ) => { if ( parsedLine.isDir ) { await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, parsedLine.path ); - } else if ( file === null ) { - thisFile = path.join( directotyPath, parsedLine.path ); - } - - ++line; - - try { - if ( path.extname( thisFile ) !== '.js' ) - thisFile += '.js'; + } else if ( thisFile === null || thisFile !== undefined ) { + console.log( 'directotyPath: ', directotyPath ); + console.log( 'parsedLine.path: ', parsedLine.path ); - if ( !buildOrder.includes( thisFile ) && thisFile !== undefined && thisFile !== null ) - buildOrder.push( path.normalize( thisFile ) ); + thisFile = path.join( directotyPath, parsedLine.path ); - } catch ( e ) { - // Invalid import statement. + try { + if ( path.extname( thisFile ) !== '.js' ) { + thisFile += '.js'; + } + + if ( !buildOrder.includes( thisFile ) ) { + buildOrder.push( path.normalize( thisFile ) ); + } + + } catch ( e ) { + // Invalid import statement. + } } + ++line; rl.resume(); - if ( lineNum >= 20 && !lastLineWasComment ) + if ( lineNum >= 20 && !lastLineWasComment ) { rl.close(); + } } ); @@ -204,7 +253,11 @@ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine } } catch ( e ) { - console.error( style.styledError, `There was an error while reading the file names from the directory: "${thisDir}". Probably it does not exist.\n\n`, e ); + console.error( + style.styledError, + `There was an error while reading the file names from the directory: "${thisDir}". Probably it does not exist.\n\n`, + e + ); killProcess(); } diff --git a/modules/fileDownloader.js b/modules/fileDownloader.js index 49e53fb..1b0ef5d 100644 --- a/modules/fileDownloader.js +++ b/modules/fileDownloader.js @@ -65,6 +65,8 @@ class FileDownloader { } let url = HOST_RAW_GITHUB + path; + console.log( 'path', path ); + console.log( 'url', url ); const fileName = Utils.getFileNameFromUrl( url ); let fileContent = null; From 4c4f2ff2ba5e9ea3e7bdd49e18dde9aa70296dd7 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Wed, 16 Oct 2019 17:21:35 +0100 Subject: [PATCH 12/31] [ package.json ]: Removed the "install" script --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 1d06898..8eee2bc 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,6 @@ "npm": ">=6.4.0" }, "scripts": { - "install": "npm install -g", "start": "merger init", "test": "npm audit && node tests/test.js", "update": "merger update" From 351931fba7a52d2dfdca023aefad2957491df0b7 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Thu, 17 Oct 2019 16:07:38 +0100 Subject: [PATCH 13/31] Refactoring the parseImports module [ IN PROGRESS ] --- modules/buildModules/parseImports.js | 156 +++++++++++++++------------ modules/fileDownloader.js | 3 +- modules/utils.js | 4 + tests/spec/parseImports_spec.js | 8 +- 4 files changed, 99 insertions(+), 72 deletions(-) diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index 46349eb..9a9668a 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -40,7 +40,7 @@ module.exports = ( Path, Callback ) => { rl.pause(); let thisFile = null; /** @type { string } */ - let directotyPath = null; + let directotyPath = ''; const parsedLine = ImportLineParser.parse( line ); @@ -51,6 +51,7 @@ module.exports = ( Path, Callback ) => { try { const createdNodeModules = await Utils.createNodeModulesIfNeeded(); + if ( createdNodeModules ) { NODE_MODULES_PATH = global.config.nodeModulesPath; await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); @@ -81,6 +82,9 @@ module.exports = ( Path, Callback ) => { case ImportType.SpecificURL: directotyPath = NODE_MODULES_PATH; thisFile = Utils.getFileNameFromUrl( parsedLine.path ); + + console.log( 'thisFile specific url:', thisFile ); + let fileExists = true; if ( !parsedLine.forceInstall ) { fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, thisFile ) ); @@ -111,77 +115,81 @@ module.exports = ( Path, Callback ) => { // #region GITHUB FILES if ( !parsedLine.isDir ) { - const fileName = path.basename( parsedLine.path ); + const fileName = path.basename( parsedLine.path ); let alreadyDowloadedDeprecatedSyntax = false; let alreadyDowloadedNewSyntax = false; - if ( !parsedLine.forceInstall && parsedLine.isGithubNewSyntax ) { - alreadyDowloadedDeprecatedSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); - - // We need to check with the deprecated syntax, to avoid breaking changes. - } else if ( !parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) { - alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, repoDirName ) ); - } - - - if ( - ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || - ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) - ) { - await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); - - - // We need to use the deprecated method to avoid breaking changes. - } else if ( - ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || - ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) - ) { - console.log( 'parsedLine.path', parsedLine.path) - await fileDownloader.fromGitHub_deprecated( parsedLine.path ); - } - - thisFile = parsedLine.isGithubNewSyntax ? path.join( directotyPath, pathToFile ) : - path.join( NODE_MODULES_PATH, fileName ); - + if ( !parsedLine.forceInstall && parsedLine.isGithubNewSyntax ) { + alreadyDowloadedDeprecatedSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); + + // We need to check with the deprecated syntax, to avoid breaking changes. + } else if ( !parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) { + alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, repoDirName ) ); + } + + if ( + ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || + ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) + ) { + await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); + + // We need to use the deprecated method to avoid breaking changes. + } else if ( + ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || + ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) + ) { + await fileDownloader.fromGitHub_deprecated( parsedLine.path ); + } + + console.log( 'github file directotyPath: ', directotyPath ); + + if ( parsedLine.isGithubNewSyntax ) { + parsedLine.path = pathToFile; + + } else { + directotyPath = NODE_MODULES_PATH; + parsedLine.path = fileName; + } + // #endregion GITHUB FILES // #region GITHUB DIRECTORIES - // For directories it is used exclusively the new syntax. + // For directories it is used exclusively the new syntax. } else { - // TODO: Finish the GitHub directory downloads. - let alreadyDownloaded = false; - - if ( !parsedLine.forceInstall ) { - alreadyDownloaded = await Utils.dirExists( path.join( directotyPath, pathToFile ) ); - } - - if ( !alreadyDownloaded || forceInstall ) { - const allFiles = await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); - buildOrder = buildOrder.concat( allFiles ); - - // This is to block adding any files to build order, - // bellow this switch. - parsedLine.isDir = false; - thisFile = ''; - - } else { - const allFilesFromRepoDir = await Utils.readDir( directotyPath ); - - for ( let i = 0; i < allFilesFromRepoDir.length; ++i ) { - if ( path.extname( allFilesFromRepoDir[i] ) !== '.js' ) { - continue; - } - - buildOrder.push( path.join( directotyPath, allFilesFromRepoDir[i] ) ); - } - - // This is to block adding any files to build order, - // bellow this switch. - parsedLine.isDir = false; - thisFile = ''; - } - + // TODO: Finish the GitHub directory downloads. + let alreadyDownloaded = false; + + if ( !parsedLine.forceInstall ) { + alreadyDownloaded = await Utils.dirExists( path.join( directotyPath, pathToFile ) ); + } + + if ( !alreadyDownloaded || forceInstall ) { + const allFiles = await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); + buildOrder = buildOrder.concat( allFiles ); + + // This is to block adding any files to build order, + // bellow this switch. + parsedLine.isDir = false; + thisFile = ''; + + } else { + const allFilesFromRepoDir = await Utils.readDir( directotyPath ); + + for ( let i = 0; i < allFilesFromRepoDir.length; ++i ) { + if ( path.extname( allFilesFromRepoDir[i] ) !== '.js' ) { + continue; + } + + buildOrder.push( path.join( directotyPath, allFilesFromRepoDir[i] ) ); + } + + // This is to block adding any files to build order, + // bellow this switch. + parsedLine.isDir = false; + thisFile = ''; + } + // #endregion GITHUB DIRECTORIES } @@ -195,7 +203,15 @@ module.exports = ( Path, Callback ) => { if ( parsedLine.isDir ) { await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, parsedLine.path ); - } else if ( thisFile === null || thisFile !== undefined ) { + } else if ( thisFile === null || thisFile === undefined ) { + + if ( parsedLine.importType === ImportType.RelativePath || parsedLine.importType === ImportType.GitHub ) { + directotyPath = ''; + + } else if ( parsedLine.importType === ImportType.SpecificURL ) { + parsedLine.path = thisFile; + } + console.log( 'directotyPath: ', directotyPath ); console.log( 'parsedLine.path: ', parsedLine.path ); @@ -205,11 +221,11 @@ module.exports = ( Path, Callback ) => { if ( path.extname( thisFile ) !== '.js' ) { thisFile += '.js'; } - + if ( !buildOrder.includes( thisFile ) ) { buildOrder.push( path.normalize( thisFile ) ); } - + } catch ( e ) { // Invalid import statement. } @@ -244,12 +260,16 @@ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine // treatedLine now holds the directory inputed by the user. const thisDir = path.join( path.dirname( thePath ), treatedLine ); + console.log( 'treatedLine', treatedLine ); + console.log( 'thisDir', thisDir ); + try { const files = await Utils.readDir( thisDir ); for ( let i = 0; i < files.length; ++i ) { - if ( path.extname( files[i] ) === '.js' ) + if ( path.extname( files[i] ) === '.js' ) { buildOrder.push( path.join( treatedLine, files[i] ) ); + } } } catch ( e ) { diff --git a/modules/fileDownloader.js b/modules/fileDownloader.js index 1b0ef5d..ae4901b 100644 --- a/modules/fileDownloader.js +++ b/modules/fileDownloader.js @@ -65,8 +65,6 @@ class FileDownloader { } let url = HOST_RAW_GITHUB + path; - console.log( 'path', path ); - console.log( 'url', url ); const fileName = Utils.getFileNameFromUrl( url ); let fileContent = null; @@ -157,6 +155,7 @@ class FileDownloader { currentFilePath = path_join( thisRepoDirName, jsonApiResponse[i].path ); currentFileContent = await httpClient.getAsync( jsonApiResponse[i].download_url ); + await Utils.saveFileInNodeModules( currentFilePath, currentFileContent.body ); currentFilePath = path_join( NODE_MODULES_PATH, currentFilePath ); allFilePaths.push( currentFilePath ); diff --git a/modules/utils.js b/modules/utils.js index 2d9b599..bb4901e 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -81,6 +81,10 @@ class Utils extends StaticClass { } ); } + static isNullOrEmptyStr( str ) { + return str === null || str === undefined || str === ''; + } + // Based on npm's strip-bom. /** * Remove unicode character FEFF (UTF-16 BOM) from a string block. diff --git a/tests/spec/parseImports_spec.js b/tests/spec/parseImports_spec.js index c5e2b51..c6abf0a 100644 --- a/tests/spec/parseImports_spec.js +++ b/tests/spec/parseImports_spec.js @@ -121,12 +121,16 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { let downloadSuccessful = false; let downloadFileError = null; + let currentLink = ''; try { for ( let i = 0; i < downloadedFilePaths.length; ++i ) { + currentLink = downloadedFilePaths[i]; downloadSuccessful = await fileExists( downloadedFilePaths[i] ); - if ( !downloadSuccessful ) break; + if ( !downloadSuccessful ) { + break; + } } } catch ( e ) { @@ -134,7 +138,7 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { downloadFileError = e; } - expect( downloadSuccessful ).toEqual( true, 'ParseImports > URL file import > Download file : FAILED, Error:\n' + downloadFileError ); + expect( downloadSuccessful ).toEqual( true, `ParseImports > URL file import > URL: ${currentLink} ; Download file : FAILED, Error:\n ${downloadFileError}` ); if ( downloadSuccessful ) { From e9e3c2a63366fa96a0db63ec5b3e6f8916cae8d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 15:25:52 +0100 Subject: [PATCH 14/31] [ enums/tokenType ]: Refactored the position and names --- enums/tokenType.js | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/enums/tokenType.js b/enums/tokenType.js index 5e5343a..7218790 100644 --- a/enums/tokenType.js +++ b/enums/tokenType.js @@ -5,21 +5,28 @@ class TokenType extends StaticClass { super( 'TokenType' ); } - static get token_push() { return '<<' } - static get token_DIR() { return `${TokenType.token_push}DIR` } - static get token_DIRECTORY() { return `${TokenType.token_push}DIRECTORY` } - static get token_dir() { return `${TokenType.token_push}dir` } - static get token_directory() { return `${TokenType.token_push}directory` } - static get token_GH() { return `${TokenType.token_push}GH` } - static get token_gh() { return `${TokenType.token_push}gh` } - static get token_github() { return `${TokenType.token_push}github` } - static get token_GITHUB() { return `${TokenType.token_push}GITHUB` } - static get token_importPath_simbol() { return "@" } - static get token_importPath() { return `${TokenType.token_importPath_simbol}import` } - static get token_importNodeModules_simbol() { return "$" } - static get token_importNodeModules() { return `${TokenType.token_importNodeModules_simbol}import` } - static get token_importUrl_simbol() { return "%" } - static get token_importUrl() { return `${TokenType.token_importUrl_simbol}import` } + static get importPath_simbol() { return '@'; } + static get importPath() { return `${TokenType.importPath_simbol}import`; } + + static get importNodeModules_simbol() { return '$'; } + static get importNodeModules() { return `${TokenType.importNodeModules_simbol}import`; } + + static get importUrl_simbol() { return '%'; } + static get doubleImportUrl_simbol() { return TokenType.importUrl_simbol + TokenType.importUrl_simbol; } + static get importUrl() { return `${TokenType.importUrl_simbol}import`; } + + static get push_symbol() { return '<<'; } + + static get push_DIR() { return `${TokenType.push_symbol}DIR`; } + static get push_DIRECTORY() { return `${TokenType.push_symbol}DIRECTORY`; } + static get push_dir() { return `${TokenType.push_symbol}dir`; } + static get push_directory() { return `${TokenType.push_symbol}directory`; } + + static get push_GH() { return `${TokenType.push_symbol}GH`; } + static get push_gh() { return `${TokenType.push_symbol}gh`; } + static get push_github() { return `${TokenType.push_symbol}github`; } + static get push_GITHUB() { return `${TokenType.push_symbol}GITHUB`; } + } module.exports = Object.freeze( TokenType ); From 14c3e91fbbd049a67f62f7513a5e57cbd4ed102c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 15:27:28 +0100 Subject: [PATCH 15/31] [ syntax tokens ]: Refactored position and names of the tokenType enum --- tests/data/mockImports.js | 12 ++++++------ tests/spec/parseImports_spec.js | 2 +- tests/spec/utils_spec.js | 20 ++++++++++---------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/tests/data/mockImports.js b/tests/data/mockImports.js index cf88236..547b63f 100644 --- a/tests/data/mockImports.js +++ b/tests/data/mockImports.js @@ -6,12 +6,12 @@ module.exports = class MockImports extends StaticClass { super( 'MockImports' ); } - static relative_DIR( path ) { return `// ${TokenType.token_importPath}${TokenType.token_DIR} '${path}'`; } - static relative_dir( path ) { return `// ${TokenType.token_importPath}${TokenType.token_dir} '${path}'`; } - static relative_DIRECTORY( path ) { return `// ${TokenType.token_importPath}${TokenType.token_DIRECTORY} '${path}'`; } - static relative_directory( path ) { return `// ${TokenType.token_importPath}${TokenType.token_directory} '${path}'`; } + static relative_DIR( path ) { return `// ${TokenType.importPath}${TokenType.push_DIR} '${path}'`; } + static relative_dir( path ) { return `// ${TokenType.importPath}${TokenType.push_dir} '${path}'`; } + static relative_DIRECTORY( path ) { return `// ${TokenType.importPath}${TokenType.push_DIRECTORY} '${path}'`; } + static relative_directory( path ) { return `// ${TokenType.importPath}${TokenType.push_directory} '${path}'`; } - static github_DIR( path ) { return `// ${TokenType.token_importUrl_simbol}${TokenType.token_github}${TokenType.token_DIR} '${path}'` } - static GH_dir( path ) { return `// ${TokenType.token_importUrl}${TokenType.token_GH}${TokenType.token_dir} '${path}'` } + static github_DIR( path ) { return `// ${TokenType.importUrl_simbol}${TokenType.push_github}${TokenType.push_DIR} '${path}'` } + static GH_dir( path ) { return `// ${TokenType.importUrl}${TokenType.push_GH}${TokenType.push_dir} '${path}'` } }; diff --git a/tests/spec/parseImports_spec.js b/tests/spec/parseImports_spec.js index c6abf0a..641ceb0 100644 --- a/tests/spec/parseImports_spec.js +++ b/tests/spec/parseImports_spec.js @@ -142,7 +142,7 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { if ( downloadSuccessful ) { - const ____validateFileAsync = ( downloadedFilePath) => { + const ____validateFileAsync = ( downloadedFilePath ) => { return new Promise( ( _res, _rej ) => { fs.readFile( downloadedFilePath, 'utf8', ( err, data ) => { if ( err ) diff --git a/tests/spec/utils_spec.js b/tests/spec/utils_spec.js index c4b5e67..2d6b9f0 100644 --- a/tests/spec/utils_spec.js +++ b/tests/spec/utils_spec.js @@ -12,22 +12,22 @@ describe( 'Utils', () => { } ); it( 'Should remove all "import" tokens types from the import input.', () => { - expect( Utils.removeImportFromInput( MockImports.relative_DIR( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.token_importPath ); - expect( Utils.removeImportFromInput( MockImports.github_DIR( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.token_importUrl_simbol ); - expect( Utils.removeImportFromInput( MockImports.GH_dir( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.token_importUrl ); + expect( Utils.removeImportFromInput( MockImports.relative_DIR( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.importPath ); + expect( Utils.removeImportFromInput( MockImports.github_DIR( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.importUrl_simbol ); + expect( Utils.removeImportFromInput( MockImports.GH_dir( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.importUrl ); } ); it( 'Should remove all GITHUB tokens from the import input.', () => { - expect( Utils.removeGithubTokenFromImport( MockImports.github_DIR( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.token_github ); - expect( Utils.removeGithubTokenFromImport( MockImports.GH_dir( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.token_GH ); + expect( Utils.removeGithubTokenFromImport( MockImports.github_DIR( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.push_symbol_github ); + expect( Utils.removeGithubTokenFromImport( MockImports.GH_dir( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.push_symbol_GH ); } ); it( 'Should remove all DIRECTORY tokens from the import input.', () => { - expect( Utils.removeDirTokenFromImport( MockImports.relative_dir( RANDOM_PATH_1 )) ).not.toContain( TokenType.token_dir ); - expect( Utils.removeDirTokenFromImport( MockImports.relative_DIR( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.token_DIR ); - expect( Utils.removeDirTokenFromImport( MockImports.github_DIR( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.token_DIR ); - expect( Utils.removeDirTokenFromImport( MockImports.relative_DIRECTORY( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.token_DIRECTORY ); - expect( Utils.removeDirTokenFromImport( MockImports.relative_directory( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.token_directory ); + expect( Utils.removeDirTokenFromImport( MockImports.relative_dir( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.push_symbol_dir ); + expect( Utils.removeDirTokenFromImport( MockImports.relative_DIR( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.push_symbol_DIR ); + expect( Utils.removeDirTokenFromImport( MockImports.github_DIR( RANDOM_LINK_1 ) ) ).not.toContain( TokenType.push_symbol_DIR ); + expect( Utils.removeDirTokenFromImport( MockImports.relative_DIRECTORY( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.push_symbol_DIRECTORY ); + expect( Utils.removeDirTokenFromImport( MockImports.relative_directory( RANDOM_PATH_1 ) ) ).not.toContain( TokenType.push_symbol_directory ); } ); it( 'Should read an entire directory.', async () => { From c48d931ff7b54877ff17d03f46e5b03e12cff917 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 15:28:04 +0100 Subject: [PATCH 16/31] Updated some comments and JSDocs --- modules/config.js | 2 +- modules/fileDownloader.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/config.js b/modules/config.js index 1df323a..f7b1d7c 100644 --- a/modules/config.js +++ b/modules/config.js @@ -52,7 +52,7 @@ module.exports = ( newConfig, Callback ) => { } } - // TODO: Remove on v4, along with all other methods of not adding breaking changes (if there is one). + // TODO: Remove on v4 (if there is one), along with all other methods of not adding breaking changes. // This was add in order to not add breaking changes. } else { // Set to true by default. diff --git a/modules/fileDownloader.js b/modules/fileDownloader.js index ae4901b..be6796f 100644 --- a/modules/fileDownloader.js +++ b/modules/fileDownloader.js @@ -119,6 +119,7 @@ class FileDownloader { // https://api.github.com/repos/{user}/{repoName}/contents{pathToFile}?ref={branch} /** * Downloads a file or directory of files from github and save it/them to node_modules. + * Returns all the files with a complete directory relative to node_modules. * * @param { string[] } buildOrder * @param { string } user From e11fc0308657df5de49bf26743c66fb98c7ccd5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 15:32:39 +0100 Subject: [PATCH 17/31] [ ImportLineParser ]: (Read commit description) - Fixed a bug on the GitHub syntax parser, where the isGithubNewSyntax property of the ParsedLine model was always being set to false (if/else). - Changed to TokenType instead of hardcoded strings. - Updated some comments and JSDocs. --- modules/buildModules/importLineParser.js | 36 ++++++++++++------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/modules/buildModules/importLineParser.js b/modules/buildModules/importLineParser.js index ce837b1..3f59993 100644 --- a/modules/buildModules/importLineParser.js +++ b/modules/buildModules/importLineParser.js @@ -1,6 +1,7 @@ const Utils = require( '../utils' ); -const ParsedLine = require( '../../models/parsedLineModel' ); +const TokenType = require( '../../enums/tokenType' ); const ImportType = require( '../../enums/importType' ); +const ParsedLine = require( '../../models/parsedLineModel' ); class ImportLineParser { @@ -24,11 +25,9 @@ class ImportLineParser { return parsedLine; } - // TODO: Reduce code duplication. - // #region IMPORT FROM RELATIVE PATH OR DIRECTORY - if ( line.startsWith( '@import', 2 ) || line.startsWith( '@', 2 ) ) { + if ( line.startsWith( TokenType.importPath, 2 ) || line.startsWith( TokenType.importPath_simbol, 2 ) ) { parsedLine.importType = ImportType.RelativePath; line = Utils.removeImportFromInput( line ); @@ -36,7 +35,7 @@ class ImportLineParser { // #region IMPORT FROM node_modules - } else if ( line.startsWith( '$import', 2 ) || line.startsWith( '$', 2 ) ) { + } else if ( line.startsWith( TokenType.importNodeModules, 2 ) || line.startsWith( TokenType.importNodeModules_simbol, 2 ) ) { parsedLine.importType = ImportType.NodeModules; line = Utils.removeImportFromInput( line ); @@ -44,8 +43,8 @@ class ImportLineParser { // #region IMPORT FROM AN URL - } else if ( line.startsWith( '%import', 2 ) || line.startsWith( '%', 2 ) || line.startsWith( '%%', 2 ) ) { - parsedLine.forceInstall = line.startsWith( '%%', 2 ); + } else if ( line.startsWith( TokenType.importUrl, 2 ) || line.startsWith( TokenType.importUrl_simbol, 2 ) || line.startsWith( TokenType.doubleImportUrl_simbol, 2 ) ) { + parsedLine.forceInstall = line.startsWith( TokenType.doubleImportUrl_simbol, 2 ); line = Utils.removeImportFromInput( line ); // #region GITHUB SYNTAX DEFENITION COMMENTS @@ -54,16 +53,16 @@ class ImportLineParser { // // %import< Date: Fri, 18 Oct 2019 15:37:35 +0100 Subject: [PATCH 18/31] [ parseImports ]: Finished the parseImports module refactoring --- modules/buildModules/parseImports.js | 42 ++++++++++------------------ 1 file changed, 15 insertions(+), 27 deletions(-) diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index 9a9668a..a8e582c 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -34,8 +34,6 @@ module.exports = ( Path, Callback ) => { skipEmptyLines: true } ); - // TODO: Reduce code duplication. - // TODO: Changed the treatedLine logic. It is already treated in the ImportLineParser. rl.on( 'line', async ( line ) => { rl.pause(); let thisFile = null; @@ -64,8 +62,6 @@ module.exports = ( Path, Callback ) => { break; default: - ++line; - rl.resume(); break; } @@ -81,13 +77,11 @@ module.exports = ( Path, Callback ) => { case ImportType.SpecificURL: directotyPath = NODE_MODULES_PATH; - thisFile = Utils.getFileNameFromUrl( parsedLine.path ); - - console.log( 'thisFile specific url:', thisFile ); + const fileName = Utils.getFileNameFromUrl( parsedLine.path ); let fileExists = true; if ( !parsedLine.forceInstall ) { - fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, thisFile ) ); + fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); } if ( !fileExists || parsedLine.forceInstall ) { @@ -99,6 +93,7 @@ module.exports = ( Path, Callback ) => { } } + parsedLine.path = fileName; break; case ImportType.GitHub: @@ -130,19 +125,19 @@ module.exports = ( Path, Callback ) => { if ( ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) - ) { + ) + { await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); // We need to use the deprecated method to avoid breaking changes. } else if ( ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) - ) { + ) + { await fileDownloader.fromGitHub_deprecated( parsedLine.path ); } - console.log( 'github file directotyPath: ', directotyPath ); - if ( parsedLine.isGithubNewSyntax ) { parsedLine.path = pathToFile; @@ -157,7 +152,6 @@ module.exports = ( Path, Callback ) => { // For directories it is used exclusively the new syntax. } else { - // TODO: Finish the GitHub directory downloads. let alreadyDownloaded = false; if ( !parsedLine.forceInstall ) { @@ -193,7 +187,6 @@ module.exports = ( Path, Callback ) => { // #endregion GITHUB DIRECTORIES } - break; default: @@ -203,18 +196,12 @@ module.exports = ( Path, Callback ) => { if ( parsedLine.isDir ) { await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, parsedLine.path ); - } else if ( thisFile === null || thisFile === undefined ) { + } else if ( thisFile === null ) { - if ( parsedLine.importType === ImportType.RelativePath || parsedLine.importType === ImportType.GitHub ) { + if ( parsedLine.importType === ImportType.RelativePath ) { directotyPath = ''; - - } else if ( parsedLine.importType === ImportType.SpecificURL ) { - parsedLine.path = thisFile; } - console.log( 'directotyPath: ', directotyPath ); - console.log( 'parsedLine.path: ', parsedLine.path ); - thisFile = path.join( directotyPath, parsedLine.path ); try { @@ -250,7 +237,7 @@ module.exports = ( Path, Callback ) => { /** * * @param { string[] } buildOrder - * @param { string } thePath The path of the directory. + * @param { string } thePath The path of the header file directory. * @param { string } treatedLine * * @return { boolean } Returns false in cae it's not a directory. @@ -260,9 +247,6 @@ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine // treatedLine now holds the directory inputed by the user. const thisDir = path.join( path.dirname( thePath ), treatedLine ); - console.log( 'treatedLine', treatedLine ); - console.log( 'thisDir', thisDir ); - try { const files = await Utils.readDir( thisDir ); @@ -278,7 +262,8 @@ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine `There was an error while reading the file names from the directory: "${thisDir}". Probably it does not exist.\n\n`, e ); - killProcess(); + + return killProcess(); } return true; @@ -303,7 +288,10 @@ const killProcess = () => { process.kill( process.pid, 'SIGINT' ); setTimeout( () => { process.kill( process.pid, 'SIGKILL' ); + return false; }, 5000 ); + + return false; }; // #endregion HELPER FUNCTIONS From c14df033c5ecc1da56bd3d03d14bf0a6128ef14f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 15:49:39 +0100 Subject: [PATCH 19/31] Update .gitignore --- .gitignore | 535 ++++++++++++++++++++++++++--------------------------- 1 file changed, 267 insertions(+), 268 deletions(-) diff --git a/.gitignore b/.gitignore index c20d627..ca750c8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,268 +1,267 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ - -# Visual Studio 2015 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUNIT -*.VisualState.xml -TestResult.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# DNX -project.lock.json -project.fragment.lock.json -artifacts/ - -*_i.c -*_p.c -*_i.h -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# JustCode is a .NET coding add-in -.JustCode - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# TODO: Comment the next line if you want to checkin your web deploy settings -# but database connection strings (with potential passwords) will be unencrypted -#*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# The packages folder can be ignored because of Package Restore -**/packages/* -# except build/, which is used as an MSBuild target. -!**/packages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/packages/repositories.config -# NuGet v3's project.json files produces more ignoreable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -node_modules/ -orleans.codegen.cs - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm - -# SQL Server files -*.mdf -*.ldf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# JetBrains Rider -.idea/ -*.sln.iml - -# CodeRush -.cr/ - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -*.sln -*.njsproj -node_modules/ -*.snyk -advisories.json -*.licenseheader +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. + +# User-specific files +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ + +# Visual Studio 2015 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUNIT +*.VisualState.xml +TestResult.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# DNX +project.lock.json +project.fragment.lock.json +artifacts/ + +*_i.c +*_p.c +*_i.h +*.ilk +*.meta +*.obj +*.pch +*.pdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# JustCode is a .NET coding add-in +.JustCode + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# TODO: Comment the next line if you want to checkin your web deploy settings +# but database connection strings (with potential passwords) will be unencrypted +#*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# The packages folder can be ignored because of Package Restore +**/packages/* +# except build/, which is used as an MSBuild target. +!**/packages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/packages/repositories.config +# NuGet v3's project.json files produces more ignoreable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +node_modules/ +orleans.codegen.cs + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm + +# SQL Server files +*.mdf +*.ldf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# JetBrains Rider +.idea/ +*.sln.iml + +# CodeRush +.cr/ + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +*.sln +*.njsproj +node_modules/ +*.snyk +advisories.json From 545f34f507640e60c21ad2ae0959e1e3afc259d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 15:50:58 +0100 Subject: [PATCH 20/31] Added the license header --- enums/importType.js | 10 +++++++++- enums/promptResponseType.js | 10 +++++++++- enums/tokenType.js | 10 +++++++++- merger-js.sln.licenseheader | 8 ++++++++ models/parsedLineModel.js | 10 +++++++++- models/staticClassBase.js | 10 +++++++++- modules/buildModules/importLineParser.js | 10 +++++++++- tests/spec/config_spec.js | 9 ++++++++- tests/spec/fileDownloader_spec.js | 9 ++++++++- tests/spec/httpClient_spec.js | 9 ++++++++- tests/spec/minifyCode_spec.js | 10 +++++++++- tests/spec/parseImports_spec.js | 8 ++++++++ tests/spec/utils_spec.js | 10 +++++++++- 13 files changed, 112 insertions(+), 11 deletions(-) create mode 100644 merger-js.sln.licenseheader diff --git a/enums/importType.js b/enums/importType.js index f2a8ba0..c23664e 100644 --- a/enums/importType.js +++ b/enums/importType.js @@ -1,4 +1,12 @@ - +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + + const ImportType = Object.freeze( { Unknown: -1, RelativePath: 1, diff --git a/enums/promptResponseType.js b/enums/promptResponseType.js index cafaf5a..18b530e 100644 --- a/enums/promptResponseType.js +++ b/enums/promptResponseType.js @@ -1,4 +1,12 @@ -const promptResponseType = Object.freeze( { +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const promptResponseType = Object.freeze( { Afirmative: 'Yes', Negative: 'No' } ); diff --git a/enums/tokenType.js b/enums/tokenType.js index 7218790..20f4593 100644 --- a/enums/tokenType.js +++ b/enums/tokenType.js @@ -1,4 +1,12 @@ -const StaticClass = require( '../models/staticClassBase' ); +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const StaticClass = require( '../models/staticClassBase' ); class TokenType extends StaticClass { constructor() { diff --git a/merger-js.sln.licenseheader b/merger-js.sln.licenseheader new file mode 100644 index 0000000..1c7df3b --- /dev/null +++ b/merger-js.sln.licenseheader @@ -0,0 +1,8 @@ +extensions: .js +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ diff --git a/models/parsedLineModel.js b/models/parsedLineModel.js index b3e6413..7d77ea8 100644 --- a/models/parsedLineModel.js +++ b/models/parsedLineModel.js @@ -1,4 +1,12 @@ -const ImportType = require( '../enums/importType' ); +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const ImportType = require( '../enums/importType' ); class ParsedLine { diff --git a/models/staticClassBase.js b/models/staticClassBase.js index 76f19cb..5c2976e 100644 --- a/models/staticClassBase.js +++ b/models/staticClassBase.js @@ -1,4 +1,12 @@ -module.exports = class StaticClass { +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +module.exports = class StaticClass { /** * Throws an Error when instantiated. * diff --git a/modules/buildModules/importLineParser.js b/modules/buildModules/importLineParser.js index 3f59993..53a8771 100644 --- a/modules/buildModules/importLineParser.js +++ b/modules/buildModules/importLineParser.js @@ -1,4 +1,12 @@ -const Utils = require( '../utils' ); +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const Utils = require( '../utils' ); const TokenType = require( '../../enums/tokenType' ); const ImportType = require( '../../enums/importType' ); const ParsedLine = require( '../../models/parsedLineModel' ); diff --git a/tests/spec/config_spec.js b/tests/spec/config_spec.js index 5f28270..236a224 100644 --- a/tests/spec/config_spec.js +++ b/tests/spec/config_spec.js @@ -1 +1,8 @@ - \ No newline at end of file +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + diff --git a/tests/spec/fileDownloader_spec.js b/tests/spec/fileDownloader_spec.js index 5f28270..236a224 100644 --- a/tests/spec/fileDownloader_spec.js +++ b/tests/spec/fileDownloader_spec.js @@ -1 +1,8 @@ - \ No newline at end of file +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + diff --git a/tests/spec/httpClient_spec.js b/tests/spec/httpClient_spec.js index 5f28270..236a224 100644 --- a/tests/spec/httpClient_spec.js +++ b/tests/spec/httpClient_spec.js @@ -1 +1,8 @@ - \ No newline at end of file +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + diff --git a/tests/spec/minifyCode_spec.js b/tests/spec/minifyCode_spec.js index cccab32..dde2137 100644 --- a/tests/spec/minifyCode_spec.js +++ b/tests/spec/minifyCode_spec.js @@ -1,4 +1,12 @@ -const minifyCode = require( '../../modules/buildModules/minifyCode' ); +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const minifyCode = require( '../../modules/buildModules/minifyCode' ); const UNMINIFIED_CODE = 'function f(a, b, x, y) { return a < b && x > y; }'; const MINIFIED_CODE = 'function f(n,f,r,t){return nt}'; diff --git a/tests/spec/parseImports_spec.js b/tests/spec/parseImports_spec.js index 641ceb0..f7410ae 100644 --- a/tests/spec/parseImports_spec.js +++ b/tests/spec/parseImports_spec.js @@ -1,3 +1,11 @@ +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + const path = require( 'path' ); const fs = require( 'fs' ); const parseImports = require( '../../modules/buildModules/parseImports' ); diff --git a/tests/spec/utils_spec.js b/tests/spec/utils_spec.js index 2d6b9f0..b727f7d 100644 --- a/tests/spec/utils_spec.js +++ b/tests/spec/utils_spec.js @@ -1,4 +1,12 @@ -const Utils = require( '../../modules/utils' ); +/* + * Copyright (c) 2018-2019 João Pedro Martins Neves - All Rights Reserved. + * + * MergerJS (merger-js) is licensed under the MIT license, located in + * the root of this project, under the name "LICENSE.md". + * + */ + +const Utils = require( '../../modules/utils' ); const TokenType = require( '../../enums/tokenType' ); const MockImports = require( '../data/mockImports' ); From 25b2dbe76637eeb6401a20af2e9fbe854833b7ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 16:21:56 +0100 Subject: [PATCH 21/31] [ parseImports ]: Solved bug with existing github directories building --- modules/buildModules/parseImports.js | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index a8e582c..dd8618f 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -139,11 +139,11 @@ module.exports = ( Path, Callback ) => { } if ( parsedLine.isGithubNewSyntax ) { - parsedLine.path = pathToFile; + parsedLine.path = pathToFile; } else { - directotyPath = NODE_MODULES_PATH; - parsedLine.path = fileName; + directotyPath = NODE_MODULES_PATH; + parsedLine.path = fileName; } // #endregion GITHUB FILES @@ -158,7 +158,7 @@ module.exports = ( Path, Callback ) => { alreadyDownloaded = await Utils.dirExists( path.join( directotyPath, pathToFile ) ); } - if ( !alreadyDownloaded || forceInstall ) { + if ( !alreadyDownloaded || parsedLine.forceInstall ) { const allFiles = await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); buildOrder = buildOrder.concat( allFiles ); @@ -168,14 +168,14 @@ module.exports = ( Path, Callback ) => { thisFile = ''; } else { - const allFilesFromRepoDir = await Utils.readDir( directotyPath ); + const allFilesFromRepoDir = await Utils.readDir( path.join( directotyPath, pathToFile ) ); for ( let i = 0; i < allFilesFromRepoDir.length; ++i ) { if ( path.extname( allFilesFromRepoDir[i] ) !== '.js' ) { continue; } - buildOrder.push( path.join( directotyPath, allFilesFromRepoDir[i] ) ); + buildOrder.push( path.join( directotyPath, pathToFile, allFilesFromRepoDir[i] ) ); } // This is to block adding any files to build order, @@ -190,16 +190,17 @@ module.exports = ( Path, Callback ) => { break; default: + parsedLine.path = null; break; } if ( parsedLine.isDir ) { await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, parsedLine.path ); - } else if ( thisFile === null ) { + } else if ( thisFile === null && parsedLine.path !== null ) { if ( parsedLine.importType === ImportType.RelativePath ) { - directotyPath = ''; + directotyPath = ''; } thisFile = path.join( directotyPath, parsedLine.path ); From af9112f7c91f003df879f53a9429aef4ae3414fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 23:10:57 +0100 Subject: [PATCH 22/31] [ parseImports ]: Fixed a bug (read description) Fixed bug where MergerJS was always downloading the file even if it was already downloaded, causing an infinite loop in the auto build mode. --- modules/buildModules/parseImports.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index dd8618f..672b418 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -115,11 +115,11 @@ module.exports = ( Path, Callback ) => { let alreadyDowloadedNewSyntax = false; if ( !parsedLine.forceInstall && parsedLine.isGithubNewSyntax ) { - alreadyDowloadedDeprecatedSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); + alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( directotyPath, pathToFile ) ); // We need to check with the deprecated syntax, to avoid breaking changes. } else if ( !parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) { - alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, repoDirName ) ); + alreadyDowloadedDeprecatedSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); } if ( From b87a731de90f007b79d2c1180fb99651622eb703 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Fri, 18 Oct 2019 23:13:16 +0100 Subject: [PATCH 23/31] [ packages ]: Bump Chokidar from v3.0.1 to v3.2.1 --- package-lock.json | 1583 +++++++++++++++++++++++++++++++++++++++++++-- package.json | 2 +- 2 files changed, 1526 insertions(+), 59 deletions(-) diff --git a/package-lock.json b/package-lock.json index 142bd3b..9f54a2e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,24 +26,119 @@ } }, "anymatch": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } } }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" + }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" + }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" + }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" + }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "binary-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", - "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==" + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" }, "brace-expansion": { "version": "1.1.11", @@ -56,11 +151,46 @@ } }, "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "requires": { - "fill-range": "^7.0.1" + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" } }, "chalk": { @@ -79,18 +209,43 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, "chokidar": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.2.1.tgz", - "integrity": "sha512-/j5PPkb5Feyps9e+jo07jUZGvkB5Aj953NrI4s8xSVScrAo/RHeILrtdb4uzR7N6aaFFxxJ+gt8mA8HfNpw76w==", + "version": "2.1.8", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", + "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.1.0", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.1.3" + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "fsevents": "^1.2.7", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + } + }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } } }, "cli-cursor": { @@ -106,6 +261,15 @@ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -124,12 +288,77 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "requires": { + "ms": "2.0.0" + } + }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" + }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -140,6 +369,57 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -150,6 +430,65 @@ "tmp": "^0.0.33" } }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "figures": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.0.0.tgz", @@ -159,11 +498,37 @@ } }, "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", "requires": { - "to-regex-range": "^5.0.1" + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" + }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "requires": { + "map-cache": "^0.2.2" } }, "fs.realpath": { @@ -173,10 +538,490 @@ "dev": true }, "fsevents": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.0.tgz", - "integrity": "sha512-+iXhW3LuDQsno8dOIrCIT/CBjeBWuP7PXe8w9shnj9Lebny/Gx1ZjVBYwexLz36Ri2jKuXMNpV6CYNh8lHHgrQ==", - "optional": true + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", + "optional": true, + "requires": { + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" + }, + "dependencies": { + "abbrev": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "optional": true + }, + "aproba": { + "version": "1.2.0", + "bundled": true, + "optional": true + }, + "are-we-there-yet": { + "version": "1.1.5", + "bundled": true, + "optional": true, + "requires": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "optional": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "chownr": { + "version": "1.1.1", + "bundled": true, + "optional": true + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "optional": true + }, + "console-control-strings": { + "version": "1.1.0", + "bundled": true, + "optional": true + }, + "core-util-is": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "optional": true, + "requires": { + "ms": "^2.1.1" + } + }, + "deep-extend": { + "version": "0.6.0", + "bundled": true, + "optional": true + }, + "delegates": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "detect-libc": { + "version": "1.0.3", + "bundled": true, + "optional": true + }, + "fs-minipass": { + "version": "1.2.5", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "gauge": { + "version": "2.7.4", + "bundled": true, + "optional": true, + "requires": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "optional": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "has-unicode": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "iconv-lite": { + "version": "0.4.24", + "bundled": true, + "optional": true, + "requires": { + "safer-buffer": ">= 2.1.2 < 3" + } + }, + "ignore-walk": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "minimatch": "^3.0.4" + } + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "optional": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "optional": true + }, + "ini": { + "version": "1.3.5", + "bundled": true, + "optional": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "optional": true, + "requires": { + "number-is-nan": "^1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "bundled": true, + "optional": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "optional": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "0.0.8", + "bundled": true, + "optional": true + }, + "minipass": { + "version": "2.3.5", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "minizlib": { + "version": "1.2.1", + "bundled": true, + "optional": true, + "requires": { + "minipass": "^2.2.1" + } + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "optional": true, + "requires": { + "minimist": "0.0.8" + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "optional": true + }, + "needle": { + "version": "2.3.0", + "bundled": true, + "optional": true, + "requires": { + "debug": "^4.1.0", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + } + }, + "node-pre-gyp": { + "version": "0.12.0", + "bundled": true, + "optional": true, + "requires": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.1", + "needle": "^2.2.1", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4" + } + }, + "nopt": { + "version": "4.0.1", + "bundled": true, + "optional": true, + "requires": { + "abbrev": "1", + "osenv": "^0.1.4" + } + }, + "npm-bundled": { + "version": "1.0.6", + "bundled": true, + "optional": true + }, + "npm-packlist": { + "version": "1.4.1", + "bundled": true, + "optional": true, + "requires": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1" + } + }, + "npmlog": { + "version": "4.1.2", + "bundled": true, + "optional": true, + "requires": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "object-assign": { + "version": "4.1.1", + "bundled": true, + "optional": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "optional": true, + "requires": { + "wrappy": "1" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "os-tmpdir": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "osenv": { + "version": "0.1.5", + "bundled": true, + "optional": true, + "requires": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "optional": true + }, + "process-nextick-args": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "rc": { + "version": "1.2.8", + "bundled": true, + "optional": true, + "requires": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "bundled": true, + "optional": true + } + } + }, + "readable-stream": { + "version": "2.3.6", + "bundled": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "optional": true, + "requires": { + "glob": "^7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "optional": true + }, + "safer-buffer": { + "version": "2.1.2", + "bundled": true, + "optional": true + }, + "sax": { + "version": "1.2.4", + "bundled": true, + "optional": true + }, + "semver": { + "version": "5.7.0", + "bundled": true, + "optional": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "optional": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "optional": true + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "optional": true, + "requires": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + } + }, + "string_decoder": { + "version": "1.1.1", + "bundled": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "optional": true, + "requires": { + "ansi-regex": "^2.0.0" + } + }, + "strip-json-comments": { + "version": "2.0.1", + "bundled": true, + "optional": true + }, + "tar": { + "version": "4.4.8", + "bundled": true, + "optional": true, + "requires": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.3.4", + "minizlib": "^1.1.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.2" + } + }, + "util-deprecate": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "wide-align": { + "version": "1.1.3", + "bundled": true, + "optional": true, + "requires": { + "string-width": "^1.0.2 || 2" + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "optional": true + }, + "yallist": { + "version": "3.0.3", + "bundled": true, + "optional": true + } + } + }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" }, "glob": { "version": "7.1.4", @@ -193,13 +1038,29 @@ } }, "glob-parent": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", - "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", "requires": { - "is-glob": "^4.0.1" + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "requires": { + "is-extglob": "^2.1.0" + } + } } }, + "graceful-fs": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", + "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" + }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -210,6 +1071,35 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -231,8 +1121,7 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "inquirer": { "version": "7.0.0", @@ -254,14 +1143,77 @@ "through": "^2.3.6" } }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", "requires": { - "binary-extensions": "^2.0.0" + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" + } } }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -281,25 +1233,61 @@ } }, "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "requires": { + "isobject": "^3.0.1" + } }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" + }, "is-wsl": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.1.1.tgz", "integrity": "sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==" }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" + }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" + }, "jasmine": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", @@ -321,6 +1309,11 @@ "resolved": "https://registry.npmjs.org/js.system.collections/-/js.system.collections-1.2.0.tgz", "integrity": "sha512-zg0ZE+1PZPEYylfgkUY8Qiqt2o94D99Ze/q7LjyYmUz6PAbkuiS1qQryOPgSnJbnaL89tspoTB6mhE/gEhf9yQ==" }, + "kind-of": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", + "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" + }, "line-by-line": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/line-by-line/-/line-by-line-0.1.6.tgz", @@ -331,6 +1324,39 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "requires": { + "object-visit": "^1.0.0" + } + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -345,11 +1371,59 @@ "brace-expansion": "^1.1.7" } }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, "mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, + "nan": { + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", + "optional": true + }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", @@ -372,6 +1446,50 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "requires": { + "isobject": "^3.0.0" + } + }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "requires": { + "isobject": "^3.0.1" + } + }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -394,25 +1512,84 @@ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, - "picomatch": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", - "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==" + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" + }, + "process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + }, + "readable-stream": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", + "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } }, "readdirp": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.3.tgz", - "integrity": "sha512-ZOsfTGkjO2kqeR5Mzr5RYDbTGYneSkdNKX2fOX2P5jF7vMrd/GNnIAUtDldeHHumHUCQ3V05YfWUdxMPAsRu9Q==", + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", "requires": { - "picomatch": "^2.0.4" + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" } }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" + }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" + }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -422,6 +1599,11 @@ "signal-exit": "^3.0.2" } }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" + }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", @@ -438,6 +1620,19 @@ "tslib": "^1.9.0" } }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "requires": { + "ret": "~0.1.10" + } + }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -448,6 +1643,27 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", @@ -458,6 +1674,152 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" + }, + "source-map-resolve": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", + "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", + "requires": { + "atob": "^2.1.1", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", + "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" + }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "requires": { + "extend-shallow": "^3.0.0" + } + }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "string-width": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", @@ -468,6 +1830,14 @@ "strip-ansi": "^5.2.0" } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "requires": { + "safe-buffer": "~5.1.0" + } + }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -497,12 +1867,42 @@ "os-tmpdir": "~1.0.2" } }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, "to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", "requires": { - "is-number": "^7.0.0" + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" } }, "tslib": { @@ -536,6 +1936,73 @@ } } }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" + } + } + }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==" + }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" + }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", diff --git a/package.json b/package.json index 8eee2bc..d0fb399 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "deprecated": false, "dependencies": { "chalk": "^2.4.2", - "chokidar": "^3.0.1", + "chokidar": "^3.2.1", "commander": "^3.0.2", "inquirer": "^7.0.0", "js.system.collections": "^1.0.0", From 5e0b90235ee1dc98340fe8d82bea5600bda3430b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Sun, 20 Oct 2019 15:08:45 +0100 Subject: [PATCH 24/31] [ package-lock.json ]: ( "npm install" ) --- package-lock.json | 1583 ++------------------------------------------- 1 file changed, 58 insertions(+), 1525 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9f54a2e..bdab859 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,119 +26,24 @@ } }, "anymatch": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", - "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", "requires": { - "micromatch": "^3.1.4", - "normalize-path": "^2.1.1" - }, - "dependencies": { - "normalize-path": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", - "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", - "requires": { - "remove-trailing-separator": "^1.0.1" - } - } + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" } }, - "arr-diff": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", - "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=" - }, - "arr-flatten": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", - "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==" - }, - "arr-union": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", - "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=" - }, - "array-unique": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", - "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" - }, - "assign-symbols": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", - "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=" - }, - "async-each": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", - "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" - }, - "atob": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", - "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==" - }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, - "base": { - "version": "0.11.2", - "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", - "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", - "requires": { - "cache-base": "^1.0.1", - "class-utils": "^0.3.5", - "component-emitter": "^1.2.1", - "define-property": "^1.0.0", - "isobject": "^3.0.1", - "mixin-deep": "^1.2.0", - "pascalcase": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "binary-extensions": { - "version": "1.13.1", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", - "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==" }, "brace-expansion": { "version": "1.1.11", @@ -151,46 +56,11 @@ } }, "braces": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", - "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", - "requires": { - "arr-flatten": "^1.1.0", - "array-unique": "^0.3.2", - "extend-shallow": "^2.0.1", - "fill-range": "^4.0.0", - "isobject": "^3.0.1", - "repeat-element": "^1.1.2", - "snapdragon": "^0.8.1", - "snapdragon-node": "^2.0.1", - "split-string": "^3.0.2", - "to-regex": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", - "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "requires": { - "collection-visit": "^1.0.0", - "component-emitter": "^1.2.1", - "get-value": "^2.0.6", - "has-value": "^1.0.0", - "isobject": "^3.0.1", - "set-value": "^2.0.0", - "to-object-path": "^0.3.0", - "union-value": "^1.0.0", - "unset-value": "^1.0.0" + "fill-range": "^7.0.1" } }, "chalk": { @@ -209,43 +79,18 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" }, "chokidar": { - "version": "2.1.8", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-2.1.8.tgz", - "integrity": "sha512-ZmZUazfOzf0Nve7duiCKD23PFSCs4JPoYyccjUFF3aQkQadqBhfzhjkwBH2mNOG9cTBwhamM37EIsIkZw3nRgg==", + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.2.2.tgz", + "integrity": "sha512-bw3pm7kZ2Wa6+jQWYP/c7bAZy3i4GwiIiMO2EeRjrE48l8vBqC/WvFhSF0xyM8fQiPEGvwMY/5bqDG7sSEOuhg==", "requires": { - "anymatch": "^2.0.0", - "async-each": "^1.0.1", - "braces": "^2.3.2", - "fsevents": "^1.2.7", - "glob-parent": "^3.1.0", - "inherits": "^2.0.3", - "is-binary-path": "^1.0.0", - "is-glob": "^4.0.0", - "normalize-path": "^3.0.0", - "path-is-absolute": "^1.0.0", - "readdirp": "^2.2.1", - "upath": "^1.1.1" - } - }, - "class-utils": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", - "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", - "requires": { - "arr-union": "^3.1.0", - "define-property": "^0.2.5", - "isobject": "^3.0.0", - "static-extend": "^0.1.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.1", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.2.0" } }, "cli-cursor": { @@ -261,15 +106,6 @@ "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=" }, - "collection-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", - "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", - "requires": { - "map-visit": "^1.0.0", - "object-visit": "^1.0.0" - } - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -288,77 +124,12 @@ "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" - }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, - "copy-descriptor": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", - "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=" - }, - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" - }, - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "decode-uri-component": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", - "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" - }, - "define-property": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", - "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", - "requires": { - "is-descriptor": "^1.0.2", - "isobject": "^3.0.1" - }, - "dependencies": { - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", @@ -369,57 +140,6 @@ "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" }, - "expand-brackets": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", - "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", - "requires": { - "debug": "^2.3.3", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "posix-character-classes": "^0.1.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "extend-shallow": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", - "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", - "requires": { - "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, "external-editor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", @@ -430,65 +150,6 @@ "tmp": "^0.0.33" } }, - "extglob": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", - "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", - "requires": { - "array-unique": "^0.3.2", - "define-property": "^1.0.0", - "expand-brackets": "^2.1.4", - "extend-shallow": "^2.0.1", - "fragment-cache": "^0.2.1", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, "figures": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.0.0.tgz", @@ -498,37 +159,11 @@ } }, "fill-range": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", - "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", - "requires": { - "extend-shallow": "^2.0.1", - "is-number": "^3.0.0", - "repeat-string": "^1.6.1", - "to-regex-range": "^2.1.0" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "for-in": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", - "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=" - }, - "fragment-cache": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", - "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "requires": { - "map-cache": "^0.2.2" + "to-regex-range": "^5.0.1" } }, "fs.realpath": { @@ -538,490 +173,10 @@ "dev": true }, "fsevents": { - "version": "1.2.9", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", - "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", - "optional": true, - "requires": { - "nan": "^2.12.1", - "node-pre-gyp": "^0.12.0" - }, - "dependencies": { - "abbrev": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "ansi-regex": { - "version": "2.1.1", - "bundled": true, - "optional": true - }, - "aproba": { - "version": "1.2.0", - "bundled": true, - "optional": true - }, - "are-we-there-yet": { - "version": "1.1.5", - "bundled": true, - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" - } - }, - "balanced-match": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "brace-expansion": { - "version": "1.1.11", - "bundled": true, - "optional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "chownr": { - "version": "1.1.1", - "bundled": true, - "optional": true - }, - "code-point-at": { - "version": "1.1.0", - "bundled": true, - "optional": true - }, - "concat-map": { - "version": "0.0.1", - "bundled": true, - "optional": true - }, - "console-control-strings": { - "version": "1.1.0", - "bundled": true, - "optional": true - }, - "core-util-is": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "debug": { - "version": "4.1.1", - "bundled": true, - "optional": true, - "requires": { - "ms": "^2.1.1" - } - }, - "deep-extend": { - "version": "0.6.0", - "bundled": true, - "optional": true - }, - "delegates": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "detect-libc": { - "version": "1.0.3", - "bundled": true, - "optional": true - }, - "fs-minipass": { - "version": "1.2.5", - "bundled": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "fs.realpath": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "bundled": true, - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } - }, - "glob": { - "version": "7.1.3", - "bundled": true, - "optional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "has-unicode": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "iconv-lite": { - "version": "0.4.24", - "bundled": true, - "optional": true, - "requires": { - "safer-buffer": ">= 2.1.2 < 3" - } - }, - "ignore-walk": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "minimatch": "^3.0.4" - } - }, - "inflight": { - "version": "1.0.6", - "bundled": true, - "optional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.3", - "bundled": true, - "optional": true - }, - "ini": { - "version": "1.3.5", - "bundled": true, - "optional": true - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "bundled": true, - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" - } - }, - "isarray": { - "version": "1.0.0", - "bundled": true, - "optional": true - }, - "minimatch": { - "version": "3.0.4", - "bundled": true, - "optional": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "0.0.8", - "bundled": true, - "optional": true - }, - "minipass": { - "version": "2.3.5", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "^5.1.2", - "yallist": "^3.0.0" - } - }, - "minizlib": { - "version": "1.2.1", - "bundled": true, - "optional": true, - "requires": { - "minipass": "^2.2.1" - } - }, - "mkdirp": { - "version": "0.5.1", - "bundled": true, - "optional": true, - "requires": { - "minimist": "0.0.8" - } - }, - "ms": { - "version": "2.1.1", - "bundled": true, - "optional": true - }, - "needle": { - "version": "2.3.0", - "bundled": true, - "optional": true, - "requires": { - "debug": "^4.1.0", - "iconv-lite": "^0.4.4", - "sax": "^1.2.4" - } - }, - "node-pre-gyp": { - "version": "0.12.0", - "bundled": true, - "optional": true, - "requires": { - "detect-libc": "^1.0.2", - "mkdirp": "^0.5.1", - "needle": "^2.2.1", - "nopt": "^4.0.1", - "npm-packlist": "^1.1.6", - "npmlog": "^4.0.2", - "rc": "^1.2.7", - "rimraf": "^2.6.1", - "semver": "^5.3.0", - "tar": "^4" - } - }, - "nopt": { - "version": "4.0.1", - "bundled": true, - "optional": true, - "requires": { - "abbrev": "1", - "osenv": "^0.1.4" - } - }, - "npm-bundled": { - "version": "1.0.6", - "bundled": true, - "optional": true - }, - "npm-packlist": { - "version": "1.4.1", - "bundled": true, - "optional": true, - "requires": { - "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" - } - }, - "npmlog": { - "version": "4.1.2", - "bundled": true, - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" - } - }, - "number-is-nan": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "bundled": true, - "optional": true - }, - "once": { - "version": "1.4.0", - "bundled": true, - "optional": true, - "requires": { - "wrappy": "1" - } - }, - "os-homedir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "os-tmpdir": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "osenv": { - "version": "0.1.5", - "bundled": true, - "optional": true, - "requires": { - "os-homedir": "^1.0.0", - "os-tmpdir": "^1.0.0" - } - }, - "path-is-absolute": { - "version": "1.0.1", - "bundled": true, - "optional": true - }, - "process-nextick-args": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "rc": { - "version": "1.2.8", - "bundled": true, - "optional": true, - "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "bundled": true, - "optional": true - } - } - }, - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "optional": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "rimraf": { - "version": "2.6.3", - "bundled": true, - "optional": true, - "requires": { - "glob": "^7.1.3" - } - }, - "safe-buffer": { - "version": "5.1.2", - "bundled": true, - "optional": true - }, - "safer-buffer": { - "version": "2.1.2", - "bundled": true, - "optional": true - }, - "sax": { - "version": "1.2.4", - "bundled": true, - "optional": true - }, - "semver": { - "version": "5.7.0", - "bundled": true, - "optional": true - }, - "set-blocking": { - "version": "2.0.0", - "bundled": true, - "optional": true - }, - "signal-exit": { - "version": "3.0.2", - "bundled": true, - "optional": true - }, - "string-width": { - "version": "1.0.2", - "bundled": true, - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, - "strip-ansi": { - "version": "3.0.1", - "bundled": true, - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" - } - }, - "strip-json-comments": { - "version": "2.0.1", - "bundled": true, - "optional": true - }, - "tar": { - "version": "4.4.8", - "bundled": true, - "optional": true, - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" - } - }, - "util-deprecate": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "wide-align": { - "version": "1.1.3", - "bundled": true, - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" - } - }, - "wrappy": { - "version": "1.0.2", - "bundled": true, - "optional": true - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "optional": true - } - } - }, - "get-value": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", - "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.1.tgz", + "integrity": "sha512-4FRPXWETxtigtJW/gxzEDsX1LVbPAM93VleB83kZB+ellqbHMkyt2aJfuzNLRvFPnGi6bcE5SvfxgbXPeKteJw==", + "optional": true }, "glob": { "version": "7.1.4", @@ -1038,29 +193,13 @@ } }, "glob-parent": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", - "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", "requires": { - "is-glob": "^3.1.0", - "path-dirname": "^1.0.0" - }, - "dependencies": { - "is-glob": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", - "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", - "requires": { - "is-extglob": "^2.1.0" - } - } + "is-glob": "^4.0.1" } }, - "graceful-fs": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.2.tgz", - "integrity": "sha512-IItsdsea19BoLC7ELy13q1iJFNmd7ofZH5+X/pJr90/nRoPEX0DJo1dHDbgtYWOhJhcCgMDTOw84RZ72q6lB+Q==" - }, "growly": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", @@ -1071,35 +210,6 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" }, - "has-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", - "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", - "requires": { - "get-value": "^2.0.6", - "has-values": "^1.0.0", - "isobject": "^3.0.0" - } - }, - "has-values": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", - "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", - "requires": { - "is-number": "^3.0.0", - "kind-of": "^4.0.0" - }, - "dependencies": { - "kind-of": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", - "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -1121,7 +231,8 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true }, "inquirer": { "version": "7.0.0", @@ -1143,77 +254,14 @@ "through": "^2.3.6" } }, - "is-accessor-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", - "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", - "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", - "requires": { - "binary-extensions": "^1.0.0" - } - }, - "is-buffer": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", - "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" - }, - "is-data-descriptor": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", - "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-descriptor": { - "version": "0.1.6", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", - "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "requires": { - "is-accessor-descriptor": "^0.1.6", - "is-data-descriptor": "^0.1.4", - "kind-of": "^5.0.0" - }, - "dependencies": { - "kind-of": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", - "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==" - } + "binary-extensions": "^2.0.0" } }, - "is-extendable": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", - "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=" - }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -1233,61 +281,25 @@ } }, "is-number": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", - "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "is-plain-object": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", - "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", - "requires": { - "isobject": "^3.0.1" - } + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=" }, - "is-windows": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==" - }, "is-wsl": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.1.1.tgz", "integrity": "sha512-umZHcSrwlDHo2TGMXv0DZ8dIUGunZ2Iv68YZnrmCiBPkZ4aaOhtv7pXJKeki9k3qJ3RJr0cDyitcl5wEH3AYog==" }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, "isexe": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, - "isobject": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", - "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=" - }, "jasmine": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/jasmine/-/jasmine-3.5.0.tgz", @@ -1309,11 +321,6 @@ "resolved": "https://registry.npmjs.org/js.system.collections/-/js.system.collections-1.2.0.tgz", "integrity": "sha512-zg0ZE+1PZPEYylfgkUY8Qiqt2o94D99Ze/q7LjyYmUz6PAbkuiS1qQryOPgSnJbnaL89tspoTB6mhE/gEhf9yQ==" }, - "kind-of": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.2.tgz", - "integrity": "sha512-s5kLOcnH0XqDO+FvuaLX8DDjZ18CGFk7VygH40QoKPUQhW4e2rvM0rwUq0t8IQDOwYSeLK01U90OjzBTme2QqA==" - }, "line-by-line": { "version": "0.1.6", "resolved": "https://registry.npmjs.org/line-by-line/-/line-by-line-0.1.6.tgz", @@ -1324,39 +331,6 @@ "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==" }, - "map-cache": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", - "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=" - }, - "map-visit": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", - "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", - "requires": { - "object-visit": "^1.0.0" - } - }, - "micromatch": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", - "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "braces": "^2.3.1", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "extglob": "^2.0.4", - "fragment-cache": "^0.2.1", - "kind-of": "^6.0.2", - "nanomatch": "^1.2.9", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.2" - } - }, "mimic-fn": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", @@ -1371,59 +345,11 @@ "brace-expansion": "^1.1.7" } }, - "mixin-deep": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", - "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", - "requires": { - "for-in": "^1.0.2", - "is-extendable": "^1.0.1" - }, - "dependencies": { - "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", - "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", - "requires": { - "is-plain-object": "^2.0.4" - } - } - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, "mute-stream": { "version": "0.0.8", "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, - "nan": { - "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", - "optional": true - }, - "nanomatch": { - "version": "1.2.13", - "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", - "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", - "requires": { - "arr-diff": "^4.0.0", - "array-unique": "^0.3.2", - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "fragment-cache": "^0.2.1", - "is-windows": "^1.0.2", - "kind-of": "^6.0.2", - "object.pick": "^1.3.0", - "regex-not": "^1.0.0", - "snapdragon": "^0.8.1", - "to-regex": "^3.0.1" - } - }, "neo-async": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", @@ -1446,50 +372,6 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, - "object-copy": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", - "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", - "requires": { - "copy-descriptor": "^0.1.0", - "define-property": "^0.2.5", - "kind-of": "^3.0.3" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", - "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", - "requires": { - "isobject": "^3.0.0" - } - }, - "object.pick": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", - "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", - "requires": { - "isobject": "^3.0.1" - } - }, "once": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", @@ -1512,84 +394,25 @@ "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" }, - "pascalcase": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", - "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=" - }, - "path-dirname": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", - "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=" - }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true }, - "posix-character-classes": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", - "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=" - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "readable-stream": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==" }, "readdirp": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", - "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", - "requires": { - "graceful-fs": "^4.1.11", - "micromatch": "^3.1.10", - "readable-stream": "^2.0.2" - } - }, - "regex-not": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", - "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.2.0.tgz", + "integrity": "sha512-crk4Qu3pmXwgxdSgGhgA/eXiJAPQiX4GMOZZMXnqKxHX7TaoL+3gQVo/WeuAiogr07DpnfjIMpXXa+PAIvwPGQ==", "requires": { - "extend-shallow": "^3.0.2", - "safe-regex": "^1.1.0" + "picomatch": "^2.0.4" } }, - "remove-trailing-separator": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", - "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=" - }, - "repeat-element": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", - "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==" - }, - "repeat-string": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", - "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=" - }, - "resolve-url": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", - "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=" - }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -1599,11 +422,6 @@ "signal-exit": "^3.0.2" } }, - "ret": { - "version": "0.1.15", - "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", - "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" - }, "run-async": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", @@ -1620,19 +438,6 @@ "tslib": "^1.9.0" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "safe-regex": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", - "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", - "requires": { - "ret": "~0.1.10" - } - }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", @@ -1643,27 +448,6 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==" }, - "set-value": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", - "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", - "requires": { - "extend-shallow": "^2.0.1", - "is-extendable": "^0.1.1", - "is-plain-object": "^2.0.3", - "split-string": "^3.0.1" - }, - "dependencies": { - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, "shellwords": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", @@ -1674,152 +458,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, - "snapdragon": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", - "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", - "requires": { - "base": "^0.11.1", - "debug": "^2.2.0", - "define-property": "^0.2.5", - "extend-shallow": "^2.0.1", - "map-cache": "^0.2.2", - "source-map": "^0.5.6", - "source-map-resolve": "^0.5.0", - "use": "^3.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - }, - "extend-shallow": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", - "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", - "requires": { - "is-extendable": "^0.1.0" - } - } - } - }, - "snapdragon-node": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", - "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", - "requires": { - "define-property": "^1.0.0", - "isobject": "^3.0.0", - "snapdragon-util": "^3.0.1" - }, - "dependencies": { - "define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", - "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", - "requires": { - "is-descriptor": "^1.0.0" - } - }, - "is-accessor-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", - "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-data-descriptor": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", - "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", - "requires": { - "kind-of": "^6.0.0" - } - }, - "is-descriptor": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", - "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", - "requires": { - "is-accessor-descriptor": "^1.0.0", - "is-data-descriptor": "^1.0.0", - "kind-of": "^6.0.2" - } - } - } - }, - "snapdragon-util": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", - "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", - "requires": { - "kind-of": "^3.2.0" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=" - }, - "source-map-resolve": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.2.tgz", - "integrity": "sha512-MjqsvNwyz1s0k81Goz/9vRBe9SZdB09Bdw+/zYyO+3CuPk6fouTaxscHkgtE8jKvf01kVfl8riHzERQ/kefaSA==", - "requires": { - "atob": "^2.1.1", - "decode-uri-component": "^0.2.0", - "resolve-url": "^0.2.1", - "source-map-url": "^0.4.0", - "urix": "^0.1.0" - } - }, - "source-map-url": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.0.tgz", - "integrity": "sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=" - }, - "split-string": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", - "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", - "requires": { - "extend-shallow": "^3.0.0" - } - }, - "static-extend": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", - "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", - "requires": { - "define-property": "^0.2.5", - "object-copy": "^0.1.0" - }, - "dependencies": { - "define-property": { - "version": "0.2.5", - "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", - "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", - "requires": { - "is-descriptor": "^0.1.0" - } - } - } - }, "string-width": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", @@ -1830,14 +468,6 @@ "strip-ansi": "^5.2.0" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", @@ -1867,42 +497,12 @@ "os-tmpdir": "~1.0.2" } }, - "to-object-path": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", - "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", - "requires": { - "kind-of": "^3.0.2" - }, - "dependencies": { - "kind-of": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", - "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", - "requires": { - "is-buffer": "^1.1.5" - } - } - } - }, - "to-regex": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", - "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", - "requires": { - "define-property": "^2.0.2", - "extend-shallow": "^3.0.2", - "regex-not": "^1.0.2", - "safe-regex": "^1.1.0" - } - }, "to-regex-range": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", - "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "requires": { - "is-number": "^3.0.0", - "repeat-string": "^1.6.1" + "is-number": "^7.0.0" } }, "tslib": { @@ -1936,73 +536,6 @@ } } }, - "union-value": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", - "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", - "requires": { - "arr-union": "^3.1.0", - "get-value": "^2.0.6", - "is-extendable": "^0.1.1", - "set-value": "^2.0.1" - } - }, - "unset-value": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", - "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", - "requires": { - "has-value": "^0.3.1", - "isobject": "^3.0.0" - }, - "dependencies": { - "has-value": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", - "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", - "requires": { - "get-value": "^2.0.3", - "has-values": "^0.1.4", - "isobject": "^2.0.0" - }, - "dependencies": { - "isobject": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", - "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", - "requires": { - "isarray": "1.0.0" - } - } - } - }, - "has-values": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", - "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=" - } - } - }, - "upath": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", - "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==" - }, - "urix": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", - "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=" - }, - "use": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", - "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==" - }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", From 8fdac47a5a5e916e152674d90de8eb848064a573 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Mon, 21 Oct 2019 12:45:57 +0100 Subject: [PATCH 25/31] [ parseImports.js ]: Now it also returns a Promise --- modules/buildModules/parseImports.js | 322 ++++++++++++++------------- 1 file changed, 165 insertions(+), 157 deletions(-) diff --git a/modules/buildModules/parseImports.js b/modules/buildModules/parseImports.js index 672b418..9400bae 100644 --- a/modules/buildModules/parseImports.js +++ b/modules/buildModules/parseImports.js @@ -21,215 +21,223 @@ const style = require( '../consoleStyling' ); * * @param { string } Path The path of the header file. * @param { Function } Callback ( buildOrder:string[] ) Receives the build order array of file paths inputed by the user. + * + * @returns { Promise } */ module.exports = ( Path, Callback ) => { - let NODE_MODULES_PATH = global.config.nodeModulesPath; - let lineNum = 0; - let lastLineWasComment = false; - let buildOrder = []; - buildOrder.push( path.basename( Path ) ); - - const rl = new lineByLine( Path, { - encoding: 'utf8', - skipEmptyLines: true - } ); - - rl.on( 'line', async ( line ) => { - rl.pause(); - let thisFile = null; - /** @type { string } */ - let directotyPath = ''; - - const parsedLine = ImportLineParser.parse( line ); + return new Promise( async ( _res, _rej ) => { + + let NODE_MODULES_PATH = global.config.nodeModulesPath; + let lineNum = 0; + let lastLineWasComment = false; + let buildOrder = []; + buildOrder.push( path.basename( Path ) ); + + const rl = new lineByLine( Path, { + encoding: 'utf8', + skipEmptyLines: true + } ); + + rl.on( 'line', async ( line ) => { + rl.pause(); + let thisFile = null; + /** @type { string } */ + let directotyPath = ''; + + const parsedLine = ImportLineParser.parse( line ); + + switch ( parsedLine.importType ) { + case ImportType.NodeModules: + case ImportType.SpecificURL: + case ImportType.GitHub: - switch ( parsedLine.importType ) { - case ImportType.NodeModules: - case ImportType.SpecificURL: - case ImportType.GitHub: + try { + const createdNodeModules = await Utils.createNodeModulesIfNeeded(); - try { - const createdNodeModules = await Utils.createNodeModulesIfNeeded(); + if ( createdNodeModules ) { + NODE_MODULES_PATH = global.config.nodeModulesPath; + await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); + } - if ( createdNodeModules ) { - NODE_MODULES_PATH = global.config.nodeModulesPath; - await addPropertyToConfig( ConfigKeysType.nodeModulesPath, NODE_MODULES_PATH ); + } catch ( e ) { + return ____nodeModulesCreationError( line ); } - } catch ( e ) { - return ____nodeModulesCreationError( line ); - } - - break; + break; - default: - break; - } + default: + break; + } - switch ( parsedLine.importType ) { + switch ( parsedLine.importType ) { - case ImportType.RelativePath: - directotyPath = Path; - break; + case ImportType.RelativePath: + directotyPath = Path; + break; - case ImportType.NodeModules: - directotyPath = NODE_MODULES_PATH; - break; + case ImportType.NodeModules: + directotyPath = NODE_MODULES_PATH; + break; - case ImportType.SpecificURL: - directotyPath = NODE_MODULES_PATH; - const fileName = Utils.getFileNameFromUrl( parsedLine.path ); + case ImportType.SpecificURL: + directotyPath = NODE_MODULES_PATH; + const fileName = Utils.getFileNameFromUrl( parsedLine.path ); - let fileExists = true; - if ( !parsedLine.forceInstall ) { - fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); - } + let fileExists = true; + if ( !parsedLine.forceInstall ) { + fileExists = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); + } - if ( !fileExists || parsedLine.forceInstall ) { - try { - await fileDownloader.fromUrl( parsedLine.path ); + if ( !fileExists || parsedLine.forceInstall ) { + try { + await fileDownloader.fromUrl( parsedLine.path ); - } catch ( e ) { - console.error( style.styledError, `There was an error while downloading a file from url ("${url}")\n`, e ); + } catch ( e ) { + console.error( style.styledError, `There was an error while downloading a file from url ("${url}")\n`, e ); + } } - } - parsedLine.path = fileName; - break; + parsedLine.path = fileName; + break; - case ImportType.GitHub: - const splitedPath = parsedLine.path.split( '/' ); - const pathToFile = splitedPath.slice( 2 ).join( '/' ); + case ImportType.GitHub: + const splitedPath = parsedLine.path.split( '/' ); + const pathToFile = splitedPath.slice( 2 ).join( '/' ); - /** - * The name of the folder where the file(s) will be stored on node_modules. - * @type { string } - */ - const repoDirName = path.join( Utils.buildGithubRepoDirName( splitedPath[0], splitedPath[1] ) ); - directotyPath = path.join( NODE_MODULES_PATH, repoDirName ); + /** + * The name of the folder where the file(s) will be stored on node_modules. + * @type { string } + */ + const repoDirName = path.join( Utils.buildGithubRepoDirName( splitedPath[0], splitedPath[1] ) ); + directotyPath = path.join( NODE_MODULES_PATH, repoDirName ); - // #region GITHUB FILES + // #region GITHUB FILES - if ( !parsedLine.isDir ) { - const fileName = path.basename( parsedLine.path ); - let alreadyDowloadedDeprecatedSyntax = false; - let alreadyDowloadedNewSyntax = false; + if ( !parsedLine.isDir ) { + const fileName = path.basename( parsedLine.path ); + let alreadyDowloadedDeprecatedSyntax = false; + let alreadyDowloadedNewSyntax = false; - if ( !parsedLine.forceInstall && parsedLine.isGithubNewSyntax ) { - alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( directotyPath, pathToFile ) ); + if ( !parsedLine.forceInstall && parsedLine.isGithubNewSyntax ) { + alreadyDowloadedNewSyntax = await Utils.fileExists( path.join( directotyPath, pathToFile ) ); - // We need to check with the deprecated syntax, to avoid breaking changes. - } else if ( !parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) { - alreadyDowloadedDeprecatedSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); - } + // We need to check with the deprecated syntax, to avoid breaking changes. + } else if ( !parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) { + alreadyDowloadedDeprecatedSyntax = await Utils.fileExists( path.join( NODE_MODULES_PATH, fileName ) ); + } - if ( - ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || - ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) - ) - { - await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); - - // We need to use the deprecated method to avoid breaking changes. - } else if ( - ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || - ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) - ) - { - await fileDownloader.fromGitHub_deprecated( parsedLine.path ); - } + if ( + ( parsedLine.isGithubNewSyntax && !alreadyDowloadedNewSyntax ) || + ( parsedLine.forceInstall || parsedLine.isGithubNewSyntax ) + ) { + await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); + + // We need to use the deprecated method to avoid breaking changes. + } else if ( + ( !parsedLine.isGithubNewSyntax && !alreadyDowloadedDeprecatedSyntax ) || + ( parsedLine.forceInstall && !parsedLine.isGithubNewSyntax ) + ) { + await fileDownloader.fromGitHub_deprecated( parsedLine.path ); + } - if ( parsedLine.isGithubNewSyntax ) { - parsedLine.path = pathToFile; + if ( parsedLine.isGithubNewSyntax ) { + parsedLine.path = pathToFile; - } else { - directotyPath = NODE_MODULES_PATH; - parsedLine.path = fileName; - } + } else { + directotyPath = NODE_MODULES_PATH; + parsedLine.path = fileName; + } - // #endregion GITHUB FILES + // #endregion GITHUB FILES - // #region GITHUB DIRECTORIES + // #region GITHUB DIRECTORIES - // For directories it is used exclusively the new syntax. - } else { - let alreadyDownloaded = false; + // For directories it is used exclusively the new syntax. + } else { + let alreadyDownloaded = false; - if ( !parsedLine.forceInstall ) { - alreadyDownloaded = await Utils.dirExists( path.join( directotyPath, pathToFile ) ); - } + if ( !parsedLine.forceInstall ) { + alreadyDownloaded = await Utils.dirExists( path.join( directotyPath, pathToFile ) ); + } - if ( !alreadyDownloaded || parsedLine.forceInstall ) { - const allFiles = await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); - buildOrder = buildOrder.concat( allFiles ); + if ( !alreadyDownloaded || parsedLine.forceInstall ) { + const allFiles = await fileDownloader.fromGithub( splitedPath[0], splitedPath[1], pathToFile, parsedLine.branchName ); + buildOrder = buildOrder.concat( allFiles ); - // This is to block adding any files to build order, - // bellow this switch. - parsedLine.isDir = false; - thisFile = ''; + // This is to block adding any files to build order, + // bellow this switch. + parsedLine.isDir = false; + thisFile = ''; - } else { - const allFilesFromRepoDir = await Utils.readDir( path.join( directotyPath, pathToFile ) ); + } else { + const allFilesFromRepoDir = await Utils.readDir( path.join( directotyPath, pathToFile ) ); - for ( let i = 0; i < allFilesFromRepoDir.length; ++i ) { - if ( path.extname( allFilesFromRepoDir[i] ) !== '.js' ) { - continue; + for ( let i = 0; i < allFilesFromRepoDir.length; ++i ) { + if ( path.extname( allFilesFromRepoDir[i] ) !== '.js' ) { + continue; + } + + buildOrder.push( path.join( directotyPath, pathToFile, allFilesFromRepoDir[i] ) ); } - buildOrder.push( path.join( directotyPath, pathToFile, allFilesFromRepoDir[i] ) ); + // This is to block adding any files to build order, + // bellow this switch. + parsedLine.isDir = false; + thisFile = ''; } - // This is to block adding any files to build order, - // bellow this switch. - parsedLine.isDir = false; - thisFile = ''; + // #endregion GITHUB DIRECTORIES + } + break; - // #endregion GITHUB DIRECTORIES + default: + parsedLine.path = null; + break; + } - } - break; + if ( parsedLine.isDir ) { + await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, parsedLine.path ); - default: - parsedLine.path = null; - break; - } + } else if ( thisFile === null && parsedLine.path !== null ) { - if ( parsedLine.isDir ) { - await ____addAllDirectoryToBuildOrder( buildOrder, directotyPath, parsedLine.path ); + if ( parsedLine.importType === ImportType.RelativePath ) { + directotyPath = ''; + } - } else if ( thisFile === null && parsedLine.path !== null ) { + thisFile = path.join( directotyPath, parsedLine.path ); - if ( parsedLine.importType === ImportType.RelativePath ) { - directotyPath = ''; - } + try { + if ( path.extname( thisFile ) !== '.js' ) { + thisFile += '.js'; + } - thisFile = path.join( directotyPath, parsedLine.path ); + if ( !buildOrder.includes( thisFile ) ) { + buildOrder.push( path.normalize( thisFile ) ); + } - try { - if ( path.extname( thisFile ) !== '.js' ) { - thisFile += '.js'; + } catch ( e ) { + // Invalid import statement. } + } - if ( !buildOrder.includes( thisFile ) ) { - buildOrder.push( path.normalize( thisFile ) ); - } + ++line; + rl.resume(); - } catch ( e ) { - // Invalid import statement. + if ( lineNum >= 20 && !lastLineWasComment ) { + rl.close(); } - } - ++line; - rl.resume(); + } ); - if ( lineNum >= 20 && !lastLineWasComment ) { - rl.close(); - } + rl.on( 'end', () => { + if ( Callback ) { + return Callback( buildOrder ); + } - } ); + return _res( buildOrder ); + } ); - rl.on( 'end', () => { - return Callback( buildOrder ); } ); }; @@ -237,9 +245,9 @@ module.exports = ( Path, Callback ) => { /** * - * @param { string[] } buildOrder + * @param { string[] } buildOrder An array that contains all the build paths. * @param { string } thePath The path of the header file directory. - * @param { string } treatedLine + * @param { string } treatedLine The path inputed by the user. * * @return { boolean } Returns false in cae it's not a directory. * In case of exception, it kill the process and logs the error message. @@ -271,7 +279,7 @@ const ____addAllDirectoryToBuildOrder = async ( buildOrder, thePath, treatedLine }; /** - * + * Prinsts the node_modules file creation error. * @param { string } fileName The file name where the error occured. * * @returns { void } Logs the error to the console. From b72f93ab3e3d89bf5b5174e8a54fe03f1a8666cc Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Mon, 21 Oct 2019 12:47:22 +0100 Subject: [PATCH 26/31] [ tests ]: Added a test to parse existing GitHub directories in cache --- tests/spec/parseImports_spec.js | 89 +++++++++++++++++++++++---------- 1 file changed, 62 insertions(+), 27 deletions(-) diff --git a/tests/spec/parseImports_spec.js b/tests/spec/parseImports_spec.js index f7410ae..902c925 100644 --- a/tests/spec/parseImports_spec.js +++ b/tests/spec/parseImports_spec.js @@ -85,26 +85,43 @@ describe( 'ParseImports', () => { it( 'Should parse a URL file import, download the file and cache it in the node_modules folder.', async () => { await __parseImportsUrlsTest( 'specificUrlPaths.header.js', [path.join( NODE_MODULES_PATH, 'jquery.min.js' )] ); + // TODO: (new) BUG: remove the jquery file. } ); + let allDownloadedFilePaths = []; + it( 'Should parse a GitHub file path, download it and cache it into the node_modules folder.', async () => { - await __parseImportsUrlsTest( 'githubFilePath.header.js', [path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.min.js' )] ); - await ____removeBootsrapFolder(); + allDownloadedFilePaths = await __parseImportsUrlsTest( 'githubFilePath.header.js', [path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.min.js' )] ); + await ____removeBootsrapFolder( allDownloadedFilePaths ); } ); - it( 'Should parse an entire GitHub directory path, download it and cache it into the node_modules folder.', async () => { - await __parseImportsUrlsTest( 'githubDirPath.header.js', - [ - path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.js' ), - path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.min.js' ), - path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.esm.min.js' ), - path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.esm.js' ), - path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.bundle.js' ), - path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.bundle.min.js' ) - ] - ); - - await ____removeBootsrapFolder(); + + it( 'Should parse an entire GitHub directory path, download it and cache it into the node_modules folder.\n' + + 'After that, it should parse an existing GitHub directory path cached in the node_modules folder, not downloading it.', + async () => { + const headerFilePath = 'githubDirPath.header.js'; + + allDownloadedFilePaths = await __parseImportsUrlsTest( headerFilePath, + [ + path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.js' ), + path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.min.js' ), + path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.esm.min.js' ), + path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.esm.js' ), + path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.bundle.js' ), + path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.bundle.min.js' ) + ] + ); + + const buildOrder = await parseImports( path.join( HEADER_FILES_DIR_PATH, headerFilePath ) ); + + fs.stat( buildOrder[1], async ( err, stats ) => { + + expect( stats.mtime ).toEqual( stats.ctime ); + expect( stats.mtimeMs ).toEqual( stats.ctimeMs ); + + await ____removeBootsrapFolder( allDownloadedFilePaths ); + } ); + } ); afterAll( () => { @@ -113,10 +130,15 @@ describe( 'ParseImports', () => { } ); +// #region HELPER FUNCTIONS + /** + * Checks if the files exists to confirm if it was successfull. * * @param { string } headerFile The header file path, with all the imports. * @param { string[] } downloadedFilePaths The path location where the downloaded file should be. + * + * @return { Promise } */ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { return new Promise( ( _resolve, _reject ) => { @@ -161,16 +183,8 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { expect( data ).not.toEqual( '404: Not Found\n' ); expect( data.length ).toBeGreaterThan( 50 ); - // Delete the downloaded file. - fs.unlink( downloadedFilePath, ( err ) => { - if ( err ) { - console.error( 'ParseImports > URL file import > (delete downloaded file) : FAILED, Error:' ); - console.error( err ); - return _rej( err ); - } + return _res(); - return _res(); - } ); } ); } ); }; @@ -179,7 +193,7 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { await ____validateFileAsync( downloadedFilePaths[i] ); } - return _resolve(); + return _resolve( downloadedFilePaths ); } return _reject( downloadFileError ); @@ -188,10 +202,29 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { } ); }; -const ____removeBootsrapFolder = () => { - return new Promise( ( _res, _rej ) => { +const ____removeBootsrapFolder = ( allFiles ) => { + return new Promise( async ( _res, _rej ) => { // This is orrible and all hardcoded as #uck. // TODO: Redo this test data removal part. + + const removeFile = ( filePath ) => { + return new Promise( ( _res, _rej ) => { + fs.unlink( filePath, ( err ) => { + if ( err ) { + console.error( 'ParseImports > URL file import > (delete downloaded file) : FAILED, Error:' ); + console.error( err ); + return _rej( err ); + } + + return _res(); + } ); + } ); + }; + + for ( let i = 0; i < allFiles.length; ++i ) { + await removeFile( allFiles[i] ); + } + fs.rmdir( path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js' ), ( err ) => { fs.rmdir( path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/' ), ( errr ) => { fs.rmdir( path.join( NODE_MODULES_PATH, 'twbs@bootstrap/' ), ( errrr ) => { @@ -207,3 +240,5 @@ const ____removeBootsrapFolder = () => { } ); } ); }; + +// #endregion HELPER FUNCTIONS From 626133c80581e036f8191bb24763d0df1357a971 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Mon, 21 Oct 2019 17:36:55 +0100 Subject: [PATCH 27/31] [ utils.js ]: Added the .fileStat() and .deleteFile() properties --- modules/utils.js | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/modules/utils.js b/modules/utils.js index bb4901e..525d2ff 100644 --- a/modules/utils.js +++ b/modules/utils.js @@ -20,6 +20,7 @@ class Utils extends StaticClass { } /** + * Reads the requested directory and returns an array of all its file names. * @param { string } path The directory path. * @param { Function } Callback Optional. (err, files[]) * @@ -81,6 +82,42 @@ class Utils extends StaticClass { } ); } + /** + * + * @param { string } filePath + * + * @returns { Promise } + */ + static fileStat( filePath ) { + return new Promise( ( _res, _rej ) => { + fs.stat( filePath, async ( err, stats ) => { + if ( err ) { + return _rej( err ); + } + + return _res( stats ); + } ); + } ); + } + + /** + * Deletes the requested file. + * @param { string } filePath + * + * @returns { Promise } + */ + static deleteFile( filePath ) { + return new Promise( ( _res, _rej ) => { + fs.unlink( filePath, ( err ) => { + if ( err ) { + return _rej( err ); + } + + return _res(); + } ); + } ); + } + static isNullOrEmptyStr( str ) { return str === null || str === undefined || str === ''; } From a4f7ea5efe7a9529295da68f8fd2702c36ea7065 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Mon, 21 Oct 2019 17:38:11 +0100 Subject: [PATCH 28/31] [ parseImports_spec.js ]: Improved file deletions and other bugs --- tests/spec/parseImports_spec.js | 64 ++++++++++++++------------------- 1 file changed, 27 insertions(+), 37 deletions(-) diff --git a/tests/spec/parseImports_spec.js b/tests/spec/parseImports_spec.js index 902c925..0c897a0 100644 --- a/tests/spec/parseImports_spec.js +++ b/tests/spec/parseImports_spec.js @@ -9,8 +9,7 @@ const path = require( 'path' ); const fs = require( 'fs' ); const parseImports = require( '../../modules/buildModules/parseImports' ); -const { fileExists } = require( '../../modules/utils' ); - +const Utils = require( '../../modules/utils' ); const DATA_DIR_PATH = path.join( __dirname, path.normalize( '../data' ) ); const HEADER_FILES_DIR_PATH = path.join( DATA_DIR_PATH, '/headerFiles' ); const NODE_MODULES_PATH = path.join( DATA_DIR_PATH, '/node_modules' ); @@ -27,8 +26,6 @@ describe( 'ParseImports', () => { } ); - // TODO: (Tests) Add the token tests on all the buildOrder files output (reuse between utils_spec.js). - it( 'Should parse file path imports, relative to the header file.', () => { parseImports( path.join( HEADER_FILES_DIR_PATH, 'relativeFilePaths.header.js' ), ( buildOrder ) => { @@ -84,24 +81,25 @@ describe( 'ParseImports', () => { } ); it( 'Should parse a URL file import, download the file and cache it in the node_modules folder.', async () => { - await __parseImportsUrlsTest( 'specificUrlPaths.header.js', [path.join( NODE_MODULES_PATH, 'jquery.min.js' )] ); - // TODO: (new) BUG: remove the jquery file. + const filePath = path.join( NODE_MODULES_PATH, 'jquery.min.js' ); + await __parseImportsUrlsTest( 'specificUrlPaths.header.js', [filePath] ); + await Utils.deleteFile( filePath ); } ); - let allDownloadedFilePaths = []; - it( 'Should parse a GitHub file path, download it and cache it into the node_modules folder.', async () => { - allDownloadedFilePaths = await __parseImportsUrlsTest( 'githubFilePath.header.js', [path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.min.js' )] ); - await ____removeBootsrapFolder( allDownloadedFilePaths ); + await ____removeBootsrapFolder( await __parseImportsUrlsTest( + 'githubFilePath.header.js', + [path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.min.js' )] + ) ); } ); - it( 'Should parse an entire GitHub directory path, download it and cache it into the node_modules folder.\n' + 'After that, it should parse an existing GitHub directory path cached in the node_modules folder, not downloading it.', async () => { const headerFilePath = 'githubDirPath.header.js'; + const cacheFolderPath = path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/' ); - allDownloadedFilePaths = await __parseImportsUrlsTest( headerFilePath, + await __parseImportsUrlsTest( headerFilePath, [ path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.js' ), path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js/bootstrap.min.js' ), @@ -114,15 +112,19 @@ describe( 'ParseImports', () => { const buildOrder = await parseImports( path.join( HEADER_FILES_DIR_PATH, headerFilePath ) ); - fs.stat( buildOrder[1], async ( err, stats ) => { - - expect( stats.mtime ).toEqual( stats.ctime ); - expect( stats.mtimeMs ).toEqual( stats.ctimeMs ); + const stats = await Utils.fileStat( buildOrder[1] ); - await ____removeBootsrapFolder( allDownloadedFilePaths ); + expect( stats.mtime ).toEqual( stats.ctime ); + expect( stats.mtimeMs ).toEqual( stats.ctimeMs ); + + const allFileNames = await Utils.readDir( cacheFolderPath ); + allFileNames.forEach( ( item, i ) => { + allFileNames[i] = cacheFolderPath + item; } ); - - } ); + + await ____removeBootsrapFolder( allFileNames ); + } + ); afterAll( () => { jasmine.DEFAULT_TIMEOUT_INTERVAL = originalTimeout; @@ -156,7 +158,7 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { try { for ( let i = 0; i < downloadedFilePaths.length; ++i ) { currentLink = downloadedFilePaths[i]; - downloadSuccessful = await fileExists( downloadedFilePaths[i] ); + downloadSuccessful = await Utils.fileExists( downloadedFilePaths[i] ); if ( !downloadSuccessful ) { break; @@ -174,9 +176,10 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { const ____validateFileAsync = ( downloadedFilePath ) => { return new Promise( ( _res, _rej ) => { + fs.readFile( downloadedFilePath, 'utf8', ( err, data ) => { if ( err ) - return _reject( err ); + return _rej( err ); expect( data ).not.toBeNull(); expect( data ).toBeDefined(); @@ -184,8 +187,8 @@ const __parseImportsUrlsTest = ( headerFile, downloadedFilePaths ) => { expect( data.length ).toBeGreaterThan( 50 ); return _res(); - } ); + } ); }; @@ -207,22 +210,8 @@ const ____removeBootsrapFolder = ( allFiles ) => { // This is orrible and all hardcoded as #uck. // TODO: Redo this test data removal part. - const removeFile = ( filePath ) => { - return new Promise( ( _res, _rej ) => { - fs.unlink( filePath, ( err ) => { - if ( err ) { - console.error( 'ParseImports > URL file import > (delete downloaded file) : FAILED, Error:' ); - console.error( err ); - return _rej( err ); - } - - return _res(); - } ); - } ); - }; - for ( let i = 0; i < allFiles.length; ++i ) { - await removeFile( allFiles[i] ); + await Utils.deleteFile( allFiles[i] ); } fs.rmdir( path.join( NODE_MODULES_PATH, 'twbs@bootstrap/dist/js' ), ( err ) => { @@ -238,6 +227,7 @@ const ____removeBootsrapFolder = ( allFiles ) => { } ); } ); } ); + } ); }; From 496b48bb66929a951b76a953f7f1bd193bc0d2d3 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Mon, 21 Oct 2019 17:45:57 +0100 Subject: [PATCH 29/31] Bump version ( v3.8.4 -> v3.8.5 ) --- VERSION.md | 2 +- package-lock.json | 2 +- package.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/VERSION.md b/VERSION.md index 291dd97..ae07af9 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1,3 +1,3 @@ # Current Branch Version -**v3.8.4** +**v3.8.5** diff --git a/package-lock.json b/package-lock.json index bdab859..ddab4dc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "merger-js", - "version": "3.8.4", + "version": "3.8.5", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index d0fb399..5ea943f 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "merger-js", "displayName": "MergerJS", - "version": "3.8.4", + "version": "3.8.5", "description": "Yet another simple cross-platform CLI build tool to bundle JavaScript files, with a custom file import syntax, ES8+ minification, auto build capabilities, and native OS notifications.", "readme": "https://github.com/joao-neves95/merger-js/blob/master/README.md", "main": "merger.js", From 73f19c97561bd5d07854b8a42c8f46a94b313769 Mon Sep 17 00:00:00 2001 From: joao-neves95 Date: Mon, 21 Oct 2019 17:46:28 +0100 Subject: [PATCH 30/31] Update CHANGELOG.md --- CHANGELOG.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index febb11c..923e735 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,15 @@   -#### *v3.8.4 - 07/10/2019 +#### *v3.8.5 - //2019 + + - Refactored the import parser and made multiple optimisations. + - Updated dependencies. + - Added more testing. + +  + +#### v3.8.4 - 07/10/2019 - The output of `merger update` is now printed on the console. From ca984a6a3bdbd5a58376a5a7a7602f0c66c4184a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Neves?= Date: Mon, 21 Oct 2019 21:53:06 +0100 Subject: [PATCH 31/31] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 923e735..85bf696 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@   -#### *v3.8.5 - //2019 +#### *v3.8.5 - 21/10/2019 - Refactored the import parser and made multiple optimisations. - Updated dependencies.