Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 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
38 changes: 38 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.
27 changes: 22 additions & 5 deletions projects/packages/premium-analytics/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { makeBaseConfig, defineConfig } from 'jetpack-js-tools/eslintrc/base.mjs';

/**
* Soften JSDoc rules for `packages/datetime/**` and `packages/formatters/**`
* so the initial ports can land with the upstream JSDoc style (descriptions
* on the function body, not on per-param tags). Temporary — backfill proper
* JSDoc on the helpers and remove these overrides (at which point this whole
* file can go away).
* Soften JSDoc rules for the internal `packages/*` ports so the initial
* ports can land with the upstream JSDoc style (descriptions on the
* function body, not on per-param tags). Temporary — backfill proper
* descriptions on the helpers and remove these overrides (at which point
* this whole file can go away).
*/
export default defineConfig(
makeBaseConfig( import.meta.url ),
Expand All @@ -27,5 +27,22 @@ export default defineConfig(
'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: {
'jsdoc/require-description': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/require-param-description': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/check-indentation': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'import/no-extraneous-dependencies': 'off',
Comment thread
chihsuan marked this conversation as resolved.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] Disabling import/no-extraneous-dependencies for the whole packages/data/** block silences more than the react false-positive the comment describes — it also masks any genuinely undeclared dependency in the ported code. Since this override is already documented as temporary, consider narrowing it (scope the off-rule to the specific files that trip the false-positive, or leave a TODO to re-enable once the leaf manifest becomes load-bearing) so a real missing dep can't slip through unnoticed.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a TODO to re-enable. Full narrowing stays with the JSDoc/leaf-deps follow-up.

},
}
);
8 changes: 8 additions & 0 deletions projects/packages/premium-analytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"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",
"test": "jest --config=tests/jest.config.cjs",
"typecheck": "tsgo --noEmit",
"watch": "wp-build --watch"
},
Expand All @@ -32,25 +33,32 @@
"dependencies": {
"@automattic/number-formatters": "workspace:*",
"@date-fns/tz": "1.4.1",
"@tanstack/react-query": "5.90.8",
"@wordpress/api-fetch": "7.48.0",
"@wordpress/boot": "0.14.1",
"@wordpress/core-data": "7.48.0",
"@wordpress/data": "10.48.0",
"@wordpress/i18n": "^6.9.0",
"@wordpress/icons": "^13.0.0",
"@wordpress/primitives": "4.48.0",
"@wordpress/route": "0.13.1",
"@wordpress/url": "4.48.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",
"@storybook/react": "10.3.6",
"@tanstack/react-query-devtools": "5.90.2",
"@testing-library/dom": "10.4.1",
"@types/jest": "30.0.0",
"@typescript/native-preview": "7.0.0-dev.20260225.1",
"@wordpress/build": "0.14.0",
"@wordpress/ui": "0.13.0",
"browserslist": "4.28.2",
"jest": "30.4.2",
"storybook": "10.3.6",
"typescript": "5.9.3"
}
Expand Down
Loading
Loading