mealie-mcp 0.2.4 → 0.2.6
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 +4 -5
- package/dist/schema.js +30 -18
- package/dist/schema.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -270,10 +270,9 @@ This repo ships two GitHub Actions workflows:
|
|
|
270
270
|
|
|
271
271
|
- **CI** (`.github/workflows/ci.yml`) — runs type-check, build and tests on every
|
|
272
272
|
pull request (and on non-`main` branch pushes) across Node 18/20/22.
|
|
273
|
-
- **Release** (`.github/workflows/release.yml`) — on every push/merge to `main
|
|
274
|
-
builds and tests,
|
|
275
|
-
notes) and publishes to npm
|
|
276
|
-
a release, bump `version` in `package.json` in your PR; merging it ships the release.
|
|
273
|
+
- **Release** (`.github/workflows/release.yml`) — on every push/merge to `main` that touches source files,
|
|
274
|
+
builds and tests, auto-bumps the patch version, creates a GitHub Release `v<version>` (with auto-generated
|
|
275
|
+
notes), and publishes to npm.
|
|
277
276
|
|
|
278
277
|
### Publishing to npm (Trusted Publishing / OIDC)
|
|
279
278
|
|
|
@@ -297,7 +296,7 @@ there is a **one-time bootstrap** for the first ever publish:
|
|
|
297
296
|
- **Repository:** `mealie-mcp`
|
|
298
297
|
- **Workflow filename:** `release.yml`
|
|
299
298
|
- **Environment:** *(leave blank)*
|
|
300
|
-
3. From then on, **every merge to `main`
|
|
299
|
+
3. From then on, **every merge to `main` that touches source files auto-bumps the patch version and publishes
|
|
301
300
|
automatically** over OIDC — no tokens, no manual steps.
|
|
302
301
|
|
|
303
302
|
> Requirements (handled by the workflow): `id-token: write` permission, Node
|
package/dist/schema.js
CHANGED
|
@@ -25,33 +25,39 @@ function clone(value) {
|
|
|
25
25
|
*/
|
|
26
26
|
function collectRefs(node, components, seen) {
|
|
27
27
|
if (Array.isArray(node)) {
|
|
28
|
-
for
|
|
29
|
-
|
|
28
|
+
// ⚡ Bolt: Using a standard for-loop avoids allocating an iterator on every recursive call.
|
|
29
|
+
for (let i = 0; i < node.length; i++)
|
|
30
|
+
collectRefs(node[i], components, seen);
|
|
30
31
|
return;
|
|
31
32
|
}
|
|
32
33
|
if (!node || typeof node !== "object")
|
|
33
34
|
return;
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
35
|
+
const obj = node;
|
|
36
|
+
if (typeof obj.$ref === "string") {
|
|
37
|
+
const match = COMPONENT_REF.exec(obj.$ref);
|
|
38
|
+
if (match) {
|
|
39
|
+
const name = match[1];
|
|
40
|
+
if (!seen.has(name)) {
|
|
41
|
+
seen.add(name);
|
|
42
|
+
if (components[name])
|
|
43
|
+
collectRefs(components[name], components, seen);
|
|
44
44
|
}
|
|
45
|
-
continue;
|
|
46
45
|
}
|
|
47
|
-
|
|
46
|
+
}
|
|
47
|
+
// ⚡ Bolt: Using for...in avoids Object.entries() which allocates an array
|
|
48
|
+
// of all key-value pairs on every recursive call, severely hurting performance.
|
|
49
|
+
for (const key in obj) {
|
|
50
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
51
|
+
if (key !== "$ref")
|
|
52
|
+
collectRefs(obj[key], components, seen);
|
|
53
|
+
}
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
56
|
/** Rewrite `#/components/schemas/X` refs to local `#/$defs/X` refs (in place). */
|
|
51
57
|
function rewriteRefs(node) {
|
|
52
58
|
if (Array.isArray(node)) {
|
|
53
|
-
for (
|
|
54
|
-
rewriteRefs(
|
|
59
|
+
for (let i = 0; i < node.length; i++)
|
|
60
|
+
rewriteRefs(node[i]);
|
|
55
61
|
return;
|
|
56
62
|
}
|
|
57
63
|
if (!node || typeof node !== "object")
|
|
@@ -62,8 +68,14 @@ function rewriteRefs(node) {
|
|
|
62
68
|
if (match)
|
|
63
69
|
obj.$ref = `#/$defs/${match[1]}`;
|
|
64
70
|
}
|
|
65
|
-
|
|
66
|
-
|
|
71
|
+
// ⚡ Bolt: Using for...in avoids Object.values() which allocates an array
|
|
72
|
+
// of all values on every recursive call.
|
|
73
|
+
for (const key in obj) {
|
|
74
|
+
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
75
|
+
if (key !== "$ref")
|
|
76
|
+
rewriteRefs(obj[key]);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
67
79
|
}
|
|
68
80
|
/**
|
|
69
81
|
* Given a set of root schemas, build the `$defs` map containing the transitive
|
package/dist/schema.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../src/schema.ts"],"names":[],"mappings":"AAEA,MAAM,aAAa,GAAG,gCAAgC,CAAC;AAEvD;;;;;GAKG;AACH,SAAS,KAAK,CAAI,KAAQ;IACxB,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC9D,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,GAAG,GAAG,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;QACpC,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE;YAAE,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;QAChE,OAAO,GAAQ,CAAC;IAClB,CAAC;IACD,MAAM,GAAG,GAAQ,EAAE,CAAC;IACpB,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,GAAG,CAAC,CAAC,CAAC,GAAG,KAAK,CAAE,KAAa,CAAC,CAAC,CAAC,CAAC,CAAC;IACzD,OAAO,GAAG,CAAC;AACb,CAAC;AAED;;;GAGG;AACH,SAAS,WAAW,CAClB,IAAa,EACb,UAAsC,EACtC,IAAiB;IAEjB,I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