Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
3daeaf0
Scan: scaffold packages/scan with shell + data layer (Phase 0)
ilonagl May 1, 2026
582fd6a
Scan: fix changelog entry type for plugins/jetpack
ilonagl May 1, 2026
1fd8e9a
Scan: wire WPCOM bridges + tabbed Active/History overview (Phase 1)
ilonagl May 1, 2026
4caad3f
Scan: fix CHANGELOG.md format
ilonagl May 1, 2026
5719670
Scan: switch tabs to @wordpress/ui Tabs.Root pattern
ilonagl May 1, 2026
4e23775
Scan: defer empty state to ThreatsDataViews
ilonagl May 1, 2026
6af458c
Scan: Forms-style empty state for Active threats / History tabs
ilonagl May 1, 2026
ecd9b2e
Scan: full-page tab panels + DataViews padding aligned with tab nav
ilonagl May 1, 2026
4203cc2
Scan: wire fix / ignore / unignore row actions (Phase 3)
ilonagl May 1, 2026
42f7627
Scan: bulk-fix modal + Auto-fix N header CTA (Phase 4)
ilonagl May 1, 2026
97b62a7
Scan: add Scan-now CTA + in-progress status (Phase 5)
ilonagl May 1, 2026
badc406
Scan: suppress wp-admin notice channels on the Scan page (Phase 6)
ilonagl May 1, 2026
36d7899
Scan: wire jetpack_scan_* Tracks events (Phase 7)
ilonagl May 1, 2026
ee4c048
Scan: scaffold PHPUnit + Jest test surface (Phase 8)
ilonagl May 1, 2026
c8170cc
Scan: fill viewport + pin footer via jetpack-admin-page-layout
ilonagl May 1, 2026
ab3ec04
Scan: switch page layout to Newsletter pattern (#48420 phase 3)
ilonagl May 1, 2026
a708424
Scan: fill viewport so DataViews centers its empty state
ilonagl May 1, 2026
2a02953
Scan: fix stylelint string-quotes in tabpanel selector
ilonagl May 1, 2026
1440e84
Scan: port Phase 3 row-action modals (fix / ignore / unignore)
ilonagl May 1, 2026
431b543
Scan: anchor ThreatsDataViews empty body to viewport height
ilonagl May 1, 2026
454126a
Scan: anchor .admin-ui-page to viewport so footer sits at the bottom
ilonagl May 1, 2026
05fe266
Scan: migrate page build pipeline from webpack to @wordpress/build
ilonagl May 1, 2026
1f906db
Scan: address P2 review feedback (auth modes, fix-status error states)
ilonagl May 1, 2026
56ae16e
Scan: address P1 review feedback (composer hook, clean-checkout build…
ilonagl May 1, 2026
6857421
Scan: fix wp-build render-function name (the actual cause of the blan…
ilonagl May 1, 2026
1c36a13
Scan: enrich mock fixtures with realistic threat spread
ilonagl May 1, 2026
1d9b6d8
Scan: hide the redundant in-table status toggle
ilonagl May 1, 2026
2995421
Scan: walk the full workspace dep graph in build:deps
ilonagl May 2, 2026
fe4ad69
Scan: migrate modals from @wordpress/components to @wordpress/ui
ilonagl May 2, 2026
cbd3db0
Scan: Phase 4 — port the view-details row-action modal
ilonagl May 2, 2026
190a69f
Scan: wire DataViews-canonical Tracks events
ilonagl May 2, 2026
a3df711
Scan: persist DataViews view state across reloads
ilonagl May 2, 2026
e54fa06
Scan: consolidate AGENTS.md against current package shape
ilonagl May 2, 2026
4d8e519
Revert "Scan: consolidate AGENTS.md against current package shape"
ilonagl May 2, 2026
e960230
Scan: refresh lockfiles for scan-page after rebase
dhasilva May 5, 2026
08f997b
Scan: cover routes/ under tsconfig and import-deps lint
dhasilva May 5, 2026
84546fb
Scan: address P3 review — wrap shared AdminPage + @wordpress/ui primi…
dhasilva May 6, 2026
7b764e2
Scan: drop js-package build step in favor of source-exports
dhasilva May 6, 2026
ac84c96
fix lockfile
dhasilva May 6, 2026
2fb2c16
Scan: drop composer build/watch scripts for source-exports js-package
dhasilva May 6, 2026
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
49 changes: 48 additions & 1 deletion eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,51 @@
import fs from 'node:fs';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import autoProjects from 'jetpack-js-tools/eslintrc/auto-projects.mjs';
import { makeBaseConfig, defineConfig } from 'jetpack-js-tools/eslintrc/base.mjs';

export default defineConfig( makeBaseConfig( import.meta.url ), autoProjects );
const rootdir = fileURLToPath( new URL( '.', import.meta.url ) );

/**
* `projects/packages/scan` uses nested `routes/<name>/package.json` for wp-build.
* Root ESLint skips per-project configs; merge those deps for import/no-extraneous-dependencies.
*
* @return {string[]} Absolute paths of route folders that contain a `package.json`.
*/
function getJetpackScanRoutePackageDirs() {
const routesRoot = path.join( rootdir, 'projects/packages/scan/routes' );
if ( ! fs.existsSync( routesRoot ) ) {
return [];
}
return fs
.readdirSync( routesRoot, { withFileTypes: true } )
.filter( dirent => dirent.isDirectory() )
.map( dirent => path.join( routesRoot, dirent.name ) )
.filter( dir => fs.existsSync( path.join( dir, 'package.json' ) ) );
}

const jetpackScanRoutePackageDirs = getJetpackScanRoutePackageDirs();

export default defineConfig(
makeBaseConfig( import.meta.url ),
autoProjects,
...( jetpackScanRoutePackageDirs.length > 0
? [
{
name: 'Jetpack Scan (wp-build routes): merge route package.json for import deps',
files: [ 'projects/packages/scan/routes/**/*.{js,jsx,ts,tsx,mjs,cjs}' ],
rules: {
'import/no-extraneous-dependencies': [
'error',
{
packageDir: [
path.join( rootdir, 'projects/packages/scan' ),
...jetpackScanRoutePackageDirs,
],
},
],
},
},
]
: [] )
);
120 changes: 97 additions & 23 deletions pnpm-lock.yaml

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

4 changes: 4 additions & 0 deletions projects/js-packages/scan/changelog/add-empty-prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

Add an optional `empty` prop to `ThreatsDataViews` that's forwarded to the underlying `DataViews` so consumers can render their own empty-state node (heading, body, CTA) instead of DataViews' built-in "no items" body.
4 changes: 4 additions & 0 deletions projects/js-packages/scan/changelog/add-on-track-event-prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

`ThreatsDataViews`: add `onTrackEvent?: ( event: string, properties?: Record< string, unknown > ) => void` prop. When supplied, the component fires DataViews-canonical event names on view transitions (`search` with `{ has_query }`, `layout_changed` with `{ layout }`, `page_change` with `{ page }`, `filter_change`, and a generic `view_change`) by diffing the previous view against the next one in `onChangeView`. Consumers add their own prefix (e.g. `jetpack_scan_*`, `jetpack_protect_*`) and forward to their analytics client. Backwards compatible — when `onTrackEvent` is omitted no events fire.
4 changes: 4 additions & 0 deletions projects/js-packages/scan/changelog/add-persist-key-prop
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

`ThreatsDataViews`: add `persistKey?: string` prop. When set, the component hydrates its initial view (filters, sort, search, pagination, layout) from `localStorage[persistKey]` and writes back on every change. Use stable, namespaced keys per panel (e.g. `jetpack-scan:active-threats:view`) so consumer panels don't collide. Quietly no-ops when `localStorage` is unavailable (privacy mode, full disk).
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

`ThreatsDataViews`: add `RenderViewModal?: ( props: RenderModalProps< Threat > ) => ReactElement` prop. Unlike the existing `RenderFixModal` / `RenderIgnoreModal` / `RenderUnignoreModal`, the resulting "View details" row action is always eligible (not gated by `fixable` / `status`) so the user can drill into any row regardless of state. Renders inside a `large` DataViews modal.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: added

`ThreatsDataViews`: add `showStatusFilter?: boolean` prop (defaults to `true`). Lets consumers that already filter the dataset by status outside the component (e.g. page-level Active threats / History tabs in Scan) opt out of the in-table active/historic toggle. Existing callers (Protect) keep the toggle by default.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: added

`ThreatsDataViews`: accept `RenderFixModal` / `RenderIgnoreModal` / `RenderUnignoreModal` props so consumers can route the row actions through DataViews-managed confirmation modals (`RenderModalProps< Threat >`) instead of fire-and-forget callbacks. The existing `onFixThreats` / `onIgnoreThreats` / `onUnignoreThreats` callbacks are still honoured when no render-modal is supplied; render-modal props take precedence when both are passed for the same action.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

`ThreatsDataViews`: anchor the DataViews empty body (`.dataviews-no-results`) to `calc(100vh - 320px)` so it always reads as a full-height empty state. The internal `.dataviews-no-results` element already grows via `flex-grow: 1`, but only when its parent has a defined height — pinning the min-block-size from inside the component means consumers (Scan page, Protect) get the full-height layout without having to wire a custom flex chain.
4 changes: 4 additions & 0 deletions projects/js-packages/scan/changelog/drop-build-step
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Switch the package to source-exports (mirrors `@automattic/jetpack-connection`): consumers resolve `@automattic/jetpack-scan` directly to `./src/index.ts`, so `tsgo` compile is no longer needed. `@wordpress/build` (esbuild) consumers process the TS + `*.module.scss` natively; webpack consumers (Protect plugin) keep working through the same `jetpack:src` resolution condition the rest of the monorepo already uses.
10 changes: 0 additions & 10 deletions projects/js-packages/scan/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@
"license": "GPL-2.0-or-later",
"require": {},
"scripts": {
"build-development": [
"pnpm run build"
],
"build-production": [
"NODE_ENV=production BABEL_ENV=production pnpm run build"
],
"watch": [
"Composer\\Config::disableProcessTimeout",
"pnpm run watch"
],
"test-coverage": "pnpm run test-coverage",
"test-js": [
"pnpm run test"
Expand Down
15 changes: 5 additions & 10 deletions projects/js-packages/scan/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,15 @@
},
"license": "GPL-2.0-or-later",
"author": "Automattic",
"sideEffects": [
"*.css",
"*.scss"
],
"type": "module",
"exports": {
".": {
"jetpack:src": "./src/index.ts",
"types": "./build/index.d.ts",
"default": "./build/index.js"
}
".": "./src/index.ts"
},
"main": "./build/index.js",
"types": "./build/index.d.ts",
"scripts": {
"build": "pnpm run clean && pnpm run compile-ts",
"clean": "rm -rf build/",
"compile-ts": "tsgo --pretty",
"test": "NODE_OPTIONS=--experimental-vm-modules jest",
"test-coverage": "pnpm run test --coverage",
"typecheck": "tsgo --noEmit"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ export const THREAT_FIELD_AUTO_FIX = 'auto-fix';
export const THREAT_ACTION_FIX = 'fix';
export const THREAT_ACTION_IGNORE = 'ignore';
export const THREAT_ACTION_UNIGNORE = 'unignore';
export const THREAT_ACTION_VIEW = 'view';
Loading
Loading