diff --git a/chartlets.js/CHANGES.md b/chartlets.js/CHANGES.md index 223f8d27..c3c041e2 100644 --- a/chartlets.js/CHANGES.md +++ b/chartlets.js/CHANGES.md @@ -4,6 +4,11 @@ Using monorepo layout for `chartlets.js` with workspaces `lib` and `demo` that host the packages for `chartlets` and `chartlets-demo`. +* Other code reorganisations: + - moved `component/Registry` into `store` + - renamed module `component` into `components` + - no longer exposing `Registry` type + * Chartlets now allows for plugins that can provide individual component implementations. The Vega-based chart and MUI components are now optional and have been diff --git a/chartlets.js/packages/lib/src/actions/configureFramework.ts b/chartlets.js/packages/lib/src/actions/configureFramework.ts index 364f3380..1e34987b 100644 --- a/chartlets.js/packages/lib/src/actions/configureFramework.ts +++ b/chartlets.js/packages/lib/src/actions/configureFramework.ts @@ -4,7 +4,7 @@ import type { FrameworkOptions, PluginLike, } from "@/types/state/options"; -import { registry } from "@/component/Registry"; +import { registry } from "@/components/registry"; import { isPromise } from "@/utils/isPromise"; import { isFunction } from "@/utils/isFunction"; import { isObject } from "@/utils/isObject"; diff --git a/chartlets.js/packages/lib/src/component/Children.test.tsx b/chartlets.js/packages/lib/src/components/Children.test.tsx similarity index 97% rename from chartlets.js/packages/lib/src/component/Children.test.tsx rename to chartlets.js/packages/lib/src/components/Children.test.tsx index a97299ba..d494cc14 100644 --- a/chartlets.js/packages/lib/src/component/Children.test.tsx +++ b/chartlets.js/packages/lib/src/components/Children.test.tsx @@ -1,7 +1,7 @@ import type { FC } from "react"; import { describe, it, expect, beforeEach, afterEach } from "vitest"; import { render, screen } from "@testing-library/react"; -import { registry } from "@/component/Registry"; +import { registry } from "@/components/registry"; import { type ComponentProps } from "./Component"; import { Children } from "./Children"; diff --git a/chartlets.js/packages/lib/src/component/Children.tsx b/chartlets.js/packages/lib/src/components/Children.tsx similarity index 100% rename from chartlets.js/packages/lib/src/component/Children.tsx rename to chartlets.js/packages/lib/src/components/Children.tsx diff --git a/chartlets.js/packages/lib/src/component/Component.test.tsx b/chartlets.js/packages/lib/src/components/Component.test.tsx similarity index 96% rename from chartlets.js/packages/lib/src/component/Component.test.tsx rename to chartlets.js/packages/lib/src/components/Component.test.tsx index 84157fe5..cbb1d9df 100644 --- a/chartlets.js/packages/lib/src/component/Component.test.tsx +++ b/chartlets.js/packages/lib/src/components/Component.test.tsx @@ -1,7 +1,7 @@ import { describe, it, expect, beforeEach, afterEach } from "vitest"; import { render, screen } from "@testing-library/react"; import { Component, type ComponentProps } from "./Component"; -import { registry } from "@/component/Registry"; +import { registry } from "@/components/registry"; import type { FC } from "react"; describe("Component", () => { diff --git a/chartlets.js/packages/lib/src/component/Component.tsx b/chartlets.js/packages/lib/src/components/Component.tsx similarity index 91% rename from chartlets.js/packages/lib/src/component/Component.tsx rename to chartlets.js/packages/lib/src/components/Component.tsx index 45874bb1..203878e6 100644 --- a/chartlets.js/packages/lib/src/component/Component.tsx +++ b/chartlets.js/packages/lib/src/components/Component.tsx @@ -1,5 +1,5 @@ import { type ComponentChangeHandler } from "@/types/state/event"; -import { registry } from "@/component/Registry"; +import { registry } from "@/components/registry"; export interface ComponentProps { type: string; diff --git a/chartlets.js/packages/lib/src/component/Registry.test.ts b/chartlets.js/packages/lib/src/components/registry.test.ts similarity index 97% rename from chartlets.js/packages/lib/src/component/Registry.test.ts rename to chartlets.js/packages/lib/src/components/registry.test.ts index bf129bec..cc333c0a 100644 --- a/chartlets.js/packages/lib/src/component/Registry.test.ts +++ b/chartlets.js/packages/lib/src/components/registry.test.ts @@ -1,6 +1,6 @@ import { describe, it, expect } from "vitest"; -import { RegistryImpl } from "@/component/Registry"; +import { RegistryImpl } from "@/components/registry"; describe("Test that RegistryImpl", () => { it("works", () => { diff --git a/chartlets.js/packages/lib/src/component/Registry.ts b/chartlets.js/packages/lib/src/components/registry.ts similarity index 97% rename from chartlets.js/packages/lib/src/component/Registry.ts rename to chartlets.js/packages/lib/src/components/registry.ts index 9df55a19..9cfc4b95 100644 --- a/chartlets.js/packages/lib/src/component/Registry.ts +++ b/chartlets.js/packages/lib/src/components/registry.ts @@ -1,6 +1,6 @@ import type { ComponentType } from "react"; -import type { ComponentProps } from "@/component/Component"; +import type { ComponentProps } from "@/components/Component"; /** * A registry for Chartlets components. diff --git a/chartlets.js/packages/lib/src/index.ts b/chartlets.js/packages/lib/src/index.ts index d8ed9d02..c718e26d 100644 --- a/chartlets.js/packages/lib/src/index.ts +++ b/chartlets.js/packages/lib/src/index.ts @@ -13,12 +13,9 @@ export { initializeContributions } from "@/actions/initializeContributions"; export { handleComponentChange } from "@/actions/handleComponentChange"; export { updateContributionContainer } from "@/actions/updateContributionContainer"; -// Component registry -export type { Registry } from "@/component/Registry"; - // React components -export { Component, type ComponentProps } from "@/component/Component"; -export { Children } from "@/component/Children"; +export { Component, type ComponentProps } from "@/components/Component"; +export { Children, type ChildrenProps } from "@/components/Children"; // React hooks export { diff --git a/chartlets.js/packages/lib/src/types/state/options.ts b/chartlets.js/packages/lib/src/types/state/options.ts index d40ef764..984cd047 100644 --- a/chartlets.js/packages/lib/src/types/state/options.ts +++ b/chartlets.js/packages/lib/src/types/state/options.ts @@ -2,7 +2,7 @@ import type { ComponentType } from "react"; import type { ApiOptions } from "@/types/api"; import type { LoggingOptions } from "@/actions/helpers/configureLogging"; -import type { ComponentProps } from "@/component/Component"; +import type { ComponentProps } from "@/components/Component"; import { isObject } from "@/utils/isObject"; import { isFunction } from "@/utils/isFunction";