mikser-io 9.14.0 → 9.15.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/index.js
CHANGED
|
@@ -45,9 +45,18 @@ export { yaml } from './src/plugins/yaml.js'
|
|
|
45
45
|
// loader stores in `runtime.renderers`; the same module also still
|
|
46
46
|
// exports `load`/`render` at the top level so Piscina worker dispatch
|
|
47
47
|
// can resolve via dynamic import. ADR-0010.
|
|
48
|
-
|
|
49
|
-
export {
|
|
50
|
-
export {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
48
|
+
// Renderers — these have a render() and turn an entity into a file.
|
|
49
|
+
export { renderHbs } from './src/plugins/render/hbs.js'
|
|
50
|
+
export { renderPreset } from './src/plugins/render/preset.js'
|
|
51
|
+
|
|
52
|
+
// Template helpers — these only install functions on `runtime` for templates
|
|
53
|
+
// to call. They render nothing, which is what the old render* names hid: two
|
|
54
|
+
// of the six factories in this folder are renderers and four are not, and
|
|
55
|
+
// naming all six after the object they concern rather than the job they do
|
|
56
|
+
// led someone to add renderPreset() expecting a helper and watch every page
|
|
57
|
+
// render throw. Renamed in 10.0.0; there are no aliases.
|
|
58
|
+
export { assetUrlHelper } from './src/plugins/render/asset.js'
|
|
59
|
+
export { hrefUrlHelpers } from './src/plugins/render/href.js'
|
|
60
|
+
export { resourceUrlHelper } from './src/plugins/render/resource.js'
|
|
61
|
+
export { fileHelpers } from './src/plugins/render/file.js'
|
|
62
|
+
|
package/package.json
CHANGED
|
@@ -41,6 +41,6 @@ export function load({ entity, runtime, options }) {
|
|
|
41
41
|
runtime.next = entity.page + 1 < entity.pages ? entity.page + 1 : false
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
export function
|
|
44
|
+
export function hrefUrlHelpers(options = {}) {
|
|
45
45
|
return { name: options.name ?? 'href', options, load }
|
|
46
|
-
}
|
|
46
|
+
}
|
|
@@ -2,7 +2,7 @@ import { mkdir } from 'node:fs/promises'
|
|
|
2
2
|
import path from 'node:path'
|
|
3
3
|
|
|
4
4
|
// A renderer's `load` runs for EVERY entity in the cycle, not only the ones
|
|
5
|
-
// this renderer will render — that is deliberate and is how
|
|
5
|
+
// this renderer will render — that is deliberate and is how assetUrlHelper
|
|
6
6
|
// installs runtime.asset() for all templates. So this has to tolerate an
|
|
7
7
|
// entity that has no preset, rather than assume it is looking at one.
|
|
8
8
|
//
|
|
@@ -11,13 +11,12 @@ import path from 'node:path'
|
|
|
11
11
|
// "you have found something real", which is a much more expensive wrong
|
|
12
12
|
// signal than a no-op. The names invite exactly that mistake:
|
|
13
13
|
//
|
|
14
|
-
//
|
|
14
|
+
// assetUrlHelper() provides runtime.asset() to templates (a URL helper)
|
|
15
15
|
// assets() runs presets and produces derivatives (the work)
|
|
16
16
|
// renderPreset() renders a preset-authored layout (this file)
|
|
17
17
|
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
// but not unreasonable.
|
|
18
|
+
// The helpers were renamed for their role in 10.0.0 for exactly this reason;
|
|
19
|
+
// renderPreset keeps its name because it really is a renderer.
|
|
21
20
|
export async function load({ entity, runtime }) {
|
|
22
21
|
if (!entity?.preset?.uri) return
|
|
23
22
|
const preset = await import(`${entity.preset.uri}?stamp=${Date.now()}`)
|