@hyperfixi/server-bridge 2.0.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.
Files changed (77) hide show
  1. package/LICENSE +20 -0
  2. package/dist/cli/config.d.ts +5 -0
  3. package/dist/cli/diff-command.d.ts +9 -0
  4. package/dist/cli/generate-command.d.ts +12 -0
  5. package/dist/cli/index.d.ts +2 -0
  6. package/dist/cli/scan-command.d.ts +9 -0
  7. package/dist/cli/watch-command.d.ts +30 -0
  8. package/dist/cli.cjs +1853 -0
  9. package/dist/cli.cjs.map +1 -0
  10. package/dist/conventions/convention-engine.d.ts +29 -0
  11. package/dist/conventions/url-patterns.d.ts +37 -0
  12. package/dist/generate.d.ts +21 -0
  13. package/dist/generators/django-generator.d.ts +10 -0
  14. package/dist/generators/express-generator.d.ts +9 -0
  15. package/dist/generators/fastapi-generator.d.ts +10 -0
  16. package/dist/generators/hono-generator.d.ts +9 -0
  17. package/dist/generators/index.d.ts +6 -0
  18. package/dist/generators/manifest.d.ts +43 -0
  19. package/dist/generators/openapi-generator.d.ts +14 -0
  20. package/dist/generators/template-helpers.d.ts +24 -0
  21. package/dist/generators/types.d.ts +11 -0
  22. package/dist/index.cjs +1426 -0
  23. package/dist/index.cjs.map +1 -0
  24. package/dist/index.d.ts +19 -0
  25. package/dist/index.js +1376 -0
  26. package/dist/index.js.map +1 -0
  27. package/dist/scanner/conflict-detector.d.ts +10 -0
  28. package/dist/scanner/form-scanner.d.ts +12 -0
  29. package/dist/scanner/htmx-extractor.d.ts +9 -0
  30. package/dist/scanner/hyperscript-extractor.d.ts +9 -0
  31. package/dist/scanner/route-scanner.d.ts +21 -0
  32. package/dist/types.d.ts +123 -0
  33. package/package.json +64 -0
  34. package/src/__tests__/cli.test.ts +30 -0
  35. package/src/__tests__/conflict-detector.test.ts +126 -0
  36. package/src/__tests__/convention-engine.test.ts +58 -0
  37. package/src/__tests__/diff-command.test.ts +69 -0
  38. package/src/__tests__/django-generator.test.ts +129 -0
  39. package/src/__tests__/express-generator.test.ts +105 -0
  40. package/src/__tests__/fastapi-generator.test.ts +125 -0
  41. package/src/__tests__/form-scanner.test.ts +91 -0
  42. package/src/__tests__/generate.test.ts +89 -0
  43. package/src/__tests__/hono-generator.test.ts +90 -0
  44. package/src/__tests__/htmx-extractor.test.ts +84 -0
  45. package/src/__tests__/hyperscript-extractor.test.ts +89 -0
  46. package/src/__tests__/integration.test.ts +102 -0
  47. package/src/__tests__/manifest.test.ts +133 -0
  48. package/src/__tests__/openapi-generator.test.ts +116 -0
  49. package/src/__tests__/query-params.test.ts +101 -0
  50. package/src/__tests__/route-scanner.test.ts +47 -0
  51. package/src/__tests__/url-patterns.test.ts +74 -0
  52. package/src/__tests__/watch-command.test.ts +141 -0
  53. package/src/cli/config.ts +35 -0
  54. package/src/cli/diff-command.ts +96 -0
  55. package/src/cli/generate-command.ts +108 -0
  56. package/src/cli/index.ts +143 -0
  57. package/src/cli/scan-command.ts +72 -0
  58. package/src/cli/watch-command.ts +242 -0
  59. package/src/conventions/convention-engine.ts +68 -0
  60. package/src/conventions/url-patterns.ts +123 -0
  61. package/src/generate.ts +44 -0
  62. package/src/generators/django-generator.ts +210 -0
  63. package/src/generators/express-generator.ts +137 -0
  64. package/src/generators/fastapi-generator.ts +248 -0
  65. package/src/generators/hono-generator.ts +137 -0
  66. package/src/generators/index.ts +25 -0
  67. package/src/generators/manifest.ts +164 -0
  68. package/src/generators/openapi-generator.ts +259 -0
  69. package/src/generators/template-helpers.ts +77 -0
  70. package/src/generators/types.ts +12 -0
  71. package/src/index.ts +42 -0
  72. package/src/scanner/conflict-detector.ts +92 -0
  73. package/src/scanner/form-scanner.ts +126 -0
  74. package/src/scanner/htmx-extractor.ts +174 -0
  75. package/src/scanner/hyperscript-extractor.ts +184 -0
  76. package/src/scanner/route-scanner.ts +130 -0
  77. package/src/types.ts +151 -0
