Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions projects/packages/premium-analytics/babel.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
presets: [
[
'@automattic/jetpack-webpack-config/babel/preset',
{ pluginReplaceTextdomain: { textdomain: 'jetpack-premium-analytics' } },
],
],
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

Port data package (React Query report hooks, fetchers, and processing) as an internal package from next-woocommerce-analytics.
36 changes: 25 additions & 11 deletions projects/packages/premium-analytics/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
import { makeBaseConfig, defineConfig } from 'jetpack-js-tools/eslintrc/base.mjs';

/**
* Soften JSDoc rules for `packages/datetime/**` so the initial port can
* land. Temporary — backfill proper descriptions on the helpers and
* remove this override (at which point this whole file can go away).
* Soften JSDoc rules for the internal `packages/*` ports so the initial
* ports can land. Temporary — backfill proper descriptions on the helpers
* and remove this override (at which point this whole file can go away).
*/
export default defineConfig( makeBaseConfig( import.meta.url ), {
files: [ 'packages/datetime/**' ],
rules: {
'jsdoc/require-description': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/check-indentation': 'off',
export default defineConfig(
makeBaseConfig( import.meta.url ),
{
files: [ 'packages/datetime/**', 'packages/data/**' ],
rules: {
'jsdoc/require-description': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/check-indentation': 'off',
},
},
} );
{
// The data port carries a couple of upstream patterns this temporary
// override keeps as-is: intentional `any` escapes for the generic report
// `TData` (see use-report.ts), and `react` flagged as extraneous because
// the internal package's deps are declared on the parent manifest.
files: [ 'packages/data/**' ],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'import/no-extraneous-dependencies': 'off',
},
}
);
11 changes: 10 additions & 1 deletion projects/packages/premium-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
"test": "jest --config=tests/jest.config.cjs",
"typecheck": "tsgo --noEmit",
"watch": "wp-build --watch"
},
Expand All @@ -30,19 +31,27 @@
},
"dependencies": {
"@date-fns/tz": "1.4.1",
"@tanstack/react-query": "5.90.8",
"@wordpress/api-fetch": "7.46.0",
"@wordpress/boot": "0.13.0",
"@wordpress/core-data": "7.46.0",
"@wordpress/data": "10.46.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^13.0.0",
"@wordpress/route": "0.12.0",
"@wordpress/url": "4.46.0",
"date-fns": "4.1.0",
"react": "18.3.1",
"react-dom": "18.3.1"
},
"devDependencies": {
"@automattic/jetpack-webpack-config": "workspace:*",
"@babel/core": "7.29.0",
"@tanstack/react-query-devtools": "5.90.2",
"@types/jest": "30.0.0",
"@typescript/native-preview": "7.0.0-dev.20260225.1",
"@wordpress/build": "0.14.0",
"browserslist": "4.28.2"
"browserslist": "4.28.2",
"jest": "30.4.2"
}
}
Loading
Loading