fix(workflow): create node script (#1856)

This commit is contained in:
July
2025-08-29 11:01:51 +08:00
committed by GitHub
parent 042f2299f0
commit 2ffd7a8221
20 changed files with 564 additions and 637 deletions

View File

@@ -13,7 +13,7 @@ import { type FormData } from './types';
import { FormRender } from './form';
import { transformOnInit, transformOnSubmit } from './data-transformer';
export const {{CONSTANT_NAME_PLACE_HOLDER}}_FORM_META: FormMetaV2<FormData> = {
export const <%= it.CONSTANT_NAME_PLACE_HOLDER %>_FORM_META: FormMetaV2<FormData> = {
// 节点表单渲染
render: () => <FormRender />,

View File

@@ -17,7 +17,7 @@ export const FormRender = () => (
<OutputsField
title={I18n.t('workflow_detail_node_output')}
tooltip={I18n.t('node_http_response_data')}
id="{{CAMEL_NAME_PLACE_HOLDER}}-node-outputs"
id="<%= it.CAMEL_NAME_PLACE_HOLDER %>-node-outputs"
name="outputs"
topLevelReadonly={true}
customReadonly

View File

@@ -0,0 +1,2 @@
export { <%= it.CONSTANT_NAME_PLACE_HOLDER %>_NODE_REGISTRY } from './node-registry';
export { <%= it.PASCAL_NAME_PLACE_HOLDER %>Content } from './node-content';

View File

@@ -1,2 +0,0 @@
export { {{CONSTANT_NAME_PLACE_HOLDER}}_NODE_REGISTRY } from './node-registry';
export { {{PASCAL_NAME_PLACE_HOLDER}}Content } from './node-content';

View File

@@ -1,6 +1,6 @@
import { InputParameters, Outputs } from '../common/components';
export function {{PASCAL_NAME_PLACE_HOLDER}}Content() {
export function <%= it.PASCAL_NAME_PLACE_HOLDER %>Content() {
return (
<>
<InputParameters />

View File

@@ -7,21 +7,19 @@ import {
type WorkflowNodeRegistry,
} from '@coze-workflow/base';
import { {{CONSTANT_NAME_PLACE_HOLDER}}_FORM_META } from './form-meta';
import { <%= it.CONSTANT_NAME_PLACE_HOLDER %>_FORM_META } from './form-meta';
import { INPUT_PATH } from './constants';
{{#if SUPPORT_TEST}}
import { test, type NodeTestMeta } from './node-test';
{{/if}}
export const {{CONSTANT_NAME_PLACE_HOLDER}}_NODE_REGISTRY: WorkflowNodeRegistry{{#if SUPPORT_TEST}}<NodeTestMeta>{{/if}} = {
type: StandardNodeType.{{PASCAL_NAME_PLACE_HOLDER}},
export const <%= it.CONSTANT_NAME_PLACE_HOLDER %>_NODE_REGISTRY: WorkflowNodeRegistry<NodeTestMeta> = {
type: StandardNodeType.<%= it.PASCAL_NAME_PLACE_HOLDER %>,
meta: {
nodeDTOType: StandardNodeType.{{PASCAL_NAME_PLACE_HOLDER}},
nodeDTOType: StandardNodeType.<%= it.PASCAL_NAME_PLACE_HOLDER %>,
size: { width: 360, height: 130.7 },
nodeMetaPath: DEFAULT_NODE_META_PATH,
outputsPath: DEFAULT_OUTPUTS_PATH,
inputParametersPath: INPUT_PATH,
test{{#unless SUPPORT_TEST}}: false{{/unless}},
test,
},
formMeta: {{CONSTANT_NAME_PLACE_HOLDER}}_FORM_META,
formMeta: <%= it.CONSTANT_NAME_PLACE_HOLDER %>_FORM_META,
};

View File

@@ -0,0 +1,5 @@
import type { NodeTestMeta } from '@/test-run-kit';
const test: NodeTestMeta = <%= it.IS_SUPPORT_TEST %>;
export { test, type NodeTestMeta };

View File

@@ -1,5 +0,0 @@
import type { NodeTestMeta } from '@/test-run-kit';
const test: NodeTestMeta = true;
export { test, type NodeTestMeta };