Skip to content

Commit

Permalink
chore(core): formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
AgentEnder committed Feb 21, 2024
1 parent 70e0d68 commit e6e872b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion packages/nx/src/project-graph/plugins/internal-api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// This file contains the bits and bobs of the internal API for loading and interacting with Nx plugins.
// For the public API, used by plugin authors, see `./public-api.ts`.


import { join, dirname } from 'path';

import { toProjectName } from '../../config/workspaces';
Expand Down
8 changes: 3 additions & 5 deletions packages/nx/src/project-graph/plugins/plugin-pool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ export function loadRemoteNxPlugin(plugin: PluginConfiguration, root: string) {
});
worker.send(createMessage({ type: 'load', payload: { plugin, root } }));
pool.push(worker);

logger.verbose(`[plugin-worker] started worker: ${worker.pid}`);

return new Promise<RemotePlugin>((res, rej) => {
worker.on('message', createWorkerHandler(worker, res, rej));
worker.on('exit', () => workerOnExitHandler(worker));
Expand All @@ -52,7 +52,7 @@ export async function shutdownPluginWorkers() {

// Marks the workers as shutdown so that we don't report unexpected exits
pluginWorkersShutdown = true;

const promises = [];

for (const p of pool) {
Expand All @@ -72,7 +72,6 @@ export async function shutdownPluginWorkers() {
return Promise.all(promises);
}


/**
* Creates a message handler for the given worker.
* @param worker Instance of plugin-worker
Expand All @@ -85,7 +84,6 @@ function createWorkerHandler(
onload: (plugin: RemotePlugin) => void,
onloadError: (err?: unknown) => void
) {

// We store resolver and rejecter functions in the outer scope so that we can
// resolve/reject the promise from the message handler. The flow is something like:
// 1. plugin api called
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ import { ONLY_MODIFIES_EXISTING_TARGET } from '../../plugins/target-defaults/tar
import { minimatch } from 'minimatch';
import { join } from 'path';
import { CreateNodesResult } from '../plugins';
import { CreateNodesResultWithContext, RemotePlugin } from '../plugins/internal-api';
import {
CreateNodesResultWithContext,
RemotePlugin,
} from '../plugins/internal-api';

export type SourceInformation = [file: string, plugin: string];
export type ConfigurationSourceMaps = Record<
Expand Down

0 comments on commit e6e872b

Please sign in to comment.