react-doctor 0.5.1-dev.486c68f → 0.5.1-dev.a64093c
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/cli.js +67 -48
- package/package.json +4 -4
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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]="
|
|
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]="347b9883-62c3-593b-8f49-2c39d1f4b2a7")}catch(e){}}();
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import * as NodeChildProcess from "node:child_process";
|
|
5
5
|
import { execFile, execFileSync, spawn, spawnSync } from "node:child_process";
|
|
@@ -21009,7 +21009,7 @@ const recurDefaults = /* @__PURE__ */ memoize((ast) => {
|
|
|
21009
21009
|
* @since 4.0.0
|
|
21010
21010
|
*/
|
|
21011
21011
|
function makeEffect(schema) {
|
|
21012
|
-
const parser = run$
|
|
21012
|
+
const parser = run$1(recurDefaults(toType(schema.ast)));
|
|
21013
21013
|
return (input, options) => {
|
|
21014
21014
|
return parser(input, options?.disableChecks ? options?.parseOptions ? {
|
|
21015
21015
|
...options.parseOptions,
|
|
@@ -21054,7 +21054,7 @@ function make$25(schema) {
|
|
|
21054
21054
|
}
|
|
21055
21055
|
/** @internal */
|
|
21056
21056
|
function _is(ast) {
|
|
21057
|
-
const parser = asExit(run$
|
|
21057
|
+
const parser = asExit(run$1(toType(ast)));
|
|
21058
21058
|
return (input) => {
|
|
21059
21059
|
return isSuccess(parser(input, defaultParseOptions));
|
|
21060
21060
|
};
|
|
@@ -21073,7 +21073,7 @@ function _is(ast) {
|
|
|
21073
21073
|
* @since 4.0.0
|
|
21074
21074
|
*/
|
|
21075
21075
|
function decodeUnknownEffect(schema, options) {
|
|
21076
|
-
const parser = run$
|
|
21076
|
+
const parser = run$1(schema.ast);
|
|
21077
21077
|
return options === void 0 ? parser : (input, overrideOptions) => parser(input, mergeParseOptions(options, overrideOptions));
|
|
21078
21078
|
}
|
|
21079
21079
|
/**
|
|
@@ -21104,7 +21104,7 @@ function decodeUnknownOption$1(schema, options) {
|
|
|
21104
21104
|
* @since 4.0.0
|
|
21105
21105
|
*/
|
|
21106
21106
|
function encodeUnknownEffect(schema, options) {
|
|
21107
|
-
const parser = run$
|
|
21107
|
+
const parser = run$1(flip$1(schema.ast));
|
|
21108
21108
|
return options === void 0 ? parser : (input, overrideOptions) => parser(input, mergeParseOptions(options, overrideOptions));
|
|
21109
21109
|
}
|
|
21110
21110
|
/**
|
|
@@ -21126,7 +21126,7 @@ const mergeParseOptions = (options, overrideOptions) => overrideOptions === void
|
|
|
21126
21126
|
...overrideOptions
|
|
21127
21127
|
};
|
|
21128
21128
|
/** @internal */
|
|
21129
|
-
function run$
|
|
21129
|
+
function run$1(ast) {
|
|
21130
21130
|
const parser = recur$1(ast);
|
|
21131
21131
|
return (input, options) => flatMapEager(parser(some(input), options ?? defaultParseOptions), (oa) => {
|
|
21132
21132
|
if (oa._tag === "None") return fail$4(new InvalidValue(oa));
|
|
@@ -28330,7 +28330,7 @@ const ensuring = /* @__PURE__ */ dual(2, (self, finalizer) => fromChannel(ensuri
|
|
|
28330
28330
|
* @category destructors
|
|
28331
28331
|
* @since 2.0.0
|
|
28332
28332
|
*/
|
|
28333
|
-
const run
|
|
28333
|
+
const run = /* @__PURE__ */ dual(2, (self, sink) => scopedWith((scope) => toPullScoped(self.channel, scope).pipe(flatMap$2((upstream) => sink.transform(upstream, scope)), map$3(([a]) => a))));
|
|
28334
28334
|
/**
|
|
28335
28335
|
* Runs the stream and collects all elements into an array.
|
|
28336
28336
|
*
|
|
@@ -35068,7 +35068,7 @@ const layer$3 = /* @__PURE__ */ effect(ChildProcessSpawner, /* @__PURE__ */ gen(
|
|
|
35068
35068
|
evaluate: () => nodeStream,
|
|
35069
35069
|
onError: (error) => toPlatformError(`fromWritable(fd${fd})`, toError(error), command)
|
|
35070
35070
|
});
|
|
35071
|
-
if (config.stream) yield* forkScoped(run
|
|
35071
|
+
if (config.stream) yield* forkScoped(run(config.stream, sink));
|
|
35072
35072
|
inputSinks.set(fd, sink);
|
|
35073
35073
|
break;
|
|
35074
35074
|
}
|
|
@@ -35097,7 +35097,7 @@ const layer$3 = /* @__PURE__ */ effect(ChildProcessSpawner, /* @__PURE__ */ gen(
|
|
|
35097
35097
|
endOnDone: config.endOnDone,
|
|
35098
35098
|
encoding: config.encoding
|
|
35099
35099
|
});
|
|
35100
|
-
if (isStream(config.stream)) return as(forkScoped(run
|
|
35100
|
+
if (isStream(config.stream)) return as(forkScoped(run(config.stream, sink)), sink);
|
|
35101
35101
|
return succeed$2(sink);
|
|
35102
35102
|
});
|
|
35103
35103
|
const setupChildOutputStreams = (command, childProcess, stdoutConfig, stderrConfig) => {
|
|
@@ -43511,6 +43511,7 @@ const isNonInteractiveEnvironment = () => NON_INTERACTIVE_ENVIRONMENT_VARIABLES.
|
|
|
43511
43511
|
//#region src/cli/utils/constants.ts
|
|
43512
43512
|
const STAGED_FILES_TEMP_DIR_PREFIX = "react-doctor-staged-";
|
|
43513
43513
|
const BASELINE_FILES_TEMP_DIR_PREFIX = "react-doctor-baseline-";
|
|
43514
|
+
const GH_DEFAULT_BRANCH_PROBE_TIMEOUT_MS = 5e3;
|
|
43514
43515
|
const CI_TRUST_COMPANIES = "PayPal, Rippling, and Alibaba";
|
|
43515
43516
|
const WELCOME_EXPLANATION_HOLD_MS = 1e3;
|
|
43516
43517
|
const CATEGORY_COUNTUP_SETTLE_HOLD_MS = 1e3;
|
|
@@ -43590,7 +43591,7 @@ const makeNoopConsole = () => ({
|
|
|
43590
43591
|
});
|
|
43591
43592
|
//#endregion
|
|
43592
43593
|
//#region src/cli/utils/version.ts
|
|
43593
|
-
const VERSION = "0.5.1-dev.
|
|
43594
|
+
const VERSION = "0.5.1-dev.a64093c";
|
|
43594
43595
|
//#endregion
|
|
43595
43596
|
//#region src/cli/utils/json-mode.ts
|
|
43596
43597
|
let context = null;
|
|
@@ -43948,13 +43949,13 @@ const isDevVersion = (version) => version === "0.0.0" || version.includes("-");
|
|
|
43948
43949
|
* uploads source-map artifacts under, so stack frames symbolicate. Honors the
|
|
43949
43950
|
* standard `SENTRY_RELEASE` override.
|
|
43950
43951
|
*/
|
|
43951
|
-
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.1-dev.
|
|
43952
|
+
const resolveSentryRelease = () => process.env.SENTRY_RELEASE || `react-doctor@0.5.1-dev.a64093c`;
|
|
43952
43953
|
/**
|
|
43953
43954
|
* Deployment environment shown in Sentry's environment filter. Defaults to
|
|
43954
43955
|
* `production` for tagged releases and `development` for dev/unbuilt versions,
|
|
43955
43956
|
* overridable via the standard `SENTRY_ENVIRONMENT` env var.
|
|
43956
43957
|
*/
|
|
43957
|
-
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.1-dev.
|
|
43958
|
+
const resolveSentryEnvironment = () => process.env.SENTRY_ENVIRONMENT || (isDevVersion("0.5.1-dev.a64093c") ? "development" : "production");
|
|
43958
43959
|
/**
|
|
43959
43960
|
* Performance-tracing sample rate in `[0, 1]`. Reads `SENTRY_TRACES_SAMPLE_RATE`
|
|
43960
43961
|
* (set to `0` to disable tracing) and falls back to
|
|
@@ -49691,7 +49692,7 @@ const installReactDoctorScriptStep = (projectRoot) => {
|
|
|
49691
49692
|
};
|
|
49692
49693
|
//#endregion
|
|
49693
49694
|
//#region src/cli/utils/install-github-workflow.ts
|
|
49694
|
-
const buildWorkflowContent = () => `# React Doctor — finds security, performance, correctness, accessibility,
|
|
49695
|
+
const buildWorkflowContent = (defaultBranch) => `# React Doctor — finds security, performance, correctness, accessibility,
|
|
49695
49696
|
# bundle-size, and architecture issues in React codebases.
|
|
49696
49697
|
#
|
|
49697
49698
|
# Docs: https://www.react.doctor/ci
|
|
@@ -49703,9 +49704,9 @@ on:
|
|
|
49703
49704
|
# Scans the PR's changed files and posts a sticky summary comment listing only the new issues introduced relative to the merge base of the target branch.
|
|
49704
49705
|
pull_request:
|
|
49705
49706
|
types: [opened, synchronize, reopened, ready_for_review]
|
|
49706
|
-
# Scans \`
|
|
49707
|
+
# Scans \`${defaultBranch}\` on every push to track the health-score trend and catch regressions that slipped past PR review.
|
|
49707
49708
|
push:
|
|
49708
|
-
branches: [
|
|
49709
|
+
branches: ["${defaultBranch}"]
|
|
49709
49710
|
|
|
49710
49711
|
permissions:
|
|
49711
49712
|
contents: read
|
|
@@ -49765,7 +49766,7 @@ const upgradeWorkflowActionToV2 = (content) => {
|
|
|
49765
49766
|
changed: upgraded !== content
|
|
49766
49767
|
};
|
|
49767
49768
|
};
|
|
49768
|
-
const installReactDoctorWorkflow = (projectRoot) => {
|
|
49769
|
+
const installReactDoctorWorkflow = (projectRoot, defaultBranch = "main") => {
|
|
49769
49770
|
const workflowPath = getReactDoctorWorkflowPath(projectRoot);
|
|
49770
49771
|
if (NFS.existsSync(workflowPath)) return {
|
|
49771
49772
|
status: "exists",
|
|
@@ -49773,7 +49774,7 @@ const installReactDoctorWorkflow = (projectRoot) => {
|
|
|
49773
49774
|
};
|
|
49774
49775
|
try {
|
|
49775
49776
|
NFS.mkdirSync(Path.dirname(workflowPath), { recursive: true });
|
|
49776
|
-
NFS.writeFileSync(workflowPath, buildWorkflowContent());
|
|
49777
|
+
NFS.writeFileSync(workflowPath, buildWorkflowContent(defaultBranch));
|
|
49777
49778
|
return {
|
|
49778
49779
|
status: "created",
|
|
49779
49780
|
workflowPath
|
|
@@ -49949,19 +49950,14 @@ const askUpgradeActionVersion = async (prompt = prompts) => {
|
|
|
49949
49950
|
return upgradeChoice === UPGRADE_YES_CHOICE ? "yes" : "no";
|
|
49950
49951
|
};
|
|
49951
49952
|
//#endregion
|
|
49952
|
-
//#region src/cli/utils/
|
|
49953
|
-
const NEW_BRANCH_PREFIX = "react-doctor/add-github-actions";
|
|
49954
|
-
const DEFAULT_COMMIT_MESSAGE = "ci: add React Doctor GitHub Actions workflow";
|
|
49955
|
-
const DEFAULT_PR_TITLE = "Add React Doctor to GitHub Actions";
|
|
49956
|
-
const DEFAULT_PR_BODY = `Adds a [React Doctor](https://www.react.doctor) scan to every pull request and every push to the default branch. The workflow file is documented inline.
|
|
49957
|
-
|
|
49958
|
-
Docs: https://www.react.doctor/ci`;
|
|
49953
|
+
//#region src/cli/utils/run-command.ts
|
|
49959
49954
|
const execFileAsync$1 = promisify(execFile);
|
|
49960
|
-
const
|
|
49955
|
+
const runCommand = async (command, args, cwd, timeoutMs) => {
|
|
49961
49956
|
try {
|
|
49962
49957
|
const { stdout, stderr } = await execFileAsync$1(command, [...args], {
|
|
49963
49958
|
cwd,
|
|
49964
|
-
encoding: "utf8"
|
|
49959
|
+
encoding: "utf8",
|
|
49960
|
+
timeout: timeoutMs
|
|
49965
49961
|
});
|
|
49966
49962
|
return {
|
|
49967
49963
|
success: true,
|
|
@@ -49977,7 +49973,18 @@ const run = async (command, args, cwd) => {
|
|
|
49977
49973
|
};
|
|
49978
49974
|
}
|
|
49979
49975
|
};
|
|
49980
|
-
|
|
49976
|
+
//#endregion
|
|
49977
|
+
//#region src/cli/utils/detect-default-branch.ts
|
|
49978
|
+
const detectDefaultBranch = async (cwd, run = runCommand) => {
|
|
49979
|
+
const repoView = await run("gh", [
|
|
49980
|
+
"repo",
|
|
49981
|
+
"view",
|
|
49982
|
+
"--json",
|
|
49983
|
+
"defaultBranchRef",
|
|
49984
|
+
"--jq",
|
|
49985
|
+
".defaultBranchRef.name"
|
|
49986
|
+
], cwd, GH_DEFAULT_BRANCH_PROBE_TIMEOUT_MS);
|
|
49987
|
+
if (repoView.success && repoView.stdout !== "" && repoView.stdout !== "null") return repoView.stdout;
|
|
49981
49988
|
const symRef = await run("git", ["symbolic-ref", "refs/remotes/origin/HEAD"], cwd);
|
|
49982
49989
|
if (symRef.success) {
|
|
49983
49990
|
const branchMatch = symRef.stdout.match(/refs\/remotes\/origin\/(.+)$/);
|
|
@@ -49995,8 +50002,16 @@ const detectDefaultBranch = async (cwd) => {
|
|
|
49995
50002
|
], cwd)).success) return "master";
|
|
49996
50003
|
return null;
|
|
49997
50004
|
};
|
|
50005
|
+
//#endregion
|
|
50006
|
+
//#region src/cli/utils/open-workflow-pull-request.ts
|
|
50007
|
+
const NEW_BRANCH_PREFIX = "react-doctor/add-github-actions";
|
|
50008
|
+
const DEFAULT_COMMIT_MESSAGE = "ci: add React Doctor GitHub Actions workflow";
|
|
50009
|
+
const DEFAULT_PR_TITLE = "Add React Doctor to GitHub Actions";
|
|
50010
|
+
const DEFAULT_PR_BODY = `Adds a [React Doctor](https://www.react.doctor) scan to every pull request and every push to the default branch. The workflow file is documented inline.
|
|
50011
|
+
|
|
50012
|
+
Docs: https://www.react.doctor/ci`;
|
|
49998
50013
|
const findUniqueBranchName = async (cwd) => {
|
|
49999
|
-
if (!(await
|
|
50014
|
+
if (!(await runCommand("git", [
|
|
50000
50015
|
"rev-parse",
|
|
50001
50016
|
"--verify",
|
|
50002
50017
|
NEW_BRANCH_PREFIX
|
|
@@ -50008,7 +50023,7 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50008
50023
|
const commitMessage = params.commitMessage ?? DEFAULT_COMMIT_MESSAGE;
|
|
50009
50024
|
const prTitle = params.prTitle ?? DEFAULT_PR_TITLE;
|
|
50010
50025
|
const prBody = params.prBody ?? DEFAULT_PR_BODY;
|
|
50011
|
-
const repoRootProbe = await
|
|
50026
|
+
const repoRootProbe = await runCommand("git", ["rev-parse", "--show-toplevel"], Path.dirname(workflowPath));
|
|
50012
50027
|
if (!repoRootProbe.success) return {
|
|
50013
50028
|
status: "not-attempted",
|
|
50014
50029
|
reason: "not-a-git-repo"
|
|
@@ -50018,16 +50033,16 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50018
50033
|
status: "not-attempted",
|
|
50019
50034
|
reason: "gh-not-installed"
|
|
50020
50035
|
};
|
|
50021
|
-
if (!(await
|
|
50036
|
+
if (!(await runCommand("gh", ["auth", "status"], cwd)).success) return {
|
|
50022
50037
|
status: "not-attempted",
|
|
50023
50038
|
reason: "gh-not-authenticated"
|
|
50024
50039
|
};
|
|
50025
|
-
const defaultBranch = await detectDefaultBranch(cwd);
|
|
50040
|
+
const defaultBranch = params.baseBranch ?? await detectDefaultBranch(cwd);
|
|
50026
50041
|
if (!defaultBranch) return {
|
|
50027
50042
|
status: "not-attempted",
|
|
50028
50043
|
reason: "no-default-branch"
|
|
50029
50044
|
};
|
|
50030
|
-
const previousBranchProbe = await
|
|
50045
|
+
const previousBranchProbe = await runCommand("git", [
|
|
50031
50046
|
"rev-parse",
|
|
50032
50047
|
"--abbrev-ref",
|
|
50033
50048
|
"HEAD"
|
|
@@ -50037,13 +50052,13 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50037
50052
|
reason: "detached-head"
|
|
50038
50053
|
};
|
|
50039
50054
|
const previousBranch = previousBranchProbe.stdout;
|
|
50040
|
-
await
|
|
50055
|
+
await runCommand("git", [
|
|
50041
50056
|
"fetch",
|
|
50042
50057
|
"origin",
|
|
50043
50058
|
defaultBranch
|
|
50044
50059
|
], cwd);
|
|
50045
50060
|
const newBranch = await findUniqueBranchName(cwd);
|
|
50046
|
-
if (!(await
|
|
50061
|
+
if (!(await runCommand("git", [
|
|
50047
50062
|
"checkout",
|
|
50048
50063
|
"-b",
|
|
50049
50064
|
newBranch,
|
|
@@ -50053,14 +50068,14 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50053
50068
|
reason: "checkout-failed"
|
|
50054
50069
|
};
|
|
50055
50070
|
const restoreToPreviousBranch = async (deleteNewBranch) => {
|
|
50056
|
-
await
|
|
50057
|
-
if (deleteNewBranch) await
|
|
50071
|
+
await runCommand("git", ["checkout", previousBranch], cwd);
|
|
50072
|
+
if (deleteNewBranch) await runCommand("git", [
|
|
50058
50073
|
"branch",
|
|
50059
50074
|
"-D",
|
|
50060
50075
|
newBranch
|
|
50061
50076
|
], cwd);
|
|
50062
50077
|
};
|
|
50063
|
-
if (!(await
|
|
50078
|
+
if (!(await runCommand("git", [
|
|
50064
50079
|
"add",
|
|
50065
50080
|
"--",
|
|
50066
50081
|
Path.relative(cwd, workflowPath)
|
|
@@ -50071,7 +50086,7 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50071
50086
|
reason: "git-add-failed"
|
|
50072
50087
|
};
|
|
50073
50088
|
}
|
|
50074
|
-
if (!(await
|
|
50089
|
+
if (!(await runCommand("git", [
|
|
50075
50090
|
"commit",
|
|
50076
50091
|
"-m",
|
|
50077
50092
|
commitMessage
|
|
@@ -50082,7 +50097,7 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50082
50097
|
reason: "git-commit-failed"
|
|
50083
50098
|
};
|
|
50084
50099
|
}
|
|
50085
|
-
if (!(await
|
|
50100
|
+
if (!(await runCommand("git", [
|
|
50086
50101
|
"push",
|
|
50087
50102
|
"-u",
|
|
50088
50103
|
"origin",
|
|
@@ -50094,7 +50109,7 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50094
50109
|
reason: "git-push-failed"
|
|
50095
50110
|
};
|
|
50096
50111
|
}
|
|
50097
|
-
const prCreate = await
|
|
50112
|
+
const prCreate = await runCommand("gh", [
|
|
50098
50113
|
"pr",
|
|
50099
50114
|
"create",
|
|
50100
50115
|
"--title",
|
|
@@ -50118,9 +50133,9 @@ const openWorkflowPullRequest = async (params) => {
|
|
|
50118
50133
|
};
|
|
50119
50134
|
const stageWorkflowFile = async (params) => {
|
|
50120
50135
|
const workflowPath = Path.resolve(params.workflowPath);
|
|
50121
|
-
const repoRootProbe = await
|
|
50136
|
+
const repoRootProbe = await runCommand("git", ["rev-parse", "--show-toplevel"], Path.dirname(workflowPath));
|
|
50122
50137
|
if (!repoRootProbe.success) return false;
|
|
50123
|
-
return (await
|
|
50138
|
+
return (await runCommand("git", [
|
|
50124
50139
|
"add",
|
|
50125
50140
|
"--",
|
|
50126
50141
|
Path.relative(repoRootProbe.stdout, workflowPath)
|
|
@@ -50149,7 +50164,8 @@ const setUpGitHubActions = async (options) => {
|
|
|
50149
50164
|
installReactDoctorScriptStep(projectRoot);
|
|
50150
50165
|
} catch {}
|
|
50151
50166
|
const workflowSpinner = spinner("Adding GitHub Actions workflow...").start();
|
|
50152
|
-
const
|
|
50167
|
+
const defaultBranch = await detectDefaultBranch(projectRoot) ?? "main";
|
|
50168
|
+
const workflowResult = installReactDoctorWorkflow(projectRoot, defaultBranch);
|
|
50153
50169
|
const didCreateWorkflow = reportWorkflowResult(workflowSpinner, workflowResult, projectRoot);
|
|
50154
50170
|
cliLogger.break();
|
|
50155
50171
|
if (workflowResult.status === "failed") {
|
|
@@ -50158,7 +50174,10 @@ const setUpGitHubActions = async (options) => {
|
|
|
50158
50174
|
}
|
|
50159
50175
|
if (workflowResult.status === "created") {
|
|
50160
50176
|
const pullRequestSpinner = spinner("Opening a pull request for review...").start();
|
|
50161
|
-
const pullRequestResult = await openWorkflowPullRequest({
|
|
50177
|
+
const pullRequestResult = await openWorkflowPullRequest({
|
|
50178
|
+
workflowPath: workflowResult.workflowPath,
|
|
50179
|
+
baseBranch: defaultBranch
|
|
50180
|
+
});
|
|
50162
50181
|
if (pullRequestResult.status === "pr-opened") pullRequestSpinner.succeed(`Opened pull request for review: ${highlighter.info(pullRequestResult.url)}`);
|
|
50163
50182
|
else if (pullRequestResult.status === "branch-pushed") pullRequestSpinner.warn(`Pushed branch ${highlighter.bold(pullRequestResult.branch)} but couldn't open a PR. Open one with: gh pr create --head ${pullRequestResult.branch}`);
|
|
50164
50183
|
else {
|
|
@@ -50999,8 +51018,8 @@ const installReactDoctorAgentHooksStep = (projectRoot, selectedAgents) => {
|
|
|
50999
51018
|
throw error;
|
|
51000
51019
|
}
|
|
51001
51020
|
};
|
|
51002
|
-
const installReactDoctorWorkflowStep = (projectRoot) => {
|
|
51003
|
-
return reportWorkflowResult(spinner("Adding GitHub Actions workflow...").start(), installReactDoctorWorkflow(projectRoot), projectRoot);
|
|
51021
|
+
const installReactDoctorWorkflowStep = async (projectRoot) => {
|
|
51022
|
+
return reportWorkflowResult(spinner("Adding GitHub Actions workflow...").start(), installReactDoctorWorkflow(projectRoot, await detectDefaultBranch(projectRoot) ?? void 0), projectRoot);
|
|
51004
51023
|
};
|
|
51005
51024
|
const upgradeReactDoctorWorkflowStep = (projectRoot) => {
|
|
51006
51025
|
const workflowSpinner = spinner("Upgrading GitHub Actions workflow to v2...").start();
|
|
@@ -51068,7 +51087,7 @@ const runInstallReactDoctor = async (options = {}) => {
|
|
|
51068
51087
|
let didInstallWorkflow = false;
|
|
51069
51088
|
if (!options.dryRun && (shouldInstallWorkflow || shouldUpgradeWorkflow)) {
|
|
51070
51089
|
cliLogger.break();
|
|
51071
|
-
if (shouldInstallWorkflow) didInstallWorkflow = installReactDoctorWorkflowStep(projectRoot);
|
|
51090
|
+
if (shouldInstallWorkflow) didInstallWorkflow = await installReactDoctorWorkflowStep(projectRoot);
|
|
51072
51091
|
else if (upgradeReactDoctorWorkflowStep(projectRoot)) recordActionUpgradeDecision(projectRoot, "accepted");
|
|
51073
51092
|
}
|
|
51074
51093
|
const setupActionChoices = [...gitHookPath === null || gitHookPath === void 0 ? [] : [{
|
|
@@ -53357,4 +53376,4 @@ Promise.resolve().then(() => assertNoRemovedFlags(process.argv)).then(() => prog
|
|
|
53357
53376
|
export {};
|
|
53358
53377
|
|
|
53359
53378
|
//# sourceMappingURL=cli.js.map
|
|
53360
|
-
//# debugId=
|
|
53379
|
+
//# debugId=347b9883-62c3-593b-8f49-2c39d1f4b2a7
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-doctor",
|
|
3
|
-
"version": "0.5.1-dev.
|
|
3
|
+
"version": "0.5.1-dev.a64093c",
|
|
4
4
|
"description": "Your agent writes bad React. This catches it",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"accessibility",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"vscode-languageserver": "^9.0.1",
|
|
65
65
|
"vscode-languageserver-textdocument": "^1.0.12",
|
|
66
66
|
"vscode-uri": "^3.1.0",
|
|
67
|
-
"oxlint-plugin-react-doctor": "0.5.1-dev.
|
|
67
|
+
"oxlint-plugin-react-doctor": "0.5.1-dev.a64093c"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
70
|
"@types/babel__code-frame": "^7.27.0",
|
|
@@ -72,9 +72,9 @@
|
|
|
72
72
|
"@xterm/headless": "^6.0.0",
|
|
73
73
|
"commander": "^14.0.3",
|
|
74
74
|
"ora": "^9.4.0",
|
|
75
|
+
"@react-doctor/api": "0.5.1",
|
|
75
76
|
"@react-doctor/core": "0.5.1",
|
|
76
|
-
"@react-doctor/language-server": "0.5.1"
|
|
77
|
-
"@react-doctor/api": "0.5.1"
|
|
77
|
+
"@react-doctor/language-server": "0.5.1"
|
|
78
78
|
},
|
|
79
79
|
"engines": {
|
|
80
80
|
"node": "^20.19.0 || >=22.13.0"
|