@primate/htmx 0.16.0 → 0.17.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/README.md +1 -1
- package/package.json +3 -3
- package/src/module.js +12 -8
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@primate/htmx",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.17.0",
|
|
4
4
|
"description": "Primate HTMX module",
|
|
5
5
|
"homepage": "https://primatejs.com/modules/htmx",
|
|
6
6
|
"bugs": "https://github.com/primatejs/primate/issues",
|
|
@@ -16,10 +16,10 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"htmx.org": "^1.9.4",
|
|
19
|
-
"runtime-compat": "^0.
|
|
19
|
+
"runtime-compat": "^0.25.7"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"primate": "0.
|
|
22
|
+
"primate": "0.22"
|
|
23
23
|
},
|
|
24
24
|
"type": "module",
|
|
25
25
|
"exports": "./src/exports.js"
|
package/src/module.js
CHANGED
|
@@ -13,9 +13,9 @@ const getBody = async (app, partial, file) => {
|
|
|
13
13
|
return partial ? body : app.render({body});
|
|
14
14
|
};
|
|
15
15
|
|
|
16
|
-
const handler =
|
|
17
|
-
async app => {
|
|
18
|
-
const
|
|
16
|
+
const handler = directory =>
|
|
17
|
+
(name, {status = Status.OK, partial = false} = {}) => async app => {
|
|
18
|
+
const components = app.runpath(directory);
|
|
19
19
|
const code = "import {htmx} from \"app\";";
|
|
20
20
|
await app.publish({code, type: "module", inline: true});
|
|
21
21
|
|
|
@@ -35,16 +35,20 @@ const handler = (name, {status = Status.OK, partial = false} = {}) =>
|
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
const name = "htmx.org";
|
|
39
|
+
export default ({
|
|
40
|
+
extension = "htmx",
|
|
41
|
+
directory,
|
|
42
|
+
} = {}) => ({
|
|
43
|
+
name: "primate:htmx",
|
|
40
44
|
register(app, next) {
|
|
41
|
-
app.register(
|
|
45
|
+
app.register(extension, handler(directory
|
|
46
|
+
?? app.config.location.components));
|
|
42
47
|
return next(app);
|
|
43
48
|
},
|
|
44
49
|
async publish(app, next) {
|
|
45
|
-
const name = "htmx.org";
|
|
46
50
|
await app.import(name);
|
|
47
|
-
app.
|
|
51
|
+
app.export({type: "script", code: `export * as htmx from "${name}";`});
|
|
48
52
|
return next(app);
|
|
49
53
|
},
|
|
50
54
|
});
|