Remove twenty-ui reexport from the SDK and use twenty-ui directly (#22326)
## What & why Removes the `twenty-sdk/ui` reexport. Apps now use Twenty UI by installing [`twenty-ui@1.0.0-alpha.1`](https://www.npmjs.com/package/twenty-ui/v/1.0.0-alpha.1) from npm and importing its subpaths directly. The reexport re-exported types that didn't resolve, forcing typecheck workarounds. ## Changes - **twenty-sdk**: delete `src/ui/index.ts`, drop the `./ui` export, remove it from the browser vite build, and rewire the CLI manifest-mock to `twenty-ui` (`.css` falls through to the empty-CSS loader). `twenty-ui` stays a devDependency for the CLI fixture tests. - **Renderer + create-twenty-app template**: import from `twenty-ui` subpaths; the template pins `twenty-ui@1.0.0-alpha.1`. - **Docs**: new "Using Twenty UI components" section (install + subpath imports + `useTheme()` for theme tokens), codex references, and the cross-doc-contract validator. The `twenty-for-twenty` / `twenty-slack` example apps are intentionally left on `twenty-sdk/ui`: they consume the published SDK (which still ships `./ui`), and `twenty-ui@1.0.0-alpha.1` requires react 19 + a `monaco-editor` peer the react-18 apps can't satisfy. They migrate once the SDK is republished.
This commit is contained in:
@@ -82,12 +82,12 @@ const assertFrontComponentGuidance = (fail) => {
|
||||
'defineFrontComponent',
|
||||
'Use `twenty-sdk/front-component`',
|
||||
'Use `twenty-client-sdk/core` or `twenty-client-sdk/metadata`',
|
||||
'Use `twenty-sdk/ui` for Twenty UI components',
|
||||
'Do not import from `twenty-ui` directly',
|
||||
'twenty-ui@1.0.0-alpha.1',
|
||||
'import Twenty UI components, icons, and theme tokens from its subpaths',
|
||||
'ThemeProvider',
|
||||
'example-sources/twenty-ui-example.front-component.tsx',
|
||||
'showcase/twenty-ui-example.front-component.tsx',
|
||||
'themeCssVariables',
|
||||
'mocks `twenty-sdk/ui` during manifest extraction',
|
||||
'mocks `twenty-ui` during manifest extraction',
|
||||
'A clean typecheck and sync is not runtime verification',
|
||||
'without a `FrontComponent error`',
|
||||
'hard refresh',
|
||||
|
||||
Reference in New Issue
Block a user