new license file version [CI SKIP]

This commit is contained in:
2023-03-15 13:43:57 +00:00
parent d8a3063735
commit 00359d25c1
5600 changed files with 523898 additions and 2 deletions

View File

@@ -0,0 +1,307 @@
const { EOL } = require('os');
const test = require('ava');
const sinon = require('sinon');
const sh = require('shelljs');
const Git = require('../lib/plugin/git/Git');
const { mkTmpDir, readFile, gitAdd } = require('./util/helpers');
const { factory } = require('./util');
test.beforeEach(() => {
const tmp = mkTmpDir();
sh.pushd('-q', tmp);
});
test.serial('should return whether repo has upstream branch', async t => {
const gitClient = factory(Git);
sh.exec('git init');
gitAdd('line', 'file', 'Add file');
t.false(await gitClient.hasUpstreamBranch());
});
test.serial('should return branch name', async t => {
const gitClient = factory(Git);
sh.exec('git init');
t.is(await gitClient.getBranchName(), null);
sh.exec('git checkout -b feat');
gitAdd('line', 'file', 'Add file');
t.is(await gitClient.getBranchName(), 'feat');
});
test.serial('should return whether tag exists and if working dir is clean', async t => {
const gitClient = factory(Git);
sh.exec('git init');
t.false(await gitClient.tagExists('1.0.0'));
sh.touch('file');
t.false(await gitClient.isWorkingDirClean());
gitAdd('line', 'file', 'Add file');
sh.exec('git tag 1.0.0');
t.true(await gitClient.tagExists('1.0.0'));
t.true(await gitClient.isWorkingDirClean());
});
test.serial('should throw if tag exists', async t => {
const gitClient = factory(Git);
sh.exec('git init');
sh.touch('file');
gitAdd('line', 'file', 'Add file');
sh.exec('git tag 0.0.2');
gitClient.setContext({ latestTagName: '0.0.1', tagName: '0.0.2' });
const expected = { instanceOf: Error, message: /fatal: tag '0\.0\.2' already exists/ };
await t.throwsAsync(gitClient.tag({ name: '0.0.2' }), expected);
});
test.serial('should only warn if tag exists intentionally', async t => {
const gitClient = factory(Git);
const { warn } = gitClient.log;
sh.exec('git init');
sh.touch('file');
gitAdd('line', 'file', 'Add file');
sh.exec('git tag 1.0.0');
gitClient.setContext({ latestTagName: '1.0.0', tagName: '1.0.0' });
await t.notThrowsAsync(gitClient.tag());
t.is(warn.callCount, 1);
t.is(warn.firstCall.args[0], 'Tag "1.0.0" already exists');
});
test.serial('should return the remote url', async t => {
sh.exec(`git init`);
{
const options = { git: { pushRepo: 'origin' } };
const gitClient = factory(Git, { options });
t.is(await gitClient.getRemoteUrl(), null);
sh.exec(`git remote add origin foo`);
t.is(await gitClient.getRemoteUrl(), 'foo');
}
{
const options = { git: { pushRepo: 'another' } };
const gitClient = factory(Git, { options });
t.is(await gitClient.getRemoteUrl(), null);
sh.exec(`git remote add another bar`);
t.is(await gitClient.getRemoteUrl(), 'bar');
}
{
const options = { git: { pushRepo: 'git://github.com/webpro/release-it.git' } };
const gitClient = factory(Git, { options });
t.is(await gitClient.getRemoteUrl(), 'git://github.com/webpro/release-it.git');
}
});
test.serial('should return the non-origin remote', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
gitAdd('line', 'file', 'Add file');
sh.exec('git remote rename origin upstream');
const gitClient = factory(Git);
t.is(await gitClient.getRemoteUrl(), bare);
});
test.serial('should stage, commit, tag and push', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
const version = '1.2.3';
gitAdd(`{"version":"${version}"}`, 'package.json', 'Add package.json');
{
const gitClient = factory(Git);
sh.exec(`git tag ${version}`);
t.is(await gitClient.getLatestTagName(), version);
}
{
const gitClient = factory(Git);
gitAdd('line', 'file', 'Add file');
sh.exec('npm --no-git-tag-version version patch');
await gitClient.stage('package.json');
await gitClient.commit({ message: `Release v1.2.4` });
await gitClient.tag({ name: 'v1.2.4', annotation: 'Release v1.2.4' });
t.is(await gitClient.getLatestTagName(), 'v1.2.4');
await gitClient.push();
const status = sh.exec('git status -uno');
t.true(status.includes('nothing to commit'));
}
});
test.serial('should commit, tag and push with extra args', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
gitAdd('line', 'file', 'Add file');
const options = { git: { commitArgs: '-S', tagArgs: ['-T', 'foo'], pushArgs: ['-U', 'bar', '-V'] } };
const gitClient = factory(Git, { options });
const stub = sinon.stub(gitClient.shell, 'exec').resolves();
await gitClient.stage('package.json');
await gitClient.commit({ message: `Release v1.2.4` });
await gitClient.tag({ name: 'v1.2.4', annotation: 'Release v1.2.4' });
await gitClient.push();
t.true(stub.secondCall.args[0].includes('-S'));
t.is(stub.thirdCall.args[0][5], '-T');
t.is(stub.thirdCall.args[0][6], 'foo');
t.true(stub.lastCall.args[0].join(' ').includes('-U bar -V'));
stub.restore();
});
test.serial('should commit and tag with quoted characters', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
const gitClient = factory(Git, {
options: { git: { commitMessage: 'Release ${version}', tagAnnotation: 'Release ${version}\n\n${changelog}' } }
});
sh.touch('file');
const changelog = `- Foo's${EOL}- "$bar"${EOL}- '$baz'${EOL}- foo`;
gitClient.config.setContext({ version: '1.0.0', changelog });
await gitClient.stage('file');
await gitClient.commit();
await gitClient.tag({ name: '1.0.0' });
await gitClient.push();
{
const { stdout } = sh.exec('git log -1 --format=%s');
t.is(stdout.trim(), 'Release 1.0.0');
}
{
const { stdout } = sh.exec('git tag -n99');
t.is(stdout.trim(), `1.0.0 Release 1.0.0\n \n - Foo's\n - "$bar"\n - '$baz'\n - foo`);
}
});
test.serial('should push to origin', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
gitAdd('line', 'file', 'Add file');
const gitClient = factory(Git);
const spy = sinon.spy(gitClient.shell, 'exec');
await gitClient.push();
t.deepEqual(spy.lastCall.args[0], ['git', 'push']);
const actual = sh.exec('git ls-tree -r HEAD --name-only', { cwd: bare });
t.is(actual.trim(), 'file');
spy.restore();
});
test.serial('should push to tracked upstream branch', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
sh.exec(`git remote rename origin upstream`);
gitAdd('line', 'file', 'Add file');
const gitClient = factory(Git);
const spy = sinon.spy(gitClient.shell, 'exec');
await gitClient.push();
t.deepEqual(spy.lastCall.args[0], ['git', 'push']);
const actual = sh.exec('git ls-tree -r HEAD --name-only', { cwd: bare });
t.is(actual.trim(), 'file');
spy.restore();
});
test.serial('should push to repo url', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
gitAdd('line', 'file', 'Add file');
const options = { git: { pushRepo: 'https://host/repo.git' } };
const gitClient = factory(Git, { options });
const spy = sinon.spy(gitClient.shell, 'exec');
try {
await gitClient.push();
} catch (err) {
t.deepEqual(spy.lastCall.args[0], ['git', 'push', 'https://host/repo.git']);
}
spy.restore();
});
test.serial('should push to remote name (not "origin")', async t => {
const bare = mkTmpDir();
sh.exec(`git init --bare ${bare}`);
sh.exec(`git clone ${bare} .`);
gitAdd('line', 'file', 'Add file');
sh.exec(`git remote add upstream ${sh.exec('git config --get remote.origin.url')}`);
const options = { git: { pushRepo: 'upstream' } };
const gitClient = factory(Git, { options });
const spy = sinon.spy(gitClient.shell, 'exec');
await gitClient.push();
t.deepEqual(spy.lastCall.args[0], ['git', 'push', 'upstream']);
const actual = sh.exec('git ls-tree -r HEAD --name-only', { cwd: bare });
t.is(actual.trim(), 'file');
{
sh.exec(`git checkout -b foo`);
gitAdd('line', 'file', 'Add file');
await gitClient.push();
t.deepEqual(spy.lastCall.args[0], ['git', 'push', '--set-upstream', 'upstream', 'foo']);
t.regex(await spy.lastCall.returnValue, /Branch .?foo.? set up to track remote branch .?foo.? from .?upstream.?/);
}
spy.restore();
});
test.serial('should return repo status', async t => {
const gitClient = factory(Git);
sh.exec('git init');
gitAdd('line', 'file1', 'Add file');
sh.ShellString('line').toEnd('file1');
sh.ShellString('line').toEnd('file2');
sh.exec('git add file2');
t.is(await gitClient.status(), 'M file1\nA file2');
});
test.serial('should reset files', async t => {
const gitClient = factory(Git);
sh.exec('git init');
gitAdd('line', 'file', 'Add file');
sh.ShellString('line').toEnd('file');
t.regex(await readFile('file'), /^line\s*line\s*$/);
await gitClient.reset('file');
t.regex(await readFile('file'), /^line\s*$/);
await gitClient.reset(['file2, file3']);
t.regex(gitClient.log.warn.firstCall.args[0], /Could not reset file2, file3/);
});
test.serial('should roll back when cancelled', async t => {
sh.exec('git init');
sh.exec(`git remote add origin foo`);
const version = '1.2.3';
gitAdd(`{"version":"${version}"}`, 'package.json', 'Add package.json');
const options = { git: { requireCleanWorkingDir: true, commit: true, tag: true, tagName: 'v${version}' } };
const gitClient = factory(Git, { options });
const exec = sinon.spy(gitClient.shell, 'execFormattedCommand');
sh.exec(`git tag ${version}`);
gitAdd('line', 'file', 'Add file');
await gitClient.init();
sh.exec('npm --no-git-tag-version version patch');
gitClient.bump('1.2.4');
await gitClient.beforeRelease();
await gitClient.stage('package.json');
await gitClient.commit({ message: 'Add this' });
await gitClient.tag();
await gitClient.rollbackOnce();
t.is(exec.args[10][0], 'git tag --delete v1.2.4');
t.is(exec.args[11][0], 'git reset --hard HEAD~1');
});
test.serial('should not touch existing history when rolling back', async t => {
sh.exec('git init');
const version = '1.2.3';
gitAdd(`{"version":"${version}"}`, 'package.json', 'Add package.json');
const options = { git: { requireCleanWorkingDir: true, commit: true, tag: true } };
const gitClient = factory(Git, { options });
sh.exec(`git tag ${version}`);
const exec = sinon.spy(gitClient.shell, 'execFormattedCommand');
gitClient.config.setContext({ version: '1.2.4' });
await gitClient.beforeRelease();
await gitClient.commit();
await gitClient.rollbackOnce();
t.is(exec.args[3][0], 'git reset --hard HEAD');
});
test.serial('should not roll back with risky config', async t => {
sh.exec('git init');
const options = { git: { requireCleanWorkingDir: false, commit: true, tag: true } };
const gitClient = factory(Git, { options });
await gitClient.beforeRelease();
t.is('rollbackOnce' in gitClient, false);
});

