@angular-architects/native-federation 0.9.0 → 0.9.2
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 +314 -259
- package/builders.json +10 -10
- package/collection.json +17 -17
- package/executors.json +10 -10
- package/generators.json +12 -12
- package/package.json +19 -9
- package/src/builders/build/builder.js +99 -177
- package/src/builders/build/builder.js.map +1 -1
- package/src/builders/build/schema.d.ts +3 -3
- package/src/builders/build/schema.json +550 -550
- package/src/config.d.ts +2 -2
- package/src/config.js +7 -7
- package/src/config.js.map +1 -1
- package/src/executors/build/schema.d.ts +1 -1
- package/src/executors/build/schema.json +9 -9
- package/src/generators/native-federation/schema.d.ts +5 -5
- package/src/generators/native-federation/schema.json +29 -29
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/schematics/init/files/{federation.config.js → federation.config.js__tmpl__} +0 -4
- package/src/schematics/init/schema.d.ts +6 -6
- package/src/schematics/init/schema.json +34 -34
- package/src/schematics/init/schematic.js +35 -29
- package/src/schematics/init/schematic.js.map +1 -1
- package/src/utils/angular-esbuild-adapter.d.ts +3 -0
- package/src/utils/angular-esbuild-adapter.js +88 -0
- package/src/utils/angular-esbuild-adapter.js.map +1 -0
- package/src/utils/rollup.d.ts +1 -0
- package/src/utils/rollup.js +58 -0
- package/src/utils/rollup.js.map +1 -0
- package/src/utils/shared-mappings-plugin.d.ts +1 -1
- package/src/config/federation-config.d.ts +0 -26
- package/src/config/federation-config.js +0 -3
- package/src/config/federation-config.js.map +0 -1
- package/src/config/index.d.ts +0 -2
- package/src/config/index.js +0 -10
- package/src/config/index.js.map +0 -1
- package/src/config/with-native-federation.d.ts +0 -2
- package/src/config/with-native-federation.js +0 -53
- package/src/config/with-native-federation.js.map +0 -1
- package/src/utils/build-utils.d.ts +0 -9
- package/src/utils/build-utils.js +0 -38
- package/src/utils/build-utils.js.map +0 -1
- package/src/utils/hash-file.d.ts +0 -1
- package/src/utils/hash-file.js +0 -13
- package/src/utils/hash-file.js.map +0 -1
- package/src/utils/mapped-paths.d.ts +0 -10
- package/src/utils/mapped-paths.js +0 -37
- package/src/utils/mapped-paths.js.map +0 -1
- package/src/utils/package-info.d.ts +0 -7
- package/src/utils/package-info.js +0 -94
- package/src/utils/package-info.js.map +0 -1
package/executors.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"executors": {
|
|
4
|
-
"build": {
|
|
5
|
-
"implementation": "./src/executors/build/executor",
|
|
6
|
-
"schema": "./src/executors/build/schema.json",
|
|
7
|
-
"description": "build executor"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"executors": {
|
|
4
|
+
"build": {
|
|
5
|
+
"implementation": "./src/executors/build/executor",
|
|
6
|
+
"schema": "./src/executors/build/schema.json",
|
|
7
|
+
"description": "build executor"
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
package/generators.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"name": "native-federation",
|
|
4
|
-
"version": "0.0.1",
|
|
5
|
-
"generators": {
|
|
6
|
-
"native-federation": {
|
|
7
|
-
"factory": "./src/generators/native-federation/generator",
|
|
8
|
-
"schema": "./src/generators/native-federation/schema.json",
|
|
9
|
-
"description": "native-federation generator"
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"name": "native-federation",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"generators": {
|
|
6
|
+
"native-federation": {
|
|
7
|
+
"factory": "./src/generators/native-federation/generator",
|
|
8
|
+
"schema": "./src/generators/native-federation/schema.json",
|
|
9
|
+
"description": "native-federation generator"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular-architects/native-federation",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.2",
|
|
4
4
|
"main": "src/index.js",
|
|
5
5
|
"generators": "./collection.json",
|
|
6
6
|
"builders": "./builders.json",
|
|
@@ -14,14 +14,24 @@
|
|
|
14
14
|
"type": "git",
|
|
15
15
|
"url": "https://github.com/angular-architects/module-federation-plugin"
|
|
16
16
|
},
|
|
17
|
-
"
|
|
17
|
+
"dependencies": {
|
|
18
18
|
"@angular-architects/build-angular": "^14.2.0-next.0",
|
|
19
|
-
"@
|
|
20
|
-
"@
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
19
|
+
"@rollup/plugin-commonjs": "^22.0.2",
|
|
20
|
+
"@rollup/plugin-node-resolve": "^13.3.0",
|
|
21
|
+
"@rollup/plugin-replace": "^4.0.0",
|
|
22
|
+
"rollup": "^2.79.0",
|
|
23
|
+
"rollup-plugin-node-externals": "^4.1.1",
|
|
24
|
+
"esbuild": "^0.15.5",
|
|
25
|
+
"@babel/core": "^7.19.0",
|
|
26
|
+
"@softarc/native-federation": "1.0.0-beta.1",
|
|
27
|
+
"@softarc/native-federation-runtime": "1.0.0-beta.1",
|
|
28
|
+
"@rollup/plugin-json": "^4.1.0",
|
|
29
|
+
"cross-spawn": "^7.0.3",
|
|
30
|
+
"rollup-plugin-terser": "^7.0.2",
|
|
31
|
+
"npmlog": "^6.0.2"
|
|
32
|
+
},
|
|
33
|
+
"peerDependencies": {
|
|
34
|
+
"@angular/compiler-cli": "*"
|
|
24
35
|
},
|
|
25
|
-
"typings": "./src/index.d.ts"
|
|
26
|
-
"dependencies": {}
|
|
36
|
+
"typings": "./src/index.d.ts"
|
|
27
37
|
}
|
|
@@ -6,40 +6,101 @@ const architect_1 = require("@angular-devkit/architect");
|
|
|
6
6
|
const index_1 = require("@angular-architects/build-angular/src/builders/browser-esbuild/index");
|
|
7
7
|
const path = require("path");
|
|
8
8
|
const fs = require("fs");
|
|
9
|
-
const
|
|
10
|
-
const package_info_1 = require("../../utils/package-info");
|
|
9
|
+
const build_1 = require("@softarc/native-federation/build");
|
|
11
10
|
const shared_mappings_plugin_1 = require("../../utils/shared-mappings-plugin");
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
const build_2 = require("@softarc/native-federation/build");
|
|
12
|
+
const angular_esbuild_adapter_1 = require("../../utils/angular-esbuild-adapter");
|
|
13
|
+
const build_3 = require("@softarc/native-federation/build");
|
|
14
|
+
const build_4 = require("@softarc/native-federation/build");
|
|
15
|
+
const build_5 = require("@softarc/native-federation/build");
|
|
16
|
+
const crossSpawn = require("cross-spawn");
|
|
18
17
|
function runBuilder(options, context) {
|
|
19
18
|
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const federationInfo = {
|
|
29
|
-
name: config.name,
|
|
30
|
-
shared: sharedInfo,
|
|
31
|
-
exposes: exposesInfo,
|
|
19
|
+
(0, build_2.setBuildAdapter)(angular_esbuild_adapter_1.AngularEsBuildAdapter);
|
|
20
|
+
(0, build_1.setLogLevel)(options.verbose ? 'verbose' : 'info');
|
|
21
|
+
const fedOptions = {
|
|
22
|
+
workspaceRoot: context.workspaceRoot,
|
|
23
|
+
outputPath: options.outputPath,
|
|
24
|
+
federationConfig: infereConfigPath(options.tsConfig),
|
|
25
|
+
tsConfig: options.tsConfig,
|
|
26
|
+
verbose: options.verbose,
|
|
32
27
|
};
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
const config = yield (0, build_4.loadFederationConfig)(fedOptions);
|
|
29
|
+
const externals = (0, build_3.getExternals)(config);
|
|
30
|
+
runNgccIfNeeded(fedOptions, fedOptions.workspaceRoot);
|
|
31
|
+
options.externalDependencies = externals.filter((e) => e !== 'tslib');
|
|
32
|
+
const output = yield build(config, options, context);
|
|
33
|
+
yield (0, build_5.buildForFederation)(config, fedOptions, externals);
|
|
34
|
+
updateIndexHtml(fedOptions);
|
|
36
35
|
return output;
|
|
37
36
|
});
|
|
38
37
|
}
|
|
39
38
|
exports.runBuilder = runBuilder;
|
|
40
39
|
exports.default = (0, architect_1.createBuilder)(runBuilder);
|
|
41
|
-
function
|
|
42
|
-
const
|
|
40
|
+
function runNgccIfNeeded(fedOptions, workspaceRoot) {
|
|
41
|
+
const hash = getLockFileHash(fedOptions);
|
|
42
|
+
const skip = skipNgcc(hash, workspaceRoot);
|
|
43
|
+
if (!skip) {
|
|
44
|
+
runNgcc(workspaceRoot);
|
|
45
|
+
writeNgccLock(hash, workspaceRoot);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
function runNgcc(workspaceRoot) {
|
|
49
|
+
build_1.logger.verbose('Running ngcc');
|
|
50
|
+
const command = getNpxCommand(workspaceRoot);
|
|
51
|
+
const result = crossSpawn.sync(command, ['ngcc', '--async', '--create-ivy-entry-points', '--first-only'], { stdio: 'inherit' });
|
|
52
|
+
if (result.status !== 0) {
|
|
53
|
+
const error = result.error || '';
|
|
54
|
+
build_1.logger.error('Error running ngcc: ' + error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function getLockFileHash(fedOptions) {
|
|
58
|
+
const lockFileName = getLockFileName(fedOptions.workspaceRoot);
|
|
59
|
+
const hash = (0, build_1.hashFile)(lockFileName);
|
|
60
|
+
return hash;
|
|
61
|
+
}
|
|
62
|
+
const NGCC_LOCK_DIR = 'node_modules/.cache/native-federation/ngcc';
|
|
63
|
+
function skipNgcc(hash, workspaceRoot) {
|
|
64
|
+
const ngccLockFileDir = path.join(workspaceRoot, NGCC_LOCK_DIR);
|
|
65
|
+
const ngccLockFileName = path.join(ngccLockFileDir, hash + '.lock');
|
|
66
|
+
let exists = false;
|
|
67
|
+
if (fs.existsSync(ngccLockFileName)) {
|
|
68
|
+
exists = true;
|
|
69
|
+
}
|
|
70
|
+
return exists;
|
|
71
|
+
}
|
|
72
|
+
function writeNgccLock(hash, workspaceRoot) {
|
|
73
|
+
const ngccLockFileDir = path.join(workspaceRoot, NGCC_LOCK_DIR);
|
|
74
|
+
const ngccLockFileName = path.join(ngccLockFileDir, hash + '.lock');
|
|
75
|
+
if (!fs.existsSync(ngccLockFileDir)) {
|
|
76
|
+
fs.mkdirSync(ngccLockFileDir, { recursive: true });
|
|
77
|
+
}
|
|
78
|
+
fs.writeFileSync(ngccLockFileName, '');
|
|
79
|
+
}
|
|
80
|
+
function getLockFileName(workspaceRoot) {
|
|
81
|
+
let candPath = '';
|
|
82
|
+
for (const candLock of ['package-lock.json', 'yarn.lock', 'pnpm-lock.yaml']) {
|
|
83
|
+
candPath = path.join(workspaceRoot, candLock);
|
|
84
|
+
if (fs.existsSync(candPath)) {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return candPath;
|
|
89
|
+
}
|
|
90
|
+
function getNpxCommand(workspaceRoot) {
|
|
91
|
+
switch (getLockFileName(workspaceRoot)) {
|
|
92
|
+
case 'package-lock.json':
|
|
93
|
+
return 'npx';
|
|
94
|
+
case 'yarn.lock':
|
|
95
|
+
return 'yarn';
|
|
96
|
+
case 'pnpm-lock.yaml':
|
|
97
|
+
return 'pnpx';
|
|
98
|
+
default:
|
|
99
|
+
return 'npx';
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
function updateIndexHtml(fedOptions) {
|
|
103
|
+
const outputPath = path.join(fedOptions.workspaceRoot, fedOptions.outputPath);
|
|
43
104
|
const indexPath = path.join(outputPath, 'index.html');
|
|
44
105
|
const mainName = fs
|
|
45
106
|
.readdirSync(outputPath)
|
|
@@ -47,15 +108,15 @@ function updateIndexHtml(context, options) {
|
|
|
47
108
|
const polyfillsName = fs
|
|
48
109
|
.readdirSync(outputPath)
|
|
49
110
|
.find((f) => f.startsWith('polyfills.') && f.endsWith('.js'));
|
|
50
|
-
const htmlFragment = `
|
|
51
|
-
<script type="esms-options">
|
|
52
|
-
{
|
|
53
|
-
"shimMode": true
|
|
54
|
-
}
|
|
55
|
-
</script>
|
|
56
|
-
|
|
57
|
-
<script type="module" src="${polyfillsName}"></script>
|
|
58
|
-
<script type="module-shim" src="${mainName}"></script>
|
|
111
|
+
const htmlFragment = `
|
|
112
|
+
<script type="esms-options">
|
|
113
|
+
{
|
|
114
|
+
"shimMode": true
|
|
115
|
+
}
|
|
116
|
+
</script>
|
|
117
|
+
|
|
118
|
+
<script type="module" src="${polyfillsName}"></script>
|
|
119
|
+
<script type="module-shim" src="${mainName}"></script>
|
|
59
120
|
`;
|
|
60
121
|
const indexContent = fs.readFileSync(indexPath, 'utf-8');
|
|
61
122
|
const updatedContent = indexContent.replace('</body>', `${htmlFragment}</body>`);
|
|
@@ -77,148 +138,9 @@ function build(config, options, context) {
|
|
|
77
138
|
return output;
|
|
78
139
|
});
|
|
79
140
|
}
|
|
80
|
-
function
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
const importMap = { imports };
|
|
85
|
-
const importMapPath = path.join(context.workspaceRoot, options.outputPath, 'importmap.json');
|
|
86
|
-
fs.writeFileSync(importMapPath, JSON.stringify(importMap, null, 2));
|
|
87
|
-
}
|
|
88
|
-
function writeFederationInfo(federationInfo, context, options) {
|
|
89
|
-
const metaDataPath = path.join(context.workspaceRoot, options.outputPath, 'remoteEntry.json');
|
|
90
|
-
fs.writeFileSync(metaDataPath, JSON.stringify(federationInfo, null, 2));
|
|
91
|
-
}
|
|
92
|
-
function bundleShared(config, options, context, externals) {
|
|
93
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
94
|
-
const result = [];
|
|
95
|
-
const packageInfos = Object.keys(config.shared)
|
|
96
|
-
.filter(packageName => !DEFAULT_SKIP_LIST.has(packageName))
|
|
97
|
-
.map(packageName => (0, package_info_1.getPackageInfo)(packageName, context))
|
|
98
|
-
.filter((pi) => !!pi);
|
|
99
|
-
for (const pi of packageInfos) {
|
|
100
|
-
console.info('Bundling shared package', pi.packageName, '...');
|
|
101
|
-
const encName = pi.packageName.replace(/[^A-Za-z0-9]/g, '_');
|
|
102
|
-
const encVersion = pi.version.replace(/[^A-Za-z0-9]/g, '_');
|
|
103
|
-
const outFileName = `${encName}-${encVersion}.js`;
|
|
104
|
-
const cachePath = path.join(context.workspaceRoot, 'node_modules/.cache/native-federation');
|
|
105
|
-
fs.mkdirSync(cachePath, { recursive: true });
|
|
106
|
-
const cachedFile = path.join(cachePath, outFileName);
|
|
107
|
-
if (!fs.existsSync(cachedFile)) {
|
|
108
|
-
yield (0, build_utils_1.bundle)({
|
|
109
|
-
entryPoint: pi.entryPoint,
|
|
110
|
-
tsConfigPath: options.tsConfig,
|
|
111
|
-
external: externals,
|
|
112
|
-
outfile: cachedFile,
|
|
113
|
-
mappedPaths: config.sharedMappings,
|
|
114
|
-
useSharedMappingPlugin: true,
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
const shared = config.shared[pi.packageName];
|
|
118
|
-
result.push({
|
|
119
|
-
packageName: pi.packageName,
|
|
120
|
-
outFileName: outFileName,
|
|
121
|
-
requiredVersion: shared.requiredVersion,
|
|
122
|
-
singleton: shared.singleton,
|
|
123
|
-
strictVersion: shared.strictVersion,
|
|
124
|
-
version: pi.version,
|
|
125
|
-
});
|
|
126
|
-
const fullOutputPath = path.join(context.workspaceRoot, options.outputPath, outFileName);
|
|
127
|
-
fs.copyFileSync(cachedFile, fullOutputPath);
|
|
128
|
-
copySrcMapIfExists(cachedFile, fullOutputPath);
|
|
129
|
-
}
|
|
130
|
-
return result;
|
|
131
|
-
});
|
|
132
|
-
}
|
|
133
|
-
function copySrcMapIfExists(cachedFile, fullOutputPath) {
|
|
134
|
-
const mapSrc = cachedFile + '.map';
|
|
135
|
-
const mapDest = fullOutputPath + '.map';
|
|
136
|
-
if (fs.existsSync(mapSrc)) {
|
|
137
|
-
fs.copyFileSync(mapSrc, mapDest);
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
function bundleSharedMappings(config, options, context, externals) {
|
|
141
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
142
|
-
const result = [];
|
|
143
|
-
for (const m of config.sharedMappings) {
|
|
144
|
-
const key = m.key.replace(/[^A-Za-z0-9]/g, '_');
|
|
145
|
-
const outFileName = key + '.js';
|
|
146
|
-
const outFilePath = path.join(options.outputPath, outFileName);
|
|
147
|
-
console.info('Bundling shared mapping', m.key, '...');
|
|
148
|
-
try {
|
|
149
|
-
yield (0, build_utils_1.bundle)({
|
|
150
|
-
entryPoint: m.path,
|
|
151
|
-
tsConfigPath: options.tsConfig,
|
|
152
|
-
external: externals,
|
|
153
|
-
outfile: outFilePath,
|
|
154
|
-
mappedPaths: config.sharedMappings,
|
|
155
|
-
useSharedMappingPlugin: false,
|
|
156
|
-
});
|
|
157
|
-
const hash = (0, hash_file_1.hashFile)(outFilePath);
|
|
158
|
-
const hashedOutFileName = `${key}-${hash}.js`;
|
|
159
|
-
const hashedOutFilePath = path.join(options.outputPath, hashedOutFileName);
|
|
160
|
-
fs.renameSync(outFilePath, hashedOutFilePath);
|
|
161
|
-
result.push({
|
|
162
|
-
packageName: m.key,
|
|
163
|
-
outFileName: hashedOutFileName,
|
|
164
|
-
requiredVersion: '',
|
|
165
|
-
singleton: true,
|
|
166
|
-
strictVersion: false,
|
|
167
|
-
version: '',
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
catch (e) {
|
|
171
|
-
context.logger.error('Error bundling shared mapping ' + m.key);
|
|
172
|
-
context.logger.error(` >> If you don't need this mapping to shared, you can explicity configure the sharedMappings property in your federation.config.js`);
|
|
173
|
-
if (options.verbose) {
|
|
174
|
-
console.error(e);
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
return result;
|
|
179
|
-
});
|
|
180
|
-
}
|
|
181
|
-
function bundleExposed(config, options, externals) {
|
|
182
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
183
|
-
const result = [];
|
|
184
|
-
for (const key in config.exposes) {
|
|
185
|
-
const outFileName = key + '.js';
|
|
186
|
-
const outFilePath = path.join(options.outputPath, outFileName);
|
|
187
|
-
const entryPoint = config.exposes[key];
|
|
188
|
-
console.info('Bundle exposed file', entryPoint, '...');
|
|
189
|
-
yield (0, build_utils_1.bundle)({
|
|
190
|
-
entryPoint,
|
|
191
|
-
tsConfigPath: options.tsConfig,
|
|
192
|
-
external: externals,
|
|
193
|
-
outfile: outFilePath,
|
|
194
|
-
mappedPaths: config.sharedMappings,
|
|
195
|
-
useSharedMappingPlugin: true,
|
|
196
|
-
});
|
|
197
|
-
const hash = (0, hash_file_1.hashFile)(outFilePath);
|
|
198
|
-
const hashedOutFileName = `${key}-${hash}.js`;
|
|
199
|
-
const hashedOutFilePath = path.join(options.outputPath, hashedOutFileName);
|
|
200
|
-
fs.renameSync(outFilePath, hashedOutFilePath);
|
|
201
|
-
result.push({ key, outFileName: hashedOutFileName });
|
|
202
|
-
}
|
|
203
|
-
return result;
|
|
204
|
-
});
|
|
205
|
-
}
|
|
206
|
-
function getExternals(config) {
|
|
207
|
-
const shared = Object.keys(config.shared);
|
|
208
|
-
const sharedMappings = config.sharedMappings.map((m) => m.key);
|
|
209
|
-
const externals = [...shared, ...sharedMappings];
|
|
210
|
-
return externals.filter((p) => !DEFAULT_SKIP_LIST.has(p));
|
|
211
|
-
}
|
|
212
|
-
function loadFederationConfig(options, context) {
|
|
213
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
214
|
-
const relProjectPath = path.dirname(options.tsConfig);
|
|
215
|
-
const fullProjectPath = path.join(context.workspaceRoot, relProjectPath);
|
|
216
|
-
const fullConfigPath = path.join(fullProjectPath, 'federation.config.js');
|
|
217
|
-
if (!fs.existsSync(fullConfigPath)) {
|
|
218
|
-
throw new Error('Expected ' + fullConfigPath);
|
|
219
|
-
}
|
|
220
|
-
const config = (yield Promise.resolve().then(() => require(fullConfigPath)));
|
|
221
|
-
return config;
|
|
222
|
-
});
|
|
141
|
+
function infereConfigPath(tsConfig) {
|
|
142
|
+
const relProjectPath = path.dirname(tsConfig);
|
|
143
|
+
const relConfigPath = path.join(relProjectPath, 'federation.config.js');
|
|
144
|
+
return relConfigPath;
|
|
223
145
|
}
|
|
224
146
|
//# sourceMappingURL=builder.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../../../../libs/native-federation/src/builders/build/builder.ts"],"names":[],"mappings":";;;;AAAA,yDAImC;AAEnC,gGAA2G;AAG3G,6BAA6B;AAC7B,yBAAyB;
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../../../../../../libs/native-federation/src/builders/build/builder.ts"],"names":[],"mappings":";;;;AAAA,yDAImC;AAEnC,gGAA2G;AAG3G,6BAA6B;AAC7B,yBAAyB;AACzB,4DAK0C;AAG1C,+EAAgF;AAEhF,4DAAmE;AACnE,iFAA4E;AAC5E,4DAAgE;AAChE,4DAAwE;AACxE,4DAAsE;AAEtE,0CAA0C;AAE1C,SAAsB,UAAU,CAC9B,OAAe,EACf,OAAuB;;QAEvB,IAAA,uBAAe,EAAC,+CAAqB,CAAC,CAAC;QACvC,IAAA,mBAAW,EAAC,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;QAElD,MAAM,UAAU,GAAsB;YACpC,aAAa,EAAE,OAAO,CAAC,aAAa;YACpC,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,gBAAgB,EAAE,gBAAgB,CAAC,OAAO,CAAC,QAAQ,CAAC;YACpD,QAAQ,EAAE,OAAO,CAAC,QAAQ;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AAC,CAAC;IAEhE,MAAM,YAAY,GAAG;;;;;;;6BAOM,aAAa;kCACR,QAAQ;CACzC,CAAC;IAEA,MAAM,YAAY,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACzD,MAAM,cAAc,GAAG,YAAY,CAAC,OAAO,CACzC,SAAS,EACT,GAAG,YAAY,SAAS,CACzB,CAAC;IACF,EAAE,CAAC,aAAa,CAAC,SAAS,EAAE,cAAc,EAAE,OAAO,CAAC,CAAC;AACvD,CAAC;AAED,SAAe,KAAK,CAClB,MAAkC,EAClC,OAAe,EACf,OAAuB;;QAEvB,MAAM,oBAAoB,GAAuC,CAC/D,OAAO,EACP,EAAE;YACF,OAAO,CAAC,OAAO,GAAG;gBAChB,GAAG,OAAO,CAAC,OAAO;gBAClB,IAAA,mDAA0B,EAAC,MAAM,CAAC,cAAc,CAAC;aAClD,CAAC;YACF,OAAO,OAAO,CAAC;QACjB,CAAC,CAAC;QAEF,kDAAkD;QAClD,MAAM,MAAM,GAAG,MAAM,IAAA,2BAAmB,EAAC,OAAO,EAAE,OAAc,EAAE;YAChE,oBAAoB;SACrB,CAAC,CAAC;QACH,OAAO,MAAM,CAAC;IAChB,CAAC;CAAA;AAED,SAAS,gBAAgB,CAAC,QAAgB;IACxC,MAAM,cAAc,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;IAExE,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { JsonObject } from '@angular-devkit/core';
|
|
2
|
-
|
|
3
|
-
export interface BuildBuilderSchema extends JsonObject {} // eslint-disable-line
|
|
1
|
+
import { JsonObject } from '@angular-devkit/core';
|
|
2
|
+
|
|
3
|
+
export interface BuildBuilderSchema extends JsonObject {} // eslint-disable-line
|