@socketsecurity/cli-with-sentry 0.15.55 → 0.15.57
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/cli.js +2 -2
- package/dist/cli.js +82 -55
- package/dist/cli.js.map +1 -1
- package/dist/constants.js +49 -29
- package/dist/constants.js.map +1 -1
- package/dist/{shadow-bin.js → shadow-npm-bin.js} +6 -6
- package/dist/shadow-npm-bin.js.map +1 -0
- package/dist/{shadow-inject.js → shadow-npm-inject.js} +1 -1
- package/dist/shadow-npm-inject.js.map +1 -0
- package/dist/types/commands/scan/handle-reach-scan.d.mts +1 -1
- package/dist/types/commands/scan/handle-reach-scan.d.mts.map +1 -1
- package/dist/types/commands/scan/scan-reachability.d.mts +1 -1
- package/dist/types/commands/scan/scan-reachability.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +4 -1
- package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +1 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +4 -1
- package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +1 -1
- package/dist/types/constants.d.mts +9 -5
- package/dist/types/constants.d.mts.map +1 -1
- package/dist/utils.js +5 -5
- package/dist/utils.js.map +1 -1
- package/dist/vendor.js +21 -21
- package/external/@coana-tech/cli/cli.mjs +123 -8
- package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +9 -4
- package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +115 -132
- package/external/@socketsecurity/registry/external/@yarnpkg/extensions.js +18 -0
- package/external/@socketsecurity/registry/external/browserslist.js +662 -658
- package/external/@socketsecurity/registry/external/cacache.js +5 -3
- package/external/@socketsecurity/registry/external/libnpmpack.js +9 -4
- package/external/@socketsecurity/registry/external/make-fetch-happen.js +5 -3
- package/external/@socketsecurity/registry/external/npm-package-arg.js +4 -1
- package/external/@socketsecurity/registry/external/pacote.js +9 -4
- package/external/@socketsecurity/registry/external/validate-npm-package-name.js +4 -1
- package/external/@socketsecurity/registry/manifest.json +4 -4
- package/external/blessed-contrib/lib/layout/grid.js +400 -32
- package/external/blessed-contrib/lib/widget/charts/bar.js +8338 -67
- package/external/blessed-contrib/lib/widget/charts/line.js +17861 -196
- package/external/blessed-contrib/lib/widget/table.js +140 -121
- package/package.json +17 -16
- package/dist/shadow-bin.js.map +0 -1
- package/dist/shadow-inject.js.map +0 -1
- package/external/blessed-contrib/index.js +0 -28
- package/external/blessed-contrib/lib/layout/carousel.js +0 -74
- package/external/blessed-contrib/lib/server-utils.js +0 -73
- package/external/blessed-contrib/lib/utils.js +0 -73
- package/external/blessed-contrib/lib/widget/canvas.js +0 -51
- package/external/blessed-contrib/lib/widget/charts/stacked-bar.js +0 -218
- package/external/blessed-contrib/lib/widget/donut.js +0 -149
- package/external/blessed-contrib/lib/widget/gauge-list.js +0 -106
- package/external/blessed-contrib/lib/widget/gauge.js +0 -125
- package/external/blessed-contrib/lib/widget/lcd.js +0 -451
- package/external/blessed-contrib/lib/widget/log.js +0 -33
- package/external/blessed-contrib/lib/widget/map.js +0 -86
- package/external/blessed-contrib/lib/widget/markdown.js +0 -64
- package/external/blessed-contrib/lib/widget/picture.js +0 -66
- package/external/blessed-contrib/lib/widget/sparkline.js +0 -58
- package/external/blessed-contrib/lib/widget/tree.js +0 -167
package/dist/vendor.js
CHANGED
|
@@ -32895,7 +32895,7 @@ var isInteractiveExports = /*@__PURE__*/ requireIsInteractive();
|
|
|
32895
32895
|
var dist$e = {};
|
|
32896
32896
|
|
|
32897
32897
|
var name$2 = "@socketsecurity/sdk";
|
|
32898
|
-
var version$5 = "1.4.
|
|
32898
|
+
var version$5 = "1.4.42";
|
|
32899
32899
|
var license = "MIT";
|
|
32900
32900
|
var description = "SDK for the Socket API client";
|
|
32901
32901
|
var author = {
|
|
@@ -32978,36 +32978,36 @@ var scripts = {
|
|
|
32978
32978
|
"update:deps": "npx --yes npm-check-updates"
|
|
32979
32979
|
};
|
|
32980
32980
|
var dependencies = {
|
|
32981
|
-
"@socketsecurity/registry": "1.0.
|
|
32981
|
+
"@socketsecurity/registry": "1.0.205"
|
|
32982
32982
|
};
|
|
32983
32983
|
var devDependencies = {
|
|
32984
32984
|
"@biomejs/biome": "1.9.4",
|
|
32985
32985
|
"@dotenvx/dotenvx": "1.44.1",
|
|
32986
32986
|
"@eslint/compat": "1.2.9",
|
|
32987
32987
|
"@eslint/js": "9.28.0",
|
|
32988
|
-
"@types/node": "22.15.
|
|
32989
|
-
"@typescript-eslint/parser": "8.33.
|
|
32990
|
-
"@vitest/coverage-v8": "3.
|
|
32988
|
+
"@types/node": "22.15.30",
|
|
32989
|
+
"@typescript-eslint/parser": "8.33.1",
|
|
32990
|
+
"@vitest/coverage-v8": "3.2.2",
|
|
32991
32991
|
"del-cli": "6.0.0",
|
|
32992
32992
|
eslint: "9.28.0",
|
|
32993
|
-
"eslint-import-resolver-typescript": "4.4.
|
|
32994
|
-
"eslint-plugin-import-x": "4.15.
|
|
32995
|
-
"eslint-plugin-jsdoc": "50.
|
|
32996
|
-
"eslint-plugin-n": "17.
|
|
32993
|
+
"eslint-import-resolver-typescript": "4.4.3",
|
|
32994
|
+
"eslint-plugin-import-x": "4.15.1",
|
|
32995
|
+
"eslint-plugin-jsdoc": "50.7.1",
|
|
32996
|
+
"eslint-plugin-n": "17.19.0",
|
|
32997
32997
|
"eslint-plugin-sort-destructure-keys": "2.0.0",
|
|
32998
32998
|
"eslint-plugin-unicorn": "56.0.1",
|
|
32999
32999
|
globals: "16.2.0",
|
|
33000
33000
|
husky: "9.1.7",
|
|
33001
|
-
knip: "5.
|
|
33001
|
+
knip: "5.60.2",
|
|
33002
33002
|
"lint-staged": "16.1.0",
|
|
33003
33003
|
nock: "14.0.5",
|
|
33004
33004
|
"npm-run-all2": "8.0.4",
|
|
33005
33005
|
"openapi-typescript": "6.7.6",
|
|
33006
|
-
oxlint: "0.
|
|
33006
|
+
oxlint: "0.18.0",
|
|
33007
33007
|
"type-coverage": "2.29.7",
|
|
33008
33008
|
typescript: "~5.8.3",
|
|
33009
|
-
"typescript-eslint": "8.33.
|
|
33010
|
-
vitest: "3.
|
|
33009
|
+
"typescript-eslint": "8.33.1",
|
|
33010
|
+
vitest: "3.2.2"
|
|
33011
33011
|
};
|
|
33012
33012
|
var overrides = {
|
|
33013
33013
|
vite: "6.3.5"
|
|
@@ -58768,7 +58768,7 @@ function requireAst() {
|
|
|
58768
58768
|
return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
|
|
58769
58769
|
}
|
|
58770
58770
|
// XXX abstract out this map method
|
|
58771
|
-
let bodyDotAllowed = !repeated || allowDot || dot ||
|
|
58771
|
+
let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ? '' : this.#partsToRegExp(true);
|
|
58772
58772
|
if (bodyDotAllowed === body) {
|
|
58773
58773
|
bodyDotAllowed = '';
|
|
58774
58774
|
}
|
|
@@ -62505,7 +62505,7 @@ function requireCommonjs$c() {
|
|
|
62505
62505
|
const IFSOCK = 0b1100;
|
|
62506
62506
|
const IFMT = 0b1111;
|
|
62507
62507
|
// mask to unset low 4 bits
|
|
62508
|
-
const IFMT_UNKNOWN =
|
|
62508
|
+
const IFMT_UNKNOWN = ~IFMT;
|
|
62509
62509
|
// set after successfully calling readdir() and getting entries.
|
|
62510
62510
|
const READDIR_CALLED = 0b0000_0001_0000;
|
|
62511
62511
|
// set after a successful lstat()
|
|
@@ -62808,7 +62808,7 @@ function requireCommonjs$c() {
|
|
|
62808
62808
|
provisional: 0
|
|
62809
62809
|
});
|
|
62810
62810
|
this.#children.set(this, children);
|
|
62811
|
-
this.#type &=
|
|
62811
|
+
this.#type &= ~READDIR_CALLED;
|
|
62812
62812
|
return children;
|
|
62813
62813
|
}
|
|
62814
62814
|
/**
|
|
@@ -77525,7 +77525,7 @@ function requireCommonjs$8() {
|
|
|
77525
77525
|
const IFSOCK = 0b1100;
|
|
77526
77526
|
const IFMT = 0b1111;
|
|
77527
77527
|
// mask to unset low 4 bits
|
|
77528
|
-
const IFMT_UNKNOWN =
|
|
77528
|
+
const IFMT_UNKNOWN = ~IFMT;
|
|
77529
77529
|
// set after successfully calling readdir() and getting entries.
|
|
77530
77530
|
const READDIR_CALLED = 0b0000_0001_0000;
|
|
77531
77531
|
// set after a successful lstat()
|
|
@@ -77828,7 +77828,7 @@ function requireCommonjs$8() {
|
|
|
77828
77828
|
provisional: 0
|
|
77829
77829
|
});
|
|
77830
77830
|
this.#children.set(this, children);
|
|
77831
|
-
this.#type &=
|
|
77831
|
+
this.#type &= ~READDIR_CALLED;
|
|
77832
77832
|
return children;
|
|
77833
77833
|
}
|
|
77834
77834
|
/**
|
|
@@ -134545,7 +134545,7 @@ function requireCommonjs$3() {
|
|
|
134545
134545
|
const IFSOCK = 0b1100;
|
|
134546
134546
|
const IFMT = 0b1111;
|
|
134547
134547
|
// mask to unset low 4 bits
|
|
134548
|
-
const IFMT_UNKNOWN =
|
|
134548
|
+
const IFMT_UNKNOWN = ~IFMT;
|
|
134549
134549
|
// set after successfully calling readdir() and getting entries.
|
|
134550
134550
|
const READDIR_CALLED = 0b0000_0001_0000;
|
|
134551
134551
|
// set after a successful lstat()
|
|
@@ -134848,7 +134848,7 @@ function requireCommonjs$3() {
|
|
|
134848
134848
|
provisional: 0
|
|
134849
134849
|
});
|
|
134850
134850
|
this.#children.set(this, children);
|
|
134851
|
-
this.#type &=
|
|
134851
|
+
this.#type &= ~READDIR_CALLED;
|
|
134852
134852
|
return children;
|
|
134853
134853
|
}
|
|
134854
134854
|
/**
|
|
@@ -164963,5 +164963,5 @@ exports.terminalLinkExports = terminalLinkExports;
|
|
|
164963
164963
|
exports.updater = updater$1;
|
|
164964
164964
|
exports.yargsParser = yargsParser;
|
|
164965
164965
|
exports.yoctocolorsCjsExports = yoctocolorsCjsExports;
|
|
164966
|
-
//# debugId=
|
|
164966
|
+
//# debugId=3979c328-ebb2-4cf5-bbd9-17c0bacec526
|
|
164967
164967
|
//# sourceMappingURL=vendor.js.map
|
|
@@ -212320,7 +212320,7 @@ async function onlineScan(dependencyTree, apiKey, timeout) {
|
|
|
212320
212320
|
}
|
|
212321
212321
|
|
|
212322
212322
|
// dist/version.js
|
|
212323
|
-
var version2 = "14.9.
|
|
212323
|
+
var version2 = "14.9.22";
|
|
212324
212324
|
|
|
212325
212325
|
// ../../node_modules/.pnpm/axios@1.9.0/node_modules/axios/lib/helpers/bind.js
|
|
212326
212326
|
function bind2(fn2, thisArg) {
|
|
@@ -215683,7 +215683,17 @@ async function scanForVulnerabilitiesSocketMode(dependencyTree) {
|
|
|
215683
215683
|
const dependencyTreeNode = dependencyTree.transitiveDependencies[dependencyIdentifier];
|
|
215684
215684
|
if (!dependencyTreeNode)
|
|
215685
215685
|
throw new Error(`Dependency tree does not contain dependency ${simplePurlForComponent}`);
|
|
215686
|
-
dependencyTreeNode.
|
|
215686
|
+
dependencyTreeNode.purlObj = {
|
|
215687
|
+
type: c3.purl_type,
|
|
215688
|
+
namespace: c3.namespace ?? void 0,
|
|
215689
|
+
name: c3.name,
|
|
215690
|
+
version: c3.version ?? void 0,
|
|
215691
|
+
subpath: c3.subpath ?? void 0,
|
|
215692
|
+
artifactId: c3.artifactId ?? void 0,
|
|
215693
|
+
artifact_id: c3.artifact_id ?? void 0,
|
|
215694
|
+
qualifiers: c3.qualifiers ?? void 0,
|
|
215695
|
+
purlString: c3.purl
|
|
215696
|
+
};
|
|
215687
215697
|
for (const vulnerability of c3.vulnerabilities) {
|
|
215688
215698
|
vulnerabilities.push({
|
|
215689
215699
|
url: vulnerability.ghsaId,
|
|
@@ -215801,6 +215811,112 @@ function getNamespaceAndName(ecosystem, packageName) {
|
|
|
215801
215811
|
return { namespace: namespace2, name };
|
|
215802
215812
|
}
|
|
215803
215813
|
|
|
215814
|
+
// dist/internal/socket-report.js
|
|
215815
|
+
function toSocketFacts(report, dependencyTrees) {
|
|
215816
|
+
const components = [];
|
|
215817
|
+
const purlToIndex = /* @__PURE__ */ new Map();
|
|
215818
|
+
for (const dependencyTree of dependencyTrees) {
|
|
215819
|
+
const depIdentifierToPurl = Object.fromEntries(Object.entries(dependencyTree.dependencyTree.transitiveDependencies).map(([depIdentifier, dep]) => {
|
|
215820
|
+
const purl = dep.purlObj.purlString;
|
|
215821
|
+
if (purl && !purlToIndex.has(purl)) {
|
|
215822
|
+
purlToIndex.set(purl, components.length);
|
|
215823
|
+
const depTreeNode = dependencyTree.dependencyTree.transitiveDependencies[depIdentifier];
|
|
215824
|
+
components[purlToIndex.get(purl)] = {
|
|
215825
|
+
id: purlToIndex.get(purl).toString(),
|
|
215826
|
+
type: depTreeNode.purlObj.type,
|
|
215827
|
+
name: depTreeNode.purlObj.name,
|
|
215828
|
+
version: depTreeNode.purlObj.version,
|
|
215829
|
+
namespace: depTreeNode.purlObj.namespace,
|
|
215830
|
+
subpath: depTreeNode.purlObj.subpath,
|
|
215831
|
+
artifact_id: depTreeNode.purlObj.artifact_id,
|
|
215832
|
+
artifactId: depTreeNode.purlObj.artifactId,
|
|
215833
|
+
qualifiers: depTreeNode.purlObj.qualifiers,
|
|
215834
|
+
// direct: false, // TODO: add direct flag
|
|
215835
|
+
// dev: false, // TODO: add dev flag
|
|
215836
|
+
dependencies: []
|
|
215837
|
+
};
|
|
215838
|
+
}
|
|
215839
|
+
return [depIdentifier, purl];
|
|
215840
|
+
}));
|
|
215841
|
+
for (const [depIdentifier, purl] of Object.entries(depIdentifierToPurl)) {
|
|
215842
|
+
const depTreeNode = dependencyTree.dependencyTree.transitiveDependencies[depIdentifier];
|
|
215843
|
+
const component = components[purlToIndex.get(purl)];
|
|
215844
|
+
depTreeNode.dependencies?.forEach((dep) => {
|
|
215845
|
+
const depPurl = depIdentifierToPurl[dep];
|
|
215846
|
+
const depIndex = purlToIndex.get(depPurl);
|
|
215847
|
+
if (!component.dependencies?.includes(depIndex.toString())) {
|
|
215848
|
+
component.dependencies.push(depIndex.toString());
|
|
215849
|
+
}
|
|
215850
|
+
});
|
|
215851
|
+
}
|
|
215852
|
+
}
|
|
215853
|
+
for (const vulnerability of report.vulnerabilities) {
|
|
215854
|
+
const component = components[purlToIndex.get(vulnerability.purl)];
|
|
215855
|
+
if (!component) {
|
|
215856
|
+
throw new Error(`Component not found for vulnerability ${vulnerability.purl}`);
|
|
215857
|
+
}
|
|
215858
|
+
if (!component.reachability) {
|
|
215859
|
+
component.reachability = [];
|
|
215860
|
+
}
|
|
215861
|
+
let reachabilityForGHSA = component.reachability?.find((r2) => r2.ghsa_id === vulnerability.vulnerabilityUrl.replace("https://github.com/advisories/", ""));
|
|
215862
|
+
if (!reachabilityForGHSA) {
|
|
215863
|
+
reachabilityForGHSA = {
|
|
215864
|
+
ghsa_id: vulnerability.vulnerabilityUrl.replace("https://github.com/advisories/", ""),
|
|
215865
|
+
reachability: []
|
|
215866
|
+
};
|
|
215867
|
+
component.reachability.push(reachabilityForGHSA);
|
|
215868
|
+
}
|
|
215869
|
+
reachabilityForGHSA.reachability.push({
|
|
215870
|
+
...toSocketReachabilitySchema(vulnerability),
|
|
215871
|
+
workspacePath: vulnerability.workspacePath,
|
|
215872
|
+
subprojectPath: vulnerability.subprojectPath
|
|
215873
|
+
});
|
|
215874
|
+
}
|
|
215875
|
+
return {
|
|
215876
|
+
components
|
|
215877
|
+
};
|
|
215878
|
+
}
|
|
215879
|
+
function toSocketReachabilitySchema(vulnerability) {
|
|
215880
|
+
if (vulnerability.codeAwareScanResult.type === "missingVulnerabilityPattern") {
|
|
215881
|
+
return { type: "missing_support" };
|
|
215882
|
+
}
|
|
215883
|
+
if (vulnerability.codeAwareScanResult.type === "noAnalysisCheck") {
|
|
215884
|
+
return { type: "undeterminable_reachability" };
|
|
215885
|
+
}
|
|
215886
|
+
if (vulnerability.codeAwareScanResult.type === "analysisError") {
|
|
215887
|
+
return { type: "error", error: vulnerability.codeAwareScanResult.message };
|
|
215888
|
+
}
|
|
215889
|
+
if (vulnerability.codeAwareScanResult.type === "otherError") {
|
|
215890
|
+
return { type: "error", error: vulnerability.codeAwareScanResult.message };
|
|
215891
|
+
}
|
|
215892
|
+
if (vulnerability.codeAwareScanResult.type === "success") {
|
|
215893
|
+
if (Array.isArray(vulnerability.codeAwareScanResult.detectedOccurrences)) {
|
|
215894
|
+
if (vulnerability.codeAwareScanResult.detectedOccurrences.length === 0) {
|
|
215895
|
+
return { type: "unreachable" };
|
|
215896
|
+
}
|
|
215897
|
+
throw new Error("Detected occurrences is an array with elements. This is a bug.");
|
|
215898
|
+
}
|
|
215899
|
+
const detOccWithStacks = vulnerability.codeAwareScanResult.detectedOccurrences;
|
|
215900
|
+
if (detOccWithStacks.stacks.length === 0) {
|
|
215901
|
+
return { type: "unreachable" };
|
|
215902
|
+
}
|
|
215903
|
+
if (detOccWithStacks.analysisLevel === "function-level") {
|
|
215904
|
+
return {
|
|
215905
|
+
type: "reachable",
|
|
215906
|
+
analysisLevel: detOccWithStacks.analysisLevel,
|
|
215907
|
+
matches: detOccWithStacks.stacks
|
|
215908
|
+
};
|
|
215909
|
+
} else if (detOccWithStacks.analysisLevel === "class-level") {
|
|
215910
|
+
return {
|
|
215911
|
+
type: "reachable",
|
|
215912
|
+
analysisLevel: detOccWithStacks.analysisLevel,
|
|
215913
|
+
matches: detOccWithStacks.stacks
|
|
215914
|
+
};
|
|
215915
|
+
}
|
|
215916
|
+
}
|
|
215917
|
+
throw new Error("Unknown codeAwareScanResult type");
|
|
215918
|
+
}
|
|
215919
|
+
|
|
215804
215920
|
// dist/cli-core.js
|
|
215805
215921
|
var { omit, partition, pick } = import_lodash15.default;
|
|
215806
215922
|
var CliCore = class {
|
|
@@ -215870,7 +215986,7 @@ var CliCore = class {
|
|
|
215870
215986
|
}
|
|
215871
215987
|
}
|
|
215872
215988
|
}
|
|
215873
|
-
if (!this.options.repoUrl && !this.options.projectName && !this.options.disableReportSubmission && !this.options.offlineDatabase) {
|
|
215989
|
+
if (!this.options.repoUrl && !this.options.projectName && !this.options.disableReportSubmission && !this.options.offlineDatabase && !this.options.socketMode) {
|
|
215874
215990
|
throw new Error("Either --repo-url or --project-name is required for dashboard integration. Use --disable-report-submission to skip report submission.");
|
|
215875
215991
|
}
|
|
215876
215992
|
if ((this.options.disableReportSubmission || this.options.offlineDatabase) && !this.options.outputDir && !this.options.printReport) {
|
|
@@ -215936,10 +216052,7 @@ var CliCore = class {
|
|
|
215936
216052
|
if (!this.reportDependencyTrees) {
|
|
215937
216053
|
throw new Error("Dependency trees should be available when using --socket-mode");
|
|
215938
216054
|
}
|
|
215939
|
-
const socketReport =
|
|
215940
|
-
...report,
|
|
215941
|
-
dependencyTrees: this.reportDependencyTrees
|
|
215942
|
-
};
|
|
216055
|
+
const socketReport = toSocketFacts(report, this.reportDependencyTrees);
|
|
215943
216056
|
const outputFile = resolve24(this.options.socketMode);
|
|
215944
216057
|
await writeFile10(outputFile, JSON.stringify(socketReport, null, 2));
|
|
215945
216058
|
logger.info(kleur_default.green(`Socket report written to: ${outputFile}`));
|
|
@@ -216278,7 +216391,9 @@ var CliCore = class {
|
|
|
216278
216391
|
packageVersion: vulnerableNode.version ?? "",
|
|
216279
216392
|
ecosystem: v.ecosystem ?? "NPM",
|
|
216280
216393
|
dependencyType,
|
|
216281
|
-
reachability
|
|
216394
|
+
reachability,
|
|
216395
|
+
purl: v.purl,
|
|
216396
|
+
purlType: v.purlType
|
|
216282
216397
|
};
|
|
216283
216398
|
});
|
|
216284
216399
|
}
|
|
@@ -4561,7 +4561,9 @@ function requireAst() {
|
|
|
4561
4561
|
}
|
|
4562
4562
|
// XXX abstract out this map method
|
|
4563
4563
|
let bodyDotAllowed =
|
|
4564
|
-
!repeated || allowDot || dot ||
|
|
4564
|
+
!repeated || allowDot || dot || !startNoDot
|
|
4565
|
+
? ''
|
|
4566
|
+
: this.#partsToRegExp(true)
|
|
4565
4567
|
if (bodyDotAllowed === body) {
|
|
4566
4568
|
bodyDotAllowed = ''
|
|
4567
4569
|
}
|
|
@@ -7078,7 +7080,7 @@ function requireCommonjs$1() {
|
|
|
7078
7080
|
const IFSOCK = 0b1100
|
|
7079
7081
|
const IFMT = 0b1111
|
|
7080
7082
|
// mask to unset low 4 bits
|
|
7081
|
-
const IFMT_UNKNOWN =
|
|
7083
|
+
const IFMT_UNKNOWN = ~IFMT
|
|
7082
7084
|
// set after successfully calling readdir() and getting entries.
|
|
7083
7085
|
const READDIR_CALLED = 0b0000_0001_0000
|
|
7084
7086
|
// set after a successful lstat()
|
|
@@ -7406,7 +7408,7 @@ function requireCommonjs$1() {
|
|
|
7406
7408
|
provisional: 0
|
|
7407
7409
|
})
|
|
7408
7410
|
this.#children.set(this, children)
|
|
7409
|
-
this.#type &=
|
|
7411
|
+
this.#type &= ~READDIR_CALLED
|
|
7410
7412
|
return children
|
|
7411
7413
|
}
|
|
7412
7414
|
/**
|
|
@@ -14379,7 +14381,7 @@ function requireLib$5() {
|
|
|
14379
14381
|
if (!name.length) {
|
|
14380
14382
|
errors.push('name length must be greater than zero')
|
|
14381
14383
|
}
|
|
14382
|
-
if (name.
|
|
14384
|
+
if (name.startsWith('.')) {
|
|
14383
14385
|
errors.push('name cannot start with a period')
|
|
14384
14386
|
}
|
|
14385
14387
|
if (name.match(/^_/)) {
|
|
@@ -14419,6 +14421,9 @@ function requireLib$5() {
|
|
|
14419
14421
|
if (nameMatch) {
|
|
14420
14422
|
const user = nameMatch[1]
|
|
14421
14423
|
const pkg = nameMatch[2]
|
|
14424
|
+
if (pkg.startsWith('.')) {
|
|
14425
|
+
errors.push('name cannot start with a period')
|
|
14426
|
+
}
|
|
14422
14427
|
if (
|
|
14423
14428
|
encodeURIComponent(user) === user &&
|
|
14424
14429
|
encodeURIComponent(pkg) === pkg
|
|
@@ -196,19 +196,18 @@ function requireYoctoSpinner() {
|
|
|
196
196
|
return _stripVTControlCharacters(string)
|
|
197
197
|
}
|
|
198
198
|
class YoctoSpinner {
|
|
199
|
-
#color
|
|
200
|
-
#currentFrame = -1
|
|
201
|
-
#exitHandlerBound
|
|
202
199
|
#frames
|
|
203
|
-
#indention = ''
|
|
204
200
|
#interval
|
|
201
|
+
#currentFrame = -1
|
|
202
|
+
#timer
|
|
203
|
+
#text
|
|
204
|
+
#stream
|
|
205
|
+
#color
|
|
206
|
+
#lines = 0
|
|
207
|
+
#exitHandlerBound
|
|
205
208
|
#isInteractive
|
|
206
209
|
#lastSpinnerFrameTime = 0
|
|
207
|
-
#
|
|
208
|
-
#signal
|
|
209
|
-
#stream
|
|
210
|
-
#text
|
|
211
|
-
#timer
|
|
210
|
+
#isSpinning = false
|
|
212
211
|
constructor(options = {}) {
|
|
213
212
|
const opts = {
|
|
214
213
|
__proto__: null,
|
|
@@ -216,114 +215,82 @@ function requireYoctoSpinner() {
|
|
|
216
215
|
}
|
|
217
216
|
const spinner = opts.spinner ?? getDefaultSpinner()
|
|
218
217
|
const stream = opts.stream ?? getProcess().stderr
|
|
219
|
-
this.#color = opts.color ?? 'cyan'
|
|
220
|
-
this.#exitHandlerBound = this.#exitHandler.bind(this)
|
|
221
218
|
this.#frames = spinner.frames
|
|
222
|
-
this.#interval = spinner.interval
|
|
219
|
+
this.#interval = spinner.interval
|
|
220
|
+
this.#text = options.text ?? ''
|
|
221
|
+
this.#stream = stream ?? process.stderr
|
|
222
|
+
this.#color = options.color ?? 'cyan'
|
|
223
223
|
this.#isInteractive = !!stream.isTTY && isProcessInteractive()
|
|
224
|
-
this.#
|
|
225
|
-
this.#stream = stream
|
|
226
|
-
this.#text = opts.text ?? ''
|
|
227
|
-
}
|
|
228
|
-
#clearTimer() {
|
|
229
|
-
clearInterval(this.#timer)
|
|
230
|
-
this.#timer = undefined
|
|
224
|
+
this.#exitHandlerBound = this.#exitHandler.bind(this)
|
|
231
225
|
}
|
|
232
|
-
|
|
226
|
+
start(text) {
|
|
227
|
+
if (text) {
|
|
228
|
+
this.#text = text
|
|
229
|
+
}
|
|
233
230
|
if (this.isSpinning) {
|
|
234
|
-
this
|
|
231
|
+
return this
|
|
235
232
|
}
|
|
236
|
-
|
|
237
|
-
|
|
233
|
+
this.#isSpinning = true
|
|
234
|
+
this.#hideCursor()
|
|
235
|
+
this.#render()
|
|
236
|
+
this.#subscribeToProcessEvents()
|
|
237
|
+
|
|
238
|
+
// Only start the timer in interactive mode
|
|
238
239
|
if (this.#isInteractive) {
|
|
239
|
-
this.#
|
|
240
|
+
this.#timer = setInterval(() => {
|
|
241
|
+
this.#render()
|
|
242
|
+
}, this.#interval)
|
|
240
243
|
}
|
|
244
|
+
return this
|
|
241
245
|
}
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
let lineCount = 0
|
|
246
|
-
for (const line of lines) {
|
|
247
|
-
lineCount += Math.max(1, Math.ceil(line.length / width))
|
|
248
|
-
}
|
|
249
|
-
return lineCount
|
|
250
|
-
}
|
|
251
|
-
#render() {
|
|
252
|
-
// Ensure we only update the spinner frame at the wanted interval,
|
|
253
|
-
// even if the frame method is called more often.
|
|
254
|
-
const now = Date.now()
|
|
255
|
-
if (
|
|
256
|
-
this.#currentFrame === -1 ||
|
|
257
|
-
now - this.#lastSpinnerFrameTime >= this.#interval
|
|
258
|
-
) {
|
|
259
|
-
this.#currentFrame = (this.#currentFrame + 1) % this.#frames.length
|
|
260
|
-
this.#lastSpinnerFrameTime = now
|
|
246
|
+
stop(finalText) {
|
|
247
|
+
if (!this.isSpinning) {
|
|
248
|
+
return this
|
|
261
249
|
}
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
if (string) {
|
|
267
|
-
if (this.#indention.length) {
|
|
268
|
-
string = `${this.#indention}${string}`
|
|
269
|
-
}
|
|
270
|
-
if (!this.#isInteractive) {
|
|
271
|
-
string += '\n'
|
|
272
|
-
}
|
|
250
|
+
this.#isSpinning = false
|
|
251
|
+
if (this.#timer) {
|
|
252
|
+
clearInterval(this.#timer)
|
|
253
|
+
this.#timer = undefined
|
|
273
254
|
}
|
|
255
|
+
this.#showCursor()
|
|
274
256
|
this.clear()
|
|
275
|
-
this.#
|
|
276
|
-
if (
|
|
277
|
-
this.#
|
|
278
|
-
}
|
|
279
|
-
}
|
|
280
|
-
#setTimer() {
|
|
281
|
-
const timeout = setInterval(() => {
|
|
282
|
-
this.#render()
|
|
283
|
-
}, this.#interval)
|
|
284
|
-
// Guard unref usage in case yocto-spinner is somehow built to run in a browser.
|
|
285
|
-
// https://nodejs.org/api/timers.html#timeoutunref
|
|
286
|
-
timeout?.unref?.()
|
|
287
|
-
this.#timer = timeout
|
|
288
|
-
}
|
|
289
|
-
#showCursor() {
|
|
290
|
-
if (this.#isInteractive) {
|
|
291
|
-
this.#write('\u001B[?25h')
|
|
257
|
+
this.#unsubscribeFromProcessEvents()
|
|
258
|
+
if (finalText) {
|
|
259
|
+
this.#stream.write(`${finalText}\n`)
|
|
292
260
|
}
|
|
293
|
-
|
|
294
|
-
#subscribeToExitEvents() {
|
|
295
|
-
this.#signal?.addEventListener('abort', this.#exitHandlerBound)
|
|
296
|
-
process.once('SIGINT', this.#exitHandlerBound)
|
|
297
|
-
process.once('SIGTERM', this.#exitHandlerBound)
|
|
261
|
+
return this
|
|
298
262
|
}
|
|
299
263
|
#symbolStop(symbolType, text) {
|
|
300
264
|
const symbols = getLogSymbols()
|
|
301
265
|
return this.stop(`${symbols[symbolType]} ${text ?? this.#text}`)
|
|
302
266
|
}
|
|
303
|
-
|
|
304
|
-
this.#
|
|
305
|
-
process.off('SIGINT', this.#exitHandlerBound)
|
|
306
|
-
process.off('SIGTERM', this.#exitHandlerBound)
|
|
267
|
+
success(text) {
|
|
268
|
+
return this.#symbolStop('success', text)
|
|
307
269
|
}
|
|
308
|
-
|
|
309
|
-
this.#
|
|
270
|
+
error(text) {
|
|
271
|
+
return this.#symbolStop('error', text)
|
|
310
272
|
}
|
|
311
|
-
|
|
312
|
-
return this.#
|
|
273
|
+
warning(text) {
|
|
274
|
+
return this.#symbolStop('warning', text)
|
|
313
275
|
}
|
|
314
|
-
|
|
315
|
-
this.#
|
|
316
|
-
this.#render()
|
|
276
|
+
info(text) {
|
|
277
|
+
return this.#symbolStop('info', text)
|
|
317
278
|
}
|
|
318
279
|
get isSpinning() {
|
|
319
|
-
return this.#
|
|
280
|
+
return this.#isSpinning
|
|
320
281
|
}
|
|
321
282
|
get text() {
|
|
322
283
|
return this.#text
|
|
323
284
|
}
|
|
324
285
|
set text(value) {
|
|
325
|
-
|
|
326
|
-
this.#
|
|
286
|
+
this.#text = value ?? ''
|
|
287
|
+
this.#render()
|
|
288
|
+
}
|
|
289
|
+
get color() {
|
|
290
|
+
return this.#color
|
|
291
|
+
}
|
|
292
|
+
set color(value) {
|
|
293
|
+
this.#color = value
|
|
327
294
|
this.#render()
|
|
328
295
|
}
|
|
329
296
|
clear() {
|
|
@@ -331,7 +298,7 @@ function requireYoctoSpinner() {
|
|
|
331
298
|
return this
|
|
332
299
|
}
|
|
333
300
|
this.#stream.cursorTo(0)
|
|
334
|
-
for (let index = 0; index < this.#lines; index
|
|
301
|
+
for (let index = 0; index < this.#lines; index++) {
|
|
335
302
|
if (index > 0) {
|
|
336
303
|
this.#stream.moveCursor(0, -1)
|
|
337
304
|
}
|
|
@@ -340,55 +307,71 @@ function requireYoctoSpinner() {
|
|
|
340
307
|
this.#lines = 0
|
|
341
308
|
return this
|
|
342
309
|
}
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
310
|
+
#render() {
|
|
311
|
+
// Ensure we only update the spinner frame at the wanted interval,
|
|
312
|
+
// even if the frame method is called more often.
|
|
313
|
+
const now = Date.now()
|
|
314
|
+
if (
|
|
315
|
+
this.#currentFrame === -1 ||
|
|
316
|
+
now - this.#lastSpinnerFrameTime >= this.#interval
|
|
317
|
+
) {
|
|
318
|
+
this.#currentFrame = ++this.#currentFrame % this.#frames.length
|
|
319
|
+
this.#lastSpinnerFrameTime = now
|
|
320
|
+
}
|
|
321
|
+
const colors = getYoctocolors()
|
|
322
|
+
const applyColor = colors[this.#color] ?? colors.cyan
|
|
323
|
+
const frame = this.#frames[this.#currentFrame]
|
|
324
|
+
let string = `${applyColor(frame)} ${this.#text}`
|
|
325
|
+
if (!this.#isInteractive) {
|
|
326
|
+
string += '\n'
|
|
327
|
+
}
|
|
328
|
+
this.clear()
|
|
329
|
+
this.#write(string)
|
|
330
|
+
if (this.#isInteractive) {
|
|
331
|
+
this.#lines = this.#lineCount(string)
|
|
332
|
+
}
|
|
356
333
|
}
|
|
357
|
-
|
|
358
|
-
this.#
|
|
359
|
-
return this
|
|
334
|
+
#write(text) {
|
|
335
|
+
this.#stream.write(text)
|
|
360
336
|
}
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
337
|
+
#lineCount(text) {
|
|
338
|
+
const width = this.#stream.columns ?? defaultTtyColumns
|
|
339
|
+
const lines = stripVTControlCharacters(text).split('\n')
|
|
340
|
+
let lineCount = 0
|
|
341
|
+
for (const line of lines) {
|
|
342
|
+
lineCount += Math.max(1, Math.ceil(line.length / width))
|
|
367
343
|
}
|
|
368
|
-
|
|
369
|
-
this.#render()
|
|
370
|
-
this.#setTimer()
|
|
371
|
-
this.#subscribeToExitEvents()
|
|
372
|
-
return this
|
|
344
|
+
return lineCount
|
|
373
345
|
}
|
|
374
|
-
|
|
375
|
-
if (
|
|
376
|
-
|
|
346
|
+
#hideCursor() {
|
|
347
|
+
if (this.#isInteractive) {
|
|
348
|
+
this.#write('\u001B[?25l')
|
|
377
349
|
}
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
this.#
|
|
381
|
-
|
|
382
|
-
if (finalText) {
|
|
383
|
-
this.#write(`${this.#indention}${finalText}\n`)
|
|
350
|
+
}
|
|
351
|
+
#showCursor() {
|
|
352
|
+
if (this.#isInteractive) {
|
|
353
|
+
this.#write('\u001B[?25h')
|
|
384
354
|
}
|
|
385
|
-
return this
|
|
386
355
|
}
|
|
387
|
-
|
|
388
|
-
|
|
356
|
+
#subscribeToProcessEvents() {
|
|
357
|
+
process.once('SIGINT', this.#exitHandlerBound)
|
|
358
|
+
process.once('SIGTERM', this.#exitHandlerBound)
|
|
389
359
|
}
|
|
390
|
-
|
|
391
|
-
|
|
360
|
+
#unsubscribeFromProcessEvents() {
|
|
361
|
+
process.off('SIGINT', this.#exitHandlerBound)
|
|
362
|
+
process.off('SIGTERM', this.#exitHandlerBound)
|
|
363
|
+
}
|
|
364
|
+
#exitHandler(signal) {
|
|
365
|
+
if (this.isSpinning) {
|
|
366
|
+
this.stop()
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
// SIGINT: 128 + 2
|
|
370
|
+
// SIGTERM: 128 + 15
|
|
371
|
+
const exitCode =
|
|
372
|
+
signal === 'SIGINT' ? 130 : signal === 'SIGTERM' ? 143 : 1
|
|
373
|
+
// eslint-disable-next-line n/no-process-exit
|
|
374
|
+
process.exit(exitCode)
|
|
392
375
|
}
|
|
393
376
|
}
|
|
394
377
|
yoctoSpinner = function yoctoSpinner(options) {
|
|
@@ -1378,6 +1378,24 @@ function requireLib() {
|
|
|
1378
1378
|
csstype: `^3.0.10`
|
|
1379
1379
|
}
|
|
1380
1380
|
}
|
|
1381
|
+
],
|
|
1382
|
+
// https://github.com/fastify/fastify-type-provider-typebox/issues/114
|
|
1383
|
+
// https://github.com/fastify/fastify-type-provider-typebox/pull/165
|
|
1384
|
+
[
|
|
1385
|
+
`@fastify/type-provider-typebox@^5.0.0`,
|
|
1386
|
+
{
|
|
1387
|
+
peerDependencies: {
|
|
1388
|
+
fastify: `^5.0.0`
|
|
1389
|
+
}
|
|
1390
|
+
}
|
|
1391
|
+
],
|
|
1392
|
+
[
|
|
1393
|
+
`@fastify/type-provider-typebox@^4.0.0`,
|
|
1394
|
+
{
|
|
1395
|
+
peerDependencies: {
|
|
1396
|
+
fastify: `^4.0.0`
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1381
1399
|
]
|
|
1382
1400
|
]
|
|
1383
1401
|
return lib
|