mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
The daemon imports the plugin SDK at runtime, but the workspace was named @paseo/plugin and marked private, so it was never published. 0.5.0-beta.1 shipped @getpaseo/server depending on a package that does not exist and `npm install @getpaseo/cli@beta` failed with a 404 for every user. Two things hid it. sync-workspace-versions only rewrites deps matching @getpaseo/*, so the "*" range on @paseo/plugin survived untouched into the published tarball. And `npm pack --dry-run`, which is all release:check and CI run, lists files without ever resolving the dependency graph. Renaming to @getpaseo/plugin rather than publishing the old name: @paseo is not our scope on npm, so that name could never have been published at all. The rename also brings the package under the version-sync filter, which is what pins it correctly from here on. Plugins scaffolded against the old name still import @paseo/plugin. Both spellings resolve through plugin-sdk-specifiers.ts, tagged COMPAT with a removal date, so existing plugins keep loading. This does not repair 0.5.0-beta.1 — a published tarball's dependencies cannot be changed. The package publishes with the next release.
51 lines
2.0 KiB
TypeScript
51 lines
2.0 KiB
TypeScript
import { useMutation } from "@tanstack/react-query";
|
|
import { type PluginWorkspacePanelProps, useRpc, useWorkspace } from "@getpaseo/plugin";
|
|
import React, { useCallback, useMemo } from "react";
|
|
import { Pressable, Text, View } from "react-native";
|
|
import { incrementRpc } from "./increment.shared";
|
|
|
|
export function ExamplePanel({ theme, layout, workspaceId }: PluginWorkspacePanelProps) {
|
|
const workspace = useWorkspace(workspaceId, ({ name }) => ({ name }));
|
|
const callIncrement = useRpc(incrementRpc);
|
|
const { data, error, isPending, mutate } = useMutation({ mutationFn: callIncrement });
|
|
const value = data?.value ?? 0;
|
|
const styles = useMemo(
|
|
() => ({
|
|
screen: {
|
|
flex: 1,
|
|
padding: layout.compact ? 16 : 24,
|
|
gap: 16,
|
|
backgroundColor: theme.colors.surface0,
|
|
},
|
|
title: { color: theme.colors.foreground, fontSize: layout.compact ? 20 : 24 },
|
|
detail: { color: theme.colors.foregroundMuted },
|
|
button: { padding: 14, borderRadius: 10, backgroundColor: theme.colors.accent },
|
|
buttonText: { color: theme.colors.accentForeground, textAlign: "center" as const },
|
|
error: { color: theme.colors.statusDanger },
|
|
}),
|
|
[theme, layout.compact],
|
|
);
|
|
const handleIncrement = useCallback(() => {
|
|
mutate({ value });
|
|
}, [mutate, value]);
|
|
|
|
return (
|
|
<View style={styles.screen}>
|
|
<Text style={styles.title}>Workspace plugin panel</Text>
|
|
<Text style={styles.detail}>{workspace?.name}</Text>
|
|
<Text style={styles.detail}>{data?.handledBy ?? "The RPC has not run yet."}</Text>
|
|
<Pressable
|
|
accessibilityRole="button"
|
|
accessibilityLabel={`Increment plugin counter, currently ${value}`}
|
|
onPress={handleIncrement}
|
|
style={styles.button}
|
|
>
|
|
<Text style={styles.buttonText}>
|
|
{isPending ? "Calling daemon…" : `RPC counter: ${value}`}
|
|
</Text>
|
|
</Pressable>
|
|
{error ? <Text style={styles.error}>{error.message}</Text> : null}
|
|
</View>
|
|
);
|
|
}
|