@kaathewise/ssg 0.10.0 → 0.11.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/render.d.ts.map +1 -1
- package/dist/render.js +15 -10
- package/package.json +4 -3
package/dist/render.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC7B,eAAe,CAAC,EAAE,CAAC,MAAM,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IAC9D,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACzC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACvD,CAAA;AAED,wBAAsB,IAAI,CACzB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,CAAC,
|
|
1
|
+
{"version":3,"file":"render.d.ts","sourceRoot":"","sources":["../src/render.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEzC,MAAM,MAAM,IAAI,GAAG;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;CAC1B,CAAA;AAED,MAAM,MAAM,eAAe,GAAG;IAC7B,eAAe,CAAC,EAAE,CAAC,MAAM,MAAM,EAAE,CAAC,GAAG,CAAC,MAAM,OAAO,CAAC,MAAM,EAAE,CAAC,CAAC,CAAA;IAC9D,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;IACvC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;IACzC,IAAI,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;CACvD,CAAA;AAED,wBAAsB,IAAI,CACzB,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,eAAe,CAAC,CAoB1B;AAED,wBAAsB,QAAQ,CAC7B,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAmBf;AAED,wBAAsB,YAAY,CACjC,UAAU,EAAE,MAAM,EAClB,MAAM,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,EAAE,CAAC,CAgBjB;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAgB1E;AAED,wBAAgB,MAAM,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAWzC"}
|
package/dist/render.js
CHANGED
|
@@ -7,20 +7,25 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
7
7
|
return path;
|
|
8
8
|
};
|
|
9
9
|
import * as path from "node:path";
|
|
10
|
-
import
|
|
10
|
+
import * as esbuild from "esbuild";
|
|
11
11
|
export async function load(modulePath, config) {
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
});
|
|
16
|
-
const chunks = await bundle.write({
|
|
12
|
+
const result = await esbuild.build({
|
|
13
|
+
entryPoints: [modulePath],
|
|
14
|
+
bundle: true,
|
|
17
15
|
format: "esm",
|
|
18
|
-
|
|
16
|
+
outdir: config.scratchDir,
|
|
17
|
+
packages: "external",
|
|
18
|
+
platform: "node",
|
|
19
|
+
metafile: true,
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
if (!result.metafile)
|
|
22
|
+
throw Error("unreachable");
|
|
23
|
+
const outputFiles = Object.keys(result.metafile.outputs);
|
|
24
|
+
if (!outputFiles[0])
|
|
25
|
+
throw Error("unreachable");
|
|
26
|
+
const fileName = outputFiles[0].split("/").pop();
|
|
27
|
+
const outputPath = `${config.scratchDir}/${fileName}?t=${Date.now()}`;
|
|
22
28
|
const module = await import(__rewriteRelativeImportExtension(outputPath));
|
|
23
|
-
await bundle.close();
|
|
24
29
|
return module;
|
|
25
30
|
}
|
|
26
31
|
export async function makePage(modulePath, params, config) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kaathewise/ssg",
|
|
3
3
|
"description": "Static site generator with TS and JSX support",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.11.0",
|
|
5
5
|
"license": "MPL-2.0",
|
|
6
6
|
"author": "Andrej Kolčin",
|
|
7
7
|
"type": "module",
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
"@biomejs/biome": "^2.2.3",
|
|
27
27
|
"@types/node": "^24.3.1",
|
|
28
28
|
"typescript": "^5.9.2",
|
|
29
|
-
"typescript-language-server": "^4.4.0"
|
|
29
|
+
"typescript-language-server": "^4.4.0",
|
|
30
|
+
"zx": "^8.8.5-lite"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"
|
|
33
|
+
"esbuild": "^0.28.0"
|
|
33
34
|
}
|
|
34
35
|
}
|