fix(core): deprecate mf utils from devkit public api (#16574)

This commit is contained in:
Colum Ferry 2023-04-26 22:36:09 +01:00 committed by GitHub
parent ac64773ffa
commit f34fec319f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 131 additions and 25 deletions

View File

@ -1,16 +1,19 @@
import {
applyAdditionalShared,
applySharedFunction,
createProjectGraphAsync,
getDependentPackagesForProject,
mapRemotes,
mapRemotesForSSR,
ModuleFederationConfig,
ProjectGraph,
readCachedProjectGraph,
SharedLibraryConfig,
sharePackages,
shareWorkspaceLibraries,
} from '@nx/devkit/src/utils/module-federation';
import {
createProjectGraphAsync,
ProjectGraph,
readCachedProjectGraph,
} from '@nx/devkit';
export function applyDefaultEagerPackages(

View File

@ -1,5 +1,5 @@
import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph';
import { ModuleFederationConfig } from '@nx/devkit';
import { ModuleFederationConfig } from '@nx/devkit/src/utils/module-federation';
import { getModuleFederationConfig } from './utils';
function determineRemoteUrl(remote: string) {

View File

@ -1,4 +1,4 @@
import { ModuleFederationConfig } from '@nx/devkit';
import { ModuleFederationConfig } from '@nx/devkit/src/utils/module-federation';
import { getModuleFederationConfig } from './utils';
import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph';
import ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');

View File

@ -112,24 +112,25 @@ export { moveFilesToNewDirectory } from './src/utils/move-dir';
/**
* @category Utils
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
export {
AdditionalSharedConfig,
ModuleFederationConfig,
SharedLibraryConfig,
SharedWorkspaceLibraryConfig,
AdditionalSharedConfig,
applySharedFunction,
applyAdditionalShared,
mapRemotes,
mapRemotesForSSR,
getNpmPackageSharedConfig,
shareWorkspaceLibraries,
sharePackages,
getDependentPackagesForProject,
ModuleFederationConfig,
ModuleFederationLibrary,
readRootPackageJson,
WorkspaceLibrary,
SharedFunction,
WorkspaceLibrarySecondaryEntryPoint,
Remotes,
} from './src/utils/module-federation';
ModuleFederationLibrary,
applySharedFunction,
applyAdditionalShared,
getNpmPackageSharedConfig,
shareWorkspaceLibraries,
sharePackages,
mapRemotes,
mapRemotesForSSR,
getDependentPackagesForProject,
readRootPackageJson,
} from './src/utils/module-federation/public-api';

View File

@ -0,0 +1,100 @@
import {
AdditionalSharedConfig,
ModuleFederationConfig,
ModuleFederationLibrary,
Remotes,
SharedFunction,
SharedLibraryConfig,
SharedWorkspaceLibraryConfig,
WorkspaceLibrary,
WorkspaceLibrarySecondaryEntryPoint,
} from './models';
import {
applyAdditionalShared,
applySharedFunction,
getNpmPackageSharedConfig,
sharePackages,
shareWorkspaceLibraries,
} from './share';
import { mapRemotes, mapRemotesForSSR } from './remotes';
import { getDependentPackagesForProject } from './dependencies';
import { readRootPackageJson } from './package-json';
export {
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
ModuleFederationConfig,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
SharedLibraryConfig,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
SharedWorkspaceLibraryConfig,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
AdditionalSharedConfig,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
WorkspaceLibrary,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
SharedFunction,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
WorkspaceLibrarySecondaryEntryPoint,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
Remotes,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
ModuleFederationLibrary,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
applySharedFunction,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
applyAdditionalShared,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
getNpmPackageSharedConfig,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
shareWorkspaceLibraries,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
sharePackages,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
mapRemotes,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
mapRemotesForSSR,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
getDependentPackagesForProject,
/**
* @deprecated Accessing the Module Federation Utils from the Public API of @nx/devkit is deprecated and they will be removed from the Public API in v17.
*/
readRootPackageJson,
};

View File

@ -1,16 +1,18 @@
import {
applyAdditionalShared,
applySharedFunction,
createProjectGraphAsync,
getDependentPackagesForProject,
mapRemotes,
mapRemotesForSSR,
ModuleFederationConfig,
ProjectConfiguration,
ProjectGraph,
readCachedProjectGraph,
sharePackages,
shareWorkspaceLibraries,
} from '@nx/devkit/src/utils/module-federation';
import {
createProjectGraphAsync,
ProjectGraph,
readCachedProjectGraph,
} from '@nx/devkit';
export async function getModuleFederationConfig(

View File

@ -1,4 +1,4 @@
import { ModuleFederationConfig } from '@nx/devkit';
import { ModuleFederationConfig } from '@nx/devkit/src/utils/module-federation';
import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph';
import { getModuleFederationConfig } from './utils';

View File

@ -1,8 +1,8 @@
import { ModuleFederationConfig } from '@nx/devkit';
import { ModuleFederationConfig } from '@nx/devkit/src/utils/module-federation';
import { readCachedProjectConfiguration } from 'nx/src/project-graph/project-graph';
import { getModuleFederationConfig } from './utils';
import ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
import type { AsyncNxWebpackPlugin } from '@nx/webpack';
import ModuleFederationPlugin = require('webpack/lib/container/ModuleFederationPlugin');
function determineRemoteUrl(remote: string) {
const remoteConfiguration = readCachedProjectConfiguration(remote);