package/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 LokaScript Contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+ this software and associated documentation files (the "Software"), to deal in
7
+ the Software without restriction, including without limitation the rights to
8
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9
+ the Software, and to permit persons to whom the Software is furnished to do so,
10
+ subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17
+ FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18
+ COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19
+ IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,5 @@
1
+ import type { ServerBridgeConfig } from '../types.js';
2
+ /**
3
+ * Load config from file, merging with CLI overrides.
4
+ */
5
+ export declare function loadConfig(cwd: string, overrides?: Partial<ServerBridgeConfig>): Promise<ServerBridgeConfig>;
@@ -0,0 +1,9 @@
1
+ interface DiffOptions {
2
+ dir: string;
3
+ format?: 'summary' | 'detailed';
4
+ include?: string[];
5
+ exclude?: string[];
6
+ ignore?: string[];
7
+ }
8
+ export declare function runDiff(options: DiffOptions): Promise<void>;
9
+ export {};
@@ -0,0 +1,12 @@
1
+ interface GenerateOptions {
2
+ dir: string;
3
+ framework?: 'express' | 'hono' | 'openapi' | 'django' | 'fastapi';
4
+ output?: string;
5
+ typescript?: boolean;
6
+ overwrite?: boolean;
7
+ include?: string[];
8
+ exclude?: string[];
9
+ ignore?: string[];
10
+ }
11
+ export declare function runGenerate(options: GenerateOptions): Promise<void>;
12
+ export {};
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
@@ -0,0 +1,9 @@
1
+ interface ScanOptions {
2
+ dir: string;
3
+ format?: 'json' | 'table';
4
+ include?: string[];
5
+ exclude?: string[];
6
+ ignore?: string[];
7
+ }
8
+ export declare function runScan(options: ScanOptions): Promise<void>;
9
+ export {};
@@ -0,0 +1,30 @@
1
+ import type { RouteDescriptor } from '../types.js';
2
+ interface WatchOptions {
3
+ dir: string;
4
+ framework?: 'express' | 'hono' | 'openapi' | 'django' | 'fastapi';
5
+ output?: string;
6
+ typescript?: boolean;
7
+ include?: string[];
8
+ exclude?: string[];
9
+ ignore?: string[];
10
+ debounce?: number;
11
+ }
12
+ /** Convert a glob-like pattern to a regex for file matching. */
13
+ declare function patternToRegex(pattern: string): RegExp;
14
+ declare function shouldScan(filename: string, includePatterns: string[]): boolean;
15
+ declare function shouldSkip(relPath: string, excludePatterns: string[]): boolean;
16
+ /**
17
+ * Creates a debounced runner that:
18
+ * - Debounces rapid invocations with setTimeout/clearTimeout
19
+ * - Guards against overlapping async executions
20
+ * - Queues a follow-up run if triggered during execution
21
+ */
22
+ export declare function createDebouncedRunner(fn: () => Promise<void>, ms: number): {
23
+ trigger: () => void;
24
+ };
25
+ /**
26
+ * Compute a hash of all route method:path pairs for change detection.
27
+ */
28
+ export declare function computeRouteHash(routes: RouteDescriptor[]): string;
29
+ export declare function runWatch(options: WatchOptions): Promise<void>;
30
+ export { patternToRegex, shouldScan, shouldSkip };