Package Tansy UI as @openkhalix/tansy-ui in a monorepo (v0.4.0)
Restructure the repo into npm workspaces so the component kit publishes as its own package, like MUI and shadcn/ui: - packages/ui: @openkhalix/tansy-ui (published), with components, stories, tests, tokens and the library build - packages/brand: private logo and catalogue data shared by both apps - apps/site: the landing page - apps/docs: Storybook The package: - MIT licence (copyright OpenKhalix) - per-component ES modules and type declarations - "use client" on component modules so they import into Next.js Server Components; helpers stay server-safe - tokens.css for Tailwind v4 apps, and a prebuilt styles.css for apps without Tailwind - lucide-react 1.x, whose types compile against current React 19 types The apps resolve the package through a "source" export condition, so they hot-reload component edits, while outside users get dist/. scripts/test-package.mjs packs the package and installs the tarball into Vite + Tailwind (strict types), plain React and Next.js apps; each must build and render correctly. Gitea workflows run CI on push and publish to npm when a vX.Y.Z tag matching the package version is pushed.
This commit is contained in:
1 parent
23e67006d3
commit
9255b255a6
214 files changed
+1521
-389
No files matched your search
+10
-5
@@ -4,25 +4,30 @@ FROM node:26-alpine AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Workspace manifests first, so dependency installs cache between builds.
|
||||
COPY package.json package-lock.json ./
|
||||
COPY packages/ui/package.json packages/ui/
|
||||
COPY packages/brand/package.json packages/brand/
|
||||
COPY apps/site/package.json apps/site/
|
||||
COPY apps/docs/package.json apps/docs/
|
||||
RUN npm ci
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN npm run lint \
|
||||
&& npm run build \
|
||||
&& npm run build-storybook
|
||||
&& npm test \
|
||||
&& npm run build
|
||||
|
||||
FROM nginx:1.29-alpine AS runtime
|
||||
|
||||
LABEL org.opencontainers.image.title="Tansy UI" \
|
||||
org.opencontainers.image.description="Landing page and Storybook for the Tansy UI React component kit" \
|
||||
org.opencontainers.image.source="local:ui-showcase" \
|
||||
org.opencontainers.image.licenses="UNLICENSED"
|
||||
org.opencontainers.image.licenses="MIT"
|
||||
|
||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY --from=build /app/storybook-static /usr/share/nginx/html/docs
|
||||
COPY --from=build /app/apps/site/dist /usr/share/nginx/html
|
||||
COPY --from=build /app/apps/docs/storybook-static /usr/share/nginx/html/docs
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
|
||||
Reference in new issue
Block a user