Update with working working version (#12)

* Fix workflow

* Trigger

* [auto] Update compiled version

* [auto] Commit modules

* Push Windows changes

* Fix

* [auto] Update compiled version

* Try removing cwd

* [auto] Update compiled version

* Try with path module

* [auto] Update compiled version

* Fix path

* [auto] Update compiled version

* Use raw path

* [auto] Update compiled version

* Other path

* [auto] Update compiled version

* Avoid @action/exec

* [auto] Update compiled version

* test

* [auto] Update compiled version

* test

* [auto] Update compiled version

* test

* [auto] Update compiled version

* test

* [auto] Update compiled version

* Try with shelljs

* [auto] Update compiled version

* Fix my stupidity

* Copy scripts to local dir

* [auto] Update compiled version

* Still use path

* [auto] Update compiled version

* Delete entrypoint.sh

* [auto] Update compiled version

* Make file executable

* [auto] Update compiled version

* Try using bash

* [auto] Update compiled version
This commit is contained in:
Federico Grandi
2019-12-14 21:47:13 +01:00
committed by GitHub
parent d81e04e96c
commit f118062594
4276 changed files with 1075004 additions and 40 deletions

21
node_modules/@node-minify/core/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2019 Rodolphe Stoclin
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

43
node_modules/@node-minify/core/README.md generated vendored Normal file
View File

@@ -0,0 +1,43 @@
<p align="center"><img src="/static/node-minify.png" width="348" alt="node-minify"></p>
<p align="center">A very light minifier Node.js module.</p>
<p align="center">
<br>
<a href="https://npmjs.org/package/@node-minify/core"><img src="https://img.shields.io/npm/v/@node-minify/core.svg"></a>
<a href="https://npmjs.org/package/@node-minify/core"><img src="https://img.shields.io/npm/dm/@node-minify/core.svg"></a>
<a href="https://codecov.io/gh/srod/node-minify"><img src="https://codecov.io/gh/srod/node-minify/branch/develop/graph/badge.svg"></a><br>
<a href="https://travis-ci.org/srod/node-minify"><img src="https://img.shields.io/travis/srod/node-minify/master.svg?label=linux"></a>
<a href="https://dev.azure.com/srodolphe/srodolphe/_build/latest?definitionId=1"><img src="https://dev.azure.com/srodolphe/srodolphe/_apis/build/status/srod.node-minify?branchName=master"></a>
<a href="https://circleci.com/gh/srod/node-minify/tree/master"><img src="https://circleci.com/gh/srod/node-minify/tree/master.svg?style=shield"></a>
</p>
# node-minify
## Installation
```bash
npm install @node-minify/core @node-minify/uglify-js
```
## Usage
```js
const minify = require('@node-minify/core');
const uglifyJS = require('@node-minify/uglify-js');
minify({
compressor: uglifyJS,
input: 'foo.js',
output: 'bar.js',
callback: function(err, min) {}
});
```
## Documentation
Visit https://node-minify.2clics.net for full documentation
## License
[MIT](https://github.com/srod/node-minify/blob/develop/LICENSE)

178
node_modules/@node-minify/core/lib/compress.js generated vendored Normal file
View File

@@ -0,0 +1,178 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.compress = void 0;
var _fs = _interopRequireDefault(require("fs"));
var _mkdirp = _interopRequireDefault(require("mkdirp"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*!
* node-minify
* Copyright(c) 2011-2019 Rodolphe Stoclin
* MIT Licensed
*/
/**
* Module dependencies.
*/
/**
* Run compressor.
*
* @param {Object} settings
*/
const compress = settings => {
if (typeof settings.compressor !== 'function') {
throw new Error(`compressor should be a function, maybe you forgot to install the compressor`);
}
createDirectory(settings.output);
if (Array.isArray(settings.output)) {
return settings.sync ? compressArrayOfFilesSync(settings) : compressArrayOfFilesAsync(settings);
} else {
return compressSingleFile(settings);
}
};
/**
* Compress an array of files in sync.
*
* @param {Object} settings
*/
exports.compress = compress;
const compressArrayOfFilesSync = settings => {
return settings.input.forEach((input, index) => {
const content = getContentFromFiles(input);
return runSync({
settings,
content,
index
});
});
};
/**
* Compress an array of files in async.
*
* @param {Object} settings
*/
const compressArrayOfFilesAsync = settings => {
let sequence = Promise.resolve();
settings.input.forEach((input, index) => {
const content = getContentFromFiles(input);
sequence = sequence.then(() => runAsync({
settings,
content,
index
}));
});
return sequence;
};
/**
* Compress a single file.
*
* @param {Object} settings
*/
const compressSingleFile = settings => {
const content = getContentFromFiles(settings.input);
return settings.sync ? runSync({
settings,
content
}) : runAsync({
settings,
content
});
};
/**
* Run compressor in sync.
*
* @param {Object} settings
* @param {String} content
* @param {Number} index - index of the file being processed
* @return {String}
*/
const runSync = ({
settings,
content,
index
}) => settings.compressor({
settings,
content,
callback: null,
index
});
/**
* Run compressor in async.
*
* @param {Object} settings
* @param {String} content
* @param {Number} index - index of the file being processed
* @return {Promise}
*/
const runAsync = ({
settings,
content,
index
}) => {
return new Promise((resolve, reject) => {
settings.compressor({
settings,
content,
callback: (err, min) => {
if (err) {
return reject(err);
}
resolve(min);
},
index
});
});
};
/**
* Concatenate all input files and get the data.
*
* @param {String|Array} input
* @return {String}
*/
const getContentFromFiles = input => {
if (!Array.isArray(input)) {
return _fs.default.readFileSync(input, 'utf8');
}
return input.map(path => _fs.default.readFileSync(path, 'utf8')).join('\n');
};
/**
* Create folder of the target file.
*
* @param {String} file - Full path of the file
*/
const createDirectory = file => {
if (Array.isArray(file)) {
file = file[0];
}
_mkdirp.default.sync(file.substr(0, file.lastIndexOf('/')));
};
/**
* Expose `compress()`.
*/

56
node_modules/@node-minify/core/lib/core.js generated vendored Normal file
View File

@@ -0,0 +1,56 @@
"use strict";
var _setup = require("./setup");
var _compress = require("./compress");
/*!
* node-minify
* Copyright(c) 2011-2019 Rodolphe Stoclin
* MIT Licensed
*/
/**
* Module dependencies.
*/
/**
* Run node-minify.
*
* @param {Object} settings - Settings from user input
*/
const minify = settings => {
return new Promise((resolve, reject) => {
settings = (0, _setup.setup)(settings);
if (!settings.sync) {
(0, _compress.compress)(settings).then(minified => {
if (settings.callback) {
settings.callback(null, minified);
}
resolve(minified);
}).catch(err => {
if (settings.callback) {
settings.callback(err);
}
reject(err);
});
} else {
const minified = (0, _compress.compress)(settings);
if (settings.callback) {
settings.callback(null, minified);
}
resolve(minified);
}
});
};
/**
* Expose `minify()`.
*/
module.exports = minify;

224
node_modules/@node-minify/core/lib/setup.js generated vendored Normal file
View File

@@ -0,0 +1,224 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.setup = void 0;
var _path = _interopRequireDefault(require("path"));
var _glob = _interopRequireDefault(require("glob"));
var _utils = require("@node-minify/utils");
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/*!
* node-minify
* Copyright(c) 2011-2019 Rodolphe Stoclin
* MIT Licensed
*/
/**
* Module dependencies.
*/
/**
* Default settings.
*/
const defaultSettings = {
sync: false,
options: {},
buffer: 1000 * 1024,
callback: false
};
/**
* Run setup.
*
* @param {Object} inputSettings
* @return {Object}
*/
const setup = inputSettings => {
checkMandatories(inputSettings);
let settings = Object.assign(_utils.utils.clone(defaultSettings), inputSettings);
settings = Object.assign(settings, wildcards(settings.input, settings.publicFolder));
settings = Object.assign(settings, checkOutput(settings.input, settings.output));
settings = Object.assign(settings, setPublicFolder(settings.input, settings.publicFolder));
return settings;
};
/**
* Check the output path, searching for $1
* if exist, returns the path remplacing $1 by file name
*
* @param {String|Array} input - Path file
* @param {String} output - Path to the output file
* @return {Object}
*/
exports.setup = setup;
function checkOutput(input, output) {
let reg = new RegExp('\\$1');
if (reg.test(output)) {
if (Array.isArray(input)) {
const outputMin = input.map(file => {
return _utils.utils.setFileNameMin(file, output);
});
return {
output: outputMin
};
} else {
return {
output: _utils.utils.setFileNameMin(input, output)
};
}
}
}
/**
* Handle wildcards in a path, get the real path of each files.
*
* @param {String|Array} input - Path with wildcards
* @param {String} publicFolder - Path to the public folder
* @return {Object}
*/
const wildcards = (input, publicFolder) => {
// If it's a string
if (!Array.isArray(input)) {
return wildcardsString(input, publicFolder);
}
return wildcardsArray(input, publicFolder);
};
/**
* Handle wildcards in a path (string only), get the real path of each files.
*
* @param {String} input - Path with wildcards
* @param {String} publicFolder - Path to the public folder
* @return {Object}
*/
const wildcardsString = (input, publicFolder) => {
const output = {};
if (input.indexOf('*') > -1) {
output.input = getFilesFromWildcards(input, publicFolder);
}
return output;
};
/**
* Handle wildcards in a path (array only), get the real path of each files.
*
* @param {Array} input - Path with wildcards
* @param {String} publicFolder - Path to the public folder
* @return {Object}
*/
const wildcardsArray = (input, publicFolder) => {
let output = {};
output.input = input; // Transform all wildcards to path file
input.forEach(item => {
output.input = output.input.concat(getFilesFromWildcards(item, publicFolder));
}); // Remove all wildcards from array
for (let i = 0; i < output.input.length; i++) {
if (output.input[i].indexOf('*') > -1) {
output.input.splice(i, 1);
i--;
}
}
return output;
};
/**
* Get the real path of each files.
*
* @param {String} input - Path with wildcards
* @param {String} publicFolder - Path to the public folder
* @return {Object}
*/
const getFilesFromWildcards = (input, publicFolder) => {
let output = [];
if (input.indexOf('*') > -1) {
output = _glob.default.sync((publicFolder || '') + input, null);
}
return output;
};
/**
* Prepend the public folder to each file.
*
* @param {String|Array} input - Path to file(s)
* @param {String} publicFolder - Path to the public folder
* @return {Object}
*/
const setPublicFolder = (input, publicFolder) => {
let output = {};
if (typeof publicFolder !== 'string') {
return output;
}
publicFolder = _path.default.normalize(publicFolder);
if (Array.isArray(input)) {
output.input = input.map(item => {
// Check if publicFolder is already in path
if (_path.default.normalize(item).indexOf(publicFolder) > -1) {
return item;
}
return _path.default.normalize(publicFolder + item);
});
return output;
}
input = _path.default.normalize(input); // Check if publicFolder is already in path
if (input.indexOf(publicFolder) > -1) {
output.input = input;
return output;
}
output.input = _path.default.normalize(publicFolder + input);
return output;
};
/**
* Check if some settings are here.
*
* @param {Object} settings
*/
const checkMandatories = settings => {
['compressor', 'input', 'output'].forEach(item => mandatory(item, settings));
};
/**
* Check if the setting exist.
*
* @param {String} setting
* @param {Object} settings
*/
const mandatory = (setting, settings) => {
if (!settings[setting]) {
throw new Error(setting + ' is mandatory.');
}
};
/**
* Expose `setup()`.
*/

73
node_modules/@node-minify/core/package.json generated vendored Normal file
View File

@@ -0,0 +1,73 @@
{
"_args": [
[
"@node-minify/core@4.1.2",
"/home/runner/work/add-and-commit/add-and-commit"
]
],
"_development": true,
"_from": "@node-minify/core@4.1.2",
"_id": "@node-minify/core@4.1.2",
"_inBundle": false,
"_integrity": "sha512-ke3PT/KXfujIqOaY1wefn8BE94uoaTKSjRk6qj2eowwP9ofhopsmJOmFtoDnEIcX7GMANCP/VGbyj959CrTcvw==",
"_location": "/@node-minify/core",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "@node-minify/core@4.1.2",
"name": "@node-minify/core",
"escapedName": "@node-minify%2fcore",
"scope": "@node-minify",
"rawSpec": "4.1.2",
"saveSpec": null,
"fetchSpec": "4.1.2"
},
"_requiredBy": [
"/@node-minify/cli"
],
"_resolved": "https://registry.npmjs.org/@node-minify/core/-/core-4.1.2.tgz",
"_spec": "4.1.2",
"_where": "/home/runner/work/add-and-commit/add-and-commit",
"author": {
"name": "Rodolphe Stoclin",
"email": "srodolphe@gmail.com"
},
"bugs": {
"url": "https://github.com/srod/node-minify/issues"
},
"dependencies": {
"@node-minify/utils": "^4.1.2",
"glob": "7.1.4",
"mkdirp": "0.5.1"
},
"description": "core of @node-minify",
"directories": {
"lib": "lib",
"test": "__tests__"
},
"engines": {
"node": ">=6.0.0"
},
"files": [
"lib"
],
"gitHead": "b13f16dfcac6f151c371414cf3a8a2969ff08783",
"homepage": "https://github.com/srod/node-minify/tree/master/packages/core#readme",
"keywords": [
"compressor",
"minify",
"minifier"
],
"license": "MIT",
"main": "lib/core.js",
"name": "@node-minify/core",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "git+https://github.com/srod/node-minify.git"
},
"version": "4.1.2"
}