@jxsuite/compiler 0.18.0 → 0.20.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/compiler.js +111 -111
- package/package.json +6 -4
- package/src/cli.js +1 -1
- package/src/compiler.js +2 -2
- package/src/shared.js +260 -149
- package/src/site/content-loader.js +84 -71
- package/src/site/context-injection.js +30 -24
- package/src/site/head-merger.js +13 -12
- package/src/site/image-optimizer.js +2 -2
- package/src/site/image-transform.js +5 -4
- package/src/site/layout-resolver.js +32 -25
- package/src/site/pages-discovery.js +6 -6
- package/src/site/prototype-resolver.js +1 -1
- package/src/site/site-build.js +71 -51
- package/src/site/site-loader.js +1 -1
- package/src/targets/compile-class.js +27 -21
- package/src/targets/compile-client.js +75 -33
- package/src/targets/compile-element.js +57 -39
- package/src/targets/compile-markdown.js +99 -78
- package/src/targets/compile-server.js +1 -1
- package/src/targets/compile-static.js +24 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jxsuite/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"description": "Jx static HTML compiler, island detector, and site builder",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -37,14 +37,16 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@apidevtools/json-schema-ref-parser": "^15.3.5",
|
|
40
|
-
"@jxsuite/parser": "^0.
|
|
41
|
-
"@jxsuite/runtime": "^0.
|
|
40
|
+
"@jxsuite/parser": "^0.20.0",
|
|
41
|
+
"@jxsuite/runtime": "^0.20.0",
|
|
42
|
+
"glob": "^13.0.6",
|
|
42
43
|
"remark-gfm": "^4.0.1",
|
|
43
44
|
"remark-stringify": "^11.0.0",
|
|
44
45
|
"sharp": "^0.34.5",
|
|
45
46
|
"unified": "^11.0.5"
|
|
46
47
|
},
|
|
47
48
|
"devDependencies": {
|
|
48
|
-
"@happy-dom/global-registrator": "^20.9.0"
|
|
49
|
+
"@happy-dom/global-registrator": "^20.9.0",
|
|
50
|
+
"@types/mdast": "^4.0.4"
|
|
49
51
|
}
|
|
50
52
|
}
|
package/src/cli.js
CHANGED
|
@@ -49,7 +49,7 @@ if (command === "build") {
|
|
|
49
49
|
|
|
50
50
|
console.log(`\nDone: ${result.routes} routes → ${result.files} files`);
|
|
51
51
|
} catch (e) {
|
|
52
|
-
const err = /** @type {
|
|
52
|
+
const err = /** @type {Error} */ (e);
|
|
53
53
|
console.error(`Build failed: ${err.message}`);
|
|
54
54
|
process.exit(1);
|
|
55
55
|
}
|
package/src/compiler.js
CHANGED
|
@@ -55,7 +55,7 @@ export {
|
|
|
55
55
|
* (lit-html) 3. Otherwise → pre-rendered HTML with reactive bindings
|
|
56
56
|
*
|
|
57
57
|
* @param {string | any} sourcePath - Path to .json file, URL, or raw object
|
|
58
|
-
* @param {
|
|
58
|
+
* @param {Record<string, unknown>} [opts]
|
|
59
59
|
* @returns {Promise<{
|
|
60
60
|
* html: string;
|
|
61
61
|
* files: { path: string; content: string; tagName?: string }[];
|
|
@@ -67,7 +67,7 @@ export async function compile(sourcePath, opts = {}) {
|
|
|
67
67
|
reactivitySrc = DEFAULT_REACTIVITY_SRC,
|
|
68
68
|
litHtmlSrc = DEFAULT_LIT_HTML_SRC,
|
|
69
69
|
projectStyle = null,
|
|
70
|
-
} = opts;
|
|
70
|
+
} = /** @type {JxMutableNode} */ (opts);
|
|
71
71
|
|
|
72
72
|
let raw;
|
|
73
73
|
if (typeof sourcePath === "string") {
|