@cimplify/sdk 0.100.3 → 0.100.4

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.
Files changed (55) hide show
  1. package/README.md +17 -0
  2. package/dist/advanced.d.mts +1 -1
  3. package/dist/advanced.d.ts +1 -1
  4. package/dist/advanced.js +20 -20
  5. package/dist/advanced.mjs +1 -1
  6. package/dist/{chunk-FWKSBF3F.js → chunk-3HU5I5VG.js} +20 -4
  7. package/dist/{chunk-NOGCGI4J.mjs → chunk-HSDQWJLA.mjs} +2 -2
  8. package/dist/{chunk-CNY2XFN4.js → chunk-JEVCHTKZ.js} +48 -47
  9. package/dist/{chunk-KNCW5DI7.js → chunk-LMD7B33E.js} +4 -4
  10. package/dist/{chunk-XCS56XSS.js → chunk-PNTINRAU.js} +31 -1
  11. package/dist/{chunk-HFTRLRLM.mjs → chunk-RQPXLXB2.mjs} +31 -1
  12. package/dist/{chunk-XG4DZT4I.mjs → chunk-RWR7JF7F.mjs} +2 -1
  13. package/dist/{chunk-FFRQNNUQ.mjs → chunk-Z7M6GAHS.mjs} +20 -4
  14. package/dist/{client-Bx4NRdl8.d.mts → client-BwRAAk4y.d.mts} +15 -0
  15. package/dist/{client-Cvp8W1r9.d.ts → client-CPcZIrjC.d.ts} +2 -2
  16. package/dist/{client-BWdeCgmo.d.ts → client-CrPglBBz.d.ts} +15 -0
  17. package/dist/{client-BGeSemVv.d.mts → client-DGrvLiJv.d.mts} +2 -2
  18. package/dist/index.d.mts +2 -2
  19. package/dist/index.d.ts +2 -2
  20. package/dist/index.js +69 -69
  21. package/dist/index.mjs +3 -3
  22. package/dist/lint-rules.json +1 -0
  23. package/dist/lint.d.mts +537 -0
  24. package/dist/lint.d.ts +537 -0
  25. package/dist/lint.js +540 -0
  26. package/dist/lint.mjs +524 -0
  27. package/dist/mock/cli.mjs +31 -1
  28. package/dist/mock/library.js +31 -1
  29. package/dist/mock/library.mjs +31 -1
  30. package/dist/mock/msw.js +31 -1
  31. package/dist/mock/msw.mjs +31 -1
  32. package/dist/react.d.mts +10 -5
  33. package/dist/react.d.ts +10 -5
  34. package/dist/react.js +40 -35
  35. package/dist/react.mjs +14 -9
  36. package/dist/{server-BRJ61o2J.d.mts → server-DRAW2OOX.d.mts} +4 -1
  37. package/dist/{server-CXrVYtNo.d.ts → server-zyrpzJVn.d.ts} +4 -1
  38. package/dist/server.d.mts +2 -2
  39. package/dist/server.d.ts +2 -2
  40. package/dist/server.js +7 -7
  41. package/dist/server.mjs +2 -2
  42. package/dist/styles.css +1 -1
  43. package/dist/testing/msw.d.mts +1 -1
  44. package/dist/testing/msw.d.ts +1 -1
  45. package/dist/testing/msw.js +2 -2
  46. package/dist/testing/msw.mjs +1 -1
  47. package/dist/testing/suite.d.mts +4 -4
  48. package/dist/testing/suite.d.ts +4 -4
  49. package/dist/testing/suite.js +23 -23
  50. package/dist/testing/suite.mjs +4 -4
  51. package/dist/testing.d.mts +3 -3
  52. package/dist/testing.d.ts +3 -3
  53. package/dist/testing.js +79 -79
  54. package/dist/testing.mjs +5 -5
  55. package/package.json +10 -2
