@fabrika/check 0.9.0-dev.1 → 0.9.0-dev.10

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 (74) hide show
  1. package/package.json +12 -11
  2. package/src/check.ts +58 -9
  3. package/src/cli.ts +23 -4
  4. package/src/dialect.ts +29 -0
  5. package/src/endpoint-fixtures.ts +99 -13
  6. package/src/finding.ts +12 -3
  7. package/src/index.ts +4 -1
  8. package/src/layout.ts +16 -1
  9. package/src/migration-base.ts +85 -0
  10. package/src/reader/surface.ts +15 -0
  11. package/src/reader/value.ts +1 -1
  12. package/src/resolution.ts +2 -2
  13. package/src/rules/cloudflare.ts +59 -0
  14. package/src/rules/framework.ts +2 -2
  15. package/src/rules/isolation.ts +5 -1
  16. package/src/rules/migration-history.ts +70 -0
  17. package/src/rules/migrations.ts +63 -0
  18. package/src/rules/modules.ts +3 -3
  19. package/src/rules/platform-migrations.ts +93 -0
  20. package/src/rules/runtime.ts +13 -7
  21. package/src/rules/structure.ts +26 -1
  22. package/src/rules/tests.ts +1 -1
  23. package/src/scaffold.ts +323 -61
  24. package/src/trust.ts +8 -4
  25. package/types/src/ast.d.ts +65 -0
  26. package/types/src/bun-plugin.d.ts +12 -0
  27. package/types/src/check.d.ts +22 -0
  28. package/types/src/cli.d.ts +2 -0
  29. package/types/src/contract.d.ts +58 -0
  30. package/types/src/dialect.d.ts +8 -0
  31. package/types/src/endpoint-fixtures.d.ts +54 -0
  32. package/types/src/finding.d.ts +39 -0
  33. package/types/src/graph.d.ts +68 -0
  34. package/types/src/index.d.ts +9 -0
  35. package/types/src/inputs.d.ts +9 -0
  36. package/types/src/jsonc.d.ts +2 -0
  37. package/types/src/layout.d.ts +76 -0
  38. package/types/src/limits.d.ts +15 -0
  39. package/types/src/lockfile.d.ts +19 -0
  40. package/types/src/migration-base.d.ts +9 -0
  41. package/types/src/packed.d.ts +15 -0
  42. package/types/src/reader/problems.d.ts +7 -0
  43. package/types/src/reader/schema.d.ts +18 -0
  44. package/types/src/reader/surface.d.ts +5 -0
  45. package/types/src/reader/tables.d.ts +6 -0
  46. package/types/src/reader/value.d.ts +113 -0
  47. package/types/src/references.d.ts +15 -0
  48. package/types/src/resolution.d.ts +20 -0
  49. package/types/src/rules/cloudflare.d.ts +9 -0
  50. package/types/src/rules/contract.d.ts +8 -0
  51. package/types/src/rules/crontab.d.ts +15 -0
  52. package/types/src/rules/framework.d.ts +19 -0
  53. package/types/src/rules/identity.d.ts +5 -0
  54. package/types/src/rules/isolation.d.ts +18 -0
  55. package/types/src/rules/json.d.ts +3 -0
  56. package/types/src/rules/literal.d.ts +63 -0
  57. package/types/src/rules/migration-history.d.ts +12 -0
  58. package/types/src/rules/migrations.d.ts +40 -0
  59. package/types/src/rules/modules.d.ts +12 -0
  60. package/types/src/rules/packages.d.ts +7 -0
  61. package/types/src/rules/platform-migrations.d.ts +13 -0
  62. package/types/src/rules/runtime.d.ts +34 -0
  63. package/types/src/rules/structure.d.ts +41 -0
  64. package/types/src/rules/tests.d.ts +22 -0
  65. package/types/src/rules/types.d.ts +4 -0
  66. package/types/src/scaffold-sample.d.ts +8 -0
  67. package/types/src/scaffold.d.ts +36 -0
  68. package/types/src/scope.d.ts +6 -0
  69. package/types/src/slice.d.ts +30 -0
  70. package/types/src/source-maps-cli.d.ts +4 -0
  71. package/types/src/source-maps.d.ts +32 -0
  72. package/types/src/toml.d.ts +30 -0
  73. package/types/src/trust.d.ts +15 -0
  74. package/types/src/version.d.ts +2 -0
@@ -0,0 +1,30 @@
1
+ export type TomlValue = {
2
+ readonly kind: 'string';
3
+ readonly value: string;
4
+ } | {
5
+ readonly kind: 'array';
6
+ readonly items: readonly TomlValue[];
7
+ }
8
+ /** A number, boolean or date, kept as its source text. */
9
+ | {
10
+ readonly kind: 'scalar';
11
+ readonly raw: string;
12
+ };
13
+ export interface TomlEntry {
14
+ /** The full key: the table's key followed by the entry's own, each decoded. */
15
+ readonly key: readonly string[];
16
+ readonly value: TomlValue;
17
+ readonly line: number;
18
+ }
19
+ export type TomlDocument = {
20
+ readonly ok: true;
21
+ readonly entries: readonly TomlEntry[];
22
+ } | {
23
+ readonly ok: false;
24
+ readonly line: number;
25
+ readonly message: string;
26
+ };
27
+ /** Decode `text`, or say on which line it leaves the subset. */
28
+ export declare function parseToml(text: string): TomlDocument;
29
+ /** Whether the decoded key is `expected`. */
30
+ export declare const isKey: (entry: TomlEntry, ...expected: readonly string[]) => boolean;
@@ -0,0 +1,15 @@
1
+ import type { Finding } from './finding';
2
+ /** Packages whose exports the reader trusts by name, and the packages they rely on. */
3
+ export declare const isTrustedSpecifier: (specifier: string) => boolean;
4
+ /** Whether an import-map pattern (`zod/*`, `*`, `@fab*`, `zod`) can match a trusted specifier. */
5
+ export declare const patternMayMatchTrusted: (pattern: string) => boolean;
6
+ export declare const BUNFIG_FILE = "bunfig.toml";
7
+ /** The configuration files `checkTrustedResolution` reads, wherever they lie: Bun reads the nearest one. */
8
+ export declare const isResolutionConfig: (path: string) => boolean;
9
+ /**
10
+ * Every configuration among `files` that could make a trusted import load something else: a `paths` or `imports`
11
+ * pattern that can match it, a `baseUrl` (an application file shadows a package under it), an `extends` the check
12
+ * cannot follow, an unparseable `tsconfig.json`, and a runtime `preload` in `bunfig.toml` (a plugin can redirect any
13
+ * import).
14
+ */
15
+ export declare const checkTrustedResolution: (files: ReadonlyMap<string, string>) => Finding[];
@@ -0,0 +1,2 @@
1
+ /** The version of this checker and reader, recorded with every snapshot Control reads with it. */
2
+ export declare const CHECKER_VERSION: string;