@wssto2/vue-core 0.15.1 → 0.15.2
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/CHANGELOG.md +7 -0
- package/bin/templates/feature-crud/api.ts.tpl +1 -1
- package/dist/eslint/index.d.ts +5 -0
- package/dist/eslint/index.js +20 -11
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.15.2 — 2026-10-20
|
|
4
|
+
|
|
5
|
+
A hand-built `Idempotency-Key` header is now a lint error.
|
|
6
|
+
|
|
7
|
+
### New
|
|
8
|
+
- **eslint:** `vueCoreConfig` reports a hand-built `Idempotency-Key` header (`no-raw-idempotency-header`, a `no-restricted-syntax` entry): a `headers: { "Idempotency-Key": … }` object property in any casing, and `headers.set(...)` / `.append(...)` with that name. Use the request option `{ idempotencyKey }`, which is also re-sent on the renew-and-retry after a 401. `src/client` is excluded. An application that sets its own `no-restricted-syntax` replaces it and should spread `RAW_IDEMPOTENCY_HEADER_SELECTORS` (exported from `@wssto2/vue-core/eslint`).
|
|
9
|
+
|
|
3
10
|
## 0.15.1 — 2026-10-20
|
|
4
11
|
|
|
5
12
|
A dialog opened from a dialog could paint behind it.
|
|
@@ -17,7 +17,7 @@ export const __FEATURE_API_CLIENT__ = (http: HttpClient) => ({
|
|
|
17
17
|
|
|
18
18
|
/** A 422 lands on the form's fields (`form.submit`). */
|
|
19
19
|
async create(payload: __FEATURE_FORM_TYPE__, idempotencyKey: string): Promise<__FEATURE_ENTITY__> {
|
|
20
|
-
return (await http.request(__FEATURE_ROUTE_TABLE__.create, payload, {
|
|
20
|
+
return (await http.request(__FEATURE_ROUTE_TABLE__.create, payload, { idempotencyKey })).data;
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
|
package/dist/eslint/index.d.ts
CHANGED
|
@@ -6,6 +6,11 @@ import type { Linter } from "eslint";
|
|
|
6
6
|
*/
|
|
7
7
|
export declare const TYPED_RULES: readonly string[];
|
|
8
8
|
export declare const TYPED_RULE_SET: ReadonlySet<string>;
|
|
9
|
+
/** Rule `no-raw-idempotency-header`, as `no-restricted-syntax` selectors: the key goes through `RequestOptions.idempotencyKey`. */
|
|
10
|
+
export declare const RAW_IDEMPOTENCY_HEADER_SELECTORS: readonly {
|
|
11
|
+
selector: string;
|
|
12
|
+
message: string;
|
|
13
|
+
}[];
|
|
9
14
|
export interface VueCoreConfigOptions {
|
|
10
15
|
/**
|
|
11
16
|
* Turn on the type-aware rules (`TYPED_RULES`, at `warn`: the ratchet counts them). Type-aware linting is slow, so it is
|
package/dist/eslint/index.js
CHANGED
|
@@ -2,8 +2,8 @@ import l from "@eslint/js";
|
|
|
2
2
|
import u from "eslint-plugin-vue";
|
|
3
3
|
import r from "globals";
|
|
4
4
|
import t from "typescript-eslint";
|
|
5
|
-
import
|
|
6
|
-
const
|
|
5
|
+
import c from "vue-eslint-parser";
|
|
6
|
+
const i = [
|
|
7
7
|
"@typescript-eslint/await-thenable",
|
|
8
8
|
"@typescript-eslint/no-base-to-string",
|
|
9
9
|
"@typescript-eslint/no-floating-promises",
|
|
@@ -21,11 +21,17 @@ const o = [
|
|
|
21
21
|
"@typescript-eslint/restrict-plus-operands",
|
|
22
22
|
"@typescript-eslint/restrict-template-expressions",
|
|
23
23
|
"@typescript-eslint/unbound-method"
|
|
24
|
-
],
|
|
25
|
-
|
|
24
|
+
], b = new Set(i), o = "/^idempotency-key$/i", f = [
|
|
25
|
+
`Property[key.name='headers'] > ObjectExpression > Property[key.value=${o}]`,
|
|
26
|
+
`CallExpression[callee.property.name=/^(set|append)$/][arguments.0.value=${o}]`
|
|
27
|
+
].map((e) => ({
|
|
28
|
+
selector: e,
|
|
29
|
+
message: "Do not build the Idempotency-Key header by hand: pass the request option { idempotencyKey } (it is also re-sent on the renew-and-retry after a 401)."
|
|
30
|
+
}));
|
|
31
|
+
function h({ typed: e = !1, tsconfigRootDir: n, ignores: p = [], rules: a = {} } = {}) {
|
|
26
32
|
if (e && !n) throw new Error("vueCoreConfig: typed linting needs tsconfigRootDir (usually import.meta.dirname)");
|
|
27
33
|
return [
|
|
28
|
-
{ ignores: ["dist/**", "node_modules/**", "coverage/**", "**/*.d.ts", ...
|
|
34
|
+
{ ignores: ["dist/**", "node_modules/**", "coverage/**", "**/*.d.ts", ...p] },
|
|
29
35
|
l.configs.recommended,
|
|
30
36
|
...t.configs.recommended,
|
|
31
37
|
...u.configs["flat/recommended"],
|
|
@@ -36,7 +42,7 @@ function b({ typed: e = !1, tsconfigRootDir: n, ignores: i = [], rules: p = {} }
|
|
|
36
42
|
{
|
|
37
43
|
files: ["**/*.vue"],
|
|
38
44
|
languageOptions: {
|
|
39
|
-
parser:
|
|
45
|
+
parser: c,
|
|
40
46
|
parserOptions: { parser: t.parser, sourceType: "module", extraFileExtensions: [".vue"] }
|
|
41
47
|
}
|
|
42
48
|
},
|
|
@@ -48,7 +54,7 @@ function b({ typed: e = !1, tsconfigRootDir: n, ignores: i = [], rules: p = {} }
|
|
|
48
54
|
rules: {
|
|
49
55
|
// TypeScript reports undefined references itself, and no-undef cannot see ambient global types.
|
|
50
56
|
"no-undef": "off",
|
|
51
|
-
...e ? Object.fromEntries(
|
|
57
|
+
...e ? Object.fromEntries(i.map((s) => [s, "warn"])) : {},
|
|
52
58
|
// Superseded by @typescript-eslint/no-unused-vars below; the core rule mis-fires on type-only constructs.
|
|
53
59
|
"no-unused-vars": "off",
|
|
54
60
|
"no-useless-assignment": "error",
|
|
@@ -73,15 +79,18 @@ function b({ typed: e = !1, tsconfigRootDir: n, ignores: i = [], rules: p = {} }
|
|
|
73
79
|
"error",
|
|
74
80
|
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_", destructuredArrayIgnorePattern: "^_" }
|
|
75
81
|
],
|
|
76
|
-
...
|
|
82
|
+
...a
|
|
77
83
|
}
|
|
78
84
|
},
|
|
85
|
+
// The client implementation sets the header itself; applications must use the request option.
|
|
86
|
+
{ files: ["**/*.{ts,vue}"], ignores: ["src/client/**"], rules: { "no-restricted-syntax": ["error", ...f] } },
|
|
79
87
|
// Test files (named *.test.ts or in a tests/ folder) define stub components inline, several per file, with untyped prop lists on purpose.
|
|
80
88
|
{ files: ["**/*.test.ts", "tests/**/*.{ts,vue}"], languageOptions: { globals: r.vitest }, rules: { "vue/require-prop-types": "off", "vue/one-component-per-file": "off" } }
|
|
81
89
|
];
|
|
82
90
|
}
|
|
83
91
|
export {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
b as
|
|
92
|
+
f as RAW_IDEMPOTENCY_HEADER_SELECTORS,
|
|
93
|
+
i as TYPED_RULES,
|
|
94
|
+
b as TYPED_RULE_SET,
|
|
95
|
+
h as vueCoreConfig
|
|
87
96
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** The version of @wssto2/vue-core (kept equal to package.json by index.test.ts). */
|
|
2
|
-
export declare const version = "0.15.
|
|
2
|
+
export declare const version = "0.15.2";
|
package/dist/index.js
CHANGED
package/package.json
CHANGED