package/dist/lint.d.ts ADDED
@@ -0,0 +1,537 @@
1
+ declare const LINT_RULE_SET_SCHEMA_VERSION: 1;
2
+ type LintSeverity = "error" | "warning";
3
+ interface ImportBindingPattern {
4
+ readonly source: string;
5
+ readonly imported: readonly string[];
6
+ }
7
+ interface ImportSourcePattern {
8
+ readonly value: string;
9
+ readonly match: "exact" | "prefix";
10
+ }
11
+ interface RequiredResultCheckPrimitive {
12
+ readonly kind: "required-result-check";
13
+ readonly factories: readonly ImportBindingPattern[];
14
+ readonly guardProperty: string;
15
+ readonly valueProperty: string;
16
+ }
17
+ type WrapperContext = "jsx-child" | "numeric-operation";
18
+ interface JsxWrapper {
19
+ readonly syntax: "jsx";
20
+ readonly source: string;
21
+ readonly imported: string;
22
+ readonly prop: string;
23
+ }
24
+ interface CallWrapper {
25
+ readonly syntax: "call";
26
+ readonly imports: readonly ImportBindingPattern[];
27
+ }
28
+ interface RequiredWrapperCallPrimitive {
29
+ readonly kind: "required-wrapper-call";
30
+ readonly context: WrapperContext;
31
+ /** The rule is inactive unless the file imports one of these modules. */
32
+ readonly activationImports: readonly ImportSourcePattern[];
33
+ /** Regular-expression source matched case-insensitively against an identifier/property name. */
34
+ readonly subjectNamePattern: string;
35
+ readonly wrapper: JsxWrapper | CallWrapper;
36
+ readonly operators?: readonly string[];
37
+ }
38
+ type BannedImportSource = ImportSourcePattern;
39
+ interface BannedImportPrimitive {
40
+ readonly kind: "banned-import";
41
+ readonly sources: readonly BannedImportSource[];
42
+ }
43
+ interface BannedCallArgumentPrimitive {
44
+ readonly kind: "banned-call-argument";
45
+ /** Unqualified callee names, such as the platform globals `fetch` and `Request`. */
46
+ readonly callees: readonly string[];
47
+ /** Ignore locally-bound functions and member calls that merely share a callee name. */
48
+ readonly globalCalleesOnly?: boolean;
49
+ /** Zero-based argument positions to inspect. */
50
+ readonly argumentIndexes: readonly number[];
51
+ /** Direct object-property paths rejected inside a selected argument. */
52
+ readonly objectPaths: readonly (readonly string[])[];
53
+ readonly caseInsensitive?: boolean;
54
+ }
55
+ interface BannedJsxElementPrimitive {
56
+ readonly kind: "banned-jsx-element";
57
+ readonly elements: readonly string[];
58
+ }
59
+ interface ClassNameReplacement {
60
+ readonly from: string;
61
+ readonly to: string;
62
+ }
63
+ interface BannedClassNamePatternPrimitive {
64
+ readonly kind: "banned-classname-pattern";
65
+ /** Regular-expression sources tested against a utility without variants, importance, or opacity. */
66
+ readonly patterns: readonly string[];
67
+ /** Exact terminal-token substitutions; variant prefixes are preserved. */
68
+ readonly replacements?: readonly ClassNameReplacement[];
69
+ }
70
+ type LintPrimitive = RequiredResultCheckPrimitive | RequiredWrapperCallPrimitive | BannedImportPrimitive | BannedCallArgumentPrimitive | BannedJsxElementPrimitive | BannedClassNamePatternPrimitive;
71
+ interface WrapJsxExpressionFix {
72
+ readonly kind: "wrap-jsx-expression";
73
+ }
74
+ interface ReplaceClassNameFix {
75
+ readonly kind: "replace-classname";
76
+ }
77
+ interface RemoveObjectPropertyFix {
78
+ readonly kind: "remove-object-property";
79
+ }
80
+ type LintFixDeclaration = WrapJsxExpressionFix | ReplaceClassNameFix | RemoveObjectPropertyFix;
81
+ /**
82
+ * Serializable rule contract shared by the SDK package and lint runners.
83
+ * Rules contain data only; execution stays in the CLI so storefronts never
84
+ * pull parser dependencies into their runtime bundles.
85
+ */
86
+ interface LintRule {
87
+ readonly id: string;
88
+ readonly severity: LintSeverity;
89
+ readonly message: string;
90
+ readonly help: string;
91
+ readonly primitive: LintPrimitive;
92
+ readonly fix?: LintFixDeclaration;
93
+ }
94
+ interface LintRuleSet {
95
+ readonly schemaVersion: typeof LINT_RULE_SET_SCHEMA_VERSION;
96
+ readonly name: string;
97
+ readonly rules: readonly LintRule[];
98
+ }
99
+
100
+ /** Type-preserving helper for project-defined declarative lint rules. */
101
+ declare function defineLintRule<const Rule extends LintRule>(rule: Rule): Rule;
102
+ /** Type-preserving helper for a versioned collection of declarative rules. */
103
+ declare function defineLintRuleSet<const Rules extends readonly LintRule[]>(options: {
104
+ readonly name: string;
105
+ readonly rules: Rules;
106
+ }): LintRuleSet & {
107
+ readonly rules: Rules;
108
+ };
109
+
110
+ declare const checkResultOkRule: {
111
+ readonly id: "sdk/check-result-ok";
112
+ readonly severity: "error";
113
+ readonly message: "Check `result.ok` before reading `result.value`.";
114
+ readonly help: "Cimplify SDK calls return Result values. Handle the error branch before using the value.";
115
+ readonly primitive: {
116
+ readonly kind: "required-result-check";
117
+ readonly factories: readonly [{
118
+ readonly source: "@cimplify/sdk";
119
+ readonly imported: readonly ["createCimplifyClient"];
120
+ }, {
121
+ readonly source: "@cimplify/sdk/server";
122
+ readonly imported: readonly ["getServerClient"];
123
+ }];
124
+ readonly guardProperty: "ok";
125
+ readonly valueProperty: "value";
126
+ };
127
+ };
128
+ declare const renderPriceComponentRule: {
129
+ readonly id: "sdk/render-price-component";
130
+ readonly severity: "error";
131
+ readonly message: "Render money with the SDK `Price` component.";
132
+ readonly help: "`Price` applies the active business currency and locale consistently.";
133
+ readonly primitive: {
134
+ readonly kind: "required-wrapper-call";
135
+ readonly context: "jsx-child";
136
+ readonly activationImports: readonly [{
137
+ readonly value: "@cimplify/sdk";
138
+ readonly match: "prefix";
139
+ }];
140
+ readonly subjectNamePattern: "(?:^|_)(?:price|amount|subtotal|total|tax|fee|discount|cost)(?:$|_)";
141
+ readonly wrapper: {
142
+ readonly syntax: "jsx";
143
+ readonly source: "@cimplify/sdk/react";
144
+ readonly imported: "Price";
145
+ readonly prop: "amount";
146
+ };
147
+ };
148
+ readonly fix: {
149
+ readonly kind: "wrap-jsx-expression";
150
+ };
151
+ };
152
+ declare const parsePriceBeforeMathRule: {
153
+ readonly id: "sdk/parse-price-before-math";
154
+ readonly severity: "error";
155
+ readonly message: "Call `parsePrice` before using a money value in numeric operations.";
156
+ readonly help: "Money arrives over the wire as a decimal string; implicit coercion can produce incorrect comparisons and totals.";
157
+ readonly primitive: {
158
+ readonly kind: "required-wrapper-call";
159
+ readonly context: "numeric-operation";
160
+ readonly activationImports: readonly [{
161
+ readonly value: "@cimplify/sdk";
162
+ readonly match: "prefix";
163
+ }];
164
+ readonly subjectNamePattern: "(?:^|_)(?:price|amount|subtotal|total|tax|fee|discount|cost)(?:$|_)";
165
+ readonly wrapper: {
166
+ readonly syntax: "call";
167
+ readonly imports: readonly [{
168
+ readonly source: "@cimplify/sdk";
169
+ readonly imported: readonly ["parsePrice"];
170
+ }, {
171
+ readonly source: "@cimplify/sdk/utils";
172
+ readonly imported: readonly ["parsePrice"];
173
+ }];
174
+ };
175
+ readonly operators: readonly ["+", "-", "*", "/", "%", "**", "<", "<=", ">", ">="];
176
+ };
177
+ };
178
+ declare const noReactQueryRule: {
179
+ readonly id: "sdk/no-react-query";
180
+ readonly severity: "error";
181
+ readonly message: "Use Cimplify SDK hooks instead of React Query.";
182
+ readonly help: "Use the SDK hooks and their provider-owned cache so cart, catalogue, and account state stay coherent.";
183
+ readonly primitive: {
184
+ readonly kind: "banned-import";
185
+ readonly sources: readonly [{
186
+ readonly value: "react-query";
187
+ readonly match: "exact";
188
+ }, {
189
+ readonly value: "@tanstack/react-query";
190
+ readonly match: "prefix";
191
+ }];
192
+ };
193
+ };
194
+ declare const noCookieInCacheKeyRule: {
195
+ readonly id: "sdk/no-cookie-in-cache-key";
196
+ readonly severity: "error";
197
+ readonly message: "Remove the Cookie header from this cacheable request.";
198
+ readonly help: "Cookie-bearing requests bypass the shared cache by design. Keep personalized cart/account reads in a client island.";
199
+ readonly primitive: {
200
+ readonly kind: "banned-call-argument";
201
+ readonly callees: readonly ["fetch", "Request"];
202
+ readonly globalCalleesOnly: true;
203
+ readonly argumentIndexes: readonly [1];
204
+ readonly objectPaths: readonly [readonly ["headers", "cookie"]];
205
+ readonly caseInsensitive: true;
206
+ };
207
+ readonly fix: {
208
+ readonly kind: "remove-object-property";
209
+ };
210
+ };
211
+ declare const noRawImgRule: {
212
+ readonly id: "ui/no-raw-img";
213
+ readonly severity: "warning";
214
+ readonly message: "Use `next/image` instead of a raw `<img>` element.";
215
+ readonly help: "The storefront image loader supplies responsive sizes, modern formats, and intrinsic dimensions.";
216
+ readonly primitive: {
217
+ readonly kind: "banned-jsx-element";
218
+ readonly elements: readonly ["img"];
219
+ };
220
+ };
221
+ declare const themeTokensOnlyRule: {
222
+ readonly id: "ui/theme-tokens-only";
223
+ readonly severity: "warning";
224
+ readonly message: "Use storefront theme tokens instead of hard-coded color utilities.";
225
+ readonly help: "Define palette changes in `app/globals.css` and consume semantic utilities such as `bg-background` and `text-foreground`.";
226
+ readonly primitive: {
227
+ readonly kind: "banned-classname-pattern";
228
+ readonly patterns: readonly ["^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950)$", "^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-(?:black|white)$", "^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-\\[(?:#|rgba?\\(|hsla?\\(|oklch\\(|oklab\\(|lab\\(|lch\\(|color:)"];
229
+ readonly replacements: readonly [{
230
+ readonly from: "bg-white";
231
+ readonly to: "bg-background";
232
+ }, {
233
+ readonly from: "bg-black";
234
+ readonly to: "bg-foreground";
235
+ }, {
236
+ readonly from: "text-black";
237
+ readonly to: "text-foreground";
238
+ }, {
239
+ readonly from: "border-black";
240
+ readonly to: "border-foreground";
241
+ }, {
242
+ readonly from: "border-white";
243
+ readonly to: "border-background";
244
+ }];
245
+ };
246
+ readonly fix: {
247
+ readonly kind: "replace-classname";
248
+ };
249
+ };
250
+ /**
251
+ * v1 deliberately excludes `sdk/not-found-only-on-code`: reliable data-flow
252
+ * analysis for that rule needs a later semantic pass rather than a heuristic.
253
+ */
254
+ declare const starterLintRuleSet: LintRuleSet & {
255
+ readonly rules: readonly [{
256
+ readonly id: "sdk/check-result-ok";
257
+ readonly severity: "error";
258
+ readonly message: "Check `result.ok` before reading `result.value`.";
259
+ readonly help: "Cimplify SDK calls return Result values. Handle the error branch before using the value.";
260
+ readonly primitive: {
261
+ readonly kind: "required-result-check";
262
+ readonly factories: readonly [{
263
+ readonly source: "@cimplify/sdk";
264
+ readonly imported: readonly ["createCimplifyClient"];
265
+ }, {
266
+ readonly source: "@cimplify/sdk/server";
267
+ readonly imported: readonly ["getServerClient"];
268
+ }];
269
+ readonly guardProperty: "ok";
270
+ readonly valueProperty: "value";
271
+ };
272
+ }, {
273
+ readonly id: "sdk/render-price-component";
274
+ readonly severity: "error";
275
+ readonly message: "Render money with the SDK `Price` component.";
276
+ readonly help: "`Price` applies the active business currency and locale consistently.";
277
+ readonly primitive: {
278
+ readonly kind: "required-wrapper-call";
279
+ readonly context: "jsx-child";
280
+ readonly activationImports: readonly [{
281
+ readonly value: "@cimplify/sdk";
282
+ readonly match: "prefix";
283
+ }];
284
+ readonly subjectNamePattern: "(?:^|_)(?:price|amount|subtotal|total|tax|fee|discount|cost)(?:$|_)";
285
+ readonly wrapper: {
286
+ readonly syntax: "jsx";
287
+ readonly source: "@cimplify/sdk/react";
288
+ readonly imported: "Price";
289
+ readonly prop: "amount";
290
+ };
291
+ };
292
+ readonly fix: {
293
+ readonly kind: "wrap-jsx-expression";
294
+ };
295
+ }, {
296
+ readonly id: "sdk/parse-price-before-math";
297
+ readonly severity: "error";
298
+ readonly message: "Call `parsePrice` before using a money value in numeric operations.";
299
+ readonly help: "Money arrives over the wire as a decimal string; implicit coercion can produce incorrect comparisons and totals.";
300
+ readonly primitive: {
301
+ readonly kind: "required-wrapper-call";
302
+ readonly context: "numeric-operation";
303
+ readonly activationImports: readonly [{
304
+ readonly value: "@cimplify/sdk";
305
+ readonly match: "prefix";
306
+ }];
307
+ readonly subjectNamePattern: "(?:^|_)(?:price|amount|subtotal|total|tax|fee|discount|cost)(?:$|_)";
308
+ readonly wrapper: {
309
+ readonly syntax: "call";
310
+ readonly imports: readonly [{
311
+ readonly source: "@cimplify/sdk";
312
+ readonly imported: readonly ["parsePrice"];
313
+ }, {
314
+ readonly source: "@cimplify/sdk/utils";
315
+ readonly imported: readonly ["parsePrice"];
316
+ }];
317
+ };
318
+ readonly operators: readonly ["+", "-", "*", "/", "%", "**", "<", "<=", ">", ">="];
319
+ };
320
+ }, {
321
+ readonly id: "sdk/no-react-query";
322
+ readonly severity: "error";
323
+ readonly message: "Use Cimplify SDK hooks instead of React Query.";
324
+ readonly help: "Use the SDK hooks and their provider-owned cache so cart, catalogue, and account state stay coherent.";
325
+ readonly primitive: {
326
+ readonly kind: "banned-import";
327
+ readonly sources: readonly [{
328
+ readonly value: "react-query";
329
+ readonly match: "exact";
330
+ }, {
331
+ readonly value: "@tanstack/react-query";
332
+ readonly match: "prefix";
333
+ }];
334
+ };
335
+ }, {
336
+ readonly id: "sdk/no-cookie-in-cache-key";
337
+ readonly severity: "error";
338
+ readonly message: "Remove the Cookie header from this cacheable request.";
339
+ readonly help: "Cookie-bearing requests bypass the shared cache by design. Keep personalized cart/account reads in a client island.";
340
+ readonly primitive: {
341
+ readonly kind: "banned-call-argument";
342
+ readonly callees: readonly ["fetch", "Request"];
343
+ readonly globalCalleesOnly: true;
344
+ readonly argumentIndexes: readonly [1];
345
+ readonly objectPaths: readonly [readonly ["headers", "cookie"]];
346
+ readonly caseInsensitive: true;
347
+ };
348
+ readonly fix: {
349
+ readonly kind: "remove-object-property";
350
+ };
351
+ }, {
352
+ readonly id: "ui/no-raw-img";
353
+ readonly severity: "warning";
354
+ readonly message: "Use `next/image` instead of a raw `<img>` element.";
355
+ readonly help: "The storefront image loader supplies responsive sizes, modern formats, and intrinsic dimensions.";
356
+ readonly primitive: {
357
+ readonly kind: "banned-jsx-element";
358
+ readonly elements: readonly ["img"];
359
+ };
360
+ }, {
361
+ readonly id: "ui/theme-tokens-only";
362
+ readonly severity: "warning";
363
+ readonly message: "Use storefront theme tokens instead of hard-coded color utilities.";
364
+ readonly help: "Define palette changes in `app/globals.css` and consume semantic utilities such as `bg-background` and `text-foreground`.";
365
+ readonly primitive: {
366
+ readonly kind: "banned-classname-pattern";
367
+ readonly patterns: readonly ["^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950)$", "^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-(?:black|white)$", "^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-\\[(?:#|rgba?\\(|hsla?\\(|oklch\\(|oklab\\(|lab\\(|lch\\(|color:)"];
368
+ readonly replacements: readonly [{
369
+ readonly from: "bg-white";
370
+ readonly to: "bg-background";
371
+ }, {
372
+ readonly from: "bg-black";
373
+ readonly to: "bg-foreground";
374
+ }, {
375
+ readonly from: "text-black";
376
+ readonly to: "text-foreground";
377
+ }, {
378
+ readonly from: "border-black";
379
+ readonly to: "border-foreground";
380
+ }, {
381
+ readonly from: "border-white";
382
+ readonly to: "border-background";
383
+ }];
384
+ };
385
+ readonly fix: {
386
+ readonly kind: "replace-classname";
387
+ };
388
+ }];
389
+ };
390
+ declare const starterLintRules: readonly LintRule[] & readonly [{
391
+ readonly id: "sdk/check-result-ok";
392
+ readonly severity: "error";
393
+ readonly message: "Check `result.ok` before reading `result.value`.";
394
+ readonly help: "Cimplify SDK calls return Result values. Handle the error branch before using the value.";
395
+ readonly primitive: {
396
+ readonly kind: "required-result-check";
397
+ readonly factories: readonly [{
398
+ readonly source: "@cimplify/sdk";
399
+ readonly imported: readonly ["createCimplifyClient"];
400
+ }, {
401
+ readonly source: "@cimplify/sdk/server";
402
+ readonly imported: readonly ["getServerClient"];
403
+ }];
404
+ readonly guardProperty: "ok";
405
+ readonly valueProperty: "value";
406
+ };
407
+ }, {
408
+ readonly id: "sdk/render-price-component";
409
+ readonly severity: "error";
410
+ readonly message: "Render money with the SDK `Price` component.";
411
+ readonly help: "`Price` applies the active business currency and locale consistently.";
412
+ readonly primitive: {
413
+ readonly kind: "required-wrapper-call";
414
+ readonly context: "jsx-child";
415
+ readonly activationImports: readonly [{
416
+ readonly value: "@cimplify/sdk";
417
+ readonly match: "prefix";
418
+ }];
419
+ readonly subjectNamePattern: "(?:^|_)(?:price|amount|subtotal|total|tax|fee|discount|cost)(?:$|_)";
420
+ readonly wrapper: {
421
+ readonly syntax: "jsx";
422
+ readonly source: "@cimplify/sdk/react";
423
+ readonly imported: "Price";
424
+ readonly prop: "amount";
425
+ };
426
+ };
427
+ readonly fix: {
428
+ readonly kind: "wrap-jsx-expression";
429
+ };
430
+ }, {
431
+ readonly id: "sdk/parse-price-before-math";
432
+ readonly severity: "error";
433
+ readonly message: "Call `parsePrice` before using a money value in numeric operations.";
434
+ readonly help: "Money arrives over the wire as a decimal string; implicit coercion can produce incorrect comparisons and totals.";
435
+ readonly primitive: {
436
+ readonly kind: "required-wrapper-call";
437
+ readonly context: "numeric-operation";
438
+ readonly activationImports: readonly [{
439
+ readonly value: "@cimplify/sdk";
440
+ readonly match: "prefix";
441
+ }];
442
+ readonly subjectNamePattern: "(?:^|_)(?:price|amount|subtotal|total|tax|fee|discount|cost)(?:$|_)";
443
+ readonly wrapper: {
444
+ readonly syntax: "call";
445
+ readonly imports: readonly [{
446
+ readonly source: "@cimplify/sdk";
447
+ readonly imported: readonly ["parsePrice"];
448
+ }, {
449
+ readonly source: "@cimplify/sdk/utils";
450
+ readonly imported: readonly ["parsePrice"];
451
+ }];
452
+ };
453
+ readonly operators: readonly ["+", "-", "*", "/", "%", "**", "<", "<=", ">", ">="];
454
+ };
455
+ }, {
456
+ readonly id: "sdk/no-react-query";
457
+ readonly severity: "error";
458
+ readonly message: "Use Cimplify SDK hooks instead of React Query.";
459
+ readonly help: "Use the SDK hooks and their provider-owned cache so cart, catalogue, and account state stay coherent.";
460
+ readonly primitive: {
461
+ readonly kind: "banned-import";
462
+ readonly sources: readonly [{
463
+ readonly value: "react-query";
464
+ readonly match: "exact";
465
+ }, {
466
+ readonly value: "@tanstack/react-query";
467
+ readonly match: "prefix";
468
+ }];
469
+ };
470
+ }, {
471
+ readonly id: "sdk/no-cookie-in-cache-key";
472
+ readonly severity: "error";
473
+ readonly message: "Remove the Cookie header from this cacheable request.";
474
+ readonly help: "Cookie-bearing requests bypass the shared cache by design. Keep personalized cart/account reads in a client island.";
475
+ readonly primitive: {
476
+ readonly kind: "banned-call-argument";
477
+ readonly callees: readonly ["fetch", "Request"];
478
+ readonly globalCalleesOnly: true;
479
+ readonly argumentIndexes: readonly [1];
480
+ readonly objectPaths: readonly [readonly ["headers", "cookie"]];
481
+ readonly caseInsensitive: true;
482
+ };
483
+ readonly fix: {
484
+ readonly kind: "remove-object-property";
485
+ };
486
+ }, {
487
+ readonly id: "ui/no-raw-img";
488
+ readonly severity: "warning";
489
+ readonly message: "Use `next/image` instead of a raw `<img>` element.";
490
+ readonly help: "The storefront image loader supplies responsive sizes, modern formats, and intrinsic dimensions.";
491
+ readonly primitive: {
492
+ readonly kind: "banned-jsx-element";
493
+ readonly elements: readonly ["img"];
494
+ };
495
+ }, {
496
+ readonly id: "ui/theme-tokens-only";
497
+ readonly severity: "warning";
498
+ readonly message: "Use storefront theme tokens instead of hard-coded color utilities.";
499
+ readonly help: "Define palette changes in `app/globals.css` and consume semantic utilities such as `bg-background` and `text-foreground`.";
500
+ readonly primitive: {
501
+ readonly kind: "banned-classname-pattern";
502
+ readonly patterns: readonly ["^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-(?:slate|gray|zinc|neutral|stone|red|orange|amber|yellow|lime|green|emerald|teal|cyan|sky|blue|indigo|violet|purple|fuchsia|pink|rose)-(?:50|100|200|300|400|500|600|700|800|900|950)$", "^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-(?:black|white)$", "^(?:accent|bg|border|caret|decoration|divide|fill|from|outline|placeholder|ring|shadow|stroke|text|to|via)-\\[(?:#|rgba?\\(|hsla?\\(|oklch\\(|oklab\\(|lab\\(|lch\\(|color:)"];
503
+ readonly replacements: readonly [{
504
+ readonly from: "bg-white";
505
+ readonly to: "bg-background";
506
+ }, {
507
+ readonly from: "bg-black";
508
+ readonly to: "bg-foreground";
509
+ }, {
510
+ readonly from: "text-black";
511
+ readonly to: "text-foreground";
512
+ }, {
513
+ readonly from: "border-black";
514
+ readonly to: "border-foreground";
515
+ }, {
516
+ readonly from: "border-white";
517
+ readonly to: "border-background";
518
+ }];
519
+ };
520
+ readonly fix: {
521
+ readonly kind: "replace-classname";
522
+ };
523
+ }];
524
+
525
+ /** Maximum UTF-8 size accepted for one inert lint-rule manifest. */
526
+ declare const MAX_LINT_RULE_MANIFEST_BYTES: number;
527
+ /** Validate and freeze one declarative rule at the SDK authoring boundary. */
528
+ declare function validateLintRule(value: unknown): LintRule;
529
+ /**
530
+ * Validate and freeze a complete data-only rule manifest.
531
+ *
532
+ * This is the single contract used by SDK authoring/build and every runner,
533
+ * so a rule release cannot publish data that the CLI will later reject.
534
+ */
535
+ declare function validateLintRuleSet(value: unknown): LintRuleSet;
536
+
537
+ export { type BannedCallArgumentPrimitive, type BannedClassNamePatternPrimitive, type BannedImportPrimitive, type BannedImportSource, type BannedJsxElementPrimitive, type CallWrapper, type ClassNameReplacement, type ImportBindingPattern, type ImportSourcePattern, type JsxWrapper, LINT_RULE_SET_SCHEMA_VERSION, type LintFixDeclaration, type LintPrimitive, type LintRule, type LintRuleSet, type LintSeverity, MAX_LINT_RULE_MANIFEST_BYTES, type RemoveObjectPropertyFix, type ReplaceClassNameFix, type RequiredResultCheckPrimitive, type RequiredWrapperCallPrimitive, type WrapJsxExpressionFix, type WrapperContext, checkResultOkRule, defineLintRule, defineLintRuleSet, noCookieInCacheKeyRule, noRawImgRule, noReactQueryRule, parsePriceBeforeMathRule, renderPriceComponentRule, starterLintRuleSet, starterLintRules, themeTokensOnlyRule, validateLintRule, validateLintRuleSet };