View File

@@ -0,0 +1,11 @@
'use strict';
var stringify = require('./stringify');
var parse = require('./parse');
var formats = require('./formats');
module.exports = {
formats: formats,
parse: parse,
stringify: stringify
};

View File

@@ -0,0 +1,55 @@
# cli-cursor [![Build Status](https://travis-ci.org/sindresorhus/cli-cursor.svg?branch=master)](https://travis-ci.org/sindresorhus/cli-cursor)
> Toggle the CLI cursor
The cursor is [gracefully restored](https://github.com/sindresorhus/restore-cursor) if the process exits.
## Install
```
$ npm install cli-cursor
```
## Usage
```js
const cliCursor = require('cli-cursor');
cliCursor.hide();
const unicornsAreAwesome = true;
cliCursor.toggle(unicornsAreAwesome);
```
## API
### .show(stream?)
### .hide(stream?)
### .toggle(force?, stream?)
#### force
Useful for showing or hiding the cursor based on a boolean.
#### stream
Type: `stream.Writable`<br>
Default: `process.stderr`
---
<div align="center">
<b>
<a href="https://tidelift.com/subscription/pkg/npm-cli-cursor?utm_source=npm-cli-cursor&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
</b>
<br>
<sub>
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
</sub>
</div>

View File

@@ -0,0 +1,43 @@
{
"name": "yocto-queue",
"version": "0.1.0",
"description": "Tiny queue data structure",
"license": "MIT",
"repository": "sindresorhus/yocto-queue",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"queue",
"data",
"structure",
"algorithm",
"queues",
"queuing",
"list",
"array",
"linkedlist",
"fifo",
"enqueue",
"dequeue",
"data-structure"
],
"devDependencies": {
"ava": "^2.4.0",
"tsd": "^0.13.1",
"xo": "^0.35.0"
}
}

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"2":"C K L H M N O P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t"},C:{"2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB DC EC"},D:{"2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d OC PC QC RC qB 9B SC rB"},G:{"2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC kC lC mC 2B 3B 4B 5B sB 6B 7B 8B"},H:{"2":"nC"},I:{"2":"tB I D oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"2":"A B C e qB 9B rB"},L:{"2":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"2":"uC"},P:{"2":"I vC wC xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C"},Q:{"2":"1B"},R:{"2":"8C"},S:{"2":"9C"}},B:5,C:"Media Queries: scripting media feature"};

View File

@@ -0,0 +1,7 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("rxjs-compat/operator/race"));
//# sourceMappingURL=race.js.map

