:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
feat(quill): publish quill-charts to npm and fix catalog: leak (#62157)
Adam Leithaff8b2a654cb
diff --git a/.github/workflows/publish-quill-npm.yml b/.github/workflows/publish-quill-npm.ymlindex c6317ccb29f6..d82fe1d494e1 100644--- a/.github/workflows/publish-quill-npm.yml+++ b/.github/workflows/publish-quill-npm.yml@@ -45,21 +45,31 @@ jobs:run: npm install -g [email protected]- name: Install dependencies- run: pnpm install --frozen-lockfile --filter "@posthog/quill..." --filter "@posthog/quill-tokens"+ run: pnpm install --frozen-lockfile --filter "@posthog/quill..." --filter "@posthog/quill-tokens" --filter "@posthog/quill-charts..."- name: Build quill packagesrun: pnpm quill:build- # Only the public facade packages get published. The internal- # workspace members (-primitives, -components, -blocks) have- # `private: true` and are bundled into @posthog/quill at build- # time. Each public package gets its own publish + version-capture- # step so a failure shows up on the exact step that broke.+ # Only the public packages get published: -tokens, the @posthog/quill+ # facade, and -charts (an independent canvas charting library, not+ # bundled into the facade). The internal workspace members+ # (-primitives, -components, -blocks) have `private: true` and are+ # bundled into @posthog/quill at build time. Each public package gets+ # its own publish + version-capture step so a failure shows up on the+ # exact step that broke.+ # `pnpm pack` (not `npm publish` directly) so pnpm's `catalog:` /+ # `workspace:` protocol specifiers are rewritten to concrete versions+ # in the tarball manifest. `npm publish <tarball>` then ships that+ # resolved manifest while preserving OIDC trusted publishing ++ # provenance. Publishing the package dir with plain `npm publish`+ # would leak literal `catalog:` strings into the registry and make+ # the package uninstallable.- name: Publish @posthog/quill-tokensid: publish-tokensworking-directory: packages/quill/packages/tokensrun: |- npm publish --tag "$NPM_TAG" --access public+ TARBALL="$(pnpm pack | tail -1)"+ npm publish "$TARBALL" --tag "$NPM_TAG" --access publicVERSION=$(node -p "require('./package.json').version")echo "version=$VERSION" >> $GITHUB_OUTPUTenv:@@ -78,7 +88,21 @@ jobs:id: publish-quillworking-directory: packages/quill/packages/quillrun: |- npm publish --tag "$NPM_TAG" --access public+ TARBALL="$(pnpm pack | tail -1)"+ npm publish "$TARBALL" --tag "$NPM_TAG" --access public+ VERSION=$(node -p "require('./package.json').version")+ echo "version=$VERSION" >> $GITHUB_OUTPUT+ env:+ NODE_AUTH_TOKEN: ''+ NPM_CONFIG_PROVENANCE: true+ NPM_TAG: ${{ inputs.tag }}++ - name: Publish @posthog/quill-charts+ id: publish-charts+ working-directory: packages/quill/packages/charts+ run: |+ TARBALL="$(pnpm pack | tail -1)"+ npm publish "$TARBALL" --tag "$NPM_TAG" --access publicVERSION=$(node -p "require('./package.json').version")echo "version=$VERSION" >> $GITHUB_OUTPUTenv:@@ -95,8 +119,9 @@ jobs:# defense-in-depth hazard, even when the upstream value is trusted.TOKENS_VERSION: ${{ steps.publish-tokens.outputs.version }}QUILL_VERSION: ${{ steps.publish-quill.outputs.version }}+ CHARTS_VERSION: ${{ steps.publish-charts.outputs.version }}run: |- echo "summary=@posthog/quill-tokens@${TOKENS_VERSION}, @posthog/quill@${QUILL_VERSION}" >> $GITHUB_OUTPUT+ echo "summary=@posthog/quill-tokens@${TOKENS_VERSION}, @posthog/quill@${QUILL_VERSION}, @posthog/quill-charts@${CHARTS_VERSION}" >> $GITHUB_OUTPUT- name: Notify Slackif: ${{ !cancelled() }}diff --git a/package.json b/package.jsonindex b76d297f69be..8aff9f25cdfe 100644--- a/package.json+++ b/package.json@@ -41,9 +41,9 @@"cleandep": "rm -rf node_modules && pnpm -r exec rm -rf node_modules","storybook": "pnpm turbo --filter=@posthog/storybook start","quill:dev": "pnpm --filter=@posthog/quill-workspace dev",- "quill:build": "pnpm --filter='@posthog/quill...' build",+ "quill:build": "pnpm --filter='@posthog/quill...' --filter='@posthog/quill-charts...' build","quill:storybook": "pnpm --filter=@posthog/quill-workspace storybook",- "quill:publish": "pnpm quill:build && pnpm --filter @posthog/quill-tokens publish --tag alpha --no-git-checks && pnpm --filter @posthog/quill publish --tag alpha --no-git-checks",+ "quill:publish": "pnpm quill:build && pnpm --filter @posthog/quill-tokens publish --tag alpha --no-git-checks && pnpm --filter @posthog/quill publish --tag alpha --no-git-checks && pnpm --filter @posthog/quill-charts publish --tag alpha --no-git-checks","// DEPRECATED - use hogli start instead": "","start": "./bin/start","postinstall": "git config --get blame.ignoreRevsFile > /dev/null 2>&1 || git config blame.ignoreRevsFile .git-blame-ignore-revs > /dev/null 2>&1 || true; [ ! -f bin/fix-rdkafka-paths ] || bin/fix-rdkafka-paths",diff --git a/packages/quill/packages/blocks/package.json b/packages/quill/packages/blocks/package.jsonindex 4a7c5fae7ea8..2a37e30aa26d 100644--- a/packages/quill/packages/blocks/package.json+++ b/packages/quill/packages/blocks/package.json@@ -1,6 +1,6 @@{"name": "@posthog/quill-blocks",- "version": "0.3.0-beta.14",+ "version": "0.3.0-beta.15","private": true,"description": "Internal workspace package (private, not published). The highest layer of the quill design system — product-level patterns made of components + primitives (e.g. a PageHeader with title + breadcrumb + action slot, an EmptyState with icon + copy + CTA, a CommandPalette, a user-menu dropdown). Opinionated and shape-stable across products so they feel consistent. Bundled into @posthog/quill at build time; consumers should import from @posthog/quill instead.","license": "MIT",diff --git a/packages/quill/packages/charts/package.json b/packages/quill/packages/charts/package.jsonindex 9351657374c4..925d80d43b09 100644--- a/packages/quill/packages/charts/package.json+++ b/packages/quill/packages/charts/package.json@@ -1,26 +1,35 @@{"name": "@posthog/quill-charts",- "version": "0.0.0",- "private": true,- "description": "Internal workspace package (private, not published). Canvas-based charting library used for trends, dashboards, and any in-app chart that needs to render thousands of points smoothly. D3 (scale/shape/color/array sub-packages) powers the scales; the canvas does the drawing; React handles overlays.",+ "version": "0.3.0-beta.15",+ "description": "Canvas-based charting library for trends, dashboards, and any chart that needs to render thousands of points smoothly. D3 (scale/shape/color/array sub-packages) powers the scales; the canvas does the drawing; React handles overlays.","license": "MIT","repository": {"type": "git","url": "https://github.com/PostHog/posthog.git","directory": "packages/quill/packages/charts"},+ "files": [+ "dist"+ ],"type": "module",- "main": "./src/index.ts",- "module": "./src/index.ts",- "types": "./src/index.ts",+ "sideEffects": false,+ "main": "./dist/index.cjs",+ "module": "./dist/index.js",+ "types": "./dist/index.d.ts","exports": {- ".": "./src/index.ts",- "./testing": "./src/testing/index.ts",- "./story-helpers": "./src/story-helpers.tsx",+ ".": {+ "types": "./dist/index.d.ts",+ "import": "./dist/index.js",+ "require": "./dist/index.cjs",+ "default": "./dist/index.js"+ },"./package.json": "./package.json"},+ "publishConfig": {+ "access": "public"+ },"scripts": {- "build": "tsc -p tsconfig.build.json"+ "build": "vite build"},"dependencies": {"@floating-ui/react": "^0.27.19",@@ -43,8 +52,11 @@"@types/jest": "catalog:","@types/react": "^18.3.27","@types/react-dom": "^18.3.7",+ "@vitejs/plugin-react": "^5.1.1","jest": "^29.7.0",- "typescript": "catalog:"+ "typescript": "catalog:",+ "vite": "^6.3.5",+ "vite-plugin-dts": "^4.5.4"},"peerDependencies": {"react": "^18.3.1 || ^19.0.0",diff --git a/packages/quill/packages/charts/tsconfig.build.json b/packages/quill/packages/charts/tsconfig.build.jsonindex 930c84d610fd..f92e1c90d951 100644--- a/packages/quill/packages/charts/tsconfig.build.json+++ b/packages/quill/packages/charts/tsconfig.build.json@@ -1,12 +1,16 @@{"extends": "./tsconfig.json","compilerOptions": {- "noEmit": false,"declaration": true,- "emitDeclarationOnly": true,- "rootDir": "src",- "outDir": "dist"+ "rootDir": "src"},- "include": ["src/index.ts"],- "exclude": ["src/**/*.test.ts", "src/**/*.test.tsx", "src/testing", "src/story-helpers.tsx"]+ "include": ["src"],+ "exclude": [+ "src/**/*.test.ts",+ "src/**/*.test.tsx",+ "src/**/*.stories.ts",+ "src/**/*.stories.tsx",+ "src/testing",+ "src/story-helpers.tsx"+ ]}diff --git a/packages/quill/packages/charts/vite.config.ts b/packages/quill/packages/charts/vite.config.tsnew file mode 100644index 000000000000..9c94c014beeb--- /dev/null+++ b/packages/quill/packages/charts/vite.config.ts@@ -0,0 +1,52 @@+import react from '@vitejs/plugin-react'+import { resolve } from 'path'+import { defineConfig } from 'vite'+import dts from 'vite-plugin-dts'++/**+ * Builds @posthog/quill-charts for npm. Charts is pure JS/canvas — no CSS+ * pipeline. The runtime deps (d3-*, dayjs, @floating-ui/react,+ * simple-statistics) stay external and are redeclared as real+ * `dependencies` so the consumer's package manager installs them; react /+ * react-dom are peers. The dev/story-only entries (testing, story-helpers)+ * are excluded — in-repo consumers reach them via tsconfig path aliases /+ * jest moduleNameMapper against src, not the published package.+ */+export default defineConfig({+ plugins: [+ react(),+ dts({+ tsconfigPath: resolve(__dirname, 'tsconfig.build.json'),+ exclude: [+ 'src/**/*.test.ts',+ 'src/**/*.test.tsx',+ 'src/**/*.stories.ts',+ 'src/**/*.stories.tsx',+ 'src/testing/**',+ 'src/story-helpers.tsx',+ ],+ }),+ ],+ build: {+ lib: {+ entry: resolve(__dirname, 'src/index.ts'),+ formats: ['es', 'cjs'],+ fileName: (format) => `index.${format === 'es' ? 'js' : 'cjs'}`,+ },+ rollupOptions: {+ external: [+ 'react',+ 'react-dom',+ 'react/jsx-runtime',+ '@floating-ui/react',+ 'd3-array',+ 'd3-color',+ 'd3-scale',+ 'd3-shape',+ 'dayjs',+ /^dayjs\//,+ 'simple-statistics',+ ],+ },+ },+})diff --git a/packages/quill/packages/components/package.json b/packages/quill/packages/components/package.jsonindex a61208d004c0..cd10148e10ec 100644--- a/packages/quill/packages/components/package.json+++ b/packages/quill/packages/components/package.json@@ -1,6 +1,6 @@{"name": "@posthog/quill-components",- "version": "0.3.0-beta.14",+ "version": "0.3.0-beta.15","private": true,"description": "Internal workspace package (private, not published). The middle layer of the quill design system — higher-level compositions of primitives that wire several of them together with sensible defaults (e.g. a FormField that composes Label + Input + validation state, or a ConfirmDialog that composes Dialog + Button + destructive variant). Bundled into @posthog/quill at build time; consumers should import from @posthog/quill instead.","license": "MIT",diff --git a/packages/quill/packages/primitives/package.json b/packages/quill/packages/primitives/package.jsonindex f81092b3bf9d..23e8fae6e996 100644--- a/packages/quill/packages/primitives/package.json+++ b/packages/quill/packages/primitives/package.json@@ -1,6 +1,6 @@{"name": "@posthog/quill-primitives",- "version": "0.3.0-beta.14",+ "version": "0.3.0-beta.15","private": true,"description": "Internal workspace package (private, not published). The lowest layer of the quill design system — unstyled Base UI primitives wrapped with quill's Tailwind classes (Button, Card, Dialog, Input, Popover, Combobox, etc.). Bundled into @posthog/quill at build time; consumers should import from @posthog/quill instead.","license": "MIT",diff --git a/packages/quill/packages/quill/package.json b/packages/quill/packages/quill/package.jsonindex 5073a306a394..7068efaabe94 100644--- a/packages/quill/packages/quill/package.json+++ b/packages/quill/packages/quill/package.json@@ -1,6 +1,6 @@{"name": "@posthog/quill",- "version": "0.3.0-beta.14",+ "version": "0.3.0-beta.15","description": "PostHog's unified design system — primitives, components, and blocks designed to be compiled by the consumer's Tailwind v4.","license": "MIT","repository": {@@ -44,7 +44,6 @@"build:js": "vite build"},"dependencies": {- "@base-ui/react": "catalog:","class-variance-authority": "^0.7.1","clsx": "^2.1.1","lucide-react": "^0.577.0",@@ -52,6 +51,7 @@"tailwind-merge": "^2.2.2"},"devDependencies": {+ "@base-ui/react": "catalog:","@posthog/quill-blocks": "workspace:*","@posthog/quill-components": "workspace:*","@posthog/quill-primitives": "workspace:*",@@ -61,6 +61,7 @@"vite-plugin-dts": "^4.5.4"},"peerDependencies": {+ "@base-ui/react": "^1.4.0","react": "^18.3.1 || ^19.0.0","react-dom": "^18.3.1 || ^19.0.0","tailwindcss": "^4.0.0"diff --git a/packages/quill/packages/tokens/package.json b/packages/quill/packages/tokens/package.jsonindex 856dea6a1f88..e245f4d6ce4b 100644--- a/packages/quill/packages/tokens/package.json+++ b/packages/quill/packages/tokens/package.json@@ -1,6 +1,6 @@{"name": "@posthog/quill-tokens",- "version": "0.3.0-beta.14",+ "version": "0.3.0-beta.15","license": "MIT","repository": {"type": "git",diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 304b7195f9ee..84c5bc91bd46 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -1960,12 +1960,21 @@ importers:'@types/react-dom':specifier: 18.3.7version: 18.3.7(@types/[email protected])+ '@vitejs/plugin-react':+ specifier: ^5.1.1+ version: 5.2.0([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))jest:specifier: ^29.7.0version: 29.7.0(@types/[email protected])([email protected](@swc/[email protected])(@types/[email protected])([email protected]))typescript:specifier: 6.0.3version: 6.0.3+ vite:+ specifier: ^6.3.5+ version: 6.4.2(@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])+ vite-plugin-dts:+ specifier: ^4.5.4+ version: 4.5.4(@types/[email protected])([email protected])([email protected])([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected])([email protected]))packages/quill/packages/components:dependencies:@@ -2067,9 +2076,6 @@ importers:packages/quill/packages/quill:dependencies:- '@base-ui/react':- specifier: 'catalog:'- version: 1.4.0(@date-fns/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])class-variance-authority:specifier: ^0.7.1version: 0.7.1@@ -2095,6 +2101,9 @@ importers:specifier: ^4.0.0version: 4.2.2devDependencies:+ '@base-ui/react':+ specifier: 'catalog:'+ version: 1.4.0(@date-fns/[email protected])(@types/[email protected])([email protected])([email protected]([email protected]))([email protected])'@posthog/quill-blocks':specifier: workspace:*version: link:../blocks