Skip to content

Commit

Permalink
refactor: move prop meta schema to sdk (#4718)
Browse files Browse the repository at this point in the history
PropMeta schema is not specific to react so moved it to agnostic sdk.
  • Loading branch information
TrySound authored Jan 5, 2025
1 parent f495363 commit 3de8c87
Show file tree
Hide file tree
Showing 64 changed files with 61 additions and 3,267 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { useState } from "react";
import type { Instance, Prop, Asset, Page } from "@webstudio-is/sdk";
import type { PropMeta } from "@webstudio-is/react-sdk";
import type { PropMeta, Instance, Prop, Asset, Page } from "@webstudio-is/sdk";
import { textVariants } from "@webstudio-is/design-system";
import { PropsSection } from "./props-section";
import { usePropsLogic } from "./use-props-logic";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { nanoid } from "nanoid";
import type { Instance, Prop } from "@webstudio-is/sdk";
import type { PropMeta, Instance, Prop } from "@webstudio-is/sdk";
import {
type PropMeta,
showAttribute,
textContentAttribute,
collectionComponent,
Expand Down
3 changes: 1 addition & 2 deletions apps/builder/app/builder/features/settings-panel/shared.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import {
type ComponentProps,
} from "react";
import equal from "fast-deep-equal";
import type { PropMeta } from "@webstudio-is/react-sdk";
import {
decodeDataSourceVariable,
encodeDataSourceVariable,
} from "@webstudio-is/sdk";
import type { Prop, Asset } from "@webstudio-is/sdk";
import type { PropMeta, Prop, Asset } from "@webstudio-is/sdk";
import { InfoCircleIcon, MinusIcon } from "@webstudio-is/icons";
import {
SmallIconButton,
Expand Down
2 changes: 1 addition & 1 deletion packages/generate-arg-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
},
"dependencies": {
"@webstudio-is/html-data": "workspace:*",
"@webstudio-is/react-sdk": "workspace:*",
"@webstudio-is/sdk": "workspace:*",
"fast-glob": "^3.3.2",
"react-docgen-typescript": "^2.2.2",
"typescript": "5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/generate-arg-types/src/arg-types.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PropItem } from "react-docgen-typescript";
import { PropMeta } from "@webstudio-is/react-sdk";
import { PropMeta } from "@webstudio-is/sdk";

export type FilterPredicate = (prop: PropItem) => boolean;

Expand Down
2 changes: 1 addition & 1 deletion packages/generate-arg-types/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ type CustomDescriptionsType = {
continue;
}

let fileContent = `import type { PropMeta } from "@webstudio-is/react-sdk";\n`;
let fileContent = `import type { PropMeta } from "@webstudio-is/sdk";\n`;

if (componentDocs.length === 1) {
const argTypes = propsToArgTypes(
Expand Down
3 changes: 1 addition & 2 deletions packages/react-sdk/src/components/component-meta.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { z } from "zod";
import type { HtmlTags } from "html-tags";
import { Matchers } from "@webstudio-is/sdk";
import { PropMeta } from "../prop-meta";
import { Matchers, PropMeta } from "@webstudio-is/sdk";
import { EmbedTemplateStyleDecl, WsEmbedTemplate } from "../embed-template";

export type PresetStyle<Tag extends HtmlTags = HtmlTags> = Partial<
Expand Down
1 change: 0 additions & 1 deletion packages/react-sdk/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ export * from "./remix";
export * from "./css/index";
export * from "./core-components";
export * from "./components/components-utils";
export { PropMeta } from "./prop-meta";
export {
type WsComponentPropsMeta,
type ComponentState,
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 3de8c87

Please sign in to comment.