Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Protect Components: Use @wordpress/dataviews/wp import path (#41510)
  • Loading branch information
nateweller committed Mar 30, 2025
commit ea5282d42efa43ce5342a3d4898fe240f29514a1
3 changes: 3 additions & 0 deletions .pnpmfile.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ function fixDeps( pkg ) {
'@use-gesture/react',
'use-memo-one',
'uuid',
// Needed for storybook to build with the /wp endpoint. Normal builds don't need them due to dependency extraction.
'@wordpress/date',
'@wordpress/hooks',
] ) {
pkg.optionalDependencies[ dep ] = '*';
}
Expand Down
8 changes: 7 additions & 1 deletion pnpm-lock.yaml

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

Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
type Field,
DataViews,
filterSortAndPaginate,
} from '@wordpress/dataviews';
} from '@wordpress/dataviews/wp';
import { __, _n } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import { useCallback, useMemo, useState } from 'react';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Badge } from '@automattic/jetpack-components';
import { __, sprintf } from '@wordpress/i18n';
import { getSeverityLabel, getSeverityVariant } from '@automattic/jetpack-scan';
import { getSeverityLabel, getSeverityVariant } from '../../utils/severity.js';

const ThreatSeverityBadge = ( { severity, showLabel = false } ) => {
const title = getSeverityLabel( severity );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,15 @@ import {
type View,
DataViews,
filterSortAndPaginate,
} from '@wordpress/dataviews';
} from '@wordpress/dataviews/wp';
import { dateI18n } from '@wordpress/date';
import { __ } from '@wordpress/i18n';
import { Icon } from '@wordpress/icons';
import { useCallback, useContext, useMemo, useState } from 'react';
import {
getThreatType,
THREAT_ACTION_FIX,
THREAT_ACTION_IGNORE,
ThreatsContext,
type Threat,
} from '@automattic/jetpack-scan';
import { THREAT_ACTION_FIX, THREAT_ACTION_IGNORE } from '../../actions/index.js';
import { ThreatsContext } from '../../context/index.js';
import { type Threat } from '../../types/threats.js';
import { getThreatType } from '../../utils/threats.js';
import ThreatFixerButton from '../threat-fixer-button/index.js';
import ThreatDetailsModal from '../threat-modals/details-modal/index.js';
import ThreatFixerModal from '../threat-modals/fixer-modal/index.js';
Expand Down

This file was deleted.

1 change: 1 addition & 0 deletions projects/js-packages/scan/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"extends": "jetpack-js-tools/tsconfig.tsc.json",
"include": [ "./src/**/*" ],
"exclude": [ "**/test/**", "**/stories/**" ],
"compilerOptions": {
"typeRoots": [ "./node_modules/@types/", "src/*" ],
"sourceMap": false,
Expand Down
47 changes: 45 additions & 2 deletions projects/plugins/protect/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,56 @@ module.exports = [
* @see https://github.com/Automattic/jetpack/issues/39907
*/
jetpackWebpackConfig.TranspileRule( {
includeNodeModules: [ '@wordpress/dataviews/' ],
includeNodeModules: [ '@wordpress/dataviews/build-wp/' ],
babelOpts: {
configFile: false,
plugins: [
[
require.resolve( '@automattic/babel-plugin-replace-textdomain' ),
{ textdomain: 'jetpack-protect' },
{
textdomain: 'jetpack-protect',
functions: {
__: 1,
__1: 1,
__2: 1,
__3: 1,
__4: 1,
__5: 1,
__6: 1,
__7: 1,
__8: 1,
__9: 1,
__10: 1,
__11: 1,
__12: 1,
__13: 1,
__14: 1,
__15: 1,
__16: 1,
__17: 1,
__18: 1,
__19: 1,
__20: 1,
__21: 1,
__22: 1,
__23: 1,
__24: 1,
__25: 1,
__26: 1,
__27: 1,
__28: 1,
__29: 1,
__30: 1,
_x: 2,
_x1: 2,
_x2: 2,
_x3: 2,
_x4: 2,
_x5: 2,
_n: 3,
_nx: 4,
},
},
],
],
},
Expand Down
Loading