@primate/htmx 0.26.0 → 0.28.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/lib/private/default.d.ts +1 -1
- package/lib/private/default.js +4 -3
- package/lib/private/init.d.ts +3 -3
- package/lib/private/init.js +2 -2
- package/lib/private/runtime.d.ts +1 -1
- package/package.json +12 -12
package/lib/private/default.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare const _default: (input?: import("@rcompat/type").Unpack<({
|
|
|
3
3
|
csr?: boolean | undefined;
|
|
4
4
|
ssr?: boolean | undefined;
|
|
5
5
|
} & {
|
|
6
|
-
|
|
6
|
+
templates?: {
|
|
7
7
|
engine: "handlebars" | "mustache" | "nunjucks";
|
|
8
8
|
} | undefined;
|
|
9
9
|
}) | undefined>) => import("@primate/core/frontend").Module;
|
package/lib/private/default.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import E from "#errors";
|
|
2
2
|
import init from "#init";
|
|
3
3
|
import frontend from "@primate/core/frontend";
|
|
4
|
+
import is from "@rcompat/is";
|
|
4
5
|
import string from "@rcompat/string";
|
|
5
6
|
const CLIENT_SIDE_TEMPLATES = {
|
|
6
7
|
mustache: {
|
|
@@ -32,13 +33,13 @@ export default frontend({
|
|
|
32
33
|
...init,
|
|
33
34
|
async onBuild(app, options) {
|
|
34
35
|
await ensure("htmx.org", app.root, () => E.htmx_package_required());
|
|
35
|
-
const templates = options.
|
|
36
|
+
const templates = options.templates;
|
|
36
37
|
const lines = [
|
|
37
38
|
`import htmx from "htmx.org";`,
|
|
38
39
|
"globalThis.htmx = htmx;",
|
|
39
40
|
];
|
|
40
|
-
if (templates
|
|
41
|
-
await ensure("htmx-ext-client-side-templates", app.root,
|
|
41
|
+
if (is.defined(templates)) {
|
|
42
|
+
await ensure("htmx-ext-client-side-templates", app.root, E.client_side_templates_required);
|
|
42
43
|
const engine = CLIENT_SIDE_TEMPLATES[templates.engine];
|
|
43
44
|
await ensure(engine.package, app.root, () => {
|
|
44
45
|
throw E.template_engine_required(templates.engine, engine.package);
|
package/lib/private/init.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { Init } from "@primate/core/frontend";
|
|
2
2
|
declare const schema: import("pema").ObjectType<import("pema").NormalizeSchemaObject<{
|
|
3
|
-
readonly
|
|
4
|
-
readonly engine: import("pema").
|
|
3
|
+
readonly templates: import("pema").OptionalType<import("pema").ObjectType<import("pema").NormalizeSchemaObject<{
|
|
4
|
+
readonly engine: import("pema").UnionType<[import("pema").LiteralType<"mustache", undefined>, import("pema").LiteralType<"handlebars", undefined>, import("pema").LiteralType<"nunjucks", undefined>], undefined>;
|
|
5
5
|
}>, undefined, {
|
|
6
6
|
engine: "handlebars" | "mustache" | "nunjucks";
|
|
7
7
|
}>>;
|
|
8
8
|
}>, undefined, {
|
|
9
|
-
|
|
9
|
+
templates: {
|
|
10
10
|
engine: "handlebars" | "mustache" | "nunjucks";
|
|
11
11
|
} | undefined;
|
|
12
12
|
}>;
|
package/lib/private/init.js
CHANGED
|
@@ -7,8 +7,8 @@ const CLIENT_SIDE_TEMPLATE_ENGINES = [
|
|
|
7
7
|
"nunjucks",
|
|
8
8
|
];
|
|
9
9
|
const schema = p({
|
|
10
|
-
|
|
11
|
-
engine: p.
|
|
10
|
+
templates: p({
|
|
11
|
+
engine: p.union(...CLIENT_SIDE_TEMPLATE_ENGINES),
|
|
12
12
|
}).optional(),
|
|
13
13
|
});
|
|
14
14
|
const init = {
|
package/lib/private/runtime.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ declare const _default: (input?: import("@rcompat/type").Unpack<({
|
|
|
3
3
|
csr?: boolean | undefined;
|
|
4
4
|
ssr?: boolean | undefined;
|
|
5
5
|
} & {
|
|
6
|
-
|
|
6
|
+
templates?: {
|
|
7
7
|
engine: "handlebars" | "mustache" | "nunjucks";
|
|
8
8
|
} | undefined;
|
|
9
9
|
}) | undefined>) => import("@primate/core/frontend").Module;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primate/htmx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.28.0",
|
|
4
4
|
"description": "HTMX for Primate",
|
|
5
5
|
"homepage": "https://primate.run/docs/frontend/htmx",
|
|
6
6
|
"bugs": "https://github.com/primate-run/primate/issues",
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
"!/**/*.spec.*"
|
|
18
18
|
],
|
|
19
19
|
"dependencies": {
|
|
20
|
-
"@
|
|
21
|
-
"@
|
|
22
|
-
"@rcompat/
|
|
23
|
-
"@rcompat/
|
|
24
|
-
"@rcompat/
|
|
25
|
-
"@rcompat/
|
|
26
|
-
"
|
|
27
|
-
"@
|
|
28
|
-
"
|
|
20
|
+
"@primate/core": "^0.10.0",
|
|
21
|
+
"@primate/html": "^0.21.0",
|
|
22
|
+
"@rcompat/assert": "^0.14.0",
|
|
23
|
+
"@rcompat/error": "^0.9.0",
|
|
24
|
+
"@rcompat/fs": "^0.35.1",
|
|
25
|
+
"@rcompat/is": "^0.12.1",
|
|
26
|
+
"@rcompat/runtime": "^0.17.0",
|
|
27
|
+
"@rcompat/string": "^0.22.0",
|
|
28
|
+
"pema": "^0.10.0"
|
|
29
29
|
},
|
|
30
30
|
"peerDependencies": {
|
|
31
31
|
"handlebars": "4",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"htmx.org": "2",
|
|
34
34
|
"mustache": "4",
|
|
35
35
|
"nunjucks": "3",
|
|
36
|
-
"primate": "^0.
|
|
36
|
+
"primate": "^0.41.0"
|
|
37
37
|
},
|
|
38
38
|
"peerDependenciesMeta": {
|
|
39
39
|
"htmx-ext-client-side-templates": {
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
|
-
"build": "
|
|
72
|
+
"build": "pnpm run clean && tsc",
|
|
73
73
|
"clean": "rm -rf ./lib",
|
|
74
74
|
"lint": "eslint ."
|
|
75
75
|
}
|