Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

merger-js

Package Overview
Dependencies
Maintainers
1
Versions
69
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

merger-js - npm Package Compare versions

Comparing version 3.6.1 to 3.6.2

13

CHANGELOG.md

@@ -5,4 +5,11 @@ # CHANGELOG

#### *v3.6.1 - 05/10/2018
#### *v3.6.2 - 26/10/2018
- Solved a bug where, in non-minified builds, if the last line of a file ended with a comment it commented out the first line of the next file;
- Solved bug where if the user imported an entire directory (e.g.: ```@import<<DIR 'someDir'```) with subdirectories, it gave an "EISDIR" read error;
&nbsp;
#### v3.6.1 - 05/10/2018
- Fixed error on the importsParser.js module introduced on the last version.

@@ -14,4 +21,4 @@

- **Added support for importing entie directories. Using this methods, the files are not compiled in any specific order**;
- Fixed a bug introduced in v3.5.0 (commit: https://github.com/joao-neves95/merger-js/commit/a976bd6bf1ea317f344bcead2d991532a2db9684#diff-e8f6b017cf5303324df391ba7f9e0b07), in the auto build 'chnage' event async Callback (called multiple times);
- **Added support for importing entire directories. Using this methods, the files are not compiled in any specific order**;
- Fixed a bug introduced in v3.5.0 (commit: https://github.com/joao-neves95/merger-js/commit/a976bd6bf1ea317f344bcead2d991532a2db9684#diff-e8f6b017cf5303324df391ba7f9e0b07), in the auto build 'change' event async Callback (called multiple times);
- Fixed a bug in the github imports. Starting the path of the github repository with a bar broke the fileDownloader.js ('/twbs/bootstrap/v4-dev/dist/js/bootstrap.min.js' vs. 'twbs/bootstrap/v4-dev/dist/js/bootstrap.min.js');

@@ -18,0 +25,0 @@ - Minor optimization and fixes on the parseImports.js module.

@@ -29,3 +29,2 @@ #!/usr/bin/env node

// TODO: BUG with Callback. Can not call multiple times (autoBuild).
async.eachSeries( files, ( file, Callback ) => {

@@ -32,0 +31,0 @@

@@ -29,3 +29,3 @@ 'use strict';

allData[file] = data;
allData[file] = data + '\n';
Callback();

@@ -32,0 +32,0 @@ } );

@@ -1,2 +0,2 @@

'use strict';
'use strict';
const fs = require( 'fs' );

@@ -28,6 +28,3 @@ const path = require('path');

if ( treatedLine.startsWith( '//' ) )
lastLineWasComment = true;
else
lastLineWasComment = false;
lastLineWasComment = treatedLine.startsWith( '//' );

@@ -54,2 +51,5 @@ // #region IMPORT FROM RELATIVE PATH OR DIRECTORY

for ( let i = 0; i < files.length; ++i ) {
if ( path.extname( files[i] ) === '' )
continue;
buildOrder.push( path.join( treatedLine, files[i] ) );

@@ -166,3 +166,2 @@ }

rl.on( 'end', () => {
console.debug( lineNum )
return Callback( buildOrder );

@@ -169,0 +168,0 @@ } );

@@ -16,6 +16,4 @@ 'use strict';

fromUrl: ( url, Callback ) => {
return new Promise( ( resolve, reject ) => {
return new Promise( async ( resolve, reject ) => {
( async () => {
try {

@@ -38,4 +36,2 @@ const fileName = Utils.getFileNameFromUrl( url );

} )();
} );

@@ -42,0 +38,0 @@ },

{
"name": "merger-js",
"displayName": "MergerJS",
"version": "3.6.1",
"version": "3.6.2",
"description": "Yet another light weight and simple cross-platform build tool for JavaScript files, with CLI tooling, file imports, auto build capabilities and native OS notifications.",

@@ -49,2 +49,3 @@ "readme": "https://github.com/joao-neves95/merger-js/blob/master/README.md",

"merge",
"merger",
"auto builds",

@@ -51,0 +52,0 @@ "automatic",

@@ -112,30 +112,2 @@ # MergerJS

## Example of a File Structure
|-- root/</br>
>|-- **merger-config.json**</br>
>|-- package.json</br>
>|-- .env</br>
>|-- node_modules/</br>
>|-- (...)</br>
>|-- server/</br>
>>|-- (...)</br>
>|-- client/</br>
>>|-- css</br>
>>>|-- (...)</br>
>>|-- js</br>
>>>|-- mergerBuildFile.js</br>
>>>|-- src</br>
>>>>|-- sourceFile.header.js (the header file containing all the imports; the first file to be build)</br>
>>>>|-- utilities.js</br>
>>>>|-- someOtherView.js</br>
>>>>|-- someOtherModel.js</br>
>>>>|-- someController.js</br>
## Import Syntax:

@@ -154,8 +126,9 @@

Using a ```%``` token imports a file from a specific URL. The file is downloaded and stored in node_modules in the first time and later fetch from there in order to not download the file in each build.<br/>
If the branch name is not provided, it defaults to the "master" branch.
* Pushing (```<<```) ```GH```, ```gh```, ```github``` or ```GITHUB``` into ```%import```, imports a file from a GitHub repository.<br/>
If the branch name is not provided, it defaults to the "master" branch.<br/>
E.g.: ```// %import<<GH '<userName>/<repositoryName>/<branchName>/<pathToFile>'```<br/>
```// $<<github '/twbs/bootstrap/v4-dev/dist/js/bootstrap.min.js'```
&nbsp;

@@ -194,2 +167,37 @@ ## Commands

## Example of a File Structure
|-- root/</br>
>|-- **merger-config.json**</br>
>|-- package.json</br>
>|-- .env</br>
>|-- node_modules/</br>
>|-- (...)</br>
>|-- server/</br>
>>|-- (...)</br>
>|-- client/</br>
>>|-- css</br>
>>>|-- (...)</br>
>>|-- js</br>
>>>|-- mergerBuildFile.js</br>
>>>|-- src</br>
>>>>|-- sourceFile.header.js (the header file containing all the imports; the first file to be build)</br>
>>>>|-- utilities.js</br>
>>>>|-- someOtherView.js</br>
>>>>|-- someOtherModel.js</br>
>>>>|-- someController.js</br>
&nbsp;
## Known Issues
The auto build does not work properly and all times on Visual Studio. It works very well on Visual Studio Code though.
&nbsp;
## Versioning

@@ -196,0 +204,0 @@

# TODO
- Add support for importing an entire directory of files inside node_modules (``` // $import<<DIR 'dirInsideNodeModules/' ```);
- In "merger add" ask the user if he is on the header file directory and if so, give him a drop down menu with all the files in that directory;
- Solve bug where its added "\ufeff" unicode characters on the build/read files process. No interpreter errors though (Char encoding Node.js issue. Use "strip-bom" package on the next release);

@@ -12,2 +16,3 @@

--------------------------------------------------------------------------------------------------------------------------
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc