@nx/devkit 16.8.1 → 16.9.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/migrations.json +6 -0
- package/package.json +3 -3
- package/public-api.d.ts +0 -5
- package/public-api.js +1 -15
- package/src/executors/parse-target-string.d.ts +13 -0
- package/src/executors/parse-target-string.js +13 -2
- package/src/executors/read-target-options.js +3 -0
- package/src/migrations/update-16-9-0/migrate-mf-util-usage.d.ts +4 -0
- package/src/migrations/update-16-9-0/migrate-mf-util-usage.js +201 -0
- package/src/utils/module-federation/dependencies.d.ts +0 -6
- package/src/utils/module-federation/dependencies.js +0 -45
- package/src/utils/module-federation/index.d.ts +0 -5
- package/src/utils/module-federation/index.js +0 -8
- package/src/utils/module-federation/models/index.d.ts +0 -39
- package/src/utils/module-federation/models/index.js +0 -2
- package/src/utils/module-federation/package-json.d.ts +0 -8
- package/src/utils/module-federation/package-json.js +0 -14
- package/src/utils/module-federation/public-api.d.ts +0 -78
- package/src/utils/module-federation/public-api.js +0 -16
- package/src/utils/module-federation/remotes.d.ts +0 -19
- package/src/utils/module-federation/remotes.js +0 -58
- package/src/utils/module-federation/secondary-entry-points.d.ts +0 -12
- package/src/utils/module-federation/secondary-entry-points.js +0 -107
- package/src/utils/module-federation/share.d.ts +0 -48
- package/src/utils/module-federation/share.js +0 -184
- package/src/utils/module-federation/typescript.d.ts +0 -4
- package/src/utils/module-federation/typescript.js +0 -50
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
[]()
|
|
9
9
|
[](http://commitizen.github.io/cz-cli/)
|
|
10
10
|
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
11
|
-
[](https://go.nx.dev/community)
|
|
12
12
|
|
|
13
13
|
</div>
|
|
14
14
|
|
package/migrations.json
CHANGED
|
@@ -5,6 +5,12 @@
|
|
|
5
5
|
"version": "16.0.0-beta.1",
|
|
6
6
|
"description": "Replace @nrwl/devkit with @nx/devkit",
|
|
7
7
|
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
|
|
8
|
+
},
|
|
9
|
+
"update-16-9-0-migrate-mf-usage-to-webpack": {
|
|
10
|
+
"cli": "nx",
|
|
11
|
+
"version": "16.9.0-beta.1",
|
|
12
|
+
"description": "Replace imports of Module Federation utils frm @nx/devkit to @nx/webpack",
|
|
13
|
+
"implementation": "./src/migrations/update-16-9-0/migrate-mf-util-usage"
|
|
8
14
|
}
|
|
9
15
|
},
|
|
10
16
|
"packageJsonUpdates": {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/devkit",
|
|
3
|
-
"version": "16.
|
|
3
|
+
"version": "16.9.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Devkit is used to customize Nx for different technologies and use cases. It contains many utility functions for reading and writing files, updating configuration, working with Abstract Syntax Trees(ASTs), and more.",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://nx.dev",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@nrwl/devkit": "16.
|
|
31
|
+
"@nrwl/devkit": "16.9.0-beta.1",
|
|
32
32
|
"ejs": "^3.1.7",
|
|
33
33
|
"enquirer": "~2.3.6",
|
|
34
34
|
"ignore": "^5.0.4",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"migrations": "./migrations.json"
|
|
47
47
|
},
|
|
48
48
|
"type": "commonjs",
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "5056d6cefb2949ba865019e8b71e633fba28c091"
|
|
50
50
|
}
|
package/public-api.d.ts
CHANGED
|
@@ -76,8 +76,3 @@ export { convertNxExecutor } from './src/utils/convert-nx-executor';
|
|
|
76
76
|
* @category Utils
|
|
77
77
|
*/
|
|
78
78
|
export { moveFilesToNewDirectory } from './src/utils/move-dir';
|
|
79
|
-
/**
|
|
80
|
-
* @category Utils
|
|
81
|
-
* @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.
|
|
82
|
-
*/
|
|
83
|
-
export { AdditionalSharedConfig, ModuleFederationConfig, SharedLibraryConfig, SharedWorkspaceLibraryConfig, WorkspaceLibrary, SharedFunction, WorkspaceLibrarySecondaryEntryPoint, Remotes, ModuleFederationLibrary, applySharedFunction, applyAdditionalShared, getNpmPackageSharedConfig, shareWorkspaceLibraries, sharePackages, mapRemotes, mapRemotesForSSR, getDependentPackagesForProject, readRootPackageJson, } from './src/utils/module-federation/public-api';
|
package/public-api.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* a. We might need to duplicate code instead of importing from nx until all supported versions of nx contain the file.
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.moveFilesToNewDirectory = exports.convertNxExecutor = exports.convertNxGenerator = exports.offsetFromRoot = exports.ChangeType = exports.applyChangesToString = exports.extractLayoutDirectory = exports.getWorkspaceLayout = exports.names = exports.installPackagesTask = exports.NX_VERSION = exports.removeDependenciesFromPackageJson = exports.ensurePackage = exports.addDependenciesToPackageJson = exports.readTargetOptions = exports.targetToTargetString = exports.parseTargetString = exports.visitNotIgnoredFiles = exports.runTasksInSerial = exports.updateTsConfigsToJs = exports.toJS = exports.generateFiles = exports.formatFiles = void 0;
|
|
13
13
|
/**
|
|
14
14
|
* @category Generators
|
|
15
15
|
*/
|
|
@@ -98,17 +98,3 @@ Object.defineProperty(exports, "convertNxExecutor", { enumerable: true, get: fun
|
|
|
98
98
|
*/
|
|
99
99
|
var move_dir_1 = require("./src/utils/move-dir");
|
|
100
100
|
Object.defineProperty(exports, "moveFilesToNewDirectory", { enumerable: true, get: function () { return move_dir_1.moveFilesToNewDirectory; } });
|
|
101
|
-
/**
|
|
102
|
-
* @category Utils
|
|
103
|
-
* @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.
|
|
104
|
-
*/
|
|
105
|
-
var public_api_1 = require("./src/utils/module-federation/public-api");
|
|
106
|
-
Object.defineProperty(exports, "applySharedFunction", { enumerable: true, get: function () { return public_api_1.applySharedFunction; } });
|
|
107
|
-
Object.defineProperty(exports, "applyAdditionalShared", { enumerable: true, get: function () { return public_api_1.applyAdditionalShared; } });
|
|
108
|
-
Object.defineProperty(exports, "getNpmPackageSharedConfig", { enumerable: true, get: function () { return public_api_1.getNpmPackageSharedConfig; } });
|
|
109
|
-
Object.defineProperty(exports, "shareWorkspaceLibraries", { enumerable: true, get: function () { return public_api_1.shareWorkspaceLibraries; } });
|
|
110
|
-
Object.defineProperty(exports, "sharePackages", { enumerable: true, get: function () { return public_api_1.sharePackages; } });
|
|
111
|
-
Object.defineProperty(exports, "mapRemotes", { enumerable: true, get: function () { return public_api_1.mapRemotes; } });
|
|
112
|
-
Object.defineProperty(exports, "mapRemotesForSSR", { enumerable: true, get: function () { return public_api_1.mapRemotesForSSR; } });
|
|
113
|
-
Object.defineProperty(exports, "getDependentPackagesForProject", { enumerable: true, get: function () { return public_api_1.getDependentPackagesForProject; } });
|
|
114
|
-
Object.defineProperty(exports, "readRootPackageJson", { enumerable: true, get: function () { return public_api_1.readRootPackageJson; } });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Target } from 'nx/src/command-line/run/run';
|
|
2
2
|
import type { ProjectGraph } from 'nx/src/config/project-graph';
|
|
3
|
+
import type { ExecutorContext } from 'nx/src/devkit-exports';
|
|
3
4
|
/**
|
|
4
5
|
* @deprecated(v17) A project graph should be passed to parseTargetString for best accuracy.
|
|
5
6
|
*/
|
|
@@ -16,6 +17,18 @@ export declare function parseTargetString(targetString: string): Target;
|
|
|
16
17
|
* @param targetString - target reference
|
|
17
18
|
*/
|
|
18
19
|
export declare function parseTargetString(targetString: string, projectGraph: ProjectGraph): Target;
|
|
20
|
+
/**
|
|
21
|
+
* Parses a target string into {project, target, configuration}. Passing a full
|
|
22
|
+
* {@link ExecutorContext} enables the targetString to reference the current project.
|
|
23
|
+
*
|
|
24
|
+
* Examples:
|
|
25
|
+
* ```typescript
|
|
26
|
+
* parseTargetString("test", executorContext) // returns { project: "proj", target: "test" }
|
|
27
|
+
* parseTargetString("proj:test", executorContext) // returns { project: "proj", target: "test" }
|
|
28
|
+
* parseTargetString("proj:test:production", executorContext) // returns { project: "proj", target: "test", configuration: "production" }
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseTargetString(targetString: string, ctx: ExecutorContext): Target;
|
|
19
32
|
/**
|
|
20
33
|
* Returns a string in the format "project:target[:configuration]" for the target
|
|
21
34
|
*
|
|
@@ -2,10 +2,15 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.targetToTargetString = exports.parseTargetString = void 0;
|
|
4
4
|
const nx_1 = require("../../nx");
|
|
5
|
-
let { readCachedProjectGraph, splitTarget } = (0, nx_1.requireNx)();
|
|
5
|
+
let { readCachedProjectGraph, splitTarget, splitByColons } = (0, nx_1.requireNx)();
|
|
6
6
|
// TODO: Remove this in Nx 18 when Nx 16.7.0 is no longer supported
|
|
7
7
|
splitTarget = splitTarget ?? require('nx/src/utils/split-target').splitTarget;
|
|
8
|
-
|
|
8
|
+
splitByColons =
|
|
9
|
+
splitByColons ?? ((s) => s.split(':'));
|
|
10
|
+
function parseTargetString(targetString, projectGraphOrCtx) {
|
|
11
|
+
let projectGraph = projectGraphOrCtx && 'projectGraph' in projectGraphOrCtx
|
|
12
|
+
? projectGraphOrCtx.projectGraph
|
|
13
|
+
: projectGraphOrCtx;
|
|
9
14
|
if (!projectGraph) {
|
|
10
15
|
try {
|
|
11
16
|
projectGraph = readCachedProjectGraph();
|
|
@@ -14,6 +19,12 @@ function parseTargetString(targetString, projectGraph) {
|
|
|
14
19
|
projectGraph = { nodes: {} };
|
|
15
20
|
}
|
|
16
21
|
}
|
|
22
|
+
const [maybeProject] = splitByColons(targetString);
|
|
23
|
+
if (!projectGraph.nodes[maybeProject] &&
|
|
24
|
+
projectGraphOrCtx &&
|
|
25
|
+
'projectName' in projectGraphOrCtx) {
|
|
26
|
+
targetString = `${projectGraphOrCtx.projectName}:${targetString}`;
|
|
27
|
+
}
|
|
17
28
|
const [project, target, configuration] = splitTarget(targetString, projectGraph);
|
|
18
29
|
if (!project || !target) {
|
|
19
30
|
throw new Error(`Invalid Target String: ${targetString}`);
|
|
@@ -15,6 +15,9 @@ combineOptionsForExecutor =
|
|
|
15
15
|
*/
|
|
16
16
|
function readTargetOptions({ project, target, configuration }, context) {
|
|
17
17
|
const projectConfiguration = (context.workspace || context.projectsConfigurations).projects[project];
|
|
18
|
+
if (!projectConfiguration) {
|
|
19
|
+
throw new Error(`Unable to find project ${project}`);
|
|
20
|
+
}
|
|
18
21
|
const targetConfiguration = projectConfiguration.targets[target];
|
|
19
22
|
// TODO(v18): remove Workspaces.
|
|
20
23
|
const ws = new Workspaces(context.root);
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const visit_not_ignored_files_1 = require("../../generators/visit-not-ignored-files");
|
|
4
|
+
const format_files_1 = require("../../generators/format-files");
|
|
5
|
+
const nx_1 = require("../../../nx");
|
|
6
|
+
const package_json_1 = require("../../utils/package-json");
|
|
7
|
+
const versions_1 = require("../../utils/versions");
|
|
8
|
+
const { readJson } = (0, nx_1.requireNx)();
|
|
9
|
+
let tsModule;
|
|
10
|
+
const MODULE_FEDERATION_PUBLIC_TOKENS = [
|
|
11
|
+
'AdditionalSharedConfig',
|
|
12
|
+
'ModuleFederationConfig',
|
|
13
|
+
'SharedLibraryConfig',
|
|
14
|
+
'SharedWorkspaceLibraryConfig',
|
|
15
|
+
'WorkspaceLibrary',
|
|
16
|
+
'SharedFunction',
|
|
17
|
+
'WorkspaceLibrarySecondaryEntryPoint',
|
|
18
|
+
'Remotes',
|
|
19
|
+
'ModuleFederationLibrary',
|
|
20
|
+
'applySharedFunction',
|
|
21
|
+
'applyAdditionalShared',
|
|
22
|
+
'getNpmPackageSharedConfig',
|
|
23
|
+
'shareWorkspaceLibraries',
|
|
24
|
+
'sharePackages',
|
|
25
|
+
'mapRemotes',
|
|
26
|
+
'mapRemotesForSSR',
|
|
27
|
+
'getDependentPackagesForProject',
|
|
28
|
+
'readRootPackageJson',
|
|
29
|
+
];
|
|
30
|
+
exports.default = async (tree) => {
|
|
31
|
+
let hasFileToMigrate = false;
|
|
32
|
+
(0, visit_not_ignored_files_1.visitNotIgnoredFiles)(tree, '/', (path) => {
|
|
33
|
+
if (!path.endsWith('.ts') && !path.endsWith('.js')) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
let fileContents = tree.read(path, 'utf-8');
|
|
37
|
+
if (MODULE_FEDERATION_PUBLIC_TOKENS.every((token) => !fileContents.includes(token))) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
hasFileToMigrate = true;
|
|
41
|
+
fileContents = replaceTSImports(tree, path, fileContents);
|
|
42
|
+
fileContents = replaceRequireCalls(tree, path, fileContents);
|
|
43
|
+
fileContents = replaceJSDoc(tree, path, fileContents);
|
|
44
|
+
tree.write(path, fileContents);
|
|
45
|
+
});
|
|
46
|
+
if (hasFileToMigrate) {
|
|
47
|
+
await (0, format_files_1.formatFiles)(tree);
|
|
48
|
+
const pkgJson = readJson(tree, 'package.json');
|
|
49
|
+
const nxVersion = pkgJson.devDependencies?.['nx'] ??
|
|
50
|
+
pkgJson.dependencies?.['nx'] ??
|
|
51
|
+
'17.0.0';
|
|
52
|
+
return (0, package_json_1.addDependenciesToPackageJson)(tree, {}, { '@nx/webpack': nxVersion });
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
function replaceJSDoc(tree, path, fileContents) {
|
|
56
|
+
let newFileContents = fileContents;
|
|
57
|
+
for (const token of MODULE_FEDERATION_PUBLIC_TOKENS) {
|
|
58
|
+
newFileContents = newFileContents.replaceAll(new RegExp(`(@type)+\\s({)+(\\s)*(import\\(('|")+@nx\/devkit('|")+\\)\.)+(${token})+\\s*(})+`, 'g'), `@type {import('@nx/webpack').${token}}`);
|
|
59
|
+
}
|
|
60
|
+
return newFileContents;
|
|
61
|
+
}
|
|
62
|
+
function replaceRequireCalls(tree, path, fileContents) {
|
|
63
|
+
if (!tsModule) {
|
|
64
|
+
tsModule = (0, package_json_1.ensurePackage)('typescript', versions_1.typescriptVersion);
|
|
65
|
+
}
|
|
66
|
+
const sourceFile = tsModule.createSourceFile(path, fileContents, tsModule.ScriptTarget.Latest, true);
|
|
67
|
+
const allDevkitRequires = findNodes(sourceFile, tsModule.SyntaxKind.VariableStatement)
|
|
68
|
+
.filter((node) => [`require("@nx/devkit")`, `require('@nx/devkit')`].some((r) => node.getText().includes(r)))
|
|
69
|
+
.filter((node) => findNodes(node, tsModule.SyntaxKind.ObjectBindingPattern).length);
|
|
70
|
+
const mfUtilRequires = allDevkitRequires.filter((node) => MODULE_FEDERATION_PUBLIC_TOKENS.some((token) => node.getText().includes(token)));
|
|
71
|
+
if (!mfUtilRequires.length) {
|
|
72
|
+
return fileContents;
|
|
73
|
+
}
|
|
74
|
+
const mfUtilTokens = mfUtilRequires.map((node) => {
|
|
75
|
+
const allTokens = findNodes(node, tsModule.SyntaxKind.BindingElement);
|
|
76
|
+
const mfTokens = allTokens.filter((node) => MODULE_FEDERATION_PUBLIC_TOKENS.some((token) => node.getText() === token));
|
|
77
|
+
return {
|
|
78
|
+
requireNode: node,
|
|
79
|
+
onlyMf: allTokens.length === mfTokens.length,
|
|
80
|
+
mfTokens,
|
|
81
|
+
};
|
|
82
|
+
});
|
|
83
|
+
const changes = [];
|
|
84
|
+
for (const mfUtilRequireData of mfUtilTokens) {
|
|
85
|
+
if (mfUtilRequireData.onlyMf) {
|
|
86
|
+
changes.push({
|
|
87
|
+
startPosition: mfUtilRequireData.requireNode.getStart(),
|
|
88
|
+
endPosition: mfUtilRequireData.requireNode.getEnd(),
|
|
89
|
+
content: '',
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
for (const mfToken of mfUtilRequireData.mfTokens) {
|
|
94
|
+
const replaceTrailingComma = mfToken.getText().charAt(mfToken.getEnd() + 1) === ',';
|
|
95
|
+
changes.push({
|
|
96
|
+
startPosition: mfToken.getStart(),
|
|
97
|
+
endPosition: replaceTrailingComma
|
|
98
|
+
? mfToken.getEnd() + 1
|
|
99
|
+
: mfToken.getEnd(),
|
|
100
|
+
content: '',
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
changes.push({
|
|
106
|
+
startPosition: mfUtilTokens[mfUtilTokens.length - 1].requireNode.getEnd(),
|
|
107
|
+
content: `\nconst { ${mfUtilTokens
|
|
108
|
+
.map((mfUtilToken) => mfUtilToken.mfTokens.map((node) => node.getText()))
|
|
109
|
+
.join(', ')} } = require('@nx/webpack');`,
|
|
110
|
+
});
|
|
111
|
+
let newFileContents = fileContents;
|
|
112
|
+
while (changes.length) {
|
|
113
|
+
const change = changes.pop();
|
|
114
|
+
newFileContents = `${newFileContents.substring(0, change.startPosition)}${change.content}${newFileContents.substring(change.endPosition ? change.endPosition : change.startPosition)}`;
|
|
115
|
+
}
|
|
116
|
+
return newFileContents;
|
|
117
|
+
}
|
|
118
|
+
function replaceTSImports(tree, path, fileContents) {
|
|
119
|
+
if (!tsModule) {
|
|
120
|
+
tsModule = (0, package_json_1.ensurePackage)('typescript', versions_1.typescriptVersion);
|
|
121
|
+
}
|
|
122
|
+
const sourceFile = tsModule.createSourceFile(path, fileContents, tsModule.ScriptTarget.Latest, true);
|
|
123
|
+
const allImports = findNodes(sourceFile, tsModule.SyntaxKind.ImportDeclaration);
|
|
124
|
+
const devkitImports = allImports.filter((i) => i.getText().includes(`'@nx/devkit';`));
|
|
125
|
+
const mfUtilsImports = devkitImports.filter((i) => MODULE_FEDERATION_PUBLIC_TOKENS.some((token) => i.getText().includes(token)));
|
|
126
|
+
if (!mfUtilsImports.length) {
|
|
127
|
+
return fileContents;
|
|
128
|
+
}
|
|
129
|
+
const mfUtilsWithMultipleImports = mfUtilsImports.map((i) => {
|
|
130
|
+
const importSpecifierNodes = findNodes(i, tsModule.SyntaxKind.ImportSpecifier);
|
|
131
|
+
const mfImportSpecifierNodes = importSpecifierNodes.filter((node) => MODULE_FEDERATION_PUBLIC_TOKENS.some((token) => node.getText().includes(token)));
|
|
132
|
+
return {
|
|
133
|
+
importDeclarationNode: i,
|
|
134
|
+
onlyMf: mfImportSpecifierNodes.length === importSpecifierNodes.length,
|
|
135
|
+
mfImportSpecifierNodes,
|
|
136
|
+
};
|
|
137
|
+
});
|
|
138
|
+
const changes = [];
|
|
139
|
+
for (const importDeclaration of mfUtilsWithMultipleImports) {
|
|
140
|
+
if (importDeclaration.onlyMf) {
|
|
141
|
+
changes.push({
|
|
142
|
+
startPosition: importDeclaration.importDeclarationNode.getStart(),
|
|
143
|
+
endPosition: importDeclaration.importDeclarationNode.getEnd(),
|
|
144
|
+
content: '',
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
else {
|
|
148
|
+
for (const mfImportSpecifierNodes of importDeclaration.mfImportSpecifierNodes) {
|
|
149
|
+
const replaceTrailingComma = importDeclaration.importDeclarationNode
|
|
150
|
+
.getText()
|
|
151
|
+
.charAt(mfImportSpecifierNodes.getEnd() + 1) === ',';
|
|
152
|
+
changes.push({
|
|
153
|
+
startPosition: mfImportSpecifierNodes.getStart(),
|
|
154
|
+
endPosition: replaceTrailingComma
|
|
155
|
+
? mfImportSpecifierNodes.getEnd() + 1
|
|
156
|
+
: mfImportSpecifierNodes.getEnd(),
|
|
157
|
+
content: '',
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
changes.push({
|
|
163
|
+
startPosition: mfUtilsWithMultipleImports[mfUtilsWithMultipleImports.length - 1].importDeclarationNode.getEnd(),
|
|
164
|
+
content: `\nimport { ${mfUtilsWithMultipleImports
|
|
165
|
+
.map((importDeclaration) => importDeclaration.mfImportSpecifierNodes.map((node) => node.getText()))
|
|
166
|
+
.join(', ')} } from '@nx/webpack';`,
|
|
167
|
+
});
|
|
168
|
+
let newFileContents = fileContents;
|
|
169
|
+
while (changes.length) {
|
|
170
|
+
const change = changes.pop();
|
|
171
|
+
newFileContents = `${newFileContents.substring(0, change.startPosition)}${change.content}${newFileContents.substring(change.endPosition ? change.endPosition : change.startPosition)}`;
|
|
172
|
+
}
|
|
173
|
+
return newFileContents;
|
|
174
|
+
}
|
|
175
|
+
function findNodes(node, kind, max = Infinity) {
|
|
176
|
+
if (!node || max == 0) {
|
|
177
|
+
return [];
|
|
178
|
+
}
|
|
179
|
+
const arr = [];
|
|
180
|
+
const hasMatch = Array.isArray(kind)
|
|
181
|
+
? kind.includes(node.kind)
|
|
182
|
+
: node.kind === kind;
|
|
183
|
+
if (hasMatch) {
|
|
184
|
+
arr.push(node);
|
|
185
|
+
max--;
|
|
186
|
+
}
|
|
187
|
+
if (max > 0) {
|
|
188
|
+
for (const child of node.getChildren()) {
|
|
189
|
+
findNodes(child, kind, max).forEach((node) => {
|
|
190
|
+
if (max > 0) {
|
|
191
|
+
arr.push(node);
|
|
192
|
+
}
|
|
193
|
+
max--;
|
|
194
|
+
});
|
|
195
|
+
if (max <= 0) {
|
|
196
|
+
break;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
return arr;
|
|
201
|
+
}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { ProjectGraph } from 'nx/src/config/project-graph';
|
|
2
|
-
import type { WorkspaceLibrary } from './models';
|
|
3
|
-
export declare function getDependentPackagesForProject(projectGraph: ProjectGraph, name: string): {
|
|
4
|
-
workspaceLibraries: WorkspaceLibrary[];
|
|
5
|
-
npmPackages: string[];
|
|
6
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDependentPackagesForProject = void 0;
|
|
4
|
-
const typescript_1 = require("./typescript");
|
|
5
|
-
function getDependentPackagesForProject(projectGraph, name) {
|
|
6
|
-
const { npmPackages, workspaceLibraries } = collectDependencies(projectGraph, name);
|
|
7
|
-
return {
|
|
8
|
-
workspaceLibraries: [...workspaceLibraries.values()],
|
|
9
|
-
npmPackages: [...npmPackages],
|
|
10
|
-
};
|
|
11
|
-
}
|
|
12
|
-
exports.getDependentPackagesForProject = getDependentPackagesForProject;
|
|
13
|
-
function collectDependencies(projectGraph, name, dependencies = {
|
|
14
|
-
workspaceLibraries: new Map(),
|
|
15
|
-
npmPackages: new Set(),
|
|
16
|
-
}, seen = new Set()) {
|
|
17
|
-
if (seen.has(name)) {
|
|
18
|
-
return dependencies;
|
|
19
|
-
}
|
|
20
|
-
seen.add(name);
|
|
21
|
-
(projectGraph.dependencies[name] ?? []).forEach((dependency) => {
|
|
22
|
-
if (dependency.target.startsWith('npm:')) {
|
|
23
|
-
dependencies.npmPackages.add(dependency.target.replace('npm:', ''));
|
|
24
|
-
}
|
|
25
|
-
else {
|
|
26
|
-
dependencies.workspaceLibraries.set(dependency.target, {
|
|
27
|
-
name: dependency.target,
|
|
28
|
-
root: projectGraph.nodes[dependency.target].data.root,
|
|
29
|
-
importKey: getLibraryImportPath(dependency.target, projectGraph),
|
|
30
|
-
});
|
|
31
|
-
collectDependencies(projectGraph, dependency.target, dependencies, seen);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
return dependencies;
|
|
35
|
-
}
|
|
36
|
-
function getLibraryImportPath(library, projectGraph) {
|
|
37
|
-
const tsConfigPathMappings = (0, typescript_1.readTsPathMappings)();
|
|
38
|
-
const sourceRoot = projectGraph.nodes[library].data.sourceRoot;
|
|
39
|
-
for (const [key, value] of Object.entries(tsConfigPathMappings)) {
|
|
40
|
-
if (value.find((path) => path.startsWith(sourceRoot))) {
|
|
41
|
-
return key;
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
return undefined;
|
|
45
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
tslib_1.__exportStar(require("./share"), exports);
|
|
5
|
-
tslib_1.__exportStar(require("./dependencies"), exports);
|
|
6
|
-
tslib_1.__exportStar(require("./package-json"), exports);
|
|
7
|
-
tslib_1.__exportStar(require("./remotes"), exports);
|
|
8
|
-
tslib_1.__exportStar(require("./models"), exports);
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import type { NormalModuleReplacementPlugin } from 'webpack';
|
|
2
|
-
export type ModuleFederationLibrary = {
|
|
3
|
-
type: string;
|
|
4
|
-
name: string;
|
|
5
|
-
};
|
|
6
|
-
export type WorkspaceLibrary = {
|
|
7
|
-
name: string;
|
|
8
|
-
root: string;
|
|
9
|
-
importKey: string | undefined;
|
|
10
|
-
};
|
|
11
|
-
export type SharedWorkspaceLibraryConfig = {
|
|
12
|
-
getAliases: () => Record<string, string>;
|
|
13
|
-
getLibraries: (eager?: boolean) => Record<string, SharedLibraryConfig>;
|
|
14
|
-
getReplacementPlugin: () => NormalModuleReplacementPlugin;
|
|
15
|
-
};
|
|
16
|
-
export type Remotes = string[] | [remoteName: string, remoteUrl: string][];
|
|
17
|
-
export interface SharedLibraryConfig {
|
|
18
|
-
singleton?: boolean;
|
|
19
|
-
strictVersion?: boolean;
|
|
20
|
-
requiredVersion?: false | string;
|
|
21
|
-
eager?: boolean;
|
|
22
|
-
}
|
|
23
|
-
export type SharedFunction = (libraryName: string, sharedConfig: SharedLibraryConfig) => undefined | false | SharedLibraryConfig;
|
|
24
|
-
export type AdditionalSharedConfig = Array<string | [libraryName: string, sharedConfig: SharedLibraryConfig] | {
|
|
25
|
-
libraryName: string;
|
|
26
|
-
sharedConfig: SharedLibraryConfig;
|
|
27
|
-
}>;
|
|
28
|
-
export interface ModuleFederationConfig {
|
|
29
|
-
name: string;
|
|
30
|
-
remotes?: Remotes;
|
|
31
|
-
library?: ModuleFederationLibrary;
|
|
32
|
-
exposes?: Record<string, string>;
|
|
33
|
-
shared?: SharedFunction;
|
|
34
|
-
additionalShared?: AdditionalSharedConfig;
|
|
35
|
-
}
|
|
36
|
-
export type WorkspaceLibrarySecondaryEntryPoint = {
|
|
37
|
-
name: string;
|
|
38
|
-
path: string;
|
|
39
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readRootPackageJson = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const nx_1 = require("../../../nx");
|
|
6
|
-
const { workspaceRoot, readJsonFile, joinPathFragments } = (0, nx_1.requireNx)();
|
|
7
|
-
function readRootPackageJson() {
|
|
8
|
-
const pkgJsonPath = joinPathFragments(workspaceRoot, 'package.json');
|
|
9
|
-
if (!(0, fs_1.existsSync)(pkgJsonPath)) {
|
|
10
|
-
throw new Error('NX MF: Could not find root package.json to determine dependency versions.');
|
|
11
|
-
}
|
|
12
|
-
return readJsonFile(pkgJsonPath);
|
|
13
|
-
}
|
|
14
|
-
exports.readRootPackageJson = readRootPackageJson;
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { AdditionalSharedConfig, ModuleFederationConfig, ModuleFederationLibrary, Remotes, SharedFunction, SharedLibraryConfig, SharedWorkspaceLibraryConfig, WorkspaceLibrary, WorkspaceLibrarySecondaryEntryPoint } from './models';
|
|
2
|
-
import { applyAdditionalShared, applySharedFunction, getNpmPackageSharedConfig, sharePackages, shareWorkspaceLibraries } from './share';
|
|
3
|
-
import { mapRemotes, mapRemotesForSSR } from './remotes';
|
|
4
|
-
import { getDependentPackagesForProject } from './dependencies';
|
|
5
|
-
import { readRootPackageJson } from './package-json';
|
|
6
|
-
export {
|
|
7
|
-
/**
|
|
8
|
-
* @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.
|
|
9
|
-
*/
|
|
10
|
-
ModuleFederationConfig,
|
|
11
|
-
/**
|
|
12
|
-
* @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.
|
|
13
|
-
*/
|
|
14
|
-
SharedLibraryConfig,
|
|
15
|
-
/**
|
|
16
|
-
* @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.
|
|
17
|
-
*/
|
|
18
|
-
SharedWorkspaceLibraryConfig,
|
|
19
|
-
/**
|
|
20
|
-
* @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.
|
|
21
|
-
*/
|
|
22
|
-
AdditionalSharedConfig,
|
|
23
|
-
/**
|
|
24
|
-
* @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.
|
|
25
|
-
*/
|
|
26
|
-
WorkspaceLibrary,
|
|
27
|
-
/**
|
|
28
|
-
* @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.
|
|
29
|
-
*/
|
|
30
|
-
SharedFunction,
|
|
31
|
-
/**
|
|
32
|
-
* @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.
|
|
33
|
-
*/
|
|
34
|
-
WorkspaceLibrarySecondaryEntryPoint,
|
|
35
|
-
/**
|
|
36
|
-
* @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.
|
|
37
|
-
*/
|
|
38
|
-
Remotes,
|
|
39
|
-
/**
|
|
40
|
-
* @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.
|
|
41
|
-
*/
|
|
42
|
-
ModuleFederationLibrary,
|
|
43
|
-
/**
|
|
44
|
-
* @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.
|
|
45
|
-
*/
|
|
46
|
-
applySharedFunction,
|
|
47
|
-
/**
|
|
48
|
-
* @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.
|
|
49
|
-
*/
|
|
50
|
-
applyAdditionalShared,
|
|
51
|
-
/**
|
|
52
|
-
* @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.
|
|
53
|
-
*/
|
|
54
|
-
getNpmPackageSharedConfig,
|
|
55
|
-
/**
|
|
56
|
-
* @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.
|
|
57
|
-
*/
|
|
58
|
-
shareWorkspaceLibraries,
|
|
59
|
-
/**
|
|
60
|
-
* @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.
|
|
61
|
-
*/
|
|
62
|
-
sharePackages,
|
|
63
|
-
/**
|
|
64
|
-
* @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.
|
|
65
|
-
*/
|
|
66
|
-
mapRemotes,
|
|
67
|
-
/**
|
|
68
|
-
* @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.
|
|
69
|
-
*/
|
|
70
|
-
mapRemotesForSSR,
|
|
71
|
-
/**
|
|
72
|
-
* @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.
|
|
73
|
-
*/
|
|
74
|
-
getDependentPackagesForProject,
|
|
75
|
-
/**
|
|
76
|
-
* @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.
|
|
77
|
-
*/
|
|
78
|
-
readRootPackageJson, };
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.readRootPackageJson = exports.getDependentPackagesForProject = exports.mapRemotesForSSR = exports.mapRemotes = exports.sharePackages = exports.shareWorkspaceLibraries = exports.getNpmPackageSharedConfig = exports.applyAdditionalShared = exports.applySharedFunction = void 0;
|
|
4
|
-
const share_1 = require("./share");
|
|
5
|
-
Object.defineProperty(exports, "applyAdditionalShared", { enumerable: true, get: function () { return share_1.applyAdditionalShared; } });
|
|
6
|
-
Object.defineProperty(exports, "applySharedFunction", { enumerable: true, get: function () { return share_1.applySharedFunction; } });
|
|
7
|
-
Object.defineProperty(exports, "getNpmPackageSharedConfig", { enumerable: true, get: function () { return share_1.getNpmPackageSharedConfig; } });
|
|
8
|
-
Object.defineProperty(exports, "sharePackages", { enumerable: true, get: function () { return share_1.sharePackages; } });
|
|
9
|
-
Object.defineProperty(exports, "shareWorkspaceLibraries", { enumerable: true, get: function () { return share_1.shareWorkspaceLibraries; } });
|
|
10
|
-
const remotes_1 = require("./remotes");
|
|
11
|
-
Object.defineProperty(exports, "mapRemotes", { enumerable: true, get: function () { return remotes_1.mapRemotes; } });
|
|
12
|
-
Object.defineProperty(exports, "mapRemotesForSSR", { enumerable: true, get: function () { return remotes_1.mapRemotesForSSR; } });
|
|
13
|
-
const dependencies_1 = require("./dependencies");
|
|
14
|
-
Object.defineProperty(exports, "getDependentPackagesForProject", { enumerable: true, get: function () { return dependencies_1.getDependentPackagesForProject; } });
|
|
15
|
-
const package_json_1 = require("./package-json");
|
|
16
|
-
Object.defineProperty(exports, "readRootPackageJson", { enumerable: true, get: function () { return package_json_1.readRootPackageJson; } });
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Remotes } from './models';
|
|
2
|
-
/**
|
|
3
|
-
* Map remote names to a format that can be understood and used by Module
|
|
4
|
-
* Federation.
|
|
5
|
-
*
|
|
6
|
-
* @param remotes - The remotes to map
|
|
7
|
-
* @param remoteEntryExt - The file extension of the remoteEntry file
|
|
8
|
-
* @param determineRemoteUrl - The function used to lookup the URL of the served remote
|
|
9
|
-
*/
|
|
10
|
-
export declare function mapRemotes(remotes: Remotes, remoteEntryExt: 'js' | 'mjs', determineRemoteUrl: (remote: string) => string): Record<string, string>;
|
|
11
|
-
/**
|
|
12
|
-
* Map remote names to a format that can be understood and used by Module
|
|
13
|
-
* Federation.
|
|
14
|
-
*
|
|
15
|
-
* @param remotes - The remotes to map
|
|
16
|
-
* @param remoteEntryExt - The file extension of the remoteEntry file
|
|
17
|
-
* @param determineRemoteUrl - The function used to lookup the URL of the served remote
|
|
18
|
-
*/
|
|
19
|
-
export declare function mapRemotesForSSR(remotes: Remotes, remoteEntryExt: 'js' | 'mjs', determineRemoteUrl: (remote: string) => string): Record<string, string>;
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mapRemotesForSSR = exports.mapRemotes = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
/**
|
|
6
|
-
* Map remote names to a format that can be understood and used by Module
|
|
7
|
-
* Federation.
|
|
8
|
-
*
|
|
9
|
-
* @param remotes - The remotes to map
|
|
10
|
-
* @param remoteEntryExt - The file extension of the remoteEntry file
|
|
11
|
-
* @param determineRemoteUrl - The function used to lookup the URL of the served remote
|
|
12
|
-
*/
|
|
13
|
-
function mapRemotes(remotes, remoteEntryExt, determineRemoteUrl) {
|
|
14
|
-
const mappedRemotes = {};
|
|
15
|
-
for (const remote of remotes) {
|
|
16
|
-
if (Array.isArray(remote)) {
|
|
17
|
-
const [remoteName, remoteLocation] = remote;
|
|
18
|
-
const remoteLocationExt = (0, path_1.extname)(remoteLocation);
|
|
19
|
-
mappedRemotes[remoteName] = ['.js', '.mjs'].includes(remoteLocationExt)
|
|
20
|
-
? remoteLocation
|
|
21
|
-
: `${remoteLocation.endsWith('/')
|
|
22
|
-
? remoteLocation.slice(0, -1)
|
|
23
|
-
: remoteLocation}/remoteEntry.${remoteEntryExt}`;
|
|
24
|
-
}
|
|
25
|
-
else if (typeof remote === 'string') {
|
|
26
|
-
mappedRemotes[remote] = determineRemoteUrl(remote);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return mappedRemotes;
|
|
30
|
-
}
|
|
31
|
-
exports.mapRemotes = mapRemotes;
|
|
32
|
-
/**
|
|
33
|
-
* Map remote names to a format that can be understood and used by Module
|
|
34
|
-
* Federation.
|
|
35
|
-
*
|
|
36
|
-
* @param remotes - The remotes to map
|
|
37
|
-
* @param remoteEntryExt - The file extension of the remoteEntry file
|
|
38
|
-
* @param determineRemoteUrl - The function used to lookup the URL of the served remote
|
|
39
|
-
*/
|
|
40
|
-
function mapRemotesForSSR(remotes, remoteEntryExt, determineRemoteUrl) {
|
|
41
|
-
const mappedRemotes = {};
|
|
42
|
-
for (const remote of remotes) {
|
|
43
|
-
if (Array.isArray(remote)) {
|
|
44
|
-
const [remoteName, remoteLocation] = remote;
|
|
45
|
-
const remoteLocationExt = (0, path_1.extname)(remoteLocation);
|
|
46
|
-
mappedRemotes[remoteName] = `${remoteName}@${['.js', '.mjs'].includes(remoteLocationExt)
|
|
47
|
-
? remoteLocation
|
|
48
|
-
: `${remoteLocation.endsWith('/')
|
|
49
|
-
? remoteLocation.slice(0, -1)
|
|
50
|
-
: remoteLocation}/remoteEntry.${remoteEntryExt}`}`;
|
|
51
|
-
}
|
|
52
|
-
else if (typeof remote === 'string') {
|
|
53
|
-
mappedRemotes[remote] = `${remote}@${determineRemoteUrl(remote)}`;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
return mappedRemotes;
|
|
57
|
-
}
|
|
58
|
-
exports.mapRemotesForSSR = mapRemotesForSSR;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import type { WorkspaceLibrary } from './models';
|
|
2
|
-
import { WorkspaceLibrarySecondaryEntryPoint } from './models';
|
|
3
|
-
export declare function collectWorkspaceLibrarySecondaryEntryPoints(library: WorkspaceLibrary, tsconfigPathAliases: Record<string, string[]>): WorkspaceLibrarySecondaryEntryPoint[];
|
|
4
|
-
export declare function getNonNodeModulesSubDirs(directory: string): string[];
|
|
5
|
-
export declare function recursivelyCollectSecondaryEntryPointsFromDirectory(pkgName: string, pkgVersion: string, pkgRoot: string, mainEntryPointExports: any | undefined, directories: string[], collectedPackages: {
|
|
6
|
-
name: string;
|
|
7
|
-
version: string;
|
|
8
|
-
}[]): void;
|
|
9
|
-
export declare function collectPackageSecondaryEntryPoints(pkgName: string, pkgVersion: string, collectedPackages: {
|
|
10
|
-
name: string;
|
|
11
|
-
version: string;
|
|
12
|
-
}[]): void;
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.collectPackageSecondaryEntryPoints = exports.recursivelyCollectSecondaryEntryPointsFromDirectory = exports.getNonNodeModulesSubDirs = exports.collectWorkspaceLibrarySecondaryEntryPoints = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const fs_1 = require("fs");
|
|
6
|
-
const nx_1 = require("../../../nx");
|
|
7
|
-
let { readJsonFile, joinPathFragments, workspaceRoot, readModulePackageJson } = (0, nx_1.requireNx)();
|
|
8
|
-
// TODO: Remove this in Nx 18 when Nx 16.7.0 is no longer supported
|
|
9
|
-
readModulePackageJson =
|
|
10
|
-
readModulePackageJson ??
|
|
11
|
-
require('nx/src/utils/package-json').readModulePackageJson;
|
|
12
|
-
function collectWorkspaceLibrarySecondaryEntryPoints(library, tsconfigPathAliases) {
|
|
13
|
-
const libraryRoot = (0, path_1.join)(workspaceRoot, library.root);
|
|
14
|
-
const needsSecondaryEntryPointsCollected = (0, fs_1.existsSync)((0, path_1.join)(libraryRoot, 'ng-package.json'));
|
|
15
|
-
const secondaryEntryPoints = [];
|
|
16
|
-
if (needsSecondaryEntryPointsCollected) {
|
|
17
|
-
const tsConfigAliasesForLibWithSecondaryEntryPoints = Object.entries(tsconfigPathAliases).reduce((acc, [tsKey, tsPaths]) => {
|
|
18
|
-
if (!tsKey.startsWith(library.importKey)) {
|
|
19
|
-
return { ...acc };
|
|
20
|
-
}
|
|
21
|
-
if (tsPaths.some((path) => path.startsWith(`${library.root}/`))) {
|
|
22
|
-
acc = { ...acc, [tsKey]: tsPaths };
|
|
23
|
-
}
|
|
24
|
-
return acc;
|
|
25
|
-
}, {});
|
|
26
|
-
for (const [alias] of Object.entries(tsConfigAliasesForLibWithSecondaryEntryPoints)) {
|
|
27
|
-
const pathToLib = (0, path_1.dirname)((0, path_1.join)(workspaceRoot, tsconfigPathAliases[alias][0]));
|
|
28
|
-
let searchDir = pathToLib;
|
|
29
|
-
while (searchDir !== libraryRoot) {
|
|
30
|
-
if ((0, fs_1.existsSync)((0, path_1.join)(searchDir, 'ng-package.json'))) {
|
|
31
|
-
secondaryEntryPoints.push({ name: alias, path: pathToLib });
|
|
32
|
-
break;
|
|
33
|
-
}
|
|
34
|
-
searchDir = (0, path_1.dirname)(searchDir);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return secondaryEntryPoints;
|
|
39
|
-
}
|
|
40
|
-
exports.collectWorkspaceLibrarySecondaryEntryPoints = collectWorkspaceLibrarySecondaryEntryPoints;
|
|
41
|
-
function getNonNodeModulesSubDirs(directory) {
|
|
42
|
-
return (0, fs_1.readdirSync)(directory)
|
|
43
|
-
.filter((file) => file !== 'node_modules')
|
|
44
|
-
.map((file) => (0, path_1.join)(directory, file))
|
|
45
|
-
.filter((file) => (0, fs_1.lstatSync)(file).isDirectory());
|
|
46
|
-
}
|
|
47
|
-
exports.getNonNodeModulesSubDirs = getNonNodeModulesSubDirs;
|
|
48
|
-
function recursivelyCollectSecondaryEntryPointsFromDirectory(pkgName, pkgVersion, pkgRoot, mainEntryPointExports, directories, collectedPackages) {
|
|
49
|
-
for (const directory of directories) {
|
|
50
|
-
const packageJsonPath = (0, path_1.join)(directory, 'package.json');
|
|
51
|
-
const relativeEntryPointPath = (0, path_1.relative)(pkgRoot, directory);
|
|
52
|
-
const entryPointName = joinPathFragments(pkgName, relativeEntryPointPath);
|
|
53
|
-
if ((0, fs_1.existsSync)(packageJsonPath)) {
|
|
54
|
-
try {
|
|
55
|
-
// require the secondary entry point to try to rule out sample code
|
|
56
|
-
require.resolve(entryPointName, { paths: [workspaceRoot] });
|
|
57
|
-
const { name } = readJsonFile(packageJsonPath);
|
|
58
|
-
// further check to make sure what we were able to require is the
|
|
59
|
-
// same as the package name
|
|
60
|
-
if (name === entryPointName) {
|
|
61
|
-
collectedPackages.push({ name, version: pkgVersion });
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
catch { }
|
|
65
|
-
}
|
|
66
|
-
else if (mainEntryPointExports) {
|
|
67
|
-
// if the package.json doesn't exist, check if the directory is
|
|
68
|
-
// exported by the main entry point
|
|
69
|
-
const entryPointExportKey = `./${relativeEntryPointPath}`;
|
|
70
|
-
const entryPointInfo = mainEntryPointExports[entryPointExportKey];
|
|
71
|
-
if (entryPointInfo) {
|
|
72
|
-
collectedPackages.push({
|
|
73
|
-
name: entryPointName,
|
|
74
|
-
version: pkgVersion,
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
const subDirs = getNonNodeModulesSubDirs(directory);
|
|
79
|
-
recursivelyCollectSecondaryEntryPointsFromDirectory(pkgName, pkgVersion, pkgRoot, mainEntryPointExports, subDirs, collectedPackages);
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
exports.recursivelyCollectSecondaryEntryPointsFromDirectory = recursivelyCollectSecondaryEntryPointsFromDirectory;
|
|
83
|
-
function collectPackageSecondaryEntryPoints(pkgName, pkgVersion, collectedPackages) {
|
|
84
|
-
let pathToPackage;
|
|
85
|
-
let packageJsonPath;
|
|
86
|
-
let packageJson;
|
|
87
|
-
try {
|
|
88
|
-
({ path: packageJsonPath, packageJson } = readModulePackageJson(pkgName));
|
|
89
|
-
pathToPackage = (0, path_1.dirname)(packageJsonPath);
|
|
90
|
-
}
|
|
91
|
-
catch {
|
|
92
|
-
// the package.json might not resolve if the package has the "exports"
|
|
93
|
-
// entry and is not exporting the package.json file, fall back to trying
|
|
94
|
-
// to find it from the top-level node_modules
|
|
95
|
-
pathToPackage = (0, path_1.join)(workspaceRoot, 'node_modules', pkgName);
|
|
96
|
-
packageJsonPath = (0, path_1.join)(pathToPackage, 'package.json');
|
|
97
|
-
if (!(0, fs_1.existsSync)(packageJsonPath)) {
|
|
98
|
-
// might not exist if it's nested in another package, just return here
|
|
99
|
-
return;
|
|
100
|
-
}
|
|
101
|
-
packageJson = readJsonFile(packageJsonPath);
|
|
102
|
-
}
|
|
103
|
-
const { exports } = packageJson;
|
|
104
|
-
const subDirs = getNonNodeModulesSubDirs(pathToPackage);
|
|
105
|
-
recursivelyCollectSecondaryEntryPointsFromDirectory(pkgName, pkgVersion, pathToPackage, exports, subDirs, collectedPackages);
|
|
106
|
-
}
|
|
107
|
-
exports.collectPackageSecondaryEntryPoints = collectPackageSecondaryEntryPoints;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import type { SharedLibraryConfig, SharedWorkspaceLibraryConfig, WorkspaceLibrary } from './models';
|
|
2
|
-
import { AdditionalSharedConfig, SharedFunction } from './models';
|
|
3
|
-
import type { ProjectGraph } from 'nx/src/config/project-graph';
|
|
4
|
-
/**
|
|
5
|
-
* Build an object of functions to be used with the ModuleFederationPlugin to
|
|
6
|
-
* share Nx Workspace Libraries between Hosts and Remotes.
|
|
7
|
-
*
|
|
8
|
-
* @param libraries - The Nx Workspace Libraries to share
|
|
9
|
-
* @param tsConfigPath - The path to TS Config File that contains the Path Mappings for the Libraries
|
|
10
|
-
*/
|
|
11
|
-
export declare function shareWorkspaceLibraries(libraries: WorkspaceLibrary[], tsConfigPath?: string): SharedWorkspaceLibraryConfig;
|
|
12
|
-
/**
|
|
13
|
-
* Build the Module Federation Share Config for a specific package and the
|
|
14
|
-
* specified version of that package.
|
|
15
|
-
* @param pkgName - Name of the package to share
|
|
16
|
-
* @param version - Version of the package to require by other apps in the Module Federation setup
|
|
17
|
-
*/
|
|
18
|
-
export declare function getNpmPackageSharedConfig(pkgName: string, version: string): SharedLibraryConfig | undefined;
|
|
19
|
-
/**
|
|
20
|
-
* Create a dictionary of packages and their Module Federation Shared Config
|
|
21
|
-
* from an array of package names.
|
|
22
|
-
*
|
|
23
|
-
* Lookup the versions of the packages from the root package.json file in the
|
|
24
|
-
* workspace.
|
|
25
|
-
* @param packages - Array of package names as strings
|
|
26
|
-
*/
|
|
27
|
-
export declare function sharePackages(packages: string[]): Record<string, SharedLibraryConfig>;
|
|
28
|
-
/**
|
|
29
|
-
* Apply a custom function provided by the user that will modify the Shared Config
|
|
30
|
-
* of the dependencies for the Module Federation build.
|
|
31
|
-
*
|
|
32
|
-
* @param sharedConfig - The original Shared Config to be modified
|
|
33
|
-
* @param sharedFn - The custom function to run
|
|
34
|
-
*/
|
|
35
|
-
export declare function applySharedFunction(sharedConfig: Record<string, SharedLibraryConfig>, sharedFn: SharedFunction | undefined): void;
|
|
36
|
-
/**
|
|
37
|
-
* Add additional dependencies to the shared package that may not have been
|
|
38
|
-
* discovered by the project graph.
|
|
39
|
-
*
|
|
40
|
-
* This can be useful for applications that use a Dependency Injection system
|
|
41
|
-
* that expects certain Singleton values to be present in the shared injection
|
|
42
|
-
* hierarchy.
|
|
43
|
-
*
|
|
44
|
-
* @param sharedConfig - The original Shared Config
|
|
45
|
-
* @param additionalShared - The additional dependencies to add
|
|
46
|
-
* @param projectGraph - The Nx project graph
|
|
47
|
-
*/
|
|
48
|
-
export declare function applyAdditionalShared(sharedConfig: Record<string, SharedLibraryConfig>, additionalShared: AdditionalSharedConfig | undefined, projectGraph: ProjectGraph): void;
|
|
@@ -1,184 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.applyAdditionalShared = exports.applySharedFunction = exports.sharePackages = exports.getNpmPackageSharedConfig = exports.shareWorkspaceLibraries = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const package_json_1 = require("./package-json");
|
|
6
|
-
const typescript_1 = require("./typescript");
|
|
7
|
-
const secondary_entry_points_1 = require("./secondary-entry-points");
|
|
8
|
-
const nx_1 = require("../../../nx");
|
|
9
|
-
const { workspaceRoot, logger } = (0, nx_1.requireNx)();
|
|
10
|
-
/**
|
|
11
|
-
* Build an object of functions to be used with the ModuleFederationPlugin to
|
|
12
|
-
* share Nx Workspace Libraries between Hosts and Remotes.
|
|
13
|
-
*
|
|
14
|
-
* @param libraries - The Nx Workspace Libraries to share
|
|
15
|
-
* @param tsConfigPath - The path to TS Config File that contains the Path Mappings for the Libraries
|
|
16
|
-
*/
|
|
17
|
-
function shareWorkspaceLibraries(libraries, tsConfigPath = process.env.NX_TSCONFIG_PATH ?? (0, typescript_1.getRootTsConfigPath)()) {
|
|
18
|
-
if (!libraries) {
|
|
19
|
-
return getEmptySharedLibrariesConfig();
|
|
20
|
-
}
|
|
21
|
-
const tsconfigPathAliases = (0, typescript_1.readTsPathMappings)(tsConfigPath);
|
|
22
|
-
if (!Object.keys(tsconfigPathAliases).length) {
|
|
23
|
-
return getEmptySharedLibrariesConfig();
|
|
24
|
-
}
|
|
25
|
-
const pathMappings = [];
|
|
26
|
-
for (const [key, paths] of Object.entries(tsconfigPathAliases)) {
|
|
27
|
-
const library = libraries.find((lib) => lib.importKey === key);
|
|
28
|
-
if (!library) {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
// This is for Angular Projects that use ng-package.json
|
|
32
|
-
// It will do nothing for React Projects
|
|
33
|
-
(0, secondary_entry_points_1.collectWorkspaceLibrarySecondaryEntryPoints)(library, tsconfigPathAliases).forEach(({ name, path }) => pathMappings.push({
|
|
34
|
-
name,
|
|
35
|
-
path,
|
|
36
|
-
}));
|
|
37
|
-
pathMappings.push({
|
|
38
|
-
name: key,
|
|
39
|
-
path: (0, path_1.normalize)((0, path_1.join)(workspaceRoot, paths[0])),
|
|
40
|
-
});
|
|
41
|
-
}
|
|
42
|
-
const webpack = require('webpack');
|
|
43
|
-
return {
|
|
44
|
-
getAliases: () => pathMappings.reduce((aliases, library) => ({ ...aliases, [library.name]: library.path }), {}),
|
|
45
|
-
getLibraries: (eager) => pathMappings.reduce((libraries, library) => ({
|
|
46
|
-
...libraries,
|
|
47
|
-
[library.name]: { requiredVersion: false, eager },
|
|
48
|
-
}), {}),
|
|
49
|
-
getReplacementPlugin: () => new webpack.NormalModuleReplacementPlugin(/./, (req) => {
|
|
50
|
-
if (!req.request.startsWith('.')) {
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
const from = req.context;
|
|
54
|
-
const to = (0, path_1.normalize)((0, path_1.join)(req.context, req.request));
|
|
55
|
-
for (const library of pathMappings) {
|
|
56
|
-
const libFolder = (0, path_1.normalize)((0, path_1.dirname)(library.path));
|
|
57
|
-
if (!from.startsWith(libFolder) && to.startsWith(libFolder)) {
|
|
58
|
-
req.request = library.name;
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
}),
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
exports.shareWorkspaceLibraries = shareWorkspaceLibraries;
|
|
65
|
-
/**
|
|
66
|
-
* Build the Module Federation Share Config for a specific package and the
|
|
67
|
-
* specified version of that package.
|
|
68
|
-
* @param pkgName - Name of the package to share
|
|
69
|
-
* @param version - Version of the package to require by other apps in the Module Federation setup
|
|
70
|
-
*/
|
|
71
|
-
function getNpmPackageSharedConfig(pkgName, version) {
|
|
72
|
-
if (!version) {
|
|
73
|
-
logger.warn(`Could not find a version for "${pkgName}" in the root "package.json" ` +
|
|
74
|
-
'when collecting shared packages for the Module Federation setup. ' +
|
|
75
|
-
'The package will not be shared.');
|
|
76
|
-
return undefined;
|
|
77
|
-
}
|
|
78
|
-
return { singleton: true, strictVersion: true, requiredVersion: version };
|
|
79
|
-
}
|
|
80
|
-
exports.getNpmPackageSharedConfig = getNpmPackageSharedConfig;
|
|
81
|
-
/**
|
|
82
|
-
* Create a dictionary of packages and their Module Federation Shared Config
|
|
83
|
-
* from an array of package names.
|
|
84
|
-
*
|
|
85
|
-
* Lookup the versions of the packages from the root package.json file in the
|
|
86
|
-
* workspace.
|
|
87
|
-
* @param packages - Array of package names as strings
|
|
88
|
-
*/
|
|
89
|
-
function sharePackages(packages) {
|
|
90
|
-
const pkgJson = (0, package_json_1.readRootPackageJson)();
|
|
91
|
-
const allPackages = [];
|
|
92
|
-
packages.forEach((pkg) => {
|
|
93
|
-
const pkgVersion = pkgJson.dependencies?.[pkg] ?? pkgJson.devDependencies?.[pkg];
|
|
94
|
-
allPackages.push({ name: pkg, version: pkgVersion });
|
|
95
|
-
(0, secondary_entry_points_1.collectPackageSecondaryEntryPoints)(pkg, pkgVersion, allPackages);
|
|
96
|
-
});
|
|
97
|
-
return allPackages.reduce((shared, pkg) => {
|
|
98
|
-
const config = getNpmPackageSharedConfig(pkg.name, pkg.version);
|
|
99
|
-
if (config) {
|
|
100
|
-
shared[pkg.name] = config;
|
|
101
|
-
}
|
|
102
|
-
return shared;
|
|
103
|
-
}, {});
|
|
104
|
-
}
|
|
105
|
-
exports.sharePackages = sharePackages;
|
|
106
|
-
/**
|
|
107
|
-
* Apply a custom function provided by the user that will modify the Shared Config
|
|
108
|
-
* of the dependencies for the Module Federation build.
|
|
109
|
-
*
|
|
110
|
-
* @param sharedConfig - The original Shared Config to be modified
|
|
111
|
-
* @param sharedFn - The custom function to run
|
|
112
|
-
*/
|
|
113
|
-
function applySharedFunction(sharedConfig, sharedFn) {
|
|
114
|
-
if (!sharedFn) {
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
for (const [libraryName, library] of Object.entries(sharedConfig)) {
|
|
118
|
-
const mappedDependency = sharedFn(libraryName, library);
|
|
119
|
-
if (mappedDependency === false) {
|
|
120
|
-
delete sharedConfig[libraryName];
|
|
121
|
-
continue;
|
|
122
|
-
}
|
|
123
|
-
else if (!mappedDependency) {
|
|
124
|
-
continue;
|
|
125
|
-
}
|
|
126
|
-
sharedConfig[libraryName] = mappedDependency;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
exports.applySharedFunction = applySharedFunction;
|
|
130
|
-
/**
|
|
131
|
-
* Add additional dependencies to the shared package that may not have been
|
|
132
|
-
* discovered by the project graph.
|
|
133
|
-
*
|
|
134
|
-
* This can be useful for applications that use a Dependency Injection system
|
|
135
|
-
* that expects certain Singleton values to be present in the shared injection
|
|
136
|
-
* hierarchy.
|
|
137
|
-
*
|
|
138
|
-
* @param sharedConfig - The original Shared Config
|
|
139
|
-
* @param additionalShared - The additional dependencies to add
|
|
140
|
-
* @param projectGraph - The Nx project graph
|
|
141
|
-
*/
|
|
142
|
-
function applyAdditionalShared(sharedConfig, additionalShared, projectGraph) {
|
|
143
|
-
if (!additionalShared) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
for (const shared of additionalShared) {
|
|
147
|
-
if (typeof shared === 'string') {
|
|
148
|
-
addStringDependencyToSharedConfig(sharedConfig, shared, projectGraph);
|
|
149
|
-
}
|
|
150
|
-
else if (Array.isArray(shared)) {
|
|
151
|
-
sharedConfig[shared[0]] = shared[1];
|
|
152
|
-
}
|
|
153
|
-
else if (typeof shared === 'object') {
|
|
154
|
-
sharedConfig[shared.libraryName] = shared.sharedConfig;
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
exports.applyAdditionalShared = applyAdditionalShared;
|
|
159
|
-
function addStringDependencyToSharedConfig(sharedConfig, dependency, projectGraph) {
|
|
160
|
-
if (projectGraph.nodes[dependency]) {
|
|
161
|
-
sharedConfig[dependency] = { requiredVersion: false };
|
|
162
|
-
}
|
|
163
|
-
else if (projectGraph.externalNodes?.[`npm:${dependency}`]) {
|
|
164
|
-
const pkgJson = (0, package_json_1.readRootPackageJson)();
|
|
165
|
-
const config = getNpmPackageSharedConfig(dependency, pkgJson.dependencies?.[dependency] ??
|
|
166
|
-
pkgJson.devDependencies?.[dependency]);
|
|
167
|
-
if (!config) {
|
|
168
|
-
return;
|
|
169
|
-
}
|
|
170
|
-
sharedConfig[dependency] = config;
|
|
171
|
-
}
|
|
172
|
-
else {
|
|
173
|
-
throw new Error(`The specified dependency "${dependency}" in the additionalShared configuration does not exist in the project graph. ` +
|
|
174
|
-
`Please check your additionalShared configuration and make sure you are including valid workspace projects or npm packages.`);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
function getEmptySharedLibrariesConfig() {
|
|
178
|
-
const webpack = require('webpack');
|
|
179
|
-
return {
|
|
180
|
-
getAliases: () => ({}),
|
|
181
|
-
getLibraries: () => ({}),
|
|
182
|
-
getReplacementPlugin: () => new webpack.NormalModuleReplacementPlugin(/./, () => { }),
|
|
183
|
-
};
|
|
184
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ParsedCommandLine } from 'typescript';
|
|
2
|
-
export declare function readTsPathMappings(tsConfigPath?: string): ParsedCommandLine['options']['paths'];
|
|
3
|
-
export declare function readTsConfig(tsConfigPath: string): ParsedCommandLine;
|
|
4
|
-
export declare function getRootTsConfigPath(): string | null;
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getRootTsConfigPath = exports.readTsConfig = exports.readTsPathMappings = void 0;
|
|
4
|
-
const fs_1 = require("fs");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
const nx_1 = require("../../../nx");
|
|
7
|
-
const { workspaceRoot } = (0, nx_1.requireNx)();
|
|
8
|
-
let tsConfig;
|
|
9
|
-
let tsPathMappings;
|
|
10
|
-
function readTsPathMappings(tsConfigPath = process.env.NX_TSCONFIG_PATH ?? getRootTsConfigPath()) {
|
|
11
|
-
if (tsPathMappings) {
|
|
12
|
-
return tsPathMappings;
|
|
13
|
-
}
|
|
14
|
-
tsConfig ??= readTsConfiguration(tsConfigPath);
|
|
15
|
-
tsPathMappings = {};
|
|
16
|
-
Object.entries(tsConfig.options?.paths ?? {}).forEach(([alias, paths]) => {
|
|
17
|
-
tsPathMappings[alias] = paths.map((path) => path.replace(/^\.\//, ''));
|
|
18
|
-
});
|
|
19
|
-
return tsPathMappings;
|
|
20
|
-
}
|
|
21
|
-
exports.readTsPathMappings = readTsPathMappings;
|
|
22
|
-
function readTsConfiguration(tsConfigPath) {
|
|
23
|
-
if (!(0, fs_1.existsSync)(tsConfigPath)) {
|
|
24
|
-
throw new Error(`NX MF: TsConfig Path for workspace libraries does not exist! (${tsConfigPath}).`);
|
|
25
|
-
}
|
|
26
|
-
return readTsConfig(tsConfigPath);
|
|
27
|
-
}
|
|
28
|
-
let tsModule;
|
|
29
|
-
function readTsConfig(tsConfigPath) {
|
|
30
|
-
if (!tsModule) {
|
|
31
|
-
tsModule = require('typescript');
|
|
32
|
-
}
|
|
33
|
-
const readResult = tsModule.readConfigFile(tsConfigPath, tsModule.sys.readFile);
|
|
34
|
-
return tsModule.parseJsonConfigFileContent(readResult.config, tsModule.sys, (0, path_1.dirname)(tsConfigPath));
|
|
35
|
-
}
|
|
36
|
-
exports.readTsConfig = readTsConfig;
|
|
37
|
-
function getRootTsConfigPath() {
|
|
38
|
-
const tsConfigFileName = getRootTsConfigFileName();
|
|
39
|
-
return tsConfigFileName ? (0, path_1.join)(workspaceRoot, tsConfigFileName) : null;
|
|
40
|
-
}
|
|
41
|
-
exports.getRootTsConfigPath = getRootTsConfigPath;
|
|
42
|
-
function getRootTsConfigFileName() {
|
|
43
|
-
for (const tsConfigName of ['tsconfig.base.json', 'tsconfig.json']) {
|
|
44
|
-
const tsConfigPath = (0, path_1.join)(workspaceRoot, tsConfigName);
|
|
45
|
-
if ((0, fs_1.existsSync)(tsConfigPath)) {
|
|
46
|
-
return tsConfigName;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
return null;
|
|
50
|
-
}
|