pasika 0.10.56 → 0.10.58
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 +10 -8
- package/dist/chunk-Z3C5YVO4.js +13 -0
- package/dist/eslint/pasika/index.d.ts +1 -0
- package/dist/eslint/pasika/index.js +454 -300
- package/dist/helpers/api-contract.d.ts +20 -0
- package/dist/helpers/api-contract.js +8 -0
- package/dist/helpers/with-response.d.ts +7 -8
- package/dist/helpers/with-response.js +11 -8
- package/dist/helpers/zod-fetch.d.ts +15 -17
- package/dist/helpers/zod-fetch.js +24 -16
- package/package.json +5 -5
- package/dist/helpers/response-envelope.d.ts +0 -20
- package/dist/helpers/response-envelope.js +0 -18
package/README.md
CHANGED
|
@@ -68,14 +68,16 @@ Some rules are cross-file: where a component, hook, value, type, or style belong
|
|
|
68
68
|
|
|
69
69
|
## 🧱 Runtime helpers
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
| Import | Exports
|
|
74
|
-
| ---------------------- |
|
|
75
|
-
| `pasika/
|
|
76
|
-
| `pasika/
|
|
77
|
-
| `pasika/
|
|
78
|
-
| `pasika/
|
|
71
|
+
Six runtime helpers ship with the package, so a repository imports them instead of writing its own copy to the shape the rules expect:
|
|
72
|
+
|
|
73
|
+
| Import | Exports | Resolves against (optional peer) |
|
|
74
|
+
| ---------------------- | ------------------------------------------------------------ | -------------------------------- |
|
|
75
|
+
| `pasika/api-contract` | `defineApiContract`, `apiErrorResponseSchema`, `ApiContract` | `zod` |
|
|
76
|
+
| `pasika/cn` | `cn` | `clsx`, `tailwind-merge` |
|
|
77
|
+
| `pasika/http-error` | `HttpError` | — |
|
|
78
|
+
| `pasika/http-method` | `HttpMethod` | — |
|
|
79
|
+
| `pasika/zod-fetch` | `zodFetch` | `zod` |
|
|
80
|
+
| `pasika/with-response` | `withResponse`, `HandlerResult`, `ResponseHeaders` | `next`, `zod` |
|
|
79
81
|
|
|
80
82
|
The entries share one `HttpError`, so a failure `zodFetch` throws satisfies the `instanceof` check `withResponse` makes. The TS/TSX rules call the TypeScript compiler API at lint time, so `typescript` is a pinned runtime dependency rather than a peer.
|
|
81
83
|
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// helpers/api-contract.ts
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
var apiErrorResponseSchema = z.object({
|
|
4
|
+
message: z.string()
|
|
5
|
+
});
|
|
6
|
+
function defineApiContract(contract) {
|
|
7
|
+
return Object.freeze({ ...contract });
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
apiErrorResponseSchema,
|
|
12
|
+
defineApiContract
|
|
13
|
+
};
|
|
@@ -192,6 +192,7 @@ declare const pasikaPlugin: {
|
|
|
192
192
|
"glossary-term-linking": _eslint_markdown.MarkdownRuleDefinition;
|
|
193
193
|
"guide-mentions-documents": _eslint_markdown.MarkdownRuleDefinition;
|
|
194
194
|
"guide-section-shape": _eslint_markdown.MarkdownRuleDefinition;
|
|
195
|
+
"api-contract": eslint.Rule.RuleModule;
|
|
195
196
|
"file-length": eslint.Rule.RuleModule;
|
|
196
197
|
"filename-case": eslint.Rule.RuleModule;
|
|
197
198
|
"import-boundaries": eslint.Rule.RuleModule;
|