@mawaru/sdk 0.19.0 → 0.20.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/_schemas/graph.test.ts +7 -8
- package/_schemas/graph.ts +1 -10
- package/dist/_schemas/graph.js +1 -9
- package/package.json +1 -1
package/_schemas/graph.test.ts
CHANGED
|
@@ -776,7 +776,7 @@ describe("saveGraphBodySchema(hooks)", () => {
|
|
|
776
776
|
on_output: false,
|
|
777
777
|
})
|
|
778
778
|
|
|
779
|
-
it("
|
|
779
|
+
it("hooks 配列を受け付ける(省略時は [] が補われる)", () => {
|
|
780
780
|
const withHooks = {
|
|
781
781
|
...programNode(),
|
|
782
782
|
hooks: [hook(), { ...hook("通知"), ref: "main" }],
|
|
@@ -795,14 +795,13 @@ describe("saveGraphBodySchema(hooks)", () => {
|
|
|
795
795
|
expect(without.nodes[0]?.hooks).toEqual([])
|
|
796
796
|
})
|
|
797
797
|
|
|
798
|
-
it("program
|
|
798
|
+
it("program 以外のノードにも hooks をアタッチできる", () => {
|
|
799
799
|
for (const node of [makeNode(), humanNode()]) {
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
).toThrow(/program ノード/)
|
|
800
|
+
const parsed = saveGraphBodySchema.parse({
|
|
801
|
+
nodes: [{ ...node, hooks: [hook()] }],
|
|
802
|
+
connections: [],
|
|
803
|
+
})
|
|
804
|
+
expect(parsed.nodes[0]?.hooks).toHaveLength(1)
|
|
806
805
|
}
|
|
807
806
|
})
|
|
808
807
|
|
package/_schemas/graph.ts
CHANGED
|
@@ -208,7 +208,7 @@ export const componentConfigSchema = z.object({
|
|
|
208
208
|
})
|
|
209
209
|
export type ComponentConfig = z.infer<typeof componentConfigSchema>
|
|
210
210
|
|
|
211
|
-
// ノードにアタッチされた IOHook(node_hooks
|
|
211
|
+
// ノードにアタッチされた IOHook(node_hooks に対応。アタッチは全 kind で可能)。
|
|
212
212
|
// on_input / on_output / on_signal はアタッチ時に repo の config.json(hookManifestSchema)から
|
|
213
213
|
// エディタが焼き込むスナップショット。ref 省略時はデフォルトブランチ
|
|
214
214
|
// (docs/tasks/done/NodeIOHooks(ノードへのIOフックのアタッチ).md・
|
|
@@ -385,15 +385,6 @@ export const saveGraphBodySchema = z
|
|
|
385
385
|
})
|
|
386
386
|
}
|
|
387
387
|
|
|
388
|
-
// フックをアタッチできるのは program ノードのみ
|
|
389
|
-
if (node.kind !== "program" && node.hooks.length > 0) {
|
|
390
|
-
ctx.addIssue({
|
|
391
|
-
code: "custom",
|
|
392
|
-
path: ["nodes", i, "hooks"],
|
|
393
|
-
message: "フックをアタッチできるのは program ノードだけです",
|
|
394
|
-
})
|
|
395
|
-
}
|
|
396
|
-
|
|
397
388
|
// フックの重複アタッチ(unique(node_id, hook_dir) の事前検証)
|
|
398
389
|
const hookDirs = new Set<string>()
|
|
399
390
|
node.hooks.forEach((hook, j) => {
|
package/dist/_schemas/graph.js
CHANGED
|
@@ -161,7 +161,7 @@ export const componentConfigSchema = z.object({
|
|
|
161
161
|
// 起動時の mergeRefs が行う。コンポーネントの設定値(refs)と1ノードのコンポーネント化.md)
|
|
162
162
|
refs: z.record(z.string(), z.unknown()).optional(),
|
|
163
163
|
});
|
|
164
|
-
// ノードにアタッチされた IOHook(node_hooks
|
|
164
|
+
// ノードにアタッチされた IOHook(node_hooks に対応。アタッチは全 kind で可能)。
|
|
165
165
|
// on_input / on_output / on_signal はアタッチ時に repo の config.json(hookManifestSchema)から
|
|
166
166
|
// エディタが焼き込むスナップショット。ref 省略時はデフォルトブランチ
|
|
167
167
|
// (docs/tasks/done/NodeIOHooks(ノードへのIOフックのアタッチ).md・
|
|
@@ -318,14 +318,6 @@ export const saveGraphBodySchema = z
|
|
|
318
318
|
message: "out ポートが最低1つ必要です",
|
|
319
319
|
});
|
|
320
320
|
}
|
|
321
|
-
// フックをアタッチできるのは program ノードのみ
|
|
322
|
-
if (node.kind !== "program" && node.hooks.length > 0) {
|
|
323
|
-
ctx.addIssue({
|
|
324
|
-
code: "custom",
|
|
325
|
-
path: ["nodes", i, "hooks"],
|
|
326
|
-
message: "フックをアタッチできるのは program ノードだけです",
|
|
327
|
-
});
|
|
328
|
-
}
|
|
329
321
|
// フックの重複アタッチ(unique(node_id, hook_dir) の事前検証)
|
|
330
322
|
const hookDirs = new Set();
|
|
331
323
|
node.hooks.forEach((hook, j) => {
|