@barefootjs/mojolicious 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.
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Mojolicious EP template test renderer
3
+ *
4
+ * Compiles JSX source with MojoAdapter and renders to HTML via `perl`.
5
+ * Used by adapter-tests conformance runner.
6
+ */
7
+ export declare class PerlNotAvailableError extends Error {
8
+ constructor(message: string);
9
+ }
10
+ /**
11
+ * Recover the bare component name from a compiler-emitted template
12
+ * file path. `templatesPerComponent` adapters write each component to
13
+ * `<dir>/<ComponentName><adapter.extension>` (Mojo: `.html.ep`), and
14
+ * downstream pairing logic needs the raw component name back so it can
15
+ * look up the matching IR in `irsByName`.
16
+ *
17
+ * Stripping the *full* adapter extension matters because Mojo's
18
+ * extension is multi-segment (`.html.ep`). A naive `\.[^.]+$/` strips
19
+ * only the last segment, leaves `<ComponentName>.html`, misses the
20
+ * IR map, and silently pairs every sibling template to the
21
+ * entry-point IR — exactly the silent-gap class issue #1297 was
22
+ * filed to surface.
23
+ *
24
+ * Exported for testing.
25
+ */
26
+ export declare function templateBaseName(path: string, extension: string): string;
27
+ export interface RenderOptions {
28
+ /** JSX source code */
29
+ source: string;
30
+ /** Template adapter to use */
31
+ adapter: import('@barefootjs/jsx').TemplateAdapter;
32
+ /** Props to inject (optional) */
33
+ props?: Record<string, unknown>;
34
+ /** Additional component files (filename → source) */
35
+ components?: Record<string, string>;
36
+ }
37
+ export declare function renderMojoComponent(options: RenderOptions): Promise<string>;
38
+ //# sourceMappingURL=test-render.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"test-render.d.ts","sourceRoot":"","sources":["../src/test-render.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAUH,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,YAAY,OAAO,EAAE,MAAM,EAG1B;CACF;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAKxE;AAkCD,MAAM,WAAW,aAAa;IAC5B,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,8BAA8B;IAC9B,OAAO,EAAE,OAAO,iBAAiB,EAAE,eAAe,CAAA;IAClD,iCAAiC;IACjC,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC/B,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CACpC;AAED,wBAAsB,mBAAmB,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC,CA2MjF"}