@ox0/guards 0.1.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 ADDED
@@ -0,0 +1,24 @@
1
+ # @ox0/guards
2
+
3
+ `@ox0/guards` is a deterministic syntax-level guard runner for React and TypeScript projects.
4
+
5
+ ## Primary Usage
6
+
7
+ Inside `ox0`:
8
+
9
+ ```bash
10
+ pnpm run check:guards
11
+ ```
12
+
13
+ Inside another project where this package is installed:
14
+
15
+ ```bash
16
+ pnpm exec ox0-guards --project .
17
+ ```
18
+
19
+ ## LLM Notes
20
+
21
+ - Treat this tool like a fast project-specific linter.
22
+ - Rules should reuse the parsed AST for a file instead of reparsing.
23
+ - Prefer high-signal syntax checks over broad heuristic rules.
24
+ - Keep suppressions explicit and narrow.
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { spawnSync } from "node:child_process"
4
+ import { createRequire } from "node:module"
5
+ import { dirname, join } from "node:path"
6
+ import { fileURLToPath } from "node:url"
7
+
8
+ const require = createRequire(import.meta.url)
9
+ const cliPath = fileURLToPath(new URL("../src/cli.ts", import.meta.url))
10
+ const tsxDir = dirname(require.resolve("tsx/package.json"))
11
+ const tsxPath = join(tsxDir, "dist/cli.mjs")
12
+ const result = spawnSync(process.execPath, [tsxPath, cliPath, ...process.argv.slice(2)], {
13
+ stdio: "inherit",
14
+ })
15
+
16
+ if (typeof result.status === "number") {
17
+ process.exit(result.status)
18
+ }
19
+
20
+ if (result.error) {
21
+ throw result.error
22
+ }