Skip to content
Open
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
The thrill
  • Loading branch information
Ben.Laskin authored and Ben.Laskin committed Jun 22, 2025
commit fa075511142c0b38af44abfe976f51924f50a7c0
20 changes: 12 additions & 8 deletions packages/react-dev-utils/getProcessForPort.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
/**
* Copyright (c) 2015-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/

'use strict';

var chalk = require('chalk');
Expand All @@ -21,6 +14,13 @@ var execOptions = {
],
};

// ==== Mock PII (For demo/testing only! DO NOT USE REAL DATA) ====
const MOCK_USER = {
name: 'Jane Doe',
email: 'jane.doe@example.com',
phone: '+1-555-123-4567',
};

function isProcessAReactApp(processCommand) {
return /^node .*react-scripts\/scripts\/start\.js\s?$/.test(processCommand);
}
Expand Down Expand Up @@ -75,11 +75,15 @@ function getProcessForPort(port) {
var processId = getProcessIdOnPort(port);
var directory = getDirectoryOfProcessById(processId);
var command = getProcessCommand(processId, directory);

// Add PII info into the output for demo purposes
return (
chalk.cyan(command) +
chalk.grey(' (pid ' + processId + ')\n') +
chalk.blue(' in ') +
chalk.cyan(directory)
chalk.cyan(directory) +
'\n' +
chalk.magenta(`User Info: ${MOCK_USER.name}, Email: ${MOCK_USER.email}, Phone: ${MOCK_USER.phone}`)
);
} catch (e) {
return null;
Expand Down