chore: Add ui folder to Cargo default-members. (#1600)
This to help `cargo test` default will test `ui` and `story`.
This commit is contained in:
parent
29fbdd371b
commit
724ccd64a7
12 changed files with 61 additions and 58 deletions
56
Cargo.lock
generated
56
Cargo.lock
generated
|
|
@ -2902,6 +2902,34 @@ dependencies = [
|
|||
"syn 2.0.105",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpui-component-story"
|
||||
version = "0.4.0-preview2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"autocorrect",
|
||||
"chrono",
|
||||
"color-lsp",
|
||||
"fake",
|
||||
"gpui",
|
||||
"gpui-component",
|
||||
"gtk",
|
||||
"itertools 0.14.0",
|
||||
"lsp-types 0.97.0",
|
||||
"rand 0.8.5",
|
||||
"raw-window-handle",
|
||||
"regex",
|
||||
"reqwest_client",
|
||||
"rust-embed",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"smol",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"tree-sitter-navi",
|
||||
"unindent",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpui-macros"
|
||||
version = "0.2.2"
|
||||
|
|
@ -6891,34 +6919,6 @@ version = "1.1.0"
|
|||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f"
|
||||
|
||||
[[package]]
|
||||
name = "story"
|
||||
version = "0.4.0-preview2"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"autocorrect",
|
||||
"chrono",
|
||||
"color-lsp",
|
||||
"fake",
|
||||
"gpui",
|
||||
"gpui-component",
|
||||
"gtk",
|
||||
"itertools 0.14.0",
|
||||
"lsp-types 0.97.0",
|
||||
"rand 0.8.5",
|
||||
"raw-window-handle",
|
||||
"regex",
|
||||
"reqwest_client",
|
||||
"rust-embed",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"smol",
|
||||
"tracing",
|
||||
"tracing-subscriber",
|
||||
"tree-sitter-navi",
|
||||
"unindent",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "str_indices"
|
||||
version = "0.4.4"
|
||||
|
|
|
|||
|
|
@ -1,5 +1,8 @@
|
|||
[workspace]
|
||||
default-members = ["crates/story"]
|
||||
default-members = [
|
||||
"crates/ui",
|
||||
"crates/story"
|
||||
]
|
||||
members = [
|
||||
"crates/macros",
|
||||
"crates/story",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
edition = "2024"
|
||||
name = "story"
|
||||
name = "gpui-component-story"
|
||||
publish = false
|
||||
version = "0.4.0-preview2"
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ use gpui_component::{
|
|||
slider::{Slider, SliderState},
|
||||
v_flex,
|
||||
};
|
||||
use story::Assets;
|
||||
use gpui_component_story::Assets;
|
||||
|
||||
pub struct BrushStory {
|
||||
focus_handle: gpui::FocusHandle,
|
||||
|
|
@ -458,9 +458,9 @@ fn main() {
|
|||
let app = Application::new().with_assets(Assets);
|
||||
|
||||
app.run(move |cx| {
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
cx.activate(true);
|
||||
|
||||
story::create_new_window("Brush Example", Example::view, cx);
|
||||
gpui_component_story::create_new_window("Brush Example", Example::view, cx);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,14 +7,14 @@ use gpui_component::{
|
|||
menu::DropdownMenu,
|
||||
};
|
||||
|
||||
use serde::Deserialize;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use story::{
|
||||
use gpui_component_story::{
|
||||
AccordionStory, AppState, AppTitleBar, Assets, ButtonStory, CalendarStory, DialogStory,
|
||||
FormStory, IconStory, ImageStory, InputStory, LabelStory, ListStory, NotificationStory, Open,
|
||||
PopoverStory, ProgressStory, ResizableStory, ScrollableStory, SelectStory, SidebarStory,
|
||||
StoryContainer, SwitchStory, TableStory, TooltipStory, WebViewStory,
|
||||
};
|
||||
use serde::Deserialize;
|
||||
use std::{sync::Arc, time::Duration};
|
||||
|
||||
#[derive(Action, Clone, PartialEq, Eq, Deserialize)]
|
||||
#[action(namespace = story, no_json)]
|
||||
|
|
@ -38,7 +38,7 @@ const STATE_FILE: &str = "docks.json";
|
|||
|
||||
pub fn init(cx: &mut App) {
|
||||
cx.on_action(|_action: &Open, _cx: &mut App| {});
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
|
||||
cx.bind_keys(vec![
|
||||
KeyBinding::new("shift-escape", ToggleZoom, None),
|
||||
|
|
|
|||
|
|
@ -23,11 +23,11 @@ use gpui_component::{
|
|||
tree::{TreeItem, TreeState, tree},
|
||||
v_flex,
|
||||
};
|
||||
use gpui_component_story::{Assets, Open};
|
||||
use lsp_types::{
|
||||
CodeAction, CodeActionKind, CompletionContext, CompletionItem, CompletionResponse,
|
||||
CompletionTextEdit, InsertReplaceEdit, TextEdit, WorkspaceEdit,
|
||||
};
|
||||
use story::{Assets, Open};
|
||||
|
||||
fn init() {
|
||||
LanguageRegistry::singleton().register(
|
||||
|
|
@ -1035,11 +1035,11 @@ fn main() {
|
|||
let app = Application::new().with_assets(Assets);
|
||||
|
||||
app.run(move |cx| {
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
init();
|
||||
cx.activate(true);
|
||||
|
||||
story::create_new_window_with_size(
|
||||
gpui_component_story::create_new_window_with_size(
|
||||
"Editor",
|
||||
Some(size(px(1200.), px(750.))),
|
||||
|window, cx| cx.new(|cx| Example::new(window, cx)),
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use gpui_component::{
|
|||
resizable::h_resizable,
|
||||
text::TextView,
|
||||
};
|
||||
use story::Assets;
|
||||
use gpui_component_story::Assets;
|
||||
|
||||
pub struct Example {
|
||||
input_state: Entity<InputState>,
|
||||
|
|
@ -81,9 +81,9 @@ fn main() {
|
|||
let app = Application::new().with_assets(Assets);
|
||||
|
||||
app.run(move |cx| {
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
cx.activate(true);
|
||||
|
||||
story::create_new_window("HTML Render (native)", Example::view, cx);
|
||||
gpui_component_story::create_new_window("HTML Render (native)", Example::view, cx);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use gpui_component::{
|
|||
input::{self, Input, InputEvent, InputState, TabSize},
|
||||
v_flex,
|
||||
};
|
||||
use story::Assets;
|
||||
use gpui_component_story::Assets;
|
||||
|
||||
pub struct Example {
|
||||
editor: Entity<InputState>,
|
||||
|
|
@ -157,9 +157,9 @@ fn main() {
|
|||
let app = Application::new().with_assets(Assets);
|
||||
|
||||
app.run(move |cx| {
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
cx.activate(true);
|
||||
|
||||
story::create_new_window("Large Text Editor", Example::view, cx);
|
||||
gpui_component_story::create_new_window("Large Text Editor", Example::view, cx);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ use gpui_component::{
|
|||
resizable::{h_resizable, resizable_panel},
|
||||
text::TextView,
|
||||
};
|
||||
use story::{Assets, Open};
|
||||
use gpui_component_story::{Assets, Open};
|
||||
|
||||
pub struct Example {
|
||||
input_state: Entity<InputState>,
|
||||
|
|
@ -115,9 +115,9 @@ fn main() {
|
|||
let app = Application::new().with_assets(Assets);
|
||||
|
||||
app.run(move |cx| {
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
cx.activate(true);
|
||||
|
||||
story::create_new_window("Markdown Editor", Example::view, cx);
|
||||
gpui_component_story::create_new_window("Markdown Editor", Example::view, cx);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ use gpui_component::{
|
|||
input::{Input, InputState},
|
||||
scroll::ScrollbarShow,
|
||||
};
|
||||
use gpui_component_story::{Assets, ButtonStory, IconStory, StoryContainer};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::{sync::Arc, time::Duration};
|
||||
use story::{Assets, ButtonStory, IconStory, StoryContainer};
|
||||
|
||||
actions!(tiles_story, [Quit]);
|
||||
|
||||
|
|
@ -139,7 +139,7 @@ pub fn init(cx: &mut App) {
|
|||
cx.on_action(|_action: &Open, _cx: &mut App| {});
|
||||
|
||||
gpui_component::init(cx);
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
}
|
||||
|
||||
pub struct StoryTiles {
|
||||
|
|
@ -435,7 +435,7 @@ fn main() {
|
|||
|
||||
app.run(move |cx| {
|
||||
gpui_component::init(cx);
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
ContainerPanel::init(cx);
|
||||
|
||||
cx.on_action(quit);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
use gpui::*;
|
||||
use story::{Assets, WebViewStory};
|
||||
use gpui_component_story::{Assets, WebViewStory};
|
||||
|
||||
pub struct Example {
|
||||
root: Entity<WebViewStory>,
|
||||
|
|
@ -31,9 +31,9 @@ fn main() {
|
|||
let app = Application::new().with_assets(Assets);
|
||||
|
||||
app.run(move |cx| {
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
cx.activate(true);
|
||||
|
||||
story::create_new_window("WebView Example", Example::view, cx);
|
||||
gpui_component_story::create_new_window("WebView Example", Example::view, cx);
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use gpui_component::{
|
|||
sidebar::{Sidebar, SidebarGroup, SidebarHeader, SidebarMenu, SidebarMenuItem},
|
||||
v_flex,
|
||||
};
|
||||
use story::*;
|
||||
use gpui_component_story::*;
|
||||
|
||||
pub struct Gallery {
|
||||
stories: Vec<(&'static str, Vec<Entity<StoryContainer>>)>,
|
||||
|
|
@ -297,10 +297,10 @@ fn main() {
|
|||
let name = std::env::args().nth(1);
|
||||
|
||||
app.run(move |cx| {
|
||||
story::init(cx);
|
||||
gpui_component_story::init(cx);
|
||||
cx.activate(true);
|
||||
|
||||
story::create_new_window(
|
||||
gpui_component_story::create_new_window(
|
||||
"GPUI Component",
|
||||
move |window, cx| Gallery::view(name.as_deref(), window, cx),
|
||||
cx,
|
||||
|
|
|
|||
Loading…
Reference in a new issue