Spaces:
Sleeping
Sleeping
Upload folder using huggingface_hub
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- .gitattributes +2 -0
- dashboard/index.html +11 -1
- dashboard/node_modules/.bin/nanoid +16 -0
- dashboard/node_modules/.bin/nanoid.cmd +17 -0
- dashboard/node_modules/.bin/nanoid.ps1 +28 -0
- dashboard/node_modules/.bin/rolldown +16 -0
- dashboard/node_modules/.bin/rolldown.cmd +17 -0
- dashboard/node_modules/.bin/rolldown.ps1 +28 -0
- dashboard/node_modules/.bin/vite +16 -0
- dashboard/node_modules/.bin/vite.cmd +17 -0
- dashboard/node_modules/.bin/vite.ps1 +28 -0
- dashboard/node_modules/.package-lock.json +328 -0
- dashboard/node_modules/.vite/deps/_metadata.json +8 -0
- dashboard/node_modules/.vite/deps/package.json +3 -0
- dashboard/node_modules/@oxc-project/types/LICENSE +22 -0
- dashboard/node_modules/@oxc-project/types/README.md +3 -0
- dashboard/node_modules/@oxc-project/types/package.json +26 -0
- dashboard/node_modules/@oxc-project/types/types.d.ts +1912 -0
- dashboard/node_modules/@rolldown/binding-win32-x64-msvc/README.md +3 -0
- dashboard/node_modules/@rolldown/binding-win32-x64-msvc/package.json +37 -0
- dashboard/node_modules/@rolldown/binding-win32-x64-msvc/rolldown-binding.win32-x64-msvc.node +3 -0
- dashboard/node_modules/@rolldown/pluginutils/LICENSE +25 -0
- dashboard/node_modules/@rolldown/pluginutils/README.md +83 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts +90 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js +256 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts +28 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js +75 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts +3 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/index.js +3 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts +71 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js +70 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/index.d.ts +1 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/index.js +1 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/utils.d.ts +2 -0
- dashboard/node_modules/@rolldown/pluginutils/dist/utils.js +17 -0
- dashboard/node_modules/@rolldown/pluginutils/package.json +37 -0
- dashboard/node_modules/detect-libc/LICENSE +201 -0
- dashboard/node_modules/detect-libc/README.md +163 -0
- dashboard/node_modules/detect-libc/index.d.ts +14 -0
- dashboard/node_modules/detect-libc/lib/detect-libc.js +313 -0
- dashboard/node_modules/detect-libc/lib/elf.js +39 -0
- dashboard/node_modules/detect-libc/lib/filesystem.js +51 -0
- dashboard/node_modules/detect-libc/lib/process.js +24 -0
- dashboard/node_modules/detect-libc/package.json +44 -0
- dashboard/node_modules/fdir/LICENSE +7 -0
- dashboard/node_modules/fdir/README.md +91 -0
- dashboard/node_modules/fdir/dist/index.cjs +588 -0
- dashboard/node_modules/fdir/dist/index.d.cts +155 -0
- dashboard/node_modules/fdir/dist/index.d.mts +155 -0
- dashboard/node_modules/fdir/dist/index.mjs +570 -0
.gitattributes
CHANGED
|
@@ -2,3 +2,5 @@
|
|
| 2 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 4 |
training/rrm_rl_trajectories.json filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
| 2 |
*.bin filter=lfs diff=lfs merge=lfs -text
|
| 3 |
*.safetensors filter=lfs diff=lfs merge=lfs -text
|
| 4 |
training/rrm_rl_trajectories.json filter=lfs diff=lfs merge=lfs -text
|
| 5 |
+
dashboard/node_modules/@rolldown/binding-win32-x64-msvc/rolldown-binding.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
| 6 |
+
dashboard/node_modules/lightningcss-win32-x64-msvc/lightningcss.win32-x64-msvc.node filter=lfs diff=lfs merge=lfs -text
|
dashboard/index.html
CHANGED
|
@@ -14,11 +14,21 @@
|
|
| 14 |
<div style="margin-top: 2rem;">
|
| 15 |
<small style="color: #666;">MODEL METRICS</small>
|
| 16 |
<div style="font-size: 0.9rem; margin-top: 0.5rem;">
|
| 17 |
-
Params:
|
| 18 |
Context: 1024<br>
|
|
|
|
| 19 |
Logic: RRM-RL90K
|
| 20 |
</div>
|
| 21 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
</div>
|
| 23 |
<div class="main-content">
|
| 24 |
<div class="monitor-view" id="monitor">
|
|
|
|
| 14 |
<div style="margin-top: 2rem;">
|
| 15 |
<small style="color: #666;">MODEL METRICS</small>
|
| 16 |
<div style="font-size: 0.9rem; margin-top: 0.5rem;">
|
| 17 |
+
Params: ~94.9M<br>
|
| 18 |
Context: 1024<br>
|
| 19 |
+
Memory Slots: 32/layer<br>
|
| 20 |
Logic: RRM-RL90K
|
| 21 |
</div>
|
| 22 |
</div>
|
| 23 |
+
<div style="margin-top: 2rem;">
|
| 24 |
+
<small style="color: #666;">CLOUD MCPs</small>
|
| 25 |
+
<div style="font-size: 0.8rem; margin-top: 0.5rem; opacity: 0.8;">
|
| 26 |
+
● Figma (Design)<br>
|
| 27 |
+
● Calendar (Google)<br>
|
| 28 |
+
● Notion (Workspace)<br>
|
| 29 |
+
● Sheets/Slides (GWS)
|
| 30 |
+
</div>
|
| 31 |
+
</div>
|
| 32 |
</div>
|
| 33 |
<div class="main-content">
|
| 34 |
<div class="monitor-view" id="monitor">
|
dashboard/node_modules/.bin/nanoid
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
| 3 |
+
|
| 4 |
+
case `uname` in
|
| 5 |
+
*CYGWIN*|*MINGW*|*MSYS*)
|
| 6 |
+
if command -v cygpath > /dev/null 2>&1; then
|
| 7 |
+
basedir=`cygpath -w "$basedir"`
|
| 8 |
+
fi
|
| 9 |
+
;;
|
| 10 |
+
esac
|
| 11 |
+
|
| 12 |
+
if [ -x "$basedir/node" ]; then
|
| 13 |
+
exec "$basedir/node" "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
| 14 |
+
else
|
| 15 |
+
exec node "$basedir/../nanoid/bin/nanoid.cjs" "$@"
|
| 16 |
+
fi
|
dashboard/node_modules/.bin/nanoid.cmd
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@ECHO off
|
| 2 |
+
GOTO start
|
| 3 |
+
:find_dp0
|
| 4 |
+
SET dp0=%~dp0
|
| 5 |
+
EXIT /b
|
| 6 |
+
:start
|
| 7 |
+
SETLOCAL
|
| 8 |
+
CALL :find_dp0
|
| 9 |
+
|
| 10 |
+
IF EXIST "%dp0%\node.exe" (
|
| 11 |
+
SET "_prog=%dp0%\node.exe"
|
| 12 |
+
) ELSE (
|
| 13 |
+
SET "_prog=node"
|
| 14 |
+
SET PATHEXT=%PATHEXT:;.JS;=;%
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\nanoid\bin\nanoid.cjs" %*
|
dashboard/node_modules/.bin/nanoid.ps1
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env pwsh
|
| 2 |
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
| 3 |
+
|
| 4 |
+
$exe=""
|
| 5 |
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
| 6 |
+
# Fix case when both the Windows and Linux builds of Node
|
| 7 |
+
# are installed in the same directory
|
| 8 |
+
$exe=".exe"
|
| 9 |
+
}
|
| 10 |
+
$ret=0
|
| 11 |
+
if (Test-Path "$basedir/node$exe") {
|
| 12 |
+
# Support pipeline input
|
| 13 |
+
if ($MyInvocation.ExpectingInput) {
|
| 14 |
+
$input | & "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
| 15 |
+
} else {
|
| 16 |
+
& "$basedir/node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
| 17 |
+
}
|
| 18 |
+
$ret=$LASTEXITCODE
|
| 19 |
+
} else {
|
| 20 |
+
# Support pipeline input
|
| 21 |
+
if ($MyInvocation.ExpectingInput) {
|
| 22 |
+
$input | & "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
| 23 |
+
} else {
|
| 24 |
+
& "node$exe" "$basedir/../nanoid/bin/nanoid.cjs" $args
|
| 25 |
+
}
|
| 26 |
+
$ret=$LASTEXITCODE
|
| 27 |
+
}
|
| 28 |
+
exit $ret
|
dashboard/node_modules/.bin/rolldown
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
| 3 |
+
|
| 4 |
+
case `uname` in
|
| 5 |
+
*CYGWIN*|*MINGW*|*MSYS*)
|
| 6 |
+
if command -v cygpath > /dev/null 2>&1; then
|
| 7 |
+
basedir=`cygpath -w "$basedir"`
|
| 8 |
+
fi
|
| 9 |
+
;;
|
| 10 |
+
esac
|
| 11 |
+
|
| 12 |
+
if [ -x "$basedir/node" ]; then
|
| 13 |
+
exec "$basedir/node" "$basedir/../rolldown/bin/cli.mjs" "$@"
|
| 14 |
+
else
|
| 15 |
+
exec node "$basedir/../rolldown/bin/cli.mjs" "$@"
|
| 16 |
+
fi
|
dashboard/node_modules/.bin/rolldown.cmd
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@ECHO off
|
| 2 |
+
GOTO start
|
| 3 |
+
:find_dp0
|
| 4 |
+
SET dp0=%~dp0
|
| 5 |
+
EXIT /b
|
| 6 |
+
:start
|
| 7 |
+
SETLOCAL
|
| 8 |
+
CALL :find_dp0
|
| 9 |
+
|
| 10 |
+
IF EXIST "%dp0%\node.exe" (
|
| 11 |
+
SET "_prog=%dp0%\node.exe"
|
| 12 |
+
) ELSE (
|
| 13 |
+
SET "_prog=node"
|
| 14 |
+
SET PATHEXT=%PATHEXT:;.JS;=;%
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\rolldown\bin\cli.mjs" %*
|
dashboard/node_modules/.bin/rolldown.ps1
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env pwsh
|
| 2 |
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
| 3 |
+
|
| 4 |
+
$exe=""
|
| 5 |
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
| 6 |
+
# Fix case when both the Windows and Linux builds of Node
|
| 7 |
+
# are installed in the same directory
|
| 8 |
+
$exe=".exe"
|
| 9 |
+
}
|
| 10 |
+
$ret=0
|
| 11 |
+
if (Test-Path "$basedir/node$exe") {
|
| 12 |
+
# Support pipeline input
|
| 13 |
+
if ($MyInvocation.ExpectingInput) {
|
| 14 |
+
$input | & "$basedir/node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
| 15 |
+
} else {
|
| 16 |
+
& "$basedir/node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
| 17 |
+
}
|
| 18 |
+
$ret=$LASTEXITCODE
|
| 19 |
+
} else {
|
| 20 |
+
# Support pipeline input
|
| 21 |
+
if ($MyInvocation.ExpectingInput) {
|
| 22 |
+
$input | & "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
| 23 |
+
} else {
|
| 24 |
+
& "node$exe" "$basedir/../rolldown/bin/cli.mjs" $args
|
| 25 |
+
}
|
| 26 |
+
$ret=$LASTEXITCODE
|
| 27 |
+
}
|
| 28 |
+
exit $ret
|
dashboard/node_modules/.bin/vite
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/sh
|
| 2 |
+
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
|
| 3 |
+
|
| 4 |
+
case `uname` in
|
| 5 |
+
*CYGWIN*|*MINGW*|*MSYS*)
|
| 6 |
+
if command -v cygpath > /dev/null 2>&1; then
|
| 7 |
+
basedir=`cygpath -w "$basedir"`
|
| 8 |
+
fi
|
| 9 |
+
;;
|
| 10 |
+
esac
|
| 11 |
+
|
| 12 |
+
if [ -x "$basedir/node" ]; then
|
| 13 |
+
exec "$basedir/node" "$basedir/../vite/bin/vite.js" "$@"
|
| 14 |
+
else
|
| 15 |
+
exec node "$basedir/../vite/bin/vite.js" "$@"
|
| 16 |
+
fi
|
dashboard/node_modules/.bin/vite.cmd
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
@ECHO off
|
| 2 |
+
GOTO start
|
| 3 |
+
:find_dp0
|
| 4 |
+
SET dp0=%~dp0
|
| 5 |
+
EXIT /b
|
| 6 |
+
:start
|
| 7 |
+
SETLOCAL
|
| 8 |
+
CALL :find_dp0
|
| 9 |
+
|
| 10 |
+
IF EXIST "%dp0%\node.exe" (
|
| 11 |
+
SET "_prog=%dp0%\node.exe"
|
| 12 |
+
) ELSE (
|
| 13 |
+
SET "_prog=node"
|
| 14 |
+
SET PATHEXT=%PATHEXT:;.JS;=;%
|
| 15 |
+
)
|
| 16 |
+
|
| 17 |
+
endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%" "%dp0%\..\vite\bin\vite.js" %*
|
dashboard/node_modules/.bin/vite.ps1
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env pwsh
|
| 2 |
+
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
|
| 3 |
+
|
| 4 |
+
$exe=""
|
| 5 |
+
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
|
| 6 |
+
# Fix case when both the Windows and Linux builds of Node
|
| 7 |
+
# are installed in the same directory
|
| 8 |
+
$exe=".exe"
|
| 9 |
+
}
|
| 10 |
+
$ret=0
|
| 11 |
+
if (Test-Path "$basedir/node$exe") {
|
| 12 |
+
# Support pipeline input
|
| 13 |
+
if ($MyInvocation.ExpectingInput) {
|
| 14 |
+
$input | & "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
|
| 15 |
+
} else {
|
| 16 |
+
& "$basedir/node$exe" "$basedir/../vite/bin/vite.js" $args
|
| 17 |
+
}
|
| 18 |
+
$ret=$LASTEXITCODE
|
| 19 |
+
} else {
|
| 20 |
+
# Support pipeline input
|
| 21 |
+
if ($MyInvocation.ExpectingInput) {
|
| 22 |
+
$input | & "node$exe" "$basedir/../vite/bin/vite.js" $args
|
| 23 |
+
} else {
|
| 24 |
+
& "node$exe" "$basedir/../vite/bin/vite.js" $args
|
| 25 |
+
}
|
| 26 |
+
$ret=$LASTEXITCODE
|
| 27 |
+
}
|
| 28 |
+
exit $ret
|
dashboard/node_modules/.package-lock.json
ADDED
|
@@ -0,0 +1,328 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "dashboard",
|
| 3 |
+
"version": "0.0.0",
|
| 4 |
+
"lockfileVersion": 3,
|
| 5 |
+
"requires": true,
|
| 6 |
+
"packages": {
|
| 7 |
+
"node_modules/@oxc-project/types": {
|
| 8 |
+
"version": "0.127.0",
|
| 9 |
+
"resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.127.0.tgz",
|
| 10 |
+
"integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==",
|
| 11 |
+
"dev": true,
|
| 12 |
+
"license": "MIT",
|
| 13 |
+
"funding": {
|
| 14 |
+
"url": "https://github.com/sponsors/Boshen"
|
| 15 |
+
}
|
| 16 |
+
},
|
| 17 |
+
"node_modules/@rolldown/binding-win32-x64-msvc": {
|
| 18 |
+
"version": "1.0.0-rc.17",
|
| 19 |
+
"resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.0.0-rc.17.tgz",
|
| 20 |
+
"integrity": "sha512-3hkiolcUAvPB9FLb3UZdfjVVNWherN1f/skkGWJP/fgSQhYUZpSIRr0/I8ZK9TkF3F7kxvJAk0+IcKvPHk9qQg==",
|
| 21 |
+
"cpu": [
|
| 22 |
+
"x64"
|
| 23 |
+
],
|
| 24 |
+
"dev": true,
|
| 25 |
+
"license": "MIT",
|
| 26 |
+
"optional": true,
|
| 27 |
+
"os": [
|
| 28 |
+
"win32"
|
| 29 |
+
],
|
| 30 |
+
"engines": {
|
| 31 |
+
"node": "^20.19.0 || >=22.12.0"
|
| 32 |
+
}
|
| 33 |
+
},
|
| 34 |
+
"node_modules/@rolldown/pluginutils": {
|
| 35 |
+
"version": "1.0.0-rc.17",
|
| 36 |
+
"resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.0-rc.17.tgz",
|
| 37 |
+
"integrity": "sha512-n8iosDOt6Ig1UhJ2AYqoIhHWh/isz0xpicHTzpKBeotdVsTEcxsSA/i3EVM7gQAj0rU27OLAxCjzlj15IWY7bg==",
|
| 38 |
+
"dev": true,
|
| 39 |
+
"license": "MIT"
|
| 40 |
+
},
|
| 41 |
+
"node_modules/detect-libc": {
|
| 42 |
+
"version": "2.1.2",
|
| 43 |
+
"resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",
|
| 44 |
+
"integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",
|
| 45 |
+
"dev": true,
|
| 46 |
+
"license": "Apache-2.0",
|
| 47 |
+
"engines": {
|
| 48 |
+
"node": ">=8"
|
| 49 |
+
}
|
| 50 |
+
},
|
| 51 |
+
"node_modules/fdir": {
|
| 52 |
+
"version": "6.5.0",
|
| 53 |
+
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
|
| 54 |
+
"integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",
|
| 55 |
+
"dev": true,
|
| 56 |
+
"license": "MIT",
|
| 57 |
+
"engines": {
|
| 58 |
+
"node": ">=12.0.0"
|
| 59 |
+
},
|
| 60 |
+
"peerDependencies": {
|
| 61 |
+
"picomatch": "^3 || ^4"
|
| 62 |
+
},
|
| 63 |
+
"peerDependenciesMeta": {
|
| 64 |
+
"picomatch": {
|
| 65 |
+
"optional": true
|
| 66 |
+
}
|
| 67 |
+
}
|
| 68 |
+
},
|
| 69 |
+
"node_modules/lightningcss": {
|
| 70 |
+
"version": "1.32.0",
|
| 71 |
+
"resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.32.0.tgz",
|
| 72 |
+
"integrity": "sha512-NXYBzinNrblfraPGyrbPoD19C1h9lfI/1mzgWYvXUTe414Gz/X1FD2XBZSZM7rRTrMA8JL3OtAaGifrIKhQ5yQ==",
|
| 73 |
+
"dev": true,
|
| 74 |
+
"license": "MPL-2.0",
|
| 75 |
+
"dependencies": {
|
| 76 |
+
"detect-libc": "^2.0.3"
|
| 77 |
+
},
|
| 78 |
+
"engines": {
|
| 79 |
+
"node": ">= 12.0.0"
|
| 80 |
+
},
|
| 81 |
+
"funding": {
|
| 82 |
+
"type": "opencollective",
|
| 83 |
+
"url": "https://opencollective.com/parcel"
|
| 84 |
+
},
|
| 85 |
+
"optionalDependencies": {
|
| 86 |
+
"lightningcss-android-arm64": "1.32.0",
|
| 87 |
+
"lightningcss-darwin-arm64": "1.32.0",
|
| 88 |
+
"lightningcss-darwin-x64": "1.32.0",
|
| 89 |
+
"lightningcss-freebsd-x64": "1.32.0",
|
| 90 |
+
"lightningcss-linux-arm-gnueabihf": "1.32.0",
|
| 91 |
+
"lightningcss-linux-arm64-gnu": "1.32.0",
|
| 92 |
+
"lightningcss-linux-arm64-musl": "1.32.0",
|
| 93 |
+
"lightningcss-linux-x64-gnu": "1.32.0",
|
| 94 |
+
"lightningcss-linux-x64-musl": "1.32.0",
|
| 95 |
+
"lightningcss-win32-arm64-msvc": "1.32.0",
|
| 96 |
+
"lightningcss-win32-x64-msvc": "1.32.0"
|
| 97 |
+
}
|
| 98 |
+
},
|
| 99 |
+
"node_modules/lightningcss-win32-x64-msvc": {
|
| 100 |
+
"version": "1.32.0",
|
| 101 |
+
"resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.32.0.tgz",
|
| 102 |
+
"integrity": "sha512-Amq9B/SoZYdDi1kFrojnoqPLxYhQ4Wo5XiL8EVJrVsB8ARoC1PWW6VGtT0WKCemjy8aC+louJnjS7U18x3b06Q==",
|
| 103 |
+
"cpu": [
|
| 104 |
+
"x64"
|
| 105 |
+
],
|
| 106 |
+
"dev": true,
|
| 107 |
+
"license": "MPL-2.0",
|
| 108 |
+
"optional": true,
|
| 109 |
+
"os": [
|
| 110 |
+
"win32"
|
| 111 |
+
],
|
| 112 |
+
"engines": {
|
| 113 |
+
"node": ">= 12.0.0"
|
| 114 |
+
},
|
| 115 |
+
"funding": {
|
| 116 |
+
"type": "opencollective",
|
| 117 |
+
"url": "https://opencollective.com/parcel"
|
| 118 |
+
}
|
| 119 |
+
},
|
| 120 |
+
"node_modules/nanoid": {
|
| 121 |
+
"version": "3.3.12",
|
| 122 |
+
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.12.tgz",
|
| 123 |
+
"integrity": "sha512-ZB9RH/39qpq5Vu6Y+NmUaFhQR6pp+M2Xt76XBnEwDaGcVAqhlvxrl3B2bKS5D3NH3QR76v3aSrKaF/Kiy7lEtQ==",
|
| 124 |
+
"dev": true,
|
| 125 |
+
"funding": [
|
| 126 |
+
{
|
| 127 |
+
"type": "github",
|
| 128 |
+
"url": "https://github.com/sponsors/ai"
|
| 129 |
+
}
|
| 130 |
+
],
|
| 131 |
+
"license": "MIT",
|
| 132 |
+
"bin": {
|
| 133 |
+
"nanoid": "bin/nanoid.cjs"
|
| 134 |
+
},
|
| 135 |
+
"engines": {
|
| 136 |
+
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
| 137 |
+
}
|
| 138 |
+
},
|
| 139 |
+
"node_modules/picocolors": {
|
| 140 |
+
"version": "1.1.1",
|
| 141 |
+
"resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",
|
| 142 |
+
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",
|
| 143 |
+
"dev": true,
|
| 144 |
+
"license": "ISC"
|
| 145 |
+
},
|
| 146 |
+
"node_modules/picomatch": {
|
| 147 |
+
"version": "4.0.4",
|
| 148 |
+
"resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.4.tgz",
|
| 149 |
+
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
| 150 |
+
"dev": true,
|
| 151 |
+
"license": "MIT",
|
| 152 |
+
"engines": {
|
| 153 |
+
"node": ">=12"
|
| 154 |
+
},
|
| 155 |
+
"funding": {
|
| 156 |
+
"url": "https://github.com/sponsors/jonschlinkert"
|
| 157 |
+
}
|
| 158 |
+
},
|
| 159 |
+
"node_modules/postcss": {
|
| 160 |
+
"version": "8.5.13",
|
| 161 |
+
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.13.tgz",
|
| 162 |
+
"integrity": "sha512-qif0+jGGZoLWdHey3UFHHWP0H7Gbmsk8T5VEqyYFbWqPr1XqvLGBbk/sl8V5exGmcYJklJOhOQq1pV9IcsiFag==",
|
| 163 |
+
"dev": true,
|
| 164 |
+
"funding": [
|
| 165 |
+
{
|
| 166 |
+
"type": "opencollective",
|
| 167 |
+
"url": "https://opencollective.com/postcss/"
|
| 168 |
+
},
|
| 169 |
+
{
|
| 170 |
+
"type": "tidelift",
|
| 171 |
+
"url": "https://tidelift.com/funding/github/npm/postcss"
|
| 172 |
+
},
|
| 173 |
+
{
|
| 174 |
+
"type": "github",
|
| 175 |
+
"url": "https://github.com/sponsors/ai"
|
| 176 |
+
}
|
| 177 |
+
],
|
| 178 |
+
"license": "MIT",
|
| 179 |
+
"dependencies": {
|
| 180 |
+
"nanoid": "^3.3.11",
|
| 181 |
+
"picocolors": "^1.1.1",
|
| 182 |
+
"source-map-js": "^1.2.1"
|
| 183 |
+
},
|
| 184 |
+
"engines": {
|
| 185 |
+
"node": "^10 || ^12 || >=14"
|
| 186 |
+
}
|
| 187 |
+
},
|
| 188 |
+
"node_modules/rolldown": {
|
| 189 |
+
"version": "1.0.0-rc.17",
|
| 190 |
+
"resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.0.0-rc.17.tgz",
|
| 191 |
+
"integrity": "sha512-ZrT53oAKrtA4+YtBWPQbtPOxIbVDbxT0orcYERKd63VJTF13zPcgXTvD4843L8pcsI7M6MErt8QtON6lrB9tyA==",
|
| 192 |
+
"dev": true,
|
| 193 |
+
"license": "MIT",
|
| 194 |
+
"dependencies": {
|
| 195 |
+
"@oxc-project/types": "=0.127.0",
|
| 196 |
+
"@rolldown/pluginutils": "1.0.0-rc.17"
|
| 197 |
+
},
|
| 198 |
+
"bin": {
|
| 199 |
+
"rolldown": "bin/cli.mjs"
|
| 200 |
+
},
|
| 201 |
+
"engines": {
|
| 202 |
+
"node": "^20.19.0 || >=22.12.0"
|
| 203 |
+
},
|
| 204 |
+
"optionalDependencies": {
|
| 205 |
+
"@rolldown/binding-android-arm64": "1.0.0-rc.17",
|
| 206 |
+
"@rolldown/binding-darwin-arm64": "1.0.0-rc.17",
|
| 207 |
+
"@rolldown/binding-darwin-x64": "1.0.0-rc.17",
|
| 208 |
+
"@rolldown/binding-freebsd-x64": "1.0.0-rc.17",
|
| 209 |
+
"@rolldown/binding-linux-arm-gnueabihf": "1.0.0-rc.17",
|
| 210 |
+
"@rolldown/binding-linux-arm64-gnu": "1.0.0-rc.17",
|
| 211 |
+
"@rolldown/binding-linux-arm64-musl": "1.0.0-rc.17",
|
| 212 |
+
"@rolldown/binding-linux-ppc64-gnu": "1.0.0-rc.17",
|
| 213 |
+
"@rolldown/binding-linux-s390x-gnu": "1.0.0-rc.17",
|
| 214 |
+
"@rolldown/binding-linux-x64-gnu": "1.0.0-rc.17",
|
| 215 |
+
"@rolldown/binding-linux-x64-musl": "1.0.0-rc.17",
|
| 216 |
+
"@rolldown/binding-openharmony-arm64": "1.0.0-rc.17",
|
| 217 |
+
"@rolldown/binding-wasm32-wasi": "1.0.0-rc.17",
|
| 218 |
+
"@rolldown/binding-win32-arm64-msvc": "1.0.0-rc.17",
|
| 219 |
+
"@rolldown/binding-win32-x64-msvc": "1.0.0-rc.17"
|
| 220 |
+
}
|
| 221 |
+
},
|
| 222 |
+
"node_modules/source-map-js": {
|
| 223 |
+
"version": "1.2.1",
|
| 224 |
+
"resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
|
| 225 |
+
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
|
| 226 |
+
"dev": true,
|
| 227 |
+
"license": "BSD-3-Clause",
|
| 228 |
+
"engines": {
|
| 229 |
+
"node": ">=0.10.0"
|
| 230 |
+
}
|
| 231 |
+
},
|
| 232 |
+
"node_modules/tinyglobby": {
|
| 233 |
+
"version": "0.2.16",
|
| 234 |
+
"resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.16.tgz",
|
| 235 |
+
"integrity": "sha512-pn99VhoACYR8nFHhxqix+uvsbXineAasWm5ojXoN8xEwK5Kd3/TrhNn1wByuD52UxWRLy8pu+kRMniEi6Eq9Zg==",
|
| 236 |
+
"dev": true,
|
| 237 |
+
"license": "MIT",
|
| 238 |
+
"dependencies": {
|
| 239 |
+
"fdir": "^6.5.0",
|
| 240 |
+
"picomatch": "^4.0.4"
|
| 241 |
+
},
|
| 242 |
+
"engines": {
|
| 243 |
+
"node": ">=12.0.0"
|
| 244 |
+
},
|
| 245 |
+
"funding": {
|
| 246 |
+
"url": "https://github.com/sponsors/SuperchupuDev"
|
| 247 |
+
}
|
| 248 |
+
},
|
| 249 |
+
"node_modules/vite": {
|
| 250 |
+
"version": "8.0.10",
|
| 251 |
+
"resolved": "https://registry.npmjs.org/vite/-/vite-8.0.10.tgz",
|
| 252 |
+
"integrity": "sha512-rZuUu9j6J5uotLDs+cAA4O5H4K1SfPliUlQwqa6YEwSrWDZzP4rhm00oJR5snMewjxF5V/K3D4kctsUTsIU9Mw==",
|
| 253 |
+
"dev": true,
|
| 254 |
+
"license": "MIT",
|
| 255 |
+
"dependencies": {
|
| 256 |
+
"lightningcss": "^1.32.0",
|
| 257 |
+
"picomatch": "^4.0.4",
|
| 258 |
+
"postcss": "^8.5.10",
|
| 259 |
+
"rolldown": "1.0.0-rc.17",
|
| 260 |
+
"tinyglobby": "^0.2.16"
|
| 261 |
+
},
|
| 262 |
+
"bin": {
|
| 263 |
+
"vite": "bin/vite.js"
|
| 264 |
+
},
|
| 265 |
+
"engines": {
|
| 266 |
+
"node": "^20.19.0 || >=22.12.0"
|
| 267 |
+
},
|
| 268 |
+
"funding": {
|
| 269 |
+
"url": "https://github.com/vitejs/vite?sponsor=1"
|
| 270 |
+
},
|
| 271 |
+
"optionalDependencies": {
|
| 272 |
+
"fsevents": "~2.3.3"
|
| 273 |
+
},
|
| 274 |
+
"peerDependencies": {
|
| 275 |
+
"@types/node": "^20.19.0 || >=22.12.0",
|
| 276 |
+
"@vitejs/devtools": "^0.1.0",
|
| 277 |
+
"esbuild": "^0.27.0 || ^0.28.0",
|
| 278 |
+
"jiti": ">=1.21.0",
|
| 279 |
+
"less": "^4.0.0",
|
| 280 |
+
"sass": "^1.70.0",
|
| 281 |
+
"sass-embedded": "^1.70.0",
|
| 282 |
+
"stylus": ">=0.54.8",
|
| 283 |
+
"sugarss": "^5.0.0",
|
| 284 |
+
"terser": "^5.16.0",
|
| 285 |
+
"tsx": "^4.8.1",
|
| 286 |
+
"yaml": "^2.4.2"
|
| 287 |
+
},
|
| 288 |
+
"peerDependenciesMeta": {
|
| 289 |
+
"@types/node": {
|
| 290 |
+
"optional": true
|
| 291 |
+
},
|
| 292 |
+
"@vitejs/devtools": {
|
| 293 |
+
"optional": true
|
| 294 |
+
},
|
| 295 |
+
"esbuild": {
|
| 296 |
+
"optional": true
|
| 297 |
+
},
|
| 298 |
+
"jiti": {
|
| 299 |
+
"optional": true
|
| 300 |
+
},
|
| 301 |
+
"less": {
|
| 302 |
+
"optional": true
|
| 303 |
+
},
|
| 304 |
+
"sass": {
|
| 305 |
+
"optional": true
|
| 306 |
+
},
|
| 307 |
+
"sass-embedded": {
|
| 308 |
+
"optional": true
|
| 309 |
+
},
|
| 310 |
+
"stylus": {
|
| 311 |
+
"optional": true
|
| 312 |
+
},
|
| 313 |
+
"sugarss": {
|
| 314 |
+
"optional": true
|
| 315 |
+
},
|
| 316 |
+
"terser": {
|
| 317 |
+
"optional": true
|
| 318 |
+
},
|
| 319 |
+
"tsx": {
|
| 320 |
+
"optional": true
|
| 321 |
+
},
|
| 322 |
+
"yaml": {
|
| 323 |
+
"optional": true
|
| 324 |
+
}
|
| 325 |
+
}
|
| 326 |
+
}
|
| 327 |
+
}
|
| 328 |
+
}
|
dashboard/node_modules/.vite/deps/_metadata.json
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"hash": "64673c37",
|
| 3 |
+
"configHash": "c827bc6e",
|
| 4 |
+
"lockfileHash": "fe4eda88",
|
| 5 |
+
"browserHash": "2bbc932b",
|
| 6 |
+
"optimized": {},
|
| 7 |
+
"chunks": {}
|
| 8 |
+
}
|
dashboard/node_modules/.vite/deps/package.json
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"type": "module"
|
| 3 |
+
}
|
dashboard/node_modules/@oxc-project/types/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
| 4 |
+
Copyright (c) 2023 Boshen
|
| 5 |
+
|
| 6 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 7 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 8 |
+
in the Software without restriction, including without limitation the rights
|
| 9 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 10 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 11 |
+
furnished to do so, subject to the following conditions:
|
| 12 |
+
|
| 13 |
+
The above copyright notice and this permission notice shall be included in all
|
| 14 |
+
copies or substantial portions of the Software.
|
| 15 |
+
|
| 16 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 17 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 18 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 19 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 20 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 21 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 22 |
+
SOFTWARE.
|
dashboard/node_modules/@oxc-project/types/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Oxc Types
|
| 2 |
+
|
| 3 |
+
Typescript definitions for Oxc AST nodes.
|
dashboard/node_modules/@oxc-project/types/package.json
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@oxc-project/types",
|
| 3 |
+
"version": "0.127.0",
|
| 4 |
+
"description": "Types for Oxc AST nodes",
|
| 5 |
+
"keywords": [
|
| 6 |
+
"AST",
|
| 7 |
+
"Parser"
|
| 8 |
+
],
|
| 9 |
+
"homepage": "https://oxc.rs",
|
| 10 |
+
"bugs": "https://github.com/oxc-project/oxc/issues",
|
| 11 |
+
"license": "MIT",
|
| 12 |
+
"author": "Boshen and oxc contributors",
|
| 13 |
+
"repository": {
|
| 14 |
+
"type": "git",
|
| 15 |
+
"url": "git+https://github.com/oxc-project/oxc.git",
|
| 16 |
+
"directory": "npm/oxc-types"
|
| 17 |
+
},
|
| 18 |
+
"funding": {
|
| 19 |
+
"url": "https://github.com/sponsors/Boshen"
|
| 20 |
+
},
|
| 21 |
+
"files": [
|
| 22 |
+
"types.d.ts"
|
| 23 |
+
],
|
| 24 |
+
"type": "module",
|
| 25 |
+
"types": "types.d.ts"
|
| 26 |
+
}
|
dashboard/node_modules/@oxc-project/types/types.d.ts
ADDED
|
@@ -0,0 +1,1912 @@
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Auto-generated code, DO NOT EDIT DIRECTLY!
|
| 2 |
+
// To edit this generated file you have to edit `tasks/ast_tools/src/generators/typescript.rs`.
|
| 3 |
+
|
| 4 |
+
export interface Program extends Span {
|
| 5 |
+
type: "Program";
|
| 6 |
+
body: Array<Directive | Statement>;
|
| 7 |
+
sourceType: ModuleKind;
|
| 8 |
+
hashbang: Hashbang | null;
|
| 9 |
+
parent?: null;
|
| 10 |
+
}
|
| 11 |
+
|
| 12 |
+
export type Expression =
|
| 13 |
+
| BooleanLiteral
|
| 14 |
+
| NullLiteral
|
| 15 |
+
| NumericLiteral
|
| 16 |
+
| BigIntLiteral
|
| 17 |
+
| RegExpLiteral
|
| 18 |
+
| StringLiteral
|
| 19 |
+
| TemplateLiteral
|
| 20 |
+
| IdentifierReference
|
| 21 |
+
| MetaProperty
|
| 22 |
+
| Super
|
| 23 |
+
| ArrayExpression
|
| 24 |
+
| ArrowFunctionExpression
|
| 25 |
+
| AssignmentExpression
|
| 26 |
+
| AwaitExpression
|
| 27 |
+
| BinaryExpression
|
| 28 |
+
| CallExpression
|
| 29 |
+
| ChainExpression
|
| 30 |
+
| Class
|
| 31 |
+
| ConditionalExpression
|
| 32 |
+
| Function
|
| 33 |
+
| ImportExpression
|
| 34 |
+
| LogicalExpression
|
| 35 |
+
| NewExpression
|
| 36 |
+
| ObjectExpression
|
| 37 |
+
| ParenthesizedExpression
|
| 38 |
+
| SequenceExpression
|
| 39 |
+
| TaggedTemplateExpression
|
| 40 |
+
| ThisExpression
|
| 41 |
+
| UnaryExpression
|
| 42 |
+
| UpdateExpression
|
| 43 |
+
| YieldExpression
|
| 44 |
+
| PrivateInExpression
|
| 45 |
+
| JSXElement
|
| 46 |
+
| JSXFragment
|
| 47 |
+
| TSAsExpression
|
| 48 |
+
| TSSatisfiesExpression
|
| 49 |
+
| TSTypeAssertion
|
| 50 |
+
| TSNonNullExpression
|
| 51 |
+
| TSInstantiationExpression
|
| 52 |
+
| V8IntrinsicExpression
|
| 53 |
+
| MemberExpression;
|
| 54 |
+
|
| 55 |
+
export interface IdentifierName extends Span {
|
| 56 |
+
type: "Identifier";
|
| 57 |
+
decorators?: [];
|
| 58 |
+
name: string;
|
| 59 |
+
optional?: false;
|
| 60 |
+
typeAnnotation?: null;
|
| 61 |
+
parent?: Node;
|
| 62 |
+
}
|
| 63 |
+
|
| 64 |
+
export interface IdentifierReference extends Span {
|
| 65 |
+
type: "Identifier";
|
| 66 |
+
decorators?: [];
|
| 67 |
+
name: string;
|
| 68 |
+
optional?: false;
|
| 69 |
+
typeAnnotation?: null;
|
| 70 |
+
parent?: Node;
|
| 71 |
+
}
|
| 72 |
+
|
| 73 |
+
export interface BindingIdentifier extends Span {
|
| 74 |
+
type: "Identifier";
|
| 75 |
+
decorators?: [];
|
| 76 |
+
name: string;
|
| 77 |
+
optional?: false;
|
| 78 |
+
typeAnnotation?: null;
|
| 79 |
+
parent?: Node;
|
| 80 |
+
}
|
| 81 |
+
|
| 82 |
+
export interface LabelIdentifier extends Span {
|
| 83 |
+
type: "Identifier";
|
| 84 |
+
decorators?: [];
|
| 85 |
+
name: string;
|
| 86 |
+
optional?: false;
|
| 87 |
+
typeAnnotation?: null;
|
| 88 |
+
parent?: Node;
|
| 89 |
+
}
|
| 90 |
+
|
| 91 |
+
export interface ThisExpression extends Span {
|
| 92 |
+
type: "ThisExpression";
|
| 93 |
+
parent?: Node;
|
| 94 |
+
}
|
| 95 |
+
|
| 96 |
+
export interface ArrayExpression extends Span {
|
| 97 |
+
type: "ArrayExpression";
|
| 98 |
+
elements: Array<ArrayExpressionElement>;
|
| 99 |
+
parent?: Node;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
export type ArrayExpressionElement = SpreadElement | null | Expression;
|
| 103 |
+
|
| 104 |
+
export interface ObjectExpression extends Span {
|
| 105 |
+
type: "ObjectExpression";
|
| 106 |
+
properties: Array<ObjectPropertyKind>;
|
| 107 |
+
parent?: Node;
|
| 108 |
+
}
|
| 109 |
+
|
| 110 |
+
export type ObjectPropertyKind = ObjectProperty | SpreadElement;
|
| 111 |
+
|
| 112 |
+
export interface ObjectProperty extends Span {
|
| 113 |
+
type: "Property";
|
| 114 |
+
kind: PropertyKind;
|
| 115 |
+
key: PropertyKey;
|
| 116 |
+
value: Expression;
|
| 117 |
+
method: boolean;
|
| 118 |
+
shorthand: boolean;
|
| 119 |
+
computed: boolean;
|
| 120 |
+
optional?: false;
|
| 121 |
+
parent?: Node;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
export type PropertyKey = IdentifierName | PrivateIdentifier | Expression;
|
| 125 |
+
|
| 126 |
+
export type PropertyKind = "init" | "get" | "set";
|
| 127 |
+
|
| 128 |
+
export interface TemplateLiteral extends Span {
|
| 129 |
+
type: "TemplateLiteral";
|
| 130 |
+
quasis: Array<TemplateElement>;
|
| 131 |
+
expressions: Array<Expression>;
|
| 132 |
+
parent?: Node;
|
| 133 |
+
}
|
| 134 |
+
|
| 135 |
+
export interface TaggedTemplateExpression extends Span {
|
| 136 |
+
type: "TaggedTemplateExpression";
|
| 137 |
+
tag: Expression;
|
| 138 |
+
typeArguments?: TSTypeParameterInstantiation | null;
|
| 139 |
+
quasi: TemplateLiteral;
|
| 140 |
+
parent?: Node;
|
| 141 |
+
}
|
| 142 |
+
|
| 143 |
+
export interface TemplateElement extends Span {
|
| 144 |
+
type: "TemplateElement";
|
| 145 |
+
value: TemplateElementValue;
|
| 146 |
+
tail: boolean;
|
| 147 |
+
parent?: Node;
|
| 148 |
+
}
|
| 149 |
+
|
| 150 |
+
export interface TemplateElementValue {
|
| 151 |
+
raw: string;
|
| 152 |
+
cooked: string | null;
|
| 153 |
+
}
|
| 154 |
+
|
| 155 |
+
export type MemberExpression =
|
| 156 |
+
| ComputedMemberExpression
|
| 157 |
+
| StaticMemberExpression
|
| 158 |
+
| PrivateFieldExpression;
|
| 159 |
+
|
| 160 |
+
export interface ComputedMemberExpression extends Span {
|
| 161 |
+
type: "MemberExpression";
|
| 162 |
+
object: Expression;
|
| 163 |
+
property: Expression;
|
| 164 |
+
optional: boolean;
|
| 165 |
+
computed: true;
|
| 166 |
+
parent?: Node;
|
| 167 |
+
}
|
| 168 |
+
|
| 169 |
+
export interface StaticMemberExpression extends Span {
|
| 170 |
+
type: "MemberExpression";
|
| 171 |
+
object: Expression;
|
| 172 |
+
property: IdentifierName;
|
| 173 |
+
optional: boolean;
|
| 174 |
+
computed: false;
|
| 175 |
+
parent?: Node;
|
| 176 |
+
}
|
| 177 |
+
|
| 178 |
+
export interface PrivateFieldExpression extends Span {
|
| 179 |
+
type: "MemberExpression";
|
| 180 |
+
object: Expression;
|
| 181 |
+
property: PrivateIdentifier;
|
| 182 |
+
optional: boolean;
|
| 183 |
+
computed: false;
|
| 184 |
+
parent?: Node;
|
| 185 |
+
}
|
| 186 |
+
|
| 187 |
+
export interface CallExpression extends Span {
|
| 188 |
+
type: "CallExpression";
|
| 189 |
+
callee: Expression;
|
| 190 |
+
typeArguments?: TSTypeParameterInstantiation | null;
|
| 191 |
+
arguments: Array<Argument>;
|
| 192 |
+
optional: boolean;
|
| 193 |
+
parent?: Node;
|
| 194 |
+
}
|
| 195 |
+
|
| 196 |
+
export interface NewExpression extends Span {
|
| 197 |
+
type: "NewExpression";
|
| 198 |
+
callee: Expression;
|
| 199 |
+
typeArguments?: TSTypeParameterInstantiation | null;
|
| 200 |
+
arguments: Array<Argument>;
|
| 201 |
+
parent?: Node;
|
| 202 |
+
}
|
| 203 |
+
|
| 204 |
+
export interface MetaProperty extends Span {
|
| 205 |
+
type: "MetaProperty";
|
| 206 |
+
meta: IdentifierName;
|
| 207 |
+
property: IdentifierName;
|
| 208 |
+
parent?: Node;
|
| 209 |
+
}
|
| 210 |
+
|
| 211 |
+
export interface SpreadElement extends Span {
|
| 212 |
+
type: "SpreadElement";
|
| 213 |
+
argument: Expression;
|
| 214 |
+
parent?: Node;
|
| 215 |
+
}
|
| 216 |
+
|
| 217 |
+
export type Argument = SpreadElement | Expression;
|
| 218 |
+
|
| 219 |
+
export interface UpdateExpression extends Span {
|
| 220 |
+
type: "UpdateExpression";
|
| 221 |
+
operator: UpdateOperator;
|
| 222 |
+
prefix: boolean;
|
| 223 |
+
argument: SimpleAssignmentTarget;
|
| 224 |
+
parent?: Node;
|
| 225 |
+
}
|
| 226 |
+
|
| 227 |
+
export interface UnaryExpression extends Span {
|
| 228 |
+
type: "UnaryExpression";
|
| 229 |
+
operator: UnaryOperator;
|
| 230 |
+
argument: Expression;
|
| 231 |
+
prefix: true;
|
| 232 |
+
parent?: Node;
|
| 233 |
+
}
|
| 234 |
+
|
| 235 |
+
export interface BinaryExpression extends Span {
|
| 236 |
+
type: "BinaryExpression";
|
| 237 |
+
left: Expression;
|
| 238 |
+
operator: BinaryOperator;
|
| 239 |
+
right: Expression;
|
| 240 |
+
parent?: Node;
|
| 241 |
+
}
|
| 242 |
+
|
| 243 |
+
export interface PrivateInExpression extends Span {
|
| 244 |
+
type: "BinaryExpression";
|
| 245 |
+
left: PrivateIdentifier;
|
| 246 |
+
operator: "in";
|
| 247 |
+
right: Expression;
|
| 248 |
+
parent?: Node;
|
| 249 |
+
}
|
| 250 |
+
|
| 251 |
+
export interface LogicalExpression extends Span {
|
| 252 |
+
type: "LogicalExpression";
|
| 253 |
+
left: Expression;
|
| 254 |
+
operator: LogicalOperator;
|
| 255 |
+
right: Expression;
|
| 256 |
+
parent?: Node;
|
| 257 |
+
}
|
| 258 |
+
|
| 259 |
+
export interface ConditionalExpression extends Span {
|
| 260 |
+
type: "ConditionalExpression";
|
| 261 |
+
test: Expression;
|
| 262 |
+
consequent: Expression;
|
| 263 |
+
alternate: Expression;
|
| 264 |
+
parent?: Node;
|
| 265 |
+
}
|
| 266 |
+
|
| 267 |
+
export interface AssignmentExpression extends Span {
|
| 268 |
+
type: "AssignmentExpression";
|
| 269 |
+
operator: AssignmentOperator;
|
| 270 |
+
left: AssignmentTarget;
|
| 271 |
+
right: Expression;
|
| 272 |
+
parent?: Node;
|
| 273 |
+
}
|
| 274 |
+
|
| 275 |
+
export type AssignmentTarget = SimpleAssignmentTarget | AssignmentTargetPattern;
|
| 276 |
+
|
| 277 |
+
export type SimpleAssignmentTarget =
|
| 278 |
+
| IdentifierReference
|
| 279 |
+
| TSAsExpression
|
| 280 |
+
| TSSatisfiesExpression
|
| 281 |
+
| TSNonNullExpression
|
| 282 |
+
| TSTypeAssertion
|
| 283 |
+
| MemberExpression;
|
| 284 |
+
|
| 285 |
+
export type AssignmentTargetPattern = ArrayAssignmentTarget | ObjectAssignmentTarget;
|
| 286 |
+
|
| 287 |
+
export interface ArrayAssignmentTarget extends Span {
|
| 288 |
+
type: "ArrayPattern";
|
| 289 |
+
decorators?: [];
|
| 290 |
+
elements: Array<AssignmentTargetMaybeDefault | AssignmentTargetRest | null>;
|
| 291 |
+
optional?: false;
|
| 292 |
+
typeAnnotation?: null;
|
| 293 |
+
parent?: Node;
|
| 294 |
+
}
|
| 295 |
+
|
| 296 |
+
export interface ObjectAssignmentTarget extends Span {
|
| 297 |
+
type: "ObjectPattern";
|
| 298 |
+
decorators?: [];
|
| 299 |
+
properties: Array<AssignmentTargetProperty | AssignmentTargetRest>;
|
| 300 |
+
optional?: false;
|
| 301 |
+
typeAnnotation?: null;
|
| 302 |
+
parent?: Node;
|
| 303 |
+
}
|
| 304 |
+
|
| 305 |
+
export interface AssignmentTargetRest extends Span {
|
| 306 |
+
type: "RestElement";
|
| 307 |
+
decorators?: [];
|
| 308 |
+
argument: AssignmentTarget;
|
| 309 |
+
optional?: false;
|
| 310 |
+
typeAnnotation?: null;
|
| 311 |
+
value?: null;
|
| 312 |
+
parent?: Node;
|
| 313 |
+
}
|
| 314 |
+
|
| 315 |
+
export type AssignmentTargetMaybeDefault = AssignmentTargetWithDefault | AssignmentTarget;
|
| 316 |
+
|
| 317 |
+
export interface AssignmentTargetWithDefault extends Span {
|
| 318 |
+
type: "AssignmentPattern";
|
| 319 |
+
decorators?: [];
|
| 320 |
+
left: AssignmentTarget;
|
| 321 |
+
right: Expression;
|
| 322 |
+
optional?: false;
|
| 323 |
+
typeAnnotation?: null;
|
| 324 |
+
parent?: Node;
|
| 325 |
+
}
|
| 326 |
+
|
| 327 |
+
export type AssignmentTargetProperty =
|
| 328 |
+
| AssignmentTargetPropertyIdentifier
|
| 329 |
+
| AssignmentTargetPropertyProperty;
|
| 330 |
+
|
| 331 |
+
export interface AssignmentTargetPropertyIdentifier extends Span {
|
| 332 |
+
type: "Property";
|
| 333 |
+
kind: "init";
|
| 334 |
+
key: IdentifierReference;
|
| 335 |
+
value: IdentifierReference | AssignmentTargetWithDefault;
|
| 336 |
+
method: false;
|
| 337 |
+
shorthand: true;
|
| 338 |
+
computed: false;
|
| 339 |
+
optional?: false;
|
| 340 |
+
parent?: Node;
|
| 341 |
+
}
|
| 342 |
+
|
| 343 |
+
export interface AssignmentTargetPropertyProperty extends Span {
|
| 344 |
+
type: "Property";
|
| 345 |
+
kind: "init";
|
| 346 |
+
key: PropertyKey;
|
| 347 |
+
value: AssignmentTargetMaybeDefault;
|
| 348 |
+
method: false;
|
| 349 |
+
shorthand: false;
|
| 350 |
+
computed: boolean;
|
| 351 |
+
optional?: false;
|
| 352 |
+
parent?: Node;
|
| 353 |
+
}
|
| 354 |
+
|
| 355 |
+
export interface SequenceExpression extends Span {
|
| 356 |
+
type: "SequenceExpression";
|
| 357 |
+
expressions: Array<Expression>;
|
| 358 |
+
parent?: Node;
|
| 359 |
+
}
|
| 360 |
+
|
| 361 |
+
export interface Super extends Span {
|
| 362 |
+
type: "Super";
|
| 363 |
+
parent?: Node;
|
| 364 |
+
}
|
| 365 |
+
|
| 366 |
+
export interface AwaitExpression extends Span {
|
| 367 |
+
type: "AwaitExpression";
|
| 368 |
+
argument: Expression;
|
| 369 |
+
parent?: Node;
|
| 370 |
+
}
|
| 371 |
+
|
| 372 |
+
export interface ChainExpression extends Span {
|
| 373 |
+
type: "ChainExpression";
|
| 374 |
+
expression: ChainElement;
|
| 375 |
+
parent?: Node;
|
| 376 |
+
}
|
| 377 |
+
|
| 378 |
+
export type ChainElement = CallExpression | TSNonNullExpression | MemberExpression;
|
| 379 |
+
|
| 380 |
+
export interface ParenthesizedExpression extends Span {
|
| 381 |
+
type: "ParenthesizedExpression";
|
| 382 |
+
expression: Expression;
|
| 383 |
+
parent?: Node;
|
| 384 |
+
}
|
| 385 |
+
|
| 386 |
+
export type Statement =
|
| 387 |
+
| BlockStatement
|
| 388 |
+
| BreakStatement
|
| 389 |
+
| ContinueStatement
|
| 390 |
+
| DebuggerStatement
|
| 391 |
+
| DoWhileStatement
|
| 392 |
+
| EmptyStatement
|
| 393 |
+
| ExpressionStatement
|
| 394 |
+
| ForInStatement
|
| 395 |
+
| ForOfStatement
|
| 396 |
+
| ForStatement
|
| 397 |
+
| IfStatement
|
| 398 |
+
| LabeledStatement
|
| 399 |
+
| ReturnStatement
|
| 400 |
+
| SwitchStatement
|
| 401 |
+
| ThrowStatement
|
| 402 |
+
| TryStatement
|
| 403 |
+
| WhileStatement
|
| 404 |
+
| WithStatement
|
| 405 |
+
| Declaration
|
| 406 |
+
| ModuleDeclaration;
|
| 407 |
+
|
| 408 |
+
export interface Directive extends Span {
|
| 409 |
+
type: "ExpressionStatement";
|
| 410 |
+
expression: StringLiteral;
|
| 411 |
+
directive: string;
|
| 412 |
+
parent?: Node;
|
| 413 |
+
}
|
| 414 |
+
|
| 415 |
+
export interface Hashbang extends Span {
|
| 416 |
+
type: "Hashbang";
|
| 417 |
+
value: string;
|
| 418 |
+
parent?: Node;
|
| 419 |
+
}
|
| 420 |
+
|
| 421 |
+
export interface BlockStatement extends Span {
|
| 422 |
+
type: "BlockStatement";
|
| 423 |
+
body: Array<Statement>;
|
| 424 |
+
parent?: Node;
|
| 425 |
+
}
|
| 426 |
+
|
| 427 |
+
export type Declaration =
|
| 428 |
+
| VariableDeclaration
|
| 429 |
+
| Function
|
| 430 |
+
| Class
|
| 431 |
+
| TSTypeAliasDeclaration
|
| 432 |
+
| TSInterfaceDeclaration
|
| 433 |
+
| TSEnumDeclaration
|
| 434 |
+
| TSModuleDeclaration
|
| 435 |
+
| TSGlobalDeclaration
|
| 436 |
+
| TSImportEqualsDeclaration;
|
| 437 |
+
|
| 438 |
+
export interface VariableDeclaration extends Span {
|
| 439 |
+
type: "VariableDeclaration";
|
| 440 |
+
kind: VariableDeclarationKind;
|
| 441 |
+
declarations: Array<VariableDeclarator>;
|
| 442 |
+
declare?: boolean;
|
| 443 |
+
parent?: Node;
|
| 444 |
+
}
|
| 445 |
+
|
| 446 |
+
export type VariableDeclarationKind = "var" | "let" | "const" | "using" | "await using";
|
| 447 |
+
|
| 448 |
+
export interface VariableDeclarator extends Span {
|
| 449 |
+
type: "VariableDeclarator";
|
| 450 |
+
id: BindingPattern;
|
| 451 |
+
init: Expression | null;
|
| 452 |
+
definite?: boolean;
|
| 453 |
+
parent?: Node;
|
| 454 |
+
}
|
| 455 |
+
|
| 456 |
+
export interface EmptyStatement extends Span {
|
| 457 |
+
type: "EmptyStatement";
|
| 458 |
+
parent?: Node;
|
| 459 |
+
}
|
| 460 |
+
|
| 461 |
+
export interface ExpressionStatement extends Span {
|
| 462 |
+
type: "ExpressionStatement";
|
| 463 |
+
expression: Expression;
|
| 464 |
+
directive?: string | null;
|
| 465 |
+
parent?: Node;
|
| 466 |
+
}
|
| 467 |
+
|
| 468 |
+
export interface IfStatement extends Span {
|
| 469 |
+
type: "IfStatement";
|
| 470 |
+
test: Expression;
|
| 471 |
+
consequent: Statement;
|
| 472 |
+
alternate: Statement | null;
|
| 473 |
+
parent?: Node;
|
| 474 |
+
}
|
| 475 |
+
|
| 476 |
+
export interface DoWhileStatement extends Span {
|
| 477 |
+
type: "DoWhileStatement";
|
| 478 |
+
body: Statement;
|
| 479 |
+
test: Expression;
|
| 480 |
+
parent?: Node;
|
| 481 |
+
}
|
| 482 |
+
|
| 483 |
+
export interface WhileStatement extends Span {
|
| 484 |
+
type: "WhileStatement";
|
| 485 |
+
test: Expression;
|
| 486 |
+
body: Statement;
|
| 487 |
+
parent?: Node;
|
| 488 |
+
}
|
| 489 |
+
|
| 490 |
+
export interface ForStatement extends Span {
|
| 491 |
+
type: "ForStatement";
|
| 492 |
+
init: ForStatementInit | null;
|
| 493 |
+
test: Expression | null;
|
| 494 |
+
update: Expression | null;
|
| 495 |
+
body: Statement;
|
| 496 |
+
parent?: Node;
|
| 497 |
+
}
|
| 498 |
+
|
| 499 |
+
export type ForStatementInit = VariableDeclaration | Expression;
|
| 500 |
+
|
| 501 |
+
export interface ForInStatement extends Span {
|
| 502 |
+
type: "ForInStatement";
|
| 503 |
+
left: ForStatementLeft;
|
| 504 |
+
right: Expression;
|
| 505 |
+
body: Statement;
|
| 506 |
+
parent?: Node;
|
| 507 |
+
}
|
| 508 |
+
|
| 509 |
+
export type ForStatementLeft = VariableDeclaration | AssignmentTarget;
|
| 510 |
+
|
| 511 |
+
export interface ForOfStatement extends Span {
|
| 512 |
+
type: "ForOfStatement";
|
| 513 |
+
await: boolean;
|
| 514 |
+
left: ForStatementLeft;
|
| 515 |
+
right: Expression;
|
| 516 |
+
body: Statement;
|
| 517 |
+
parent?: Node;
|
| 518 |
+
}
|
| 519 |
+
|
| 520 |
+
export interface ContinueStatement extends Span {
|
| 521 |
+
type: "ContinueStatement";
|
| 522 |
+
label: LabelIdentifier | null;
|
| 523 |
+
parent?: Node;
|
| 524 |
+
}
|
| 525 |
+
|
| 526 |
+
export interface BreakStatement extends Span {
|
| 527 |
+
type: "BreakStatement";
|
| 528 |
+
label: LabelIdentifier | null;
|
| 529 |
+
parent?: Node;
|
| 530 |
+
}
|
| 531 |
+
|
| 532 |
+
export interface ReturnStatement extends Span {
|
| 533 |
+
type: "ReturnStatement";
|
| 534 |
+
argument: Expression | null;
|
| 535 |
+
parent?: Node;
|
| 536 |
+
}
|
| 537 |
+
|
| 538 |
+
export interface WithStatement extends Span {
|
| 539 |
+
type: "WithStatement";
|
| 540 |
+
object: Expression;
|
| 541 |
+
body: Statement;
|
| 542 |
+
parent?: Node;
|
| 543 |
+
}
|
| 544 |
+
|
| 545 |
+
export interface SwitchStatement extends Span {
|
| 546 |
+
type: "SwitchStatement";
|
| 547 |
+
discriminant: Expression;
|
| 548 |
+
cases: Array<SwitchCase>;
|
| 549 |
+
parent?: Node;
|
| 550 |
+
}
|
| 551 |
+
|
| 552 |
+
export interface SwitchCase extends Span {
|
| 553 |
+
type: "SwitchCase";
|
| 554 |
+
test: Expression | null;
|
| 555 |
+
consequent: Array<Statement>;
|
| 556 |
+
parent?: Node;
|
| 557 |
+
}
|
| 558 |
+
|
| 559 |
+
export interface LabeledStatement extends Span {
|
| 560 |
+
type: "LabeledStatement";
|
| 561 |
+
label: LabelIdentifier;
|
| 562 |
+
body: Statement;
|
| 563 |
+
parent?: Node;
|
| 564 |
+
}
|
| 565 |
+
|
| 566 |
+
export interface ThrowStatement extends Span {
|
| 567 |
+
type: "ThrowStatement";
|
| 568 |
+
argument: Expression;
|
| 569 |
+
parent?: Node;
|
| 570 |
+
}
|
| 571 |
+
|
| 572 |
+
export interface TryStatement extends Span {
|
| 573 |
+
type: "TryStatement";
|
| 574 |
+
block: BlockStatement;
|
| 575 |
+
handler: CatchClause | null;
|
| 576 |
+
finalizer: BlockStatement | null;
|
| 577 |
+
parent?: Node;
|
| 578 |
+
}
|
| 579 |
+
|
| 580 |
+
export interface CatchClause extends Span {
|
| 581 |
+
type: "CatchClause";
|
| 582 |
+
param: BindingPattern | null;
|
| 583 |
+
body: BlockStatement;
|
| 584 |
+
parent?: Node;
|
| 585 |
+
}
|
| 586 |
+
|
| 587 |
+
export interface DebuggerStatement extends Span {
|
| 588 |
+
type: "DebuggerStatement";
|
| 589 |
+
parent?: Node;
|
| 590 |
+
}
|
| 591 |
+
|
| 592 |
+
export type BindingPattern = BindingIdentifier | ObjectPattern | ArrayPattern | AssignmentPattern;
|
| 593 |
+
|
| 594 |
+
export interface AssignmentPattern extends Span {
|
| 595 |
+
type: "AssignmentPattern";
|
| 596 |
+
decorators?: [];
|
| 597 |
+
left: BindingPattern;
|
| 598 |
+
right: Expression;
|
| 599 |
+
optional?: false;
|
| 600 |
+
typeAnnotation?: null;
|
| 601 |
+
parent?: Node;
|
| 602 |
+
}
|
| 603 |
+
|
| 604 |
+
export interface ObjectPattern extends Span {
|
| 605 |
+
type: "ObjectPattern";
|
| 606 |
+
decorators?: [];
|
| 607 |
+
properties: Array<BindingProperty | BindingRestElement>;
|
| 608 |
+
optional?: false;
|
| 609 |
+
typeAnnotation?: null;
|
| 610 |
+
parent?: Node;
|
| 611 |
+
}
|
| 612 |
+
|
| 613 |
+
export interface BindingProperty extends Span {
|
| 614 |
+
type: "Property";
|
| 615 |
+
kind: "init";
|
| 616 |
+
key: PropertyKey;
|
| 617 |
+
value: BindingPattern;
|
| 618 |
+
method: false;
|
| 619 |
+
shorthand: boolean;
|
| 620 |
+
computed: boolean;
|
| 621 |
+
optional?: false;
|
| 622 |
+
parent?: Node;
|
| 623 |
+
}
|
| 624 |
+
|
| 625 |
+
export interface ArrayPattern extends Span {
|
| 626 |
+
type: "ArrayPattern";
|
| 627 |
+
decorators?: [];
|
| 628 |
+
elements: Array<BindingPattern | BindingRestElement | null>;
|
| 629 |
+
optional?: false;
|
| 630 |
+
typeAnnotation?: null;
|
| 631 |
+
parent?: Node;
|
| 632 |
+
}
|
| 633 |
+
|
| 634 |
+
export interface BindingRestElement extends Span {
|
| 635 |
+
type: "RestElement";
|
| 636 |
+
decorators?: [];
|
| 637 |
+
argument: BindingPattern;
|
| 638 |
+
optional?: false;
|
| 639 |
+
typeAnnotation?: null;
|
| 640 |
+
value?: null;
|
| 641 |
+
parent?: Node;
|
| 642 |
+
}
|
| 643 |
+
|
| 644 |
+
export interface Function extends Span {
|
| 645 |
+
type: FunctionType;
|
| 646 |
+
id: BindingIdentifier | null;
|
| 647 |
+
generator: boolean;
|
| 648 |
+
async: boolean;
|
| 649 |
+
declare?: boolean;
|
| 650 |
+
typeParameters?: TSTypeParameterDeclaration | null;
|
| 651 |
+
params: ParamPattern[];
|
| 652 |
+
returnType?: TSTypeAnnotation | null;
|
| 653 |
+
body: FunctionBody | null;
|
| 654 |
+
expression: false;
|
| 655 |
+
parent?: Node;
|
| 656 |
+
}
|
| 657 |
+
|
| 658 |
+
export type ParamPattern = FormalParameter | TSParameterProperty | FormalParameterRest;
|
| 659 |
+
|
| 660 |
+
export type FunctionType =
|
| 661 |
+
| "FunctionDeclaration"
|
| 662 |
+
| "FunctionExpression"
|
| 663 |
+
| "TSDeclareFunction"
|
| 664 |
+
| "TSEmptyBodyFunctionExpression";
|
| 665 |
+
|
| 666 |
+
export interface FormalParameterRest extends Span {
|
| 667 |
+
type: "RestElement";
|
| 668 |
+
argument: BindingPattern;
|
| 669 |
+
decorators?: [];
|
| 670 |
+
optional?: boolean;
|
| 671 |
+
typeAnnotation?: TSTypeAnnotation | null;
|
| 672 |
+
value?: null;
|
| 673 |
+
parent?: Node;
|
| 674 |
+
}
|
| 675 |
+
|
| 676 |
+
export type FormalParameter = {
|
| 677 |
+
decorators?: Array<Decorator>;
|
| 678 |
+
} & BindingPattern;
|
| 679 |
+
|
| 680 |
+
export interface TSParameterProperty extends Span {
|
| 681 |
+
type: "TSParameterProperty";
|
| 682 |
+
accessibility: TSAccessibility | null;
|
| 683 |
+
decorators: Array<Decorator>;
|
| 684 |
+
override: boolean;
|
| 685 |
+
parameter: FormalParameter;
|
| 686 |
+
readonly: boolean;
|
| 687 |
+
static: boolean;
|
| 688 |
+
parent?: Node;
|
| 689 |
+
}
|
| 690 |
+
|
| 691 |
+
export interface FunctionBody extends Span {
|
| 692 |
+
type: "BlockStatement";
|
| 693 |
+
body: Array<Directive | Statement>;
|
| 694 |
+
parent?: Node;
|
| 695 |
+
}
|
| 696 |
+
|
| 697 |
+
export interface ArrowFunctionExpression extends Span {
|
| 698 |
+
type: "ArrowFunctionExpression";
|
| 699 |
+
expression: boolean;
|
| 700 |
+
async: boolean;
|
| 701 |
+
typeParameters?: TSTypeParameterDeclaration | null;
|
| 702 |
+
params: ParamPattern[];
|
| 703 |
+
returnType?: TSTypeAnnotation | null;
|
| 704 |
+
body: FunctionBody | Expression;
|
| 705 |
+
id: null;
|
| 706 |
+
generator: false;
|
| 707 |
+
parent?: Node;
|
| 708 |
+
}
|
| 709 |
+
|
| 710 |
+
export interface YieldExpression extends Span {
|
| 711 |
+
type: "YieldExpression";
|
| 712 |
+
delegate: boolean;
|
| 713 |
+
argument: Expression | null;
|
| 714 |
+
parent?: Node;
|
| 715 |
+
}
|
| 716 |
+
|
| 717 |
+
export interface Class extends Span {
|
| 718 |
+
type: ClassType;
|
| 719 |
+
decorators: Array<Decorator>;
|
| 720 |
+
id: BindingIdentifier | null;
|
| 721 |
+
typeParameters?: TSTypeParameterDeclaration | null;
|
| 722 |
+
superClass: Expression | null;
|
| 723 |
+
superTypeArguments?: TSTypeParameterInstantiation | null;
|
| 724 |
+
implements?: Array<TSClassImplements>;
|
| 725 |
+
body: ClassBody;
|
| 726 |
+
abstract?: boolean;
|
| 727 |
+
declare?: boolean;
|
| 728 |
+
parent?: Node;
|
| 729 |
+
}
|
| 730 |
+
|
| 731 |
+
export type ClassType = "ClassDeclaration" | "ClassExpression";
|
| 732 |
+
|
| 733 |
+
export interface ClassBody extends Span {
|
| 734 |
+
type: "ClassBody";
|
| 735 |
+
body: Array<ClassElement>;
|
| 736 |
+
parent?: Node;
|
| 737 |
+
}
|
| 738 |
+
|
| 739 |
+
export type ClassElement =
|
| 740 |
+
| StaticBlock
|
| 741 |
+
| MethodDefinition
|
| 742 |
+
| PropertyDefinition
|
| 743 |
+
| AccessorProperty
|
| 744 |
+
| TSIndexSignature;
|
| 745 |
+
|
| 746 |
+
export interface MethodDefinition extends Span {
|
| 747 |
+
type: MethodDefinitionType;
|
| 748 |
+
decorators: Array<Decorator>;
|
| 749 |
+
key: PropertyKey;
|
| 750 |
+
value: Function;
|
| 751 |
+
kind: MethodDefinitionKind;
|
| 752 |
+
computed: boolean;
|
| 753 |
+
static: boolean;
|
| 754 |
+
override?: boolean;
|
| 755 |
+
optional?: boolean;
|
| 756 |
+
accessibility?: TSAccessibility | null;
|
| 757 |
+
parent?: Node;
|
| 758 |
+
}
|
| 759 |
+
|
| 760 |
+
export type MethodDefinitionType = "MethodDefinition" | "TSAbstractMethodDefinition";
|
| 761 |
+
|
| 762 |
+
export interface PropertyDefinition extends Span {
|
| 763 |
+
type: PropertyDefinitionType;
|
| 764 |
+
decorators: Array<Decorator>;
|
| 765 |
+
key: PropertyKey;
|
| 766 |
+
typeAnnotation?: TSTypeAnnotation | null;
|
| 767 |
+
value: Expression | null;
|
| 768 |
+
computed: boolean;
|
| 769 |
+
static: boolean;
|
| 770 |
+
declare?: boolean;
|
| 771 |
+
override?: boolean;
|
| 772 |
+
optional?: boolean;
|
| 773 |
+
definite?: boolean;
|
| 774 |
+
readonly?: boolean;
|
| 775 |
+
accessibility?: TSAccessibility | null;
|
| 776 |
+
parent?: Node;
|
| 777 |
+
}
|
| 778 |
+
|
| 779 |
+
export type PropertyDefinitionType = "PropertyDefinition" | "TSAbstractPropertyDefinition";
|
| 780 |
+
|
| 781 |
+
export type MethodDefinitionKind = "constructor" | "method" | "get" | "set";
|
| 782 |
+
|
| 783 |
+
export interface PrivateIdentifier extends Span {
|
| 784 |
+
type: "PrivateIdentifier";
|
| 785 |
+
name: string;
|
| 786 |
+
parent?: Node;
|
| 787 |
+
}
|
| 788 |
+
|
| 789 |
+
export interface StaticBlock extends Span {
|
| 790 |
+
type: "StaticBlock";
|
| 791 |
+
body: Array<Statement>;
|
| 792 |
+
parent?: Node;
|
| 793 |
+
}
|
| 794 |
+
|
| 795 |
+
export type ModuleDeclaration =
|
| 796 |
+
| ImportDeclaration
|
| 797 |
+
| ExportAllDeclaration
|
| 798 |
+
| ExportDefaultDeclaration
|
| 799 |
+
| ExportNamedDeclaration
|
| 800 |
+
| TSExportAssignment
|
| 801 |
+
| TSNamespaceExportDeclaration;
|
| 802 |
+
|
| 803 |
+
export type AccessorPropertyType = "AccessorProperty" | "TSAbstractAccessorProperty";
|
| 804 |
+
|
| 805 |
+
export interface AccessorProperty extends Span {
|
| 806 |
+
type: AccessorPropertyType;
|
| 807 |
+
decorators: Array<Decorator>;
|
| 808 |
+
key: PropertyKey;
|
| 809 |
+
typeAnnotation?: TSTypeAnnotation | null;
|
| 810 |
+
value: Expression | null;
|
| 811 |
+
computed: boolean;
|
| 812 |
+
static: boolean;
|
| 813 |
+
override?: boolean;
|
| 814 |
+
definite?: boolean;
|
| 815 |
+
accessibility?: TSAccessibility | null;
|
| 816 |
+
declare?: false;
|
| 817 |
+
optional?: false;
|
| 818 |
+
readonly?: false;
|
| 819 |
+
parent?: Node;
|
| 820 |
+
}
|
| 821 |
+
|
| 822 |
+
export interface ImportExpression extends Span {
|
| 823 |
+
type: "ImportExpression";
|
| 824 |
+
source: Expression;
|
| 825 |
+
options: Expression | null;
|
| 826 |
+
phase: ImportPhase | null;
|
| 827 |
+
parent?: Node;
|
| 828 |
+
}
|
| 829 |
+
|
| 830 |
+
export interface ImportDeclaration extends Span {
|
| 831 |
+
type: "ImportDeclaration";
|
| 832 |
+
specifiers: Array<ImportDeclarationSpecifier>;
|
| 833 |
+
source: StringLiteral;
|
| 834 |
+
phase: ImportPhase | null;
|
| 835 |
+
attributes: Array<ImportAttribute>;
|
| 836 |
+
importKind?: ImportOrExportKind;
|
| 837 |
+
parent?: Node;
|
| 838 |
+
}
|
| 839 |
+
|
| 840 |
+
export type ImportPhase = "source" | "defer";
|
| 841 |
+
|
| 842 |
+
export type ImportDeclarationSpecifier =
|
| 843 |
+
| ImportSpecifier
|
| 844 |
+
| ImportDefaultSpecifier
|
| 845 |
+
| ImportNamespaceSpecifier;
|
| 846 |
+
|
| 847 |
+
export interface ImportSpecifier extends Span {
|
| 848 |
+
type: "ImportSpecifier";
|
| 849 |
+
imported: ModuleExportName;
|
| 850 |
+
local: BindingIdentifier;
|
| 851 |
+
importKind?: ImportOrExportKind;
|
| 852 |
+
parent?: Node;
|
| 853 |
+
}
|
| 854 |
+
|
| 855 |
+
export interface ImportDefaultSpecifier extends Span {
|
| 856 |
+
type: "ImportDefaultSpecifier";
|
| 857 |
+
local: BindingIdentifier;
|
| 858 |
+
parent?: Node;
|
| 859 |
+
}
|
| 860 |
+
|
| 861 |
+
export interface ImportNamespaceSpecifier extends Span {
|
| 862 |
+
type: "ImportNamespaceSpecifier";
|
| 863 |
+
local: BindingIdentifier;
|
| 864 |
+
parent?: Node;
|
| 865 |
+
}
|
| 866 |
+
|
| 867 |
+
export interface ImportAttribute extends Span {
|
| 868 |
+
type: "ImportAttribute";
|
| 869 |
+
key: ImportAttributeKey;
|
| 870 |
+
value: StringLiteral;
|
| 871 |
+
parent?: Node;
|
| 872 |
+
}
|
| 873 |
+
|
| 874 |
+
export type ImportAttributeKey = IdentifierName | StringLiteral;
|
| 875 |
+
|
| 876 |
+
export interface ExportNamedDeclaration extends Span {
|
| 877 |
+
type: "ExportNamedDeclaration";
|
| 878 |
+
declaration: Declaration | null;
|
| 879 |
+
specifiers: Array<ExportSpecifier>;
|
| 880 |
+
source: StringLiteral | null;
|
| 881 |
+
exportKind?: ImportOrExportKind;
|
| 882 |
+
attributes: Array<ImportAttribute>;
|
| 883 |
+
parent?: Node;
|
| 884 |
+
}
|
| 885 |
+
|
| 886 |
+
export interface ExportDefaultDeclaration extends Span {
|
| 887 |
+
type: "ExportDefaultDeclaration";
|
| 888 |
+
declaration: ExportDefaultDeclarationKind;
|
| 889 |
+
exportKind?: "value";
|
| 890 |
+
parent?: Node;
|
| 891 |
+
}
|
| 892 |
+
|
| 893 |
+
export interface ExportAllDeclaration extends Span {
|
| 894 |
+
type: "ExportAllDeclaration";
|
| 895 |
+
exported: ModuleExportName | null;
|
| 896 |
+
source: StringLiteral;
|
| 897 |
+
attributes: Array<ImportAttribute>;
|
| 898 |
+
exportKind?: ImportOrExportKind;
|
| 899 |
+
parent?: Node;
|
| 900 |
+
}
|
| 901 |
+
|
| 902 |
+
export interface ExportSpecifier extends Span {
|
| 903 |
+
type: "ExportSpecifier";
|
| 904 |
+
local: ModuleExportName;
|
| 905 |
+
exported: ModuleExportName;
|
| 906 |
+
exportKind?: ImportOrExportKind;
|
| 907 |
+
parent?: Node;
|
| 908 |
+
}
|
| 909 |
+
|
| 910 |
+
export type ExportDefaultDeclarationKind = Function | Class | TSInterfaceDeclaration | Expression;
|
| 911 |
+
|
| 912 |
+
export type ModuleExportName = IdentifierName | IdentifierReference | StringLiteral;
|
| 913 |
+
|
| 914 |
+
export interface V8IntrinsicExpression extends Span {
|
| 915 |
+
type: "V8IntrinsicExpression";
|
| 916 |
+
name: IdentifierName;
|
| 917 |
+
arguments: Array<Argument>;
|
| 918 |
+
parent?: Node;
|
| 919 |
+
}
|
| 920 |
+
|
| 921 |
+
export interface BooleanLiteral extends Span {
|
| 922 |
+
type: "Literal";
|
| 923 |
+
value: boolean;
|
| 924 |
+
raw: string | null;
|
| 925 |
+
parent?: Node;
|
| 926 |
+
}
|
| 927 |
+
|
| 928 |
+
export interface NullLiteral extends Span {
|
| 929 |
+
type: "Literal";
|
| 930 |
+
value: null;
|
| 931 |
+
raw: "null" | null;
|
| 932 |
+
parent?: Node;
|
| 933 |
+
}
|
| 934 |
+
|
| 935 |
+
export interface NumericLiteral extends Span {
|
| 936 |
+
type: "Literal";
|
| 937 |
+
value: number;
|
| 938 |
+
raw: string | null;
|
| 939 |
+
parent?: Node;
|
| 940 |
+
}
|
| 941 |
+
|
| 942 |
+
export interface StringLiteral extends Span {
|
| 943 |
+
type: "Literal";
|
| 944 |
+
value: string;
|
| 945 |
+
raw: string | null;
|
| 946 |
+
parent?: Node;
|
| 947 |
+
}
|
| 948 |
+
|
| 949 |
+
export interface BigIntLiteral extends Span {
|
| 950 |
+
type: "Literal";
|
| 951 |
+
value: bigint;
|
| 952 |
+
raw: string | null;
|
| 953 |
+
bigint: string;
|
| 954 |
+
parent?: Node;
|
| 955 |
+
}
|
| 956 |
+
|
| 957 |
+
export interface RegExpLiteral extends Span {
|
| 958 |
+
type: "Literal";
|
| 959 |
+
value: RegExp | null;
|
| 960 |
+
raw: string | null;
|
| 961 |
+
regex: { pattern: string; flags: string };
|
| 962 |
+
parent?: Node;
|
| 963 |
+
}
|
| 964 |
+
|
| 965 |
+
export interface JSXElement extends Span {
|
| 966 |
+
type: "JSXElement";
|
| 967 |
+
openingElement: JSXOpeningElement;
|
| 968 |
+
children: Array<JSXChild>;
|
| 969 |
+
closingElement: JSXClosingElement | null;
|
| 970 |
+
parent?: Node;
|
| 971 |
+
}
|
| 972 |
+
|
| 973 |
+
export interface JSXOpeningElement extends Span {
|
| 974 |
+
type: "JSXOpeningElement";
|
| 975 |
+
name: JSXElementName;
|
| 976 |
+
typeArguments?: TSTypeParameterInstantiation | null;
|
| 977 |
+
attributes: Array<JSXAttributeItem>;
|
| 978 |
+
selfClosing: boolean;
|
| 979 |
+
parent?: Node;
|
| 980 |
+
}
|
| 981 |
+
|
| 982 |
+
export interface JSXClosingElement extends Span {
|
| 983 |
+
type: "JSXClosingElement";
|
| 984 |
+
name: JSXElementName;
|
| 985 |
+
parent?: Node;
|
| 986 |
+
}
|
| 987 |
+
|
| 988 |
+
export interface JSXFragment extends Span {
|
| 989 |
+
type: "JSXFragment";
|
| 990 |
+
openingFragment: JSXOpeningFragment;
|
| 991 |
+
children: Array<JSXChild>;
|
| 992 |
+
closingFragment: JSXClosingFragment;
|
| 993 |
+
parent?: Node;
|
| 994 |
+
}
|
| 995 |
+
|
| 996 |
+
export interface JSXOpeningFragment extends Span {
|
| 997 |
+
type: "JSXOpeningFragment";
|
| 998 |
+
attributes?: [];
|
| 999 |
+
selfClosing?: false;
|
| 1000 |
+
parent?: Node;
|
| 1001 |
+
}
|
| 1002 |
+
|
| 1003 |
+
export interface JSXClosingFragment extends Span {
|
| 1004 |
+
type: "JSXClosingFragment";
|
| 1005 |
+
parent?: Node;
|
| 1006 |
+
}
|
| 1007 |
+
|
| 1008 |
+
export type JSXElementName = JSXIdentifier | JSXNamespacedName | JSXMemberExpression;
|
| 1009 |
+
|
| 1010 |
+
export interface JSXNamespacedName extends Span {
|
| 1011 |
+
type: "JSXNamespacedName";
|
| 1012 |
+
namespace: JSXIdentifier;
|
| 1013 |
+
name: JSXIdentifier;
|
| 1014 |
+
parent?: Node;
|
| 1015 |
+
}
|
| 1016 |
+
|
| 1017 |
+
export interface JSXMemberExpression extends Span {
|
| 1018 |
+
type: "JSXMemberExpression";
|
| 1019 |
+
object: JSXMemberExpressionObject;
|
| 1020 |
+
property: JSXIdentifier;
|
| 1021 |
+
parent?: Node;
|
| 1022 |
+
}
|
| 1023 |
+
|
| 1024 |
+
export type JSXMemberExpressionObject = JSXIdentifier | JSXMemberExpression;
|
| 1025 |
+
|
| 1026 |
+
export interface JSXExpressionContainer extends Span {
|
| 1027 |
+
type: "JSXExpressionContainer";
|
| 1028 |
+
expression: JSXExpression;
|
| 1029 |
+
parent?: Node;
|
| 1030 |
+
}
|
| 1031 |
+
|
| 1032 |
+
export type JSXExpression = JSXEmptyExpression | Expression;
|
| 1033 |
+
|
| 1034 |
+
export interface JSXEmptyExpression extends Span {
|
| 1035 |
+
type: "JSXEmptyExpression";
|
| 1036 |
+
parent?: Node;
|
| 1037 |
+
}
|
| 1038 |
+
|
| 1039 |
+
export type JSXAttributeItem = JSXAttribute | JSXSpreadAttribute;
|
| 1040 |
+
|
| 1041 |
+
export interface JSXAttribute extends Span {
|
| 1042 |
+
type: "JSXAttribute";
|
| 1043 |
+
name: JSXAttributeName;
|
| 1044 |
+
value: JSXAttributeValue | null;
|
| 1045 |
+
parent?: Node;
|
| 1046 |
+
}
|
| 1047 |
+
|
| 1048 |
+
export interface JSXSpreadAttribute extends Span {
|
| 1049 |
+
type: "JSXSpreadAttribute";
|
| 1050 |
+
argument: Expression;
|
| 1051 |
+
parent?: Node;
|
| 1052 |
+
}
|
| 1053 |
+
|
| 1054 |
+
export type JSXAttributeName = JSXIdentifier | JSXNamespacedName;
|
| 1055 |
+
|
| 1056 |
+
export type JSXAttributeValue = StringLiteral | JSXExpressionContainer | JSXElement | JSXFragment;
|
| 1057 |
+
|
| 1058 |
+
export interface JSXIdentifier extends Span {
|
| 1059 |
+
type: "JSXIdentifier";
|
| 1060 |
+
name: string;
|
| 1061 |
+
parent?: Node;
|
| 1062 |
+
}
|
| 1063 |
+
|
| 1064 |
+
export type JSXChild = JSXText | JSXElement | JSXFragment | JSXExpressionContainer | JSXSpreadChild;
|
| 1065 |
+
|
| 1066 |
+
export interface JSXSpreadChild extends Span {
|
| 1067 |
+
type: "JSXSpreadChild";
|
| 1068 |
+
expression: Expression;
|
| 1069 |
+
parent?: Node;
|
| 1070 |
+
}
|
| 1071 |
+
|
| 1072 |
+
export interface JSXText extends Span {
|
| 1073 |
+
type: "JSXText";
|
| 1074 |
+
value: string;
|
| 1075 |
+
raw: string | null;
|
| 1076 |
+
parent?: Node;
|
| 1077 |
+
}
|
| 1078 |
+
|
| 1079 |
+
export interface TSThisParameter extends Span {
|
| 1080 |
+
type: "Identifier";
|
| 1081 |
+
decorators: [];
|
| 1082 |
+
name: "this";
|
| 1083 |
+
optional: false;
|
| 1084 |
+
typeAnnotation: TSTypeAnnotation | null;
|
| 1085 |
+
parent?: Node;
|
| 1086 |
+
}
|
| 1087 |
+
|
| 1088 |
+
export interface TSEnumDeclaration extends Span {
|
| 1089 |
+
type: "TSEnumDeclaration";
|
| 1090 |
+
id: BindingIdentifier;
|
| 1091 |
+
body: TSEnumBody;
|
| 1092 |
+
const: boolean;
|
| 1093 |
+
declare: boolean;
|
| 1094 |
+
parent?: Node;
|
| 1095 |
+
}
|
| 1096 |
+
|
| 1097 |
+
export interface TSEnumBody extends Span {
|
| 1098 |
+
type: "TSEnumBody";
|
| 1099 |
+
members: Array<TSEnumMember>;
|
| 1100 |
+
parent?: Node;
|
| 1101 |
+
}
|
| 1102 |
+
|
| 1103 |
+
export interface TSEnumMember extends Span {
|
| 1104 |
+
type: "TSEnumMember";
|
| 1105 |
+
id: TSEnumMemberName;
|
| 1106 |
+
initializer: Expression | null;
|
| 1107 |
+
computed: boolean;
|
| 1108 |
+
parent?: Node;
|
| 1109 |
+
}
|
| 1110 |
+
|
| 1111 |
+
export type TSEnumMemberName = IdentifierName | StringLiteral | TemplateLiteral;
|
| 1112 |
+
|
| 1113 |
+
export interface TSTypeAnnotation extends Span {
|
| 1114 |
+
type: "TSTypeAnnotation";
|
| 1115 |
+
typeAnnotation: TSType;
|
| 1116 |
+
parent?: Node;
|
| 1117 |
+
}
|
| 1118 |
+
|
| 1119 |
+
export interface TSLiteralType extends Span {
|
| 1120 |
+
type: "TSLiteralType";
|
| 1121 |
+
literal: TSLiteral;
|
| 1122 |
+
parent?: Node;
|
| 1123 |
+
}
|
| 1124 |
+
|
| 1125 |
+
export type TSLiteral =
|
| 1126 |
+
| BooleanLiteral
|
| 1127 |
+
| NumericLiteral
|
| 1128 |
+
| BigIntLiteral
|
| 1129 |
+
| StringLiteral
|
| 1130 |
+
| TemplateLiteral
|
| 1131 |
+
| UnaryExpression;
|
| 1132 |
+
|
| 1133 |
+
export type TSType =
|
| 1134 |
+
| TSAnyKeyword
|
| 1135 |
+
| TSBigIntKeyword
|
| 1136 |
+
| TSBooleanKeyword
|
| 1137 |
+
| TSIntrinsicKeyword
|
| 1138 |
+
| TSNeverKeyword
|
| 1139 |
+
| TSNullKeyword
|
| 1140 |
+
| TSNumberKeyword
|
| 1141 |
+
| TSObjectKeyword
|
| 1142 |
+
| TSStringKeyword
|
| 1143 |
+
| TSSymbolKeyword
|
| 1144 |
+
| TSUndefinedKeyword
|
| 1145 |
+
| TSUnknownKeyword
|
| 1146 |
+
| TSVoidKeyword
|
| 1147 |
+
| TSArrayType
|
| 1148 |
+
| TSConditionalType
|
| 1149 |
+
| TSConstructorType
|
| 1150 |
+
| TSFunctionType
|
| 1151 |
+
| TSImportType
|
| 1152 |
+
| TSIndexedAccessType
|
| 1153 |
+
| TSInferType
|
| 1154 |
+
| TSIntersectionType
|
| 1155 |
+
| TSLiteralType
|
| 1156 |
+
| TSMappedType
|
| 1157 |
+
| TSNamedTupleMember
|
| 1158 |
+
| TSTemplateLiteralType
|
| 1159 |
+
| TSThisType
|
| 1160 |
+
| TSTupleType
|
| 1161 |
+
| TSTypeLiteral
|
| 1162 |
+
| TSTypeOperator
|
| 1163 |
+
| TSTypePredicate
|
| 1164 |
+
| TSTypeQuery
|
| 1165 |
+
| TSTypeReference
|
| 1166 |
+
| TSUnionType
|
| 1167 |
+
| TSParenthesizedType
|
| 1168 |
+
| JSDocNullableType
|
| 1169 |
+
| JSDocNonNullableType
|
| 1170 |
+
| JSDocUnknownType;
|
| 1171 |
+
|
| 1172 |
+
export interface TSConditionalType extends Span {
|
| 1173 |
+
type: "TSConditionalType";
|
| 1174 |
+
checkType: TSType;
|
| 1175 |
+
extendsType: TSType;
|
| 1176 |
+
trueType: TSType;
|
| 1177 |
+
falseType: TSType;
|
| 1178 |
+
parent?: Node;
|
| 1179 |
+
}
|
| 1180 |
+
|
| 1181 |
+
export interface TSUnionType extends Span {
|
| 1182 |
+
type: "TSUnionType";
|
| 1183 |
+
types: Array<TSType>;
|
| 1184 |
+
parent?: Node;
|
| 1185 |
+
}
|
| 1186 |
+
|
| 1187 |
+
export interface TSIntersectionType extends Span {
|
| 1188 |
+
type: "TSIntersectionType";
|
| 1189 |
+
types: Array<TSType>;
|
| 1190 |
+
parent?: Node;
|
| 1191 |
+
}
|
| 1192 |
+
|
| 1193 |
+
export interface TSParenthesizedType extends Span {
|
| 1194 |
+
type: "TSParenthesizedType";
|
| 1195 |
+
typeAnnotation: TSType;
|
| 1196 |
+
parent?: Node;
|
| 1197 |
+
}
|
| 1198 |
+
|
| 1199 |
+
export interface TSTypeOperator extends Span {
|
| 1200 |
+
type: "TSTypeOperator";
|
| 1201 |
+
operator: TSTypeOperatorOperator;
|
| 1202 |
+
typeAnnotation: TSType;
|
| 1203 |
+
parent?: Node;
|
| 1204 |
+
}
|
| 1205 |
+
|
| 1206 |
+
export type TSTypeOperatorOperator = "keyof" | "unique" | "readonly";
|
| 1207 |
+
|
| 1208 |
+
export interface TSArrayType extends Span {
|
| 1209 |
+
type: "TSArrayType";
|
| 1210 |
+
elementType: TSType;
|
| 1211 |
+
parent?: Node;
|
| 1212 |
+
}
|
| 1213 |
+
|
| 1214 |
+
export interface TSIndexedAccessType extends Span {
|
| 1215 |
+
type: "TSIndexedAccessType";
|
| 1216 |
+
objectType: TSType;
|
| 1217 |
+
indexType: TSType;
|
| 1218 |
+
parent?: Node;
|
| 1219 |
+
}
|
| 1220 |
+
|
| 1221 |
+
export interface TSTupleType extends Span {
|
| 1222 |
+
type: "TSTupleType";
|
| 1223 |
+
elementTypes: Array<TSTupleElement>;
|
| 1224 |
+
parent?: Node;
|
| 1225 |
+
}
|
| 1226 |
+
|
| 1227 |
+
export interface TSNamedTupleMember extends Span {
|
| 1228 |
+
type: "TSNamedTupleMember";
|
| 1229 |
+
label: IdentifierName;
|
| 1230 |
+
elementType: TSTupleElement;
|
| 1231 |
+
optional: boolean;
|
| 1232 |
+
parent?: Node;
|
| 1233 |
+
}
|
| 1234 |
+
|
| 1235 |
+
export interface TSOptionalType extends Span {
|
| 1236 |
+
type: "TSOptionalType";
|
| 1237 |
+
typeAnnotation: TSType;
|
| 1238 |
+
parent?: Node;
|
| 1239 |
+
}
|
| 1240 |
+
|
| 1241 |
+
export interface TSRestType extends Span {
|
| 1242 |
+
type: "TSRestType";
|
| 1243 |
+
typeAnnotation: TSType;
|
| 1244 |
+
parent?: Node;
|
| 1245 |
+
}
|
| 1246 |
+
|
| 1247 |
+
export type TSTupleElement = TSOptionalType | TSRestType | TSType;
|
| 1248 |
+
|
| 1249 |
+
export interface TSAnyKeyword extends Span {
|
| 1250 |
+
type: "TSAnyKeyword";
|
| 1251 |
+
parent?: Node;
|
| 1252 |
+
}
|
| 1253 |
+
|
| 1254 |
+
export interface TSStringKeyword extends Span {
|
| 1255 |
+
type: "TSStringKeyword";
|
| 1256 |
+
parent?: Node;
|
| 1257 |
+
}
|
| 1258 |
+
|
| 1259 |
+
export interface TSBooleanKeyword extends Span {
|
| 1260 |
+
type: "TSBooleanKeyword";
|
| 1261 |
+
parent?: Node;
|
| 1262 |
+
}
|
| 1263 |
+
|
| 1264 |
+
export interface TSNumberKeyword extends Span {
|
| 1265 |
+
type: "TSNumberKeyword";
|
| 1266 |
+
parent?: Node;
|
| 1267 |
+
}
|
| 1268 |
+
|
| 1269 |
+
export interface TSNeverKeyword extends Span {
|
| 1270 |
+
type: "TSNeverKeyword";
|
| 1271 |
+
parent?: Node;
|
| 1272 |
+
}
|
| 1273 |
+
|
| 1274 |
+
export interface TSIntrinsicKeyword extends Span {
|
| 1275 |
+
type: "TSIntrinsicKeyword";
|
| 1276 |
+
parent?: Node;
|
| 1277 |
+
}
|
| 1278 |
+
|
| 1279 |
+
export interface TSUnknownKeyword extends Span {
|
| 1280 |
+
type: "TSUnknownKeyword";
|
| 1281 |
+
parent?: Node;
|
| 1282 |
+
}
|
| 1283 |
+
|
| 1284 |
+
export interface TSNullKeyword extends Span {
|
| 1285 |
+
type: "TSNullKeyword";
|
| 1286 |
+
parent?: Node;
|
| 1287 |
+
}
|
| 1288 |
+
|
| 1289 |
+
export interface TSUndefinedKeyword extends Span {
|
| 1290 |
+
type: "TSUndefinedKeyword";
|
| 1291 |
+
parent?: Node;
|
| 1292 |
+
}
|
| 1293 |
+
|
| 1294 |
+
export interface TSVoidKeyword extends Span {
|
| 1295 |
+
type: "TSVoidKeyword";
|
| 1296 |
+
parent?: Node;
|
| 1297 |
+
}
|
| 1298 |
+
|
| 1299 |
+
export interface TSSymbolKeyword extends Span {
|
| 1300 |
+
type: "TSSymbolKeyword";
|
| 1301 |
+
parent?: Node;
|
| 1302 |
+
}
|
| 1303 |
+
|
| 1304 |
+
export interface TSThisType extends Span {
|
| 1305 |
+
type: "TSThisType";
|
| 1306 |
+
parent?: Node;
|
| 1307 |
+
}
|
| 1308 |
+
|
| 1309 |
+
export interface TSObjectKeyword extends Span {
|
| 1310 |
+
type: "TSObjectKeyword";
|
| 1311 |
+
parent?: Node;
|
| 1312 |
+
}
|
| 1313 |
+
|
| 1314 |
+
export interface TSBigIntKeyword extends Span {
|
| 1315 |
+
type: "TSBigIntKeyword";
|
| 1316 |
+
parent?: Node;
|
| 1317 |
+
}
|
| 1318 |
+
|
| 1319 |
+
export interface TSTypeReference extends Span {
|
| 1320 |
+
type: "TSTypeReference";
|
| 1321 |
+
typeName: TSTypeName;
|
| 1322 |
+
typeArguments: TSTypeParameterInstantiation | null;
|
| 1323 |
+
parent?: Node;
|
| 1324 |
+
}
|
| 1325 |
+
|
| 1326 |
+
export type TSTypeName = IdentifierReference | TSQualifiedName | ThisExpression;
|
| 1327 |
+
|
| 1328 |
+
export interface TSQualifiedName extends Span {
|
| 1329 |
+
type: "TSQualifiedName";
|
| 1330 |
+
left: TSTypeName;
|
| 1331 |
+
right: IdentifierName;
|
| 1332 |
+
parent?: Node;
|
| 1333 |
+
}
|
| 1334 |
+
|
| 1335 |
+
export interface TSTypeParameterInstantiation extends Span {
|
| 1336 |
+
type: "TSTypeParameterInstantiation";
|
| 1337 |
+
params: Array<TSType>;
|
| 1338 |
+
parent?: Node;
|
| 1339 |
+
}
|
| 1340 |
+
|
| 1341 |
+
export interface TSTypeParameter extends Span {
|
| 1342 |
+
type: "TSTypeParameter";
|
| 1343 |
+
name: BindingIdentifier;
|
| 1344 |
+
constraint: TSType | null;
|
| 1345 |
+
default: TSType | null;
|
| 1346 |
+
in: boolean;
|
| 1347 |
+
out: boolean;
|
| 1348 |
+
const: boolean;
|
| 1349 |
+
parent?: Node;
|
| 1350 |
+
}
|
| 1351 |
+
|
| 1352 |
+
export interface TSTypeParameterDeclaration extends Span {
|
| 1353 |
+
type: "TSTypeParameterDeclaration";
|
| 1354 |
+
params: Array<TSTypeParameter>;
|
| 1355 |
+
parent?: Node;
|
| 1356 |
+
}
|
| 1357 |
+
|
| 1358 |
+
export interface TSTypeAliasDeclaration extends Span {
|
| 1359 |
+
type: "TSTypeAliasDeclaration";
|
| 1360 |
+
id: BindingIdentifier;
|
| 1361 |
+
typeParameters: TSTypeParameterDeclaration | null;
|
| 1362 |
+
typeAnnotation: TSType;
|
| 1363 |
+
declare: boolean;
|
| 1364 |
+
parent?: Node;
|
| 1365 |
+
}
|
| 1366 |
+
|
| 1367 |
+
export type TSAccessibility = "private" | "protected" | "public";
|
| 1368 |
+
|
| 1369 |
+
export interface TSClassImplements extends Span {
|
| 1370 |
+
type: "TSClassImplements";
|
| 1371 |
+
expression: IdentifierReference | ThisExpression | MemberExpression;
|
| 1372 |
+
typeArguments: TSTypeParameterInstantiation | null;
|
| 1373 |
+
parent?: Node;
|
| 1374 |
+
}
|
| 1375 |
+
|
| 1376 |
+
export interface TSInterfaceDeclaration extends Span {
|
| 1377 |
+
type: "TSInterfaceDeclaration";
|
| 1378 |
+
id: BindingIdentifier;
|
| 1379 |
+
typeParameters: TSTypeParameterDeclaration | null;
|
| 1380 |
+
extends: Array<TSInterfaceHeritage>;
|
| 1381 |
+
body: TSInterfaceBody;
|
| 1382 |
+
declare: boolean;
|
| 1383 |
+
parent?: Node;
|
| 1384 |
+
}
|
| 1385 |
+
|
| 1386 |
+
export interface TSInterfaceBody extends Span {
|
| 1387 |
+
type: "TSInterfaceBody";
|
| 1388 |
+
body: Array<TSSignature>;
|
| 1389 |
+
parent?: Node;
|
| 1390 |
+
}
|
| 1391 |
+
|
| 1392 |
+
export interface TSPropertySignature extends Span {
|
| 1393 |
+
type: "TSPropertySignature";
|
| 1394 |
+
computed: boolean;
|
| 1395 |
+
optional: boolean;
|
| 1396 |
+
readonly: boolean;
|
| 1397 |
+
key: PropertyKey;
|
| 1398 |
+
typeAnnotation: TSTypeAnnotation | null;
|
| 1399 |
+
accessibility: null;
|
| 1400 |
+
static: false;
|
| 1401 |
+
parent?: Node;
|
| 1402 |
+
}
|
| 1403 |
+
|
| 1404 |
+
export type TSSignature =
|
| 1405 |
+
| TSIndexSignature
|
| 1406 |
+
| TSPropertySignature
|
| 1407 |
+
| TSCallSignatureDeclaration
|
| 1408 |
+
| TSConstructSignatureDeclaration
|
| 1409 |
+
| TSMethodSignature;
|
| 1410 |
+
|
| 1411 |
+
export interface TSIndexSignature extends Span {
|
| 1412 |
+
type: "TSIndexSignature";
|
| 1413 |
+
parameters: Array<TSIndexSignatureName>;
|
| 1414 |
+
typeAnnotation: TSTypeAnnotation;
|
| 1415 |
+
readonly: boolean;
|
| 1416 |
+
static: boolean;
|
| 1417 |
+
accessibility: null;
|
| 1418 |
+
parent?: Node;
|
| 1419 |
+
}
|
| 1420 |
+
|
| 1421 |
+
export interface TSCallSignatureDeclaration extends Span {
|
| 1422 |
+
type: "TSCallSignatureDeclaration";
|
| 1423 |
+
typeParameters: TSTypeParameterDeclaration | null;
|
| 1424 |
+
params: ParamPattern[];
|
| 1425 |
+
returnType: TSTypeAnnotation | null;
|
| 1426 |
+
parent?: Node;
|
| 1427 |
+
}
|
| 1428 |
+
|
| 1429 |
+
export type TSMethodSignatureKind = "method" | "get" | "set";
|
| 1430 |
+
|
| 1431 |
+
export interface TSMethodSignature extends Span {
|
| 1432 |
+
type: "TSMethodSignature";
|
| 1433 |
+
key: PropertyKey;
|
| 1434 |
+
computed: boolean;
|
| 1435 |
+
optional: boolean;
|
| 1436 |
+
kind: TSMethodSignatureKind;
|
| 1437 |
+
typeParameters: TSTypeParameterDeclaration | null;
|
| 1438 |
+
params: ParamPattern[];
|
| 1439 |
+
returnType: TSTypeAnnotation | null;
|
| 1440 |
+
accessibility: null;
|
| 1441 |
+
readonly: false;
|
| 1442 |
+
static: false;
|
| 1443 |
+
parent?: Node;
|
| 1444 |
+
}
|
| 1445 |
+
|
| 1446 |
+
export interface TSConstructSignatureDeclaration extends Span {
|
| 1447 |
+
type: "TSConstructSignatureDeclaration";
|
| 1448 |
+
typeParameters: TSTypeParameterDeclaration | null;
|
| 1449 |
+
params: ParamPattern[];
|
| 1450 |
+
returnType: TSTypeAnnotation | null;
|
| 1451 |
+
parent?: Node;
|
| 1452 |
+
}
|
| 1453 |
+
|
| 1454 |
+
export interface TSIndexSignatureName extends Span {
|
| 1455 |
+
type: "Identifier";
|
| 1456 |
+
decorators: [];
|
| 1457 |
+
name: string;
|
| 1458 |
+
optional: false;
|
| 1459 |
+
typeAnnotation: TSTypeAnnotation;
|
| 1460 |
+
parent?: Node;
|
| 1461 |
+
}
|
| 1462 |
+
|
| 1463 |
+
export interface TSInterfaceHeritage extends Span {
|
| 1464 |
+
type: "TSInterfaceHeritage";
|
| 1465 |
+
expression: Expression;
|
| 1466 |
+
typeArguments: TSTypeParameterInstantiation | null;
|
| 1467 |
+
parent?: Node;
|
| 1468 |
+
}
|
| 1469 |
+
|
| 1470 |
+
export interface TSTypePredicate extends Span {
|
| 1471 |
+
type: "TSTypePredicate";
|
| 1472 |
+
parameterName: TSTypePredicateName;
|
| 1473 |
+
asserts: boolean;
|
| 1474 |
+
typeAnnotation: TSTypeAnnotation | null;
|
| 1475 |
+
parent?: Node;
|
| 1476 |
+
}
|
| 1477 |
+
|
| 1478 |
+
export type TSTypePredicateName = IdentifierName | TSThisType;
|
| 1479 |
+
|
| 1480 |
+
export interface TSModuleDeclaration extends Span {
|
| 1481 |
+
type: "TSModuleDeclaration";
|
| 1482 |
+
id: BindingIdentifier | StringLiteral | TSQualifiedName;
|
| 1483 |
+
body: TSModuleBlock | null;
|
| 1484 |
+
kind: TSModuleDeclarationKind;
|
| 1485 |
+
declare: boolean;
|
| 1486 |
+
global: false;
|
| 1487 |
+
parent?: Node;
|
| 1488 |
+
}
|
| 1489 |
+
|
| 1490 |
+
export type TSModuleDeclarationKind = "module" | "namespace";
|
| 1491 |
+
|
| 1492 |
+
export interface TSGlobalDeclaration extends Span {
|
| 1493 |
+
type: "TSModuleDeclaration";
|
| 1494 |
+
id: IdentifierName;
|
| 1495 |
+
body: TSModuleBlock;
|
| 1496 |
+
kind: "global";
|
| 1497 |
+
declare: boolean;
|
| 1498 |
+
global: true;
|
| 1499 |
+
parent?: Node;
|
| 1500 |
+
}
|
| 1501 |
+
|
| 1502 |
+
export interface TSModuleBlock extends Span {
|
| 1503 |
+
type: "TSModuleBlock";
|
| 1504 |
+
body: Array<Directive | Statement>;
|
| 1505 |
+
parent?: Node;
|
| 1506 |
+
}
|
| 1507 |
+
|
| 1508 |
+
export interface TSTypeLiteral extends Span {
|
| 1509 |
+
type: "TSTypeLiteral";
|
| 1510 |
+
members: Array<TSSignature>;
|
| 1511 |
+
parent?: Node;
|
| 1512 |
+
}
|
| 1513 |
+
|
| 1514 |
+
export interface TSInferType extends Span {
|
| 1515 |
+
type: "TSInferType";
|
| 1516 |
+
typeParameter: TSTypeParameter;
|
| 1517 |
+
parent?: Node;
|
| 1518 |
+
}
|
| 1519 |
+
|
| 1520 |
+
export interface TSTypeQuery extends Span {
|
| 1521 |
+
type: "TSTypeQuery";
|
| 1522 |
+
exprName: TSTypeQueryExprName;
|
| 1523 |
+
typeArguments: TSTypeParameterInstantiation | null;
|
| 1524 |
+
parent?: Node;
|
| 1525 |
+
}
|
| 1526 |
+
|
| 1527 |
+
export type TSTypeQueryExprName = TSImportType | TSTypeName;
|
| 1528 |
+
|
| 1529 |
+
export interface TSImportType extends Span {
|
| 1530 |
+
type: "TSImportType";
|
| 1531 |
+
source: StringLiteral;
|
| 1532 |
+
options: ObjectExpression | null;
|
| 1533 |
+
qualifier: TSImportTypeQualifier | null;
|
| 1534 |
+
typeArguments: TSTypeParameterInstantiation | null;
|
| 1535 |
+
parent?: Node;
|
| 1536 |
+
}
|
| 1537 |
+
|
| 1538 |
+
export type TSImportTypeQualifier = IdentifierName | TSImportTypeQualifiedName;
|
| 1539 |
+
|
| 1540 |
+
export interface TSImportTypeQualifiedName extends Span {
|
| 1541 |
+
type: "TSQualifiedName";
|
| 1542 |
+
left: TSImportTypeQualifier;
|
| 1543 |
+
right: IdentifierName;
|
| 1544 |
+
parent?: Node;
|
| 1545 |
+
}
|
| 1546 |
+
|
| 1547 |
+
export interface TSFunctionType extends Span {
|
| 1548 |
+
type: "TSFunctionType";
|
| 1549 |
+
typeParameters: TSTypeParameterDeclaration | null;
|
| 1550 |
+
params: ParamPattern[];
|
| 1551 |
+
returnType: TSTypeAnnotation;
|
| 1552 |
+
parent?: Node;
|
| 1553 |
+
}
|
| 1554 |
+
|
| 1555 |
+
export interface TSConstructorType extends Span {
|
| 1556 |
+
type: "TSConstructorType";
|
| 1557 |
+
abstract: boolean;
|
| 1558 |
+
typeParameters: TSTypeParameterDeclaration | null;
|
| 1559 |
+
params: ParamPattern[];
|
| 1560 |
+
returnType: TSTypeAnnotation;
|
| 1561 |
+
parent?: Node;
|
| 1562 |
+
}
|
| 1563 |
+
|
| 1564 |
+
export interface TSMappedType extends Span {
|
| 1565 |
+
type: "TSMappedType";
|
| 1566 |
+
key: BindingIdentifier;
|
| 1567 |
+
constraint: TSType;
|
| 1568 |
+
nameType: TSType | null;
|
| 1569 |
+
typeAnnotation: TSType | null;
|
| 1570 |
+
optional: TSMappedTypeModifierOperator | false;
|
| 1571 |
+
readonly: TSMappedTypeModifierOperator | null;
|
| 1572 |
+
parent?: Node;
|
| 1573 |
+
}
|
| 1574 |
+
|
| 1575 |
+
export type TSMappedTypeModifierOperator = true | "+" | "-";
|
| 1576 |
+
|
| 1577 |
+
export interface TSTemplateLiteralType extends Span {
|
| 1578 |
+
type: "TSTemplateLiteralType";
|
| 1579 |
+
quasis: Array<TemplateElement>;
|
| 1580 |
+
types: Array<TSType>;
|
| 1581 |
+
parent?: Node;
|
| 1582 |
+
}
|
| 1583 |
+
|
| 1584 |
+
export interface TSAsExpression extends Span {
|
| 1585 |
+
type: "TSAsExpression";
|
| 1586 |
+
expression: Expression;
|
| 1587 |
+
typeAnnotation: TSType;
|
| 1588 |
+
parent?: Node;
|
| 1589 |
+
}
|
| 1590 |
+
|
| 1591 |
+
export interface TSSatisfiesExpression extends Span {
|
| 1592 |
+
type: "TSSatisfiesExpression";
|
| 1593 |
+
expression: Expression;
|
| 1594 |
+
typeAnnotation: TSType;
|
| 1595 |
+
parent?: Node;
|
| 1596 |
+
}
|
| 1597 |
+
|
| 1598 |
+
export interface TSTypeAssertion extends Span {
|
| 1599 |
+
type: "TSTypeAssertion";
|
| 1600 |
+
typeAnnotation: TSType;
|
| 1601 |
+
expression: Expression;
|
| 1602 |
+
parent?: Node;
|
| 1603 |
+
}
|
| 1604 |
+
|
| 1605 |
+
export interface TSImportEqualsDeclaration extends Span {
|
| 1606 |
+
type: "TSImportEqualsDeclaration";
|
| 1607 |
+
id: BindingIdentifier;
|
| 1608 |
+
moduleReference: TSModuleReference;
|
| 1609 |
+
importKind: ImportOrExportKind;
|
| 1610 |
+
parent?: Node;
|
| 1611 |
+
}
|
| 1612 |
+
|
| 1613 |
+
export type TSModuleReference = TSExternalModuleReference | IdentifierReference | TSQualifiedName;
|
| 1614 |
+
|
| 1615 |
+
export interface TSExternalModuleReference extends Span {
|
| 1616 |
+
type: "TSExternalModuleReference";
|
| 1617 |
+
expression: StringLiteral;
|
| 1618 |
+
parent?: Node;
|
| 1619 |
+
}
|
| 1620 |
+
|
| 1621 |
+
export interface TSNonNullExpression extends Span {
|
| 1622 |
+
type: "TSNonNullExpression";
|
| 1623 |
+
expression: Expression;
|
| 1624 |
+
parent?: Node;
|
| 1625 |
+
}
|
| 1626 |
+
|
| 1627 |
+
export interface Decorator extends Span {
|
| 1628 |
+
type: "Decorator";
|
| 1629 |
+
expression: Expression;
|
| 1630 |
+
parent?: Node;
|
| 1631 |
+
}
|
| 1632 |
+
|
| 1633 |
+
export interface TSExportAssignment extends Span {
|
| 1634 |
+
type: "TSExportAssignment";
|
| 1635 |
+
expression: Expression;
|
| 1636 |
+
parent?: Node;
|
| 1637 |
+
}
|
| 1638 |
+
|
| 1639 |
+
export interface TSNamespaceExportDeclaration extends Span {
|
| 1640 |
+
type: "TSNamespaceExportDeclaration";
|
| 1641 |
+
id: IdentifierName;
|
| 1642 |
+
parent?: Node;
|
| 1643 |
+
}
|
| 1644 |
+
|
| 1645 |
+
export interface TSInstantiationExpression extends Span {
|
| 1646 |
+
type: "TSInstantiationExpression";
|
| 1647 |
+
expression: Expression;
|
| 1648 |
+
typeArguments: TSTypeParameterInstantiation;
|
| 1649 |
+
parent?: Node;
|
| 1650 |
+
}
|
| 1651 |
+
|
| 1652 |
+
export type ImportOrExportKind = "value" | "type";
|
| 1653 |
+
|
| 1654 |
+
export interface JSDocNullableType extends Span {
|
| 1655 |
+
type: "TSJSDocNullableType";
|
| 1656 |
+
typeAnnotation: TSType;
|
| 1657 |
+
postfix: boolean;
|
| 1658 |
+
parent?: Node;
|
| 1659 |
+
}
|
| 1660 |
+
|
| 1661 |
+
export interface JSDocNonNullableType extends Span {
|
| 1662 |
+
type: "TSJSDocNonNullableType";
|
| 1663 |
+
typeAnnotation: TSType;
|
| 1664 |
+
postfix: boolean;
|
| 1665 |
+
parent?: Node;
|
| 1666 |
+
}
|
| 1667 |
+
|
| 1668 |
+
export interface JSDocUnknownType extends Span {
|
| 1669 |
+
type: "TSJSDocUnknownType";
|
| 1670 |
+
parent?: Node;
|
| 1671 |
+
}
|
| 1672 |
+
|
| 1673 |
+
export type ModuleKind = "script" | "module" | "commonjs";
|
| 1674 |
+
|
| 1675 |
+
export interface Span {
|
| 1676 |
+
start: number;
|
| 1677 |
+
end: number;
|
| 1678 |
+
range?: [number, number];
|
| 1679 |
+
}
|
| 1680 |
+
|
| 1681 |
+
export type AssignmentOperator =
|
| 1682 |
+
| "="
|
| 1683 |
+
| "+="
|
| 1684 |
+
| "-="
|
| 1685 |
+
| "*="
|
| 1686 |
+
| "/="
|
| 1687 |
+
| "%="
|
| 1688 |
+
| "**="
|
| 1689 |
+
| "<<="
|
| 1690 |
+
| ">>="
|
| 1691 |
+
| ">>>="
|
| 1692 |
+
| "|="
|
| 1693 |
+
| "^="
|
| 1694 |
+
| "&="
|
| 1695 |
+
| "||="
|
| 1696 |
+
| "&&="
|
| 1697 |
+
| "??=";
|
| 1698 |
+
|
| 1699 |
+
export type BinaryOperator =
|
| 1700 |
+
| "=="
|
| 1701 |
+
| "!="
|
| 1702 |
+
| "==="
|
| 1703 |
+
| "!=="
|
| 1704 |
+
| "<"
|
| 1705 |
+
| "<="
|
| 1706 |
+
| ">"
|
| 1707 |
+
| ">="
|
| 1708 |
+
| "+"
|
| 1709 |
+
| "-"
|
| 1710 |
+
| "*"
|
| 1711 |
+
| "/"
|
| 1712 |
+
| "%"
|
| 1713 |
+
| "**"
|
| 1714 |
+
| "<<"
|
| 1715 |
+
| ">>"
|
| 1716 |
+
| ">>>"
|
| 1717 |
+
| "|"
|
| 1718 |
+
| "^"
|
| 1719 |
+
| "&"
|
| 1720 |
+
| "in"
|
| 1721 |
+
| "instanceof";
|
| 1722 |
+
|
| 1723 |
+
export type LogicalOperator = "||" | "&&" | "??";
|
| 1724 |
+
|
| 1725 |
+
export type UnaryOperator = "+" | "-" | "!" | "~" | "typeof" | "void" | "delete";
|
| 1726 |
+
|
| 1727 |
+
export type UpdateOperator = "++" | "--";
|
| 1728 |
+
|
| 1729 |
+
export type Node =
|
| 1730 |
+
| Program
|
| 1731 |
+
| IdentifierName
|
| 1732 |
+
| IdentifierReference
|
| 1733 |
+
| BindingIdentifier
|
| 1734 |
+
| LabelIdentifier
|
| 1735 |
+
| ThisExpression
|
| 1736 |
+
| ArrayExpression
|
| 1737 |
+
| ObjectExpression
|
| 1738 |
+
| ObjectProperty
|
| 1739 |
+
| TemplateLiteral
|
| 1740 |
+
| TaggedTemplateExpression
|
| 1741 |
+
| TemplateElement
|
| 1742 |
+
| ComputedMemberExpression
|
| 1743 |
+
| StaticMemberExpression
|
| 1744 |
+
| PrivateFieldExpression
|
| 1745 |
+
| CallExpression
|
| 1746 |
+
| NewExpression
|
| 1747 |
+
| MetaProperty
|
| 1748 |
+
| SpreadElement
|
| 1749 |
+
| UpdateExpression
|
| 1750 |
+
| UnaryExpression
|
| 1751 |
+
| BinaryExpression
|
| 1752 |
+
| PrivateInExpression
|
| 1753 |
+
| LogicalExpression
|
| 1754 |
+
| ConditionalExpression
|
| 1755 |
+
| AssignmentExpression
|
| 1756 |
+
| ArrayAssignmentTarget
|
| 1757 |
+
| ObjectAssignmentTarget
|
| 1758 |
+
| AssignmentTargetRest
|
| 1759 |
+
| AssignmentTargetWithDefault
|
| 1760 |
+
| AssignmentTargetPropertyIdentifier
|
| 1761 |
+
| AssignmentTargetPropertyProperty
|
| 1762 |
+
| SequenceExpression
|
| 1763 |
+
| Super
|
| 1764 |
+
| AwaitExpression
|
| 1765 |
+
| ChainExpression
|
| 1766 |
+
| ParenthesizedExpression
|
| 1767 |
+
| Directive
|
| 1768 |
+
| Hashbang
|
| 1769 |
+
| BlockStatement
|
| 1770 |
+
| VariableDeclaration
|
| 1771 |
+
| VariableDeclarator
|
| 1772 |
+
| EmptyStatement
|
| 1773 |
+
| ExpressionStatement
|
| 1774 |
+
| IfStatement
|
| 1775 |
+
| DoWhileStatement
|
| 1776 |
+
| WhileStatement
|
| 1777 |
+
| ForStatement
|
| 1778 |
+
| ForInStatement
|
| 1779 |
+
| ForOfStatement
|
| 1780 |
+
| ContinueStatement
|
| 1781 |
+
| BreakStatement
|
| 1782 |
+
| ReturnStatement
|
| 1783 |
+
| WithStatement
|
| 1784 |
+
| SwitchStatement
|
| 1785 |
+
| SwitchCase
|
| 1786 |
+
| LabeledStatement
|
| 1787 |
+
| ThrowStatement
|
| 1788 |
+
| TryStatement
|
| 1789 |
+
| CatchClause
|
| 1790 |
+
| DebuggerStatement
|
| 1791 |
+
| AssignmentPattern
|
| 1792 |
+
| ObjectPattern
|
| 1793 |
+
| BindingProperty
|
| 1794 |
+
| ArrayPattern
|
| 1795 |
+
| BindingRestElement
|
| 1796 |
+
| Function
|
| 1797 |
+
| FunctionBody
|
| 1798 |
+
| ArrowFunctionExpression
|
| 1799 |
+
| YieldExpression
|
| 1800 |
+
| Class
|
| 1801 |
+
| ClassBody
|
| 1802 |
+
| MethodDefinition
|
| 1803 |
+
| PropertyDefinition
|
| 1804 |
+
| PrivateIdentifier
|
| 1805 |
+
| StaticBlock
|
| 1806 |
+
| AccessorProperty
|
| 1807 |
+
| ImportExpression
|
| 1808 |
+
| ImportDeclaration
|
| 1809 |
+
| ImportSpecifier
|
| 1810 |
+
| ImportDefaultSpecifier
|
| 1811 |
+
| ImportNamespaceSpecifier
|
| 1812 |
+
| ImportAttribute
|
| 1813 |
+
| ExportNamedDeclaration
|
| 1814 |
+
| ExportDefaultDeclaration
|
| 1815 |
+
| ExportAllDeclaration
|
| 1816 |
+
| ExportSpecifier
|
| 1817 |
+
| V8IntrinsicExpression
|
| 1818 |
+
| BooleanLiteral
|
| 1819 |
+
| NullLiteral
|
| 1820 |
+
| NumericLiteral
|
| 1821 |
+
| StringLiteral
|
| 1822 |
+
| BigIntLiteral
|
| 1823 |
+
| RegExpLiteral
|
| 1824 |
+
| JSXElement
|
| 1825 |
+
| JSXOpeningElement
|
| 1826 |
+
| JSXClosingElement
|
| 1827 |
+
| JSXFragment
|
| 1828 |
+
| JSXOpeningFragment
|
| 1829 |
+
| JSXClosingFragment
|
| 1830 |
+
| JSXNamespacedName
|
| 1831 |
+
| JSXMemberExpression
|
| 1832 |
+
| JSXExpressionContainer
|
| 1833 |
+
| JSXEmptyExpression
|
| 1834 |
+
| JSXAttribute
|
| 1835 |
+
| JSXSpreadAttribute
|
| 1836 |
+
| JSXIdentifier
|
| 1837 |
+
| JSXSpreadChild
|
| 1838 |
+
| JSXText
|
| 1839 |
+
| TSThisParameter
|
| 1840 |
+
| TSEnumDeclaration
|
| 1841 |
+
| TSEnumBody
|
| 1842 |
+
| TSEnumMember
|
| 1843 |
+
| TSTypeAnnotation
|
| 1844 |
+
| TSLiteralType
|
| 1845 |
+
| TSConditionalType
|
| 1846 |
+
| TSUnionType
|
| 1847 |
+
| TSIntersectionType
|
| 1848 |
+
| TSParenthesizedType
|
| 1849 |
+
| TSTypeOperator
|
| 1850 |
+
| TSArrayType
|
| 1851 |
+
| TSIndexedAccessType
|
| 1852 |
+
| TSTupleType
|
| 1853 |
+
| TSNamedTupleMember
|
| 1854 |
+
| TSOptionalType
|
| 1855 |
+
| TSRestType
|
| 1856 |
+
| TSAnyKeyword
|
| 1857 |
+
| TSStringKeyword
|
| 1858 |
+
| TSBooleanKeyword
|
| 1859 |
+
| TSNumberKeyword
|
| 1860 |
+
| TSNeverKeyword
|
| 1861 |
+
| TSIntrinsicKeyword
|
| 1862 |
+
| TSUnknownKeyword
|
| 1863 |
+
| TSNullKeyword
|
| 1864 |
+
| TSUndefinedKeyword
|
| 1865 |
+
| TSVoidKeyword
|
| 1866 |
+
| TSSymbolKeyword
|
| 1867 |
+
| TSThisType
|
| 1868 |
+
| TSObjectKeyword
|
| 1869 |
+
| TSBigIntKeyword
|
| 1870 |
+
| TSTypeReference
|
| 1871 |
+
| TSQualifiedName
|
| 1872 |
+
| TSTypeParameterInstantiation
|
| 1873 |
+
| TSTypeParameter
|
| 1874 |
+
| TSTypeParameterDeclaration
|
| 1875 |
+
| TSTypeAliasDeclaration
|
| 1876 |
+
| TSClassImplements
|
| 1877 |
+
| TSInterfaceDeclaration
|
| 1878 |
+
| TSInterfaceBody
|
| 1879 |
+
| TSPropertySignature
|
| 1880 |
+
| TSIndexSignature
|
| 1881 |
+
| TSCallSignatureDeclaration
|
| 1882 |
+
| TSMethodSignature
|
| 1883 |
+
| TSConstructSignatureDeclaration
|
| 1884 |
+
| TSIndexSignatureName
|
| 1885 |
+
| TSInterfaceHeritage
|
| 1886 |
+
| TSTypePredicate
|
| 1887 |
+
| TSModuleDeclaration
|
| 1888 |
+
| TSGlobalDeclaration
|
| 1889 |
+
| TSModuleBlock
|
| 1890 |
+
| TSTypeLiteral
|
| 1891 |
+
| TSInferType
|
| 1892 |
+
| TSTypeQuery
|
| 1893 |
+
| TSImportType
|
| 1894 |
+
| TSImportTypeQualifiedName
|
| 1895 |
+
| TSFunctionType
|
| 1896 |
+
| TSConstructorType
|
| 1897 |
+
| TSMappedType
|
| 1898 |
+
| TSTemplateLiteralType
|
| 1899 |
+
| TSAsExpression
|
| 1900 |
+
| TSSatisfiesExpression
|
| 1901 |
+
| TSTypeAssertion
|
| 1902 |
+
| TSImportEqualsDeclaration
|
| 1903 |
+
| TSExternalModuleReference
|
| 1904 |
+
| TSNonNullExpression
|
| 1905 |
+
| Decorator
|
| 1906 |
+
| TSExportAssignment
|
| 1907 |
+
| TSNamespaceExportDeclaration
|
| 1908 |
+
| TSInstantiationExpression
|
| 1909 |
+
| JSDocNullableType
|
| 1910 |
+
| JSDocNonNullableType
|
| 1911 |
+
| JSDocUnknownType
|
| 1912 |
+
| ParamPattern;
|
dashboard/node_modules/@rolldown/binding-win32-x64-msvc/README.md
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# `@rolldown/binding-win32-x64-msvc`
|
| 2 |
+
|
| 3 |
+
This is the **x86_64-pc-windows-msvc** binary for `@rolldown/binding`
|
dashboard/node_modules/@rolldown/binding-win32-x64-msvc/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@rolldown/binding-win32-x64-msvc",
|
| 3 |
+
"version": "1.0.0-rc.17",
|
| 4 |
+
"cpu": [
|
| 5 |
+
"x64"
|
| 6 |
+
],
|
| 7 |
+
"main": "rolldown-binding.win32-x64-msvc.node",
|
| 8 |
+
"files": [
|
| 9 |
+
"rolldown-binding.win32-x64-msvc.node"
|
| 10 |
+
],
|
| 11 |
+
"description": "Fast JavaScript/TypeScript bundler in Rust with Rollup-compatible API.",
|
| 12 |
+
"keywords": [
|
| 13 |
+
"bundler",
|
| 14 |
+
"esbuild",
|
| 15 |
+
"parcel",
|
| 16 |
+
"rolldown",
|
| 17 |
+
"rollup",
|
| 18 |
+
"webpack"
|
| 19 |
+
],
|
| 20 |
+
"homepage": "https://rolldown.rs/",
|
| 21 |
+
"license": "MIT",
|
| 22 |
+
"engines": {
|
| 23 |
+
"node": "^20.19.0 || >=22.12.0"
|
| 24 |
+
},
|
| 25 |
+
"repository": {
|
| 26 |
+
"type": "git",
|
| 27 |
+
"url": "git+https://github.com/rolldown/rolldown.git",
|
| 28 |
+
"directory": "packages/rolldown"
|
| 29 |
+
},
|
| 30 |
+
"publishConfig": {
|
| 31 |
+
"registry": "https://registry.npmjs.org/",
|
| 32 |
+
"access": "public"
|
| 33 |
+
},
|
| 34 |
+
"os": [
|
| 35 |
+
"win32"
|
| 36 |
+
]
|
| 37 |
+
}
|
dashboard/node_modules/@rolldown/binding-win32-x64-msvc/rolldown-binding.win32-x64-msvc.node
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:912974e68c2f46ca74e4474e1f21e1154eae0ffcff9ef0783d994c36b2f341cd
|
| 3 |
+
size 24431616
|
dashboard/node_modules/@rolldown/pluginutils/LICENSE
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
MIT License
|
| 2 |
+
|
| 3 |
+
Copyright (c) 2024-present VoidZero Inc. & Contributors
|
| 4 |
+
|
| 5 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 6 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 7 |
+
in the Software without restriction, including without limitation the rights
|
| 8 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 9 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 10 |
+
furnished to do so, subject to the following conditions:
|
| 11 |
+
|
| 12 |
+
The above copyright notice and this permission notice shall be included in all
|
| 13 |
+
copies or substantial portions of the Software.
|
| 14 |
+
|
| 15 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 16 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 17 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 18 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 19 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 20 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
| 21 |
+
SOFTWARE.
|
| 22 |
+
|
| 23 |
+
end of terms and conditions
|
| 24 |
+
|
| 25 |
+
The licenses of externally maintained libraries from which parts of the Software is derived are listed [here](https://github.com/rolldown/rolldown/blob/main/THIRD-PARTY-LICENSE).
|
dashboard/node_modules/@rolldown/pluginutils/README.md
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# @rolldown/pluginutils
|
| 2 |
+
|
| 3 |
+
A utility library for building flexible, composable filter expressions that can be used in plugin hook filters of Rolldown/Vite/Rollup/Unplugin plugins.
|
| 4 |
+
|
| 5 |
+
## Installation
|
| 6 |
+
|
| 7 |
+
```sh
|
| 8 |
+
pnpm add @rolldown/pluginutils
|
| 9 |
+
```
|
| 10 |
+
|
| 11 |
+
## Usage
|
| 12 |
+
|
| 13 |
+
### Simple Filters
|
| 14 |
+
|
| 15 |
+
```ts
|
| 16 |
+
import { exactRegex, makeIdFiltersToMatchWithQuery, prefixRegex } from '@rolldown/pluginutils';
|
| 17 |
+
|
| 18 |
+
// Match exactly 'foo.js'
|
| 19 |
+
const filter = exactRegex('foo.js');
|
| 20 |
+
|
| 21 |
+
// Match any id starting with 'lib/'
|
| 22 |
+
const prefix = prefixRegex('lib/');
|
| 23 |
+
|
| 24 |
+
// Match ids with query params (e.g. 'foo.js?bar')
|
| 25 |
+
const idFilters = makeIdFiltersToMatchWithQuery(['**/*.js', /\.ts$/]);
|
| 26 |
+
|
| 27 |
+
// Usage in a plugin to define a hook filter
|
| 28 |
+
const myPlugin = {
|
| 29 |
+
resolveId: {
|
| 30 |
+
filter: {
|
| 31 |
+
id: [exactRegex('MY_ID_TO_CHECK'), /some-other-regex/],
|
| 32 |
+
},
|
| 33 |
+
handler(id) {
|
| 34 |
+
// Your code here
|
| 35 |
+
},
|
| 36 |
+
},
|
| 37 |
+
};
|
| 38 |
+
```
|
| 39 |
+
|
| 40 |
+
### Composable Filters
|
| 41 |
+
|
| 42 |
+
> [!WARNING]
|
| 43 |
+
> Composable filters are not yet supported in Vite or unplugin. They can be used in Rolldown plugins only.
|
| 44 |
+
|
| 45 |
+
```ts
|
| 46 |
+
import { and, id, include, moduleType, query } from '@rolldown/pluginutils';
|
| 47 |
+
|
| 48 |
+
// Build a filter expression
|
| 49 |
+
const filterExpr = and(id(/\.ts$/), moduleType('ts'), query('foo', true));
|
| 50 |
+
|
| 51 |
+
// Usage in a plugin to define a hook filter
|
| 52 |
+
const myPlugin = {
|
| 53 |
+
transform: {
|
| 54 |
+
filter: [include(filterExpr)],
|
| 55 |
+
handler(code, id, options) {
|
| 56 |
+
// Your code here
|
| 57 |
+
},
|
| 58 |
+
},
|
| 59 |
+
};
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## API Reference
|
| 63 |
+
|
| 64 |
+
### Simple Filters
|
| 65 |
+
|
| 66 |
+
- `exactRegex(str: string, flags?: string): RegExp` — Matches the exact string.
|
| 67 |
+
- `prefixRegex(str: string, flags?: string): RegExp` — Matches values with the given prefix.
|
| 68 |
+
- `makeIdFiltersToMatchWithQuery(input: string | RegExp | (string | RegExp)[]): string | RegExp | (string | RegExp)[]` — Adapts filters to match ids with query params.
|
| 69 |
+
|
| 70 |
+
### Composable Filters
|
| 71 |
+
|
| 72 |
+
- `and(...exprs)` / `or(...exprs)` / `not(expr)` — Logical composition of filter expressions.
|
| 73 |
+
- `id(pattern, params?)` — Filter by id. A `string` pattern is matched by exact equality (not glob); a `RegExp` is tested against the id.
|
| 74 |
+
- `importerId(pattern, params?)` — Filter by importer id. A `string` pattern is matched by exact equality; a `RegExp` is tested against the importer id. Only usable with the `resolveId` hook.
|
| 75 |
+
- `moduleType(type)` — Filter by module type (e.g. 'js', 'tsx', or 'json').
|
| 76 |
+
- `code(pattern)` — Filter by code content.
|
| 77 |
+
- `query(key, pattern)` — Filter by query parameter.
|
| 78 |
+
- `include(expr)` / `exclude(expr)` — Top-level include/exclude wrappers.
|
| 79 |
+
- `queries(obj)` — Compose multiple query filters.
|
| 80 |
+
|
| 81 |
+
### Utilities
|
| 82 |
+
|
| 83 |
+
- `filterVitePlugins(plugins)` — Filters out Vite plugins with `apply: 'serve'`.
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
type StringOrRegExp = string | RegExp;
|
| 2 |
+
type PluginModuleType = 'js' | 'jsx' | 'ts' | 'tsx' | 'json' | 'text' | 'base64' | 'dataurl' | 'binary' | 'empty' | (string & {});
|
| 3 |
+
export type FilterExpressionKind = FilterExpression['kind'];
|
| 4 |
+
export type FilterExpression = And | Or | Not | Id | ImporterId | ModuleType | Code | Query;
|
| 5 |
+
export type TopLevelFilterExpression = Include | Exclude;
|
| 6 |
+
declare class And {
|
| 7 |
+
kind: 'and';
|
| 8 |
+
args: FilterExpression[];
|
| 9 |
+
constructor(...args: FilterExpression[]);
|
| 10 |
+
}
|
| 11 |
+
declare class Or {
|
| 12 |
+
kind: 'or';
|
| 13 |
+
args: FilterExpression[];
|
| 14 |
+
constructor(...args: FilterExpression[]);
|
| 15 |
+
}
|
| 16 |
+
declare class Not {
|
| 17 |
+
kind: 'not';
|
| 18 |
+
expr: FilterExpression;
|
| 19 |
+
constructor(expr: FilterExpression);
|
| 20 |
+
}
|
| 21 |
+
export interface QueryFilterObject {
|
| 22 |
+
[key: string]: StringOrRegExp | boolean;
|
| 23 |
+
}
|
| 24 |
+
interface IdParams {
|
| 25 |
+
cleanUrl?: boolean;
|
| 26 |
+
}
|
| 27 |
+
declare class Id {
|
| 28 |
+
kind: 'id';
|
| 29 |
+
pattern: StringOrRegExp;
|
| 30 |
+
params: IdParams;
|
| 31 |
+
constructor(pattern: StringOrRegExp, params?: IdParams);
|
| 32 |
+
}
|
| 33 |
+
declare class ImporterId {
|
| 34 |
+
kind: 'importerId';
|
| 35 |
+
pattern: StringOrRegExp;
|
| 36 |
+
params: IdParams;
|
| 37 |
+
constructor(pattern: StringOrRegExp, params?: IdParams);
|
| 38 |
+
}
|
| 39 |
+
declare class ModuleType {
|
| 40 |
+
kind: 'moduleType';
|
| 41 |
+
pattern: PluginModuleType;
|
| 42 |
+
constructor(pattern: PluginModuleType);
|
| 43 |
+
}
|
| 44 |
+
declare class Code {
|
| 45 |
+
kind: 'code';
|
| 46 |
+
pattern: StringOrRegExp;
|
| 47 |
+
constructor(expr: StringOrRegExp);
|
| 48 |
+
}
|
| 49 |
+
declare class Query {
|
| 50 |
+
kind: 'query';
|
| 51 |
+
key: string;
|
| 52 |
+
pattern: StringOrRegExp | boolean;
|
| 53 |
+
constructor(key: string, pattern: StringOrRegExp | boolean);
|
| 54 |
+
}
|
| 55 |
+
declare class Include {
|
| 56 |
+
kind: 'include';
|
| 57 |
+
expr: FilterExpression;
|
| 58 |
+
constructor(expr: FilterExpression);
|
| 59 |
+
}
|
| 60 |
+
declare class Exclude {
|
| 61 |
+
kind: 'exclude';
|
| 62 |
+
expr: FilterExpression;
|
| 63 |
+
constructor(expr: FilterExpression);
|
| 64 |
+
}
|
| 65 |
+
export declare function and(...args: FilterExpression[]): And;
|
| 66 |
+
export declare function or(...args: FilterExpression[]): Or;
|
| 67 |
+
export declare function not(expr: FilterExpression): Not;
|
| 68 |
+
export declare function id(pattern: StringOrRegExp, params?: IdParams): Id;
|
| 69 |
+
export declare function importerId(pattern: StringOrRegExp, params?: IdParams): ImporterId;
|
| 70 |
+
export declare function moduleType(pattern: PluginModuleType): ModuleType;
|
| 71 |
+
export declare function code(pattern: StringOrRegExp): Code;
|
| 72 |
+
export declare function query(key: string, pattern: StringOrRegExp | boolean): Query;
|
| 73 |
+
export declare function include(expr: FilterExpression): Include;
|
| 74 |
+
export declare function exclude(expr: FilterExpression): Exclude;
|
| 75 |
+
/**
|
| 76 |
+
* convert a queryObject to FilterExpression like
|
| 77 |
+
* ```js
|
| 78 |
+
* and(query(k1, v1), query(k2, v2))
|
| 79 |
+
* ```
|
| 80 |
+
* @param queryFilterObject The query filter object needs to be matched.
|
| 81 |
+
* @returns a `And` FilterExpression
|
| 82 |
+
*/
|
| 83 |
+
export declare function queries(queryFilter: QueryFilterObject): And;
|
| 84 |
+
export declare function interpreter(exprs: TopLevelFilterExpression | TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string): boolean;
|
| 85 |
+
interface InterpreterCtx {
|
| 86 |
+
urlSearchParamsCache?: URLSearchParams;
|
| 87 |
+
}
|
| 88 |
+
export declare function interpreterImpl(expr: TopLevelFilterExpression[], code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
| 89 |
+
export declare function exprInterpreter(expr: FilterExpression, code?: string, id?: string, moduleType?: PluginModuleType, importerId?: string, ctx?: InterpreterCtx): boolean;
|
| 90 |
+
export {};
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/composable-filters.js
ADDED
|
@@ -0,0 +1,256 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { cleanUrl, extractQueryWithoutFragment } from "../utils.js";
|
| 2 |
+
class And {
|
| 3 |
+
kind;
|
| 4 |
+
args;
|
| 5 |
+
constructor(...args) {
|
| 6 |
+
if (args.length === 0) {
|
| 7 |
+
throw new Error('`And` expects at least one operand');
|
| 8 |
+
}
|
| 9 |
+
this.args = args;
|
| 10 |
+
this.kind = 'and';
|
| 11 |
+
}
|
| 12 |
+
}
|
| 13 |
+
class Or {
|
| 14 |
+
kind;
|
| 15 |
+
args;
|
| 16 |
+
constructor(...args) {
|
| 17 |
+
if (args.length === 0) {
|
| 18 |
+
throw new Error('`Or` expects at least one operand');
|
| 19 |
+
}
|
| 20 |
+
this.args = args;
|
| 21 |
+
this.kind = 'or';
|
| 22 |
+
}
|
| 23 |
+
}
|
| 24 |
+
class Not {
|
| 25 |
+
kind;
|
| 26 |
+
expr;
|
| 27 |
+
constructor(expr) {
|
| 28 |
+
this.expr = expr;
|
| 29 |
+
this.kind = 'not';
|
| 30 |
+
}
|
| 31 |
+
}
|
| 32 |
+
class Id {
|
| 33 |
+
kind;
|
| 34 |
+
pattern;
|
| 35 |
+
params;
|
| 36 |
+
constructor(pattern, params) {
|
| 37 |
+
this.pattern = pattern;
|
| 38 |
+
this.kind = 'id';
|
| 39 |
+
this.params = params ?? {
|
| 40 |
+
cleanUrl: false,
|
| 41 |
+
};
|
| 42 |
+
}
|
| 43 |
+
}
|
| 44 |
+
class ImporterId {
|
| 45 |
+
kind;
|
| 46 |
+
pattern;
|
| 47 |
+
params;
|
| 48 |
+
constructor(pattern, params) {
|
| 49 |
+
this.pattern = pattern;
|
| 50 |
+
this.kind = 'importerId';
|
| 51 |
+
this.params = params ?? {
|
| 52 |
+
cleanUrl: false,
|
| 53 |
+
};
|
| 54 |
+
}
|
| 55 |
+
}
|
| 56 |
+
class ModuleType {
|
| 57 |
+
kind;
|
| 58 |
+
pattern;
|
| 59 |
+
constructor(pattern) {
|
| 60 |
+
this.pattern = pattern;
|
| 61 |
+
this.kind = 'moduleType';
|
| 62 |
+
}
|
| 63 |
+
}
|
| 64 |
+
class Code {
|
| 65 |
+
kind;
|
| 66 |
+
pattern;
|
| 67 |
+
constructor(expr) {
|
| 68 |
+
this.pattern = expr;
|
| 69 |
+
this.kind = 'code';
|
| 70 |
+
}
|
| 71 |
+
}
|
| 72 |
+
class Query {
|
| 73 |
+
kind;
|
| 74 |
+
key;
|
| 75 |
+
pattern;
|
| 76 |
+
constructor(key, pattern) {
|
| 77 |
+
this.pattern = pattern;
|
| 78 |
+
this.key = key;
|
| 79 |
+
this.kind = 'query';
|
| 80 |
+
}
|
| 81 |
+
}
|
| 82 |
+
class Include {
|
| 83 |
+
kind;
|
| 84 |
+
expr;
|
| 85 |
+
constructor(expr) {
|
| 86 |
+
this.expr = expr;
|
| 87 |
+
this.kind = 'include';
|
| 88 |
+
}
|
| 89 |
+
}
|
| 90 |
+
class Exclude {
|
| 91 |
+
kind;
|
| 92 |
+
expr;
|
| 93 |
+
constructor(expr) {
|
| 94 |
+
this.expr = expr;
|
| 95 |
+
this.kind = 'exclude';
|
| 96 |
+
}
|
| 97 |
+
}
|
| 98 |
+
export function and(...args) {
|
| 99 |
+
return new And(...args);
|
| 100 |
+
}
|
| 101 |
+
export function or(...args) {
|
| 102 |
+
return new Or(...args);
|
| 103 |
+
}
|
| 104 |
+
export function not(expr) {
|
| 105 |
+
return new Not(expr);
|
| 106 |
+
}
|
| 107 |
+
export function id(pattern, params) {
|
| 108 |
+
return new Id(pattern, params);
|
| 109 |
+
}
|
| 110 |
+
export function importerId(pattern, params) {
|
| 111 |
+
return new ImporterId(pattern, params);
|
| 112 |
+
}
|
| 113 |
+
export function moduleType(pattern) {
|
| 114 |
+
return new ModuleType(pattern);
|
| 115 |
+
}
|
| 116 |
+
export function code(pattern) {
|
| 117 |
+
return new Code(pattern);
|
| 118 |
+
}
|
| 119 |
+
/*
|
| 120 |
+
* There are three kinds of conditions are supported:
|
| 121 |
+
* 1. `boolean`: if the value is `true`, the key must exist and be truthy. if the value is `false`, the key must not exist or be falsy.
|
| 122 |
+
* 2. `string`: the key must exist and be equal to the value.
|
| 123 |
+
* 3. `RegExp`: the key must exist and match the value.
|
| 124 |
+
*/
|
| 125 |
+
export function query(key, pattern) {
|
| 126 |
+
return new Query(key, pattern);
|
| 127 |
+
}
|
| 128 |
+
export function include(expr) {
|
| 129 |
+
return new Include(expr);
|
| 130 |
+
}
|
| 131 |
+
export function exclude(expr) {
|
| 132 |
+
return new Exclude(expr);
|
| 133 |
+
}
|
| 134 |
+
/**
|
| 135 |
+
* convert a queryObject to FilterExpression like
|
| 136 |
+
* ```js
|
| 137 |
+
* and(query(k1, v1), query(k2, v2))
|
| 138 |
+
* ```
|
| 139 |
+
* @param queryFilterObject The query filter object needs to be matched.
|
| 140 |
+
* @returns a `And` FilterExpression
|
| 141 |
+
*/
|
| 142 |
+
export function queries(queryFilter) {
|
| 143 |
+
let arr = Object.entries(queryFilter).map(([key, value]) => {
|
| 144 |
+
return new Query(key, value);
|
| 145 |
+
});
|
| 146 |
+
return and(...arr);
|
| 147 |
+
}
|
| 148 |
+
export function interpreter(exprs, code, id, moduleType, importerId) {
|
| 149 |
+
let arr = [];
|
| 150 |
+
if (Array.isArray(exprs)) {
|
| 151 |
+
arr = exprs;
|
| 152 |
+
}
|
| 153 |
+
else {
|
| 154 |
+
arr = [exprs];
|
| 155 |
+
}
|
| 156 |
+
return interpreterImpl(arr, code, id, moduleType, importerId);
|
| 157 |
+
}
|
| 158 |
+
export function interpreterImpl(expr, code, id, moduleType, importerId, ctx = {}) {
|
| 159 |
+
let hasInclude = false;
|
| 160 |
+
for (const e of expr) {
|
| 161 |
+
switch (e.kind) {
|
| 162 |
+
case 'include': {
|
| 163 |
+
hasInclude = true;
|
| 164 |
+
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) {
|
| 165 |
+
return true;
|
| 166 |
+
}
|
| 167 |
+
break;
|
| 168 |
+
}
|
| 169 |
+
case 'exclude': {
|
| 170 |
+
if (exprInterpreter(e.expr, code, id, moduleType, importerId, ctx)) {
|
| 171 |
+
return false;
|
| 172 |
+
}
|
| 173 |
+
break;
|
| 174 |
+
}
|
| 175 |
+
}
|
| 176 |
+
}
|
| 177 |
+
return !hasInclude;
|
| 178 |
+
}
|
| 179 |
+
export function exprInterpreter(expr, code, id, moduleType, importerId, ctx = {}) {
|
| 180 |
+
switch (expr.kind) {
|
| 181 |
+
case 'and': {
|
| 182 |
+
return expr.args.every((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
| 183 |
+
}
|
| 184 |
+
case 'or': {
|
| 185 |
+
return expr.args.some((e) => exprInterpreter(e, code, id, moduleType, importerId, ctx));
|
| 186 |
+
}
|
| 187 |
+
case 'not': {
|
| 188 |
+
return !exprInterpreter(expr.expr, code, id, moduleType, importerId, ctx);
|
| 189 |
+
}
|
| 190 |
+
case 'id': {
|
| 191 |
+
if (id === undefined) {
|
| 192 |
+
throw new Error('`id` is required for `id` expression');
|
| 193 |
+
}
|
| 194 |
+
let idToMatch = id;
|
| 195 |
+
if (expr.params.cleanUrl) {
|
| 196 |
+
idToMatch = cleanUrl(idToMatch);
|
| 197 |
+
}
|
| 198 |
+
return typeof expr.pattern === 'string'
|
| 199 |
+
? idToMatch === expr.pattern
|
| 200 |
+
: expr.pattern.test(idToMatch);
|
| 201 |
+
}
|
| 202 |
+
case 'importerId': {
|
| 203 |
+
if (importerId === undefined) {
|
| 204 |
+
return false; // Entry files have no importer, so no match
|
| 205 |
+
}
|
| 206 |
+
let importerIdToMatch = importerId;
|
| 207 |
+
if (expr.params.cleanUrl) {
|
| 208 |
+
importerIdToMatch = cleanUrl(importerIdToMatch);
|
| 209 |
+
}
|
| 210 |
+
return typeof expr.pattern === 'string'
|
| 211 |
+
? importerIdToMatch === expr.pattern
|
| 212 |
+
: expr.pattern.test(importerIdToMatch);
|
| 213 |
+
}
|
| 214 |
+
case 'moduleType': {
|
| 215 |
+
if (moduleType === undefined) {
|
| 216 |
+
throw new Error('`moduleType` is required for `moduleType` expression');
|
| 217 |
+
}
|
| 218 |
+
return moduleType === expr.pattern;
|
| 219 |
+
}
|
| 220 |
+
case 'code': {
|
| 221 |
+
if (code === undefined) {
|
| 222 |
+
throw new Error('`code` is required for `code` expression');
|
| 223 |
+
}
|
| 224 |
+
return typeof expr.pattern === 'string'
|
| 225 |
+
? code.includes(expr.pattern)
|
| 226 |
+
: expr.pattern.test(code);
|
| 227 |
+
}
|
| 228 |
+
case 'query': {
|
| 229 |
+
if (id === undefined) {
|
| 230 |
+
throw new Error('`id` is required for `Query` expression');
|
| 231 |
+
}
|
| 232 |
+
if (!ctx.urlSearchParamsCache) {
|
| 233 |
+
let queryString = extractQueryWithoutFragment(id);
|
| 234 |
+
ctx.urlSearchParamsCache = new URLSearchParams(queryString);
|
| 235 |
+
}
|
| 236 |
+
let urlParams = ctx.urlSearchParamsCache;
|
| 237 |
+
if (typeof expr.pattern === 'boolean') {
|
| 238 |
+
if (expr.pattern) {
|
| 239 |
+
return urlParams.has(expr.key);
|
| 240 |
+
}
|
| 241 |
+
else {
|
| 242 |
+
return !urlParams.has(expr.key);
|
| 243 |
+
}
|
| 244 |
+
}
|
| 245 |
+
else if (typeof expr.pattern === 'string') {
|
| 246 |
+
return urlParams.get(expr.key) === expr.pattern;
|
| 247 |
+
}
|
| 248 |
+
else {
|
| 249 |
+
return expr.pattern.test(urlParams.get(expr.key) ?? '');
|
| 250 |
+
}
|
| 251 |
+
}
|
| 252 |
+
default: {
|
| 253 |
+
throw new Error(`Expression ${JSON.stringify(expr)} is not expected.`);
|
| 254 |
+
}
|
| 255 |
+
}
|
| 256 |
+
}
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.d.ts
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Filters out Vite plugins that have `apply: 'serve'` set.
|
| 3 |
+
*
|
| 4 |
+
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
| 5 |
+
* are intended only for Vite's dev server and should be excluded from the build process.
|
| 6 |
+
*
|
| 7 |
+
* @param plugins - Array of plugins (can include nested arrays)
|
| 8 |
+
* @returns Filtered array with serve-only plugins removed
|
| 9 |
+
*
|
| 10 |
+
* @example
|
| 11 |
+
* ```ts
|
| 12 |
+
* import { defineConfig } from 'rolldown';
|
| 13 |
+
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
| 14 |
+
* import viteReact from '@vitejs/plugin-react';
|
| 15 |
+
*
|
| 16 |
+
* export default defineConfig({
|
| 17 |
+
* plugins: filterVitePlugins([
|
| 18 |
+
* viteReact(),
|
| 19 |
+
* {
|
| 20 |
+
* name: 'dev-only',
|
| 21 |
+
* apply: 'serve', // This will be filtered out
|
| 22 |
+
* // ...
|
| 23 |
+
* }
|
| 24 |
+
* ])
|
| 25 |
+
* });
|
| 26 |
+
* ```
|
| 27 |
+
*/
|
| 28 |
+
export declare function filterVitePlugins<T = any>(plugins: T | T[] | null | undefined | false): T[];
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/filter-vite-plugins.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Filters out Vite plugins that have `apply: 'serve'` set.
|
| 3 |
+
*
|
| 4 |
+
* Since Rolldown operates in build mode, plugins marked with `apply: 'serve'`
|
| 5 |
+
* are intended only for Vite's dev server and should be excluded from the build process.
|
| 6 |
+
*
|
| 7 |
+
* @param plugins - Array of plugins (can include nested arrays)
|
| 8 |
+
* @returns Filtered array with serve-only plugins removed
|
| 9 |
+
*
|
| 10 |
+
* @example
|
| 11 |
+
* ```ts
|
| 12 |
+
* import { defineConfig } from 'rolldown';
|
| 13 |
+
* import { filterVitePlugins } from '@rolldown/pluginutils';
|
| 14 |
+
* import viteReact from '@vitejs/plugin-react';
|
| 15 |
+
*
|
| 16 |
+
* export default defineConfig({
|
| 17 |
+
* plugins: filterVitePlugins([
|
| 18 |
+
* viteReact(),
|
| 19 |
+
* {
|
| 20 |
+
* name: 'dev-only',
|
| 21 |
+
* apply: 'serve', // This will be filtered out
|
| 22 |
+
* // ...
|
| 23 |
+
* }
|
| 24 |
+
* ])
|
| 25 |
+
* });
|
| 26 |
+
* ```
|
| 27 |
+
*/
|
| 28 |
+
export function filterVitePlugins(plugins) {
|
| 29 |
+
if (!plugins) {
|
| 30 |
+
return [];
|
| 31 |
+
}
|
| 32 |
+
const pluginArray = Array.isArray(plugins) ? plugins : [plugins];
|
| 33 |
+
const result = [];
|
| 34 |
+
for (const plugin of pluginArray) {
|
| 35 |
+
// Skip falsy values
|
| 36 |
+
if (!plugin) {
|
| 37 |
+
continue;
|
| 38 |
+
}
|
| 39 |
+
// Handle nested arrays recursively
|
| 40 |
+
if (Array.isArray(plugin)) {
|
| 41 |
+
result.push(...filterVitePlugins(plugin));
|
| 42 |
+
continue;
|
| 43 |
+
}
|
| 44 |
+
// Check if plugin has apply property
|
| 45 |
+
const pluginWithApply = plugin;
|
| 46 |
+
if ('apply' in pluginWithApply) {
|
| 47 |
+
const applyValue = pluginWithApply.apply;
|
| 48 |
+
// If apply is a function, call it with build mode
|
| 49 |
+
if (typeof applyValue === 'function') {
|
| 50 |
+
try {
|
| 51 |
+
const shouldApply = applyValue({}, // config object
|
| 52 |
+
{ command: 'build', mode: 'production' });
|
| 53 |
+
if (shouldApply) {
|
| 54 |
+
result.push(plugin);
|
| 55 |
+
}
|
| 56 |
+
}
|
| 57 |
+
catch {
|
| 58 |
+
// If function throws, include the plugin to be safe
|
| 59 |
+
result.push(plugin);
|
| 60 |
+
}
|
| 61 |
+
} // If apply is 'serve', skip this plugin
|
| 62 |
+
else if (applyValue === 'serve') {
|
| 63 |
+
continue;
|
| 64 |
+
} // If apply is 'build' or anything else, include it
|
| 65 |
+
else {
|
| 66 |
+
result.push(plugin);
|
| 67 |
+
}
|
| 68 |
+
}
|
| 69 |
+
else {
|
| 70 |
+
// No apply property, include the plugin
|
| 71 |
+
result.push(plugin);
|
| 72 |
+
}
|
| 73 |
+
}
|
| 74 |
+
return result;
|
| 75 |
+
}
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/index.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export * from './composable-filters.ts';
|
| 2 |
+
export * from './filter-vite-plugins.ts';
|
| 3 |
+
export * from './simple-filters.ts';
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/index.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export * from "./composable-filters.js";
|
| 2 |
+
export * from "./filter-vite-plugins.js";
|
| 3 |
+
export * from "./simple-filters.js";
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.d.ts
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Constructs a RegExp that matches the exact string specified.
|
| 3 |
+
*
|
| 4 |
+
* This is useful for plugin hook filters.
|
| 5 |
+
*
|
| 6 |
+
* @param str the string to match.
|
| 7 |
+
* @param flags flags for the RegExp.
|
| 8 |
+
*
|
| 9 |
+
* @example
|
| 10 |
+
* ```ts
|
| 11 |
+
* import { exactRegex } from '@rolldown/pluginutils';
|
| 12 |
+
* const plugin = {
|
| 13 |
+
* name: 'plugin',
|
| 14 |
+
* resolveId: {
|
| 15 |
+
* filter: { id: exactRegex('foo') },
|
| 16 |
+
* handler(id) {} // will only be called for `foo`
|
| 17 |
+
* }
|
| 18 |
+
* }
|
| 19 |
+
* ```
|
| 20 |
+
*/
|
| 21 |
+
export declare function exactRegex(str: string, flags?: string): RegExp;
|
| 22 |
+
/**
|
| 23 |
+
* Constructs a RegExp that matches a value that has the specified prefix.
|
| 24 |
+
*
|
| 25 |
+
* This is useful for plugin hook filters.
|
| 26 |
+
*
|
| 27 |
+
* @param str the string to match.
|
| 28 |
+
* @param flags flags for the RegExp.
|
| 29 |
+
*
|
| 30 |
+
* @example
|
| 31 |
+
* ```ts
|
| 32 |
+
* import { prefixRegex } from '@rolldown/pluginutils';
|
| 33 |
+
* const plugin = {
|
| 34 |
+
* name: 'plugin',
|
| 35 |
+
* resolveId: {
|
| 36 |
+
* filter: { id: prefixRegex('foo') },
|
| 37 |
+
* handler(id) {} // will only be called for IDs starting with `foo`
|
| 38 |
+
* }
|
| 39 |
+
* }
|
| 40 |
+
* ```
|
| 41 |
+
*/
|
| 42 |
+
export declare function prefixRegex(str: string, flags?: string): RegExp;
|
| 43 |
+
type WidenString<T> = T extends string ? string : T;
|
| 44 |
+
/**
|
| 45 |
+
* Converts a id filter to match with an id with a query.
|
| 46 |
+
*
|
| 47 |
+
* @param input the id filters to convert.
|
| 48 |
+
*
|
| 49 |
+
* @example
|
| 50 |
+
* ```ts
|
| 51 |
+
* import { makeIdFiltersToMatchWithQuery } from '@rolldown/pluginutils';
|
| 52 |
+
* const plugin = {
|
| 53 |
+
* name: 'plugin',
|
| 54 |
+
* transform: {
|
| 55 |
+
* filter: { id: makeIdFiltersToMatchWithQuery(['**' + '/*.js', /\.ts$/]) },
|
| 56 |
+
* // The handler will be called for IDs like:
|
| 57 |
+
* // - foo.js
|
| 58 |
+
* // - foo.js?foo
|
| 59 |
+
* // - foo.txt?foo.js
|
| 60 |
+
* // - foo.ts
|
| 61 |
+
* // - foo.ts?foo
|
| 62 |
+
* // - foo.txt?foo.ts
|
| 63 |
+
* handler(code, id) {}
|
| 64 |
+
* }
|
| 65 |
+
* }
|
| 66 |
+
* ```
|
| 67 |
+
*/
|
| 68 |
+
export declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: T): WidenString<T>;
|
| 69 |
+
export declare function makeIdFiltersToMatchWithQuery<T extends string | RegExp>(input: readonly T[]): WidenString<T>[];
|
| 70 |
+
export declare function makeIdFiltersToMatchWithQuery(input: string | RegExp | readonly (string | RegExp)[]): string | RegExp | (string | RegExp)[];
|
| 71 |
+
export {};
|
dashboard/node_modules/@rolldown/pluginutils/dist/filter/simple-filters.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/**
|
| 2 |
+
* Constructs a RegExp that matches the exact string specified.
|
| 3 |
+
*
|
| 4 |
+
* This is useful for plugin hook filters.
|
| 5 |
+
*
|
| 6 |
+
* @param str the string to match.
|
| 7 |
+
* @param flags flags for the RegExp.
|
| 8 |
+
*
|
| 9 |
+
* @example
|
| 10 |
+
* ```ts
|
| 11 |
+
* import { exactRegex } from '@rolldown/pluginutils';
|
| 12 |
+
* const plugin = {
|
| 13 |
+
* name: 'plugin',
|
| 14 |
+
* resolveId: {
|
| 15 |
+
* filter: { id: exactRegex('foo') },
|
| 16 |
+
* handler(id) {} // will only be called for `foo`
|
| 17 |
+
* }
|
| 18 |
+
* }
|
| 19 |
+
* ```
|
| 20 |
+
*/
|
| 21 |
+
export function exactRegex(str, flags) {
|
| 22 |
+
return new RegExp(`^${escapeRegex(str)}$`, flags);
|
| 23 |
+
}
|
| 24 |
+
/**
|
| 25 |
+
* Constructs a RegExp that matches a value that has the specified prefix.
|
| 26 |
+
*
|
| 27 |
+
* This is useful for plugin hook filters.
|
| 28 |
+
*
|
| 29 |
+
* @param str the string to match.
|
| 30 |
+
* @param flags flags for the RegExp.
|
| 31 |
+
*
|
| 32 |
+
* @example
|
| 33 |
+
* ```ts
|
| 34 |
+
* import { prefixRegex } from '@rolldown/pluginutils';
|
| 35 |
+
* const plugin = {
|
| 36 |
+
* name: 'plugin',
|
| 37 |
+
* resolveId: {
|
| 38 |
+
* filter: { id: prefixRegex('foo') },
|
| 39 |
+
* handler(id) {} // will only be called for IDs starting with `foo`
|
| 40 |
+
* }
|
| 41 |
+
* }
|
| 42 |
+
* ```
|
| 43 |
+
*/
|
| 44 |
+
export function prefixRegex(str, flags) {
|
| 45 |
+
return new RegExp(`^${escapeRegex(str)}`, flags);
|
| 46 |
+
}
|
| 47 |
+
const escapeRegexRE = /[-/\\^$*+?.()|[\]{}]/g;
|
| 48 |
+
function escapeRegex(str) {
|
| 49 |
+
return str.replace(escapeRegexRE, '\\$&');
|
| 50 |
+
}
|
| 51 |
+
export function makeIdFiltersToMatchWithQuery(input) {
|
| 52 |
+
if (!Array.isArray(input)) {
|
| 53 |
+
return makeIdFilterToMatchWithQuery(
|
| 54 |
+
// Array.isArray cannot narrow the type
|
| 55 |
+
// https://github.com/microsoft/TypeScript/issues/17002
|
| 56 |
+
input);
|
| 57 |
+
}
|
| 58 |
+
return input.map((i) => makeIdFilterToMatchWithQuery(i));
|
| 59 |
+
}
|
| 60 |
+
function makeIdFilterToMatchWithQuery(input) {
|
| 61 |
+
if (typeof input === 'string') {
|
| 62 |
+
return `${input}{?*,}`;
|
| 63 |
+
}
|
| 64 |
+
return makeRegexIdFilterToMatchWithQuery(input);
|
| 65 |
+
}
|
| 66 |
+
function makeRegexIdFilterToMatchWithQuery(input) {
|
| 67 |
+
return new RegExp(
|
| 68 |
+
// replace `$` with `(?:\?.*)?$` (ignore `\$`)
|
| 69 |
+
input.source.replace(/(?<!\\)\$/g, '(?:\\?.*)?$'), input.flags);
|
| 70 |
+
}
|
dashboard/node_modules/@rolldown/pluginutils/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from './filter/index.ts';
|
dashboard/node_modules/@rolldown/pluginutils/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
export * from "./filter/index.js";
|
dashboard/node_modules/@rolldown/pluginutils/dist/utils.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
export declare function cleanUrl(url: string): string;
|
| 2 |
+
export declare function extractQueryWithoutFragment(url: string): string;
|
dashboard/node_modules/@rolldown/pluginutils/dist/utils.js
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
const postfixRE = /[?#].*$/;
|
| 2 |
+
export function cleanUrl(url) {
|
| 3 |
+
return url.replace(postfixRE, '');
|
| 4 |
+
}
|
| 5 |
+
export function extractQueryWithoutFragment(url) {
|
| 6 |
+
const questionMarkIndex = url.indexOf('?');
|
| 7 |
+
if (questionMarkIndex === -1) {
|
| 8 |
+
return '';
|
| 9 |
+
}
|
| 10 |
+
const fragmentIndex = url.indexOf('#', questionMarkIndex); // Search for # after ?
|
| 11 |
+
if (fragmentIndex === -1) {
|
| 12 |
+
return url.substring(questionMarkIndex);
|
| 13 |
+
}
|
| 14 |
+
else {
|
| 15 |
+
return url.substring(questionMarkIndex, fragmentIndex);
|
| 16 |
+
}
|
| 17 |
+
}
|
dashboard/node_modules/@rolldown/pluginutils/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "@rolldown/pluginutils",
|
| 3 |
+
"version": "1.0.0-rc.17",
|
| 4 |
+
"homepage": "https://rolldown.rs/",
|
| 5 |
+
"license": "MIT",
|
| 6 |
+
"repository": {
|
| 7 |
+
"type": "git",
|
| 8 |
+
"url": "git+https://github.com/rolldown/rolldown.git",
|
| 9 |
+
"directory": "packages/pluginutils"
|
| 10 |
+
},
|
| 11 |
+
"files": [
|
| 12 |
+
"dist"
|
| 13 |
+
],
|
| 14 |
+
"type": "module",
|
| 15 |
+
"main": "./dist/index.js",
|
| 16 |
+
"module": "./dist/index.js",
|
| 17 |
+
"types": "./dist/index.d.ts",
|
| 18 |
+
"exports": {
|
| 19 |
+
".": "./dist/index.js",
|
| 20 |
+
"./filter": "./dist/filter/index.js",
|
| 21 |
+
"./package.json": "./package.json"
|
| 22 |
+
},
|
| 23 |
+
"publishConfig": {
|
| 24 |
+
"access": "public"
|
| 25 |
+
},
|
| 26 |
+
"devDependencies": {
|
| 27 |
+
"@types/picomatch": "^4.0.0",
|
| 28 |
+
"picomatch": "^4.0.2",
|
| 29 |
+
"typescript": "^6.0.0",
|
| 30 |
+
"vitest": "^4.0.15"
|
| 31 |
+
},
|
| 32 |
+
"scripts": {
|
| 33 |
+
"build": "tsc",
|
| 34 |
+
"test": "vitest --typecheck",
|
| 35 |
+
"publint": "publint ."
|
| 36 |
+
}
|
| 37 |
+
}
|
dashboard/node_modules/detect-libc/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all
|
| 16 |
+
other entities that control, are controlled by, or are under common
|
| 17 |
+
control with that entity. For the purposes of this definition,
|
| 18 |
+
"control" means (i) the power, direct or indirect, to cause the
|
| 19 |
+
direction or management of such entity, whether by contract or
|
| 20 |
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
| 21 |
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
| 22 |
+
|
| 23 |
+
"You" (or "Your") shall mean an individual or Legal Entity
|
| 24 |
+
exercising permissions granted by this License.
|
| 25 |
+
|
| 26 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 27 |
+
including but not limited to software source code, documentation
|
| 28 |
+
source, and configuration files.
|
| 29 |
+
|
| 30 |
+
"Object" form shall mean any form resulting from mechanical
|
| 31 |
+
transformation or translation of a Source form, including but
|
| 32 |
+
not limited to compiled object code, generated documentation,
|
| 33 |
+
and conversions to other media types.
|
| 34 |
+
|
| 35 |
+
"Work" shall mean the work of authorship, whether in Source or
|
| 36 |
+
Object form, made available under the License, as indicated by a
|
| 37 |
+
copyright notice that is included in or attached to the work
|
| 38 |
+
(an example is provided in the Appendix below).
|
| 39 |
+
|
| 40 |
+
"Derivative Works" shall mean any work, whether in Source or Object
|
| 41 |
+
form, that is based on (or derived from) the Work and for which the
|
| 42 |
+
editorial revisions, annotations, elaborations, or other modifications
|
| 43 |
+
represent, as a whole, an original work of authorship. For the purposes
|
| 44 |
+
of this License, Derivative Works shall not include works that remain
|
| 45 |
+
separable from, or merely link (or bind by name) to the interfaces of,
|
| 46 |
+
the Work and Derivative Works thereof.
|
| 47 |
+
|
| 48 |
+
"Contribution" shall mean any work of authorship, including
|
| 49 |
+
the original version of the Work and any modifications or additions
|
| 50 |
+
to that Work or Derivative Works thereof, that is intentionally
|
| 51 |
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
| 52 |
+
or by an individual or Legal Entity authorized to submit on behalf of
|
| 53 |
+
the copyright owner. For the purposes of this definition, "submitted"
|
| 54 |
+
means any form of electronic, verbal, or written communication sent
|
| 55 |
+
to the Licensor or its representatives, including but not limited to
|
| 56 |
+
communication on electronic mailing lists, source code control systems,
|
| 57 |
+
and issue tracking systems that are managed by, or on behalf of, the
|
| 58 |
+
Licensor for the purpose of discussing and improving the Work, but
|
| 59 |
+
excluding communication that is conspicuously marked or otherwise
|
| 60 |
+
designated in writing by the copyright owner as "Not a Contribution."
|
| 61 |
+
|
| 62 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
| 63 |
+
on behalf of whom a Contribution has been received by Licensor and
|
| 64 |
+
subsequently incorporated within the Work.
|
| 65 |
+
|
| 66 |
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
| 67 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 68 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 69 |
+
copyright license to reproduce, prepare Derivative Works of,
|
| 70 |
+
publicly display, publicly perform, sublicense, and distribute the
|
| 71 |
+
Work and such Derivative Works in Source or Object form.
|
| 72 |
+
|
| 73 |
+
3. Grant of Patent License. Subject to the terms and conditions of
|
| 74 |
+
this License, each Contributor hereby grants to You a perpetual,
|
| 75 |
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
| 76 |
+
(except as stated in this section) patent license to make, have made,
|
| 77 |
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
| 78 |
+
where such license applies only to those patent claims licensable
|
| 79 |
+
by such Contributor that are necessarily infringed by their
|
| 80 |
+
Contribution(s) alone or by combination of their Contribution(s)
|
| 81 |
+
with the Work to which such Contribution(s) was submitted. If You
|
| 82 |
+
institute patent litigation against any entity (including a
|
| 83 |
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
| 84 |
+
or a Contribution incorporated within the Work constitutes direct
|
| 85 |
+
or contributory patent infringement, then any patent licenses
|
| 86 |
+
granted to You under this License for that Work shall terminate
|
| 87 |
+
as of the date such litigation is filed.
|
| 88 |
+
|
| 89 |
+
4. Redistribution. You may reproduce and distribute copies of the
|
| 90 |
+
Work or Derivative Works thereof in any medium, with or without
|
| 91 |
+
modifications, and in Source or Object form, provided that You
|
| 92 |
+
meet the following conditions:
|
| 93 |
+
|
| 94 |
+
(a) You must give any other recipients of the Work or
|
| 95 |
+
Derivative Works a copy of this License; and
|
| 96 |
+
|
| 97 |
+
(b) You must cause any modified files to carry prominent notices
|
| 98 |
+
stating that You changed the files; and
|
| 99 |
+
|
| 100 |
+
(c) You must retain, in the Source form of any Derivative Works
|
| 101 |
+
that You distribute, all copyright, patent, trademark, and
|
| 102 |
+
attribution notices from the Source form of the Work,
|
| 103 |
+
excluding those notices that do not pertain to any part of
|
| 104 |
+
the Derivative Works; and
|
| 105 |
+
|
| 106 |
+
(d) If the Work includes a "NOTICE" text file as part of its
|
| 107 |
+
distribution, then any Derivative Works that You distribute must
|
| 108 |
+
include a readable copy of the attribution notices contained
|
| 109 |
+
within such NOTICE file, excluding those notices that do not
|
| 110 |
+
pertain to any part of the Derivative Works, in at least one
|
| 111 |
+
of the following places: within a NOTICE text file distributed
|
| 112 |
+
as part of the Derivative Works; within the Source form or
|
| 113 |
+
documentation, if provided along with the Derivative Works; or,
|
| 114 |
+
within a display generated by the Derivative Works, if and
|
| 115 |
+
wherever such third-party notices normally appear. The contents
|
| 116 |
+
of the NOTICE file are for informational purposes only and
|
| 117 |
+
do not modify the License. You may add Your own attribution
|
| 118 |
+
notices within Derivative Works that You distribute, alongside
|
| 119 |
+
or as an addendum to the NOTICE text from the Work, provided
|
| 120 |
+
that such additional attribution notices cannot be construed
|
| 121 |
+
as modifying the License.
|
| 122 |
+
|
| 123 |
+
You may add Your own copyright statement to Your modifications and
|
| 124 |
+
may provide additional or different license terms and conditions
|
| 125 |
+
for use, reproduction, or distribution of Your modifications, or
|
| 126 |
+
for any such Derivative Works as a whole, provided Your use,
|
| 127 |
+
reproduction, and distribution of the Work otherwise complies with
|
| 128 |
+
the conditions stated in this License.
|
| 129 |
+
|
| 130 |
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
| 131 |
+
any Contribution intentionally submitted for inclusion in the Work
|
| 132 |
+
by You to the Licensor shall be under the terms and conditions of
|
| 133 |
+
this License, without any additional terms or conditions.
|
| 134 |
+
Notwithstanding the above, nothing herein shall supersede or modify
|
| 135 |
+
the terms of any separate license agreement you may have executed
|
| 136 |
+
with Licensor regarding such Contributions.
|
| 137 |
+
|
| 138 |
+
6. Trademarks. This License does not grant permission to use the trade
|
| 139 |
+
names, trademarks, service marks, or product names of the Licensor,
|
| 140 |
+
except as required for reasonable and customary use in describing the
|
| 141 |
+
origin of the Work and reproducing the content of the NOTICE file.
|
| 142 |
+
|
| 143 |
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
| 144 |
+
agreed to in writing, Licensor provides the Work (and each
|
| 145 |
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 146 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
| 147 |
+
implied, including, without limitation, any warranties or conditions
|
| 148 |
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
| 149 |
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
| 150 |
+
appropriateness of using or redistributing the Work and assume any
|
| 151 |
+
risks associated with Your exercise of permissions under this License.
|
| 152 |
+
|
| 153 |
+
8. Limitation of Liability. In no event and under no legal theory,
|
| 154 |
+
whether in tort (including negligence), contract, or otherwise,
|
| 155 |
+
unless required by applicable law (such as deliberate and grossly
|
| 156 |
+
negligent acts) or agreed to in writing, shall any Contributor be
|
| 157 |
+
liable to You for damages, including any direct, indirect, special,
|
| 158 |
+
incidental, or consequential damages of any character arising as a
|
| 159 |
+
result of this License or out of the use or inability to use the
|
| 160 |
+
Work (including but not limited to damages for loss of goodwill,
|
| 161 |
+
work stoppage, computer failure or malfunction, or any and all
|
| 162 |
+
other commercial damages or losses), even if such Contributor
|
| 163 |
+
has been advised of the possibility of such damages.
|
| 164 |
+
|
| 165 |
+
9. Accepting Warranty or Additional Liability. While redistributing
|
| 166 |
+
the Work or Derivative Works thereof, You may choose to offer,
|
| 167 |
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
| 168 |
+
or other liability obligations and/or rights consistent with this
|
| 169 |
+
License. However, in accepting such obligations, You may act only
|
| 170 |
+
on Your own behalf and on Your sole responsibility, not on behalf
|
| 171 |
+
of any other Contributor, and only if You agree to indemnify,
|
| 172 |
+
defend, and hold each Contributor harmless for any liability
|
| 173 |
+
incurred by, or claims asserted against, such Contributor by reason
|
| 174 |
+
of your accepting any such warranty or additional liability.
|
| 175 |
+
|
| 176 |
+
END OF TERMS AND CONDITIONS
|
| 177 |
+
|
| 178 |
+
APPENDIX: How to apply the Apache License to your work.
|
| 179 |
+
|
| 180 |
+
To apply the Apache License to your work, attach the following
|
| 181 |
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
| 182 |
+
replaced with your own identifying information. (Don't include
|
| 183 |
+
the brackets!) The text should be enclosed in the appropriate
|
| 184 |
+
comment syntax for the file format. We also recommend that a
|
| 185 |
+
file or class name and description of purpose be included on the
|
| 186 |
+
same "printed page" as the copyright notice for easier
|
| 187 |
+
identification within third-party archives.
|
| 188 |
+
|
| 189 |
+
Copyright {yyyy} {name of copyright owner}
|
| 190 |
+
|
| 191 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 192 |
+
you may not use this file except in compliance with the License.
|
| 193 |
+
You may obtain a copy of the License at
|
| 194 |
+
|
| 195 |
+
http://www.apache.org/licenses/LICENSE-2.0
|
| 196 |
+
|
| 197 |
+
Unless required by applicable law or agreed to in writing, software
|
| 198 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 199 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 200 |
+
See the License for the specific language governing permissions and
|
| 201 |
+
limitations under the License.
|
dashboard/node_modules/detect-libc/README.md
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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|
| 5 |
+
|
| 6 |
+
Currently supports detection of GNU glibc and MUSL libc.
|
| 7 |
+
|
| 8 |
+
Provides asychronous and synchronous functions for the
|
| 9 |
+
family (e.g. `glibc`, `musl`) and version (e.g. `1.23`, `1.2.3`).
|
| 10 |
+
|
| 11 |
+
The version numbers of libc implementations
|
| 12 |
+
are not guaranteed to be semver-compliant.
|
| 13 |
+
|
| 14 |
+
For previous v1.x releases, please see the
|
| 15 |
+
[v1](https://github.com/lovell/detect-libc/tree/v1) branch.
|
| 16 |
+
|
| 17 |
+
## Install
|
| 18 |
+
|
| 19 |
+
```sh
|
| 20 |
+
npm install detect-libc
|
| 21 |
+
```
|
| 22 |
+
|
| 23 |
+
## API
|
| 24 |
+
|
| 25 |
+
### GLIBC
|
| 26 |
+
|
| 27 |
+
```ts
|
| 28 |
+
const GLIBC: string = 'glibc';
|
| 29 |
+
```
|
| 30 |
+
|
| 31 |
+
A String constant containing the value `glibc`.
|
| 32 |
+
|
| 33 |
+
### MUSL
|
| 34 |
+
|
| 35 |
+
```ts
|
| 36 |
+
const MUSL: string = 'musl';
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
A String constant containing the value `musl`.
|
| 40 |
+
|
| 41 |
+
### family
|
| 42 |
+
|
| 43 |
+
```ts
|
| 44 |
+
function family(): Promise<string | null>;
|
| 45 |
+
```
|
| 46 |
+
|
| 47 |
+
Resolves asychronously with:
|
| 48 |
+
|
| 49 |
+
* `glibc` or `musl` when the libc family can be determined
|
| 50 |
+
* `null` when the libc family cannot be determined
|
| 51 |
+
* `null` when run on a non-Linux platform
|
| 52 |
+
|
| 53 |
+
```js
|
| 54 |
+
const { family, GLIBC, MUSL } = require('detect-libc');
|
| 55 |
+
|
| 56 |
+
switch (await family()) {
|
| 57 |
+
case GLIBC: ...
|
| 58 |
+
case MUSL: ...
|
| 59 |
+
case null: ...
|
| 60 |
+
}
|
| 61 |
+
```
|
| 62 |
+
|
| 63 |
+
### familySync
|
| 64 |
+
|
| 65 |
+
```ts
|
| 66 |
+
function familySync(): string | null;
|
| 67 |
+
```
|
| 68 |
+
|
| 69 |
+
Synchronous version of `family()`.
|
| 70 |
+
|
| 71 |
+
```js
|
| 72 |
+
const { familySync, GLIBC, MUSL } = require('detect-libc');
|
| 73 |
+
|
| 74 |
+
switch (familySync()) {
|
| 75 |
+
case GLIBC: ...
|
| 76 |
+
case MUSL: ...
|
| 77 |
+
case null: ...
|
| 78 |
+
}
|
| 79 |
+
```
|
| 80 |
+
|
| 81 |
+
### version
|
| 82 |
+
|
| 83 |
+
```ts
|
| 84 |
+
function version(): Promise<string | null>;
|
| 85 |
+
```
|
| 86 |
+
|
| 87 |
+
Resolves asychronously with:
|
| 88 |
+
|
| 89 |
+
* The version when it can be determined
|
| 90 |
+
* `null` when the libc family cannot be determined
|
| 91 |
+
* `null` when run on a non-Linux platform
|
| 92 |
+
|
| 93 |
+
```js
|
| 94 |
+
const { version } = require('detect-libc');
|
| 95 |
+
|
| 96 |
+
const v = await version();
|
| 97 |
+
if (v) {
|
| 98 |
+
const [major, minor, patch] = v.split('.');
|
| 99 |
+
}
|
| 100 |
+
```
|
| 101 |
+
|
| 102 |
+
### versionSync
|
| 103 |
+
|
| 104 |
+
```ts
|
| 105 |
+
function versionSync(): string | null;
|
| 106 |
+
```
|
| 107 |
+
|
| 108 |
+
Synchronous version of `version()`.
|
| 109 |
+
|
| 110 |
+
```js
|
| 111 |
+
const { versionSync } = require('detect-libc');
|
| 112 |
+
|
| 113 |
+
const v = versionSync();
|
| 114 |
+
if (v) {
|
| 115 |
+
const [major, minor, patch] = v.split('.');
|
| 116 |
+
}
|
| 117 |
+
```
|
| 118 |
+
|
| 119 |
+
### isNonGlibcLinux
|
| 120 |
+
|
| 121 |
+
```ts
|
| 122 |
+
function isNonGlibcLinux(): Promise<boolean>;
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
Resolves asychronously with:
|
| 126 |
+
|
| 127 |
+
* `false` when the libc family is `glibc`
|
| 128 |
+
* `true` when the libc family is not `glibc`
|
| 129 |
+
* `false` when run on a non-Linux platform
|
| 130 |
+
|
| 131 |
+
```js
|
| 132 |
+
const { isNonGlibcLinux } = require('detect-libc');
|
| 133 |
+
|
| 134 |
+
if (await isNonGlibcLinux()) { ... }
|
| 135 |
+
```
|
| 136 |
+
|
| 137 |
+
### isNonGlibcLinuxSync
|
| 138 |
+
|
| 139 |
+
```ts
|
| 140 |
+
function isNonGlibcLinuxSync(): boolean;
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
Synchronous version of `isNonGlibcLinux()`.
|
| 144 |
+
|
| 145 |
+
```js
|
| 146 |
+
const { isNonGlibcLinuxSync } = require('detect-libc');
|
| 147 |
+
|
| 148 |
+
if (isNonGlibcLinuxSync()) { ... }
|
| 149 |
+
```
|
| 150 |
+
|
| 151 |
+
## Licensing
|
| 152 |
+
|
| 153 |
+
Copyright 2017 Lovell Fuller and others.
|
| 154 |
+
|
| 155 |
+
Licensed under the Apache License, Version 2.0 (the "License");
|
| 156 |
+
you may not use this file except in compliance with the License.
|
| 157 |
+
You may obtain a copy of the License at [http://www.apache.org/licenses/LICENSE-2.0](http://www.apache.org/licenses/LICENSE-2.0.html)
|
| 158 |
+
|
| 159 |
+
Unless required by applicable law or agreed to in writing, software
|
| 160 |
+
distributed under the License is distributed on an "AS IS" BASIS,
|
| 161 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
| 162 |
+
See the License for the specific language governing permissions and
|
| 163 |
+
limitations under the License.
|
dashboard/node_modules/detect-libc/index.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2017 Lovell Fuller and others.
|
| 2 |
+
// SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
|
| 4 |
+
export const GLIBC: 'glibc';
|
| 5 |
+
export const MUSL: 'musl';
|
| 6 |
+
|
| 7 |
+
export function family(): Promise<string | null>;
|
| 8 |
+
export function familySync(): string | null;
|
| 9 |
+
|
| 10 |
+
export function isNonGlibcLinux(): Promise<boolean>;
|
| 11 |
+
export function isNonGlibcLinuxSync(): boolean;
|
| 12 |
+
|
| 13 |
+
export function version(): Promise<string | null>;
|
| 14 |
+
export function versionSync(): string | null;
|
dashboard/node_modules/detect-libc/lib/detect-libc.js
ADDED
|
@@ -0,0 +1,313 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2017 Lovell Fuller and others.
|
| 2 |
+
// SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
|
| 4 |
+
'use strict';
|
| 5 |
+
|
| 6 |
+
const childProcess = require('child_process');
|
| 7 |
+
const { isLinux, getReport } = require('./process');
|
| 8 |
+
const { LDD_PATH, SELF_PATH, readFile, readFileSync } = require('./filesystem');
|
| 9 |
+
const { interpreterPath } = require('./elf');
|
| 10 |
+
|
| 11 |
+
let cachedFamilyInterpreter;
|
| 12 |
+
let cachedFamilyFilesystem;
|
| 13 |
+
let cachedVersionFilesystem;
|
| 14 |
+
|
| 15 |
+
const command = 'getconf GNU_LIBC_VERSION 2>&1 || true; ldd --version 2>&1 || true';
|
| 16 |
+
let commandOut = '';
|
| 17 |
+
|
| 18 |
+
const safeCommand = () => {
|
| 19 |
+
if (!commandOut) {
|
| 20 |
+
return new Promise((resolve) => {
|
| 21 |
+
childProcess.exec(command, (err, out) => {
|
| 22 |
+
commandOut = err ? ' ' : out;
|
| 23 |
+
resolve(commandOut);
|
| 24 |
+
});
|
| 25 |
+
});
|
| 26 |
+
}
|
| 27 |
+
return commandOut;
|
| 28 |
+
};
|
| 29 |
+
|
| 30 |
+
const safeCommandSync = () => {
|
| 31 |
+
if (!commandOut) {
|
| 32 |
+
try {
|
| 33 |
+
commandOut = childProcess.execSync(command, { encoding: 'utf8' });
|
| 34 |
+
} catch (_err) {
|
| 35 |
+
commandOut = ' ';
|
| 36 |
+
}
|
| 37 |
+
}
|
| 38 |
+
return commandOut;
|
| 39 |
+
};
|
| 40 |
+
|
| 41 |
+
/**
|
| 42 |
+
* A String constant containing the value `glibc`.
|
| 43 |
+
* @type {string}
|
| 44 |
+
* @public
|
| 45 |
+
*/
|
| 46 |
+
const GLIBC = 'glibc';
|
| 47 |
+
|
| 48 |
+
/**
|
| 49 |
+
* A Regexp constant to get the GLIBC Version.
|
| 50 |
+
* @type {string}
|
| 51 |
+
*/
|
| 52 |
+
const RE_GLIBC_VERSION = /LIBC[a-z0-9 \-).]*?(\d+\.\d+)/i;
|
| 53 |
+
|
| 54 |
+
/**
|
| 55 |
+
* A String constant containing the value `musl`.
|
| 56 |
+
* @type {string}
|
| 57 |
+
* @public
|
| 58 |
+
*/
|
| 59 |
+
const MUSL = 'musl';
|
| 60 |
+
|
| 61 |
+
const isFileMusl = (f) => f.includes('libc.musl-') || f.includes('ld-musl-');
|
| 62 |
+
|
| 63 |
+
const familyFromReport = () => {
|
| 64 |
+
const report = getReport();
|
| 65 |
+
if (report.header && report.header.glibcVersionRuntime) {
|
| 66 |
+
return GLIBC;
|
| 67 |
+
}
|
| 68 |
+
if (Array.isArray(report.sharedObjects)) {
|
| 69 |
+
if (report.sharedObjects.some(isFileMusl)) {
|
| 70 |
+
return MUSL;
|
| 71 |
+
}
|
| 72 |
+
}
|
| 73 |
+
return null;
|
| 74 |
+
};
|
| 75 |
+
|
| 76 |
+
const familyFromCommand = (out) => {
|
| 77 |
+
const [getconf, ldd1] = out.split(/[\r\n]+/);
|
| 78 |
+
if (getconf && getconf.includes(GLIBC)) {
|
| 79 |
+
return GLIBC;
|
| 80 |
+
}
|
| 81 |
+
if (ldd1 && ldd1.includes(MUSL)) {
|
| 82 |
+
return MUSL;
|
| 83 |
+
}
|
| 84 |
+
return null;
|
| 85 |
+
};
|
| 86 |
+
|
| 87 |
+
const familyFromInterpreterPath = (path) => {
|
| 88 |
+
if (path) {
|
| 89 |
+
if (path.includes('/ld-musl-')) {
|
| 90 |
+
return MUSL;
|
| 91 |
+
} else if (path.includes('/ld-linux-')) {
|
| 92 |
+
return GLIBC;
|
| 93 |
+
}
|
| 94 |
+
}
|
| 95 |
+
return null;
|
| 96 |
+
};
|
| 97 |
+
|
| 98 |
+
const getFamilyFromLddContent = (content) => {
|
| 99 |
+
content = content.toString();
|
| 100 |
+
if (content.includes('musl')) {
|
| 101 |
+
return MUSL;
|
| 102 |
+
}
|
| 103 |
+
if (content.includes('GNU C Library')) {
|
| 104 |
+
return GLIBC;
|
| 105 |
+
}
|
| 106 |
+
return null;
|
| 107 |
+
};
|
| 108 |
+
|
| 109 |
+
const familyFromFilesystem = async () => {
|
| 110 |
+
if (cachedFamilyFilesystem !== undefined) {
|
| 111 |
+
return cachedFamilyFilesystem;
|
| 112 |
+
}
|
| 113 |
+
cachedFamilyFilesystem = null;
|
| 114 |
+
try {
|
| 115 |
+
const lddContent = await readFile(LDD_PATH);
|
| 116 |
+
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
| 117 |
+
} catch (e) {}
|
| 118 |
+
return cachedFamilyFilesystem;
|
| 119 |
+
};
|
| 120 |
+
|
| 121 |
+
const familyFromFilesystemSync = () => {
|
| 122 |
+
if (cachedFamilyFilesystem !== undefined) {
|
| 123 |
+
return cachedFamilyFilesystem;
|
| 124 |
+
}
|
| 125 |
+
cachedFamilyFilesystem = null;
|
| 126 |
+
try {
|
| 127 |
+
const lddContent = readFileSync(LDD_PATH);
|
| 128 |
+
cachedFamilyFilesystem = getFamilyFromLddContent(lddContent);
|
| 129 |
+
} catch (e) {}
|
| 130 |
+
return cachedFamilyFilesystem;
|
| 131 |
+
};
|
| 132 |
+
|
| 133 |
+
const familyFromInterpreter = async () => {
|
| 134 |
+
if (cachedFamilyInterpreter !== undefined) {
|
| 135 |
+
return cachedFamilyInterpreter;
|
| 136 |
+
}
|
| 137 |
+
cachedFamilyInterpreter = null;
|
| 138 |
+
try {
|
| 139 |
+
const selfContent = await readFile(SELF_PATH);
|
| 140 |
+
const path = interpreterPath(selfContent);
|
| 141 |
+
cachedFamilyInterpreter = familyFromInterpreterPath(path);
|
| 142 |
+
} catch (e) {}
|
| 143 |
+
return cachedFamilyInterpreter;
|
| 144 |
+
};
|
| 145 |
+
|
| 146 |
+
const familyFromInterpreterSync = () => {
|
| 147 |
+
if (cachedFamilyInterpreter !== undefined) {
|
| 148 |
+
return cachedFamilyInterpreter;
|
| 149 |
+
}
|
| 150 |
+
cachedFamilyInterpreter = null;
|
| 151 |
+
try {
|
| 152 |
+
const selfContent = readFileSync(SELF_PATH);
|
| 153 |
+
const path = interpreterPath(selfContent);
|
| 154 |
+
cachedFamilyInterpreter = familyFromInterpreterPath(path);
|
| 155 |
+
} catch (e) {}
|
| 156 |
+
return cachedFamilyInterpreter;
|
| 157 |
+
};
|
| 158 |
+
|
| 159 |
+
/**
|
| 160 |
+
* Resolves with the libc family when it can be determined, `null` otherwise.
|
| 161 |
+
* @returns {Promise<?string>}
|
| 162 |
+
*/
|
| 163 |
+
const family = async () => {
|
| 164 |
+
let family = null;
|
| 165 |
+
if (isLinux()) {
|
| 166 |
+
family = await familyFromInterpreter();
|
| 167 |
+
if (!family) {
|
| 168 |
+
family = await familyFromFilesystem();
|
| 169 |
+
if (!family) {
|
| 170 |
+
family = familyFromReport();
|
| 171 |
+
}
|
| 172 |
+
if (!family) {
|
| 173 |
+
const out = await safeCommand();
|
| 174 |
+
family = familyFromCommand(out);
|
| 175 |
+
}
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
+
return family;
|
| 179 |
+
};
|
| 180 |
+
|
| 181 |
+
/**
|
| 182 |
+
* Returns the libc family when it can be determined, `null` otherwise.
|
| 183 |
+
* @returns {?string}
|
| 184 |
+
*/
|
| 185 |
+
const familySync = () => {
|
| 186 |
+
let family = null;
|
| 187 |
+
if (isLinux()) {
|
| 188 |
+
family = familyFromInterpreterSync();
|
| 189 |
+
if (!family) {
|
| 190 |
+
family = familyFromFilesystemSync();
|
| 191 |
+
if (!family) {
|
| 192 |
+
family = familyFromReport();
|
| 193 |
+
}
|
| 194 |
+
if (!family) {
|
| 195 |
+
const out = safeCommandSync();
|
| 196 |
+
family = familyFromCommand(out);
|
| 197 |
+
}
|
| 198 |
+
}
|
| 199 |
+
}
|
| 200 |
+
return family;
|
| 201 |
+
};
|
| 202 |
+
|
| 203 |
+
/**
|
| 204 |
+
* Resolves `true` only when the platform is Linux and the libc family is not `glibc`.
|
| 205 |
+
* @returns {Promise<boolean>}
|
| 206 |
+
*/
|
| 207 |
+
const isNonGlibcLinux = async () => isLinux() && await family() !== GLIBC;
|
| 208 |
+
|
| 209 |
+
/**
|
| 210 |
+
* Returns `true` only when the platform is Linux and the libc family is not `glibc`.
|
| 211 |
+
* @returns {boolean}
|
| 212 |
+
*/
|
| 213 |
+
const isNonGlibcLinuxSync = () => isLinux() && familySync() !== GLIBC;
|
| 214 |
+
|
| 215 |
+
const versionFromFilesystem = async () => {
|
| 216 |
+
if (cachedVersionFilesystem !== undefined) {
|
| 217 |
+
return cachedVersionFilesystem;
|
| 218 |
+
}
|
| 219 |
+
cachedVersionFilesystem = null;
|
| 220 |
+
try {
|
| 221 |
+
const lddContent = await readFile(LDD_PATH);
|
| 222 |
+
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
| 223 |
+
if (versionMatch) {
|
| 224 |
+
cachedVersionFilesystem = versionMatch[1];
|
| 225 |
+
}
|
| 226 |
+
} catch (e) {}
|
| 227 |
+
return cachedVersionFilesystem;
|
| 228 |
+
};
|
| 229 |
+
|
| 230 |
+
const versionFromFilesystemSync = () => {
|
| 231 |
+
if (cachedVersionFilesystem !== undefined) {
|
| 232 |
+
return cachedVersionFilesystem;
|
| 233 |
+
}
|
| 234 |
+
cachedVersionFilesystem = null;
|
| 235 |
+
try {
|
| 236 |
+
const lddContent = readFileSync(LDD_PATH);
|
| 237 |
+
const versionMatch = lddContent.match(RE_GLIBC_VERSION);
|
| 238 |
+
if (versionMatch) {
|
| 239 |
+
cachedVersionFilesystem = versionMatch[1];
|
| 240 |
+
}
|
| 241 |
+
} catch (e) {}
|
| 242 |
+
return cachedVersionFilesystem;
|
| 243 |
+
};
|
| 244 |
+
|
| 245 |
+
const versionFromReport = () => {
|
| 246 |
+
const report = getReport();
|
| 247 |
+
if (report.header && report.header.glibcVersionRuntime) {
|
| 248 |
+
return report.header.glibcVersionRuntime;
|
| 249 |
+
}
|
| 250 |
+
return null;
|
| 251 |
+
};
|
| 252 |
+
|
| 253 |
+
const versionSuffix = (s) => s.trim().split(/\s+/)[1];
|
| 254 |
+
|
| 255 |
+
const versionFromCommand = (out) => {
|
| 256 |
+
const [getconf, ldd1, ldd2] = out.split(/[\r\n]+/);
|
| 257 |
+
if (getconf && getconf.includes(GLIBC)) {
|
| 258 |
+
return versionSuffix(getconf);
|
| 259 |
+
}
|
| 260 |
+
if (ldd1 && ldd2 && ldd1.includes(MUSL)) {
|
| 261 |
+
return versionSuffix(ldd2);
|
| 262 |
+
}
|
| 263 |
+
return null;
|
| 264 |
+
};
|
| 265 |
+
|
| 266 |
+
/**
|
| 267 |
+
* Resolves with the libc version when it can be determined, `null` otherwise.
|
| 268 |
+
* @returns {Promise<?string>}
|
| 269 |
+
*/
|
| 270 |
+
const version = async () => {
|
| 271 |
+
let version = null;
|
| 272 |
+
if (isLinux()) {
|
| 273 |
+
version = await versionFromFilesystem();
|
| 274 |
+
if (!version) {
|
| 275 |
+
version = versionFromReport();
|
| 276 |
+
}
|
| 277 |
+
if (!version) {
|
| 278 |
+
const out = await safeCommand();
|
| 279 |
+
version = versionFromCommand(out);
|
| 280 |
+
}
|
| 281 |
+
}
|
| 282 |
+
return version;
|
| 283 |
+
};
|
| 284 |
+
|
| 285 |
+
/**
|
| 286 |
+
* Returns the libc version when it can be determined, `null` otherwise.
|
| 287 |
+
* @returns {?string}
|
| 288 |
+
*/
|
| 289 |
+
const versionSync = () => {
|
| 290 |
+
let version = null;
|
| 291 |
+
if (isLinux()) {
|
| 292 |
+
version = versionFromFilesystemSync();
|
| 293 |
+
if (!version) {
|
| 294 |
+
version = versionFromReport();
|
| 295 |
+
}
|
| 296 |
+
if (!version) {
|
| 297 |
+
const out = safeCommandSync();
|
| 298 |
+
version = versionFromCommand(out);
|
| 299 |
+
}
|
| 300 |
+
}
|
| 301 |
+
return version;
|
| 302 |
+
};
|
| 303 |
+
|
| 304 |
+
module.exports = {
|
| 305 |
+
GLIBC,
|
| 306 |
+
MUSL,
|
| 307 |
+
family,
|
| 308 |
+
familySync,
|
| 309 |
+
isNonGlibcLinux,
|
| 310 |
+
isNonGlibcLinuxSync,
|
| 311 |
+
version,
|
| 312 |
+
versionSync
|
| 313 |
+
};
|
dashboard/node_modules/detect-libc/lib/elf.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2017 Lovell Fuller and others.
|
| 2 |
+
// SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
|
| 4 |
+
'use strict';
|
| 5 |
+
|
| 6 |
+
const interpreterPath = (elf) => {
|
| 7 |
+
if (elf.length < 64) {
|
| 8 |
+
return null;
|
| 9 |
+
}
|
| 10 |
+
if (elf.readUInt32BE(0) !== 0x7F454C46) {
|
| 11 |
+
// Unexpected magic bytes
|
| 12 |
+
return null;
|
| 13 |
+
}
|
| 14 |
+
if (elf.readUInt8(4) !== 2) {
|
| 15 |
+
// Not a 64-bit ELF
|
| 16 |
+
return null;
|
| 17 |
+
}
|
| 18 |
+
if (elf.readUInt8(5) !== 1) {
|
| 19 |
+
// Not little-endian
|
| 20 |
+
return null;
|
| 21 |
+
}
|
| 22 |
+
const offset = elf.readUInt32LE(32);
|
| 23 |
+
const size = elf.readUInt16LE(54);
|
| 24 |
+
const count = elf.readUInt16LE(56);
|
| 25 |
+
for (let i = 0; i < count; i++) {
|
| 26 |
+
const headerOffset = offset + (i * size);
|
| 27 |
+
const type = elf.readUInt32LE(headerOffset);
|
| 28 |
+
if (type === 3) {
|
| 29 |
+
const fileOffset = elf.readUInt32LE(headerOffset + 8);
|
| 30 |
+
const fileSize = elf.readUInt32LE(headerOffset + 32);
|
| 31 |
+
return elf.subarray(fileOffset, fileOffset + fileSize).toString().replace(/\0.*$/g, '');
|
| 32 |
+
}
|
| 33 |
+
}
|
| 34 |
+
return null;
|
| 35 |
+
};
|
| 36 |
+
|
| 37 |
+
module.exports = {
|
| 38 |
+
interpreterPath
|
| 39 |
+
};
|
dashboard/node_modules/detect-libc/lib/filesystem.js
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2017 Lovell Fuller and others.
|
| 2 |
+
// SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
|
| 4 |
+
'use strict';
|
| 5 |
+
|
| 6 |
+
const fs = require('fs');
|
| 7 |
+
|
| 8 |
+
const LDD_PATH = '/usr/bin/ldd';
|
| 9 |
+
const SELF_PATH = '/proc/self/exe';
|
| 10 |
+
const MAX_LENGTH = 2048;
|
| 11 |
+
|
| 12 |
+
/**
|
| 13 |
+
* Read the content of a file synchronous
|
| 14 |
+
*
|
| 15 |
+
* @param {string} path
|
| 16 |
+
* @returns {Buffer}
|
| 17 |
+
*/
|
| 18 |
+
const readFileSync = (path) => {
|
| 19 |
+
const fd = fs.openSync(path, 'r');
|
| 20 |
+
const buffer = Buffer.alloc(MAX_LENGTH);
|
| 21 |
+
const bytesRead = fs.readSync(fd, buffer, 0, MAX_LENGTH, 0);
|
| 22 |
+
fs.close(fd, () => {});
|
| 23 |
+
return buffer.subarray(0, bytesRead);
|
| 24 |
+
};
|
| 25 |
+
|
| 26 |
+
/**
|
| 27 |
+
* Read the content of a file
|
| 28 |
+
*
|
| 29 |
+
* @param {string} path
|
| 30 |
+
* @returns {Promise<Buffer>}
|
| 31 |
+
*/
|
| 32 |
+
const readFile = (path) => new Promise((resolve, reject) => {
|
| 33 |
+
fs.open(path, 'r', (err, fd) => {
|
| 34 |
+
if (err) {
|
| 35 |
+
reject(err);
|
| 36 |
+
} else {
|
| 37 |
+
const buffer = Buffer.alloc(MAX_LENGTH);
|
| 38 |
+
fs.read(fd, buffer, 0, MAX_LENGTH, 0, (_, bytesRead) => {
|
| 39 |
+
resolve(buffer.subarray(0, bytesRead));
|
| 40 |
+
fs.close(fd, () => {});
|
| 41 |
+
});
|
| 42 |
+
}
|
| 43 |
+
});
|
| 44 |
+
});
|
| 45 |
+
|
| 46 |
+
module.exports = {
|
| 47 |
+
LDD_PATH,
|
| 48 |
+
SELF_PATH,
|
| 49 |
+
readFileSync,
|
| 50 |
+
readFile
|
| 51 |
+
};
|
dashboard/node_modules/detect-libc/lib/process.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
// Copyright 2017 Lovell Fuller and others.
|
| 2 |
+
// SPDX-License-Identifier: Apache-2.0
|
| 3 |
+
|
| 4 |
+
'use strict';
|
| 5 |
+
|
| 6 |
+
const isLinux = () => process.platform === 'linux';
|
| 7 |
+
|
| 8 |
+
let report = null;
|
| 9 |
+
const getReport = () => {
|
| 10 |
+
if (!report) {
|
| 11 |
+
/* istanbul ignore next */
|
| 12 |
+
if (isLinux() && process.report) {
|
| 13 |
+
const orig = process.report.excludeNetwork;
|
| 14 |
+
process.report.excludeNetwork = true;
|
| 15 |
+
report = process.report.getReport();
|
| 16 |
+
process.report.excludeNetwork = orig;
|
| 17 |
+
} else {
|
| 18 |
+
report = {};
|
| 19 |
+
}
|
| 20 |
+
}
|
| 21 |
+
return report;
|
| 22 |
+
};
|
| 23 |
+
|
| 24 |
+
module.exports = { isLinux, getReport };
|
dashboard/node_modules/detect-libc/package.json
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"name": "detect-libc",
|
| 3 |
+
"version": "2.1.2",
|
| 4 |
+
"description": "Node.js module to detect the C standard library (libc) implementation family and version",
|
| 5 |
+
"main": "lib/detect-libc.js",
|
| 6 |
+
"files": [
|
| 7 |
+
"lib/",
|
| 8 |
+
"index.d.ts"
|
| 9 |
+
],
|
| 10 |
+
"scripts": {
|
| 11 |
+
"test": "semistandard && nyc --reporter=text --check-coverage --branches=100 ava test/unit.js",
|
| 12 |
+
"changelog": "conventional-changelog -i CHANGELOG.md -s",
|
| 13 |
+
"bench": "node benchmark/detect-libc",
|
| 14 |
+
"bench:calls": "node benchmark/call-familySync.js && sleep 1 && node benchmark/call-isNonGlibcLinuxSync.js && sleep 1 && node benchmark/call-versionSync.js"
|
| 15 |
+
},
|
| 16 |
+
"repository": {
|
| 17 |
+
"type": "git",
|
| 18 |
+
"url": "git://github.com/lovell/detect-libc.git"
|
| 19 |
+
},
|
| 20 |
+
"keywords": [
|
| 21 |
+
"libc",
|
| 22 |
+
"glibc",
|
| 23 |
+
"musl"
|
| 24 |
+
],
|
| 25 |
+
"author": "Lovell Fuller <npm@lovell.info>",
|
| 26 |
+
"contributors": [
|
| 27 |
+
"Niklas Salmoukas <niklas@salmoukas.com>",
|
| 28 |
+
"Vinícius Lourenço <vinyygamerlol@gmail.com>"
|
| 29 |
+
],
|
| 30 |
+
"license": "Apache-2.0",
|
| 31 |
+
"devDependencies": {
|
| 32 |
+
"ava": "^2.4.0",
|
| 33 |
+
"benchmark": "^2.1.4",
|
| 34 |
+
"conventional-changelog-cli": "^5.0.0",
|
| 35 |
+
"eslint-config-standard": "^13.0.1",
|
| 36 |
+
"nyc": "^15.1.0",
|
| 37 |
+
"proxyquire": "^2.1.3",
|
| 38 |
+
"semistandard": "^14.2.3"
|
| 39 |
+
},
|
| 40 |
+
"engines": {
|
| 41 |
+
"node": ">=8"
|
| 42 |
+
},
|
| 43 |
+
"types": "index.d.ts"
|
| 44 |
+
}
|
dashboard/node_modules/fdir/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Copyright 2023 Abdullah Atta
|
| 2 |
+
|
| 3 |
+
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:
|
| 4 |
+
|
| 5 |
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
| 6 |
+
|
| 7 |
+
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.
|
dashboard/node_modules/fdir/README.md
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
<p align="center">
|
| 2 |
+
<img src="https://github.com/thecodrr/fdir/raw/master/assets/fdir.gif" width="75%"/>
|
| 3 |
+
|
| 4 |
+
<h1 align="center">The Fastest Directory Crawler & Globber for NodeJS</h1>
|
| 5 |
+
<p align="center">
|
| 6 |
+
<a href="https://www.npmjs.com/package/fdir"><img src="https://img.shields.io/npm/v/fdir?style=for-the-badge"/></a>
|
| 7 |
+
<a href="https://www.npmjs.com/package/fdir"><img src="https://img.shields.io/npm/dw/fdir?style=for-the-badge"/></a>
|
| 8 |
+
<a href="https://codeclimate.com/github/thecodrr/fdir/maintainability"><img src="https://img.shields.io/codeclimate/maintainability-percentage/thecodrr/fdir?style=for-the-badge"/></a>
|
| 9 |
+
<a href="https://coveralls.io/github/thecodrr/fdir?branch=master"><img src="https://img.shields.io/coveralls/github/thecodrr/fdir?style=for-the-badge"/></a>
|
| 10 |
+
<a href="https://www.npmjs.com/package/fdir"><img src="https://img.shields.io/bundlephobia/minzip/fdir?style=for-the-badge"/></a>
|
| 11 |
+
<a href="https://www.producthunt.com/posts/fdir-every-millisecond-matters"><img src="https://img.shields.io/badge/ProductHunt-Upvote-red?style=for-the-badge&logo=product-hunt"/></a>
|
| 12 |
+
<a href="https://dev.to/thecodrr/how-i-wrote-the-fastest-directory-crawler-ever-3p9c"><img src="https://img.shields.io/badge/dev.to-Read%20Blog-black?style=for-the-badge&logo=dev.to"/></a>
|
| 13 |
+
<a href="./LICENSE"><img src="https://img.shields.io/github/license/thecodrr/fdir?style=for-the-badge"/></a>
|
| 14 |
+
</p>
|
| 15 |
+
</p>
|
| 16 |
+
|
| 17 |
+
⚡ **The Fastest:** Nothing similar (in the NodeJS world) beats `fdir` in speed. It can easily crawl a directory containing **1 million files in < 1 second.**
|
| 18 |
+
|
| 19 |
+
💡 **Stupidly Easy:** `fdir` uses expressive Builder pattern to build the crawler increasing code readability.
|
| 20 |
+
|
| 21 |
+
🤖 **Zero Dependencies\*:** `fdir` only uses NodeJS `fs` & `path` modules.
|
| 22 |
+
|
| 23 |
+
🕺 **Astonishingly Small:** < 2KB in size gzipped & minified.
|
| 24 |
+
|
| 25 |
+
🖮 **Hackable:** Extending `fdir` is extremely simple now that the new Builder API is here. Feel free to experiment around.
|
| 26 |
+
|
| 27 |
+
_\* `picomatch` must be installed manually by the user to support globbing._
|
| 28 |
+
|
| 29 |
+
## 🚄 Quickstart
|
| 30 |
+
|
| 31 |
+
### Installation
|
| 32 |
+
|
| 33 |
+
You can install using `npm`:
|
| 34 |
+
|
| 35 |
+
```sh
|
| 36 |
+
$ npm i fdir
|
| 37 |
+
```
|
| 38 |
+
|
| 39 |
+
or Yarn:
|
| 40 |
+
|
| 41 |
+
```sh
|
| 42 |
+
$ yarn add fdir
|
| 43 |
+
```
|
| 44 |
+
|
| 45 |
+
### Usage
|
| 46 |
+
|
| 47 |
+
```ts
|
| 48 |
+
import { fdir } from "fdir";
|
| 49 |
+
|
| 50 |
+
// create the builder
|
| 51 |
+
const api = new fdir().withFullPaths().crawl("path/to/dir");
|
| 52 |
+
|
| 53 |
+
// get all files in a directory synchronously
|
| 54 |
+
const files = api.sync();
|
| 55 |
+
|
| 56 |
+
// or asynchronously
|
| 57 |
+
api.withPromise().then((files) => {
|
| 58 |
+
// do something with the result here.
|
| 59 |
+
});
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
## Documentation:
|
| 63 |
+
|
| 64 |
+
Documentation for all methods is available [here](/documentation.md).
|
| 65 |
+
|
| 66 |
+
## 📊 Benchmarks:
|
| 67 |
+
|
| 68 |
+
Please check the benchmark against the latest version [here](/BENCHMARKS.md).
|
| 69 |
+
|
| 70 |
+
## 🙏Used by:
|
| 71 |
+
|
| 72 |
+
`fdir` is downloaded over 200k+ times a week by projects around the world. Here's a list of some notable projects using `fdir` in production:
|
| 73 |
+
|
| 74 |
+
> Note: if you think your project should be here, feel free to open an issue. Notable is anything with a considerable amount of GitHub stars.
|
| 75 |
+
|
| 76 |
+
1. [rollup/plugins](https://github.com/rollup/plugins)
|
| 77 |
+
2. [SuperchupuDev/tinyglobby](https://github.com/SuperchupuDev/tinyglobby)
|
| 78 |
+
3. [pulumi/pulumi](https://github.com/pulumi/pulumi)
|
| 79 |
+
4. [dotenvx/dotenvx](https://github.com/dotenvx/dotenvx)
|
| 80 |
+
5. [mdn/yari](https://github.com/mdn/yari)
|
| 81 |
+
6. [streetwriters/notesnook](https://github.com/streetwriters/notesnook)
|
| 82 |
+
7. [imba/imba](https://github.com/imba/imba)
|
| 83 |
+
8. [moroshko/react-scanner](https://github.com/moroshko/react-scanner)
|
| 84 |
+
9. [netlify/build](https://github.com/netlify/build)
|
| 85 |
+
10. [yassinedoghri/astro-i18next](https://github.com/yassinedoghri/astro-i18next)
|
| 86 |
+
11. [selfrefactor/rambda](https://github.com/selfrefactor/rambda)
|
| 87 |
+
12. [whyboris/Video-Hub-App](https://github.com/whyboris/Video-Hub-App)
|
| 88 |
+
|
| 89 |
+
## 🦮 LICENSE
|
| 90 |
+
|
| 91 |
+
Copyright © 2024 Abdullah Atta under MIT. [Read full text here.](https://github.com/thecodrr/fdir/raw/master/LICENSE)
|
dashboard/node_modules/fdir/dist/index.cjs
ADDED
|
@@ -0,0 +1,588 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
//#region rolldown:runtime
|
| 2 |
+
var __create = Object.create;
|
| 3 |
+
var __defProp = Object.defineProperty;
|
| 4 |
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
| 5 |
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
| 6 |
+
var __getProtoOf = Object.getPrototypeOf;
|
| 7 |
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
| 8 |
+
var __copyProps = (to, from, except, desc) => {
|
| 9 |
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
| 10 |
+
key = keys[i];
|
| 11 |
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
| 12 |
+
get: ((k) => from[k]).bind(null, key),
|
| 13 |
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
| 14 |
+
});
|
| 15 |
+
}
|
| 16 |
+
return to;
|
| 17 |
+
};
|
| 18 |
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
| 19 |
+
value: mod,
|
| 20 |
+
enumerable: true
|
| 21 |
+
}) : target, mod));
|
| 22 |
+
|
| 23 |
+
//#endregion
|
| 24 |
+
const path = __toESM(require("path"));
|
| 25 |
+
const fs = __toESM(require("fs"));
|
| 26 |
+
|
| 27 |
+
//#region src/utils.ts
|
| 28 |
+
function cleanPath(path$1) {
|
| 29 |
+
let normalized = (0, path.normalize)(path$1);
|
| 30 |
+
if (normalized.length > 1 && normalized[normalized.length - 1] === path.sep) normalized = normalized.substring(0, normalized.length - 1);
|
| 31 |
+
return normalized;
|
| 32 |
+
}
|
| 33 |
+
const SLASHES_REGEX = /[\\/]/g;
|
| 34 |
+
function convertSlashes(path$1, separator) {
|
| 35 |
+
return path$1.replace(SLASHES_REGEX, separator);
|
| 36 |
+
}
|
| 37 |
+
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
| 38 |
+
function isRootDirectory(path$1) {
|
| 39 |
+
return path$1 === "/" || WINDOWS_ROOT_DIR_REGEX.test(path$1);
|
| 40 |
+
}
|
| 41 |
+
function normalizePath(path$1, options) {
|
| 42 |
+
const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
|
| 43 |
+
const pathNeedsCleaning = process.platform === "win32" && path$1.includes("/") || path$1.startsWith(".");
|
| 44 |
+
if (resolvePaths) path$1 = (0, path.resolve)(path$1);
|
| 45 |
+
if (normalizePath$1 || pathNeedsCleaning) path$1 = cleanPath(path$1);
|
| 46 |
+
if (path$1 === ".") return "";
|
| 47 |
+
const needsSeperator = path$1[path$1.length - 1] !== pathSeparator;
|
| 48 |
+
return convertSlashes(needsSeperator ? path$1 + pathSeparator : path$1, pathSeparator);
|
| 49 |
+
}
|
| 50 |
+
|
| 51 |
+
//#endregion
|
| 52 |
+
//#region src/api/functions/join-path.ts
|
| 53 |
+
function joinPathWithBasePath(filename, directoryPath) {
|
| 54 |
+
return directoryPath + filename;
|
| 55 |
+
}
|
| 56 |
+
function joinPathWithRelativePath(root, options) {
|
| 57 |
+
return function(filename, directoryPath) {
|
| 58 |
+
const sameRoot = directoryPath.startsWith(root);
|
| 59 |
+
if (sameRoot) return directoryPath.slice(root.length) + filename;
|
| 60 |
+
else return convertSlashes((0, path.relative)(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
| 61 |
+
};
|
| 62 |
+
}
|
| 63 |
+
function joinPath(filename) {
|
| 64 |
+
return filename;
|
| 65 |
+
}
|
| 66 |
+
function joinDirectoryPath(filename, directoryPath, separator) {
|
| 67 |
+
return directoryPath + filename + separator;
|
| 68 |
+
}
|
| 69 |
+
function build$7(root, options) {
|
| 70 |
+
const { relativePaths, includeBasePath } = options;
|
| 71 |
+
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
| 72 |
+
}
|
| 73 |
+
|
| 74 |
+
//#endregion
|
| 75 |
+
//#region src/api/functions/push-directory.ts
|
| 76 |
+
function pushDirectoryWithRelativePath(root) {
|
| 77 |
+
return function(directoryPath, paths) {
|
| 78 |
+
paths.push(directoryPath.substring(root.length) || ".");
|
| 79 |
+
};
|
| 80 |
+
}
|
| 81 |
+
function pushDirectoryFilterWithRelativePath(root) {
|
| 82 |
+
return function(directoryPath, paths, filters) {
|
| 83 |
+
const relativePath = directoryPath.substring(root.length) || ".";
|
| 84 |
+
if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath);
|
| 85 |
+
};
|
| 86 |
+
}
|
| 87 |
+
const pushDirectory = (directoryPath, paths) => {
|
| 88 |
+
paths.push(directoryPath || ".");
|
| 89 |
+
};
|
| 90 |
+
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
| 91 |
+
const path$1 = directoryPath || ".";
|
| 92 |
+
if (filters.every((filter) => filter(path$1, true))) paths.push(path$1);
|
| 93 |
+
};
|
| 94 |
+
const empty$2 = () => {};
|
| 95 |
+
function build$6(root, options) {
|
| 96 |
+
const { includeDirs, filters, relativePaths } = options;
|
| 97 |
+
if (!includeDirs) return empty$2;
|
| 98 |
+
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
| 99 |
+
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
| 100 |
+
}
|
| 101 |
+
|
| 102 |
+
//#endregion
|
| 103 |
+
//#region src/api/functions/push-file.ts
|
| 104 |
+
const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
|
| 105 |
+
if (filters.every((filter) => filter(filename, false))) counts.files++;
|
| 106 |
+
};
|
| 107 |
+
const pushFileFilter = (filename, paths, _counts, filters) => {
|
| 108 |
+
if (filters.every((filter) => filter(filename, false))) paths.push(filename);
|
| 109 |
+
};
|
| 110 |
+
const pushFileCount = (_filename, _paths, counts, _filters) => {
|
| 111 |
+
counts.files++;
|
| 112 |
+
};
|
| 113 |
+
const pushFile = (filename, paths) => {
|
| 114 |
+
paths.push(filename);
|
| 115 |
+
};
|
| 116 |
+
const empty$1 = () => {};
|
| 117 |
+
function build$5(options) {
|
| 118 |
+
const { excludeFiles, filters, onlyCounts } = options;
|
| 119 |
+
if (excludeFiles) return empty$1;
|
| 120 |
+
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
| 121 |
+
else if (onlyCounts) return pushFileCount;
|
| 122 |
+
else return pushFile;
|
| 123 |
+
}
|
| 124 |
+
|
| 125 |
+
//#endregion
|
| 126 |
+
//#region src/api/functions/get-array.ts
|
| 127 |
+
const getArray = (paths) => {
|
| 128 |
+
return paths;
|
| 129 |
+
};
|
| 130 |
+
const getArrayGroup = () => {
|
| 131 |
+
return [""].slice(0, 0);
|
| 132 |
+
};
|
| 133 |
+
function build$4(options) {
|
| 134 |
+
return options.group ? getArrayGroup : getArray;
|
| 135 |
+
}
|
| 136 |
+
|
| 137 |
+
//#endregion
|
| 138 |
+
//#region src/api/functions/group-files.ts
|
| 139 |
+
const groupFiles = (groups, directory, files) => {
|
| 140 |
+
groups.push({
|
| 141 |
+
directory,
|
| 142 |
+
files,
|
| 143 |
+
dir: directory
|
| 144 |
+
});
|
| 145 |
+
};
|
| 146 |
+
const empty = () => {};
|
| 147 |
+
function build$3(options) {
|
| 148 |
+
return options.group ? groupFiles : empty;
|
| 149 |
+
}
|
| 150 |
+
|
| 151 |
+
//#endregion
|
| 152 |
+
//#region src/api/functions/resolve-symlink.ts
|
| 153 |
+
const resolveSymlinksAsync = function(path$1, state, callback$1) {
|
| 154 |
+
const { queue, fs: fs$1, options: { suppressErrors } } = state;
|
| 155 |
+
queue.enqueue();
|
| 156 |
+
fs$1.realpath(path$1, (error, resolvedPath) => {
|
| 157 |
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
| 158 |
+
fs$1.stat(resolvedPath, (error$1, stat) => {
|
| 159 |
+
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
| 160 |
+
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return queue.dequeue(null, state);
|
| 161 |
+
callback$1(stat, resolvedPath);
|
| 162 |
+
queue.dequeue(null, state);
|
| 163 |
+
});
|
| 164 |
+
});
|
| 165 |
+
};
|
| 166 |
+
const resolveSymlinks = function(path$1, state, callback$1) {
|
| 167 |
+
const { queue, fs: fs$1, options: { suppressErrors } } = state;
|
| 168 |
+
queue.enqueue();
|
| 169 |
+
try {
|
| 170 |
+
const resolvedPath = fs$1.realpathSync(path$1);
|
| 171 |
+
const stat = fs$1.statSync(resolvedPath);
|
| 172 |
+
if (stat.isDirectory() && isRecursive(path$1, resolvedPath, state)) return;
|
| 173 |
+
callback$1(stat, resolvedPath);
|
| 174 |
+
} catch (e) {
|
| 175 |
+
if (!suppressErrors) throw e;
|
| 176 |
+
}
|
| 177 |
+
};
|
| 178 |
+
function build$2(options, isSynchronous) {
|
| 179 |
+
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
| 180 |
+
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
| 181 |
+
}
|
| 182 |
+
function isRecursive(path$1, resolved, state) {
|
| 183 |
+
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
| 184 |
+
let parent = (0, path.dirname)(path$1);
|
| 185 |
+
let depth = 1;
|
| 186 |
+
while (parent !== state.root && depth < 2) {
|
| 187 |
+
const resolvedPath = state.symlinks.get(parent);
|
| 188 |
+
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
| 189 |
+
if (isSameRoot) depth++;
|
| 190 |
+
else parent = (0, path.dirname)(parent);
|
| 191 |
+
}
|
| 192 |
+
state.symlinks.set(path$1, resolved);
|
| 193 |
+
return depth > 1;
|
| 194 |
+
}
|
| 195 |
+
function isRecursiveUsingRealPaths(resolved, state) {
|
| 196 |
+
return state.visited.includes(resolved + state.options.pathSeparator);
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
//#endregion
|
| 200 |
+
//#region src/api/functions/invoke-callback.ts
|
| 201 |
+
const onlyCountsSync = (state) => {
|
| 202 |
+
return state.counts;
|
| 203 |
+
};
|
| 204 |
+
const groupsSync = (state) => {
|
| 205 |
+
return state.groups;
|
| 206 |
+
};
|
| 207 |
+
const defaultSync = (state) => {
|
| 208 |
+
return state.paths;
|
| 209 |
+
};
|
| 210 |
+
const limitFilesSync = (state) => {
|
| 211 |
+
return state.paths.slice(0, state.options.maxFiles);
|
| 212 |
+
};
|
| 213 |
+
const onlyCountsAsync = (state, error, callback$1) => {
|
| 214 |
+
report(error, callback$1, state.counts, state.options.suppressErrors);
|
| 215 |
+
return null;
|
| 216 |
+
};
|
| 217 |
+
const defaultAsync = (state, error, callback$1) => {
|
| 218 |
+
report(error, callback$1, state.paths, state.options.suppressErrors);
|
| 219 |
+
return null;
|
| 220 |
+
};
|
| 221 |
+
const limitFilesAsync = (state, error, callback$1) => {
|
| 222 |
+
report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
| 223 |
+
return null;
|
| 224 |
+
};
|
| 225 |
+
const groupsAsync = (state, error, callback$1) => {
|
| 226 |
+
report(error, callback$1, state.groups, state.options.suppressErrors);
|
| 227 |
+
return null;
|
| 228 |
+
};
|
| 229 |
+
function report(error, callback$1, output, suppressErrors) {
|
| 230 |
+
if (error && !suppressErrors) callback$1(error, output);
|
| 231 |
+
else callback$1(null, output);
|
| 232 |
+
}
|
| 233 |
+
function build$1(options, isSynchronous) {
|
| 234 |
+
const { onlyCounts, group, maxFiles } = options;
|
| 235 |
+
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
| 236 |
+
else if (group) return isSynchronous ? groupsSync : groupsAsync;
|
| 237 |
+
else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
|
| 238 |
+
else return isSynchronous ? defaultSync : defaultAsync;
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
//#endregion
|
| 242 |
+
//#region src/api/functions/walk-directory.ts
|
| 243 |
+
const readdirOpts = { withFileTypes: true };
|
| 244 |
+
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
| 245 |
+
state.queue.enqueue();
|
| 246 |
+
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
| 247 |
+
const { fs: fs$1 } = state;
|
| 248 |
+
state.visited.push(crawlPath);
|
| 249 |
+
state.counts.directories++;
|
| 250 |
+
fs$1.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
|
| 251 |
+
callback$1(entries, directoryPath, currentDepth);
|
| 252 |
+
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
| 253 |
+
});
|
| 254 |
+
};
|
| 255 |
+
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
| 256 |
+
const { fs: fs$1 } = state;
|
| 257 |
+
if (currentDepth < 0) return;
|
| 258 |
+
state.visited.push(crawlPath);
|
| 259 |
+
state.counts.directories++;
|
| 260 |
+
let entries = [];
|
| 261 |
+
try {
|
| 262 |
+
entries = fs$1.readdirSync(crawlPath || ".", readdirOpts);
|
| 263 |
+
} catch (e) {
|
| 264 |
+
if (!state.options.suppressErrors) throw e;
|
| 265 |
+
}
|
| 266 |
+
callback$1(entries, directoryPath, currentDepth);
|
| 267 |
+
};
|
| 268 |
+
function build(isSynchronous) {
|
| 269 |
+
return isSynchronous ? walkSync : walkAsync;
|
| 270 |
+
}
|
| 271 |
+
|
| 272 |
+
//#endregion
|
| 273 |
+
//#region src/api/queue.ts
|
| 274 |
+
/**
|
| 275 |
+
* This is a custom stateless queue to track concurrent async fs calls.
|
| 276 |
+
* It increments a counter whenever a call is queued and decrements it
|
| 277 |
+
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
|
| 278 |
+
*/
|
| 279 |
+
var Queue = class {
|
| 280 |
+
count = 0;
|
| 281 |
+
constructor(onQueueEmpty) {
|
| 282 |
+
this.onQueueEmpty = onQueueEmpty;
|
| 283 |
+
}
|
| 284 |
+
enqueue() {
|
| 285 |
+
this.count++;
|
| 286 |
+
return this.count;
|
| 287 |
+
}
|
| 288 |
+
dequeue(error, output) {
|
| 289 |
+
if (this.onQueueEmpty && (--this.count <= 0 || error)) {
|
| 290 |
+
this.onQueueEmpty(error, output);
|
| 291 |
+
if (error) {
|
| 292 |
+
output.controller.abort();
|
| 293 |
+
this.onQueueEmpty = void 0;
|
| 294 |
+
}
|
| 295 |
+
}
|
| 296 |
+
}
|
| 297 |
+
};
|
| 298 |
+
|
| 299 |
+
//#endregion
|
| 300 |
+
//#region src/api/counter.ts
|
| 301 |
+
var Counter = class {
|
| 302 |
+
_files = 0;
|
| 303 |
+
_directories = 0;
|
| 304 |
+
set files(num) {
|
| 305 |
+
this._files = num;
|
| 306 |
+
}
|
| 307 |
+
get files() {
|
| 308 |
+
return this._files;
|
| 309 |
+
}
|
| 310 |
+
set directories(num) {
|
| 311 |
+
this._directories = num;
|
| 312 |
+
}
|
| 313 |
+
get directories() {
|
| 314 |
+
return this._directories;
|
| 315 |
+
}
|
| 316 |
+
/**
|
| 317 |
+
* @deprecated use `directories` instead
|
| 318 |
+
*/
|
| 319 |
+
/* c8 ignore next 3 */
|
| 320 |
+
get dirs() {
|
| 321 |
+
return this._directories;
|
| 322 |
+
}
|
| 323 |
+
};
|
| 324 |
+
|
| 325 |
+
//#endregion
|
| 326 |
+
//#region src/api/aborter.ts
|
| 327 |
+
/**
|
| 328 |
+
* AbortController is not supported on Node 14 so we use this until we can drop
|
| 329 |
+
* support for Node 14.
|
| 330 |
+
*/
|
| 331 |
+
var Aborter = class {
|
| 332 |
+
aborted = false;
|
| 333 |
+
abort() {
|
| 334 |
+
this.aborted = true;
|
| 335 |
+
}
|
| 336 |
+
};
|
| 337 |
+
|
| 338 |
+
//#endregion
|
| 339 |
+
//#region src/api/walker.ts
|
| 340 |
+
var Walker = class {
|
| 341 |
+
root;
|
| 342 |
+
isSynchronous;
|
| 343 |
+
state;
|
| 344 |
+
joinPath;
|
| 345 |
+
pushDirectory;
|
| 346 |
+
pushFile;
|
| 347 |
+
getArray;
|
| 348 |
+
groupFiles;
|
| 349 |
+
resolveSymlink;
|
| 350 |
+
walkDirectory;
|
| 351 |
+
callbackInvoker;
|
| 352 |
+
constructor(root, options, callback$1) {
|
| 353 |
+
this.isSynchronous = !callback$1;
|
| 354 |
+
this.callbackInvoker = build$1(options, this.isSynchronous);
|
| 355 |
+
this.root = normalizePath(root, options);
|
| 356 |
+
this.state = {
|
| 357 |
+
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
| 358 |
+
paths: [""].slice(0, 0),
|
| 359 |
+
groups: [],
|
| 360 |
+
counts: new Counter(),
|
| 361 |
+
options,
|
| 362 |
+
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
|
| 363 |
+
symlinks: /* @__PURE__ */ new Map(),
|
| 364 |
+
visited: [""].slice(0, 0),
|
| 365 |
+
controller: new Aborter(),
|
| 366 |
+
fs: options.fs || fs
|
| 367 |
+
};
|
| 368 |
+
this.joinPath = build$7(this.root, options);
|
| 369 |
+
this.pushDirectory = build$6(this.root, options);
|
| 370 |
+
this.pushFile = build$5(options);
|
| 371 |
+
this.getArray = build$4(options);
|
| 372 |
+
this.groupFiles = build$3(options);
|
| 373 |
+
this.resolveSymlink = build$2(options, this.isSynchronous);
|
| 374 |
+
this.walkDirectory = build(this.isSynchronous);
|
| 375 |
+
}
|
| 376 |
+
start() {
|
| 377 |
+
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
|
| 378 |
+
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
| 379 |
+
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
| 380 |
+
}
|
| 381 |
+
walk = (entries, directoryPath, depth) => {
|
| 382 |
+
const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
| 383 |
+
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
| 384 |
+
const files = this.getArray(this.state.paths);
|
| 385 |
+
for (let i = 0; i < entries.length; ++i) {
|
| 386 |
+
const entry = entries[i];
|
| 387 |
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
| 388 |
+
const filename = this.joinPath(entry.name, directoryPath);
|
| 389 |
+
this.pushFile(filename, files, this.state.counts, filters);
|
| 390 |
+
} else if (entry.isDirectory()) {
|
| 391 |
+
let path$1 = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
| 392 |
+
if (exclude && exclude(entry.name, path$1)) continue;
|
| 393 |
+
this.pushDirectory(path$1, paths, filters);
|
| 394 |
+
this.walkDirectory(this.state, path$1, path$1, depth - 1, this.walk);
|
| 395 |
+
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
| 396 |
+
let path$1 = joinPathWithBasePath(entry.name, directoryPath);
|
| 397 |
+
this.resolveSymlink(path$1, this.state, (stat, resolvedPath) => {
|
| 398 |
+
if (stat.isDirectory()) {
|
| 399 |
+
resolvedPath = normalizePath(resolvedPath, this.state.options);
|
| 400 |
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path$1 + pathSeparator)) return;
|
| 401 |
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path$1 + pathSeparator, depth - 1, this.walk);
|
| 402 |
+
} else {
|
| 403 |
+
resolvedPath = useRealPaths ? resolvedPath : path$1;
|
| 404 |
+
const filename = (0, path.basename)(resolvedPath);
|
| 405 |
+
const directoryPath$1 = normalizePath((0, path.dirname)(resolvedPath), this.state.options);
|
| 406 |
+
resolvedPath = this.joinPath(filename, directoryPath$1);
|
| 407 |
+
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
| 408 |
+
}
|
| 409 |
+
});
|
| 410 |
+
}
|
| 411 |
+
}
|
| 412 |
+
this.groupFiles(this.state.groups, directoryPath, files);
|
| 413 |
+
};
|
| 414 |
+
};
|
| 415 |
+
|
| 416 |
+
//#endregion
|
| 417 |
+
//#region src/api/async.ts
|
| 418 |
+
function promise(root, options) {
|
| 419 |
+
return new Promise((resolve$1, reject) => {
|
| 420 |
+
callback(root, options, (err, output) => {
|
| 421 |
+
if (err) return reject(err);
|
| 422 |
+
resolve$1(output);
|
| 423 |
+
});
|
| 424 |
+
});
|
| 425 |
+
}
|
| 426 |
+
function callback(root, options, callback$1) {
|
| 427 |
+
let walker = new Walker(root, options, callback$1);
|
| 428 |
+
walker.start();
|
| 429 |
+
}
|
| 430 |
+
|
| 431 |
+
//#endregion
|
| 432 |
+
//#region src/api/sync.ts
|
| 433 |
+
function sync(root, options) {
|
| 434 |
+
const walker = new Walker(root, options);
|
| 435 |
+
return walker.start();
|
| 436 |
+
}
|
| 437 |
+
|
| 438 |
+
//#endregion
|
| 439 |
+
//#region src/builder/api-builder.ts
|
| 440 |
+
var APIBuilder = class {
|
| 441 |
+
constructor(root, options) {
|
| 442 |
+
this.root = root;
|
| 443 |
+
this.options = options;
|
| 444 |
+
}
|
| 445 |
+
withPromise() {
|
| 446 |
+
return promise(this.root, this.options);
|
| 447 |
+
}
|
| 448 |
+
withCallback(cb) {
|
| 449 |
+
callback(this.root, this.options, cb);
|
| 450 |
+
}
|
| 451 |
+
sync() {
|
| 452 |
+
return sync(this.root, this.options);
|
| 453 |
+
}
|
| 454 |
+
};
|
| 455 |
+
|
| 456 |
+
//#endregion
|
| 457 |
+
//#region src/builder/index.ts
|
| 458 |
+
let pm = null;
|
| 459 |
+
/* c8 ignore next 6 */
|
| 460 |
+
try {
|
| 461 |
+
require.resolve("picomatch");
|
| 462 |
+
pm = require("picomatch");
|
| 463 |
+
} catch {}
|
| 464 |
+
var Builder = class {
|
| 465 |
+
globCache = {};
|
| 466 |
+
options = {
|
| 467 |
+
maxDepth: Infinity,
|
| 468 |
+
suppressErrors: true,
|
| 469 |
+
pathSeparator: path.sep,
|
| 470 |
+
filters: []
|
| 471 |
+
};
|
| 472 |
+
globFunction;
|
| 473 |
+
constructor(options) {
|
| 474 |
+
this.options = {
|
| 475 |
+
...this.options,
|
| 476 |
+
...options
|
| 477 |
+
};
|
| 478 |
+
this.globFunction = this.options.globFunction;
|
| 479 |
+
}
|
| 480 |
+
group() {
|
| 481 |
+
this.options.group = true;
|
| 482 |
+
return this;
|
| 483 |
+
}
|
| 484 |
+
withPathSeparator(separator) {
|
| 485 |
+
this.options.pathSeparator = separator;
|
| 486 |
+
return this;
|
| 487 |
+
}
|
| 488 |
+
withBasePath() {
|
| 489 |
+
this.options.includeBasePath = true;
|
| 490 |
+
return this;
|
| 491 |
+
}
|
| 492 |
+
withRelativePaths() {
|
| 493 |
+
this.options.relativePaths = true;
|
| 494 |
+
return this;
|
| 495 |
+
}
|
| 496 |
+
withDirs() {
|
| 497 |
+
this.options.includeDirs = true;
|
| 498 |
+
return this;
|
| 499 |
+
}
|
| 500 |
+
withMaxDepth(depth) {
|
| 501 |
+
this.options.maxDepth = depth;
|
| 502 |
+
return this;
|
| 503 |
+
}
|
| 504 |
+
withMaxFiles(limit) {
|
| 505 |
+
this.options.maxFiles = limit;
|
| 506 |
+
return this;
|
| 507 |
+
}
|
| 508 |
+
withFullPaths() {
|
| 509 |
+
this.options.resolvePaths = true;
|
| 510 |
+
this.options.includeBasePath = true;
|
| 511 |
+
return this;
|
| 512 |
+
}
|
| 513 |
+
withErrors() {
|
| 514 |
+
this.options.suppressErrors = false;
|
| 515 |
+
return this;
|
| 516 |
+
}
|
| 517 |
+
withSymlinks({ resolvePaths = true } = {}) {
|
| 518 |
+
this.options.resolveSymlinks = true;
|
| 519 |
+
this.options.useRealPaths = resolvePaths;
|
| 520 |
+
return this.withFullPaths();
|
| 521 |
+
}
|
| 522 |
+
withAbortSignal(signal) {
|
| 523 |
+
this.options.signal = signal;
|
| 524 |
+
return this;
|
| 525 |
+
}
|
| 526 |
+
normalize() {
|
| 527 |
+
this.options.normalizePath = true;
|
| 528 |
+
return this;
|
| 529 |
+
}
|
| 530 |
+
filter(predicate) {
|
| 531 |
+
this.options.filters.push(predicate);
|
| 532 |
+
return this;
|
| 533 |
+
}
|
| 534 |
+
onlyDirs() {
|
| 535 |
+
this.options.excludeFiles = true;
|
| 536 |
+
this.options.includeDirs = true;
|
| 537 |
+
return this;
|
| 538 |
+
}
|
| 539 |
+
exclude(predicate) {
|
| 540 |
+
this.options.exclude = predicate;
|
| 541 |
+
return this;
|
| 542 |
+
}
|
| 543 |
+
onlyCounts() {
|
| 544 |
+
this.options.onlyCounts = true;
|
| 545 |
+
return this;
|
| 546 |
+
}
|
| 547 |
+
crawl(root) {
|
| 548 |
+
return new APIBuilder(root || ".", this.options);
|
| 549 |
+
}
|
| 550 |
+
withGlobFunction(fn) {
|
| 551 |
+
this.globFunction = fn;
|
| 552 |
+
return this;
|
| 553 |
+
}
|
| 554 |
+
/**
|
| 555 |
+
* @deprecated Pass options using the constructor instead:
|
| 556 |
+
* ```ts
|
| 557 |
+
* new fdir(options).crawl("/path/to/root");
|
| 558 |
+
* ```
|
| 559 |
+
* This method will be removed in v7.0
|
| 560 |
+
*/
|
| 561 |
+
/* c8 ignore next 4 */
|
| 562 |
+
crawlWithOptions(root, options) {
|
| 563 |
+
this.options = {
|
| 564 |
+
...this.options,
|
| 565 |
+
...options
|
| 566 |
+
};
|
| 567 |
+
return new APIBuilder(root || ".", this.options);
|
| 568 |
+
}
|
| 569 |
+
glob(...patterns) {
|
| 570 |
+
if (this.globFunction) return this.globWithOptions(patterns);
|
| 571 |
+
return this.globWithOptions(patterns, ...[{ dot: true }]);
|
| 572 |
+
}
|
| 573 |
+
globWithOptions(patterns, ...options) {
|
| 574 |
+
const globFn = this.globFunction || pm;
|
| 575 |
+
/* c8 ignore next 5 */
|
| 576 |
+
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
| 577 |
+
var isMatch = this.globCache[patterns.join("\0")];
|
| 578 |
+
if (!isMatch) {
|
| 579 |
+
isMatch = globFn(patterns, ...options);
|
| 580 |
+
this.globCache[patterns.join("\0")] = isMatch;
|
| 581 |
+
}
|
| 582 |
+
this.options.filters.push((path$1) => isMatch(path$1));
|
| 583 |
+
return this;
|
| 584 |
+
}
|
| 585 |
+
};
|
| 586 |
+
|
| 587 |
+
//#endregion
|
| 588 |
+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 |
+
import * as nativeFs from "fs";
|
| 3 |
+
import picomatch from "picomatch";
|
| 4 |
+
|
| 5 |
+
//#region src/api/aborter.d.ts
|
| 6 |
+
/**
|
| 7 |
+
* AbortController is not supported on Node 14 so we use this until we can drop
|
| 8 |
+
* support for Node 14.
|
| 9 |
+
*/
|
| 10 |
+
declare class Aborter {
|
| 11 |
+
aborted: boolean;
|
| 12 |
+
abort(): void;
|
| 13 |
+
}
|
| 14 |
+
//#endregion
|
| 15 |
+
//#region src/api/queue.d.ts
|
| 16 |
+
type OnQueueEmptyCallback = (error: Error | null, output: WalkerState) => void;
|
| 17 |
+
/**
|
| 18 |
+
* This is a custom stateless queue to track concurrent async fs calls.
|
| 19 |
+
* It increments a counter whenever a call is queued and decrements it
|
| 20 |
+
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
|
| 21 |
+
*/
|
| 22 |
+
declare class Queue {
|
| 23 |
+
private onQueueEmpty?;
|
| 24 |
+
count: number;
|
| 25 |
+
constructor(onQueueEmpty?: OnQueueEmptyCallback | undefined);
|
| 26 |
+
enqueue(): number;
|
| 27 |
+
dequeue(error: Error | null, output: WalkerState): void;
|
| 28 |
+
}
|
| 29 |
+
//#endregion
|
| 30 |
+
//#region src/types.d.ts
|
| 31 |
+
type Counts = {
|
| 32 |
+
files: number;
|
| 33 |
+
directories: number;
|
| 34 |
+
/**
|
| 35 |
+
* @deprecated use `directories` instead. Will be removed in v7.0.
|
| 36 |
+
*/
|
| 37 |
+
dirs: number;
|
| 38 |
+
};
|
| 39 |
+
type Group = {
|
| 40 |
+
directory: string;
|
| 41 |
+
files: string[];
|
| 42 |
+
/**
|
| 43 |
+
* @deprecated use `directory` instead. Will be removed in v7.0.
|
| 44 |
+
*/
|
| 45 |
+
dir: string;
|
| 46 |
+
};
|
| 47 |
+
type GroupOutput = Group[];
|
| 48 |
+
type OnlyCountsOutput = Counts;
|
| 49 |
+
type PathsOutput = string[];
|
| 50 |
+
type Output = OnlyCountsOutput | PathsOutput | GroupOutput;
|
| 51 |
+
type FSLike = {
|
| 52 |
+
readdir: typeof nativeFs.readdir;
|
| 53 |
+
readdirSync: typeof nativeFs.readdirSync;
|
| 54 |
+
realpath: typeof nativeFs.realpath;
|
| 55 |
+
realpathSync: typeof nativeFs.realpathSync;
|
| 56 |
+
stat: typeof nativeFs.stat;
|
| 57 |
+
statSync: typeof nativeFs.statSync;
|
| 58 |
+
};
|
| 59 |
+
type WalkerState = {
|
| 60 |
+
root: string;
|
| 61 |
+
paths: string[];
|
| 62 |
+
groups: Group[];
|
| 63 |
+
counts: Counts;
|
| 64 |
+
options: Options;
|
| 65 |
+
queue: Queue;
|
| 66 |
+
controller: Aborter;
|
| 67 |
+
fs: FSLike;
|
| 68 |
+
symlinks: Map<string, string>;
|
| 69 |
+
visited: string[];
|
| 70 |
+
};
|
| 71 |
+
type ResultCallback<TOutput extends Output> = (error: Error | null, output: TOutput) => void;
|
| 72 |
+
type FilterPredicate = (path: string, isDirectory: boolean) => boolean;
|
| 73 |
+
type ExcludePredicate = (dirName: string, dirPath: string) => boolean;
|
| 74 |
+
type PathSeparator = "/" | "\\";
|
| 75 |
+
type Options<TGlobFunction = unknown> = {
|
| 76 |
+
includeBasePath?: boolean;
|
| 77 |
+
includeDirs?: boolean;
|
| 78 |
+
normalizePath?: boolean;
|
| 79 |
+
maxDepth: number;
|
| 80 |
+
maxFiles?: number;
|
| 81 |
+
resolvePaths?: boolean;
|
| 82 |
+
suppressErrors: boolean;
|
| 83 |
+
group?: boolean;
|
| 84 |
+
onlyCounts?: boolean;
|
| 85 |
+
filters: FilterPredicate[];
|
| 86 |
+
resolveSymlinks?: boolean;
|
| 87 |
+
useRealPaths?: boolean;
|
| 88 |
+
excludeFiles?: boolean;
|
| 89 |
+
excludeSymlinks?: boolean;
|
| 90 |
+
exclude?: ExcludePredicate;
|
| 91 |
+
relativePaths?: boolean;
|
| 92 |
+
pathSeparator: PathSeparator;
|
| 93 |
+
signal?: AbortSignal;
|
| 94 |
+
globFunction?: TGlobFunction;
|
| 95 |
+
fs?: FSLike;
|
| 96 |
+
};
|
| 97 |
+
type GlobMatcher = (test: string) => boolean;
|
| 98 |
+
type GlobFunction = (glob: string | string[], ...params: unknown[]) => GlobMatcher;
|
| 99 |
+
type GlobParams<T> = T extends ((globs: string | string[], ...params: infer TParams extends unknown[]) => GlobMatcher) ? TParams : [];
|
| 100 |
+
//#endregion
|
| 101 |
+
//#region src/builder/api-builder.d.ts
|
| 102 |
+
declare class APIBuilder<TReturnType extends Output> {
|
| 103 |
+
private readonly root;
|
| 104 |
+
private readonly options;
|
| 105 |
+
constructor(root: string, options: Options);
|
| 106 |
+
withPromise(): Promise<TReturnType>;
|
| 107 |
+
withCallback(cb: ResultCallback<TReturnType>): void;
|
| 108 |
+
sync(): TReturnType;
|
| 109 |
+
}
|
| 110 |
+
//#endregion
|
| 111 |
+
//#region src/builder/index.d.ts
|
| 112 |
+
declare class Builder<TReturnType extends Output = PathsOutput, TGlobFunction = typeof picomatch> {
|
| 113 |
+
private readonly globCache;
|
| 114 |
+
private options;
|
| 115 |
+
private globFunction?;
|
| 116 |
+
constructor(options?: Partial<Options<TGlobFunction>>);
|
| 117 |
+
group(): Builder<GroupOutput, TGlobFunction>;
|
| 118 |
+
withPathSeparator(separator: "/" | "\\"): this;
|
| 119 |
+
withBasePath(): this;
|
| 120 |
+
withRelativePaths(): this;
|
| 121 |
+
withDirs(): this;
|
| 122 |
+
withMaxDepth(depth: number): this;
|
| 123 |
+
withMaxFiles(limit: number): this;
|
| 124 |
+
withFullPaths(): this;
|
| 125 |
+
withErrors(): this;
|
| 126 |
+
withSymlinks({
|
| 127 |
+
resolvePaths
|
| 128 |
+
}?: {
|
| 129 |
+
resolvePaths?: boolean | undefined;
|
| 130 |
+
}): this;
|
| 131 |
+
withAbortSignal(signal: AbortSignal): this;
|
| 132 |
+
normalize(): this;
|
| 133 |
+
filter(predicate: FilterPredicate): this;
|
| 134 |
+
onlyDirs(): this;
|
| 135 |
+
exclude(predicate: ExcludePredicate): this;
|
| 136 |
+
onlyCounts(): Builder<OnlyCountsOutput, TGlobFunction>;
|
| 137 |
+
crawl(root?: string): APIBuilder<TReturnType>;
|
| 138 |
+
withGlobFunction<TFunc>(fn: TFunc): Builder<TReturnType, TFunc>;
|
| 139 |
+
/**
|
| 140 |
+
* @deprecated Pass options using the constructor instead:
|
| 141 |
+
* ```ts
|
| 142 |
+
* new fdir(options).crawl("/path/to/root");
|
| 143 |
+
* ```
|
| 144 |
+
* This method will be removed in v7.0
|
| 145 |
+
*/
|
| 146 |
+
crawlWithOptions(root: string, options: Partial<Options<TGlobFunction>>): APIBuilder<TReturnType>;
|
| 147 |
+
glob(...patterns: string[]): Builder<TReturnType, TGlobFunction>;
|
| 148 |
+
globWithOptions(patterns: string[]): Builder<TReturnType, TGlobFunction>;
|
| 149 |
+
globWithOptions(patterns: string[], ...options: GlobParams<TGlobFunction>): Builder<TReturnType, TGlobFunction>;
|
| 150 |
+
}
|
| 151 |
+
//#endregion
|
| 152 |
+
//#region src/index.d.ts
|
| 153 |
+
type Fdir = typeof Builder;
|
| 154 |
+
//#endregion
|
| 155 |
+
export { Counts, ExcludePredicate, FSLike, Fdir, FilterPredicate, GlobFunction, GlobMatcher, GlobParams, Group, GroupOutput, OnlyCountsOutput, Options, Output, PathSeparator, PathsOutput, ResultCallback, WalkerState, Builder as fdir };
|
dashboard/node_modules/fdir/dist/index.d.mts
ADDED
|
@@ -0,0 +1,155 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
/// <reference types="node" />
|
| 2 |
+
import * as nativeFs from "fs";
|
| 3 |
+
import picomatch from "picomatch";
|
| 4 |
+
|
| 5 |
+
//#region src/api/aborter.d.ts
|
| 6 |
+
/**
|
| 7 |
+
* AbortController is not supported on Node 14 so we use this until we can drop
|
| 8 |
+
* support for Node 14.
|
| 9 |
+
*/
|
| 10 |
+
declare class Aborter {
|
| 11 |
+
aborted: boolean;
|
| 12 |
+
abort(): void;
|
| 13 |
+
}
|
| 14 |
+
//#endregion
|
| 15 |
+
//#region src/api/queue.d.ts
|
| 16 |
+
type OnQueueEmptyCallback = (error: Error | null, output: WalkerState) => void;
|
| 17 |
+
/**
|
| 18 |
+
* This is a custom stateless queue to track concurrent async fs calls.
|
| 19 |
+
* It increments a counter whenever a call is queued and decrements it
|
| 20 |
+
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
|
| 21 |
+
*/
|
| 22 |
+
declare class Queue {
|
| 23 |
+
private onQueueEmpty?;
|
| 24 |
+
count: number;
|
| 25 |
+
constructor(onQueueEmpty?: OnQueueEmptyCallback | undefined);
|
| 26 |
+
enqueue(): number;
|
| 27 |
+
dequeue(error: Error | null, output: WalkerState): void;
|
| 28 |
+
}
|
| 29 |
+
//#endregion
|
| 30 |
+
//#region src/types.d.ts
|
| 31 |
+
type Counts = {
|
| 32 |
+
files: number;
|
| 33 |
+
directories: number;
|
| 34 |
+
/**
|
| 35 |
+
* @deprecated use `directories` instead. Will be removed in v7.0.
|
| 36 |
+
*/
|
| 37 |
+
dirs: number;
|
| 38 |
+
};
|
| 39 |
+
type Group = {
|
| 40 |
+
directory: string;
|
| 41 |
+
files: string[];
|
| 42 |
+
/**
|
| 43 |
+
* @deprecated use `directory` instead. Will be removed in v7.0.
|
| 44 |
+
*/
|
| 45 |
+
dir: string;
|
| 46 |
+
};
|
| 47 |
+
type GroupOutput = Group[];
|
| 48 |
+
type OnlyCountsOutput = Counts;
|
| 49 |
+
type PathsOutput = string[];
|
| 50 |
+
type Output = OnlyCountsOutput | PathsOutput | GroupOutput;
|
| 51 |
+
type FSLike = {
|
| 52 |
+
readdir: typeof nativeFs.readdir;
|
| 53 |
+
readdirSync: typeof nativeFs.readdirSync;
|
| 54 |
+
realpath: typeof nativeFs.realpath;
|
| 55 |
+
realpathSync: typeof nativeFs.realpathSync;
|
| 56 |
+
stat: typeof nativeFs.stat;
|
| 57 |
+
statSync: typeof nativeFs.statSync;
|
| 58 |
+
};
|
| 59 |
+
type WalkerState = {
|
| 60 |
+
root: string;
|
| 61 |
+
paths: string[];
|
| 62 |
+
groups: Group[];
|
| 63 |
+
counts: Counts;
|
| 64 |
+
options: Options;
|
| 65 |
+
queue: Queue;
|
| 66 |
+
controller: Aborter;
|
| 67 |
+
fs: FSLike;
|
| 68 |
+
symlinks: Map<string, string>;
|
| 69 |
+
visited: string[];
|
| 70 |
+
};
|
| 71 |
+
type ResultCallback<TOutput extends Output> = (error: Error | null, output: TOutput) => void;
|
| 72 |
+
type FilterPredicate = (path: string, isDirectory: boolean) => boolean;
|
| 73 |
+
type ExcludePredicate = (dirName: string, dirPath: string) => boolean;
|
| 74 |
+
type PathSeparator = "/" | "\\";
|
| 75 |
+
type Options<TGlobFunction = unknown> = {
|
| 76 |
+
includeBasePath?: boolean;
|
| 77 |
+
includeDirs?: boolean;
|
| 78 |
+
normalizePath?: boolean;
|
| 79 |
+
maxDepth: number;
|
| 80 |
+
maxFiles?: number;
|
| 81 |
+
resolvePaths?: boolean;
|
| 82 |
+
suppressErrors: boolean;
|
| 83 |
+
group?: boolean;
|
| 84 |
+
onlyCounts?: boolean;
|
| 85 |
+
filters: FilterPredicate[];
|
| 86 |
+
resolveSymlinks?: boolean;
|
| 87 |
+
useRealPaths?: boolean;
|
| 88 |
+
excludeFiles?: boolean;
|
| 89 |
+
excludeSymlinks?: boolean;
|
| 90 |
+
exclude?: ExcludePredicate;
|
| 91 |
+
relativePaths?: boolean;
|
| 92 |
+
pathSeparator: PathSeparator;
|
| 93 |
+
signal?: AbortSignal;
|
| 94 |
+
globFunction?: TGlobFunction;
|
| 95 |
+
fs?: FSLike;
|
| 96 |
+
};
|
| 97 |
+
type GlobMatcher = (test: string) => boolean;
|
| 98 |
+
type GlobFunction = (glob: string | string[], ...params: unknown[]) => GlobMatcher;
|
| 99 |
+
type GlobParams<T> = T extends ((globs: string | string[], ...params: infer TParams extends unknown[]) => GlobMatcher) ? TParams : [];
|
| 100 |
+
//#endregion
|
| 101 |
+
//#region src/builder/api-builder.d.ts
|
| 102 |
+
declare class APIBuilder<TReturnType extends Output> {
|
| 103 |
+
private readonly root;
|
| 104 |
+
private readonly options;
|
| 105 |
+
constructor(root: string, options: Options);
|
| 106 |
+
withPromise(): Promise<TReturnType>;
|
| 107 |
+
withCallback(cb: ResultCallback<TReturnType>): void;
|
| 108 |
+
sync(): TReturnType;
|
| 109 |
+
}
|
| 110 |
+
//#endregion
|
| 111 |
+
//#region src/builder/index.d.ts
|
| 112 |
+
declare class Builder<TReturnType extends Output = PathsOutput, TGlobFunction = typeof picomatch> {
|
| 113 |
+
private readonly globCache;
|
| 114 |
+
private options;
|
| 115 |
+
private globFunction?;
|
| 116 |
+
constructor(options?: Partial<Options<TGlobFunction>>);
|
| 117 |
+
group(): Builder<GroupOutput, TGlobFunction>;
|
| 118 |
+
withPathSeparator(separator: "/" | "\\"): this;
|
| 119 |
+
withBasePath(): this;
|
| 120 |
+
withRelativePaths(): this;
|
| 121 |
+
withDirs(): this;
|
| 122 |
+
withMaxDepth(depth: number): this;
|
| 123 |
+
withMaxFiles(limit: number): this;
|
| 124 |
+
withFullPaths(): this;
|
| 125 |
+
withErrors(): this;
|
| 126 |
+
withSymlinks({
|
| 127 |
+
resolvePaths
|
| 128 |
+
}?: {
|
| 129 |
+
resolvePaths?: boolean | undefined;
|
| 130 |
+
}): this;
|
| 131 |
+
withAbortSignal(signal: AbortSignal): this;
|
| 132 |
+
normalize(): this;
|
| 133 |
+
filter(predicate: FilterPredicate): this;
|
| 134 |
+
onlyDirs(): this;
|
| 135 |
+
exclude(predicate: ExcludePredicate): this;
|
| 136 |
+
onlyCounts(): Builder<OnlyCountsOutput, TGlobFunction>;
|
| 137 |
+
crawl(root?: string): APIBuilder<TReturnType>;
|
| 138 |
+
withGlobFunction<TFunc>(fn: TFunc): Builder<TReturnType, TFunc>;
|
| 139 |
+
/**
|
| 140 |
+
* @deprecated Pass options using the constructor instead:
|
| 141 |
+
* ```ts
|
| 142 |
+
* new fdir(options).crawl("/path/to/root");
|
| 143 |
+
* ```
|
| 144 |
+
* This method will be removed in v7.0
|
| 145 |
+
*/
|
| 146 |
+
crawlWithOptions(root: string, options: Partial<Options<TGlobFunction>>): APIBuilder<TReturnType>;
|
| 147 |
+
glob(...patterns: string[]): Builder<TReturnType, TGlobFunction>;
|
| 148 |
+
globWithOptions(patterns: string[]): Builder<TReturnType, TGlobFunction>;
|
| 149 |
+
globWithOptions(patterns: string[], ...options: GlobParams<TGlobFunction>): Builder<TReturnType, TGlobFunction>;
|
| 150 |
+
}
|
| 151 |
+
//#endregion
|
| 152 |
+
//#region src/index.d.ts
|
| 153 |
+
type Fdir = typeof Builder;
|
| 154 |
+
//#endregion
|
| 155 |
+
export { Counts, ExcludePredicate, FSLike, Fdir, FilterPredicate, GlobFunction, GlobMatcher, GlobParams, Group, GroupOutput, OnlyCountsOutput, Options, Output, PathSeparator, PathsOutput, ResultCallback, WalkerState, Builder as fdir };
|
dashboard/node_modules/fdir/dist/index.mjs
ADDED
|
@@ -0,0 +1,570 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import { createRequire } from "module";
|
| 2 |
+
import { basename, dirname, normalize, relative, resolve, sep } from "path";
|
| 3 |
+
import * as nativeFs from "fs";
|
| 4 |
+
|
| 5 |
+
//#region rolldown:runtime
|
| 6 |
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
| 7 |
+
|
| 8 |
+
//#endregion
|
| 9 |
+
//#region src/utils.ts
|
| 10 |
+
function cleanPath(path) {
|
| 11 |
+
let normalized = normalize(path);
|
| 12 |
+
if (normalized.length > 1 && normalized[normalized.length - 1] === sep) normalized = normalized.substring(0, normalized.length - 1);
|
| 13 |
+
return normalized;
|
| 14 |
+
}
|
| 15 |
+
const SLASHES_REGEX = /[\\/]/g;
|
| 16 |
+
function convertSlashes(path, separator) {
|
| 17 |
+
return path.replace(SLASHES_REGEX, separator);
|
| 18 |
+
}
|
| 19 |
+
const WINDOWS_ROOT_DIR_REGEX = /^[a-z]:[\\/]$/i;
|
| 20 |
+
function isRootDirectory(path) {
|
| 21 |
+
return path === "/" || WINDOWS_ROOT_DIR_REGEX.test(path);
|
| 22 |
+
}
|
| 23 |
+
function normalizePath(path, options) {
|
| 24 |
+
const { resolvePaths, normalizePath: normalizePath$1, pathSeparator } = options;
|
| 25 |
+
const pathNeedsCleaning = process.platform === "win32" && path.includes("/") || path.startsWith(".");
|
| 26 |
+
if (resolvePaths) path = resolve(path);
|
| 27 |
+
if (normalizePath$1 || pathNeedsCleaning) path = cleanPath(path);
|
| 28 |
+
if (path === ".") return "";
|
| 29 |
+
const needsSeperator = path[path.length - 1] !== pathSeparator;
|
| 30 |
+
return convertSlashes(needsSeperator ? path + pathSeparator : path, pathSeparator);
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
//#endregion
|
| 34 |
+
//#region src/api/functions/join-path.ts
|
| 35 |
+
function joinPathWithBasePath(filename, directoryPath) {
|
| 36 |
+
return directoryPath + filename;
|
| 37 |
+
}
|
| 38 |
+
function joinPathWithRelativePath(root, options) {
|
| 39 |
+
return function(filename, directoryPath) {
|
| 40 |
+
const sameRoot = directoryPath.startsWith(root);
|
| 41 |
+
if (sameRoot) return directoryPath.slice(root.length) + filename;
|
| 42 |
+
else return convertSlashes(relative(root, directoryPath), options.pathSeparator) + options.pathSeparator + filename;
|
| 43 |
+
};
|
| 44 |
+
}
|
| 45 |
+
function joinPath(filename) {
|
| 46 |
+
return filename;
|
| 47 |
+
}
|
| 48 |
+
function joinDirectoryPath(filename, directoryPath, separator) {
|
| 49 |
+
return directoryPath + filename + separator;
|
| 50 |
+
}
|
| 51 |
+
function build$7(root, options) {
|
| 52 |
+
const { relativePaths, includeBasePath } = options;
|
| 53 |
+
return relativePaths && root ? joinPathWithRelativePath(root, options) : includeBasePath ? joinPathWithBasePath : joinPath;
|
| 54 |
+
}
|
| 55 |
+
|
| 56 |
+
//#endregion
|
| 57 |
+
//#region src/api/functions/push-directory.ts
|
| 58 |
+
function pushDirectoryWithRelativePath(root) {
|
| 59 |
+
return function(directoryPath, paths) {
|
| 60 |
+
paths.push(directoryPath.substring(root.length) || ".");
|
| 61 |
+
};
|
| 62 |
+
}
|
| 63 |
+
function pushDirectoryFilterWithRelativePath(root) {
|
| 64 |
+
return function(directoryPath, paths, filters) {
|
| 65 |
+
const relativePath = directoryPath.substring(root.length) || ".";
|
| 66 |
+
if (filters.every((filter) => filter(relativePath, true))) paths.push(relativePath);
|
| 67 |
+
};
|
| 68 |
+
}
|
| 69 |
+
const pushDirectory = (directoryPath, paths) => {
|
| 70 |
+
paths.push(directoryPath || ".");
|
| 71 |
+
};
|
| 72 |
+
const pushDirectoryFilter = (directoryPath, paths, filters) => {
|
| 73 |
+
const path = directoryPath || ".";
|
| 74 |
+
if (filters.every((filter) => filter(path, true))) paths.push(path);
|
| 75 |
+
};
|
| 76 |
+
const empty$2 = () => {};
|
| 77 |
+
function build$6(root, options) {
|
| 78 |
+
const { includeDirs, filters, relativePaths } = options;
|
| 79 |
+
if (!includeDirs) return empty$2;
|
| 80 |
+
if (relativePaths) return filters && filters.length ? pushDirectoryFilterWithRelativePath(root) : pushDirectoryWithRelativePath(root);
|
| 81 |
+
return filters && filters.length ? pushDirectoryFilter : pushDirectory;
|
| 82 |
+
}
|
| 83 |
+
|
| 84 |
+
//#endregion
|
| 85 |
+
//#region src/api/functions/push-file.ts
|
| 86 |
+
const pushFileFilterAndCount = (filename, _paths, counts, filters) => {
|
| 87 |
+
if (filters.every((filter) => filter(filename, false))) counts.files++;
|
| 88 |
+
};
|
| 89 |
+
const pushFileFilter = (filename, paths, _counts, filters) => {
|
| 90 |
+
if (filters.every((filter) => filter(filename, false))) paths.push(filename);
|
| 91 |
+
};
|
| 92 |
+
const pushFileCount = (_filename, _paths, counts, _filters) => {
|
| 93 |
+
counts.files++;
|
| 94 |
+
};
|
| 95 |
+
const pushFile = (filename, paths) => {
|
| 96 |
+
paths.push(filename);
|
| 97 |
+
};
|
| 98 |
+
const empty$1 = () => {};
|
| 99 |
+
function build$5(options) {
|
| 100 |
+
const { excludeFiles, filters, onlyCounts } = options;
|
| 101 |
+
if (excludeFiles) return empty$1;
|
| 102 |
+
if (filters && filters.length) return onlyCounts ? pushFileFilterAndCount : pushFileFilter;
|
| 103 |
+
else if (onlyCounts) return pushFileCount;
|
| 104 |
+
else return pushFile;
|
| 105 |
+
}
|
| 106 |
+
|
| 107 |
+
//#endregion
|
| 108 |
+
//#region src/api/functions/get-array.ts
|
| 109 |
+
const getArray = (paths) => {
|
| 110 |
+
return paths;
|
| 111 |
+
};
|
| 112 |
+
const getArrayGroup = () => {
|
| 113 |
+
return [""].slice(0, 0);
|
| 114 |
+
};
|
| 115 |
+
function build$4(options) {
|
| 116 |
+
return options.group ? getArrayGroup : getArray;
|
| 117 |
+
}
|
| 118 |
+
|
| 119 |
+
//#endregion
|
| 120 |
+
//#region src/api/functions/group-files.ts
|
| 121 |
+
const groupFiles = (groups, directory, files) => {
|
| 122 |
+
groups.push({
|
| 123 |
+
directory,
|
| 124 |
+
files,
|
| 125 |
+
dir: directory
|
| 126 |
+
});
|
| 127 |
+
};
|
| 128 |
+
const empty = () => {};
|
| 129 |
+
function build$3(options) {
|
| 130 |
+
return options.group ? groupFiles : empty;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
//#endregion
|
| 134 |
+
//#region src/api/functions/resolve-symlink.ts
|
| 135 |
+
const resolveSymlinksAsync = function(path, state, callback$1) {
|
| 136 |
+
const { queue, fs, options: { suppressErrors } } = state;
|
| 137 |
+
queue.enqueue();
|
| 138 |
+
fs.realpath(path, (error, resolvedPath) => {
|
| 139 |
+
if (error) return queue.dequeue(suppressErrors ? null : error, state);
|
| 140 |
+
fs.stat(resolvedPath, (error$1, stat) => {
|
| 141 |
+
if (error$1) return queue.dequeue(suppressErrors ? null : error$1, state);
|
| 142 |
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return queue.dequeue(null, state);
|
| 143 |
+
callback$1(stat, resolvedPath);
|
| 144 |
+
queue.dequeue(null, state);
|
| 145 |
+
});
|
| 146 |
+
});
|
| 147 |
+
};
|
| 148 |
+
const resolveSymlinks = function(path, state, callback$1) {
|
| 149 |
+
const { queue, fs, options: { suppressErrors } } = state;
|
| 150 |
+
queue.enqueue();
|
| 151 |
+
try {
|
| 152 |
+
const resolvedPath = fs.realpathSync(path);
|
| 153 |
+
const stat = fs.statSync(resolvedPath);
|
| 154 |
+
if (stat.isDirectory() && isRecursive(path, resolvedPath, state)) return;
|
| 155 |
+
callback$1(stat, resolvedPath);
|
| 156 |
+
} catch (e) {
|
| 157 |
+
if (!suppressErrors) throw e;
|
| 158 |
+
}
|
| 159 |
+
};
|
| 160 |
+
function build$2(options, isSynchronous) {
|
| 161 |
+
if (!options.resolveSymlinks || options.excludeSymlinks) return null;
|
| 162 |
+
return isSynchronous ? resolveSymlinks : resolveSymlinksAsync;
|
| 163 |
+
}
|
| 164 |
+
function isRecursive(path, resolved, state) {
|
| 165 |
+
if (state.options.useRealPaths) return isRecursiveUsingRealPaths(resolved, state);
|
| 166 |
+
let parent = dirname(path);
|
| 167 |
+
let depth = 1;
|
| 168 |
+
while (parent !== state.root && depth < 2) {
|
| 169 |
+
const resolvedPath = state.symlinks.get(parent);
|
| 170 |
+
const isSameRoot = !!resolvedPath && (resolvedPath === resolved || resolvedPath.startsWith(resolved) || resolved.startsWith(resolvedPath));
|
| 171 |
+
if (isSameRoot) depth++;
|
| 172 |
+
else parent = dirname(parent);
|
| 173 |
+
}
|
| 174 |
+
state.symlinks.set(path, resolved);
|
| 175 |
+
return depth > 1;
|
| 176 |
+
}
|
| 177 |
+
function isRecursiveUsingRealPaths(resolved, state) {
|
| 178 |
+
return state.visited.includes(resolved + state.options.pathSeparator);
|
| 179 |
+
}
|
| 180 |
+
|
| 181 |
+
//#endregion
|
| 182 |
+
//#region src/api/functions/invoke-callback.ts
|
| 183 |
+
const onlyCountsSync = (state) => {
|
| 184 |
+
return state.counts;
|
| 185 |
+
};
|
| 186 |
+
const groupsSync = (state) => {
|
| 187 |
+
return state.groups;
|
| 188 |
+
};
|
| 189 |
+
const defaultSync = (state) => {
|
| 190 |
+
return state.paths;
|
| 191 |
+
};
|
| 192 |
+
const limitFilesSync = (state) => {
|
| 193 |
+
return state.paths.slice(0, state.options.maxFiles);
|
| 194 |
+
};
|
| 195 |
+
const onlyCountsAsync = (state, error, callback$1) => {
|
| 196 |
+
report(error, callback$1, state.counts, state.options.suppressErrors);
|
| 197 |
+
return null;
|
| 198 |
+
};
|
| 199 |
+
const defaultAsync = (state, error, callback$1) => {
|
| 200 |
+
report(error, callback$1, state.paths, state.options.suppressErrors);
|
| 201 |
+
return null;
|
| 202 |
+
};
|
| 203 |
+
const limitFilesAsync = (state, error, callback$1) => {
|
| 204 |
+
report(error, callback$1, state.paths.slice(0, state.options.maxFiles), state.options.suppressErrors);
|
| 205 |
+
return null;
|
| 206 |
+
};
|
| 207 |
+
const groupsAsync = (state, error, callback$1) => {
|
| 208 |
+
report(error, callback$1, state.groups, state.options.suppressErrors);
|
| 209 |
+
return null;
|
| 210 |
+
};
|
| 211 |
+
function report(error, callback$1, output, suppressErrors) {
|
| 212 |
+
if (error && !suppressErrors) callback$1(error, output);
|
| 213 |
+
else callback$1(null, output);
|
| 214 |
+
}
|
| 215 |
+
function build$1(options, isSynchronous) {
|
| 216 |
+
const { onlyCounts, group, maxFiles } = options;
|
| 217 |
+
if (onlyCounts) return isSynchronous ? onlyCountsSync : onlyCountsAsync;
|
| 218 |
+
else if (group) return isSynchronous ? groupsSync : groupsAsync;
|
| 219 |
+
else if (maxFiles) return isSynchronous ? limitFilesSync : limitFilesAsync;
|
| 220 |
+
else return isSynchronous ? defaultSync : defaultAsync;
|
| 221 |
+
}
|
| 222 |
+
|
| 223 |
+
//#endregion
|
| 224 |
+
//#region src/api/functions/walk-directory.ts
|
| 225 |
+
const readdirOpts = { withFileTypes: true };
|
| 226 |
+
const walkAsync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
| 227 |
+
state.queue.enqueue();
|
| 228 |
+
if (currentDepth < 0) return state.queue.dequeue(null, state);
|
| 229 |
+
const { fs } = state;
|
| 230 |
+
state.visited.push(crawlPath);
|
| 231 |
+
state.counts.directories++;
|
| 232 |
+
fs.readdir(crawlPath || ".", readdirOpts, (error, entries = []) => {
|
| 233 |
+
callback$1(entries, directoryPath, currentDepth);
|
| 234 |
+
state.queue.dequeue(state.options.suppressErrors ? null : error, state);
|
| 235 |
+
});
|
| 236 |
+
};
|
| 237 |
+
const walkSync = (state, crawlPath, directoryPath, currentDepth, callback$1) => {
|
| 238 |
+
const { fs } = state;
|
| 239 |
+
if (currentDepth < 0) return;
|
| 240 |
+
state.visited.push(crawlPath);
|
| 241 |
+
state.counts.directories++;
|
| 242 |
+
let entries = [];
|
| 243 |
+
try {
|
| 244 |
+
entries = fs.readdirSync(crawlPath || ".", readdirOpts);
|
| 245 |
+
} catch (e) {
|
| 246 |
+
if (!state.options.suppressErrors) throw e;
|
| 247 |
+
}
|
| 248 |
+
callback$1(entries, directoryPath, currentDepth);
|
| 249 |
+
};
|
| 250 |
+
function build(isSynchronous) {
|
| 251 |
+
return isSynchronous ? walkSync : walkAsync;
|
| 252 |
+
}
|
| 253 |
+
|
| 254 |
+
//#endregion
|
| 255 |
+
//#region src/api/queue.ts
|
| 256 |
+
/**
|
| 257 |
+
* This is a custom stateless queue to track concurrent async fs calls.
|
| 258 |
+
* It increments a counter whenever a call is queued and decrements it
|
| 259 |
+
* as soon as it completes. When the counter hits 0, it calls onQueueEmpty.
|
| 260 |
+
*/
|
| 261 |
+
var Queue = class {
|
| 262 |
+
count = 0;
|
| 263 |
+
constructor(onQueueEmpty) {
|
| 264 |
+
this.onQueueEmpty = onQueueEmpty;
|
| 265 |
+
}
|
| 266 |
+
enqueue() {
|
| 267 |
+
this.count++;
|
| 268 |
+
return this.count;
|
| 269 |
+
}
|
| 270 |
+
dequeue(error, output) {
|
| 271 |
+
if (this.onQueueEmpty && (--this.count <= 0 || error)) {
|
| 272 |
+
this.onQueueEmpty(error, output);
|
| 273 |
+
if (error) {
|
| 274 |
+
output.controller.abort();
|
| 275 |
+
this.onQueueEmpty = void 0;
|
| 276 |
+
}
|
| 277 |
+
}
|
| 278 |
+
}
|
| 279 |
+
};
|
| 280 |
+
|
| 281 |
+
//#endregion
|
| 282 |
+
//#region src/api/counter.ts
|
| 283 |
+
var Counter = class {
|
| 284 |
+
_files = 0;
|
| 285 |
+
_directories = 0;
|
| 286 |
+
set files(num) {
|
| 287 |
+
this._files = num;
|
| 288 |
+
}
|
| 289 |
+
get files() {
|
| 290 |
+
return this._files;
|
| 291 |
+
}
|
| 292 |
+
set directories(num) {
|
| 293 |
+
this._directories = num;
|
| 294 |
+
}
|
| 295 |
+
get directories() {
|
| 296 |
+
return this._directories;
|
| 297 |
+
}
|
| 298 |
+
/**
|
| 299 |
+
* @deprecated use `directories` instead
|
| 300 |
+
*/
|
| 301 |
+
/* c8 ignore next 3 */
|
| 302 |
+
get dirs() {
|
| 303 |
+
return this._directories;
|
| 304 |
+
}
|
| 305 |
+
};
|
| 306 |
+
|
| 307 |
+
//#endregion
|
| 308 |
+
//#region src/api/aborter.ts
|
| 309 |
+
/**
|
| 310 |
+
* AbortController is not supported on Node 14 so we use this until we can drop
|
| 311 |
+
* support for Node 14.
|
| 312 |
+
*/
|
| 313 |
+
var Aborter = class {
|
| 314 |
+
aborted = false;
|
| 315 |
+
abort() {
|
| 316 |
+
this.aborted = true;
|
| 317 |
+
}
|
| 318 |
+
};
|
| 319 |
+
|
| 320 |
+
//#endregion
|
| 321 |
+
//#region src/api/walker.ts
|
| 322 |
+
var Walker = class {
|
| 323 |
+
root;
|
| 324 |
+
isSynchronous;
|
| 325 |
+
state;
|
| 326 |
+
joinPath;
|
| 327 |
+
pushDirectory;
|
| 328 |
+
pushFile;
|
| 329 |
+
getArray;
|
| 330 |
+
groupFiles;
|
| 331 |
+
resolveSymlink;
|
| 332 |
+
walkDirectory;
|
| 333 |
+
callbackInvoker;
|
| 334 |
+
constructor(root, options, callback$1) {
|
| 335 |
+
this.isSynchronous = !callback$1;
|
| 336 |
+
this.callbackInvoker = build$1(options, this.isSynchronous);
|
| 337 |
+
this.root = normalizePath(root, options);
|
| 338 |
+
this.state = {
|
| 339 |
+
root: isRootDirectory(this.root) ? this.root : this.root.slice(0, -1),
|
| 340 |
+
paths: [""].slice(0, 0),
|
| 341 |
+
groups: [],
|
| 342 |
+
counts: new Counter(),
|
| 343 |
+
options,
|
| 344 |
+
queue: new Queue((error, state) => this.callbackInvoker(state, error, callback$1)),
|
| 345 |
+
symlinks: /* @__PURE__ */ new Map(),
|
| 346 |
+
visited: [""].slice(0, 0),
|
| 347 |
+
controller: new Aborter(),
|
| 348 |
+
fs: options.fs || nativeFs
|
| 349 |
+
};
|
| 350 |
+
this.joinPath = build$7(this.root, options);
|
| 351 |
+
this.pushDirectory = build$6(this.root, options);
|
| 352 |
+
this.pushFile = build$5(options);
|
| 353 |
+
this.getArray = build$4(options);
|
| 354 |
+
this.groupFiles = build$3(options);
|
| 355 |
+
this.resolveSymlink = build$2(options, this.isSynchronous);
|
| 356 |
+
this.walkDirectory = build(this.isSynchronous);
|
| 357 |
+
}
|
| 358 |
+
start() {
|
| 359 |
+
this.pushDirectory(this.root, this.state.paths, this.state.options.filters);
|
| 360 |
+
this.walkDirectory(this.state, this.root, this.root, this.state.options.maxDepth, this.walk);
|
| 361 |
+
return this.isSynchronous ? this.callbackInvoker(this.state, null) : null;
|
| 362 |
+
}
|
| 363 |
+
walk = (entries, directoryPath, depth) => {
|
| 364 |
+
const { paths, options: { filters, resolveSymlinks: resolveSymlinks$1, excludeSymlinks, exclude, maxFiles, signal, useRealPaths, pathSeparator }, controller } = this.state;
|
| 365 |
+
if (controller.aborted || signal && signal.aborted || maxFiles && paths.length > maxFiles) return;
|
| 366 |
+
const files = this.getArray(this.state.paths);
|
| 367 |
+
for (let i = 0; i < entries.length; ++i) {
|
| 368 |
+
const entry = entries[i];
|
| 369 |
+
if (entry.isFile() || entry.isSymbolicLink() && !resolveSymlinks$1 && !excludeSymlinks) {
|
| 370 |
+
const filename = this.joinPath(entry.name, directoryPath);
|
| 371 |
+
this.pushFile(filename, files, this.state.counts, filters);
|
| 372 |
+
} else if (entry.isDirectory()) {
|
| 373 |
+
let path = joinDirectoryPath(entry.name, directoryPath, this.state.options.pathSeparator);
|
| 374 |
+
if (exclude && exclude(entry.name, path)) continue;
|
| 375 |
+
this.pushDirectory(path, paths, filters);
|
| 376 |
+
this.walkDirectory(this.state, path, path, depth - 1, this.walk);
|
| 377 |
+
} else if (this.resolveSymlink && entry.isSymbolicLink()) {
|
| 378 |
+
let path = joinPathWithBasePath(entry.name, directoryPath);
|
| 379 |
+
this.resolveSymlink(path, this.state, (stat, resolvedPath) => {
|
| 380 |
+
if (stat.isDirectory()) {
|
| 381 |
+
resolvedPath = normalizePath(resolvedPath, this.state.options);
|
| 382 |
+
if (exclude && exclude(entry.name, useRealPaths ? resolvedPath : path + pathSeparator)) return;
|
| 383 |
+
this.walkDirectory(this.state, resolvedPath, useRealPaths ? resolvedPath : path + pathSeparator, depth - 1, this.walk);
|
| 384 |
+
} else {
|
| 385 |
+
resolvedPath = useRealPaths ? resolvedPath : path;
|
| 386 |
+
const filename = basename(resolvedPath);
|
| 387 |
+
const directoryPath$1 = normalizePath(dirname(resolvedPath), this.state.options);
|
| 388 |
+
resolvedPath = this.joinPath(filename, directoryPath$1);
|
| 389 |
+
this.pushFile(resolvedPath, files, this.state.counts, filters);
|
| 390 |
+
}
|
| 391 |
+
});
|
| 392 |
+
}
|
| 393 |
+
}
|
| 394 |
+
this.groupFiles(this.state.groups, directoryPath, files);
|
| 395 |
+
};
|
| 396 |
+
};
|
| 397 |
+
|
| 398 |
+
//#endregion
|
| 399 |
+
//#region src/api/async.ts
|
| 400 |
+
function promise(root, options) {
|
| 401 |
+
return new Promise((resolve$1, reject) => {
|
| 402 |
+
callback(root, options, (err, output) => {
|
| 403 |
+
if (err) return reject(err);
|
| 404 |
+
resolve$1(output);
|
| 405 |
+
});
|
| 406 |
+
});
|
| 407 |
+
}
|
| 408 |
+
function callback(root, options, callback$1) {
|
| 409 |
+
let walker = new Walker(root, options, callback$1);
|
| 410 |
+
walker.start();
|
| 411 |
+
}
|
| 412 |
+
|
| 413 |
+
//#endregion
|
| 414 |
+
//#region src/api/sync.ts
|
| 415 |
+
function sync(root, options) {
|
| 416 |
+
const walker = new Walker(root, options);
|
| 417 |
+
return walker.start();
|
| 418 |
+
}
|
| 419 |
+
|
| 420 |
+
//#endregion
|
| 421 |
+
//#region src/builder/api-builder.ts
|
| 422 |
+
var APIBuilder = class {
|
| 423 |
+
constructor(root, options) {
|
| 424 |
+
this.root = root;
|
| 425 |
+
this.options = options;
|
| 426 |
+
}
|
| 427 |
+
withPromise() {
|
| 428 |
+
return promise(this.root, this.options);
|
| 429 |
+
}
|
| 430 |
+
withCallback(cb) {
|
| 431 |
+
callback(this.root, this.options, cb);
|
| 432 |
+
}
|
| 433 |
+
sync() {
|
| 434 |
+
return sync(this.root, this.options);
|
| 435 |
+
}
|
| 436 |
+
};
|
| 437 |
+
|
| 438 |
+
//#endregion
|
| 439 |
+
//#region src/builder/index.ts
|
| 440 |
+
let pm = null;
|
| 441 |
+
/* c8 ignore next 6 */
|
| 442 |
+
try {
|
| 443 |
+
__require.resolve("picomatch");
|
| 444 |
+
pm = __require("picomatch");
|
| 445 |
+
} catch {}
|
| 446 |
+
var Builder = class {
|
| 447 |
+
globCache = {};
|
| 448 |
+
options = {
|
| 449 |
+
maxDepth: Infinity,
|
| 450 |
+
suppressErrors: true,
|
| 451 |
+
pathSeparator: sep,
|
| 452 |
+
filters: []
|
| 453 |
+
};
|
| 454 |
+
globFunction;
|
| 455 |
+
constructor(options) {
|
| 456 |
+
this.options = {
|
| 457 |
+
...this.options,
|
| 458 |
+
...options
|
| 459 |
+
};
|
| 460 |
+
this.globFunction = this.options.globFunction;
|
| 461 |
+
}
|
| 462 |
+
group() {
|
| 463 |
+
this.options.group = true;
|
| 464 |
+
return this;
|
| 465 |
+
}
|
| 466 |
+
withPathSeparator(separator) {
|
| 467 |
+
this.options.pathSeparator = separator;
|
| 468 |
+
return this;
|
| 469 |
+
}
|
| 470 |
+
withBasePath() {
|
| 471 |
+
this.options.includeBasePath = true;
|
| 472 |
+
return this;
|
| 473 |
+
}
|
| 474 |
+
withRelativePaths() {
|
| 475 |
+
this.options.relativePaths = true;
|
| 476 |
+
return this;
|
| 477 |
+
}
|
| 478 |
+
withDirs() {
|
| 479 |
+
this.options.includeDirs = true;
|
| 480 |
+
return this;
|
| 481 |
+
}
|
| 482 |
+
withMaxDepth(depth) {
|
| 483 |
+
this.options.maxDepth = depth;
|
| 484 |
+
return this;
|
| 485 |
+
}
|
| 486 |
+
withMaxFiles(limit) {
|
| 487 |
+
this.options.maxFiles = limit;
|
| 488 |
+
return this;
|
| 489 |
+
}
|
| 490 |
+
withFullPaths() {
|
| 491 |
+
this.options.resolvePaths = true;
|
| 492 |
+
this.options.includeBasePath = true;
|
| 493 |
+
return this;
|
| 494 |
+
}
|
| 495 |
+
withErrors() {
|
| 496 |
+
this.options.suppressErrors = false;
|
| 497 |
+
return this;
|
| 498 |
+
}
|
| 499 |
+
withSymlinks({ resolvePaths = true } = {}) {
|
| 500 |
+
this.options.resolveSymlinks = true;
|
| 501 |
+
this.options.useRealPaths = resolvePaths;
|
| 502 |
+
return this.withFullPaths();
|
| 503 |
+
}
|
| 504 |
+
withAbortSignal(signal) {
|
| 505 |
+
this.options.signal = signal;
|
| 506 |
+
return this;
|
| 507 |
+
}
|
| 508 |
+
normalize() {
|
| 509 |
+
this.options.normalizePath = true;
|
| 510 |
+
return this;
|
| 511 |
+
}
|
| 512 |
+
filter(predicate) {
|
| 513 |
+
this.options.filters.push(predicate);
|
| 514 |
+
return this;
|
| 515 |
+
}
|
| 516 |
+
onlyDirs() {
|
| 517 |
+
this.options.excludeFiles = true;
|
| 518 |
+
this.options.includeDirs = true;
|
| 519 |
+
return this;
|
| 520 |
+
}
|
| 521 |
+
exclude(predicate) {
|
| 522 |
+
this.options.exclude = predicate;
|
| 523 |
+
return this;
|
| 524 |
+
}
|
| 525 |
+
onlyCounts() {
|
| 526 |
+
this.options.onlyCounts = true;
|
| 527 |
+
return this;
|
| 528 |
+
}
|
| 529 |
+
crawl(root) {
|
| 530 |
+
return new APIBuilder(root || ".", this.options);
|
| 531 |
+
}
|
| 532 |
+
withGlobFunction(fn) {
|
| 533 |
+
this.globFunction = fn;
|
| 534 |
+
return this;
|
| 535 |
+
}
|
| 536 |
+
/**
|
| 537 |
+
* @deprecated Pass options using the constructor instead:
|
| 538 |
+
* ```ts
|
| 539 |
+
* new fdir(options).crawl("/path/to/root");
|
| 540 |
+
* ```
|
| 541 |
+
* This method will be removed in v7.0
|
| 542 |
+
*/
|
| 543 |
+
/* c8 ignore next 4 */
|
| 544 |
+
crawlWithOptions(root, options) {
|
| 545 |
+
this.options = {
|
| 546 |
+
...this.options,
|
| 547 |
+
...options
|
| 548 |
+
};
|
| 549 |
+
return new APIBuilder(root || ".", this.options);
|
| 550 |
+
}
|
| 551 |
+
glob(...patterns) {
|
| 552 |
+
if (this.globFunction) return this.globWithOptions(patterns);
|
| 553 |
+
return this.globWithOptions(patterns, ...[{ dot: true }]);
|
| 554 |
+
}
|
| 555 |
+
globWithOptions(patterns, ...options) {
|
| 556 |
+
const globFn = this.globFunction || pm;
|
| 557 |
+
/* c8 ignore next 5 */
|
| 558 |
+
if (!globFn) throw new Error("Please specify a glob function to use glob matching.");
|
| 559 |
+
var isMatch = this.globCache[patterns.join("\0")];
|
| 560 |
+
if (!isMatch) {
|
| 561 |
+
isMatch = globFn(patterns, ...options);
|
| 562 |
+
this.globCache[patterns.join("\0")] = isMatch;
|
| 563 |
+
}
|
| 564 |
+
this.options.filters.push((path) => isMatch(path));
|
| 565 |
+
return this;
|
| 566 |
+
}
|
| 567 |
+
};
|
| 568 |
+
|
| 569 |
+
//#endregion
|
| 570 |
+
export { Builder as fdir };
|