提交 0d764de5 编写于 作者: 沐夕花开's avatar 沐夕花开

feat: 修改文字单位为px

为适应横屏,文字单位调整成px,新defaultOpen用于控制树形结构是否自动展开
上级 23138d1f

要显示的变更太多。

To preserve performance only 1000 of 1000+ files are displayed.
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../acorn/bin/acorn" "$@"
else
exec node "$basedir/../acorn/bin/acorn" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\acorn\bin\acorn" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
} else {
& "$basedir/node$exe" "$basedir/../acorn/bin/acorn" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../acorn/bin/acorn" $args
} else {
& "node$exe" "$basedir/../acorn/bin/acorn" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../commitizen/bin/commitizen" "$@"
else
exec node "$basedir/../commitizen/bin/commitizen" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\commitizen\bin\commitizen" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../commitizen/bin/commitizen" $args
} else {
& "$basedir/node$exe" "$basedir/../commitizen/bin/commitizen" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../commitizen/bin/commitizen" $args
} else {
& "node$exe" "$basedir/../commitizen/bin/commitizen" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../commitizen/bin/git-cz" "$@"
else
exec node "$basedir/../commitizen/bin/git-cz" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\commitizen\bin\git-cz" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../commitizen/bin/git-cz" $args
} else {
& "$basedir/node$exe" "$basedir/../commitizen/bin/git-cz" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../commitizen/bin/git-cz" $args
} else {
& "node$exe" "$basedir/../commitizen/bin/git-cz" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../commitizen/bin/git-cz" "$@"
else
exec node "$basedir/../commitizen/bin/git-cz" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\commitizen\bin\git-cz" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../commitizen/bin/git-cz" $args
} else {
& "$basedir/node$exe" "$basedir/../commitizen/bin/git-cz" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../commitizen/bin/git-cz" $args
} else {
& "node$exe" "$basedir/../commitizen/bin/git-cz" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../ts-node/dist/bin.js" "$@"
else
exec node "$basedir/../ts-node/dist/bin.js" "$@"
fi
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../ts-node/dist/bin-cwd.js" "$@"
else
exec node "$basedir/../ts-node/dist/bin-cwd.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-cwd.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args
} else {
& "$basedir/node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args
} else {
& "node$exe" "$basedir/../ts-node/dist/bin-cwd.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../ts-node/dist/bin-esm.js" "$@"
else
exec node "$basedir/../ts-node/dist/bin-esm.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-esm.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args
} else {
& "$basedir/node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args
} else {
& "node$exe" "$basedir/../ts-node/dist/bin-esm.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../ts-node/dist/bin-script.js" "$@"
else
exec node "$basedir/../ts-node/dist/bin-script.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-script.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script.js" $args
} else {
& "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../ts-node/dist/bin-script.js" $args
} else {
& "node$exe" "$basedir/../ts-node/dist/bin-script.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../ts-node/dist/bin-transpile.js" "$@"
else
exec node "$basedir/../ts-node/dist/bin-transpile.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-transpile.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args
} else {
& "$basedir/node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args
} else {
& "node$exe" "$basedir/../ts-node/dist/bin-transpile.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin.js" $args
} else {
& "$basedir/node$exe" "$basedir/../ts-node/dist/bin.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../ts-node/dist/bin.js" $args
} else {
& "node$exe" "$basedir/../ts-node/dist/bin.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@"
else
exec node "$basedir/../ts-node/dist/bin-script-deprecated.js" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\ts-node\dist\bin-script-deprecated.js" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
} else {
& "$basedir/node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
} else {
& "node$exe" "$basedir/../ts-node/dist/bin-script-deprecated.js" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../typescript/bin/tsc" "$@"
else
exec node "$basedir/../typescript/bin/tsc" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsc" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args
} else {
& "$basedir/node$exe" "$basedir/../typescript/bin/tsc" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../typescript/bin/tsc" $args
} else {
& "node$exe" "$basedir/../typescript/bin/tsc" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../typescript/bin/tsserver" "$@"
else
exec node "$basedir/../typescript/bin/tsserver" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\typescript\bin\tsserver" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args
} else {
& "$basedir/node$exe" "$basedir/../typescript/bin/tsserver" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../typescript/bin/tsserver" $args
} else {
& "node$exe" "$basedir/../typescript/bin/tsserver" $args
}
$ret=$LASTEXITCODE
}
exit $ret
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
exec "$basedir/node" "$basedir/../which/bin/which" "$@"
else
exec node "$basedir/../which/bin/which" "$@"
fi
@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\which\bin\which" %*
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "$basedir/node$exe" "$basedir/../which/bin/which" $args
} else {
& "$basedir/node$exe" "$basedir/../which/bin/which" $args
}
$ret=$LASTEXITCODE
} else {
# Support pipeline input
if ($MyInvocation.ExpectingInput) {
$input | & "node$exe" "$basedir/../which/bin/which" $args
} else {
& "node$exe" "$basedir/../which/bin/which" $args
}
$ret=$LASTEXITCODE
}
exit $ret
此差异已折叠。
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
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.
# @babel/code-frame
> Generate errors that contain a code frame that point to source locations.
See our website [@babel/code-frame](https://babeljs.io/docs/en/babel-code-frame) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/code-frame
```
or using yarn:
```sh
yarn add @babel/code-frame --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.codeFrameColumns = codeFrameColumns;
exports.default = _default;
var _highlight = require("@babel/highlight");
let deprecationWarningShown = false;
function getDefs(chalk) {
return {
gutter: chalk.grey,
marker: chalk.red.bold,
message: chalk.red.bold
};
}
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
function getMarkerLines(loc, source, opts) {
const startLoc = Object.assign({
column: 0,
line: -1
}, loc.start);
const endLoc = Object.assign({}, startLoc, loc.end);
const {
linesAbove = 2,
linesBelow = 3
} = opts || {};
const startLine = startLoc.line;
const startColumn = startLoc.column;
const endLine = endLoc.line;
const endColumn = endLoc.column;
let start = Math.max(startLine - (linesAbove + 1), 0);
let end = Math.min(source.length, endLine + linesBelow);
if (startLine === -1) {
start = 0;
}
if (endLine === -1) {
end = source.length;
}
const lineDiff = endLine - startLine;
const markerLines = {};
if (lineDiff) {
for (let i = 0; i <= lineDiff; i++) {
const lineNumber = i + startLine;
if (!startColumn) {
markerLines[lineNumber] = true;
} else if (i === 0) {
const sourceLength = source[lineNumber - 1].length;
markerLines[lineNumber] = [startColumn, sourceLength - startColumn + 1];
} else if (i === lineDiff) {
markerLines[lineNumber] = [0, endColumn];
} else {
const sourceLength = source[lineNumber - i].length;
markerLines[lineNumber] = [0, sourceLength];
}
}
} else {
if (startColumn === endColumn) {
if (startColumn) {
markerLines[startLine] = [startColumn, 0];
} else {
markerLines[startLine] = true;
}
} else {
markerLines[startLine] = [startColumn, endColumn - startColumn];
}
}
return {
start,
end,
markerLines
};
}
function codeFrameColumns(rawLines, loc, opts = {}) {
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
const chalk = (0, _highlight.getChalk)(opts);
const defs = getDefs(chalk);
const maybeHighlight = (chalkFn, string) => {
return highlighted ? chalkFn(string) : string;
};
const lines = rawLines.split(NEWLINE);
const {
start,
end,
markerLines
} = getMarkerLines(loc, lines, opts);
const hasColumns = loc.start && typeof loc.start.column === "number";
const numberMaxWidth = String(end).length;
const highlightedLines = highlighted ? (0, _highlight.default)(rawLines, opts) : rawLines;
let frame = highlightedLines.split(NEWLINE, end).slice(start, end).map((line, index) => {
const number = start + 1 + index;
const paddedNumber = ` ${number}`.slice(-numberMaxWidth);
const gutter = ` ${paddedNumber} |`;
const hasMarker = markerLines[number];
const lastMarkerLine = !markerLines[number + 1];
if (hasMarker) {
let markerLine = "";
if (Array.isArray(hasMarker)) {
const markerSpacing = line.slice(0, Math.max(hasMarker[0] - 1, 0)).replace(/[^\t]/g, " ");
const numberOfMarkers = hasMarker[1] || 1;
markerLine = ["\n ", maybeHighlight(defs.gutter, gutter.replace(/\d/g, " ")), " ", markerSpacing, maybeHighlight(defs.marker, "^").repeat(numberOfMarkers)].join("");
if (lastMarkerLine && opts.message) {
markerLine += " " + maybeHighlight(defs.message, opts.message);
}
}
return [maybeHighlight(defs.marker, ">"), maybeHighlight(defs.gutter, gutter), line.length > 0 ? ` ${line}` : "", markerLine].join("");
} else {
return ` ${maybeHighlight(defs.gutter, gutter)}${line.length > 0 ? ` ${line}` : ""}`;
}
}).join("\n");
if (opts.message && !hasColumns) {
frame = `${" ".repeat(numberMaxWidth + 1)}${opts.message}\n${frame}`;
}
if (highlighted) {
return chalk.reset(frame);
} else {
return frame;
}
}
function _default(rawLines, lineNumber, colNumber, opts = {}) {
if (!deprecationWarningShown) {
deprecationWarningShown = true;
const message = "Passing lineNumber and colNumber is deprecated to @babel/code-frame. Please use `codeFrameColumns`.";
if (process.emitWarning) {
process.emitWarning(message, "DeprecationWarning");
} else {
const deprecationError = new Error(message);
deprecationError.name = "DeprecationWarning";
console.warn(new Error(message));
}
}
colNumber = Math.max(colNumber, 0);
const location = {
start: {
column: colNumber,
line: lineNumber
}
};
return codeFrameColumns(rawLines, location, opts);
}
\ No newline at end of file
{
"name": "@babel/code-frame",
"version": "7.16.7",
"description": "Generate errors that contain a code frame that point to source locations.",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-code-frame",
"bugs": "https://github.com/babel/babel/issues?utf8=%E2%9C%93&q=is%3Aissue+is%3Aopen",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-code-frame"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/highlight": "^7.16.7"
},
"devDependencies": {
"@types/chalk": "^2.0.0",
"chalk": "^2.0.0",
"strip-ansi": "^4.0.0"
},
"engines": {
"node": ">=6.9.0"
}
}
\ No newline at end of file
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
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.
# @babel/helper-validator-identifier
> Validate identifier/keywords name
See our website [@babel/helper-validator-identifier](https://babeljs.io/docs/en/babel-helper-validator-identifier) for more information.
## Install
Using npm:
```sh
npm install --save @babel/helper-validator-identifier
```
or using yarn:
```sh
yarn add @babel/helper-validator-identifier
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isIdentifierChar = isIdentifierChar;
exports.isIdentifierName = isIdentifierName;
exports.isIdentifierStart = isIdentifierStart;
let nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088e\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c88\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7ca\ua7d0\ua7d1\ua7d3\ua7d5-\ua7d9\ua7f2-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";
let nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0898-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1ace\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f";
const nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
const nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");
nonASCIIidentifierStartChars = nonASCIIidentifierChars = null;
const astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 68, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 349, 41, 7, 1, 79, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 85, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 159, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 264, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 328, 18, 190, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1070, 4050, 582, 8634, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 689, 63, 129, 74, 6, 0, 67, 12, 65, 1, 2, 0, 29, 6135, 9, 1237, 43, 8, 8936, 3, 2, 6, 2, 1, 2, 290, 46, 2, 18, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 482, 44, 11, 6, 17, 0, 322, 29, 19, 43, 1269, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4152, 8, 221, 3, 5761, 15, 7472, 3104, 541, 1507, 4938];
const astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 370, 1, 154, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 161, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 193, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 84, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 406, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 330, 3, 19306, 9, 87, 9, 39, 4, 60, 6, 26, 9, 1014, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4706, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 262, 6, 10, 9, 357, 0, 62, 13, 1495, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];
function isInAstralSet(code, set) {
let pos = 0x10000;
for (let i = 0, length = set.length; i < length; i += 2) {
pos += set[i];
if (pos > code) return false;
pos += set[i + 1];
if (pos >= code) return true;
}
return false;
}
function isIdentifierStart(code) {
if (code < 65) return code === 36;
if (code <= 90) return true;
if (code < 97) return code === 95;
if (code <= 122) return true;
if (code <= 0xffff) {
return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes);
}
function isIdentifierChar(code) {
if (code < 48) return code === 36;
if (code < 58) return true;
if (code < 65) return false;
if (code <= 90) return true;
if (code < 97) return code === 95;
if (code <= 122) return true;
if (code <= 0xffff) {
return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code));
}
return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes);
}
function isIdentifierName(name) {
let isFirst = true;
for (let i = 0; i < name.length; i++) {
let cp = name.charCodeAt(i);
if ((cp & 0xfc00) === 0xd800 && i + 1 < name.length) {
const trail = name.charCodeAt(++i);
if ((trail & 0xfc00) === 0xdc00) {
cp = 0x10000 + ((cp & 0x3ff) << 10) + (trail & 0x3ff);
}
}
if (isFirst) {
isFirst = false;
if (!isIdentifierStart(cp)) {
return false;
}
} else if (!isIdentifierChar(cp)) {
return false;
}
}
return !isFirst;
}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
Object.defineProperty(exports, "isIdentifierChar", {
enumerable: true,
get: function () {
return _identifier.isIdentifierChar;
}
});
Object.defineProperty(exports, "isIdentifierName", {
enumerable: true,
get: function () {
return _identifier.isIdentifierName;
}
});
Object.defineProperty(exports, "isIdentifierStart", {
enumerable: true,
get: function () {
return _identifier.isIdentifierStart;
}
});
Object.defineProperty(exports, "isKeyword", {
enumerable: true,
get: function () {
return _keyword.isKeyword;
}
});
Object.defineProperty(exports, "isReservedWord", {
enumerable: true,
get: function () {
return _keyword.isReservedWord;
}
});
Object.defineProperty(exports, "isStrictBindOnlyReservedWord", {
enumerable: true,
get: function () {
return _keyword.isStrictBindOnlyReservedWord;
}
});
Object.defineProperty(exports, "isStrictBindReservedWord", {
enumerable: true,
get: function () {
return _keyword.isStrictBindReservedWord;
}
});
Object.defineProperty(exports, "isStrictReservedWord", {
enumerable: true,
get: function () {
return _keyword.isStrictReservedWord;
}
});
var _identifier = require("./identifier");
var _keyword = require("./keyword");
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.isKeyword = isKeyword;
exports.isReservedWord = isReservedWord;
exports.isStrictBindOnlyReservedWord = isStrictBindOnlyReservedWord;
exports.isStrictBindReservedWord = isStrictBindReservedWord;
exports.isStrictReservedWord = isStrictReservedWord;
const reservedWords = {
keyword: ["break", "case", "catch", "continue", "debugger", "default", "do", "else", "finally", "for", "function", "if", "return", "switch", "throw", "try", "var", "const", "while", "with", "new", "this", "super", "class", "extends", "export", "import", "null", "true", "false", "in", "instanceof", "typeof", "void", "delete"],
strict: ["implements", "interface", "let", "package", "private", "protected", "public", "static", "yield"],
strictBind: ["eval", "arguments"]
};
const keywords = new Set(reservedWords.keyword);
const reservedWordsStrictSet = new Set(reservedWords.strict);
const reservedWordsStrictBindSet = new Set(reservedWords.strictBind);
function isReservedWord(word, inModule) {
return inModule && word === "await" || word === "enum";
}
function isStrictReservedWord(word, inModule) {
return isReservedWord(word, inModule) || reservedWordsStrictSet.has(word);
}
function isStrictBindOnlyReservedWord(word) {
return reservedWordsStrictBindSet.has(word);
}
function isStrictBindReservedWord(word, inModule) {
return isStrictReservedWord(word, inModule) || isStrictBindOnlyReservedWord(word);
}
function isKeyword(word) {
return keywords.has(word);
}
\ No newline at end of file
{
"name": "@babel/helper-validator-identifier",
"version": "7.16.7",
"description": "Validate identifier/keywords name",
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-helper-validator-identifier"
},
"license": "MIT",
"publishConfig": {
"access": "public"
},
"main": "./lib/index.js",
"exports": {
".": "./lib/index.js",
"./package.json": "./package.json"
},
"devDependencies": {
"@unicode/unicode-14.0.0": "^1.2.1",
"charcodes": "^0.2.0"
},
"engines": {
"node": ">=6.9.0"
},
"author": "The Babel Team (https://babel.dev/team)"
}
\ No newline at end of file
"use strict";
// Always use the latest available version of Unicode!
// https://tc39.github.io/ecma262/#sec-conformance
const version = "14.0.0";
const start = require("@unicode/unicode-" +
version +
"/Binary_Property/ID_Start/code-points.js").filter(function (ch) {
return ch > 0x7f;
});
let last = -1;
const cont = [0x200c, 0x200d].concat(
require("@unicode/unicode-" +
version +
"/Binary_Property/ID_Continue/code-points.js").filter(function (ch) {
return ch > 0x7f && search(start, ch, last + 1) == -1;
})
);
function search(arr, ch, starting) {
for (let i = starting; arr[i] <= ch && i < arr.length; last = i++) {
if (arr[i] === ch) return i;
}
return -1;
}
function pad(str, width) {
while (str.length < width) str = "0" + str;
return str;
}
function esc(code) {
const hex = code.toString(16);
if (hex.length <= 2) return "\\x" + pad(hex, 2);
else return "\\u" + pad(hex, 4);
}
function generate(chars) {
const astral = [];
let re = "";
for (let i = 0, at = 0x10000; i < chars.length; i++) {
const from = chars[i];
let to = from;
while (i < chars.length - 1 && chars[i + 1] == to + 1) {
i++;
to++;
}
if (to <= 0xffff) {
if (from == to) re += esc(from);
else if (from + 1 == to) re += esc(from) + esc(to);
else re += esc(from) + "-" + esc(to);
} else {
astral.push(from - at, to - from);
at = to;
}
}
return { nonASCII: re, astral: astral };
}
const startData = generate(start);
const contData = generate(cont);
console.log("/* prettier-ignore */");
console.log('let nonASCIIidentifierStartChars = "' + startData.nonASCII + '";');
console.log("/* prettier-ignore */");
console.log('let nonASCIIidentifierChars = "' + contData.nonASCII + '";');
console.log("/* prettier-ignore */");
console.log(
"const astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"
);
console.log("/* prettier-ignore */");
console.log(
"const astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"
);
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
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.
# @babel/highlight
> Syntax highlight JavaScript strings for output in terminals.
See our website [@babel/highlight](https://babeljs.io/docs/en/babel-highlight) for more information.
## Install
Using npm:
```sh
npm install --save-dev @babel/highlight
```
or using yarn:
```sh
yarn add @babel/highlight --dev
```
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = highlight;
exports.getChalk = getChalk;
exports.shouldHighlight = shouldHighlight;
var _jsTokens = require("js-tokens");
var _helperValidatorIdentifier = require("@babel/helper-validator-identifier");
var _chalk = require("chalk");
const sometimesKeywords = new Set(["as", "async", "from", "get", "of", "set"]);
function getDefs(chalk) {
return {
keyword: chalk.cyan,
capitalized: chalk.yellow,
jsxIdentifier: chalk.yellow,
punctuator: chalk.yellow,
number: chalk.magenta,
string: chalk.green,
regex: chalk.magenta,
comment: chalk.grey,
invalid: chalk.white.bgRed.bold
};
}
const NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
const BRACKET = /^[()[\]{}]$/;
let tokenize;
{
const JSX_TAG = /^[a-z][\w-]*$/i;
const getTokenType = function (token, offset, text) {
if (token.type === "name") {
if ((0, _helperValidatorIdentifier.isKeyword)(token.value) || (0, _helperValidatorIdentifier.isStrictReservedWord)(token.value, true) || sometimesKeywords.has(token.value)) {
return "keyword";
}
if (JSX_TAG.test(token.value) && (text[offset - 1] === "<" || text.slice(offset - 2, offset) == "</")) {
return "jsxIdentifier";
}
if (token.value[0] !== token.value[0].toLowerCase()) {
return "capitalized";
}
}
if (token.type === "punctuator" && BRACKET.test(token.value)) {
return "bracket";
}
if (token.type === "invalid" && (token.value === "@" || token.value === "#")) {
return "punctuator";
}
return token.type;
};
tokenize = function* (text) {
let match;
while (match = _jsTokens.default.exec(text)) {
const token = _jsTokens.matchToToken(match);
yield {
type: getTokenType(token, match.index, text),
value: token.value
};
}
};
}
function highlightTokens(defs, text) {
let highlighted = "";
for (const {
type,
value
} of tokenize(text)) {
const colorize = defs[type];
if (colorize) {
highlighted += value.split(NEWLINE).map(str => colorize(str)).join("\n");
} else {
highlighted += value;
}
}
return highlighted;
}
function shouldHighlight(options) {
return !!_chalk.supportsColor || options.forceColor;
}
function getChalk(options) {
return options.forceColor ? new _chalk.constructor({
enabled: true,
level: 1
}) : _chalk;
}
function highlight(code, options = {}) {
if (code !== "" && shouldHighlight(options)) {
const chalk = getChalk(options);
const defs = getDefs(chalk);
return highlightTokens(defs, code);
} else {
return code;
}
}
\ No newline at end of file
{
"name": "@babel/highlight",
"version": "7.17.9",
"description": "Syntax highlight JavaScript strings for output in terminals.",
"author": "The Babel Team (https://babel.dev/team)",
"homepage": "https://babel.dev/docs/en/next/babel-highlight",
"license": "MIT",
"publishConfig": {
"access": "public"
},
"repository": {
"type": "git",
"url": "https://github.com/babel/babel.git",
"directory": "packages/babel-highlight"
},
"main": "./lib/index.js",
"dependencies": {
"@babel/helper-validator-identifier": "^7.16.7",
"chalk": "^2.0.0",
"js-tokens": "^4.0.0"
},
"devDependencies": {
"@types/chalk": "^2.0.0",
"strip-ansi": "^4.0.0"
},
"engines": {
"node": ">=6.9.0"
}
}
\ No newline at end of file
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [16.2.1](https://github.com/conventional-changelog/commitlint/compare/v16.2.0...v16.2.1) (2022-02-13)
**Note:** Version bump only for package @commitlint/config-validator
# [16.1.0](https://github.com/conventional-changelog/commitlint/compare/v16.0.3...v16.1.0) (2022-01-20)
### Features
* **load:** accept functions as parser presets ([#2982](https://github.com/conventional-changelog/commitlint/issues/2982)) ([420e8d6](https://github.com/conventional-changelog/commitlint/commit/420e8d6a4d5663ade953272275a9e0fa7c5ddff0)), closes [#2964](https://github.com/conventional-changelog/commitlint/issues/2964) [#2964](https://github.com/conventional-changelog/commitlint/issues/2964)
# [16.0.0](https://github.com/conventional-changelog/commitlint/compare/v15.0.0...v16.0.0) (2021-12-26)
### Features
* config validation ([#2412](https://github.com/conventional-changelog/commitlint/issues/2412)) ([c717202](https://github.com/conventional-changelog/commitlint/commit/c7172022097b11f46b33617e4a94d751243c1049)), closes [#327](https://github.com/conventional-changelog/commitlint/issues/327)
{
"$schema": "http://json-schema.org/draft-07/schema",
"default": {},
"type": "object",
"definitions": {
"rule": {
"oneOf": [
{
"description": "A rule",
"type": "array",
"items": [
{
"description": "Level: 0 disables the rule. For 1 it will be considered a warning, for 2 an error",
"type": "number",
"enum": [0, 1, 2]
},
{
"description": "Applicable: always|never: never inverts the rule",
"type": "string",
"enum": ["always", "never"]
},
{
"description": "Value: the value for this rule"
}
],
"minItems": 1,
"maxItems": 3,
"additionalItems": false
},
{
"description": "A rule",
"typeof": "function"
}
]
}
},
"properties": {
"extends": {
"description": "Resolveable ids to commitlint configurations to extend",
"oneOf": [
{
"type": "array",
"items": { "type": "string" }
},
{ "type": "string" }
]
},
"parserPreset": {
"description": "Resolveable id to conventional-changelog parser preset to import and use",
"oneOf": [
{ "type": "string" },
{
"type": "object",
"properties": {
"name": { "type": "string" },
"path": { "type": "string" },
"parserOpts": {}
},
"additionalProperties": true
},
{ "typeof": "function" }
]
},
"helpUrl": {
"description": "Custom URL to show upon failure",
"type": "string"
},
"formatter": {
"description": "Resolveable id to package, from node_modules, which formats the output",
"type": "string"
},
"rules": {
"description": "Rules to check against",
"type": "object",
"propertyNames": { "type": "string" },
"additionalProperties": { "$ref": "#/definitions/rule" }
},
"plugins": {
"description": "Resolveable ids of commitlint plugins from node_modules",
"type": "array",
"items": {
"anyOf": [
{ "type": "string" },
{
"required": ["rules"],
"rules": {}
}
]
}
},
"ignores": {
"type": "array",
"items": { "typeof": "function" },
"description": "Additional commits to ignore, defined by ignore matchers"
},
"defaultIgnores": {
"description": "Whether commitlint uses the default ignore rules",
"type": "boolean"
}
}
}
import { ErrorObject } from 'ajv';
/**
* Formats an array of schema validation errors.
* @param errors An array of error messages to format.
* @returns Formatted error message
* Based on https://github.com/eslint/eslint/blob/master/lib/shared/config-validator.js#L237-L261
*/
export declare function formatErrors(errors: ErrorObject[]): string;
//# sourceMappingURL=formatErrors.d.ts.map
\ No newline at end of file
{"version":3,"file":"formatErrors.d.ts","sourceRoot":"","sources":["../src/formatErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,WAAW,EAAC,MAAM,KAAK,CAAC;AAEhC;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAoC1D"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.formatErrors = void 0;
/**
* Formats an array of schema validation errors.
* @param errors An array of error messages to format.
* @returns Formatted error message
* Based on https://github.com/eslint/eslint/blob/master/lib/shared/config-validator.js#L237-L261
*/
function formatErrors(errors) {
return errors
.map((error) => {
if (error.keyword === 'additionalProperties' &&
'additionalProperty' in error.params) {
const formattedPropertyPath = error.dataPath.length
? `${error.dataPath.slice(1)}.${error.params.additionalProperty}`
: error.params.additionalProperty;
return `Unexpected top-level property "${formattedPropertyPath}"`;
}
if (error.keyword === 'type') {
const formattedField = error.dataPath.slice(1);
if (!formattedField) {
return `Config has the wrong type - ${error.message}`;
}
return `Property "${formattedField}" has the wrong type - ${error.message}`;
}
const field = (error.dataPath[0] === '.'
? error.dataPath.slice(1)
: error.dataPath) || 'Config';
if (error.keyword === 'typeof') {
return `"${field}" should be a ${error.schema}. Value: ${JSON.stringify(error.data)}`;
}
return `"${field}" ${error.message}. Value: ${JSON.stringify(error.data)}`;
})
.map((message) => `\t- ${message}.\n`)
.join('');
}
exports.formatErrors = formatErrors;
//# sourceMappingURL=formatErrors.js.map
\ No newline at end of file
{"version":3,"file":"formatErrors.js","sourceRoot":"","sources":["../src/formatErrors.ts"],"names":[],"mappings":";;;AAEA;;;;;GAKG;AACH,SAAgB,YAAY,CAAC,MAAqB;IACjD,OAAO,MAAM;SACX,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;QACd,IACC,KAAK,CAAC,OAAO,KAAK,sBAAsB;YACxC,oBAAoB,IAAI,KAAK,CAAC,MAAM,EACnC;YACD,MAAM,qBAAqB,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM;gBAClD,CAAC,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,kBAAkB,EAAE;gBACjE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,kBAAkB,CAAC;YAEnC,OAAO,kCAAkC,qBAAqB,GAAG,CAAC;SAClE;QACD,IAAI,KAAK,CAAC,OAAO,KAAK,MAAM,EAAE;YAC7B,MAAM,cAAc,GAAG,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAC/C,IAAI,CAAC,cAAc,EAAE;gBACpB,OAAO,+BAA+B,KAAK,CAAC,OAAO,EAAE,CAAC;aACtD;YACD,OAAO,aAAa,cAAc,0BAA0B,KAAK,CAAC,OAAO,EAAE,CAAC;SAC5E;QACD,MAAM,KAAK,GACV,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG;YACzB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,IAAI,QAAQ,CAAC;QAChC,IAAI,KAAK,CAAC,OAAO,KAAK,QAAQ,EAAE;YAC/B,OAAO,IAAI,KAAK,iBAAiB,KAAK,CAAC,MAAM,YAAY,IAAI,CAAC,SAAS,CACtE,KAAK,CAAC,IAAI,CACV,EAAE,CAAC;SACJ;QAED,OAAO,IAAI,KAAK,KAAK,KAAK,CAAC,OAAO,YAAY,IAAI,CAAC,SAAS,CAC3D,KAAK,CAAC,IAAI,CACV,EAAE,CAAC;IACL,CAAC,CAAC;SACD,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,OAAO,KAAK,CAAC;SACrC,IAAI,CAAC,EAAE,CAAC,CAAC;AACZ,CAAC;AApCD,oCAoCC"}
\ No newline at end of file
import { UserConfig } from '@commitlint/types';
export declare function validateConfig(source: string, config: unknown): asserts config is UserConfig;
//# sourceMappingURL=validate.d.ts.map
\ No newline at end of file
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,UAAU,EAAC,MAAM,mBAAmB,CAAC;AAc7C,wBAAgB,cAAc,CAC7B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,OAAO,GACb,OAAO,CAAC,MAAM,IAAI,UAAU,CA4B9B"}
\ No newline at end of file
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.validateConfig = void 0;
const ajv_1 = __importDefault(require("ajv"));
const commitlint_schema_json_1 = __importDefault(require("./commitlint.schema.json"));
const formatErrors_1 = require("./formatErrors");
const TYPE_OF = [
'undefined',
'string',
'number',
'object',
'function',
'boolean',
'symbol',
];
function validateConfig(source, config) {
const ajv = new ajv_1.default({
meta: false,
useDefaults: true,
validateSchema: false,
missingRefs: 'ignore',
verbose: true,
schemaId: 'auto',
});
ajv.addKeyword('typeof', {
validate: function typeOfFunc(schema, data) {
return typeof data === schema;
},
metaSchema: { type: 'string', enum: TYPE_OF },
schema: true,
});
const validate = ajv.compile(commitlint_schema_json_1.default);
const isValid = validate(config);
if (!isValid && validate.errors && validate.errors.length) {
throw new Error(`Commitlint configuration in ${source} is invalid:\n${(0, formatErrors_1.formatErrors)(validate.errors)}`);
}
}
exports.validateConfig = validateConfig;
//# sourceMappingURL=validate.js.map
\ No newline at end of file
{"version":3,"file":"validate.js","sourceRoot":"","sources":["../src/validate.ts"],"names":[],"mappings":";;;;;;AAAA,8CAAsB;AAEtB,sFAA8C;AAC9C,iDAA4C;AAE5C,MAAM,OAAO,GAAG;IACf,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,QAAQ;IACR,UAAU;IACV,SAAS;IACT,QAAQ;CACR,CAAC;AAEF,SAAgB,cAAc,CAC7B,MAAc,EACd,MAAe;IAEf,MAAM,GAAG,GAAG,IAAI,aAAG,CAAC;QACnB,IAAI,EAAE,KAAK;QACX,WAAW,EAAE,IAAI;QACjB,cAAc,EAAE,KAAK;QACrB,WAAW,EAAE,QAAQ;QACrB,OAAO,EAAE,IAAI;QACb,QAAQ,EAAE,MAAM;KAChB,CAAC,CAAC;IAEH,GAAG,CAAC,UAAU,CAAC,QAAQ,EAAE;QACxB,QAAQ,EAAE,SAAS,UAAU,CAAC,MAAW,EAAE,IAAS;YACnD,OAAO,OAAO,IAAI,KAAK,MAAM,CAAC;QAC/B,CAAC;QACD,UAAU,EAAE,EAAC,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAC;QAC3C,MAAM,EAAE,IAAI;KACZ,CAAC,CAAC;IAEH,MAAM,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,gCAAM,CAAC,CAAC;IACrC,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,CAAC;IAEjC,IAAI,CAAC,OAAO,IAAI,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE;QAC1D,MAAM,IAAI,KAAK,CACd,+BAA+B,MAAM,iBAAiB,IAAA,2BAAY,EACjE,QAAQ,CAAC,MAAM,CACf,EAAE,CACH,CAAC;KACF;AACF,CAAC;AA/BD,wCA+BC"}
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2016 - present Mario Nebl
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.
{
"name": "@commitlint/config-validator",
"version": "16.2.1",
"description": "config validator for commitlint.config.js",
"main": "lib/validate.js",
"types": "lib/validate.d.ts",
"files": [
"lib/"
],
"scripts": {
"deps": "dep-check",
"pkg": "pkg-check --skip-import"
},
"engines": {
"node": ">=v12"
},
"repository": {
"type": "git",
"url": "https://github.com/conventional-changelog/commitlint.git",
"directory": "@commitlint/config-validator"
},
"bugs": {
"url": "https://github.com/conventional-changelog/commitlint/issues"
},
"homepage": "https://commitlint.js.org/",
"keywords": [
"conventional-changelog",
"commitlint",
"library",
"core"
],
"author": {
"name": "Mario Nebl",
"email": "hello@herebecode.com"
},
"license": "MIT",
"devDependencies": {
"@commitlint/utils": "^16.2.1"
},
"dependencies": {
"@commitlint/types": "^16.2.1",
"ajv": "^6.12.6"
},
"gitHead": "071cce297f207ebcaf9cfa00e23542b7e0a550e8"
}
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [16.2.1](https://github.com/conventional-changelog/commitlint/compare/v16.2.0...v16.2.1) (2022-02-13)
**Note:** Version bump only for package @commitlint/execute-rule
# [16.0.0](https://github.com/conventional-changelog/commitlint/compare/v15.0.0...v16.0.0) (2021-12-26)
**Note:** Version bump only for package @commitlint/execute-rule
# [15.0.0](https://github.com/conventional-changelog/commitlint/compare/v14.2.0...v15.0.0) (2021-11-17)
**Note:** Version bump only for package @commitlint/execute-rule
# [14.0.0](https://github.com/conventional-changelog/commitlint/compare/v13.2.1...v14.0.0) (2021-10-26)
**Note:** Version bump only for package @commitlint/execute-rule
# [13.2.0](https://github.com/conventional-changelog/commitlint/compare/v13.1.0...v13.2.0) (2021-09-28)
**Note:** Version bump only for package @commitlint/execute-rule
# [13.0.0](https://github.com/conventional-changelog/commitlint/compare/v12.1.4...v13.0.0) (2021-05-24)
* chore!: remove node 10 support (#2596) ([4db4ba1](https://github.com/conventional-changelog/commitlint/commit/4db4ba1b0b312410a0f62100a93a80c246a6c410)), closes [#2596](https://github.com/conventional-changelog/commitlint/issues/2596)
### BREAKING CHANGES
* minimum node version is 12
## [12.1.3](https://github.com/conventional-changelog/commitlint/compare/v12.1.2...v12.1.3) (2021-05-12)
**Note:** Version bump only for package @commitlint/execute-rule
## [12.1.1](https://github.com/conventional-changelog/commitlint/compare/v12.1.0...v12.1.1) (2021-04-02)
**Note:** Version bump only for package @commitlint/execute-rule
## [12.0.1](https://github.com/conventional-changelog/commitlint/compare/v12.0.0...v12.0.1) (2021-02-23)
**Note:** Version bump only for package @commitlint/execute-rule
# [12.0.0](https://github.com/conventional-changelog/commitlint/compare/v11.0.0...v12.0.0) (2021-01-18)
**Note:** Version bump only for package @commitlint/execute-rule
# [11.0.0](https://github.com/conventional-changelog/commitlint/compare/v10.0.0...v11.0.0) (2020-09-05)
**Note:** Version bump only for package @commitlint/execute-rule
# [10.0.0](https://github.com/conventional-changelog/commitlint/compare/v9.1.2...v10.0.0) (2020-08-16)
* refactor!: drop support for node 8 (#1999) ([751f39f](https://github.com/conventional-changelog/commitlint/commit/751f39f284ef232574a176c3c11b1982ee544166)), closes [#1999](https://github.com/conventional-changelog/commitlint/issues/1999)
### BREAKING CHANGES
* remove node 8 from circle-ci checks
also remove node 13 because we do not support experimental versions
* docs: update node v10 to latest LTS 10 version
Co-authored-by: Cedric van Putten <me@bycedric.com>
Co-authored-by: Cedric van Putten <me@bycedric.com>
## [9.1.2](https://github.com/conventional-changelog/commitlint/compare/v9.1.1...v9.1.2) (2020-07-13)
**Note:** Version bump only for package @commitlint/execute-rule
## [9.1.1](https://github.com/conventional-changelog/commitlint/compare/v9.1.0...v9.1.1) (2020-06-30)
**Note:** Version bump only for package @commitlint/execute-rule
# [9.1.0](https://github.com/conventional-changelog/commitlint/compare/v9.0.1...v9.1.0) (2020-06-21)
**Note:** Version bump only for package @commitlint/execute-rule
## [9.0.1](https://github.com/conventional-changelog/commitlint/compare/v9.0.0...v9.0.1) (2020-05-26)
**Note:** Version bump only for package @commitlint/execute-rule
# [9.0.0](https://github.com/conventional-changelog/commitlint/compare/v8.3.5...v9.0.0) (2020-05-21)
**Note:** Version bump only for package @commitlint/execute-rule
## [8.3.4](https://github.com/conventional-changelog/commitlint/compare/v8.3.3...v8.3.4) (2020-01-03)
**Note:** Version bump only for package @commitlint/execute-rule
# [8.3.0](https://github.com/conventional-changelog/commitlint/compare/v8.2.0...v8.3.0) (2019-10-16)
**Note:** Version bump only for package @commitlint/execute-rule
# [8.2.0](https://github.com/conventional-changelog/commitlint/compare/v8.1.0...v8.2.0) (2019-09-16)
**Note:** Version bump only for package @commitlint/execute-rule
# [8.1.0](https://github.com/conventional-changelog/commitlint/compare/v8.0.0...v8.1.0) (2019-07-15)
**Note:** Version bump only for package @commitlint/execute-rule
# [7.6.0](https://github.com/conventional-changelog/commitlint/compare/v7.5.2...v7.6.0) (2019-05-06)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="7.5.0"></a>
# [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31)
### Bug Fixes
* replace all repository references with conventional changelog ([#561](https://github.com/conventional-changelog/commitlint/issues/561)) ([6c3afcd](https://github.com/conventional-changelog/commitlint/commit/6c3afcd))
<a name="7.3.1"></a>
## [7.3.1](https://github.com/conventional-changelog/commitlint/compare/v7.3.0...v7.3.1) (2019-01-11)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="7.3.0"></a>
# [7.3.0](https://github.com/conventional-changelog/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="7.1.2"></a>
## [7.1.2](https://github.com/conventional-changelog/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="6.1.1"></a>
## [6.1.1](https://github.com/conventional-changelog/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="6.1.0"></a>
# [6.1.0](https://github.com/conventional-changelog/commitlint/compare/v6.0.5...v6.1.0) (2018-02-03)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="6.0.4"></a>
## [6.0.4](https://github.com/conventional-changelog/commitlint/compare/v6.0.3...v6.0.4) (2018-01-31)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="6.0.3"></a>
## [6.0.3](https://github.com/conventional-changelog/commitlint/compare/v6.0.2...v6.0.3) (2018-01-31)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="6.0.2"></a>
## [6.0.2](https://github.com/conventional-changelog/commitlint/compare/v6.0.0...v6.0.2) (2018-01-12)
**Note:** Version bump only for package @commitlint/execute-rule
<a name="6.0.0"></a>
# [6.0.0](https://github.com/conventional-changelog/commitlint/compare/v5.2.6...v6.0.0) (2018-01-09)
**Note:** Version bump only for package @commitlint/execute-rule
declare type Rule<T> = readonly [string, Config<T>];
declare type Config<T> = T | Promise<T> | ExectableConfig<T>;
declare type ExectableConfig<T> = (() => T) | (() => Promise<T>);
declare type ExecutedRule<T> = readonly [string, T];
export default execute;
export declare function execute<T = unknown>(rule?: Rule<T>): Promise<ExecutedRule<T> | null>;
//# sourceMappingURL=index.d.ts.map
\ No newline at end of file
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,aAAK,IAAI,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5C,aAAK,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;AACrD,aAAK,eAAe,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAEzD,aAAK,YAAY,CAAC,CAAC,IAAI,SAAS,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAE5C,eAAe,OAAO,CAAC;AAEvB,wBAAsB,OAAO,CAAC,CAAC,GAAG,OAAO,EACxC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,GACZ,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAUjC"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.execute = void 0;
exports.default = execute;
async function execute(rule) {
if (!Array.isArray(rule)) {
return null;
}
const [name, config] = rule;
const fn = executable(config) ? config : async () => config;
return [name, await fn()];
}
exports.execute = execute;
function executable(config) {
return typeof config === 'function';
}
//# sourceMappingURL=index.js.map
\ No newline at end of file
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAMA,kBAAe,OAAO,CAAC;AAEhB,KAAK,UAAU,OAAO,CAC5B,IAAc;IAEd,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;QACzB,OAAO,IAAI,CAAC;KACZ;IAED,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;IAE5B,MAAM,EAAE,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC,MAAM,CAAC;IAE5D,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,CAAC,CAAC;AAC3B,CAAC;AAZD,0BAYC;AAED,SAAS,UAAU,CAAI,MAAiB;IACvC,OAAO,OAAO,MAAM,KAAK,UAAU,CAAC;AACrC,CAAC"}
\ No newline at end of file
The MIT License (MIT)
Copyright (c) 2016 - present Mario Nebl
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.
{
"name": "@commitlint/execute-rule",
"version": "16.2.1",
"description": "Lint your commit messages",
"main": "lib/index.js",
"types": "lib/index.d.ts",
"files": [
"lib/"
],
"scripts": {
"deps": "dep-check",
"pkg": "pkg-check"
},
"engines": {
"node": ">=v12"
},
"repository": {
"type": "git",
"url": "https://github.com/conventional-changelog/commitlint.git",
"directory": "@commitlint/execute-rule"
},
"bugs": {
"url": "https://github.com/conventional-changelog/commitlint/issues"
},
"homepage": "https://commitlint.js.org/",
"keywords": [
"conventional-changelog",
"commitlint",
"library",
"core"
],
"author": {
"name": "Mario Nebl",
"email": "hello@herebecode.com"
},
"license": "MIT",
"devDependencies": {
"@commitlint/utils": "^16.2.1"
},
"gitHead": "071cce297f207ebcaf9cfa00e23542b7e0a550e8"
}
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## [16.2.3](https://github.com/conventional-changelog/commitlint/compare/v16.2.2...v16.2.3) (2022-03-16)
**Note:** Version bump only for package @commitlint/load
## [16.2.1](https://github.com/conventional-changelog/commitlint/compare/v16.2.0...v16.2.1) (2022-02-13)
### Bug Fixes
* **load:** satisfy @types/node peer dependency for cosmiconfig-loader-typescript ([#3008](https://github.com/conventional-changelog/commitlint/issues/3008)) ([338180c](https://github.com/conventional-changelog/commitlint/commit/338180c7174625cddd7a0ea2b9d2786fee375756)), closes [#3007](https://github.com/conventional-changelog/commitlint/issues/3007)
# [16.1.0](https://github.com/conventional-changelog/commitlint/compare/v16.0.3...v16.1.0) (2022-01-20)
### Features
* **load:** accept functions as parser presets ([#2982](https://github.com/conventional-changelog/commitlint/issues/2982)) ([420e8d6](https://github.com/conventional-changelog/commitlint/commit/420e8d6a4d5663ade953272275a9e0fa7c5ddff0)), closes [#2964](https://github.com/conventional-changelog/commitlint/issues/2964) [#2964](https://github.com/conventional-changelog/commitlint/issues/2964)
# [16.0.0](https://github.com/conventional-changelog/commitlint/compare/v15.0.0...v16.0.0) (2021-12-26)
### Features
* config validation ([#2412](https://github.com/conventional-changelog/commitlint/issues/2412)) ([c717202](https://github.com/conventional-changelog/commitlint/commit/c7172022097b11f46b33617e4a94d751243c1049)), closes [#327](https://github.com/conventional-changelog/commitlint/issues/327)
# [15.0.0](https://github.com/conventional-changelog/commitlint/compare/v14.2.0...v15.0.0) (2021-11-17)
### Bug Fixes
* **types:** fix signature of QualifiedRuleConfig for async configurations ([#2868](https://github.com/conventional-changelog/commitlint/issues/2868)) ([#2869](https://github.com/conventional-changelog/commitlint/issues/2869)) ([c7f355b](https://github.com/conventional-changelog/commitlint/commit/c7f355b25e5baddab0b9559892f5ce4112e4f93a))
### Features
* simplify config resolution ([#2398](https://github.com/conventional-changelog/commitlint/issues/2398)) ([8a8384f](https://github.com/conventional-changelog/commitlint/commit/8a8384f3c18954447cb633e76a573e1db71a1440)), closes [#327](https://github.com/conventional-changelog/commitlint/issues/327)
# [14.1.0](https://github.com/conventional-changelog/commitlint/compare/v14.0.0...v14.1.0) (2021-11-01)
### Features
* extend helpUrl from shareable config ([#2846](https://github.com/conventional-changelog/commitlint/issues/2846)) ([d7e2e2b](https://github.com/conventional-changelog/commitlint/commit/d7e2e2b943be383f99f4000b6b6bed0eab03bfcf))
* **load:** add support for `.commitlintrc.cjs` and `commitlint.config.cjs` files ([#2797](https://github.com/conventional-changelog/commitlint/issues/2797)) ([fabb495](https://github.com/conventional-changelog/commitlint/commit/fabb49509730609276ff9ef6357536c95a1f6bb1))
# [14.0.0](https://github.com/conventional-changelog/commitlint/compare/v13.2.1...v14.0.0) (2021-10-26)
**Note:** Version bump only for package @commitlint/load
## [13.2.1](https://github.com/conventional-changelog/commitlint/compare/v13.2.0...v13.2.1) (2021-10-09)
### Bug Fixes
* **load:** added a direct dependency on typescript ([#2785](https://github.com/conventional-changelog/commitlint/issues/2785)) ([9c17f8d](https://github.com/conventional-changelog/commitlint/commit/9c17f8d423404b484f72df41358a18bd90014ecd)), closes [EndemolShineGroup/cosmiconfig-typescript-loader#147](https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader/issues/147) [#2779](https://github.com/conventional-changelog/commitlint/issues/2779)
# [13.2.0](https://github.com/conventional-changelog/commitlint/compare/v13.1.0...v13.2.0) (2021-09-28)
### Bug Fixes
* **types:** user config prompt ([6d7a1c4](https://github.com/conventional-changelog/commitlint/commit/6d7a1c40e2f8a8ff22595e0e17f71f3702b0699c))
### Features
* **load:** add cosmiconfig typescript loader ([b65aced](https://github.com/conventional-changelog/commitlint/commit/b65acedc3334a859811762539ec8716de3e73f85))
# [13.1.0](https://github.com/conventional-changelog/commitlint/compare/v13.0.0...v13.1.0) (2021-07-24)
**Note:** Version bump only for package @commitlint/load
# [13.0.0](https://github.com/conventional-changelog/commitlint/compare/v12.1.4...v13.0.0) (2021-05-24)
* chore!: remove node 10 support (#2596) ([4db4ba1](https://github.com/conventional-changelog/commitlint/commit/4db4ba1b0b312410a0f62100a93a80c246a6c410)), closes [#2596](https://github.com/conventional-changelog/commitlint/issues/2596)
### BREAKING CHANGES
* minimum node version is 12
## [12.1.3](https://github.com/conventional-changelog/commitlint/compare/v12.1.2...v12.1.3) (2021-05-12)
**Note:** Version bump only for package @commitlint/load
## [12.1.2](https://github.com/conventional-changelog/commitlint/compare/v12.1.1...v12.1.2) (2021-04-29)
**Note:** Version bump only for package @commitlint/load
## [12.1.1](https://github.com/conventional-changelog/commitlint/compare/v12.1.0...v12.1.1) (2021-04-02)
**Note:** Version bump only for package @commitlint/load
# [12.1.0](https://github.com/conventional-changelog/commitlint/compare/v12.0.1...v12.1.0) (2021-03-06)
**Note:** Version bump only for package @commitlint/load
## [12.0.1](https://github.com/conventional-changelog/commitlint/compare/v12.0.0...v12.0.1) (2021-02-23)
### Bug Fixes
* **load:** use `Rule | AsyncRule | SyncRule` as rule value type in `Plugin` ([#2146](https://github.com/conventional-changelog/commitlint/issues/2146)) ([75b67b8](https://github.com/conventional-changelog/commitlint/commit/75b67b8fb7fc4df21267b98f0c9daeeb1130b824))
# [12.0.0](https://github.com/conventional-changelog/commitlint/compare/v11.0.0...v12.0.0) (2021-01-18)
### Bug Fixes
* update dependency execa to v4.1.0 ([#2251](https://github.com/conventional-changelog/commitlint/issues/2251)) ([b5743dd](https://github.com/conventional-changelog/commitlint/commit/b5743dd1e49bbe7eac03f34bc38c59df5fbaf2a0))
* update dependency execa to v5 ([#2341](https://github.com/conventional-changelog/commitlint/issues/2341)) ([f349df9](https://github.com/conventional-changelog/commitlint/commit/f349df90f08096a9bcad46b5e55b411aac327a24))
### Features
* **load:** allow specifying helpUrl via config ([#2180](https://github.com/conventional-changelog/commitlint/issues/2180)) ([d6795a3](https://github.com/conventional-changelog/commitlint/commit/d6795a3c4633ba6efd7a0fcff48339dc291cd832))
# [11.0.0](https://github.com/conventional-changelog/commitlint/compare/v10.0.0...v11.0.0) (2020-09-05)
**Note:** Version bump only for package @commitlint/load
# [10.0.0](https://github.com/conventional-changelog/commitlint/compare/v9.1.2...v10.0.0) (2020-08-16)
### Bug Fixes
* update dependency cosmiconfig to v7 ([#2044](https://github.com/conventional-changelog/commitlint/issues/2044)) ([f4db933](https://github.com/conventional-changelog/commitlint/commit/f4db93324698ea39528be0d2692151546c2b5517))
* update dependency execa to v4 ([#1936](https://github.com/conventional-changelog/commitlint/issues/1936)) ([8efb441](https://github.com/conventional-changelog/commitlint/commit/8efb44193058d286f7325327a6d33936b273ec91))
* refactor!: drop support for node 8 (#1999) ([751f39f](https://github.com/conventional-changelog/commitlint/commit/751f39f284ef232574a176c3c11b1982ee544166)), closes [#1999](https://github.com/conventional-changelog/commitlint/issues/1999)
### BREAKING CHANGES
* remove node 8 from circle-ci checks
also remove node 13 because we do not support experimental versions
* docs: update node v10 to latest LTS 10 version
Co-authored-by: Cedric van Putten <me@bycedric.com>
Co-authored-by: Cedric van Putten <me@bycedric.com>
## [9.1.2](https://github.com/conventional-changelog/commitlint/compare/v9.1.1...v9.1.2) (2020-07-13)
**Note:** Version bump only for package @commitlint/load
## [9.1.1](https://github.com/conventional-changelog/commitlint/compare/v9.1.0...v9.1.1) (2020-06-30)
### Bug Fixes
* **load:** resolve plugins from extended configs ([#1976](https://github.com/conventional-changelog/commitlint/issues/1976)) ([d0f0eb9](https://github.com/conventional-changelog/commitlint/commit/d0f0eb9fde7efc2dff7a3aad190ded14303d3079))
# [9.1.0](https://github.com/conventional-changelog/commitlint/compare/v9.0.1...v9.1.0) (2020-06-21)
### Bug Fixes
* update dependency chalk to v4 ([#1275](https://github.com/conventional-changelog/commitlint/issues/1275)) ([a5d8fa1](https://github.com/conventional-changelog/commitlint/commit/a5d8fa118e8221361f14f5fd2b21d7aaad008a27))
### Features
* add local plugins support ([#1692](https://github.com/conventional-changelog/commitlint/issues/1692)) ([7b29c48](https://github.com/conventional-changelog/commitlint/commit/7b29c48321b513e091849fbb2cc2bf0e6ebb94a6))
## [9.0.1](https://github.com/conventional-changelog/commitlint/compare/v9.0.0...v9.0.1) (2020-05-26)
**Note:** Version bump only for package @commitlint/load
# [9.0.0](https://github.com/conventional-changelog/commitlint/compare/v8.3.5...v9.0.0) (2020-05-21)
### Bug Fixes
* [#840](https://github.com/conventional-changelog/commitlint/issues/840) add caret to lodash versions ([#843](https://github.com/conventional-changelog/commitlint/issues/843)) ([ffc0bac](https://github.com/conventional-changelog/commitlint/commit/ffc0bac26993acb2ab6a8fa51065f93c92b0d644))
## [8.3.5](https://github.com/conventional-changelog/commitlint/compare/v8.3.4...v8.3.5) (2020-01-15)
**Note:** Version bump only for package @commitlint/load
## [8.3.4](https://github.com/conventional-changelog/commitlint/compare/v8.3.3...v8.3.4) (2020-01-03)
**Note:** Version bump only for package @commitlint/load
## [8.3.1](https://github.com/conventional-changelog/commitlint/compare/v8.3.0...v8.3.1) (2019-10-16)
### Bug Fixes
* **load:** resolve nested parser preset factories ([#831](https://github.com/conventional-changelog/commitlint/issues/831)) ([73a7df7](https://github.com/conventional-changelog/commitlint/commit/73a7df7))
# [8.3.0](https://github.com/conventional-changelog/commitlint/compare/v8.2.0...v8.3.0) (2019-10-16)
### Features
* **config-conventional:** use parser with short breaking change support ([#821](https://github.com/conventional-changelog/commitlint/issues/821)) ([4b5300a](https://github.com/conventional-changelog/commitlint/commit/4b5300a))
# [8.2.0](https://github.com/conventional-changelog/commitlint/compare/v8.1.0...v8.2.0) (2019-09-16)
**Note:** Version bump only for package @commitlint/load
# [8.1.0](https://github.com/conventional-changelog/commitlint/compare/v8.0.0...v8.1.0) (2019-07-15)
### Bug Fixes
* add explicit dependency on chalk ([#687](https://github.com/conventional-changelog/commitlint/issues/687)) ([9075844](https://github.com/conventional-changelog/commitlint/commit/9075844))
## [7.6.1](https://github.com/conventional-changelog/commitlint/compare/v7.6.0...v7.6.1) (2019-05-09)
### Bug Fixes
* handle absolute config paths correctly [#647](https://github.com/conventional-changelog/commitlint/issues/647) ([49b3a77](https://github.com/conventional-changelog/commitlint/commit/49b3a77))
# [7.6.0](https://github.com/conventional-changelog/commitlint/compare/v7.5.2...v7.6.0) (2019-05-06)
### Bug Fixes
* remove unneeded dev dependency ([6ccaf79](https://github.com/conventional-changelog/commitlint/commit/6ccaf79))
* update cosmiconfig to safe >=5 [#599](https://github.com/conventional-changelog/commitlint/issues/599) ([f186fcb](https://github.com/conventional-changelog/commitlint/commit/f186fcb))
### Features
* adds support for plugins ([#228](https://github.com/conventional-changelog/commitlint/issues/228)) ([#588](https://github.com/conventional-changelog/commitlint/issues/588)) ([cea4564](https://github.com/conventional-changelog/commitlint/commit/cea4564))
* config based is-ignored overrides ([#595](https://github.com/conventional-changelog/commitlint/issues/595)) ([2434d71](https://github.com/conventional-changelog/commitlint/commit/2434d71))
<a name="7.5.0"></a>
# [7.5.0](https://github.com/conventional-changelog/commitlint/compare/v7.4.0...v7.5.0) (2019-01-31)
### Bug Fixes
* all broken website references ([#564](https://github.com/conventional-changelog/commitlint/issues/564)) ([82eeb5a](https://github.com/conventional-changelog/commitlint/commit/82eeb5a))
* replace all repository references with conventional changelog ([#561](https://github.com/conventional-changelog/commitlint/issues/561)) ([6c3afcd](https://github.com/conventional-changelog/commitlint/commit/6c3afcd))
* replace all website references with conventional changelog ([#563](https://github.com/conventional-changelog/commitlint/issues/563)) ([6b86fb1](https://github.com/conventional-changelog/commitlint/commit/6b86fb1))
<a name="7.3.1"></a>
## [7.3.1](https://github.com/conventional-changelog/commitlint/compare/v7.3.0...v7.3.1) (2019-01-11)
**Note:** Version bump only for package @commitlint/load
<a name="7.3.0"></a>
# [7.3.0](https://github.com/conventional-changelog/commitlint/compare/v7.2.1...v7.3.0) (2019-01-11)
### Bug Fixes
* update to security-patched dependency versions ([97c033b](https://github.com/conventional-changelog/commitlint/commit/97c033b))
### Features
* check stage before entering prompt ([#495](https://github.com/conventional-changelog/commitlint/issues/495)) ([3b3667a](https://github.com/conventional-changelog/commitlint/commit/3b3667a)), closes [#51](https://github.com/conventional-changelog/commitlint/issues/51) [#51](https://github.com/conventional-changelog/commitlint/issues/51)
<a name="7.2.1"></a>
## [7.2.1](https://github.com/conventional-changelog/commitlint/compare/v7.2.0...v7.2.1) (2018-10-11)
### Bug Fixes
* improve format module resolving ([#464](https://github.com/conventional-changelog/commitlint/issues/464)) ([baed8b1](https://github.com/conventional-changelog/commitlint/commit/baed8b1))
<a name="7.2.0"></a>
# [7.2.0](https://github.com/conventional-changelog/commitlint/compare/v7.1.2...v7.2.0) (2018-10-05)
### Features
* **load:** add formatter option with default value ([b0e63d9](https://github.com/conventional-changelog/commitlint/commit/b0e63d9))
<a name="7.1.2"></a>
## [7.1.2](https://github.com/conventional-changelog/commitlint/compare/v7.1.1...v7.1.2) (2018-09-04)
**Note:** Version bump only for package @commitlint/load
<a name="6.1.1"></a>
## [6.1.1](https://github.com/conventional-changelog/commitlint/compare/v6.1.0...v6.1.1) (2018-02-22)
**Note:** Version bump only for package @commitlint/load
> Load shared commitlint configuration
# @commitlint/load
## Getting started
```shell
npm install --save-dev @commitlint/load
```
## Example
```js
const load = require('@commitlint/load').default;
load({extends: ['./package']}).then((config) => console.log(config));
// => { extends: ['./package', './package-b'], rules: {} }
```
Consult [docs/api](https://conventional-changelog.github.io/commitlint/#/reference-api) for comprehensive documentation.
import { LoadOptions, QualifiedConfig, UserConfig } from '@commitlint/types';
export default function load(seed?: UserConfig, options?: LoadOptions): Promise<QualifiedConfig>;
//# sourceMappingURL=load.d.ts.map
\ No newline at end of file
{"version":3,"file":"load.d.ts","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,WAAW,EACX,eAAe,EAGf,UAAU,EACV,MAAM,mBAAmB,CAAC;AAU3B,wBAA8B,IAAI,CACjC,IAAI,GAAE,UAAe,EACrB,OAAO,GAAE,WAAgB,GACvB,OAAO,CAAC,eAAe,CAAC,CA6F1B"}
\ No newline at end of file
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const execute_rule_1 = __importDefault(require("@commitlint/execute-rule"));
const resolve_extends_1 = __importDefault(require("@commitlint/resolve-extends"));
const config_validator_1 = require("@commitlint/config-validator");
const isPlainObject_1 = __importDefault(require("lodash/isPlainObject"));
const merge_1 = __importDefault(require("lodash/merge"));
const uniq_1 = __importDefault(require("lodash/uniq"));
const path_1 = __importDefault(require("path"));
const resolve_from_1 = __importDefault(require("resolve-from"));
const load_config_1 = require("./utils/load-config");
const load_parser_opts_1 = require("./utils/load-parser-opts");
const load_plugin_1 = __importDefault(require("./utils/load-plugin"));
async function load(seed = {}, options = {}) {
const cwd = typeof options.cwd === 'undefined' ? process.cwd() : options.cwd;
const loaded = await (0, load_config_1.loadConfig)(cwd, options.file);
const base = loaded && loaded.filepath ? path_1.default.dirname(loaded.filepath) : cwd;
let config = {};
if (loaded) {
(0, config_validator_1.validateConfig)(loaded.filepath || '', loaded.config);
config = loaded.config;
}
// Merge passed config with file based options
config = (0, merge_1.default)({
extends: [],
plugins: [],
rules: {},
}, config, seed);
// Resolve parserPreset key
if (typeof config.parserPreset === 'string') {
const resolvedParserPreset = (0, resolve_from_1.default)(base, config.parserPreset);
config.parserPreset = {
name: config.parserPreset,
path: resolvedParserPreset,
parserOpts: require(resolvedParserPreset),
};
}
// Resolve extends key
const extended = (0, resolve_extends_1.default)(config, {
prefix: 'commitlint-config',
cwd: base,
parserPreset: config.parserPreset,
});
if (!extended.formatter || typeof extended.formatter !== 'string') {
extended.formatter = '@commitlint/format';
}
let plugins = {};
if (Array.isArray(extended.plugins)) {
(0, uniq_1.default)(extended.plugins || []).forEach((plugin) => {
if (typeof plugin === 'string') {
plugins = (0, load_plugin_1.default)(plugins, plugin, process.env.DEBUG === 'true');
}
else {
plugins.local = plugin;
}
});
}
const rules = (await Promise.all(Object.entries(extended.rules || {}).map((entry) => (0, execute_rule_1.default)(entry)))).reduce((registry, item) => {
// type of `item` can be null, but Object.entries always returns key pair
const [key, value] = item;
registry[key] = value;
return registry;
}, {});
const helpUrl = typeof extended.helpUrl === 'string'
? extended.helpUrl
: typeof config.helpUrl === 'string'
? config.helpUrl
: 'https://github.com/conventional-changelog/commitlint/#what-is-commitlint';
const prompt = extended.prompt && (0, isPlainObject_1.default)(extended.prompt) ? extended.prompt : {};
return {
extends: Array.isArray(extended.extends)
? extended.extends
: typeof extended.extends === 'string'
? [extended.extends]
: [],
// Resolve config-relative formatter module
formatter: resolve_from_1.default.silent(base, extended.formatter) || extended.formatter,
// Resolve parser-opts from preset
parserPreset: await (0, load_parser_opts_1.loadParserOpts)(extended.parserPreset),
ignores: extended.ignores,
defaultIgnores: extended.defaultIgnores,
plugins: plugins,
rules: rules,
helpUrl: helpUrl,
prompt,
};
}
exports.default = load;
//# sourceMappingURL=load.js.map
\ No newline at end of file
{"version":3,"file":"load.js","sourceRoot":"","sources":["../src/load.ts"],"names":[],"mappings":";;;;;AAAA,4EAAmD;AACnD,kFAAyD;AACzD,mEAA4D;AAQ5D,yEAAiD;AACjD,yDAAiC;AACjC,uDAA+B;AAC/B,gDAAwB;AACxB,gEAAuC;AACvC,qDAA+C;AAC/C,+DAAwD;AACxD,sEAA6C;AAE9B,KAAK,UAAU,IAAI,CACjC,OAAmB,EAAE,EACrB,UAAuB,EAAE;IAEzB,MAAM,GAAG,GAAG,OAAO,OAAO,CAAC,GAAG,KAAK,WAAW,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC;IAC7E,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAU,EAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;IACnD,MAAM,IAAI,GAAG,MAAM,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC;IAC7E,IAAI,MAAM,GAAe,EAAE,CAAC;IAC5B,IAAI,MAAM,EAAE;QACX,IAAA,iCAAc,EAAC,MAAM,CAAC,QAAQ,IAAI,EAAE,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC;QACrD,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;KACvB;IAED,8CAA8C;IAC9C,MAAM,GAAG,IAAA,eAAK,EACb;QACC,OAAO,EAAE,EAAE;QACX,OAAO,EAAE,EAAE;QACX,KAAK,EAAE,EAAE;KACT,EACD,MAAM,EACN,IAAI,CACJ,CAAC;IAEF,2BAA2B;IAC3B,IAAI,OAAO,MAAM,CAAC,YAAY,KAAK,QAAQ,EAAE;QAC5C,MAAM,oBAAoB,GAAG,IAAA,sBAAW,EAAC,IAAI,EAAE,MAAM,CAAC,YAAY,CAAC,CAAC;QAEpE,MAAM,CAAC,YAAY,GAAG;YACrB,IAAI,EAAE,MAAM,CAAC,YAAY;YACzB,IAAI,EAAE,oBAAoB;YAC1B,UAAU,EAAE,OAAO,CAAC,oBAAoB,CAAC;SACzC,CAAC;KACF;IAED,sBAAsB;IACtB,MAAM,QAAQ,GAAG,IAAA,yBAAc,EAAC,MAAM,EAAE;QACvC,MAAM,EAAE,mBAAmB;QAC3B,GAAG,EAAE,IAAI;QACT,YAAY,EAAE,MAAM,CAAC,YAAY;KACjC,CAAC,CAAC;IAEH,IAAI,CAAC,QAAQ,CAAC,SAAS,IAAI,OAAO,QAAQ,CAAC,SAAS,KAAK,QAAQ,EAAE;QAClE,QAAQ,CAAC,SAAS,GAAG,oBAAoB,CAAC;KAC1C;IAED,IAAI,OAAO,GAAkB,EAAE,CAAC;IAChC,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE;QACpC,IAAA,cAAI,EAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE;YAC/C,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE;gBAC/B,OAAO,GAAG,IAAA,qBAAU,EAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,KAAK,KAAK,MAAM,CAAC,CAAC;aACpE;iBAAM;gBACN,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;aACvB;QACF,CAAC,CAAC,CAAC;KACH;IAED,MAAM,KAAK,GAAG,CACb,MAAM,OAAO,CAAC,GAAG,CAChB,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,sBAAW,EAAC,KAAK,CAAC,CAAC,CACvE,CACD,CAAC,MAAM,CAAiB,CAAC,QAAQ,EAAE,IAAI,EAAE,EAAE;QAC3C,yEAAyE;QACzE,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,GAAG,IAAK,CAAC;QAC3B,QAAQ,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACtB,OAAO,QAAQ,CAAC;IACjB,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,MAAM,OAAO,GACZ,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ;QACnC,CAAC,CAAC,QAAQ,CAAC,OAAO;QAClB,CAAC,CAAC,OAAO,MAAM,CAAC,OAAO,KAAK,QAAQ;YACpC,CAAC,CAAC,MAAM,CAAC,OAAO;YAChB,CAAC,CAAC,0EAA0E,CAAC;IAE/E,MAAM,MAAM,GACX,QAAQ,CAAC,MAAM,IAAI,IAAA,uBAAa,EAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC;IAE1E,OAAO;QACN,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;YACvC,CAAC,CAAC,QAAQ,CAAC,OAAO;YAClB,CAAC,CAAC,OAAO,QAAQ,CAAC,OAAO,KAAK,QAAQ;gBACtC,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;gBACpB,CAAC,CAAC,EAAE;QACL,2CAA2C;QAC3C,SAAS,EACR,sBAAW,CAAC,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,SAAS;QACnE,kCAAkC;QAClC,YAAY,EAAE,MAAM,IAAA,iCAAc,EAAC,QAAQ,CAAC,YAAY,CAAC;QACzD,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,cAAc,EAAE,QAAQ,CAAC,cAAc;QACvC,OAAO,EAAE,OAAO;QAChB,KAAK,EAAE,KAAK;QACZ,OAAO,EAAE,OAAO;QAChB,MAAM;KACN,CAAC;AACH,CAAC;AAhGD,uBAgGC"}
\ No newline at end of file
export interface LoadConfigResult {
config: unknown;
filepath: string;
isEmpty?: boolean;
}
export declare function loadConfig(cwd: string, configPath?: string): Promise<LoadConfigResult | null>;
//# sourceMappingURL=load-config.d.ts.map
\ No newline at end of file
{"version":3,"file":"load-config.d.ts","sourceRoot":"","sources":["../../src/utils/load-config.ts"],"names":[],"mappings":"AAIA,MAAM,WAAW,gBAAgB;IAChC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,wBAAsB,UAAU,CAC/B,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAAC,CAmClC"}
\ No newline at end of file
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadConfig = void 0;
const cosmiconfig_1 = require("cosmiconfig");
const cosmiconfig_typescript_loader_1 = __importDefault(require("cosmiconfig-typescript-loader"));
const path_1 = __importDefault(require("path"));
async function loadConfig(cwd, configPath) {
const moduleName = 'commitlint';
const explorer = (0, cosmiconfig_1.cosmiconfig)(moduleName, {
searchPlaces: [
// cosmiconfig overrides default searchPlaces if any new search place is added (For e.g. `*.ts` files),
// we need to manually merge default searchPlaces from https://github.com/davidtheclark/cosmiconfig#searchplaces
'package.json',
`.${moduleName}rc`,
`.${moduleName}rc.json`,
`.${moduleName}rc.yaml`,
`.${moduleName}rc.yml`,
`.${moduleName}rc.js`,
`.${moduleName}rc.cjs`,
`${moduleName}.config.js`,
`${moduleName}.config.cjs`,
// files supported by TypescriptLoader
`.${moduleName}rc.ts`,
`${moduleName}.config.ts`,
],
loaders: {
'.ts': (0, cosmiconfig_typescript_loader_1.default)(),
},
});
const explicitPath = configPath ? path_1.default.resolve(cwd, configPath) : undefined;
const explore = explicitPath ? explorer.load : explorer.search;
const searchPath = explicitPath ? explicitPath : cwd;
const local = await explore(searchPath);
if (local) {
return local;
}
return null;
}
exports.loadConfig = loadConfig;
//# sourceMappingURL=load-config.js.map
\ No newline at end of file
{"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../src/utils/load-config.ts"],"names":[],"mappings":";;;;;;AAAA,6CAAwC;AACxC,kGAA6D;AAC7D,gDAAwB;AAQjB,KAAK,UAAU,UAAU,CAC/B,GAAW,EACX,UAAmB;IAEnB,MAAM,UAAU,GAAG,YAAY,CAAC;IAChC,MAAM,QAAQ,GAAG,IAAA,yBAAW,EAAC,UAAU,EAAE;QACxC,YAAY,EAAE;YACb,uGAAuG;YACvG,gHAAgH;YAChH,cAAc;YACd,IAAI,UAAU,IAAI;YAClB,IAAI,UAAU,SAAS;YACvB,IAAI,UAAU,SAAS;YACvB,IAAI,UAAU,QAAQ;YACtB,IAAI,UAAU,OAAO;YACrB,IAAI,UAAU,QAAQ;YACtB,GAAG,UAAU,YAAY;YACzB,GAAG,UAAU,aAAa;YAE1B,sCAAsC;YACtC,IAAI,UAAU,OAAO;YACrB,GAAG,UAAU,YAAY;SACzB;QACD,OAAO,EAAE;YACR,KAAK,EAAE,IAAA,uCAAgB,GAAE;SACzB;KACD,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,cAAI,CAAC,OAAO,CAAC,GAAG,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5E,MAAM,OAAO,GAAG,YAAY,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC;IAC/D,MAAM,UAAU,GAAG,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC;IACrD,MAAM,KAAK,GAAG,MAAM,OAAO,CAAC,UAAU,CAAC,CAAC;IAExC,IAAI,KAAK,EAAE;QACV,OAAO,KAAK,CAAC;KACb;IAED,OAAO,IAAI,CAAC;AACb,CAAC;AAtCD,gCAsCC"}
\ No newline at end of file
import { ParserPreset } from '@commitlint/types';
declare type Awaitable<T> = T | PromiseLike<T>;
export declare function loadParserOpts(pendingParser: string | Awaitable<ParserPreset> | (() => Awaitable<ParserPreset>) | undefined): Promise<ParserPreset | undefined>;
export {};
//# sourceMappingURL=load-parser-opts.d.ts.map
\ No newline at end of file
{"version":3,"file":"load-parser-opts.d.ts","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,mBAAmB,CAAC;AAE/C,aAAK,SAAS,CAAC,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;AAgBvC,wBAAsB,cAAc,CACnC,aAAa,EACV,MAAM,GACN,SAAS,CAAC,YAAY,CAAC,GACvB,CAAC,MAAM,SAAS,CAAC,YAAY,CAAC,CAAC,GAC/B,SAAS,GACV,OAAO,CAAC,YAAY,GAAG,SAAS,CAAC,CA0DnC"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadParserOpts = void 0;
function isObjectLike(obj) {
return Boolean(obj) && typeof obj === 'object'; // typeof null === 'object'
}
function isParserOptsFunction(obj) {
return typeof obj.parserOpts === 'function';
}
async function loadParserOpts(pendingParser) {
if (typeof pendingParser === 'function') {
return loadParserOpts(pendingParser());
}
if (!pendingParser || typeof pendingParser !== 'object') {
return undefined;
}
// Await for the module, loaded with require
const parser = await pendingParser;
// exit early, no opts to resolve
if (!parser.parserOpts) {
return parser;
}
// Pull nested parserOpts, might happen if overwritten with a module in main config
if (typeof parser.parserOpts === 'object') {
// Await parser opts if applicable
parser.parserOpts = await parser.parserOpts;
if (isObjectLike(parser.parserOpts) &&
isObjectLike(parser.parserOpts.parserOpts)) {
parser.parserOpts = parser.parserOpts.parserOpts;
}
return parser;
}
// Create parser opts from factory
if (isParserOptsFunction(parser) &&
typeof parser.name === 'string' &&
parser.name.startsWith('conventional-changelog-')) {
return new Promise((resolve) => {
const result = parser.parserOpts((_, opts) => {
resolve(Object.assign(Object.assign({}, parser), { parserOpts: opts === null || opts === void 0 ? void 0 : opts.parserOpts }));
});
// If result has data or a promise, the parser doesn't support factory-init
// due to https://github.com/nodejs/promises-debugging/issues/16 it just quits, so let's use this fallback
if (result) {
Promise.resolve(result).then((opts) => {
resolve(Object.assign(Object.assign({}, parser), { parserOpts: opts === null || opts === void 0 ? void 0 : opts.parserOpts }));
});
}
return;
});
}
return parser;
}
exports.loadParserOpts = loadParserOpts;
//# sourceMappingURL=load-parser-opts.js.map
\ No newline at end of file
{"version":3,"file":"load-parser-opts.js","sourceRoot":"","sources":["../../src/utils/load-parser-opts.ts"],"names":[],"mappings":";;;AAIA,SAAS,YAAY,CAAC,GAAY;IACjC,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,OAAO,GAAG,KAAK,QAAQ,CAAC,CAAC,2BAA2B;AAC5E,CAAC;AAED,SAAS,oBAAoB,CAC5B,GAAM;IAMN,OAAO,OAAO,GAAG,CAAC,UAAU,KAAK,UAAU,CAAC;AAC7C,CAAC;AAEM,KAAK,UAAU,cAAc,CACnC,aAIY;IAEZ,IAAI,OAAO,aAAa,KAAK,UAAU,EAAE;QACxC,OAAO,cAAc,CAAC,aAAa,EAAE,CAAC,CAAC;KACvC;IAED,IAAI,CAAC,aAAa,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QACxD,OAAO,SAAS,CAAC;KACjB;IACD,4CAA4C;IAC5C,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC;IAEnC,iCAAiC;IACjC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;QACvB,OAAO,MAAM,CAAC;KACd;IAED,mFAAmF;IACnF,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,QAAQ,EAAE;QAC1C,kCAAkC;QAClC,MAAM,CAAC,UAAU,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC;QAC5C,IACC,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC;YAC/B,YAAY,CAAC,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,EACzC;YACD,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC;SACjD;QACD,OAAO,MAAM,CAAC;KACd;IAED,kCAAkC;IAClC,IACC,oBAAoB,CAAC,MAAM,CAAC;QAC5B,OAAO,MAAM,CAAC,IAAI,KAAK,QAAQ;QAC/B,MAAM,CAAC,IAAI,CAAC,UAAU,CAAC,yBAAyB,CAAC,EAChD;QACD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC9B,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC,CAAQ,EAAE,IAAI,EAAE,EAAE;gBACnD,OAAO,iCACH,MAAM,KACT,UAAU,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,IAC3B,CAAC;YACJ,CAAC,CAAC,CAAC;YAEH,2EAA2E;YAC3E,0GAA0G;YAC1G,IAAI,MAAM,EAAE;gBACX,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE;oBACrC,OAAO,iCACH,MAAM,KACT,UAAU,EAAE,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,UAAU,IAC3B,CAAC;gBACJ,CAAC,CAAC,CAAC;aACH;YACD,OAAO;QACR,CAAC,CAAC,CAAC;KACH;IAED,OAAO,MAAM,CAAC;AACf,CAAC;AAhED,wCAgEC"}
\ No newline at end of file
import { PluginRecords } from '@commitlint/types';
export default function loadPlugin(plugins: PluginRecords, pluginName: string, debug?: boolean): PluginRecords;
//# sourceMappingURL=load-plugin.d.ts.map
\ No newline at end of file
{"version":3,"file":"load-plugin.d.ts","sourceRoot":"","sources":["../../src/utils/load-plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,MAAM,CAAC,OAAO,UAAU,UAAU,CACjC,OAAO,EAAE,aAAa,EACtB,UAAU,EAAE,MAAM,EAClB,KAAK,GAAE,OAAe,GACpB,aAAa,CA8Df"}
\ No newline at end of file
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const path_1 = __importDefault(require("path"));
const chalk_1 = __importDefault(require("chalk"));
const plugin_naming_1 = require("./plugin-naming");
const plugin_errors_1 = require("./plugin-errors");
function loadPlugin(plugins, pluginName, debug = false) {
const longName = (0, plugin_naming_1.normalizePackageName)(pluginName);
const shortName = (0, plugin_naming_1.getShorthandName)(longName);
let plugin = null;
if (pluginName.match(/\s+/u)) {
throw new plugin_errors_1.WhitespacePluginError(pluginName, {
pluginName: longName,
});
}
const pluginKey = longName === pluginName ? shortName : pluginName;
if (!plugins[pluginKey]) {
try {
plugin = require(longName);
}
catch (pluginLoadErr) {
try {
// Check whether the plugin exists
require.resolve(longName);
}
catch (error) {
// If the plugin can't be resolved, display the missing plugin error (usually a config or install error)
console.error(chalk_1.default.red(`Failed to load plugin ${longName}.`));
const message = (error === null || error === void 0 ? void 0 : error.message) || 'Unknown error occurred';
throw new plugin_errors_1.MissingPluginError(pluginName, message, {
pluginName: longName,
commitlintPath: path_1.default.resolve(__dirname, '../..'),
});
}
// Otherwise, the plugin exists and is throwing on module load for some reason, so print the stack trace.
throw pluginLoadErr;
}
// This step is costly, so skip if debug is disabled
if (debug) {
const resolvedPath = require.resolve(longName);
let version = null;
try {
version = require(`${longName}/package.json`).version;
}
catch (e) {
// Do nothing
}
const loadedPluginAndVersion = version
? `${longName}@${version}`
: `${longName}, version unknown`;
console.log(chalk_1.default.blue(`Loaded plugin ${pluginName} (${loadedPluginAndVersion}) (from ${resolvedPath})`));
}
plugins[pluginKey] = plugin;
}
return plugins;
}
exports.default = loadPlugin;
//# sourceMappingURL=load-plugin.js.map
\ No newline at end of file
{"version":3,"file":"load-plugin.js","sourceRoot":"","sources":["../../src/utils/load-plugin.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,kDAA0B;AAC1B,mDAAuE;AACvE,mDAA0E;AAG1E,SAAwB,UAAU,CACjC,OAAsB,EACtB,UAAkB,EAClB,QAAiB,KAAK;IAEtB,MAAM,QAAQ,GAAG,IAAA,oCAAoB,EAAC,UAAU,CAAC,CAAC;IAClD,MAAM,SAAS,GAAG,IAAA,gCAAgB,EAAC,QAAQ,CAAC,CAAC;IAC7C,IAAI,MAAM,GAAG,IAAI,CAAC;IAElB,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;QAC7B,MAAM,IAAI,qCAAqB,CAAC,UAAU,EAAE;YAC3C,UAAU,EAAE,QAAQ;SACpB,CAAC,CAAC;KACH;IAED,MAAM,SAAS,GAAG,QAAQ,KAAK,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,UAAU,CAAC;IAEnE,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,EAAE;QACxB,IAAI;YACH,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;SAC3B;QAAC,OAAO,aAAa,EAAE;YACvB,IAAI;gBACH,kCAAkC;gBAClC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;aAC1B;YAAC,OAAO,KAAU,EAAE;gBACpB,wGAAwG;gBACxG,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,yBAAyB,QAAQ,GAAG,CAAC,CAAC,CAAC;gBAE/D,MAAM,OAAO,GAAG,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,OAAO,KAAI,wBAAwB,CAAC;gBAC3D,MAAM,IAAI,kCAAkB,CAAC,UAAU,EAAE,OAAO,EAAE;oBACjD,UAAU,EAAE,QAAQ;oBACpB,cAAc,EAAE,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,OAAO,CAAC;iBAChD,CAAC,CAAC;aACH;YAED,yGAAyG;YACzG,MAAM,aAAa,CAAC;SACpB;QAED,oDAAoD;QACpD,IAAI,KAAK,EAAE;YACV,MAAM,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;YAE/C,IAAI,OAAO,GAAG,IAAI,CAAC;YAEnB,IAAI;gBACH,OAAO,GAAG,OAAO,CAAC,GAAG,QAAQ,eAAe,CAAC,CAAC,OAAO,CAAC;aACtD;YAAC,OAAO,CAAC,EAAE;gBACX,aAAa;aACb;YAED,MAAM,sBAAsB,GAAG,OAAO;gBACrC,CAAC,CAAC,GAAG,QAAQ,IAAI,OAAO,EAAE;gBAC1B,CAAC,CAAC,GAAG,QAAQ,mBAAmB,CAAC;YAElC,OAAO,CAAC,GAAG,CACV,eAAK,CAAC,IAAI,CACT,iBAAiB,UAAU,KAAK,sBAAsB,WAAW,YAAY,GAAG,CAChF,CACD,CAAC;SACF;QAED,OAAO,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC;KAC5B;IAED,OAAO,OAAO,CAAC;AAChB,CAAC;AAlED,6BAkEC"}
\ No newline at end of file
export declare class WhitespacePluginError extends Error {
__proto__: ErrorConstructor;
messageTemplate: string;
messageData: any;
constructor(pluginName?: string, data?: any);
}
export declare class MissingPluginError extends Error {
__proto__: ErrorConstructor;
messageTemplate: string;
messageData: any;
constructor(pluginName?: string, errorMessage?: string, data?: any);
}
//# sourceMappingURL=plugin-errors.d.ts.map
\ No newline at end of file
{"version":3,"file":"plugin-errors.d.ts","sourceRoot":"","sources":["../../src/utils/plugin-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,qBAAsB,SAAQ,KAAK;IAC/C,SAAS,mBAAS;IAEX,eAAe,EAAE,MAAM,CAAsB;IAC7C,WAAW,EAAE,GAAG,CAAM;gBAEjB,UAAU,CAAC,EAAE,MAAM,EAAE,IAAI,GAAE,GAAQ;CAO/C;AAED,qBAAa,kBAAmB,SAAQ,KAAK;IAC5C,SAAS,mBAAS;IAEX,eAAe,EAAE,MAAM,CAAoB;IAC3C,WAAW,EAAE,GAAG,CAAC;gBAEZ,UAAU,CAAC,EAAE,MAAM,EAAE,YAAY,GAAE,MAAW,EAAE,IAAI,GAAE,GAAQ;CAO1E"}
\ No newline at end of file
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MissingPluginError = exports.WhitespacePluginError = void 0;
class WhitespacePluginError extends Error {
constructor(pluginName, data = {}) {
super(`Whitespace found in plugin name '${pluginName}'`);
this.__proto__ = Error;
this.messageTemplate = 'whitespace-found';
this.messageData = {};
this.messageData = data;
Object.setPrototypeOf(this, WhitespacePluginError.prototype);
}
}
exports.WhitespacePluginError = WhitespacePluginError;
class MissingPluginError extends Error {
constructor(pluginName, errorMessage = '', data = {}) {
super(`Failed to load plugin ${pluginName}: ${errorMessage}`);
this.__proto__ = Error;
this.messageTemplate = 'plugin-missing';
this.messageData = data;
Object.setPrototypeOf(this, MissingPluginError.prototype);
}
}
exports.MissingPluginError = MissingPluginError;
//# sourceMappingURL=plugin-errors.js.map
\ No newline at end of file
{"version":3,"file":"plugin-errors.js","sourceRoot":"","sources":["../../src/utils/plugin-errors.ts"],"names":[],"mappings":";;;AAAA,MAAa,qBAAsB,SAAQ,KAAK;IAM/C,YAAY,UAAmB,EAAE,OAAY,EAAE;QAC9C,KAAK,CAAC,oCAAoC,UAAU,GAAG,CAAC,CAAC;QAN1D,cAAS,GAAG,KAAK,CAAC;QAEX,oBAAe,GAAW,kBAAkB,CAAC;QAC7C,gBAAW,GAAQ,EAAE,CAAC;QAK5B,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAExB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC9D,CAAC;CACD;AAbD,sDAaC;AAED,MAAa,kBAAmB,SAAQ,KAAK;IAM5C,YAAY,UAAmB,EAAE,eAAuB,EAAE,EAAE,OAAY,EAAE;QACzE,KAAK,CAAC,yBAAyB,UAAU,KAAK,YAAY,EAAE,CAAC,CAAC;QAN/D,cAAS,GAAG,KAAK,CAAC;QAEX,oBAAe,GAAW,gBAAgB,CAAC;QAMjD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAExB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,CAAC,CAAC;IAC3D,CAAC;CACD;AAbD,gDAaC"}
\ No newline at end of file
/**
* Brings package name to correct format based on prefix
* @param {string} name The name of the package.
* @returns {string} Normalized name of the package
* @private
*/
export declare function normalizePackageName(name: string): string;
/**
* Removes the prefix from a fullname.
* @param {string} fullname The term which may have the prefix.
* @returns {string} The term without prefix.
*/
export declare function getShorthandName(fullname: string): string;
/**
* Gets the scope (namespace) of a term.
* @param {string} term The term which may have the namespace.
* @returns {string} The namepace of the term if it has one.
*/
export declare function getNamespaceFromTerm(term: string): string;
//# sourceMappingURL=plugin-naming.d.ts.map
\ No newline at end of file
{"version":3,"file":"plugin-naming.d.ts","sourceRoot":"","sources":["../../src/utils/plugin-naming.ts"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,UA2ChD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,UAiBhD;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,UAIhD"}
\ No newline at end of file
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getNamespaceFromTerm = exports.getShorthandName = exports.normalizePackageName = void 0;
const path_1 = __importDefault(require("path"));
// largely adapted from eslint's plugin system
const NAMESPACE_REGEX = /^@.*\//iu;
// In eslint this is a parameter - we don't need to support the extra options
const prefix = 'commitlint-plugin';
// Replace Windows with posix style paths
function convertPathToPosix(filepath) {
const normalizedFilepath = path_1.default.normalize(filepath);
const posixFilepath = normalizedFilepath.replace(/\\/gu, '/');
return posixFilepath;
}
/**
* Brings package name to correct format based on prefix
* @param {string} name The name of the package.
* @returns {string} Normalized name of the package
* @private
*/
function normalizePackageName(name) {
let normalizedName = name;
/**
* On Windows, name can come in with Windows slashes instead of Unix slashes.
* Normalize to Unix first to avoid errors later on.
* https://github.com/eslint/eslint/issues/5644
*/
if (normalizedName.indexOf('\\') > -1) {
normalizedName = convertPathToPosix(normalizedName);
}
if (normalizedName.charAt(0) === '@') {
/**
* it's a scoped package
* package name is the prefix, or just a username
*/
const scopedPackageShortcutRegex = new RegExp(`^(@[^/]+)(?:/(?:${prefix})?)?$`, 'u'), scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, 'u');
if (scopedPackageShortcutRegex.test(normalizedName)) {
normalizedName = normalizedName.replace(scopedPackageShortcutRegex, `$1/${prefix}`);
}
else if (!scopedPackageNameRegex.test(normalizedName.split('/')[1])) {
/**
* for scoped packages, insert the prefix after the first / unless
* the path is already @scope/eslint or @scope/eslint-xxx-yyy
*/
normalizedName = normalizedName.replace(/^@([^/]+)\/(.*)$/u, `@$1/${prefix}-$2`);
}
}
else if (normalizedName.indexOf(`${prefix}-`) !== 0) {
normalizedName = `${prefix}-${normalizedName}`;
}
return normalizedName;
}
exports.normalizePackageName = normalizePackageName;
/**
* Removes the prefix from a fullname.
* @param {string} fullname The term which may have the prefix.
* @returns {string} The term without prefix.
*/
function getShorthandName(fullname) {
if (fullname[0] === '@') {
let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, 'u').exec(fullname);
if (matchResult) {
return matchResult[1];
}
matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, 'u').exec(fullname);
if (matchResult) {
return `${matchResult[1]}/${matchResult[2]}`;
}
}
else if (fullname.startsWith(`${prefix}-`)) {
return fullname.slice(prefix.length + 1);
}
return fullname;
}
exports.getShorthandName = getShorthandName;
/**
* Gets the scope (namespace) of a term.
* @param {string} term The term which may have the namespace.
* @returns {string} The namepace of the term if it has one.
*/
function getNamespaceFromTerm(term) {
const match = term.match(NAMESPACE_REGEX);
return match ? match[0] : '';
}
exports.getNamespaceFromTerm = getNamespaceFromTerm;
//# sourceMappingURL=plugin-naming.js.map
\ No newline at end of file
{"version":3,"file":"plugin-naming.js","sourceRoot":"","sources":["../../src/utils/plugin-naming.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAwB;AAExB,8CAA8C;AAC9C,MAAM,eAAe,GAAG,UAAU,CAAC;AACnC,6EAA6E;AAC7E,MAAM,MAAM,GAAG,mBAAmB,CAAC;AAEnC,yCAAyC;AACzC,SAAS,kBAAkB,CAAC,QAAgB;IAC3C,MAAM,kBAAkB,GAAG,cAAI,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACpD,MAAM,aAAa,GAAG,kBAAkB,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE9D,OAAO,aAAa,CAAC;AACtB,CAAC;AAED;;;;;GAKG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAChD,IAAI,cAAc,GAAG,IAAI,CAAC;IAE1B;;;;OAIG;IACH,IAAI,cAAc,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE;QACtC,cAAc,GAAG,kBAAkB,CAAC,cAAc,CAAC,CAAC;KACpD;IAED,IAAI,cAAc,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACrC;;;WAGG;QACH,MAAM,0BAA0B,GAAG,IAAI,MAAM,CAC3C,mBAAmB,MAAM,OAAO,EAChC,GAAG,CACH,EACD,sBAAsB,GAAG,IAAI,MAAM,CAAC,IAAI,MAAM,OAAO,EAAE,GAAG,CAAC,CAAC;QAE7D,IAAI,0BAA0B,CAAC,IAAI,CAAC,cAAc,CAAC,EAAE;YACpD,cAAc,GAAG,cAAc,CAAC,OAAO,CACtC,0BAA0B,EAC1B,MAAM,MAAM,EAAE,CACd,CAAC;SACF;aAAM,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE;YACtE;;;eAGG;YACH,cAAc,GAAG,cAAc,CAAC,OAAO,CACtC,mBAAmB,EACnB,OAAO,MAAM,KAAK,CAClB,CAAC;SACF;KACD;SAAM,IAAI,cAAc,CAAC,OAAO,CAAC,GAAG,MAAM,GAAG,CAAC,KAAK,CAAC,EAAE;QACtD,cAAc,GAAG,GAAG,MAAM,IAAI,cAAc,EAAE,CAAC;KAC/C;IAED,OAAO,cAAc,CAAC;AACvB,CAAC;AA3CD,oDA2CC;AAED;;;;GAIG;AACH,SAAgB,gBAAgB,CAAC,QAAgB;IAChD,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE;QACxB,IAAI,WAAW,GAAG,IAAI,MAAM,CAAC,aAAa,MAAM,GAAG,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAEzE,IAAI,WAAW,EAAE;YAChB,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC;SACtB;QAED,WAAW,GAAG,IAAI,MAAM,CAAC,aAAa,MAAM,QAAQ,EAAE,GAAG,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC1E,IAAI,WAAW,EAAE;YAChB,OAAO,GAAG,WAAW,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC;SAC7C;KACD;SAAM,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE;QAC7C,OAAO,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;KACzC;IAED,OAAO,QAAQ,CAAC;AACjB,CAAC;AAjBD,4CAiBC;AAED;;;;GAIG;AACH,SAAgB,oBAAoB,CAAC,IAAY;IAChD,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;IAE1C,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9B,CAAC;AAJD,oDAIC"}
\ No newline at end of file
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册