This commit is contained in:
Stephen Franceschelli 2019-07-30 13:41:05 -04:00
commit c1a589c5b6
7078 changed files with 1882834 additions and 319 deletions

21
node_modules/opencollective-postinstall/LICENSE generated vendored Normal file
View file

@ -0,0 +1,21 @@
MIT License
Copyright (c) 2018 Open Collective
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.

32
node_modules/opencollective-postinstall/README.md generated vendored Normal file
View file

@ -0,0 +1,32 @@
# Open Collective postinstall
Lightweight npm postinstall message to invite people to donate to your collective
## Installation
```
npm install --save opencollective-postinstall
```
And in your `package.json` add:
```json
{
...
"scripts": {
"postinstall": "opencollective-postinstall"
},
"collective": {
"url": "https://opencollective.com/webpack"
}
...
}
```
## Disabling this message
In some places (e.g. CI) you may want to disable this output. You can do this by setting the environment variable `DISABLE_OPENCOLLECTIVE=true`.
It will not be shown if npm's log level is set to silent (`--silent`), warn (`--quiet`), or error (`--loglevel error`).
Note: This is a lightweight alternative to the [opencollective-cli](https://github.com/opencollective/opencollective-cli) that offers a more complete postinstall message with the current balance and ASCII logo of the collective.

18
node_modules/opencollective-postinstall/index.js generated vendored Normal file
View file

@ -0,0 +1,18 @@
#!/usr/bin/env node
function isTrue(value) {
return !!value && value !== "0" && value !== "false"
}
var envDisable = isTrue(process.env.DISABLE_OPENCOLLECTIVE) || isTrue(process.env.CI);
var logLevel = process.env.npm_config_loglevel;
var logLevelDisplay = ['silent', 'error', 'warn'].indexOf(logLevel) > -1;
if (!envDisable && !logLevelDisplay) {
var pkg = require(require('path').resolve('./package.json'));
if (pkg.collective) {
console.log(`\u001b[96m\u001b[1mThank you for using ${pkg.name}!\u001b[96m\u001b[1m`);
console.log(`\u001b[0m\u001b[96mIf you rely on this package, please consider supporting our open collective:\u001b[22m\u001b[39m`);
console.log(`> \u001b[94m${pkg.collective.url}/donate\u001b[0m\n`);
}
}

69
node_modules/opencollective-postinstall/index.test.js generated vendored Normal file
View file

@ -0,0 +1,69 @@
jest.mock('./package.json', () => ({
name: 'testpkg2',
collective: {url: 'testurl'}
}), {virtual: true});
describe('test all the things', () => {
const env = global.process.env;
const console = global.console;
beforeEach(() => {
global.console = {log: jest.fn(), warn: global.console.warn};
});
afterEach(() => {
global.process.env = env;
global.console.log.mockReset();
global.console = console;
jest.resetModules();
});
describe('outputs the correct values', () => {
it('when called without args', () =>{
expect(global.console.log).not.toHaveBeenCalled();
require('./index');
expect(global.console.log).toHaveBeenCalledTimes(3);
expect(global.console.log).toHaveBeenNthCalledWith(1,
`\u001b[96m\u001b[1mThank you for using testpkg2!\u001b[96m\u001b[1m`
);
expect(global.console.log).toHaveBeenNthCalledWith(3,
`> \u001b[94mtesturl/donate\u001b[0m\n`
);
});
[0, false].forEach(falsy => {
it(`when Disable is set to ${falsy}`, () => {
global.process.env = {DISABLE_OPENCOLLECTIVE: falsy};
expect(global.console.log).not.toHaveBeenCalled();
require('./index');
expect(global.console.log).toHaveBeenCalledTimes(3);
});
});
['notice', 'http', 'timing', 'info', 'verbose', 'silly'].forEach(log => {
it(`when config_loglevel is set to ${log}`, () => {
global.process.env = {npm_config_loglevel: log}
expect(global.console.log).not.toHaveBeenCalled();
require('./index');
expect(global.console.log).toHaveBeenCalledTimes(3);
});
});
});
describe('does not show output', () => {
[1, true].forEach(truthy => {
it(`when Disable is set to ${truthy}`, () => {
global.process.env = {DISABLE_OPENCOLLECTIVE: truthy};
expect(global.console.log).not.toHaveBeenCalled();
require('./index');
expect(global.console.log).not.toHaveBeenCalled();
});
});
['warn', 'error', 'silent'].forEach(log => {
it(`when npm_config_loglevel is set to ${log}`, () => {
global.process.env = {npm_config_loglevel: log}
require('./index');
expect(global.console.log).not.toHaveBeenCalled();
});
});
});
});

59
node_modules/opencollective-postinstall/package.json generated vendored Normal file
View file

@ -0,0 +1,59 @@
{
"_from": "opencollective-postinstall@^2.0.2",
"_id": "opencollective-postinstall@2.0.2",
"_inBundle": false,
"_integrity": "sha512-pVOEP16TrAO2/fjej1IdOyupJY8KDUM1CvsaScRbw6oddvpQoOfGk4ywha0HKKVAD6RkW4x6Q+tNBwhf3Bgpuw==",
"_location": "/opencollective-postinstall",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "opencollective-postinstall@^2.0.2",
"name": "opencollective-postinstall",
"escapedName": "opencollective-postinstall",
"rawSpec": "^2.0.2",
"saveSpec": null,
"fetchSpec": "^2.0.2"
},
"_requiredBy": [
"/husky"
],
"_resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.2.tgz",
"_shasum": "5657f1bede69b6e33a45939b061eb53d3c6c3a89",
"_spec": "opencollective-postinstall@^2.0.2",
"_where": "E:\\github\\setup-java\\node_modules\\husky",
"author": {
"name": "Xavier Damman",
"url": "@xdamman"
},
"bin": {
"opencollective-postinstall": "index.js"
},
"bugs": {
"url": "https://github.com/opencollective/opencollective-postinstall/issues"
},
"bundleDependencies": false,
"deprecated": false,
"description": "Lightweight npm postinstall message to invite people to donate to your collective",
"devDependencies": {
"jest": "^24.0.0"
},
"homepage": "https://github.com/opencollective/opencollective-postinstall#readme",
"keywords": [
"opencollective",
"donation",
"funding",
"sustain"
],
"license": "MIT",
"main": "index.js",
"name": "opencollective-postinstall",
"repository": {
"type": "git",
"url": "git+https://github.com/opencollective/opencollective-postinstall.git"
},
"scripts": {
"test": "jest"
},
"version": "2.0.2"
}