From 00fed2dbff5130fba9736d0ce073c40eb57b0e0d Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 27 May 2026 15:23:32 +0800 Subject: [PATCH 01/18] feat(premium-analytics): add tsconfig paths and typecheck for internal packages --- pnpm-lock.yaml | 3 ++ projects/packages/premium-analytics/README.md | 29 +++++++++++++++---- .../changelog/add-internal-package-resolution | 4 +++ .../packages/premium-analytics/package.json | 2 ++ .../packages/premium-analytics/tsconfig.json | 9 ++++++ 5 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 projects/packages/premium-analytics/changelog/add-internal-package-resolution diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 526dabd96ca4..85e3d1751a8d 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3849,6 +3849,9 @@ importers: '@babel/core': specifier: 7.29.0 version: 7.29.0 + '@typescript/native-preview': + specifier: 7.0.0-dev.20260225.1 + version: 7.0.0-dev.20260225.1 '@wordpress/build': specifier: 0.13.0 version: 0.13.0(@babel/core@7.29.0)(@wordpress/boot@0.13.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@wordpress/route@0.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(browserslist@4.28.2) diff --git a/projects/packages/premium-analytics/README.md b/projects/packages/premium-analytics/README.md index e3f361a44074..5b26b1fbcaa5 100644 --- a/projects/packages/premium-analytics/README.md +++ b/projects/packages/premium-analytics/README.md @@ -42,17 +42,19 @@ jetpack build packages/premium-analytics # via Jetpack CLI ### Adding a route 1. Create `routes//package.json`: + ```json { - "name": "-route", - "route": { - "path": "/", - "page": "jetpack-premium-analytics" - } + "name": "-route", + "route": { + "path": "/", + "page": "jetpack-premium-analytics" + } } ``` 2. Create `routes//stage.tsx` exporting `stage()`: + ```tsx export const stage = () =>
My new page
; ``` @@ -74,11 +76,28 @@ fixes the template or the minimum WordPress version is 7.0+. ### Init module (`packages/init/`) Serves two purposes: + 1. Sets the dashboard menu icon via `@wordpress/boot` store 2. Forces `@wordpress/build` to track `@wordpress/boot` as a module dependency — without an init module that imports boot, the build skips it +## Internal packages (`packages/*`) + +App-internal modules discovered by `@wordpress/build`. Types/IDE resolve +`@jetpack-premium-analytics/` imports via the `tsconfig.json` `paths` alias +(`pnpm typecheck`). + +To import one from a route/another package, the build also needs it symlinked in +`node_modules` under that specifier. Name the package +`@automattic/jetpack-premium-analytics-` (a bare `@jetpack-premium-analytics/*` +name fails the repo name lint and `_@…` is invalid to pnpm), then add a `link:` +dep on the top-level `package.json` (routes aren't workspace members): + +```jsonc +"dependencies": { "@jetpack-premium-analytics/": "link:packages/" } +``` + ## File structure ``` diff --git a/projects/packages/premium-analytics/changelog/add-internal-package-resolution b/projects/packages/premium-analytics/changelog/add-internal-package-resolution new file mode 100644 index 000000000000..d35865145ec1 --- /dev/null +++ b/projects/packages/premium-analytics/changelog/add-internal-package-resolution @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Add a tsconfig paths alias and typecheck script so internal packages/* resolve for types/IDE, and document how to wire cross-package imports for the build. diff --git a/projects/packages/premium-analytics/package.json b/projects/packages/premium-analytics/package.json index ada5924f05de..e30e5e144b49 100644 --- a/projects/packages/premium-analytics/package.json +++ b/projects/packages/premium-analytics/package.json @@ -6,6 +6,7 @@ "scripts": { "build": "wp-build && mkdir -p build/modules/boot && cp shims/boot-asset.php build/modules/boot/index.min.asset.php", "build-production": "NODE_ENV=production wp-build && mkdir -p build/modules/boot && cp shims/boot-asset.php build/modules/boot/index.min.asset.php", + "typecheck": "tsgo --noEmit", "watch": "wp-build --watch" }, "wpPlugin": { @@ -38,6 +39,7 @@ }, "devDependencies": { "@babel/core": "7.29.0", + "@typescript/native-preview": "7.0.0-dev.20260225.1", "@wordpress/build": "0.13.0", "browserslist": "4.28.2" } diff --git a/projects/packages/premium-analytics/tsconfig.json b/projects/packages/premium-analytics/tsconfig.json index 1e36ba0293d3..f018f27578e3 100644 --- a/projects/packages/premium-analytics/tsconfig.json +++ b/projects/packages/premium-analytics/tsconfig.json @@ -1,4 +1,13 @@ { "extends": "jetpack-js-tools/tsconfig.base.json", + "compilerOptions": { + // Resolve cross-package imports between internal `packages/*` modules + // (`@jetpack-premium-analytics/`) to their TypeScript source for + // type-checking + IDE. The build resolves the same specifier separately (see + // README → "Internal packages"); this keeps tsc/esbuild and `tsgo` in sync. + "paths": { + "@jetpack-premium-analytics/*": [ "./packages/*/src" ] + } + }, "include": [ "routes/**/*", "packages/**/*" ] } From 20e62414b3a35c1ef8cfb65f271e5bebf95d8134 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 27 May 2026 16:16:30 +0800 Subject: [PATCH 02/18] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- projects/packages/premium-analytics/README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/projects/packages/premium-analytics/README.md b/projects/packages/premium-analytics/README.md index 5b26b1fbcaa5..5abfb8f0e512 100644 --- a/projects/packages/premium-analytics/README.md +++ b/projects/packages/premium-analytics/README.md @@ -45,11 +45,11 @@ jetpack build packages/premium-analytics # via Jetpack CLI ```json { - "name": "-route", - "route": { - "path": "/", - "page": "jetpack-premium-analytics" - } + "name": "-route", + "route": { + "path": "/", + "page": "jetpack-premium-analytics" + } } ``` From 662c887ff7538d3ea7aa57a8026f301a11d2ae0e Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 27 May 2026 16:16:40 +0800 Subject: [PATCH 03/18] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- projects/packages/premium-analytics/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/projects/packages/premium-analytics/README.md b/projects/packages/premium-analytics/README.md index 5abfb8f0e512..2785620dabee 100644 --- a/projects/packages/premium-analytics/README.md +++ b/projects/packages/premium-analytics/README.md @@ -92,7 +92,8 @@ To import one from a route/another package, the build also needs it symlinked in `node_modules` under that specifier. Name the package `@automattic/jetpack-premium-analytics-` (a bare `@jetpack-premium-analytics/*` name fails the repo name lint and `_@…` is invalid to pnpm), then add a `link:` -dep on the top-level `package.json` (routes aren't workspace members): +dep in this package's `projects/packages/premium-analytics/package.json` +(not the repo root `package.json`; routes aren't workspace members): ```jsonc "dependencies": { "@jetpack-premium-analytics/": "link:packages/" } From d4da9cad4304fe48243f8c8250e76a72f483e7de Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 14:07:06 +0800 Subject: [PATCH 04/18] docs(premium-analytics): clarify internal-package naming and rename init Address PR review feedback on the "Internal packages" section: - Lead with scope intent: internal-only, never published, in-tree symlink-only resolution (answers the npm-squatting concern) - Explicitly explain the structural dual naming between the package name field and the wp-build-derived import specifier - Rename packages/init from `_@jetpack-premium-analytics/init` to `@automattic/jetpack-premium-analytics-init` so the codebase matches the documented pattern (the old placeholder is invalid to pnpm) --- projects/packages/premium-analytics/README.md | 40 ++++++++++++------- .../packages/init/package.json | 2 +- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/projects/packages/premium-analytics/README.md b/projects/packages/premium-analytics/README.md index 2785620dabee..bf7ad81a5191 100644 --- a/projects/packages/premium-analytics/README.md +++ b/projects/packages/premium-analytics/README.md @@ -45,11 +45,11 @@ jetpack build packages/premium-analytics # via Jetpack CLI ```json { - "name": "-route", - "route": { - "path": "/", - "page": "jetpack-premium-analytics" - } + "name": "-route", + "route": { + "path": "/", + "page": "jetpack-premium-analytics" + } } ``` @@ -84,16 +84,26 @@ Serves two purposes: ## Internal packages (`packages/*`) -App-internal modules discovered by `@wordpress/build`. Types/IDE resolve -`@jetpack-premium-analytics/` imports via the `tsconfig.json` `paths` alias -(`pnpm typecheck`). - -To import one from a route/another package, the build also needs it symlinked in -`node_modules` under that specifier. Name the package -`@automattic/jetpack-premium-analytics-` (a bare `@jetpack-premium-analytics/*` -name fails the repo name lint and `_@…` is invalid to pnpm), then add a `link:` -dep in this package's `projects/packages/premium-analytics/package.json` -(not the repo root `package.json`; routes aren't workspace members): +App-internal modules used only by this package — never published to npm, never +shared across the monorepo. Resolution is entirely in-tree (the local symlink); +the `@jetpack-premium-analytics/*` scope is never looked up against any registry. + +**The dual naming is structural.** `@wordpress/build` derives the import +specifier as `@/`, so the specifier here is +always `@jetpack-premium-analytics/`. The package's own `name` field has +to be different (`@automattic/jetpack-premium-analytics-`) because pnpm +rejects the `_@…` escape and the repo name lint (`lint-project-structure.sh`) +rejects the bare `@jetpack-premium-analytics/*` scope. They don't need to +match: pnpm symlinks under the **dep key**, so the import resolves regardless +of the linked package's `name`. + +Types/IDE: the `tsconfig.json` `paths` alias maps the specifier to +`./packages//src` (covered by `pnpm typecheck`). + +Build: to import one from a route or another package, add a `link:` dep on +**this package's `package.json`** (`projects/packages/premium-analytics/package.json` — +routes aren't workspace members, so the dep belongs here, not in the route's +`package.json`): ```jsonc "dependencies": { "@jetpack-premium-analytics/": "link:packages/" } diff --git a/projects/packages/premium-analytics/packages/init/package.json b/projects/packages/premium-analytics/packages/init/package.json index 6ee2ce1e4470..70de0aea9d5b 100644 --- a/projects/packages/premium-analytics/packages/init/package.json +++ b/projects/packages/premium-analytics/packages/init/package.json @@ -1,6 +1,6 @@ { "private": true, - "name": "_@jetpack-premium-analytics/init", + "name": "@automattic/jetpack-premium-analytics-init", "version": "0.1.0", "type": "module", "wpScript": true, From b08c64d463f7cf38b8b39ff7b331f1ebf4133c36 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 15:34:17 +0800 Subject: [PATCH 05/18] chore(premium-analytics): add @wordpress/primitives dependency Required by the icons package being ported in subsequent commits. Refs WOOA7S-1314 --- pnpm-lock.yaml | 3 +++ projects/packages/premium-analytics/package.json | 1 + 2 files changed, 4 insertions(+) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 85e3d1751a8d..762bf5727d14 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3836,6 +3836,9 @@ importers: '@wordpress/icons': specifier: ^13.0.0 version: 13.1.0(react@18.3.1) + '@wordpress/primitives': + specifier: 4.46.0 + version: 4.46.0(react@18.3.1) '@wordpress/route': specifier: 0.12.0 version: 0.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) diff --git a/projects/packages/premium-analytics/package.json b/projects/packages/premium-analytics/package.json index e30e5e144b49..29f965c888ec 100644 --- a/projects/packages/premium-analytics/package.json +++ b/projects/packages/premium-analytics/package.json @@ -33,6 +33,7 @@ "@wordpress/data": "10.46.0", "@wordpress/i18n": "^6.9.0", "@wordpress/icons": "^13.0.0", + "@wordpress/primitives": "4.46.0", "@wordpress/route": "0.12.0", "react": "18.3.1", "react-dom": "18.3.1" From 45b3debefa01ed3f9e6e1dc13689de18bc7794dd Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 15:35:28 +0800 Subject: [PATCH 06/18] feat(premium-analytics): copy icons sources from next-woocommerce-analytics MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Verbatim port of the 13 illustrated WPDS icons (calendar, channel, coupon, customer, device, goal, location, megaphone, payment, payment-return, product-blouse, reports, search) plus the barrel index that re-exports navigation/settings/plus/info from @wordpress/icons. The upstream stories file is dropped (depends on @wordpress/ui — a CIAB-only package). The upstream leaf tsconfig.json is also dropped: this package's parent tsconfig already covers packages/**/*. The leaf package.json is added in a follow-up commit (adapted for the monorepo, not copyable verbatim). Refs WOOA7S-1314 --- .../packages/icons/src/calendar/index.tsx | 75 +++++++++++++++++++ .../packages/icons/src/channel/index.tsx | 17 +++++ .../packages/icons/src/coupon/index.tsx | 21 ++++++ .../packages/icons/src/customer/index.tsx | 21 ++++++ .../packages/icons/src/device/index.tsx | 37 +++++++++ .../packages/icons/src/goal/index.tsx | 33 ++++++++ .../packages/icons/src/index.ts | 19 +++++ .../packages/icons/src/location/index.tsx | 20 +++++ .../packages/icons/src/megaphone/index.tsx | 25 +++++++ .../icons/src/payment-return/index.tsx | 25 +++++++ .../packages/icons/src/payment/index.tsx | 29 +++++++ .../icons/src/product-blouse/index.tsx | 17 +++++ .../packages/icons/src/reports/index.tsx | 22 ++++++ .../packages/icons/src/search/index.tsx | 21 ++++++ 14 files changed, 382 insertions(+) create mode 100644 projects/packages/premium-analytics/packages/icons/src/calendar/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/channel/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/coupon/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/customer/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/device/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/goal/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/index.ts create mode 100644 projects/packages/premium-analytics/packages/icons/src/location/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/megaphone/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/payment-return/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/payment/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/product-blouse/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/reports/index.tsx create mode 100644 projects/packages/premium-analytics/packages/icons/src/search/index.tsx diff --git a/projects/packages/premium-analytics/packages/icons/src/calendar/index.tsx b/projects/packages/premium-analytics/packages/icons/src/calendar/index.tsx new file mode 100644 index 000000000000..9472ebfa007b --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/calendar/index.tsx @@ -0,0 +1,75 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const calendar = ( + + + + + + + + + + + + + + + + + + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/channel/index.tsx b/projects/packages/premium-analytics/packages/icons/src/channel/index.tsx new file mode 100644 index 000000000000..ead4881eb553 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/channel/index.tsx @@ -0,0 +1,17 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const channel = ( + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/coupon/index.tsx b/projects/packages/premium-analytics/packages/icons/src/coupon/index.tsx new file mode 100644 index 000000000000..3b7820c4d6e3 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/coupon/index.tsx @@ -0,0 +1,21 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const coupon = ( + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/customer/index.tsx b/projects/packages/premium-analytics/packages/icons/src/customer/index.tsx new file mode 100644 index 000000000000..c5e858f2227f --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/customer/index.tsx @@ -0,0 +1,21 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const customer = ( + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/device/index.tsx b/projects/packages/premium-analytics/packages/icons/src/device/index.tsx new file mode 100644 index 000000000000..ac0c5a611a60 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/device/index.tsx @@ -0,0 +1,37 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const device = ( + + + + + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/goal/index.tsx b/projects/packages/premium-analytics/packages/icons/src/goal/index.tsx new file mode 100644 index 000000000000..14c807057c43 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/goal/index.tsx @@ -0,0 +1,33 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const goal = ( + + + + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/index.ts b/projects/packages/premium-analytics/packages/icons/src/index.ts new file mode 100644 index 000000000000..7a2d0079430c --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/index.ts @@ -0,0 +1,19 @@ +/** + * External dependencies + */ +import { navigation, settings, plus, info } from '@wordpress/icons'; + +export { reports } from './reports'; +export { productBlouse } from './product-blouse'; +export { goal } from './goal'; +export { device } from './device'; +export { location } from './location'; +export { calendar } from './calendar'; +export { megaphone } from './megaphone'; +export { channel } from './channel'; +export { coupon } from './coupon'; +export { customer } from './customer'; +export { paymentReturn } from './payment-return'; +export { search } from './search'; +export { payment } from './payment'; +export { navigation as dashboard, settings, plus, info }; diff --git a/projects/packages/premium-analytics/packages/icons/src/location/index.tsx b/projects/packages/premium-analytics/packages/icons/src/location/index.tsx new file mode 100644 index 000000000000..48beba17dbdd --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/location/index.tsx @@ -0,0 +1,20 @@ +/** + * External dependencies + */ +import { SVG, Path, Circle } from '@wordpress/primitives'; + +export const location = ( + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/megaphone/index.tsx b/projects/packages/premium-analytics/packages/icons/src/megaphone/index.tsx new file mode 100644 index 000000000000..1d8ed207e02e --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/megaphone/index.tsx @@ -0,0 +1,25 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const megaphone = ( + + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/payment-return/index.tsx b/projects/packages/premium-analytics/packages/icons/src/payment-return/index.tsx new file mode 100644 index 000000000000..0d4cdf101d17 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/payment-return/index.tsx @@ -0,0 +1,25 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const paymentReturn = ( + + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/payment/index.tsx b/projects/packages/premium-analytics/packages/icons/src/payment/index.tsx new file mode 100644 index 000000000000..9b5fdced89fd --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/payment/index.tsx @@ -0,0 +1,29 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const payment = ( + + + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/product-blouse/index.tsx b/projects/packages/premium-analytics/packages/icons/src/product-blouse/index.tsx new file mode 100644 index 000000000000..2475619305d8 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/product-blouse/index.tsx @@ -0,0 +1,17 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const productBlouse = ( + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/reports/index.tsx b/projects/packages/premium-analytics/packages/icons/src/reports/index.tsx new file mode 100644 index 000000000000..f543d31c59ba --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/reports/index.tsx @@ -0,0 +1,22 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const reports = ( + + + + + + + +); diff --git a/projects/packages/premium-analytics/packages/icons/src/search/index.tsx b/projects/packages/premium-analytics/packages/icons/src/search/index.tsx new file mode 100644 index 000000000000..fb333ca4785f --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/search/index.tsx @@ -0,0 +1,21 @@ +/** + * External dependencies + */ +import { SVG, Path } from '@wordpress/primitives'; + +export const search = ( + + + + + +); From 6eb7834d06c4b2c61258a387a80c79c3d71c0922 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 15:35:53 +0800 Subject: [PATCH 07/18] feat(premium-analytics): add icons package manifest Adapt upstream package.json for the Jetpack monorepo: - Rename to @automattic/jetpack-premium-analytics-icons (the import specifier @jetpack-premium-analytics/icons comes from the parent's wpPlugin.packageNamespace; see parent README). - private: true and version 0.1.0 (matches sibling packages/init). - Pin @wordpress/primitives 4.46.0 (Jetpack convention) and bump @wordpress/icons to ^13.0.0 (matches parent). - Add main/types pointing at src/index.ts and sideEffects: false so tooling can resolve the package from source. - Drop upstream wpModule/exports (CIAB-specific build conventions) and the design-system / @wordpress/ui devDeps (only used by the now-dropped stories file). Refs WOOA7S-1314 --- .../premium-analytics/packages/icons/package.json | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 projects/packages/premium-analytics/packages/icons/package.json diff --git a/projects/packages/premium-analytics/packages/icons/package.json b/projects/packages/premium-analytics/packages/icons/package.json new file mode 100644 index 000000000000..177894ed9107 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/package.json @@ -0,0 +1,13 @@ +{ + "private": true, + "name": "@automattic/jetpack-premium-analytics-icons", + "version": "0.1.0", + "type": "module", + "main": "src/index.ts", + "types": "src/index.ts", + "sideEffects": false, + "dependencies": { + "@wordpress/icons": "^13.0.0", + "@wordpress/primitives": "4.46.0" + } +} From b18515dfb9ff3b1fd5b9fdd0cc9b859b47e7ead3 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 15:36:17 +0800 Subject: [PATCH 08/18] docs(premium-analytics): add icons README The upstream icons package shipped no README; document the exported icons, the WPDS / @wordpress/icons split, and the dual-naming convention link back to the parent README. Refs WOOA7S-1314 --- .../packages/icons/README.md | 54 +++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 projects/packages/premium-analytics/packages/icons/README.md diff --git a/projects/packages/premium-analytics/packages/icons/README.md b/projects/packages/premium-analytics/packages/icons/README.md new file mode 100644 index 000000000000..65773c774591 --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/README.md @@ -0,0 +1,54 @@ +# @jetpack-premium-analytics/icons + +Illustrated WPDS icons used by Premium Analytics widgets and navigation. + +## Overview + +13 branded multi-fill SVG illustrations (48×48 viewBox, fills driven by +`var(--wpds-color-*)` tokens), plus a small set of re-exports from +`@wordpress/icons` for utility glyphs (`dashboard`, `settings`, `plus`, +`info`). + +The illustrated icons are intentionally distinct from upstream +`@wordpress/icons`, which ships 24×24 monochrome glyphs intended for +`fill: currentColor` styling. Where a glyph is enough, prefer upstream. + +## Usage + +```ts +import { Icon } from '@wordpress/icons'; +import { calendar, dashboard, search } from '@jetpack-premium-analytics/icons'; + +; +``` + +## Exports + +| Name | Source | +| --------------- | -------------------------------------------- | +| `calendar` | local (illustrated) | +| `channel` | local (illustrated) | +| `coupon` | local (illustrated) | +| `customer` | local (illustrated) | +| `device` | local (illustrated) | +| `goal` | local (illustrated) | +| `location` | local (illustrated) | +| `megaphone` | local (illustrated) | +| `payment` | local (illustrated) | +| `paymentReturn` | local (illustrated) | +| `productBlouse` | local (illustrated) | +| `reports` | local (illustrated) | +| `search` | local (illustrated) | +| `dashboard` | re-export of `@wordpress/icons` `navigation` | +| `settings` | re-export of `@wordpress/icons` | +| `plus` | re-export of `@wordpress/icons` | +| `info` | re-export of `@wordpress/icons` | + +## Dependencies + +- `@wordpress/primitives` — `SVG`, `Path`, `Circle` +- `@wordpress/icons` — utility-glyph re-exports + +See the parent README's "Internal packages" section for the dual-naming +convention behind the `@jetpack-premium-analytics/icons` import specifier +vs. the package's `name` field. From d13b8b48cfb24a5cd120f4a9a806ddd4342e4fc8 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 15:36:27 +0800 Subject: [PATCH 09/18] changelog: add entry for premium-analytics icons port Refs WOOA7S-1314 --- .../wooa7s-1314-integrate-icons-package-into-analytics | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 projects/packages/premium-analytics/changelog/wooa7s-1314-integrate-icons-package-into-analytics diff --git a/projects/packages/premium-analytics/changelog/wooa7s-1314-integrate-icons-package-into-analytics b/projects/packages/premium-analytics/changelog/wooa7s-1314-integrate-icons-package-into-analytics new file mode 100644 index 000000000000..71608dab69f3 --- /dev/null +++ b/projects/packages/premium-analytics/changelog/wooa7s-1314-integrate-icons-package-into-analytics @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Port icons package (illustrated WPDS icons + @wordpress/icons re-exports) as an internal package from next-woocommerce-analytics. From 05058b6db15ba1638f662ccbfba2f52bba0ef762 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 15:51:35 +0800 Subject: [PATCH 10/18] feat(premium-analytics): restore icons stories with Jetpack adaptations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @wordpress/ui is a published package (already pinned at 0.13.0 by sibling packages videopress and publicize), not CIAB-only — restore the upstream stories gallery so the icons remain discoverable. Adaptations from upstream: - Title: 'Icons/Gallery' → 'Packages/Premium Analytics/Icons' (Jetpack story-tree convention). - Add component: Icon to the default export to satisfy storybook/csf-component. - Drop the External/Internal-dependencies comment separators and the blank line between import groups so import/order passes. Adds @wordpress/ui@0.13.0 and @storybook/react@10.3.6 as devDeps on both the parent and the leaf package.json (parent so pnpm resolves them; leaf so import/no-extraneous-dependencies finds them). Note: the stories file is not yet wired into the central Storybook config at projects/js-packages/storybook/storybook/projects.js, so it won't render in Storybook until that list is extended. Tracked separately. Refs WOOA7S-1314 --- pnpm-lock.yaml | 24 ++++++++++ .../packages/premium-analytics/package.json | 2 + .../packages/icons/package.json | 4 ++ .../icons/src/stories/icons.stories.tsx | 46 +++++++++++++++++++ 4 files changed, 76 insertions(+) create mode 100644 projects/packages/premium-analytics/packages/icons/src/stories/icons.stories.tsx diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 762bf5727d14..1023da055c09 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3852,12 +3852,18 @@ importers: '@babel/core': specifier: 7.29.0 version: 7.29.0 + '@storybook/react': + specifier: 10.3.6 + version: 10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) '@typescript/native-preview': specifier: 7.0.0-dev.20260225.1 version: 7.0.0-dev.20260225.1 '@wordpress/build': specifier: 0.13.0 version: 0.13.0(@babel/core@7.29.0)(@wordpress/boot@0.13.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(@wordpress/route@0.12.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(browserslist@4.28.2) + '@wordpress/ui': + specifier: 0.13.0 + version: 0.13.0(react-dom@18.3.1(react@18.3.1))(react@18.3.1) browserslist: specifier: 4.28.2 version: 4.28.2 @@ -22373,6 +22379,11 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) + '@storybook/react-dom-shim@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + react: 18.3.1 + react-dom: 18.3.1(react@18.3.1) + '@storybook/react-dom-shim@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.3.6(@testing-library/dom@10.4.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: react: 18.3.1 @@ -22401,6 +22412,17 @@ snapshots: - typescript - webpack + '@storybook/react@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': + dependencies: + '@storybook/global': 5.0.0 + '@storybook/react-dom-shim': 10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + react: 18.3.1 + react-docgen: 8.0.3 + react-docgen-typescript: 2.4.0 + react-dom: 18.3.1(react@18.3.1) + transitivePeerDependencies: + - supports-color + '@storybook/react@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.3.6(@testing-library/dom@10.4.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(typescript@5.9.3)': dependencies: '@storybook/global': 5.0.0 @@ -31740,6 +31762,8 @@ snapshots: date-fns-jalali: 4.1.0-0 react: 18.3.1 + react-docgen-typescript@2.4.0: {} + react-docgen-typescript@2.4.0(typescript@5.9.3): dependencies: typescript: 5.9.3 diff --git a/projects/packages/premium-analytics/package.json b/projects/packages/premium-analytics/package.json index 29f965c888ec..6717ae0af1a4 100644 --- a/projects/packages/premium-analytics/package.json +++ b/projects/packages/premium-analytics/package.json @@ -40,8 +40,10 @@ }, "devDependencies": { "@babel/core": "7.29.0", + "@storybook/react": "10.3.6", "@typescript/native-preview": "7.0.0-dev.20260225.1", "@wordpress/build": "0.13.0", + "@wordpress/ui": "0.13.0", "browserslist": "4.28.2" } } diff --git a/projects/packages/premium-analytics/packages/icons/package.json b/projects/packages/premium-analytics/packages/icons/package.json index 177894ed9107..5989790dc3e3 100644 --- a/projects/packages/premium-analytics/packages/icons/package.json +++ b/projects/packages/premium-analytics/packages/icons/package.json @@ -9,5 +9,9 @@ "dependencies": { "@wordpress/icons": "^13.0.0", "@wordpress/primitives": "4.46.0" + }, + "devDependencies": { + "@storybook/react": "10.3.6", + "@wordpress/ui": "0.13.0" } } diff --git a/projects/packages/premium-analytics/packages/icons/src/stories/icons.stories.tsx b/projects/packages/premium-analytics/packages/icons/src/stories/icons.stories.tsx new file mode 100644 index 000000000000..c3b6f9130aed --- /dev/null +++ b/projects/packages/premium-analytics/packages/icons/src/stories/icons.stories.tsx @@ -0,0 +1,46 @@ +import { Icon, Stack } from '@wordpress/ui'; +import * as icons from '../index'; +import type { Meta, StoryObj } from '@storybook/react'; + +const meta: Meta< typeof Icon > = { + title: 'Packages/Premium Analytics/Icons', + component: Icon, + parameters: { + layout: 'padded', + }, +}; + +export default meta; +type Story = StoryObj< typeof Icon >; + +const iconEntries = Object.entries( icons ); + +export const AllIcons: Story = { + render: () => ( +
+ { iconEntries.map( ( [ name, icon ] ) => ( + + + { name } + + ) ) } +
+ ), +}; From 1f6f4a087678e93ca7952166b5322658828bf4f3 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 28 May 2026 15:57:32 +0800 Subject: [PATCH 11/18] chore(premium-analytics): pin @storybook/react peer deps Adding @storybook/react@10.3.6 as a devDep brings unmet peer dependencies (storybook, typescript, @testing-library/dom) that ERR_PNPM_PEER_DEP_ISSUES blocks fresh CI installs on. Pin the same versions sibling packages videopress and publicize already pin: storybook@10.3.6 typescript@5.9.3 @testing-library/dom@10.4.1 Refs WOOA7S-1314 --- pnpm-lock.yaml | 29 +++++++------------ .../packages/premium-analytics/package.json | 5 +++- 2 files changed, 14 insertions(+), 20 deletions(-) diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1023da055c09..b7fe480013aa 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -3854,7 +3854,10 @@ importers: version: 7.29.0 '@storybook/react': specifier: 10.3.6 - version: 10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + version: 10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.3.6(@testing-library/dom@10.4.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(typescript@5.9.3) + '@testing-library/dom': + specifier: 10.4.1 + version: 10.4.1 '@typescript/native-preview': specifier: 7.0.0-dev.20260225.1 version: 7.0.0-dev.20260225.1 @@ -3867,6 +3870,12 @@ importers: browserslist: specifier: 4.28.2 version: 4.28.2 + storybook: + specifier: 10.3.6 + version: 10.3.6(@testing-library/dom@10.4.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) + typescript: + specifier: 5.9.3 + version: 5.9.3 projects/packages/protect-models: {} @@ -22379,11 +22388,6 @@ snapshots: react: 18.3.1 react-dom: 18.3.1(react@18.3.1) - '@storybook/react-dom-shim@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - react: 18.3.1 - react-dom: 18.3.1(react@18.3.1) - '@storybook/react-dom-shim@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.3.6(@testing-library/dom@10.4.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))': dependencies: react: 18.3.1 @@ -22412,17 +22416,6 @@ snapshots: - typescript - webpack - '@storybook/react@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)': - dependencies: - '@storybook/global': 5.0.0 - '@storybook/react-dom-shim': 10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1) - react: 18.3.1 - react-docgen: 8.0.3 - react-docgen-typescript: 2.4.0 - react-dom: 18.3.1(react@18.3.1) - transitivePeerDependencies: - - supports-color - '@storybook/react@10.3.6(react-dom@18.3.1(react@18.3.1))(react@18.3.1)(storybook@10.3.6(@testing-library/dom@10.4.1)(react-dom@18.3.1(react@18.3.1))(react@18.3.1))(typescript@5.9.3)': dependencies: '@storybook/global': 5.0.0 @@ -31762,8 +31755,6 @@ snapshots: date-fns-jalali: 4.1.0-0 react: 18.3.1 - react-docgen-typescript@2.4.0: {} - react-docgen-typescript@2.4.0(typescript@5.9.3): dependencies: typescript: 5.9.3 diff --git a/projects/packages/premium-analytics/package.json b/projects/packages/premium-analytics/package.json index 6717ae0af1a4..d9db49e2dc45 100644 --- a/projects/packages/premium-analytics/package.json +++ b/projects/packages/premium-analytics/package.json @@ -41,9 +41,12 @@ "devDependencies": { "@babel/core": "7.29.0", "@storybook/react": "10.3.6", + "@testing-library/dom": "10.4.1", "@typescript/native-preview": "7.0.0-dev.20260225.1", "@wordpress/build": "0.13.0", "@wordpress/ui": "0.13.0", - "browserslist": "4.28.2" + "browserslist": "4.28.2", + "storybook": "10.3.6", + "typescript": "5.9.3" } } From 37208ce4c83a81bdda71f47218ecb021742a69a5 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Fri, 29 May 2026 16:21:42 +0800 Subject: [PATCH 12/18] refactor(premium-analytics): drop @wordpress/icons re-exports from icons package --- .../packages/icons/README.md | 46 +++++++++---------- .../packages/icons/package.json | 1 - .../packages/icons/src/index.ts | 6 --- 3 files changed, 21 insertions(+), 32 deletions(-) diff --git a/projects/packages/premium-analytics/packages/icons/README.md b/projects/packages/premium-analytics/packages/icons/README.md index 65773c774591..97fcbc54a1d0 100644 --- a/projects/packages/premium-analytics/packages/icons/README.md +++ b/projects/packages/premium-analytics/packages/icons/README.md @@ -5,49 +5,45 @@ Illustrated WPDS icons used by Premium Analytics widgets and navigation. ## Overview 13 branded multi-fill SVG illustrations (48×48 viewBox, fills driven by -`var(--wpds-color-*)` tokens), plus a small set of re-exports from -`@wordpress/icons` for utility glyphs (`dashboard`, `settings`, `plus`, -`info`). +`var(--wpds-color-*)` tokens). The illustrated icons are intentionally distinct from upstream `@wordpress/icons`, which ships 24×24 monochrome glyphs intended for -`fill: currentColor` styling. Where a glyph is enough, prefer upstream. +`fill: currentColor` styling. Where a glyph is enough, import it directly +from `@wordpress/icons` rather than adding a re-export here — keeping this +package focused on the genuinely-custom illustrations and free of upstream +names we'd otherwise have to track across `@wordpress/icons` bumps. ## Usage ```ts import { Icon } from '@wordpress/icons'; -import { calendar, dashboard, search } from '@jetpack-premium-analytics/icons'; +import { calendar, search } from '@jetpack-premium-analytics/icons'; ; ``` ## Exports -| Name | Source | -| --------------- | -------------------------------------------- | -| `calendar` | local (illustrated) | -| `channel` | local (illustrated) | -| `coupon` | local (illustrated) | -| `customer` | local (illustrated) | -| `device` | local (illustrated) | -| `goal` | local (illustrated) | -| `location` | local (illustrated) | -| `megaphone` | local (illustrated) | -| `payment` | local (illustrated) | -| `paymentReturn` | local (illustrated) | -| `productBlouse` | local (illustrated) | -| `reports` | local (illustrated) | -| `search` | local (illustrated) | -| `dashboard` | re-export of `@wordpress/icons` `navigation` | -| `settings` | re-export of `@wordpress/icons` | -| `plus` | re-export of `@wordpress/icons` | -| `info` | re-export of `@wordpress/icons` | +| Name | Source | +| --------------- | ------------------- | +| `calendar` | local (illustrated) | +| `channel` | local (illustrated) | +| `coupon` | local (illustrated) | +| `customer` | local (illustrated) | +| `device` | local (illustrated) | +| `goal` | local (illustrated) | +| `location` | local (illustrated) | +| `megaphone` | local (illustrated) | +| `payment` | local (illustrated) | +| `paymentReturn` | local (illustrated) | +| `productBlouse` | local (illustrated) | +| `reports` | local (illustrated) | +| `search` | local (illustrated) | ## Dependencies - `@wordpress/primitives` — `SVG`, `Path`, `Circle` -- `@wordpress/icons` — utility-glyph re-exports See the parent README's "Internal packages" section for the dual-naming convention behind the `@jetpack-premium-analytics/icons` import specifier diff --git a/projects/packages/premium-analytics/packages/icons/package.json b/projects/packages/premium-analytics/packages/icons/package.json index 5989790dc3e3..e36ad12bcbad 100644 --- a/projects/packages/premium-analytics/packages/icons/package.json +++ b/projects/packages/premium-analytics/packages/icons/package.json @@ -7,7 +7,6 @@ "types": "src/index.ts", "sideEffects": false, "dependencies": { - "@wordpress/icons": "^13.0.0", "@wordpress/primitives": "4.46.0" }, "devDependencies": { diff --git a/projects/packages/premium-analytics/packages/icons/src/index.ts b/projects/packages/premium-analytics/packages/icons/src/index.ts index 7a2d0079430c..97d525458ec2 100644 --- a/projects/packages/premium-analytics/packages/icons/src/index.ts +++ b/projects/packages/premium-analytics/packages/icons/src/index.ts @@ -1,8 +1,3 @@ -/** - * External dependencies - */ -import { navigation, settings, plus, info } from '@wordpress/icons'; - export { reports } from './reports'; export { productBlouse } from './product-blouse'; export { goal } from './goal'; @@ -16,4 +11,3 @@ export { customer } from './customer'; export { paymentReturn } from './payment-return'; export { search } from './search'; export { payment } from './payment'; -export { navigation as dashboard, settings, plus, info }; From feeb212fd34ef003d5e873ad87c6b33ec013f733 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 3 Jun 2026 10:15:02 +0800 Subject: [PATCH 13/18] docs(premium-analytics): revert internal-packages README section Defer the internal-packages naming docs until the upstream wp-build identity change (gutenberg#78822 / #48089) lands; restore README to trunk. --- projects/packages/premium-analytics/README.md | 40 +++---------------- 1 file changed, 5 insertions(+), 35 deletions(-) diff --git a/projects/packages/premium-analytics/README.md b/projects/packages/premium-analytics/README.md index bf7ad81a5191..e3f361a44074 100644 --- a/projects/packages/premium-analytics/README.md +++ b/projects/packages/premium-analytics/README.md @@ -42,19 +42,17 @@ jetpack build packages/premium-analytics # via Jetpack CLI ### Adding a route 1. Create `routes//package.json`: - ```json { - "name": "-route", - "route": { - "path": "/", - "page": "jetpack-premium-analytics" - } + "name": "-route", + "route": { + "path": "/", + "page": "jetpack-premium-analytics" + } } ``` 2. Create `routes//stage.tsx` exporting `stage()`: - ```tsx export const stage = () =>
My new page
; ``` @@ -76,39 +74,11 @@ fixes the template or the minimum WordPress version is 7.0+. ### Init module (`packages/init/`) Serves two purposes: - 1. Sets the dashboard menu icon via `@wordpress/boot` store 2. Forces `@wordpress/build` to track `@wordpress/boot` as a module dependency — without an init module that imports boot, the build skips it -## Internal packages (`packages/*`) - -App-internal modules used only by this package — never published to npm, never -shared across the monorepo. Resolution is entirely in-tree (the local symlink); -the `@jetpack-premium-analytics/*` scope is never looked up against any registry. - -**The dual naming is structural.** `@wordpress/build` derives the import -specifier as `@/`, so the specifier here is -always `@jetpack-premium-analytics/`. The package's own `name` field has -to be different (`@automattic/jetpack-premium-analytics-`) because pnpm -rejects the `_@…` escape and the repo name lint (`lint-project-structure.sh`) -rejects the bare `@jetpack-premium-analytics/*` scope. They don't need to -match: pnpm symlinks under the **dep key**, so the import resolves regardless -of the linked package's `name`. - -Types/IDE: the `tsconfig.json` `paths` alias maps the specifier to -`./packages//src` (covered by `pnpm typecheck`). - -Build: to import one from a route or another package, add a `link:` dep on -**this package's `package.json`** (`projects/packages/premium-analytics/package.json` — -routes aren't workspace members, so the dep belongs here, not in the route's -`package.json`): - -```jsonc -"dependencies": { "@jetpack-premium-analytics/": "link:packages/" } -``` - ## File structure ``` From 2beeaa9a2c6ac17b2d050597d09229f1254bd49e Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 3 Jun 2026 10:35:23 +0800 Subject: [PATCH 14/18] fix(premium-analytics): align route name with internal-package convention Rename routes/dashboard to @automattic/jetpack-premium-analytics-dashboard-route to match the packages/* naming (per review), and drop the stale changelog line about README build docs that were reverted. Build output is unchanged (routes key off the directory name). --- .../premium-analytics/changelog/add-internal-package-resolution | 2 +- .../packages/premium-analytics/routes/dashboard/package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/packages/premium-analytics/changelog/add-internal-package-resolution b/projects/packages/premium-analytics/changelog/add-internal-package-resolution index d35865145ec1..f4343aa091ea 100644 --- a/projects/packages/premium-analytics/changelog/add-internal-package-resolution +++ b/projects/packages/premium-analytics/changelog/add-internal-package-resolution @@ -1,4 +1,4 @@ Significance: patch Type: added -Add a tsconfig paths alias and typecheck script so internal packages/* resolve for types/IDE, and document how to wire cross-package imports for the build. +Add a tsconfig paths alias and typecheck script so internal packages/* resolve for types/IDE. diff --git a/projects/packages/premium-analytics/routes/dashboard/package.json b/projects/packages/premium-analytics/routes/dashboard/package.json index e71390452278..b0139ff6987b 100644 --- a/projects/packages/premium-analytics/routes/dashboard/package.json +++ b/projects/packages/premium-analytics/routes/dashboard/package.json @@ -1,6 +1,6 @@ { "private": true, - "name": "_@jetpack-premium-analytics/dashboard-route", + "name": "@automattic/jetpack-premium-analytics-dashboard-route", "route": { "path": "/", "page": "jetpack-premium-analytics" From be20f7a786db2b6a45d9c3001d3cbeda201bb3a4 Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Wed, 3 Jun 2026 11:24:24 +0800 Subject: [PATCH 15/18] docs(premium-analytics): use canonical package name in icons README --- .../packages/premium-analytics/packages/icons/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/projects/packages/premium-analytics/packages/icons/README.md b/projects/packages/premium-analytics/packages/icons/README.md index 97fcbc54a1d0..7043dac3e24c 100644 --- a/projects/packages/premium-analytics/packages/icons/README.md +++ b/projects/packages/premium-analytics/packages/icons/README.md @@ -1,4 +1,4 @@ -# @jetpack-premium-analytics/icons +# @automattic/jetpack-premium-analytics-icons Illustrated WPDS icons used by Premium Analytics widgets and navigation. @@ -18,7 +18,7 @@ names we'd otherwise have to track across `@wordpress/icons` bumps. ```ts import { Icon } from '@wordpress/icons'; -import { calendar, search } from '@jetpack-premium-analytics/icons'; +import { calendar, search } from '@automattic/jetpack-premium-analytics-icons'; ; ``` @@ -46,5 +46,5 @@ import { calendar, search } from '@jetpack-premium-analytics/icons'; - `@wordpress/primitives` — `SVG`, `Path`, `Circle` See the parent README's "Internal packages" section for the dual-naming -convention behind the `@jetpack-premium-analytics/icons` import specifier -vs. the package's `name` field. +convention behind the `@automattic/jetpack-premium-analytics-icons` package +name vs. its temporary import specifier. From 5b6f46059243bd9d539a405062d6efdbb333668c Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 4 Jun 2026 11:10:46 +0800 Subject: [PATCH 16/18] docs(premium-analytics): fix icons README import example and viewBox claims --- .../packages/icons/README.md | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/projects/packages/premium-analytics/packages/icons/README.md b/projects/packages/premium-analytics/packages/icons/README.md index 7043dac3e24c..9253e2039502 100644 --- a/projects/packages/premium-analytics/packages/icons/README.md +++ b/projects/packages/premium-analytics/packages/icons/README.md @@ -4,8 +4,8 @@ Illustrated WPDS icons used by Premium Analytics widgets and navigation. ## Overview -13 branded multi-fill SVG illustrations (48×48 viewBox, fills driven by -`var(--wpds-color-*)` tokens). +13 branded multi-fill SVG illustrations (48×48 viewBox for most — see the +exports table, fills driven by `var(--wpds-color-*)` tokens). The illustrated icons are intentionally distinct from upstream `@wordpress/icons`, which ships 24×24 monochrome glyphs intended for @@ -18,33 +18,31 @@ names we'd otherwise have to track across `@wordpress/icons` bumps. ```ts import { Icon } from '@wordpress/icons'; -import { calendar, search } from '@automattic/jetpack-premium-analytics-icons'; +import { calendar, search } from '@jetpack-premium-analytics/icons'; ; ``` ## Exports -| Name | Source | -| --------------- | ------------------- | -| `calendar` | local (illustrated) | -| `channel` | local (illustrated) | -| `coupon` | local (illustrated) | -| `customer` | local (illustrated) | -| `device` | local (illustrated) | -| `goal` | local (illustrated) | -| `location` | local (illustrated) | -| `megaphone` | local (illustrated) | -| `payment` | local (illustrated) | -| `paymentReturn` | local (illustrated) | -| `productBlouse` | local (illustrated) | -| `reports` | local (illustrated) | -| `search` | local (illustrated) | +| Name | viewBox | +| --------------- | ----------- | +| `calendar` | `0 0 36 40` | +| `channel` | `0 0 48 48` | +| `coupon` | `0 0 48 48` | +| `customer` | `0 0 48 48` | +| `device` | `0 0 48 48` | +| `goal` | `0 0 48 48` | +| `location` | `0 0 48 49` | +| `megaphone` | `0 0 48 48` | +| `payment` | `0 0 48 48` | +| `paymentReturn` | `0 0 48 48` | +| `productBlouse` | `0 0 48 48` | +| `reports` | `0 0 24 24` | +| `search` | `0 0 48 48` | + +The viewBox variance is inherited from the upstream source as-is. ## Dependencies - `@wordpress/primitives` — `SVG`, `Path`, `Circle` - -See the parent README's "Internal packages" section for the dual-naming -convention behind the `@automattic/jetpack-premium-analytics-icons` package -name vs. its temporary import specifier. From b35572f754bdf94e9696d12279350814d86b330a Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Thu, 4 Jun 2026 11:14:35 +0800 Subject: [PATCH 17/18] docs(premium-analytics): drop per-icon size details from icons README --- .../packages/icons/README.md | 24 ++++--------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/projects/packages/premium-analytics/packages/icons/README.md b/projects/packages/premium-analytics/packages/icons/README.md index 9253e2039502..142115fc4ff0 100644 --- a/projects/packages/premium-analytics/packages/icons/README.md +++ b/projects/packages/premium-analytics/packages/icons/README.md @@ -4,8 +4,8 @@ Illustrated WPDS icons used by Premium Analytics widgets and navigation. ## Overview -13 branded multi-fill SVG illustrations (48×48 viewBox for most — see the -exports table, fills driven by `var(--wpds-color-*)` tokens). +13 branded multi-fill SVG illustrations (fills driven by +`var(--wpds-color-*)` tokens). The illustrated icons are intentionally distinct from upstream `@wordpress/icons`, which ships 24×24 monochrome glyphs intended for @@ -25,23 +25,9 @@ import { calendar, search } from '@jetpack-premium-analytics/icons'; ## Exports -| Name | viewBox | -| --------------- | ----------- | -| `calendar` | `0 0 36 40` | -| `channel` | `0 0 48 48` | -| `coupon` | `0 0 48 48` | -| `customer` | `0 0 48 48` | -| `device` | `0 0 48 48` | -| `goal` | `0 0 48 48` | -| `location` | `0 0 48 49` | -| `megaphone` | `0 0 48 48` | -| `payment` | `0 0 48 48` | -| `paymentReturn` | `0 0 48 48` | -| `productBlouse` | `0 0 48 48` | -| `reports` | `0 0 24 24` | -| `search` | `0 0 48 48` | - -The viewBox variance is inherited from the upstream source as-is. +`calendar`, `channel`, `coupon`, `customer`, `device`, `goal`, `location`, +`megaphone`, `payment`, `paymentReturn`, `productBlouse`, `reports`, +`search` ## Dependencies From 37117765210d6c1152fd2590f6135b726daa44fb Mon Sep 17 00:00:00 2001 From: Chi-Hsuan Huang Date: Fri, 5 Jun 2026 11:02:41 +0800 Subject: [PATCH 18/18] feat(premium-analytics): integrate icons stories into shared Storybook --- .../wooa7s-1314-integrate-icons-package-into-analytics | 4 ++++ projects/js-packages/storybook/storybook/projects.js | 1 + projects/packages/premium-analytics/package.json | 1 + 3 files changed, 6 insertions(+) create mode 100644 projects/js-packages/storybook/changelog/wooa7s-1314-integrate-icons-package-into-analytics diff --git a/projects/js-packages/storybook/changelog/wooa7s-1314-integrate-icons-package-into-analytics b/projects/js-packages/storybook/changelog/wooa7s-1314-integrate-icons-package-into-analytics new file mode 100644 index 000000000000..bdc3a8c71b97 --- /dev/null +++ b/projects/js-packages/storybook/changelog/wooa7s-1314-integrate-icons-package-into-analytics @@ -0,0 +1,4 @@ +Significance: patch +Type: added + +Add premium-analytics internal packages stories diff --git a/projects/js-packages/storybook/storybook/projects.js b/projects/js-packages/storybook/storybook/projects.js index f135ee0569bb..6601798f40a9 100644 --- a/projects/js-packages/storybook/storybook/projects.js +++ b/projects/js-packages/storybook/storybook/projects.js @@ -13,6 +13,7 @@ export const projects = [ 'projects/js-packages/scan/src', 'projects/js-packages/social-logos/src/react', 'projects/packages/my-jetpack/_inc/components', + 'projects/packages/premium-analytics/packages', 'projects/packages/publicize/_inc/components', 'projects/packages/search/src/dashboard/components', 'projects/packages/videopress/src/client/admin/components', diff --git a/projects/packages/premium-analytics/package.json b/projects/packages/premium-analytics/package.json index bfab5f64b609..22ec71926161 100644 --- a/projects/packages/premium-analytics/package.json +++ b/projects/packages/premium-analytics/package.json @@ -6,6 +6,7 @@ "scripts": { "build": "wp-build && mkdir -p build/modules/boot && cp shims/boot-asset.php build/modules/boot/index.min.asset.php", "build-production": "NODE_ENV=production wp-build && mkdir -p build/modules/boot && cp shims/boot-asset.php build/modules/boot/index.min.asset.php", + "storybook": "cd ../../js-packages/storybook && pnpm run storybook:dev", "typecheck": "tsgo --noEmit", "watch": "wp-build --watch" },