roto-rooter 0.1.6 → 0.3.0
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 +17 -0
- package/dist/analyzer.d.ts.map +1 -1
- package/dist/checks/interactivity-check.d.ts +6 -0
- package/dist/checks/interactivity-check.d.ts.map +1 -0
- package/dist/checks/persistence-check.d.ts +6 -0
- package/dist/checks/persistence-check.d.ts.map +1 -0
- package/dist/cli.js +119 -111
- package/dist/index.js +111 -111
- package/dist/parsers/action-parser.d.ts +12 -0
- package/dist/parsers/action-parser.d.ts.map +1 -1
- package/dist/parsers/drizzle-schema-parser.d.ts +30 -0
- package/dist/parsers/drizzle-schema-parser.d.ts.map +1 -0
- package/dist/types.d.ts +104 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/utils/ast-utils.d.ts +6 -0
- package/dist/utils/ast-utils.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -34,6 +34,12 @@ rr --dry-run
|
|
|
34
34
|
|
|
35
35
|
# Fix specific file(s)
|
|
36
36
|
rr --fix app/routes/dashboard.tsx
|
|
37
|
+
|
|
38
|
+
# Enable Drizzle ORM persistence checking (auto-discovers schema)
|
|
39
|
+
rr --orm drizzle
|
|
40
|
+
|
|
41
|
+
# Drizzle checking with explicit schema path
|
|
42
|
+
rr --orm drizzle --drizzle-schema src/db/schema.ts
|
|
37
43
|
```
|
|
38
44
|
|
|
39
45
|
## Checks
|
|
@@ -50,6 +56,17 @@ rr --fix app/routes/dashboard.tsx
|
|
|
50
56
|
|
|
51
57
|
Some hydration issues are auto-fixable (e.g., adding `{ timeZone: "UTC" }` to locale methods, replacing `uuid()` with `useId()`).
|
|
52
58
|
|
|
59
|
+
- **interactivity**: Detects disconnected interactive elements:
|
|
60
|
+
- Dialog/modal forms where "Save" button only closes the dialog without persisting data
|
|
61
|
+
- "Delete" confirmation buttons that only close without performing the action
|
|
62
|
+
- Buttons with empty or stub onClick handlers (console.log only)
|
|
63
|
+
- Validates dialogs use React Router `<Form>` or `useFetcher.submit()` for data operations
|
|
64
|
+
|
|
65
|
+
- **persistence**: Validates database operations against Drizzle ORM schema. Requires `--orm drizzle` flag. Auto-discovers schema from common locations (`db/schema.ts`, `src/db/schema.ts`, etc.) or use `--drizzle-schema` for custom paths.
|
|
66
|
+
- Missing required columns on `db.insert()` calls
|
|
67
|
+
- Type mismatches (e.g., string from `formData.get()` to integer column)
|
|
68
|
+
- Enum columns receiving unvalidated external input
|
|
69
|
+
|
|
53
70
|
## Programmatic API
|
|
54
71
|
|
|
55
72
|
```typescript
|
package/dist/analyzer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAId,UAAU,
|
|
1
|
+
{"version":3,"file":"analyzer.d.ts","sourceRoot":"","sources":["../src/analyzer.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,cAAc,EAId,UAAU,EAEX,MAAM,YAAY,CAAC;AAepB;;GAEG;AACH,wBAAgB,OAAO,CAAC,OAAO,EAAE,UAAU,GAAG,cAAc,CA4H3D"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AnalyzerIssue } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Check for disconnected interactive elements (dialogs with fake submit buttons)
|
|
4
|
+
*/
|
|
5
|
+
export declare function checkInteractivity(files: string[]): AnalyzerIssue[];
|
|
6
|
+
//# sourceMappingURL=interactivity-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactivity-check.d.ts","sourceRoot":"","sources":["../../src/checks/interactivity-check.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAkB,MAAM,aAAa,CAAC;AAkFjE;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,aAAa,EAAE,CA0DnE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AnalyzerIssue, DrizzleSchema } from '../types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Check persistence operations against Drizzle schema
|
|
4
|
+
*/
|
|
5
|
+
export declare function checkPersistence(files: string[], schema: DrizzleSchema): AnalyzerIssue[];
|
|
6
|
+
//# sourceMappingURL=persistence-check.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"persistence-check.d.ts","sourceRoot":"","sources":["../../src/checks/persistence-check.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EAKd,MAAM,aAAa,CAAC;AAUrB;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,MAAM,EAAE,EACf,MAAM,EAAE,aAAa,GACpB,aAAa,EAAE,CAiBjB"}
|