@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.
- package/dist/adapter/__tests__/boolean-result.test.d.ts +2 -0
- package/dist/adapter/__tests__/boolean-result.test.d.ts.map +1 -0
- package/dist/adapter/boolean-result.d.ts +42 -0
- package/dist/adapter/boolean-result.d.ts.map +1 -0
- package/dist/adapter/index.d.ts +6 -0
- package/dist/adapter/index.d.ts.map +1 -0
- package/dist/adapter/index.js +1143 -0
- package/dist/adapter/mojo-adapter.d.ts +219 -0
- package/dist/adapter/mojo-adapter.d.ts.map +1 -0
- package/dist/build.d.ts +28 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +1163 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1143 -0
- package/dist/test-render.d.ts +38 -0
- package/dist/test-render.d.ts.map +1 -0
- package/lib/BarefootJS.pm +745 -0
- package/lib/Mojolicious/Plugin/BarefootJS/DevReload.pm +150 -0
- package/lib/Mojolicious/Plugin/BarefootJS.pm +104 -0
- package/package.json +65 -0
- package/src/__tests__/mojo-adapter.test.ts +940 -0
- package/src/__tests__/mojo-streaming.test.ts +136 -0
- package/src/__tests__/scaffold.test.ts +224 -0
- package/src/__tests__/template-base-name.test.ts +26 -0
- package/src/adapter/__tests__/boolean-result.test.ts +106 -0
- package/src/adapter/boolean-result.ts +126 -0
- package/src/adapter/index.ts +6 -0
- package/src/adapter/mojo-adapter.ts +1931 -0
- package/src/build.ts +37 -0
- package/src/index.ts +8 -0
- package/src/test-render.ts +704 -0
|
@@ -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"}
|