View File

@@ -0,0 +1,6 @@
export declare const lookupCache: {
[locale: string]: {
[messageId: string]: any;
};
};
export declare const lookup: (path: string, refLocale: string) => any;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"J E F G A B BC"},B:{"1":"P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t","2":"C K L H M N O"},C:{"2":"0 1 2 3 4 5 6 7 8 9 CC tB I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB DC EC"},D:{"1":"XB YB uB ZB vB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R S T U V W X Y Z a b c d f g h i j k l m n o p q r s D t xB yB FC","2":"0 1 2 3 4 5 6 7 8 9 I u J E F G A B C K L H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB LB MB NB","66":"OB PB QB","129":"RB SB TB UB VB WB"},E:{"2":"I u J E F G A B C K L H GC zB HC IC JC KC 0B qB rB 1B LC MC 2B 3B 4B 5B sB 6B 7B 8B NC"},F:{"1":"LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB bB cB dB eB fB gB hB iB jB kB e lB mB nB oB pB P Q R wB S T U V W X Y Z a b c d","2":"0 1 2 3 4 5 6 7 8 9 G B C H M N O v w x y z AB BB CB DB EB FB GB HB IB JB KB OC PC QC RC qB 9B SC rB"},G:{"1":"kC lC mC 2B 3B 4B 5B sB 6B 7B 8B","2":"F zB TC AC UC VC WC XC YC ZC aC bC cC dC eC fC gC hC iC jC"},H:{"2":"nC"},I:{"1":"D","2":"tB I oC pC qC rC AC sC tC"},J:{"2":"E A"},K:{"1":"e","2":"A B C qB 9B rB"},L:{"1":"D"},M:{"2":"D"},N:{"2":"A B"},O:{"1":"uC"},P:{"1":"xC yC zC 0B 0C 1C 2C 3C 4C sB 5C 6C 7C","2":"I vC wC"},Q:{"1":"1B"},R:{"1":"8C"},S:{"2":"9C"}},B:5,C:"Credential Management API"};

View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2014 Jonathan Ong me@jongleberry.com
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.

View File

@@ -0,0 +1 @@
export * from 'rxjs-compat/operators/distinctUntilKeyChanged';

View File

@@ -0,0 +1,7 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("rxjs-compat/operator/catch"));
//# sourceMappingURL=catch.js.map

View File

@@ -0,0 +1,7 @@
"use strict";
function __export(m) {
for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];
}
Object.defineProperty(exports, "__esModule", { value: true });
__export(require("rxjs-compat/observable/merge"));
//# sourceMappingURL=merge.js.map