@lumeland/plugin-jsx 1.0.0-beta-8 → 1.0.0-beta-9
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/README.md +7 -0
- package/build/src/mod.d.ts +0 -8
- package/build/src/mod.js +2 -12
- package/package.json +6 -5
package/README.md
ADDED
package/build/src/mod.d.ts
CHANGED
|
@@ -5,11 +5,6 @@ export interface Options {
|
|
|
5
5
|
extensions?: string[];
|
|
6
6
|
/** Optional sub-extension for page files */
|
|
7
7
|
pageSubExtension?: string;
|
|
8
|
-
/**
|
|
9
|
-
* Custom includes path
|
|
10
|
-
* @default `site.options.includes`
|
|
11
|
-
*/
|
|
12
|
-
includes?: string;
|
|
13
8
|
}
|
|
14
9
|
export declare const defaults: {
|
|
15
10
|
extensions: string[];
|
|
@@ -18,9 +13,6 @@ export declare const defaults: {
|
|
|
18
13
|
/** Template engine to render JSX files */
|
|
19
14
|
export declare class JsxEngine implements Engine {
|
|
20
15
|
helpers: Record<string, Helper>;
|
|
21
|
-
basePath: string;
|
|
22
|
-
includes: string;
|
|
23
|
-
constructor(basePath: string, includes: string);
|
|
24
16
|
deleteCache(): void;
|
|
25
17
|
render(content: unknown, data?: Record<string, unknown>): Promise<string>;
|
|
26
18
|
addHelper(name: string, fn: Helper): void;
|
package/build/src/mod.js
CHANGED
|
@@ -9,12 +9,6 @@ export const defaults = {
|
|
|
9
9
|
/** Template engine to render JSX files */
|
|
10
10
|
export class JsxEngine {
|
|
11
11
|
helpers = {};
|
|
12
|
-
basePath;
|
|
13
|
-
includes;
|
|
14
|
-
constructor(basePath, includes) {
|
|
15
|
-
this.basePath = basePath;
|
|
16
|
-
this.includes = includes;
|
|
17
|
-
}
|
|
18
12
|
deleteCache() { }
|
|
19
13
|
async render(content, data = {}) {
|
|
20
14
|
// If content is a string, convert to a JSX element
|
|
@@ -40,12 +34,8 @@ export class JsxEngine {
|
|
|
40
34
|
*/
|
|
41
35
|
export function jsx(userOptions) {
|
|
42
36
|
return (site) => {
|
|
43
|
-
const options = merge(
|
|
44
|
-
const engine = new JsxEngine(
|
|
45
|
-
// Ignore includes folder
|
|
46
|
-
if (options.includes) {
|
|
47
|
-
site.ignore(options.includes);
|
|
48
|
-
}
|
|
37
|
+
const options = merge(defaults, userOptions);
|
|
38
|
+
const engine = new JsxEngine();
|
|
49
39
|
// Load the pages and register the engine
|
|
50
40
|
site.loadPages(options.extensions, {
|
|
51
41
|
loader,
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lumeland/plugin-jsx",
|
|
3
|
-
"version": "1.0.0-beta-
|
|
3
|
+
"version": "1.0.0-beta-9",
|
|
4
4
|
"description": "",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"lume-plugin"
|
|
7
|
+
],
|
|
5
8
|
"homepage": "https://lume.land/plugins/jsx/",
|
|
6
9
|
"license": "MIT",
|
|
7
10
|
"author": "Óscar Otero",
|
|
@@ -24,10 +27,8 @@
|
|
|
24
27
|
"import": "./build/src/*.js"
|
|
25
28
|
}
|
|
26
29
|
},
|
|
27
|
-
"dependencies": {
|
|
28
|
-
"@lumeland/ssx": "^0.1.16"
|
|
29
|
-
},
|
|
30
30
|
"peerDependencies": {
|
|
31
|
-
"@lumeland/core": "^1.0.0-beta-
|
|
31
|
+
"@lumeland/core": "^1.0.0-beta-9",
|
|
32
|
+
"@lumeland/ssx": "^0.1.16"
|
|
32
33
|
}
|
|
33
34
|
}
|