svelte-command 1.1.50 → 2.0.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/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2021-2023 by arlac77
1
+ Copyright (c) 2021-2024 by arlac77
2
2
  All rights reserved.
3
3
 
4
4
  Redistribution and use in source and binary forms, with or without
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Svelte v3](https://img.shields.io/badge/svelte-v3-orange.svg)](https://svelte.dev)
1
+ [![Svelte v4](https://img.shields.io/badge/svelte-v4-orange.svg)](https://svelte.dev)
2
2
  [![npm](https://img.shields.io/npm/v/svelte-command.svg)](https://www.npmjs.com/package/svelte-command)
3
3
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
4
4
  [![bundlejs](https://deno.bundlejs.com/?q=svelte-command\&badge=detailed)](https://bundlejs.com/?q=svelte-command)
@@ -86,9 +86,9 @@ Command executing a fetch request.
86
86
 
87
87
  ### Parameters
88
88
 
89
- * `url`  
90
- * `fetchOptions`  
91
- * `options` (optional, default `{}`)
89
+ * `url` **any** 
90
+ * `fetchOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
91
+ * `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `{}`)
92
92
 
93
93
  ## handleFailedResponse
94
94
 
package/package.json CHANGED
@@ -1,8 +1,9 @@
1
1
  {
2
2
  "name": "svelte-command",
3
- "version": "1.1.50",
3
+ "version": "2.0.0",
4
4
  "publishConfig": {
5
- "access": "public"
5
+ "access": "public",
6
+ "provenance": true
6
7
  },
7
8
  "exports": {
8
9
  ".": {
@@ -25,38 +26,43 @@
25
26
  ],
26
27
  "license": "BSD-2-Clause",
27
28
  "scripts": {
28
- "prepare": "vite build",
29
+ "prepare": "npm run prepare:vite",
30
+ "prepare:vite": "vite build",
29
31
  "start": "vite",
30
32
  "test": "npm run test:ava && npm run test:cafe",
31
33
  "test:cafe": "testcafe $BROWSER:headless tests/cafe/*-cafe.mjs --esm -s build/test --page-request-timeout 5000 --app-init-delay 8000 --app vite",
32
- "test:ava": "ava --timeout 2m tests/*-ava.mjs tests/*-ava-node.mjs && ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
34
+ "test:ava": "ava --timeout 4m tests/*-ava.mjs tests/*-ava-node.mjs",
33
35
  "docs": "documentation readme --section=API ./src/**/*.mjs",
34
36
  "lint": "npm run lint:docs",
35
37
  "lint:docs": "documentation lint ./src/**/*.mjs",
36
38
  "preview": "vite preview"
37
39
  },
38
40
  "devDependencies": {
39
- "@semantic-release/commit-analyzer": "^11.0.0",
41
+ "@semantic-release/commit-analyzer": "^12.0.0",
40
42
  "@semantic-release/exec": "^6.0.3",
41
- "@semantic-release/release-notes-generator": "^12.0.0",
42
- "@sveltejs/vite-plugin-svelte": "^2.4.6",
43
- "ava": "^5.3.1",
44
- "documentation": "^14.0.2",
45
- "mf-styling": "^3.0.5",
46
- "npm-pkgbuild": "^12.1.2",
47
- "semantic-release": "^22.0.5",
48
- "svelte": "^4.2.1",
49
- "testcafe": "^3.3.0",
50
- "vite": "^4.4.9",
51
- "vite-plugin-compression2": "^0.10.4"
43
+ "@semantic-release/github": "^10.0.4",
44
+ "@semantic-release/release-notes-generator": "^13.0.0",
45
+ "@sveltejs/vite-plugin-svelte": "^3.1.0",
46
+ "ava": "^6.1.3",
47
+ "documentation": "^14.0.3",
48
+ "mf-styling": "^3.1.6",
49
+ "npm-pkgbuild": "^15.3.14",
50
+ "semantic-release": "^23.1.1",
51
+ "svelte": "^5.0.0-next.136",
52
+ "testcafe": "^3.6.0",
53
+ "vite": "^5.2.11",
54
+ "vite-plugin-compression2": "^1.1.0"
55
+ },
56
+ "peerDependencies": {
57
+ "svelte": "^5.0.0-next.0"
52
58
  },
53
59
  "optionalDependencies": {
54
60
  "mf-hosting-cloudflare": "^1.0.6",
55
- "mf-hosting-frontend": "^2.2.3"
61
+ "mf-hosting-frontend": "^3.0.3"
56
62
  },
57
63
  "repository": {
58
64
  "type": "git",
59
- "url": "https://github.com/arlac77/svelte-command"
65
+ "url": "git+https://github.com/arlac77/svelte-command.git"
60
66
  },
61
67
  "bugs": {
62
68
  "url": "https://github.com/arlac77/svelte-command/issues"
@@ -77,7 +83,7 @@
77
83
  [
78
84
  "@semantic-release/exec",
79
85
  {
80
- "publishCmd": "npx npm-pkgbuild --available --continue --publish dist"
86
+ "publishCmd": "npx npm-pkgbuild --publish dist"
81
87
  }
82
88
  ],
83
89
  [
@@ -1,14 +1,14 @@
1
1
  <script>
2
2
  export let command;
3
3
 
4
- function handleKeydown(event) {
4
+ function onkeydown(event) {
5
5
  if (command.matchesKeydown?.(event)) {
6
6
  command.start();
7
7
  }
8
8
  }
9
9
  </script>
10
10
 
11
- <svelte:window on:keydown={handleKeydown} />
11
+ <svelte:window {onkeydown} />
12
12
 
13
13
  <button
14
14
  disabled={$command.disabled}
@@ -23,6 +23,6 @@
23
23
  <slot />
24
24
 
25
25
  {#if $command.active}
26
- <div class="spinner" />
26
+ <div class="spinner"></div>
27
27
  {/if}
28
28
  </button>
@@ -1,7 +1,7 @@
1
1
  import { BasicCommand } from "./command.mjs";
2
2
 
3
3
  /**
4
- * Ask for confirmation before esxecution a given Command.
4
+ * Ask for confirmation before execution a given Command.
5
5
  */
6
6
  export class ConfirmCommand extends BasicCommand {
7
7
  constructor(command) {
@@ -4,6 +4,14 @@ import { Command } from "./command.mjs";
4
4
  * Command executing a fetch request.
5
5
  */
6
6
  export class FetchCommand extends Command {
7
+
8
+ /**
9
+ *
10
+ * @param {*} url
11
+ * @param {Object} fetchOptions
12
+ * @param {Object} options
13
+ * @param {Function} [options.responseHandler]
14
+ */
7
15
  constructor(url, fetchOptions, options = {}) {
8
16
  const controller = new AbortController();
9
17
  super(