@adminide-stack/form-builder-core 5.1.4-alpha.82 → 6.0.1-alpha.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 +30 -21
- package/package.json +2 -2
- package/CHANGELOG.md +0 -60
- package/rollup.config.mjs +0 -33
- package/src/index.ts +0 -5
- package/src/inngest/MONACO_INTEGRATION_EXAMPLE.md +0 -406
- package/src/inngest/README_AUTOCOMPLETE.md +0 -380
- package/src/inngest/generateFunctionCode.ts +0 -248
- package/src/inngest/interfaces/index.ts +0 -1
- package/src/inngest/interfaces/types.ts +0 -63
- package/src/inngest/monacoAutocompleteIntegration.ts +0 -432
- package/src/inngest/stepGenerator.ts +0 -538
- package/src/utils/json.ts +0 -50
- package/tsconfig.json +0 -14
package/LICENSE
CHANGED
|
@@ -1,21 +1,30 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
Copyright (c)
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
THE
|
|
1
|
+
PROPRIETARY SOFTWARE LICENSE
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 CDMBase. All Rights Reserved.
|
|
4
|
+
|
|
5
|
+
This software and associated documentation files (the "Software") are the
|
|
6
|
+
proprietary and confidential property of CDMBase.
|
|
7
|
+
|
|
8
|
+
ALL RIGHTS RESERVED.
|
|
9
|
+
|
|
10
|
+
No part of this Software may be reproduced, distributed, transmitted,
|
|
11
|
+
displayed, published, or broadcast in any form or by any means, electronic,
|
|
12
|
+
mechanical, photocopying, recording, or otherwise, without the prior written
|
|
13
|
+
permission of CDMBase.
|
|
14
|
+
|
|
15
|
+
The Software is provided to authorized users only under separate written
|
|
16
|
+
agreement and may not be used, copied, modified, merged, published, distributed,
|
|
17
|
+
sublicensed, and/or sold without express written permission from CDMBase.
|
|
18
|
+
|
|
19
|
+
UNAUTHORIZED USE, REPRODUCTION, OR DISTRIBUTION OF THIS SOFTWARE, OR ANY
|
|
20
|
+
PORTION OF IT, MAY RESULT IN SEVERE CIVIL AND CRIMINAL PENALTIES, AND WILL
|
|
21
|
+
BE PROSECUTED TO THE MAXIMUM EXTENT POSSIBLE UNDER LAW.
|
|
22
|
+
|
|
23
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
24
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
25
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
26
|
+
CDMBase BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
27
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
28
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
29
|
+
|
|
30
|
+
For licensing inquiries, please contact: legal@cdmbase.com
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adminide-stack/form-builder-core",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "6.0.1-alpha.0",
|
|
4
4
|
"sideEffects": false,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -24,5 +24,5 @@
|
|
|
24
24
|
"publishConfig": {
|
|
25
25
|
"access": "public"
|
|
26
26
|
},
|
|
27
|
-
"gitHead": "
|
|
27
|
+
"gitHead": "3b03b6491950e7c03b51a00014c3ff879a21fcdf"
|
|
28
28
|
}
|
package/CHANGELOG.md
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
# Change Log
|
|
2
|
-
|
|
3
|
-
All notable changes to this project will be documented in this file.
|
|
4
|
-
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
|
-
|
|
6
|
-
## [5.1.4-alpha.82](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.81...v5.1.4-alpha.82) (2025-10-25)
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
9
|
-
|
|
10
|
-
## [5.1.4-alpha.81](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.80...v5.1.4-alpha.81) (2025-10-24)
|
|
11
|
-
|
|
12
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
13
|
-
|
|
14
|
-
## [5.1.4-alpha.66](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.65...v5.1.4-alpha.66) (2025-10-16)
|
|
15
|
-
|
|
16
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
17
|
-
|
|
18
|
-
## [5.1.4-alpha.62](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.61...v5.1.4-alpha.62) (2025-10-11)
|
|
19
|
-
|
|
20
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
21
|
-
|
|
22
|
-
## [5.1.4-alpha.61](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.60...v5.1.4-alpha.61) (2025-10-11)
|
|
23
|
-
|
|
24
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
25
|
-
|
|
26
|
-
## [5.1.4-alpha.58](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.57...v5.1.4-alpha.58) (2025-10-06)
|
|
27
|
-
|
|
28
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
29
|
-
|
|
30
|
-
## [5.1.4-alpha.57](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.56...v5.1.4-alpha.57) (2025-10-03)
|
|
31
|
-
|
|
32
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
33
|
-
|
|
34
|
-
## [5.1.4-alpha.49](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.48...v5.1.4-alpha.49) (2025-09-24)
|
|
35
|
-
|
|
36
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
37
|
-
|
|
38
|
-
## [5.1.4-alpha.48](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.47...v5.1.4-alpha.48) (2025-09-23)
|
|
39
|
-
|
|
40
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
41
|
-
|
|
42
|
-
## [5.1.4-alpha.47](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.46...v5.1.4-alpha.47) (2025-09-23)
|
|
43
|
-
|
|
44
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
45
|
-
|
|
46
|
-
## [5.1.4-alpha.46](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.45...v5.1.4-alpha.46) (2025-09-23)
|
|
47
|
-
|
|
48
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
49
|
-
|
|
50
|
-
## [5.1.4-alpha.45](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.44...v5.1.4-alpha.45) (2025-09-23)
|
|
51
|
-
|
|
52
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
53
|
-
|
|
54
|
-
## [5.1.4-alpha.44](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.43...v5.1.4-alpha.44) (2025-09-23)
|
|
55
|
-
|
|
56
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
|
57
|
-
|
|
58
|
-
## [5.1.4-alpha.43](https://github.com/CDEBase/forms-stack/compare/v5.1.4-alpha.42...v5.1.4-alpha.43) (2025-09-23)
|
|
59
|
-
|
|
60
|
-
**Note:** Version bump only for package @adminide-stack/form-builder-core
|
package/rollup.config.mjs
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { createRollupConfig } from '../../../rollup.config.base.mjs';
|
|
2
|
-
|
|
3
|
-
// Define any additional plugins specific to this bundle
|
|
4
|
-
const additionalPlugins = [];
|
|
5
|
-
|
|
6
|
-
// Use the createRollupConfig function to merge the base and specific configurations
|
|
7
|
-
export default (commandLineArgs) => {
|
|
8
|
-
const isWatchMode = commandLineArgs.watch;
|
|
9
|
-
return [
|
|
10
|
-
createRollupConfig(
|
|
11
|
-
{
|
|
12
|
-
input: ['src/index.ts'],
|
|
13
|
-
plugins: [
|
|
14
|
-
// Spread in additional plugins specific to this config
|
|
15
|
-
...additionalPlugins,
|
|
16
|
-
],
|
|
17
|
-
output: [
|
|
18
|
-
{
|
|
19
|
-
dir: 'lib',
|
|
20
|
-
format: 'es',
|
|
21
|
-
name: 'form-stack-server',
|
|
22
|
-
compact: true,
|
|
23
|
-
exports: 'named',
|
|
24
|
-
sourcemap: true,
|
|
25
|
-
preserveModules: true,
|
|
26
|
-
chunkFileNames: '[name]-[hash].[format].js',
|
|
27
|
-
},
|
|
28
|
-
],
|
|
29
|
-
},
|
|
30
|
-
isWatchMode,
|
|
31
|
-
),
|
|
32
|
-
];
|
|
33
|
-
};
|
package/src/index.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export * from './inngest/interfaces/types';
|
|
2
|
-
export * from './inngest/generateFunctionCode';
|
|
3
|
-
export { generateFromExtractedFunctions, extractFunctionBody } from './inngest/stepGenerator';
|
|
4
|
-
export * from './inngest/monacoAutocompleteIntegration';
|
|
5
|
-
export * from './utils/json';
|
|
@@ -1,406 +0,0 @@
|
|
|
1
|
-
# Monaco Autocomplete Integration Example
|
|
2
|
-
|
|
3
|
-
This guide shows how to integrate the JavaScript autocomplete extension with your CodeEditor component using the command service pattern.
|
|
4
|
-
|
|
5
|
-
## Integration in CodeEditor Component
|
|
6
|
-
|
|
7
|
-
Here's how to update your `CodeEditor.tsx` to use the autocomplete extension:
|
|
8
|
-
|
|
9
|
-
```tsx
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import Editor from '@monaco-editor/react';
|
|
12
|
-
import {
|
|
13
|
-
setupMonacoAutocomplete,
|
|
14
|
-
setupStepAutocomplete,
|
|
15
|
-
} from '@form-builder/core/inngest/monacoAutocompleteIntegration';
|
|
16
|
-
import { EditorSettings } from '../../types/inngest';
|
|
17
|
-
|
|
18
|
-
interface CodeEditorProps {
|
|
19
|
-
value: string;
|
|
20
|
-
onChange: (value: string | undefined) => void;
|
|
21
|
-
language?: string;
|
|
22
|
-
settings: EditorSettings;
|
|
23
|
-
height?: string;
|
|
24
|
-
readOnly?: boolean;
|
|
25
|
-
step?: any; // Current Inngest step being edited
|
|
26
|
-
services?: any; // Service container with command service
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const CodeEditor: React.FC<CodeEditorProps> = ({
|
|
30
|
-
value,
|
|
31
|
-
onChange,
|
|
32
|
-
language = 'typescript',
|
|
33
|
-
settings,
|
|
34
|
-
height = '400px',
|
|
35
|
-
readOnly = false,
|
|
36
|
-
step,
|
|
37
|
-
services,
|
|
38
|
-
}) => {
|
|
39
|
-
const handleEditorWillMount = async (monaco: any) => {
|
|
40
|
-
// 🆕 Setup autocomplete using the extension
|
|
41
|
-
if (services?.commands) {
|
|
42
|
-
if (step) {
|
|
43
|
-
// Setup step-specific autocomplete
|
|
44
|
-
await setupStepAutocomplete(monaco, step, value, services.commands);
|
|
45
|
-
} else {
|
|
46
|
-
// Setup general JavaScript autocomplete
|
|
47
|
-
await setupMonacoAutocomplete(
|
|
48
|
-
monaco,
|
|
49
|
-
{
|
|
50
|
-
enableInngestContext: true,
|
|
51
|
-
customScope: ['step', 'event'],
|
|
52
|
-
enableHoverInfo: true,
|
|
53
|
-
commandService: services.commands,
|
|
54
|
-
},
|
|
55
|
-
services.commands,
|
|
56
|
-
);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
// Add cdeops API type definitions
|
|
61
|
-
const cdeopsTypes = `
|
|
62
|
-
declare module 'cdeops/client' {
|
|
63
|
-
export interface ICodeJavascriptRequest {
|
|
64
|
-
script: string;
|
|
65
|
-
args: any[];
|
|
66
|
-
timeout?: number;
|
|
67
|
-
context?: Record<string, any>;
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export namespace code {
|
|
71
|
-
export namespace javascript {
|
|
72
|
-
export function executeScript(request: ICodeJavascriptRequest): Promise<any>;
|
|
73
|
-
export function getCompletions(context: { text: string; position: number; scope?: string[] }): Promise<any>;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
`;
|
|
78
|
-
|
|
79
|
-
monaco.languages.typescript.typescriptDefaults.addExtraLib(cdeopsTypes, 'file:///cdeops-types.d.ts');
|
|
80
|
-
|
|
81
|
-
// Add Inngest ambient types
|
|
82
|
-
const inngestAmbientTypes = `
|
|
83
|
-
declare const step: {
|
|
84
|
-
run<T>(id: string, fn: (event: any, step: any) => Promise<T> | T): Promise<T>;
|
|
85
|
-
sendEvent(id: string, input: { name: string; data?: any }): Promise<void>;
|
|
86
|
-
waitForEvent<T = any>(id: string, opts: { event: string; timeout?: string | number }): Promise<T>;
|
|
87
|
-
sleep(id: string, ms: string | number): Promise<void>;
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
declare const event: { data: any };
|
|
91
|
-
`;
|
|
92
|
-
|
|
93
|
-
monaco.languages.typescript.typescriptDefaults.addExtraLib(
|
|
94
|
-
inngestAmbientTypes,
|
|
95
|
-
'file:///inngest-ambient-types.d.ts',
|
|
96
|
-
);
|
|
97
|
-
|
|
98
|
-
// Configure TypeScript compiler options
|
|
99
|
-
monaco.languages.typescript.typescriptDefaults.setCompilerOptions({
|
|
100
|
-
target: monaco.languages.typescript.ScriptTarget.ES2020,
|
|
101
|
-
allowNonTSExtensions: true,
|
|
102
|
-
moduleResolution: monaco.languages.typescript.ModuleResolutionKind.NodeJs,
|
|
103
|
-
module: monaco.languages.typescript.ModuleKind.CommonJS,
|
|
104
|
-
noEmit: true,
|
|
105
|
-
esModuleInterop: true,
|
|
106
|
-
jsx: monaco.languages.typescript.JsxEmit.React,
|
|
107
|
-
reactNamespace: 'React',
|
|
108
|
-
allowJs: true,
|
|
109
|
-
typeRoots: ['node_modules/@types'],
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const editorOptions = {
|
|
114
|
-
fontSize: settings.fontSize,
|
|
115
|
-
tabSize: settings.tabSize,
|
|
116
|
-
wordWrap: settings.wordWrap ? ('on' as 'on') : ('off' as 'off'),
|
|
117
|
-
minimap: { enabled: false },
|
|
118
|
-
scrollBeyondLastLine: false,
|
|
119
|
-
automaticLayout: true,
|
|
120
|
-
formatOnPaste: true,
|
|
121
|
-
formatOnType: true,
|
|
122
|
-
readOnly,
|
|
123
|
-
suggest: {
|
|
124
|
-
showWords: false,
|
|
125
|
-
showSnippets: true,
|
|
126
|
-
preview: true, // Show completion preview
|
|
127
|
-
showIcons: true, // Show icons for completions
|
|
128
|
-
},
|
|
129
|
-
quickSuggestions: {
|
|
130
|
-
other: true,
|
|
131
|
-
comments: false,
|
|
132
|
-
strings: false,
|
|
133
|
-
},
|
|
134
|
-
hover: {
|
|
135
|
-
enabled: true, // Enable hover info
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
const handleEditorDidMount = (_editor: any, monaco: any) => {
|
|
140
|
-
// Your existing Inngest snippets still work alongside autocomplete!
|
|
141
|
-
monaco.languages.registerCompletionItemProvider('typescript', {
|
|
142
|
-
provideCompletionItems: () => {
|
|
143
|
-
const suggestions = [
|
|
144
|
-
{
|
|
145
|
-
label: 'step.run',
|
|
146
|
-
kind: monaco.languages.CompletionItemKind.Snippet,
|
|
147
|
-
insertText: [
|
|
148
|
-
"const ${1:result} = await step.run('${2:step-id}', async (event, step) => {",
|
|
149
|
-
' ${3:// your logic}',
|
|
150
|
-
' return ${4:{ success: true }};',
|
|
151
|
-
'});',
|
|
152
|
-
].join('\n'),
|
|
153
|
-
insertTextRules: monaco.languages.CompletionItemInsertTextRule.InsertAsSnippet,
|
|
154
|
-
documentation: 'Run a unit of work inside an Workflow step',
|
|
155
|
-
},
|
|
156
|
-
// ... other snippets
|
|
157
|
-
];
|
|
158
|
-
|
|
159
|
-
return { suggestions };
|
|
160
|
-
},
|
|
161
|
-
});
|
|
162
|
-
};
|
|
163
|
-
|
|
164
|
-
return (
|
|
165
|
-
<Editor
|
|
166
|
-
height={height}
|
|
167
|
-
language={language}
|
|
168
|
-
value={value}
|
|
169
|
-
onChange={onChange}
|
|
170
|
-
theme={settings.theme}
|
|
171
|
-
options={editorOptions}
|
|
172
|
-
beforeMount={handleEditorWillMount}
|
|
173
|
-
onMount={handleEditorDidMount}
|
|
174
|
-
/>
|
|
175
|
-
);
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
export default CodeEditor;
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
## Using in InngestEditor Component
|
|
182
|
-
|
|
183
|
-
Here's how to pass the services to your CodeEditor:
|
|
184
|
-
|
|
185
|
-
```tsx
|
|
186
|
-
import React, { useContext } from 'react';
|
|
187
|
-
import CodeEditor from './CodeEditor';
|
|
188
|
-
import { ServiceContext } from '../../context/ServiceContext'; // Your service context
|
|
189
|
-
|
|
190
|
-
const InngestEditor: React.FC = () => {
|
|
191
|
-
const services = useContext(ServiceContext); // Get services from context
|
|
192
|
-
const [code, setCode] = React.useState('');
|
|
193
|
-
const [currentStep, setCurrentStep] = React.useState(null);
|
|
194
|
-
|
|
195
|
-
return (
|
|
196
|
-
<div>
|
|
197
|
-
<CodeEditor
|
|
198
|
-
value={code}
|
|
199
|
-
onChange={setCode}
|
|
200
|
-
language="typescript"
|
|
201
|
-
settings={editorSettings}
|
|
202
|
-
step={currentStep}
|
|
203
|
-
services={services} // Pass services including commands
|
|
204
|
-
/>
|
|
205
|
-
</div>
|
|
206
|
-
);
|
|
207
|
-
};
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
## Calling Extension Commands
|
|
211
|
-
|
|
212
|
-
The integration uses your existing command pattern:
|
|
213
|
-
|
|
214
|
-
```typescript
|
|
215
|
-
// Example: Get completions
|
|
216
|
-
const result = await services.commands.executeCommand({
|
|
217
|
-
command: 'jsAutocomplete.getCompletions',
|
|
218
|
-
arguments: [text, position, scope],
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
// Example: Get type info
|
|
222
|
-
const typeInfo = await services.commands.executeCommand({
|
|
223
|
-
command: 'jsAutocomplete.getTypeInfo',
|
|
224
|
-
arguments: ['functionName', ['step', 'event']],
|
|
225
|
-
});
|
|
226
|
-
|
|
227
|
-
// Example: Install a library
|
|
228
|
-
await services.commands.executeCommand({
|
|
229
|
-
command: 'jsAutocomplete.installLibrary',
|
|
230
|
-
arguments: ['https://cdn.jsdelivr.net/npm/@types/lodash/index.d.ts', ['_', 'lodash']],
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
// Example: Update config
|
|
234
|
-
await services.commands.executeCommand({
|
|
235
|
-
command: 'jsAutocomplete.updateConfig',
|
|
236
|
-
arguments: [
|
|
237
|
-
{
|
|
238
|
-
includeDefaults: true,
|
|
239
|
-
includeLibraries: true,
|
|
240
|
-
customDefinitions: ['lodash', 'moment'],
|
|
241
|
-
},
|
|
242
|
-
],
|
|
243
|
-
});
|
|
244
|
-
```
|
|
245
|
-
|
|
246
|
-
## Available Extension Commands
|
|
247
|
-
|
|
248
|
-
### `jsAutocomplete.getCompletions`
|
|
249
|
-
|
|
250
|
-
Get code completions at a specific position.
|
|
251
|
-
|
|
252
|
-
**Arguments:** `[text: string, position: number, scope?: string[]]`
|
|
253
|
-
|
|
254
|
-
**Returns:**
|
|
255
|
-
|
|
256
|
-
```typescript
|
|
257
|
-
{
|
|
258
|
-
completions: Array<{
|
|
259
|
-
name: string;
|
|
260
|
-
type?: string;
|
|
261
|
-
doc?: string;
|
|
262
|
-
url?: string;
|
|
263
|
-
}>;
|
|
264
|
-
isIncomplete: boolean;
|
|
265
|
-
}
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
### `jsAutocomplete.getTypeInfo`
|
|
269
|
-
|
|
270
|
-
Get type information for a symbol.
|
|
271
|
-
|
|
272
|
-
**Arguments:** `[symbol: string, scope?: string[]]`
|
|
273
|
-
|
|
274
|
-
**Returns:**
|
|
275
|
-
|
|
276
|
-
```typescript
|
|
277
|
-
{
|
|
278
|
-
type?: string;
|
|
279
|
-
doc?: string;
|
|
280
|
-
url?: string;
|
|
281
|
-
} | null
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
### `jsAutocomplete.installLibrary`
|
|
285
|
-
|
|
286
|
-
Install a library for autocomplete.
|
|
287
|
-
|
|
288
|
-
**Arguments:** `[url: string, accessors: string[]]`
|
|
289
|
-
|
|
290
|
-
**Returns:** `boolean`
|
|
291
|
-
|
|
292
|
-
### `jsAutocomplete.uninstallLibrary`
|
|
293
|
-
|
|
294
|
-
Uninstall a library.
|
|
295
|
-
|
|
296
|
-
**Arguments:** `[accessors: string[]]`
|
|
297
|
-
|
|
298
|
-
**Returns:** `{ success: boolean; error?: string }`
|
|
299
|
-
|
|
300
|
-
### `jsAutocomplete.updateConfig`
|
|
301
|
-
|
|
302
|
-
Update autocomplete configuration.
|
|
303
|
-
|
|
304
|
-
**Arguments:** `[config: Partial<AutocompleteConfig>]`
|
|
305
|
-
|
|
306
|
-
**Returns:** `boolean`
|
|
307
|
-
|
|
308
|
-
### `jsAutocomplete.getAvailableDefinitions`
|
|
309
|
-
|
|
310
|
-
Get list of available type definitions.
|
|
311
|
-
|
|
312
|
-
**Arguments:** `[]`
|
|
313
|
-
|
|
314
|
-
**Returns:** `string[]`
|
|
315
|
-
|
|
316
|
-
### `jsAutocomplete.resetContext`
|
|
317
|
-
|
|
318
|
-
Reset the JavaScript execution context.
|
|
319
|
-
|
|
320
|
-
**Arguments:** `[]`
|
|
321
|
-
|
|
322
|
-
**Returns:** `boolean`
|
|
323
|
-
|
|
324
|
-
## Helper Functions
|
|
325
|
-
|
|
326
|
-
The `monacoAutocompleteIntegration.ts` provides helper functions:
|
|
327
|
-
|
|
328
|
-
```typescript
|
|
329
|
-
import {
|
|
330
|
-
setupMonacoAutocomplete,
|
|
331
|
-
setupStepAutocomplete,
|
|
332
|
-
installLibraryForAutocomplete,
|
|
333
|
-
updateAutocompleteConfig,
|
|
334
|
-
getAvailableDefinitions,
|
|
335
|
-
} from '@form-builder/core/inngest/monacoAutocompleteIntegration';
|
|
336
|
-
|
|
337
|
-
// Setup general autocomplete
|
|
338
|
-
await setupMonacoAutocomplete(monaco, options, commandService);
|
|
339
|
-
|
|
340
|
-
// Setup step-specific autocomplete
|
|
341
|
-
await setupStepAutocomplete(monaco, step, code, commandService);
|
|
342
|
-
|
|
343
|
-
// Install a library
|
|
344
|
-
await installLibraryForAutocomplete(commandService, 'https://cdn.jsdelivr.net/npm/@types/lodash/index.d.ts', [
|
|
345
|
-
'_',
|
|
346
|
-
'lodash',
|
|
347
|
-
]);
|
|
348
|
-
|
|
349
|
-
// Update config
|
|
350
|
-
await updateAutocompleteConfig(commandService, {
|
|
351
|
-
includeDefaults: true,
|
|
352
|
-
includeLibraries: true,
|
|
353
|
-
});
|
|
354
|
-
|
|
355
|
-
// Get available definitions
|
|
356
|
-
const defs = await getAvailableDefinitions(commandService);
|
|
357
|
-
```
|
|
358
|
-
|
|
359
|
-
## Testing the Integration
|
|
360
|
-
|
|
361
|
-
1. **Start your application** with the js-autocomplete-extension installed
|
|
362
|
-
2. **Open a step editor** with a code block
|
|
363
|
-
3. **Type `step.`** - You should see intelligent completions with type info
|
|
364
|
-
4. **Hover over `step`** - You should see type information
|
|
365
|
-
5. **Type any JavaScript** - Get ECMAScript completions
|
|
366
|
-
|
|
367
|
-
## Debugging
|
|
368
|
-
|
|
369
|
-
Check if the extension is working:
|
|
370
|
-
|
|
371
|
-
```typescript
|
|
372
|
-
// In your component
|
|
373
|
-
React.useEffect(() => {
|
|
374
|
-
if (services?.commands) {
|
|
375
|
-
// Test if extension commands are available
|
|
376
|
-
services.commands
|
|
377
|
-
.executeCommand({
|
|
378
|
-
command: 'jsAutocomplete.getAvailableDefinitions',
|
|
379
|
-
arguments: [],
|
|
380
|
-
})
|
|
381
|
-
.then((defs) => {
|
|
382
|
-
console.log('Available definitions:', defs);
|
|
383
|
-
})
|
|
384
|
-
.catch((err) => {
|
|
385
|
-
console.error('Extension not available:', err);
|
|
386
|
-
});
|
|
387
|
-
}
|
|
388
|
-
}, [services]);
|
|
389
|
-
```
|
|
390
|
-
|
|
391
|
-
## Benefits
|
|
392
|
-
|
|
393
|
-
✅ **Context-aware completions** based on your step type
|
|
394
|
-
✅ **Type information** on hover
|
|
395
|
-
✅ **Library support** (lodash, moment, custom libs)
|
|
396
|
-
✅ **Dynamic updates** as you edit code
|
|
397
|
-
✅ **Inngest-specific** completions for step functions
|
|
398
|
-
✅ **Works alongside** your existing snippets
|
|
399
|
-
✅ **Uses your existing** command execution pattern
|
|
400
|
-
|
|
401
|
-
## Next Steps
|
|
402
|
-
|
|
403
|
-
- Add more step-specific completions
|
|
404
|
-
- Integrate with your workflow execution context
|
|
405
|
-
- Add custom library definitions for your domain
|
|
406
|
-
- Implement signature help for function parameters
|