@colrealpro/react-luau-doctor 0.17.0 → 0.17.2
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/README.md +20 -12
- package/dist/cli.js +6955 -6818
- package/dist/cli.js.map +28 -26
- package/dist/scan-worker.js +6510 -0
- package/dist/scan-worker.js.map +41 -0
- package/docs/ci.md +11 -15
- package/docs/cli.md +4 -4
- package/docs/development.md +18 -17
- package/docs/rules.md +1 -1
- package/package.json +6 -7
- package/action.yml +0 -71
- package/dist/runtime-lock.json +0 -29
package/docs/ci.md
CHANGED
|
@@ -4,13 +4,13 @@ There are two workflows to distinguish: this repository's own build/test CI, and
|
|
|
4
4
|
|
|
5
5
|
## Install into a Roblox repository
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Run React-Luau Doctor as described in the [README](../README.md). From the Roblox repository, run:
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
10
|
react-luau-doctor ci install --yes
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
Commit
|
|
13
|
+
Commit `.github/workflows/react-luau-doctor.yml`. The generated workflow installs Bun, then runs the exact npm package version that generated the workflow, for example `@colrealpro/react-luau-doctor@<version>`. This keeps CI reproducible without committing Doctor's bundle, parser grammar, or dependencies into your repository.
|
|
14
14
|
|
|
15
15
|
The workflow checks out full Git history. Pull requests use `changed` scope by default. Pushes to `main` run a full advisory scan. Change the branch trigger if your default branch has another name.
|
|
16
16
|
|
|
@@ -31,24 +31,20 @@ Fork PR tokens commonly lack write permissions. Reporting failures are logged wh
|
|
|
31
31
|
|
|
32
32
|
## Upgrade
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
Run the latest Doctor version, then regenerate the managed workflow:
|
|
35
35
|
|
|
36
36
|
```bash
|
|
37
|
-
react-luau-doctor ci upgrade --yes
|
|
37
|
+
bunx @colrealpro/react-luau-doctor@latest ci upgrade --yes
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
This
|
|
40
|
+
This preserves supported workflow settings while updating the pinned npm version. Review and commit the generated change. `ci config` also regenerates the managed workflow using the version of Doctor that invokes it. Keep custom workflow logic in a separate workflow.
|
|
41
41
|
|
|
42
|
-
`ci install` and `ci upgrade` accept `--pr`, which uses authenticated GitHub CLI access to create a branch, commit generated files, push, and open a PR. Omit it when you want to review the
|
|
43
|
-
|
|
44
|
-
## Direct repository Action
|
|
45
|
-
|
|
46
|
-
After publishing this repository, you can reference its root `action.yml` instead of committing a runtime copy. Select an existing commit or release tag from `colrealpro/react-luau-doctor`; no release tag is assumed to exist yet. Pinning a full commit SHA also pins `dist/cli.js`.
|
|
47
|
-
|
|
48
|
-
Your workflow must check out the target repository with `fetch-depth: 0`, set the required permissions, then call the Action. Inputs are `directory`, `project`, `scope`, `blocking`, `comment`, `review-comments`, and `commit-status`. Input values pass through environment variables before shell invocation.
|
|
42
|
+
`ci install` and `ci upgrade` accept `--pr`, which uses authenticated GitHub CLI access to create a branch, commit generated files, push, and open a PR. Omit it when you want to review the file locally first.
|
|
49
43
|
|
|
50
44
|
## Outputs
|
|
51
45
|
|
|
46
|
+
The generated GitHub step has the id `doctor` and writes these outputs through `GITHUB_OUTPUT`, so later steps in the same job can read values such as `${{ steps.doctor.outputs.score }}`.
|
|
47
|
+
|
|
52
48
|
| Output | Meaning |
|
|
53
49
|
| --- | --- |
|
|
54
50
|
| `score` | Heuristic score for the reported findings. |
|
|
@@ -64,10 +60,10 @@ Your workflow must check out the target repository with `fetch-depth: 0`, set th
|
|
|
64
60
|
react-luau-doctor ci install --provider gitlab --blocking error --yes
|
|
65
61
|
```
|
|
66
62
|
|
|
67
|
-
Commit `.gitlab-ci.yml
|
|
63
|
+
Commit `.gitlab-ci.yml`. The generated job uses a pinned Bun image and runs the exact npm package version that generated the workflow. It does not publish merge-request comments or statuses. Full Git history is requested; explicitly adapt the comparison base to your merge-request workflow if needed. Existing unrelated `.gitlab-ci.yml` files are not overwritten.
|
|
68
64
|
|
|
69
65
|
## Verification
|
|
70
66
|
|
|
71
|
-
The test suite simulates GitHub API requests for summary creation and updates, review replacement, commit statuses,
|
|
67
|
+
The test suite simulates GitHub API requests for summary creation and updates, review replacement, commit statuses, forbidden responses, generated workflow behavior, and shell input handling. Package verification also checks that `ci install` from the packed distribution generates a version-pinned npm workflow without vendoring Doctor into the target repository.
|
|
72
68
|
|
|
73
|
-
Before enabling a required check, run real PRs in your repository that introduce an error, repair it, delete an affected component, and originate from a fork. Confirm the gate, outputs, comments, and status behavior. Local simulation does not validate GitHub account permissions or hosted
|
|
69
|
+
Before enabling a required check, run real PRs in your repository that introduce an error, repair it, delete an affected component, and originate from a fork. Confirm the gate, outputs, comments, and status behavior. Local simulation does not validate GitHub account permissions or hosted-runner behavior.
|
package/docs/cli.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# CLI and configuration
|
|
2
2
|
|
|
3
|
-
Examples
|
|
3
|
+
Examples use the installed `react-luau-doctor` command. For one-off use, run the same arguments through `bunx @colrealpro/react-luau-doctor` or `npx @colrealpro/react-luau-doctor`; Bun must be installed either way.
|
|
4
4
|
|
|
5
5
|
## Scan targets
|
|
6
6
|
|
|
@@ -50,7 +50,7 @@ Use `--category Hooks`, repeatable for multiple categories, or `--min-severity w
|
|
|
50
50
|
|
|
51
51
|
## Configuration
|
|
52
52
|
|
|
53
|
-
Doctor reads `react-luau-doctor.config.json
|
|
53
|
+
Doctor reads `react-luau-doctor.config.json` from the directory where the command is run. It does not search ancestor directories for local scan configuration.
|
|
54
54
|
|
|
55
55
|
```json
|
|
56
56
|
{
|
|
@@ -64,7 +64,7 @@ Doctor reads `react-luau-doctor.config.json`, falling back to `doctor.config.jso
|
|
|
64
64
|
}
|
|
65
65
|
```
|
|
66
66
|
|
|
67
|
-
A rule setting is `error`, `warning`, `suggestion`, or `off`. An explicit severity applies to every finding from that rule, including findings normally downgraded for uncertainty. Without an override, individual findings may have lower severity than the rule default. Unknown rule IDs produce an error.
|
|
67
|
+
A rule setting is `error`, `warning`, `suggestion`, or `off`. An explicit severity applies to every finding from that rule, including findings normally downgraded for uncertainty. Without an override, individual findings may have lower severity than the rule default. Unknown rule IDs produce an error.
|
|
68
68
|
|
|
69
69
|
Patterns support `*`, `**`, and `?`; they are not full gitignore syntax. `**/` can match zero directories. Paths are relative to the scan project root.
|
|
70
70
|
|
|
@@ -112,4 +112,4 @@ Doctor stores an incremental cache outside the scanned repository:
|
|
|
112
112
|
|
|
113
113
|
Set `REACT_LUAU_DOCTOR_CACHE_DIR` to choose a location. Use `--no-cache` or `REACT_LUAU_DOCTOR_DISABLE_CACHE=1` to bypass it. Cache entries can include source-derived information, so treat the directory as local project data.
|
|
114
114
|
|
|
115
|
-
For the complete option list, run `react-luau-doctor --help`.
|
|
115
|
+
For the complete option list, run `react-luau-doctor --help`.
|
package/docs/development.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
# Development and releases
|
|
2
2
|
|
|
3
|
-
Use Bun 1.
|
|
3
|
+
Use Bun 1.4.0 for reproducible release builds. Newer Bun versions can run the CLI, but bundle output can vary with the builder version. Git is required by the scoped-scan tests. Package verification needs `tar` and registry access. It uses npm when available, otherwise runs npm through Bun.
|
|
4
4
|
|
|
5
5
|
## Work locally
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
bun install --frozen-lockfile
|
|
9
|
-
bun run build
|
|
10
9
|
bun run check
|
|
11
10
|
bun test
|
|
11
|
+
bun run build
|
|
12
12
|
```
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
`bun test` runs fixture-based rules, Git scope cases, configuration tests, CLI subprocesses, generated CI tests, and simulated GitHub API reporting. The API tests bind only to loopback and use a test token.
|
|
15
15
|
|
|
16
|
-
|
|
16
|
+
`dist/` is generated output and should not be committed. Keep `vendor/` and `bun.lock` tracked. npm's `prepack` hook rebuilds `dist/` before packing or publishing.
|
|
17
17
|
|
|
18
18
|
## Source layout
|
|
19
19
|
|
|
@@ -26,10 +26,10 @@ Only `node_modules/` is ignored. Keep `dist/`, `vendor/`, and both lockfiles tra
|
|
|
26
26
|
| `src/project-effects.ts` | Source-visible effects and propagation. |
|
|
27
27
|
| `src/rules/` | Rule definitions and repair guidance. |
|
|
28
28
|
| `src/git.ts`, `src/scope.ts` | Git content selection and comparisons. |
|
|
29
|
-
| `src/ci.ts` | Generated workflows,
|
|
29
|
+
| `src/ci.ts` | Generated workflows, npm version pinning, GitHub reporting. |
|
|
30
30
|
| `vendor/` | Luau parser grammar and its license. |
|
|
31
31
|
|
|
32
|
-
The build bundles `src/cli.ts` into `dist/cli.js`, leaving runtime dependencies external.
|
|
32
|
+
The build bundles `src/cli.ts` into `dist/cli.js`, leaving runtime dependencies external. `dist/` exists for the npm distribution, where the package `bin` points at `dist/cli.js`; it is not a source-controlled CI runtime. The parser locates its grammar relative to the published package layout.
|
|
33
33
|
|
|
34
34
|
## Change a rule
|
|
35
35
|
|
|
@@ -39,23 +39,24 @@ Check a proposed repair in Roblox where runtime behavior matters. Tests of synta
|
|
|
39
39
|
|
|
40
40
|
## Change CI
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Generated GitHub and GitLab workflows pin `${package name}@${package version}` from `package.json` and resolve the package from npm at run time. Keep the package version pin exact rather than using `latest` in generated CI, so a repository only changes analyzer versions when its workflow is regenerated.
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Pass variable workflow values through environment variables rather than interpolating them directly into shell source. Tests cover generated settings, package pinning, and shell metacharacters.
|
|
45
45
|
|
|
46
|
-
Repository CI typechecks, tests,
|
|
46
|
+
Repository CI typechecks, tests, builds, and verifies the packed npm distribution. `dist/` is ignored, so CI does not compare generated bundle bytes against committed artifacts.
|
|
47
47
|
|
|
48
48
|
## Release checklist
|
|
49
49
|
|
|
50
|
-
1. Update
|
|
51
|
-
2. Build with Bun 1.
|
|
52
|
-
3. Run `
|
|
53
|
-
4.
|
|
54
|
-
5. Commit source, documentation, and
|
|
55
|
-
6.
|
|
56
|
-
7.
|
|
50
|
+
1. Update the version in `package.json`. A version change also invalidates persistent analysis caches.
|
|
51
|
+
2. Build with Bun 1.4.0 and run the full local checks with `bun run ci`.
|
|
52
|
+
3. Run `npm pack --dry-run` to inspect the package list. It must include `dist/cli.js`, the grammar, license notices, and docs, while excluding tests, dependencies, development-only source files, and CI-only runtime copies.
|
|
53
|
+
4. Run `bun run verify:package` to pack, install, scan, and generate CI from an isolated tarball.
|
|
54
|
+
5. Commit source, documentation, and lockfile changes, then push to `colrealpro/react-luau-doctor` and wait for repository CI. Do not commit `dist/`.
|
|
55
|
+
6. Publish the verified npm version and confirm `bunx @colrealpro/react-luau-doctor@<version> --version` resolves from the registry.
|
|
56
|
+
7. Generate CI from the published version and test real PR reporting plus a fork PR in a disposable repository before recommending required checks.
|
|
57
|
+
8. Create the matching release tag after the published package and hosted CI behavior are verified.
|
|
57
58
|
|
|
58
|
-
|
|
59
|
+
npm distributes the developer CLI; it does not install a runtime library into Roblox. Release commands are still manual: this checkout does not publish packages, create releases, or push changes automatically.
|
|
59
60
|
|
|
60
61
|
## Report a problem
|
|
61
62
|
|
package/docs/rules.md
CHANGED
|
@@ -53,4 +53,4 @@ Errors, warnings, and suggestions express reporting policy, not proof of a runti
|
|
|
53
53
|
|
|
54
54
|
The Binding candidate rule is suggestion-tier because the consumer may require ordinary state or a larger refactor. Array-index keys can also be intentional for collections with stable ordering. See [analysis limits](analysis.md) and [configuration](cli.md).
|
|
55
55
|
|
|
56
|
-
Instance creation and tween operations during render are reported by `react-luau/no-side-effects-in-render
|
|
56
|
+
Instance creation and tween operations during render are reported by `react-luau/no-side-effects-in-render` and use that rule's severity and configuration.
|
package/package.json
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "0.17.
|
|
7
|
-
"description": "
|
|
6
|
+
"version": "0.17.2",
|
|
7
|
+
"description": "Static analysis for React-Luau hooks, effects, rendering, and performance.",
|
|
8
8
|
"license": "MIT",
|
|
9
9
|
"type": "module",
|
|
10
10
|
"bin": {
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"README.md",
|
|
17
17
|
"LICENSE",
|
|
18
18
|
"THIRD_PARTY_NOTICES.md",
|
|
19
|
-
"docs"
|
|
20
|
-
"action.yml"
|
|
19
|
+
"docs"
|
|
21
20
|
],
|
|
22
21
|
"scripts": {
|
|
23
22
|
"build": "bun run scripts/build.ts",
|
|
@@ -29,14 +28,14 @@
|
|
|
29
28
|
"verify:package": "bun run build && bun run scripts/verify-package.ts"
|
|
30
29
|
},
|
|
31
30
|
"engines": {
|
|
32
|
-
"bun": ">=1.
|
|
31
|
+
"bun": ">=1.4.0"
|
|
33
32
|
},
|
|
34
|
-
"packageManager": "bun@1.
|
|
33
|
+
"packageManager": "bun@1.4.0",
|
|
35
34
|
"dependencies": {
|
|
36
35
|
"web-tree-sitter": "0.26.11"
|
|
37
36
|
},
|
|
38
37
|
"devDependencies": {
|
|
39
|
-
"@types/bun": "1.
|
|
38
|
+
"@types/bun": "1.4.0",
|
|
40
39
|
"typescript": "5.8.3"
|
|
41
40
|
},
|
|
42
41
|
"keywords": [
|
package/action.yml
DELETED
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
name: React-Luau Doctor
|
|
2
|
-
description: "Review React-Luau pull requests and report introduced diagnostics."
|
|
3
|
-
inputs:
|
|
4
|
-
blocking:
|
|
5
|
-
description: "Severity that fails the workflow: error, warning, or none."
|
|
6
|
-
default: none
|
|
7
|
-
scope:
|
|
8
|
-
description: "Pull request scan scope: changed, files, lines, or full."
|
|
9
|
-
default: changed
|
|
10
|
-
comment:
|
|
11
|
-
description: "Create or update a sticky pull request summary comment."
|
|
12
|
-
default: "true"
|
|
13
|
-
review-comments:
|
|
14
|
-
description: "Post inline review comments on changed lines."
|
|
15
|
-
default: "true"
|
|
16
|
-
commit-status:
|
|
17
|
-
description: "Publish score and issue counts as a commit status."
|
|
18
|
-
default: "true"
|
|
19
|
-
project:
|
|
20
|
-
description: "Project directories to scan, comma-separated. Asterisk scans the whole directory."
|
|
21
|
-
default: "*"
|
|
22
|
-
directory:
|
|
23
|
-
description: "Project directory to scan."
|
|
24
|
-
default: "."
|
|
25
|
-
outputs:
|
|
26
|
-
score:
|
|
27
|
-
description: "Health score from 0 to 100."
|
|
28
|
-
value: ${{ steps.doctor.outputs.score }}
|
|
29
|
-
total-issues:
|
|
30
|
-
description: "Total diagnostics reported by this run."
|
|
31
|
-
value: ${{ steps.doctor.outputs.total-issues }}
|
|
32
|
-
fixed-issues:
|
|
33
|
-
description: "Number of diagnostics resolved by the pull request."
|
|
34
|
-
value: ${{ steps.doctor.outputs.fixed-issues }}
|
|
35
|
-
error-count:
|
|
36
|
-
description: "Error diagnostic count."
|
|
37
|
-
value: ${{ steps.doctor.outputs.error-count }}
|
|
38
|
-
warning-count:
|
|
39
|
-
description: "Warning diagnostic count."
|
|
40
|
-
value: ${{ steps.doctor.outputs.warning-count }}
|
|
41
|
-
affected-files:
|
|
42
|
-
description: "Number of files with diagnostics."
|
|
43
|
-
value: ${{ steps.doctor.outputs.affected-files }}
|
|
44
|
-
runs:
|
|
45
|
-
using: composite
|
|
46
|
-
steps:
|
|
47
|
-
- uses: oven-sh/setup-bun@v2
|
|
48
|
-
with:
|
|
49
|
-
bun-version: "1.3.14"
|
|
50
|
-
- name: Install parser runtime
|
|
51
|
-
shell: bash
|
|
52
|
-
run: |
|
|
53
|
-
cd "$GITHUB_ACTION_PATH"
|
|
54
|
-
bun install --production --frozen-lockfile
|
|
55
|
-
- id: doctor
|
|
56
|
-
shell: bash
|
|
57
|
-
env:
|
|
58
|
-
GITHUB_TOKEN: ${{ github.token }}
|
|
59
|
-
DOCTOR_DIRECTORY: ${{ inputs.directory }}
|
|
60
|
-
DOCTOR_PROJECT: ${{ inputs.project }}
|
|
61
|
-
DOCTOR_BLOCKING: ${{ inputs.blocking }}
|
|
62
|
-
DOCTOR_SCOPE: ${{ inputs.scope }}
|
|
63
|
-
run: >-
|
|
64
|
-
bun "$GITHUB_ACTION_PATH/dist/cli.js" ci run
|
|
65
|
-
--directory "$DOCTOR_DIRECTORY"
|
|
66
|
-
--project "$DOCTOR_PROJECT"
|
|
67
|
-
--blocking "$DOCTOR_BLOCKING"
|
|
68
|
-
--scope "$DOCTOR_SCOPE"
|
|
69
|
-
${{ inputs.comment == 'true' && '--comment' || '--no-comment' }}
|
|
70
|
-
${{ inputs.review-comments == 'true' && '--review-comments' || '--no-review-comments' }}
|
|
71
|
-
${{ inputs.commit-status == 'true' && '--commit-status' || '--no-commit-status' }}
|
package/dist/runtime-lock.json
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"lockfileVersion": 1,
|
|
3
|
-
"configVersion": 1,
|
|
4
|
-
"workspaces": {
|
|
5
|
-
"": {
|
|
6
|
-
"name": "react-luau-doctor",
|
|
7
|
-
"dependencies": {
|
|
8
|
-
"web-tree-sitter": "0.26.11",
|
|
9
|
-
},
|
|
10
|
-
"devDependencies": {
|
|
11
|
-
"@types/bun": "1.3.14",
|
|
12
|
-
"typescript": "5.8.3",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
"packages": {
|
|
17
|
-
"@types/bun": ["@types/bun@1.3.14", "https://registry.npmjs.org/@types/bun/-/bun-1.3.14.tgz", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="],
|
|
18
|
-
|
|
19
|
-
"@types/node": ["@types/node@26.1.1", "https://registry.npmjs.org/@types/node/-/node-26.1.1.tgz", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-nxAkRSVkN1Y0JC1W8ky/fTfkGsMmcrRsbx+3XoZE+rMOX71kLYTV7fLXpqud1GpbpP5TuffXFqfX7fH2GgZREw=="],
|
|
20
|
-
|
|
21
|
-
"bun-types": ["bun-types@1.3.14", "https://registry.npmjs.org/bun-types/-/bun-types-1.3.14.tgz", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="],
|
|
22
|
-
|
|
23
|
-
"typescript": ["typescript@5.8.3", "https://registry.npmjs.org/typescript/-/typescript-5.8.3.tgz", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-p1diW6TqL9L07nNxvRMM7hMMw4c5XOo/1ibL4aAIGmSAt9slTE1Xgw5KWuof2uTOvCg9BY7ZRi+GaF+7sfgPeQ=="],
|
|
24
|
-
|
|
25
|
-
"undici-types": ["undici-types@8.3.0", "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="],
|
|
26
|
-
|
|
27
|
-
"web-tree-sitter": ["web-tree-sitter@0.26.11", "https://registry.npmjs.org/web-tree-sitter/-/web-tree-sitter-0.26.11.tgz", {}, "sha512-Q5Dm3YTIXSXuH6FxX6RuzX2Qwpc4DPGiYMU87Wg5Z8OIStiQFiUex4zMDc0vBTw78EphaYJacncJghCHzbZptg=="],
|
|
28
|
-
}
|
|
29
|
-
}
|