@primate/htmx 0.9.0 → 0.9.1

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/package.json CHANGED
@@ -1,24 +1,25 @@
1
1
  {
2
2
  "name": "@primate/htmx",
3
- "version": "0.9.0",
3
+ "version": "0.9.1",
4
4
  "description": "Primate HTMX module",
5
- "homepage": "https://primatejs.com/modules/htmx",
6
- "bugs": "https://github.com/primatejs/htmx/issues",
5
+ "bugs": "https://github.com/primatejs/packages/issues",
7
6
  "license": "MIT",
8
- "repository": "https://github.com/primatejs/htmx",
7
+ "files": [
8
+ "src/**",
9
+ "!src/**/*.spec.js"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "https://github.com/primatejs/packages",
14
+ "directory": "packages/htmx"
15
+ },
9
16
  "dependencies": {
10
17
  "htmx.org": "^1.8.6",
11
- "runtime-compat": "^0.15.0"
12
- },
13
- "devDependencies": {
14
- "maximin": "^0.1.2"
18
+ "runtime-compat": "^0.15.1"
15
19
  },
16
20
  "peerDependencies": {
17
21
  "primate": "0.15"
18
22
  },
19
23
  "type": "module",
20
- "exports": "./exports.js",
21
- "engines": {
22
- "node": ">=17.9.0"
23
- }
24
+ "exports": "./src/exports.js"
24
25
  }
package/src/exports.js ADDED
@@ -0,0 +1 @@
1
+ export {default} from "./module.js";
package/src/module.js CHANGED
@@ -8,13 +8,13 @@ const loadComponent = async (file) => {
8
8
  }
9
9
  };
10
10
 
11
- const getBody = async (env, partial, file) => {
11
+ const getBody = async (app, partial, file) => {
12
12
  const body = await loadComponent(file);
13
- return partial ? body : env.render({body});
13
+ return partial ? body : app.render({body});
14
14
  };
15
15
 
16
16
  const handler = path => (name, {status = 200, partial = false} = {}) =>
17
- async (env, headers) => {
17
+ async (app, headers) => {
18
18
  const styleSrc = "style-src 'unsafe-inline';";
19
19
  const csp = `${headers["Content-Security-Policy"]}${styleSrc}`;
20
20
  const options = {
@@ -25,20 +25,20 @@ const handler = path => (name, {status = 200, partial = false} = {}) =>
25
25
  "Content-Security-Policy": csp,
26
26
  },
27
27
  };
28
- return [await getBody(env, partial, path.join(name).file), options];
28
+ return [await getBody(app, partial, path.join(name).file), options];
29
29
  };
30
30
 
31
31
  export default directory => ({
32
- register(env, next) {
33
- env.register("htmx", handler(directory ?? env.paths.components));
34
- return next(env);
32
+ register(app, next) {
33
+ app.register("htmx", handler(directory ?? app.paths.components));
34
+ return next(app);
35
35
  },
36
- async publish(env, next) {
36
+ async publish(app, next) {
37
37
  const src = "htmx.js";
38
38
  const path = ["node_modules", "htmx.org", "dist", src];
39
39
  const code = await Path.resolve().join(...path).file.read();
40
- await env.publish({src, code, type: "module"});
41
- env.bootstrap({type: "script", code: `import * as htmx from "./${src}";`});
42
- return next(env);
40
+ await app.publish({src, code, type: "module"});
41
+ app.bootstrap({type: "script", code: `import * as htmx from "./${src}";`});
42
+ return next(app);
43
43
  },
44
44
  });
package/LICENSE DELETED
@@ -1,19 +0,0 @@
1
- Copyright (c) Terrablue <terrablue@proton.me> and contributors.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy
4
- of this software and associated documentation files (the "Software"), to deal
5
- in the Software without restriction, including without limitation the rights
6
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- copies of the Software, and to permit persons to whom the Software is
8
- furnished to do so, subject to the following conditions:
9
-
10
- The above copyright notice and this permission notice shall be included in
11
- all copies or substantial portions of the Software.
12
-
13
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
16
- THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- THE SOFTWARE.
package/eslint.config.js DELETED
@@ -1 +0,0 @@
1
- export {default} from "maximin";
package/exports.js DELETED
@@ -1 +0,0 @@
1
- export {default} from "./src/module.js";