Skip to content

Commit 7e9f39e

Browse files
authored
Removing WIT stubs, Dynamic Linking, Rib, and transformer plugins (#2798)
* Removing stubgen, wip * Removing all WIT related code from the CLI * Removed dependencies from manifest * Using cargo with wasip2 target directly in the rust templates * Migrated rust test components to wasip2 target * Schema validation error display fix and updated templates and test components * More rebuilt components * Removed component transformer, app and library plugin types * Removed forked wasm_metadata * Fix * Removed dynamic linking * Removed rib * Removed the golem-ai bindings from the TS SDK and rebuilt all test components * No verbose flag for cargo in rust bridge tests * Test fix * Test fix and reducred test log verbosity * Desktop app fix * Missing file * Dependency cleanup * Regenerated config * More assert lib migration and fixes * Template fixes * Template fixes * Format * Test fix * Template fixes and temporarily ignoring some * Fix template test * Clippy * Fix
1 parent 27ca4f5 commit 7e9f39e

File tree

1,255 files changed

+1383
-159876
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,255 files changed

+1383
-159876
lines changed

Cargo.lock

Lines changed: 155 additions & 2379 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ members = [
99
"golem-service-base",
1010
"golem-component-compilation-service",
1111
"golem-registry-service",
12-
"golem-rib",
13-
"golem-rib-repl",
1412
"golem-test-framework",
1513
"golem-shard-manager",
1614
"golem-worker-executor",
@@ -43,8 +41,6 @@ golem-common = { version = "=0.0.0", path = "golem-common", default-features = f
4341
golem-component-compilation-service = { path = "golem-component-compilation-service" }
4442
golem-openapi-client-generator = { version = "=0.0.17" }
4543
golem-registry-service = { path = "golem-registry-service" }
46-
golem-rib = { version = "=0.0.0", path = "golem-rib" }
47-
golem-rib-repl = { version = "=0.0.0", path = "golem-rib-repl" }
4844
golem-service-base = { version = "=0.0.0", path = "golem-service-base" }
4945
golem-shard-manager = { path = "golem-shard-manager" }
5046
golem-templates = { version = "=0.0.0", path = "cli/golem-templates" }
@@ -102,7 +98,7 @@ criterion = "0.5"
10298
crossterm = "0.28.1"
10399
darling = "0.20.11"
104100
derive_more = { version = "2.0.1", features = ["display", "into", "from_str"] }
105-
desert_rust = { version = "0.1.6", features = ["bigdecimal", "uuid", "chrono", "nonempty-collections", "serde-json", "bit-vec", "url", "mac_address"] }
101+
desert_rust = { version = "0.1.7", features = ["bigdecimal", "uuid", "chrono", "nonempty-collections", "serde-json", "bit-vec", "url", "mac_address"] }
106102
dir-diff = "0.3.3"
107103
dirs = "4.0.0"
108104
drop-stream = "0.3.2"

cli/desktop-app/src/pages/plugin/create.tsx

Lines changed: 53 additions & 230 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,6 @@ import {
1414
FormLabel,
1515
FormMessage,
1616
} from "@/components/ui/form";
17-
import {
18-
Select,
19-
SelectContent,
20-
SelectItem,
21-
SelectTrigger,
22-
SelectValue,
23-
} from "@/components/ui/select";
2417

2518
import { useEffect, useState } from "react";
2619

@@ -62,30 +55,13 @@ const formSchema = z.object({
6255
}),
6356
specs: z
6457
.object({
65-
type: z.enum([
66-
"ComponentTransformer",
67-
"OplogProcessor",
68-
"App",
69-
"Library",
70-
]),
71-
// ComponentTransformer specific fields
72-
validateUrl: z.string().url().optional(),
73-
transformUrl: z.string().url().optional(),
74-
providedWitPackage: z.string().optional(),
75-
jsonSchema: z.string().optional(),
76-
// OplogProcessor, App, Library specific field
58+
type: z.enum(["OplogProcessor"]),
59+
// OplogProcessor specific field
7760
component: z.string().optional(),
7861
})
7962
.refine(
8063
data => {
81-
if (data.type === "ComponentTransformer") {
82-
return data.validateUrl && data.transformUrl;
83-
}
84-
if (
85-
data.type === "OplogProcessor" ||
86-
data.type === "App" ||
87-
data.type === "Library"
88-
) {
64+
if (data.type === "OplogProcessor") {
8965
return data.component;
9066
}
9167
return true;
@@ -104,9 +80,6 @@ export default function CreatePlugin() {
10480
const [_componentApiList, setComponentApiList] = useState<{
10581
[key: string]: ComponentList;
10682
}>({});
107-
const [activeSpecTab, setActiveSpecTab] = useState<
108-
"ComponentTransformer" | "OplogProcessor" | "App" | "Library"
109-
>("ComponentTransformer");
11083
const form = useForm<z.infer<typeof formSchema>>({
11184
resolver: zodResolver(formSchema),
11285
defaultValues: {
@@ -116,7 +89,7 @@ export default function CreatePlugin() {
11689
homepage: "",
11790
icon: "",
11891
specs: {
119-
type: "ComponentTransformer",
92+
type: "OplogProcessor",
12093
component: "",
12194
},
12295
},
@@ -128,10 +101,6 @@ export default function CreatePlugin() {
128101
});
129102
}, []);
130103

131-
useEffect(() => {
132-
form.setValue("specs.type", activeSpecTab);
133-
}, [activeSpecTab, form]);
134-
135104
return (
136105
<div className="container mx-auto py-10">
137106
<Card className="max-w-4xl mx-auto">
@@ -338,217 +307,71 @@ export default function CreatePlugin() {
338307
/>
339308
</div>
340309

341-
{/* Plugin Type Selection */}
310+
{/* Plugin Type */}
342311
<div className="space-y-4">
343312
<h3 className="text-lg font-semibold">Plugin Type</h3>
313+
<p className="text-sm text-muted-foreground">Oplog Processor</p>
314+
</div>
315+
316+
<div className="space-y-4">
317+
<h3 className="text-lg font-semibold">
318+
Oplog Processor Configuration
319+
</h3>
344320
<FormField
345321
control={form.control}
346-
name="specs.type"
322+
name="specs.component"
347323
render={({ field }) => (
348324
<FormItem>
349325
<FormLabel>
350-
Type<span className="text-red-500">*</span>
326+
Component Path<span className="text-red-500">*</span>
351327
</FormLabel>
352-
<Select
353-
value={field.value}
354-
onValueChange={value => {
355-
field.onChange(value);
356-
setActiveSpecTab(value as typeof activeSpecTab);
357-
}}
358-
>
359-
<FormControl>
360-
<SelectTrigger>
361-
<SelectValue placeholder="Select plugin type" />
362-
</SelectTrigger>
363-
</FormControl>
364-
<SelectContent>
365-
<SelectItem value="ComponentTransformer">
366-
Component Transformer
367-
</SelectItem>
368-
<SelectItem value="OplogProcessor">
369-
Oplog Processor
370-
</SelectItem>
371-
<SelectItem value="App">App</SelectItem>
372-
<SelectItem value="Library">Library</SelectItem>
373-
</SelectContent>
374-
</Select>
328+
<FormControl>
329+
<div className="flex gap-2">
330+
<Input
331+
placeholder="path/to/oplog-processor.wasm"
332+
{...field}
333+
readOnly
334+
className={cn(
335+
form.formState.errors.specs?.component &&
336+
"border-red-500 focus-visible:ring-red-500",
337+
)}
338+
/>
339+
<Button
340+
type="button"
341+
variant="outline"
342+
size="icon"
343+
onClick={async () => {
344+
try {
345+
const selected = await open({
346+
multiple: false,
347+
filters: [
348+
{
349+
name: "WASM Component",
350+
extensions: ["wasm"],
351+
},
352+
],
353+
});
354+
if (selected) {
355+
field.onChange(selected);
356+
}
357+
} catch (error) {
358+
console.error("Error selecting file:", error);
359+
}
360+
}}
361+
>
362+
<FileIcon className="h-4 w-4" />
363+
</Button>
364+
</div>
365+
</FormControl>
375366
<FormDescription>
376-
Choose the type of plugin you want to create.
367+
Select the WASM component file
377368
</FormDescription>
378369
<FormMessage />
379370
</FormItem>
380371
)}
381372
/>
382373
</div>
383374

384-
{/* Type-specific fields */}
385-
{form.watch("specs.type") === "ComponentTransformer" && (
386-
<div className="space-y-4">
387-
<h3 className="text-lg font-semibold">
388-
Component Transformer Configuration
389-
</h3>
390-
<div className="grid gap-4 sm:grid-cols-2">
391-
<FormField
392-
control={form.control}
393-
name="specs.validateUrl"
394-
render={({ field }) => (
395-
<FormItem>
396-
<FormLabel>
397-
Validate URL<span className="text-red-500">*</span>
398-
</FormLabel>
399-
<FormControl>
400-
<Input
401-
placeholder="https://api.example.com/validate"
402-
{...field}
403-
className={cn(
404-
form.formState.errors.specs?.validateUrl &&
405-
"border-red-500 focus-visible:ring-red-500",
406-
)}
407-
/>
408-
</FormControl>
409-
<FormMessage />
410-
</FormItem>
411-
)}
412-
/>
413-
<FormField
414-
control={form.control}
415-
name="specs.transformUrl"
416-
render={({ field }) => (
417-
<FormItem>
418-
<FormLabel>
419-
Transform URL<span className="text-red-500">*</span>
420-
</FormLabel>
421-
<FormControl>
422-
<Input
423-
placeholder="https://api.example.com/transform"
424-
{...field}
425-
className={cn(
426-
form.formState.errors.specs?.transformUrl &&
427-
"border-red-500 focus-visible:ring-red-500",
428-
)}
429-
/>
430-
</FormControl>
431-
<FormMessage />
432-
</FormItem>
433-
)}
434-
/>
435-
</div>
436-
<div className="grid gap-4 sm:grid-cols-2">
437-
<FormField
438-
control={form.control}
439-
name="specs.providedWitPackage"
440-
render={({ field }) => (
441-
<FormItem>
442-
<FormLabel>WIT Package Path</FormLabel>
443-
<FormControl>
444-
<Input
445-
placeholder="path/to/wit/file.wit"
446-
{...field}
447-
/>
448-
</FormControl>
449-
<FormDescription>
450-
Optional WIT file path
451-
</FormDescription>
452-
<FormMessage />
453-
</FormItem>
454-
)}
455-
/>
456-
<FormField
457-
control={form.control}
458-
name="specs.jsonSchema"
459-
render={({ field }) => (
460-
<FormItem>
461-
<FormLabel>JSON Schema Path</FormLabel>
462-
<FormControl>
463-
<Input
464-
placeholder="path/to/schema.json"
465-
{...field}
466-
/>
467-
</FormControl>
468-
<FormDescription>
469-
Optional JSON schema file path
470-
</FormDescription>
471-
<FormMessage />
472-
</FormItem>
473-
)}
474-
/>
475-
</div>
476-
</div>
477-
)}
478-
479-
{(form.watch("specs.type") === "OplogProcessor" ||
480-
form.watch("specs.type") === "App" ||
481-
form.watch("specs.type") === "Library") && (
482-
<div className="space-y-4">
483-
<h3 className="text-lg font-semibold">
484-
{form.watch("specs.type") === "OplogProcessor" &&
485-
"Oplog Processor Configuration"}
486-
{form.watch("specs.type") === "App" && "App Configuration"}
487-
{form.watch("specs.type") === "Library" &&
488-
"Library Configuration"}
489-
</h3>
490-
<FormField
491-
control={form.control}
492-
name="specs.component"
493-
render={({ field }) => (
494-
<FormItem>
495-
<FormLabel>
496-
Component Path<span className="text-red-500">*</span>
497-
</FormLabel>
498-
<FormControl>
499-
<div className="flex gap-2">
500-
<Input
501-
placeholder={
502-
form.watch("specs.type") === "OplogProcessor"
503-
? "path/to/oplog-processor.wasm"
504-
: form.watch("specs.type") === "App"
505-
? "path/to/app.wasm"
506-
: "path/to/library.wasm"
507-
}
508-
{...field}
509-
readOnly
510-
className={cn(
511-
form.formState.errors.specs?.component &&
512-
"border-red-500 focus-visible:ring-red-500",
513-
)}
514-
/>
515-
<Button
516-
type="button"
517-
variant="outline"
518-
size="icon"
519-
onClick={async () => {
520-
try {
521-
const selected = await open({
522-
multiple: false,
523-
filters: [
524-
{
525-
name: "WASM Component",
526-
extensions: ["wasm"],
527-
},
528-
],
529-
});
530-
if (selected) {
531-
field.onChange(selected);
532-
}
533-
} catch (error) {
534-
console.error("Error selecting file:", error);
535-
}
536-
}}
537-
>
538-
<FileIcon className="h-4 w-4" />
539-
</Button>
540-
</div>
541-
</FormControl>
542-
<FormDescription>
543-
Select the WASM component file
544-
</FormDescription>
545-
<FormMessage />
546-
</FormItem>
547-
)}
548-
/>
549-
</div>
550-
)}
551-
552375
<div className="flex justify-between pt-6">
553376
<Button
554377
type="button"

0 commit comments

Comments
 (0)