@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 CHANGED
@@ -1,5 +1,5 @@
1
1
  # HTMX
2
2
 
3
- This handler module serves HTMX components with the .htmx extension.
3
+ This handler serves HTMX components with the `htmx` file extension.
4
4
 
5
5
  ## [Documentation](https://primatejs.com/modules/htmx)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primate/htmx",
3
- "version": "0.16.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.24.1"
19
+ "runtime-compat": "^0.25.7"
20
20
  },
21
21
  "peerDependencies": {
22
- "primate": "0.21"
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 = (name, {status = Status.OK, partial = false} = {}) =>
17
- async app => {
18
- const {build: {paths: {components}}} = app;
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
- export default _ => ({
39
- name: "@primate/htmx",
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("htmx", handler);
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.bootstrap({type: "script", code: `export * as htmx from "${name}";`});
51
+ app.export({type: "script", code: `export * as htmx from "${name}";`});
48
52
  return next(app);
49
53
  },
50
54
  });