react-doctor 0.9.13-dev.1239043 → 0.9.13-dev.45c0df3
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/dist/_react-doctor_require-typescript-DnwIzXJn.js +7 -0
- package/dist/{active-scan-abort-registry-DwG6tSPy.js → active-scan-abort-registry-B72ASBUh.js} +3 -3
- package/dist/build-section-divider-DUxdYc-w.js +80 -0
- package/dist/{ci-CUgNjCr-.js → ci-BwvrFxxP.js} +12 -12
- package/dist/cli.js +25 -26
- package/dist/constants-CKOk_Fa9.js +23 -0
- package/dist/{design-CX2j8ubS.js → design-kKNMVr1y.js} +4 -4
- package/dist/{devtools-CC2PAZ85.js → devtools-DOdrAPkZ.js} +3 -3
- package/dist/duplicate-jsx-worker.d.ts +1 -0
- package/dist/duplicate-jsx-worker.js +636 -0
- package/dist/{exit-gracefully-cGJM2g3O.js → exit-gracefully-rrcHzkUN.js} +7 -7
- package/dist/{get-east-asian-width-Bv2TD3Xj.js → get-east-asian-width-CM5BOEC-.js} +3 -3
- package/dist/{handle-error-BCI-Nv3P.js → handle-error-CkUL31OJ.js} +5 -5
- package/dist/index.js +2289 -1604
- package/dist/{inspect-Dq5krKWG.js → inspect-DA6s8FhA.js} +22 -20
- package/dist/{install-C0aiZKgf.js → install-6tMGZzFd.js} +9 -9
- package/dist/{install-doctor-script-CaTIms0r.js → install-doctor-script-CjJaGxqK.js} +5 -5
- package/dist/{install-github-workflow-DjPgXVqg.js → install-github-workflow-0aMzq1Ju.js} +5 -5
- package/dist/{install-react-doctor-C-PVDWXv.js → install-react-doctor-Dvq7uaam.js} +8 -8
- package/dist/{jsx-runtime-D_A4d39v.js → jsx-runtime-DmLigwoS.js} +7 -7
- package/dist/oxlint-worker.d.ts +1 -0
- package/dist/oxlint-worker.js +135 -0
- package/dist/{print-branded-header-Dz0SwyHQ.js → print-branded-header-2XLtwL_O.js} +4 -4
- package/dist/project-analysis-worker.js +452 -469
- package/dist/{prompt-runtime-scan-url-BXdY2Opw.js → prompt-runtime-scan-url-BqFheEqh.js} +5 -5
- package/dist/{read-object-file-CmMGK1uu.js → read-object-file-BC9KgyfB.js} +4 -4
- package/dist/{record-metric-B6T_Ej33.js → record-metric-DadXt-YJ.js} +1782 -1047
- package/dist/{report-error-DwL3b99q.js → report-error-RqZ4TcFp.js} +7 -7
- package/dist/{report-workflow-result-5PueDIAr.js → report-workflow-result-C-6ou3Yf.js} +5 -5
- package/dist/{resolve-scope-CTlLl7e6.js → resolve-scope-IralKJo7.js} +6 -6
- package/dist/{rules-DEbHKRag.js → rules-PiRhyXht.js} +6 -6
- package/dist/{run-scan-app-D3huvmXJ.js → run-scan-app-Bx3RR66H.js} +12 -12
- package/dist/{runtime-scan-CHFAEYg3.js → runtime-scan-CzLZG2SG.js} +11 -11
- package/dist/{sanitize-runtime-url-Bbq40iIp.js → sanitize-runtime-url-ChOwIs6Q.js} +4 -4
- package/dist/{scan-C7sCm7wi.js → scan-BsKjedB4.js} +9 -9
- package/dist/{semver-DFtnEmN-.js → semver-DlmXks31.js} +3 -3
- package/dist/{should-fail-scan-gate-CfG_ppAV.js → should-fail-scan-gate-DKuuz_Be.js} +86 -67
- package/dist/{should-skip-prompts-BuNtAVEs.js → should-skip-prompts-D49q53Ep.js} +4 -4
- package/dist/{should-use-tui-B-lCjXVG.js → should-use-tui-BSXNboYB.js} +4 -4
- package/dist/{telemetry-runtime-BF83aBFL.js → telemetry-runtime-DprfIwPW.js} +153 -5
- package/dist/unwrap-typescript-expression-CbO_6kmC.js +14 -0
- package/dist/{version-C27gr4Qj.js → version-DihZTmZU.js} +4 -4
- package/dist/{why-CYRkZ2VY.js → why-B8uIFoLE.js} +4 -4
- package/dist/{with-run-span-CdsXSJgE.js → with-run-span-JTZIIQT_.js} +5 -5
- package/package.json +4 -4
- package/dist/build-section-divider-C09RcJrc.js +0 -216
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="3f276705-c59b-5820-9c67-3379b6bd67f5")}catch(e){}}();
|
|
3
|
+
import { t as _react_doctor_require_typescript_default } from "./_react-doctor_require-typescript-DnwIzXJn.js";
|
|
4
|
+
//#region ../core/src/utils/unwrap-typescript-expression.ts
|
|
5
|
+
const unwrapTypescriptExpression = (expression) => {
|
|
6
|
+
let currentExpression = expression;
|
|
7
|
+
while (_react_doctor_require_typescript_default.isParenthesizedExpression(currentExpression) || _react_doctor_require_typescript_default.isAsExpression(currentExpression) || _react_doctor_require_typescript_default.isSatisfiesExpression(currentExpression) || _react_doctor_require_typescript_default.isNonNullExpression(currentExpression) || _react_doctor_require_typescript_default.isTypeAssertionExpression(currentExpression)) currentExpression = currentExpression.expression;
|
|
8
|
+
return currentExpression;
|
|
9
|
+
};
|
|
10
|
+
//#endregion
|
|
11
|
+
export { unwrapTypescriptExpression as t };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=unwrap-typescript-expression-CbO_6kmC.js.map
|
|
14
|
+
//# debugId=3f276705-c59b-5820-9c67-3379b6bd67f5
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { T as METRIC, _ as VERSION, t as recordCount } from "./record-metric-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="09e4c2f0-3bc6-568f-ab64-de6d23e8133a")}catch(e){}}();
|
|
3
|
+
import { T as METRIC, _ as VERSION, t as recordCount } from "./record-metric-DadXt-YJ.js";
|
|
4
4
|
//#region src/cli/commands/version.ts
|
|
5
5
|
/**
|
|
6
6
|
* oclif-style version line. 12-factor CLI Apps (#3, "What version am I
|
|
@@ -17,5 +17,5 @@ const versionAction = () => {
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { versionAction };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=version-
|
|
21
|
-
//# debugId=
|
|
20
|
+
//# sourceMappingURL=version-DihZTmZU.js.map
|
|
21
|
+
//# debugId=09e4c2f0-3bc6-568f-ab64-de6d23e8133a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { t as inspectAction } from "./inspect-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="1bddb0d3-f665-543e-be56-98e8ff256fb6")}catch(e){}}();
|
|
3
|
+
import { t as inspectAction } from "./inspect-DA6s8FhA.js";
|
|
4
4
|
//#region src/cli/commands/why.ts
|
|
5
5
|
/**
|
|
6
6
|
* `why <file:line>` — explains why a rule fired (or why a suppression didn't
|
|
@@ -17,5 +17,5 @@ const whyAction = async (location, options) => {
|
|
|
17
17
|
//#endregion
|
|
18
18
|
export { whyAction };
|
|
19
19
|
|
|
20
|
-
//# sourceMappingURL=why-
|
|
21
|
-
//# debugId=
|
|
20
|
+
//# sourceMappingURL=why-B8uIFoLE.js.map
|
|
21
|
+
//# debugId=1bddb0d3-f665-543e-be56-98e8ff256fb6
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
-
import { D as NANOSECONDS_PER_MILLISECOND,
|
|
4
|
-
import { t as getTelemetryContext } from "./telemetry-runtime-
|
|
2
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="d7d88578-8da6-57a3-a78d-3699c8c84ae8")}catch(e){}}();
|
|
3
|
+
import { D as NANOSECONDS_PER_MILLISECOND, Nn as makeSpan, Qn as void_, Rn as provideContext, Vn as runSync, Zn as fail, c as setSentryProjectInfo, o as buildSentryScope, r as toSpanAttributes, s as buildSentryProjectContext } from "./record-metric-DadXt-YJ.js";
|
|
4
|
+
import { t as getTelemetryContext } from "./telemetry-runtime-DprfIwPW.js";
|
|
5
5
|
import { i as setActiveRunTrace, r as recordRunTraceId } from "./active-run-trace-dlIZeEvb.js";
|
|
6
6
|
//#region src/cli/utils/with-run-span.ts
|
|
7
7
|
/**
|
|
@@ -106,5 +106,5 @@ const recordSentryProjectContext = (projectInfo, rootSpan, options = {}) => {
|
|
|
106
106
|
//#endregion
|
|
107
107
|
export { resetSentryRunState as n, withRunSpan as r, recordSentryProjectContext as t };
|
|
108
108
|
|
|
109
|
-
//# sourceMappingURL=with-run-span-
|
|
110
|
-
//# debugId=
|
|
109
|
+
//# sourceMappingURL=with-run-span-JTZIIQT_.js.map
|
|
110
|
+
//# debugId=d7d88578-8da6-57a3-a78d-3699c8c84ae8
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.9.13-dev.
|
|
3
|
+
"version": "0.9.13-dev.45c0df3",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"typescript": ">=5.0.4 <6",
|
|
69
69
|
"yaml": "^2.9.0",
|
|
70
70
|
"yoga-layout": "~3.2.1",
|
|
71
|
-
"oxlint-plugin-react-doctor": "0.9.13-dev.
|
|
71
|
+
"oxlint-plugin-react-doctor": "0.9.13-dev.45c0df3"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
74
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -81,8 +81,8 @@
|
|
|
81
81
|
"ora": "^9.4.0",
|
|
82
82
|
"react": "19.2.5",
|
|
83
83
|
"react-devtools-core": "^7.0.1",
|
|
84
|
-
"@react-doctor/
|
|
85
|
-
"@react-doctor/
|
|
84
|
+
"@react-doctor/core": "0.9.13",
|
|
85
|
+
"@react-doctor/api": "0.9.13"
|
|
86
86
|
},
|
|
87
87
|
"engines": {
|
|
88
88
|
"node": "^20.19.0 || >=22.13.0"
|
|
@@ -1,216 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="b37f4df2-f905-5bdf-9075-d7d409a6d722")}catch(e){}}();
|
|
3
|
-
import { Kt as highlighter, N as SENTRY_FLUSH_TIMEOUT_MS, a as isEnvFlagEnabled, er as CANONICAL_GITHUB_URL, ft as anonymizeInPlace, hn as scrubSensitivePaths, i as isTelemetryEnabled, o as buildSentryScope, or as DOCS_URL, pt as anonymizeText } from "./record-metric-B6T_Ej33.js";
|
|
4
|
-
import { r as isExpectedUserError } from "./telemetry-runtime-BF83aBFL.js";
|
|
5
|
-
import * as Sentry from "@sentry/node";
|
|
6
|
-
//#region src/cli/utils/scrub-sentry-event.ts
|
|
7
|
-
/**
|
|
8
|
-
* Anonymizes a Sentry event (error or transaction) before it leaves the
|
|
9
|
-
* machine. Strips identity the SDK attaches automatically — the IP-bearing
|
|
10
|
-
* `user`, the `server_name`, and the device `name` (all hostnames) — drops
|
|
11
|
-
* captured local variables (unbounded, un-anonymizable user data), and scrubs
|
|
12
|
-
* home-directory paths + known secrets/emails from every remaining string:
|
|
13
|
-
* messages, stack frames, breadcrumbs, contexts/extra/tags, and span
|
|
14
|
-
* attributes (e.g. the `inspect.directory` path on the bridged `runInspect`
|
|
15
|
-
* span).
|
|
16
|
-
*
|
|
17
|
-
* Wired into both `beforeSend` and `beforeSendTransaction`. If scrubbing ever
|
|
18
|
-
* throws, the event is dropped (`null`) rather than risk sending un-anonymized
|
|
19
|
-
* data — telemetry is best-effort, privacy is not.
|
|
20
|
-
*/
|
|
21
|
-
const scrubSentryEvent = (event) => {
|
|
22
|
-
try {
|
|
23
|
-
delete event.server_name;
|
|
24
|
-
delete event.user;
|
|
25
|
-
const device = event.contexts?.device;
|
|
26
|
-
if (device) delete device.name;
|
|
27
|
-
if (event.contexts) anonymizeInPlace(event.contexts);
|
|
28
|
-
if (event.extra) anonymizeInPlace(event.extra);
|
|
29
|
-
if (event.tags) anonymizeInPlace(event.tags);
|
|
30
|
-
if (typeof event.message === "string") event.message = anonymizeText(event.message);
|
|
31
|
-
for (const breadcrumb of event.breadcrumbs ?? []) {
|
|
32
|
-
if (typeof breadcrumb.message === "string") breadcrumb.message = anonymizeText(breadcrumb.message);
|
|
33
|
-
if (breadcrumb.data) anonymizeInPlace(breadcrumb.data);
|
|
34
|
-
}
|
|
35
|
-
for (const exception of event.exception?.values ?? []) {
|
|
36
|
-
if (typeof exception.value === "string") exception.value = anonymizeText(exception.value);
|
|
37
|
-
for (const frame of exception.stacktrace?.frames ?? []) {
|
|
38
|
-
delete frame.vars;
|
|
39
|
-
if (typeof frame.filename === "string") frame.filename = scrubSensitivePaths(frame.filename);
|
|
40
|
-
if (typeof frame.abs_path === "string") frame.abs_path = scrubSensitivePaths(frame.abs_path);
|
|
41
|
-
if (typeof frame.module === "string") frame.module = scrubSensitivePaths(frame.module);
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
for (const span of event.spans ?? []) {
|
|
45
|
-
if (typeof span.description === "string") span.description = anonymizeText(span.description);
|
|
46
|
-
if (span.data) anonymizeInPlace(span.data);
|
|
47
|
-
}
|
|
48
|
-
return event;
|
|
49
|
-
} catch {
|
|
50
|
-
return null;
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/cli/utils/sentry-config.ts
|
|
55
|
-
/**
|
|
56
|
-
* Shared Sentry configuration resolution — release, environment, and tracing
|
|
57
|
-
* sample rate — derived from `VERSION` and the standard `SENTRY_*` env
|
|
58
|
-
* overrides. Lives apart from `instrument.ts` so this resolution remains
|
|
59
|
-
* independently testable.
|
|
60
|
-
*/
|
|
61
|
-
/**
|
|
62
|
-
* A version is a "dev" build when it's the unbuilt placeholder (`0.0.0`) or
|
|
63
|
-
* carries a prerelease suffix (e.g. the `-dev.<sha>` snapshots published from
|
|
64
|
-
* CI). Everything else is a real, tagged release.
|
|
65
|
-
*/
|
|
66
|
-
const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
67
|
-
/**
|
|
68
|
-
* Sentry release identifier. `react-doctor@<version>` keeps it unique within
|
|
69
|
-
* the org and — crucially — matches the value `scripts/sentry-sourcemaps.mjs`
|
|
70
|
-
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
71
|
-
* standard `SENTRY_RELEASE` override.
|
|
72
|
-
*/
|
|
73
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.9.13-dev.1239043`;
|
|
74
|
-
/**
|
|
75
|
-
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
76
|
-
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
77
|
-
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
78
|
-
*/
|
|
79
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.9.13-dev.1239043") ? "development" : "production");
|
|
80
|
-
//#endregion
|
|
81
|
-
//#region src/instrument.ts
|
|
82
|
-
let isInitialized = false;
|
|
83
|
-
/**
|
|
84
|
-
* Flushes queued Sentry events (errors + transactions) before the CLI exits, so
|
|
85
|
-
* the success-path transaction is delivered. A no-op when Sentry was never
|
|
86
|
-
* initialized, and it swallows transport failures so telemetry can never mask
|
|
87
|
-
* the user's result.
|
|
88
|
-
*/
|
|
89
|
-
const flushSentry = async () => {
|
|
90
|
-
if (!Sentry.isInitialized()) return;
|
|
91
|
-
try {
|
|
92
|
-
await Sentry.flush(SENTRY_FLUSH_TIMEOUT_MS);
|
|
93
|
-
} catch {}
|
|
94
|
-
};
|
|
95
|
-
/**
|
|
96
|
-
* Initializes the Sentry Node SDK for CLI crash reporting and performance
|
|
97
|
-
* crash reporting. Invoked as the first statement of the CLI entry
|
|
98
|
-
* (`cli/index.ts`) so the SDK's global `uncaughtException` /
|
|
99
|
-
* `unhandledRejection` handlers are armed before any command runs.
|
|
100
|
-
*
|
|
101
|
-
* Performance tracing is off: spans are exported to Axiom instead (see
|
|
102
|
-
* `telemetry-runtime.ts`), and Effect has a single `Tracer` reference, so the
|
|
103
|
-
* two backends are mutually exclusive. Sentry keeps what it is good at —
|
|
104
|
-
* symbolicated stack traces, issue grouping, and a quotable event id — while
|
|
105
|
-
* crashes carry the Axiom trace id as a tag so an issue pivots into its trace.
|
|
106
|
-
*
|
|
107
|
-
* Exported as a function rather than a bare side-effecting import because the
|
|
108
|
-
* package declares `"sideEffects": false`, which lets the bundler tree-shake
|
|
109
|
-
* side-effect-only modules. An explicit call keeps the initialization in the
|
|
110
|
-
* published `dist/cli.js`.
|
|
111
|
-
*
|
|
112
|
-
* Scoped to the CLI application only — the programmatic `@react-doctor/api`
|
|
113
|
-
* library never initializes Sentry, so importing `diagnose()` into a consumer
|
|
114
|
-
* app can't hijack their telemetry.
|
|
115
|
-
*
|
|
116
|
-
* Configuration is environment-overridable for self-hosting and tuning:
|
|
117
|
-
* `SENTRY_DSN`, `SENTRY_ENVIRONMENT`, `SENTRY_RELEASE`, and `SENTRY_DEBUG`.
|
|
118
|
-
*/
|
|
119
|
-
const initializeSentry = () => {
|
|
120
|
-
if (isInitialized || !isTelemetryEnabled()) return;
|
|
121
|
-
isInitialized = true;
|
|
122
|
-
const { tags, contexts } = buildSentryScope();
|
|
123
|
-
try {
|
|
124
|
-
Sentry.init({
|
|
125
|
-
dsn: process.env.SENTRY_DSN || "https://f253d570240a59b8dbd77b7a548ef133@o4510226365743104.ingest.us.sentry.io/4511487817809920",
|
|
126
|
-
release: resolveSentryRelease(),
|
|
127
|
-
environment: resolveSentryEnvironment(),
|
|
128
|
-
sendDefaultPii: false,
|
|
129
|
-
tracesSampleRate: 0,
|
|
130
|
-
debug: isEnvFlagEnabled(process.env.SENTRY_DEBUG),
|
|
131
|
-
initialScope: {
|
|
132
|
-
tags,
|
|
133
|
-
contexts
|
|
134
|
-
},
|
|
135
|
-
beforeSend: (event, hint) => isExpectedUserError(hint.originalException) ? null : scrubSentryEvent(event)
|
|
136
|
-
});
|
|
137
|
-
} catch {}
|
|
138
|
-
};
|
|
139
|
-
//#endregion
|
|
140
|
-
//#region src/cli/utils/resolve-measure-width.ts
|
|
141
|
-
const resolveClampedWidth = (input) => {
|
|
142
|
-
const terminalColumns = process.stdout.columns;
|
|
143
|
-
if (!terminalColumns || terminalColumns <= 0) return input.fullWidth;
|
|
144
|
-
const availableColumns = terminalColumns - input.reservedColumns;
|
|
145
|
-
return Math.max(input.minWidth, Math.min(input.fullWidth, availableColumns));
|
|
146
|
-
};
|
|
147
|
-
const resolveMeasureWidth = (reservedColumns = 0) => resolveClampedWidth({
|
|
148
|
-
reservedColumns,
|
|
149
|
-
fullWidth: 60,
|
|
150
|
-
minWidth: 24
|
|
151
|
-
});
|
|
152
|
-
//#endregion
|
|
153
|
-
//#region src/cli/utils/wrap-indented-text.ts
|
|
154
|
-
const wrapLine = (lineText, width, breakLongWords) => {
|
|
155
|
-
if (lineText.length <= width) return [lineText];
|
|
156
|
-
const wrappedLines = [];
|
|
157
|
-
let remainingText = lineText.trim();
|
|
158
|
-
while (remainingText.length > width) {
|
|
159
|
-
const candidateText = remainingText.slice(0, width);
|
|
160
|
-
const breakIndex = candidateText.lastIndexOf(" ");
|
|
161
|
-
if (breakIndex <= 0) {
|
|
162
|
-
if (breakLongWords) {
|
|
163
|
-
wrappedLines.push(candidateText);
|
|
164
|
-
remainingText = remainingText.slice(width).trimStart();
|
|
165
|
-
continue;
|
|
166
|
-
}
|
|
167
|
-
const nextSpace = remainingText.indexOf(" ");
|
|
168
|
-
if (nextSpace === -1) break;
|
|
169
|
-
wrappedLines.push(remainingText.slice(0, nextSpace));
|
|
170
|
-
remainingText = remainingText.slice(nextSpace + 1).trimStart();
|
|
171
|
-
continue;
|
|
172
|
-
}
|
|
173
|
-
wrappedLines.push(remainingText.slice(0, breakIndex));
|
|
174
|
-
remainingText = remainingText.slice(breakIndex + 1).trimStart();
|
|
175
|
-
}
|
|
176
|
-
if (remainingText.length > 0) wrappedLines.push(remainingText);
|
|
177
|
-
return wrappedLines;
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* Greedy word-wrap to a character width, returning one string per line
|
|
181
|
-
* (no indentation applied). Preserves existing `\n` boundaries.
|
|
182
|
-
*/
|
|
183
|
-
const wrapTextToWidth = (text, width, options = {}) => {
|
|
184
|
-
if (width <= 0) return text.split("\n");
|
|
185
|
-
const breakLongWords = options.breakLongWords ?? true;
|
|
186
|
-
return text.split("\n").flatMap((lineText) => wrapLine(lineText, width, breakLongWords));
|
|
187
|
-
};
|
|
188
|
-
//#endregion
|
|
189
|
-
//#region src/cli/utils/build-footer-description-lines.ts
|
|
190
|
-
const FOOTER_DESCRIPTION_INDENT = " ";
|
|
191
|
-
const buildFooterDescriptionLines = (description) => {
|
|
192
|
-
return wrapTextToWidth(description, resolveMeasureWidth(2)).map((line) => highlighter.dim(`${FOOTER_DESCRIPTION_INDENT}${line}`));
|
|
193
|
-
};
|
|
194
|
-
//#endregion
|
|
195
|
-
//#region src/cli/utils/build-footer-link-lines.ts
|
|
196
|
-
const buildFooterLinkLines = ({ shareUrl }) => [
|
|
197
|
-
...shareUrl === null ? [] : [
|
|
198
|
-
` ${highlighter.bold("Share:")} ${highlighter.info(shareUrl)}`,
|
|
199
|
-
...buildFooterDescriptionLines("Tell others how you did on socials"),
|
|
200
|
-
""
|
|
201
|
-
],
|
|
202
|
-
` ${highlighter.bold("Docs:")} ${highlighter.info(DOCS_URL)}`,
|
|
203
|
-
...buildFooterDescriptionLines("Learn more about fixing issues, setting up CI/CD, and configuring rules with a config file"),
|
|
204
|
-
"",
|
|
205
|
-
` ${highlighter.bold("GitHub:")} ${highlighter.info(CANONICAL_GITHUB_URL)}`,
|
|
206
|
-
...buildFooterDescriptionLines("Report issues and star the repository!")
|
|
207
|
-
];
|
|
208
|
-
//#endregion
|
|
209
|
-
//#region src/cli/utils/build-section-divider.ts
|
|
210
|
-
const DIVIDER_INDENT = " ";
|
|
211
|
-
const buildSectionDivider = () => highlighter.dim(`${DIVIDER_INDENT}${"─".repeat(resolveMeasureWidth(2))}`);
|
|
212
|
-
//#endregion
|
|
213
|
-
export { initializeSentry as i, buildFooterLinkLines as n, flushSentry as r, buildSectionDivider as t };
|
|
214
|
-
|
|
215
|
-
//# sourceMappingURL=build-section-divider-C09RcJrc.js.map
|
|
216
|
-
//# debugId=b37f4df2-f905-5bdf-9075-d7d409a6d722
|