@softarc/native-federation 3.5.0 → 4.0.0-RC1
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/package.json +33 -5
- package/src/config.d.ts +5 -1
- package/src/config.d.ts.map +1 -0
- package/src/config.js +4 -6
- package/src/domain.d.ts +3 -0
- package/src/domain.d.ts.map +1 -0
- package/src/domain.js +2 -0
- package/src/index.d.ts +9 -1
- package/src/index.d.ts.map +1 -0
- package/src/index.js +8 -5
- package/src/internal.d.ts +12 -0
- package/src/internal.d.ts.map +1 -0
- package/src/internal.js +8 -0
- package/src/lib/config/configuration-context.d.ts +1 -0
- package/src/lib/config/configuration-context.d.ts.map +1 -0
- package/src/lib/config/configuration-context.js +3 -9
- package/src/lib/config/default-skip-list.d.ts +5 -0
- package/src/lib/config/default-skip-list.d.ts.map +1 -0
- package/src/lib/{core → config}/default-skip-list.js +10 -16
- package/src/lib/config/share-utils.d.ts +7 -17
- package/src/lib/config/share-utils.d.ts.map +1 -0
- package/src/lib/config/share-utils.js +50 -123
- package/src/lib/config/with-native-federation.d.ts +2 -1
- package/src/lib/config/with-native-federation.d.ts.map +1 -0
- package/src/lib/config/with-native-federation.js +16 -20
- package/src/lib/core/build-adapter.d.ts +4 -28
- package/src/lib/core/build-adapter.d.ts.map +1 -0
- package/src/lib/core/build-adapter.js +4 -9
- package/src/lib/core/build-for-federation.d.ts +5 -8
- package/src/lib/core/build-for-federation.d.ts.map +1 -0
- package/src/lib/core/build-for-federation.js +38 -45
- package/src/lib/core/bundle-exposed-and-mappings.d.ts +4 -7
- package/src/lib/core/bundle-exposed-and-mappings.d.ts.map +1 -0
- package/src/lib/core/bundle-exposed-and-mappings.js +32 -42
- package/src/lib/core/bundle-shared.d.ts +6 -4
- package/src/lib/core/bundle-shared.d.ts.map +1 -0
- package/src/lib/core/bundle-shared.js +59 -65
- package/src/lib/core/default-external-list.d.ts +1 -0
- package/src/lib/core/default-external-list.d.ts.map +1 -0
- package/src/lib/core/default-external-list.js +1 -5
- package/src/lib/core/default-server-deps-list.d.ts +1 -0
- package/src/lib/core/default-server-deps-list.d.ts.map +1 -0
- package/src/lib/core/default-server-deps-list.js +2 -6
- package/src/lib/core/federation-builder.d.ts +7 -6
- package/src/lib/core/federation-builder.d.ts.map +1 -0
- package/src/lib/core/federation-builder.js +14 -19
- package/src/lib/core/get-externals.d.ts +2 -1
- package/src/lib/core/get-externals.d.ts.map +1 -0
- package/src/lib/core/get-externals.js +2 -6
- package/src/lib/core/load-federation-config.d.ts +3 -2
- package/src/lib/core/load-federation-config.d.ts.map +1 -0
- package/src/lib/core/load-federation-config.js +6 -12
- package/src/lib/core/remove-unused-deps.d.ts +2 -1
- package/src/lib/core/remove-unused-deps.d.ts.map +1 -0
- package/src/lib/core/remove-unused-deps.js +21 -29
- package/src/lib/core/write-federation-info.d.ts +3 -2
- package/src/lib/core/write-federation-info.d.ts.map +1 -0
- package/src/lib/core/write-federation-info.js +3 -8
- package/src/lib/core/write-import-map.d.ts +3 -2
- package/src/lib/core/write-import-map.d.ts.map +1 -0
- package/src/lib/core/write-import-map.js +3 -8
- package/src/lib/domain/config/external-config.contract.d.ts +40 -0
- package/src/lib/domain/config/external-config.contract.d.ts.map +1 -0
- package/src/lib/domain/config/external-config.contract.js +1 -0
- package/src/lib/domain/config/federation-config.contract.d.ts +28 -0
- package/src/lib/domain/config/federation-config.contract.d.ts.map +1 -0
- package/src/lib/domain/config/federation-config.contract.js +1 -0
- package/src/lib/domain/config/index.d.ts +4 -0
- package/src/lib/domain/config/index.d.ts.map +1 -0
- package/src/lib/domain/config/index.js +1 -0
- package/src/lib/{core/default-skip-list.d.ts → domain/config/skip-list.contract.d.ts} +1 -3
- package/src/lib/domain/config/skip-list.contract.d.ts.map +1 -0
- package/src/lib/domain/config/skip-list.contract.js +1 -0
- package/src/lib/domain/core/build-adapter.contract.d.ts +28 -0
- package/src/lib/domain/core/build-adapter.contract.d.ts.map +1 -0
- package/src/lib/domain/core/build-adapter.contract.js +1 -0
- package/src/lib/domain/core/build-notification-options.contract.d.ts +10 -0
- package/src/lib/domain/core/build-notification-options.contract.d.ts.map +1 -0
- package/src/lib/domain/core/build-notification-options.contract.js +6 -0
- package/src/lib/domain/core/build-params.contract.d.ts +6 -0
- package/src/lib/domain/core/build-params.contract.d.ts.map +1 -0
- package/src/lib/domain/core/build-params.contract.js +1 -0
- package/src/lib/domain/core/federation-info.contract.d.ts +29 -0
- package/src/lib/domain/core/federation-info.contract.d.ts.map +1 -0
- package/src/lib/domain/core/federation-info.contract.js +1 -0
- package/src/lib/{core/federation-options.d.ts → domain/core/federation-options.contract.d.ts} +2 -1
- package/src/lib/domain/core/federation-options.contract.d.ts.map +1 -0
- package/src/lib/domain/core/federation-options.contract.js +1 -0
- package/src/lib/domain/core/index.d.ts +6 -0
- package/src/lib/domain/core/index.d.ts.map +1 -0
- package/src/lib/domain/core/index.js +1 -0
- package/src/lib/domain/utils/index.d.ts +3 -0
- package/src/lib/domain/utils/index.d.ts.map +1 -0
- package/src/lib/domain/utils/index.js +1 -0
- package/src/lib/domain/utils/keyvaluepair.contract.d.ts +5 -0
- package/src/lib/domain/utils/keyvaluepair.contract.d.ts.map +1 -0
- package/src/lib/domain/utils/keyvaluepair.contract.js +1 -0
- package/src/lib/domain/utils/mapped-path.contract.d.ts +5 -0
- package/src/lib/domain/utils/mapped-path.contract.d.ts.map +1 -0
- package/src/lib/domain/utils/mapped-path.contract.js +1 -0
- package/src/lib/utils/build-result-map.d.ts +3 -2
- package/src/lib/utils/build-result-map.d.ts.map +1 -0
- package/src/lib/utils/build-result-map.js +5 -11
- package/src/lib/utils/build-utils.d.ts +3 -2
- package/src/lib/utils/build-utils.d.ts.map +1 -0
- package/src/lib/utils/build-utils.js +3 -7
- package/src/lib/utils/bundle-caching.d.ts +5 -4
- package/src/lib/utils/bundle-caching.d.ts.map +1 -0
- package/src/lib/utils/bundle-caching.js +37 -48
- package/src/lib/utils/errors.d.ts +1 -0
- package/src/lib/utils/errors.d.ts.map +1 -0
- package/src/lib/utils/errors.js +1 -6
- package/src/lib/utils/get-external-imports.d.ts +1 -0
- package/src/lib/utils/get-external-imports.d.ts.map +1 -0
- package/src/lib/utils/get-external-imports.js +5 -10
- package/src/lib/utils/hash-file.d.ts +1 -0
- package/src/lib/utils/hash-file.d.ts.map +1 -0
- package/src/lib/utils/hash-file.js +3 -8
- package/src/lib/utils/logger.d.ts +1 -0
- package/src/lib/utils/logger.d.ts.map +1 -0
- package/src/lib/utils/logger.js +10 -16
- package/src/lib/utils/mapped-paths.d.ts +2 -4
- package/src/lib/utils/mapped-paths.d.ts.map +1 -0
- package/src/lib/utils/mapped-paths.js +4 -9
- package/src/lib/utils/normalize.d.ts +1 -0
- package/src/lib/utils/normalize.d.ts.map +1 -0
- package/src/lib/utils/normalize.js +2 -7
- package/src/lib/utils/package-info.d.ts +1 -0
- package/src/lib/utils/package-info.d.ts.map +1 -0
- package/src/lib/utils/package-info.js +36 -47
- package/src/lib/utils/rebuild-queue.d.ts +1 -0
- package/src/lib/utils/rebuild-queue.d.ts.map +1 -0
- package/src/lib/utils/rebuild-queue.js +5 -10
- package/src/lib/utils/resolve-glob.d.ts +1 -0
- package/src/lib/utils/resolve-glob.d.ts.map +1 -0
- package/src/lib/utils/resolve-glob.js +3 -8
- package/src/lib/utils/resolve-wildcard-keys.d.ts +2 -4
- package/src/lib/utils/resolve-wildcard-keys.d.ts.map +1 -0
- package/src/lib/utils/resolve-wildcard-keys.js +3 -8
- package/src/lib/utils/rewrite-chunk-imports.d.ts +1 -0
- package/src/lib/utils/rewrite-chunk-imports.d.ts.map +1 -0
- package/src/lib/utils/rewrite-chunk-imports.js +13 -22
- package/LICENSE +0 -8
- package/README.md +0 -509
- package/build.d.ts +0 -1
- package/build.js +0 -5
- package/build.js.map +0 -1
- package/src/build.d.ts +0 -19
- package/src/build.js +0 -38
- package/src/build.js.map +0 -1
- package/src/config.js.map +0 -1
- package/src/index.js.map +0 -1
- package/src/lib/config/configuration-context.js.map +0 -1
- package/src/lib/config/federation-config.d.ts +0 -55
- package/src/lib/config/federation-config.js +0 -3
- package/src/lib/config/federation-config.js.map +0 -1
- package/src/lib/config/share-utils.js.map +0 -1
- package/src/lib/config/with-native-federation.js.map +0 -1
- package/src/lib/core/build-adapter.js.map +0 -1
- package/src/lib/core/build-for-federation.js.map +0 -1
- package/src/lib/core/bundle-exposed-and-mappings.js.map +0 -1
- package/src/lib/core/bundle-shared.js.map +0 -1
- package/src/lib/core/default-external-list.js.map +0 -1
- package/src/lib/core/default-server-deps-list.js.map +0 -1
- package/src/lib/core/default-skip-list.js.map +0 -1
- package/src/lib/core/federation-builder.js.map +0 -1
- package/src/lib/core/federation-options.js +0 -3
- package/src/lib/core/federation-options.js.map +0 -1
- package/src/lib/core/get-externals.js.map +0 -1
- package/src/lib/core/load-federation-config.js.map +0 -1
- package/src/lib/core/remove-unused-deps.js.map +0 -1
- package/src/lib/core/write-federation-info.js.map +0 -1
- package/src/lib/core/write-import-map.js.map +0 -1
- package/src/lib/utils/build-result-map.js.map +0 -1
- package/src/lib/utils/build-utils.js.map +0 -1
- package/src/lib/utils/bundle-caching.js.map +0 -1
- package/src/lib/utils/errors.js.map +0 -1
- package/src/lib/utils/get-external-imports.js.map +0 -1
- package/src/lib/utils/hash-file.js.map +0 -1
- package/src/lib/utils/logger.js.map +0 -1
- package/src/lib/utils/mapped-paths.js.map +0 -1
- package/src/lib/utils/normalize.js.map +0 -1
- package/src/lib/utils/package-info.js.map +0 -1
- package/src/lib/utils/rebuild-queue.js.map +0 -1
- package/src/lib/utils/resolve-glob.js.map +0 -1
- package/src/lib/utils/resolve-wildcard-keys.js.map +0 -1
- package/src/lib/utils/rewrite-chunk-imports.js.map +0 -1
|
@@ -1,62 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const bundle_caching_1 = require("./../utils/bundle-caching");
|
|
14
|
-
async function bundleShared(sharedBundles, config, fedOptions, externals, platform = 'browser', cacheOptions) {
|
|
15
|
-
const checksum = (0, bundle_caching_1.getChecksum)(sharedBundles, fedOptions.dev ? '1' : '0');
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import { bundle } from '../utils/build-utils.js';
|
|
4
|
+
import { getPackageInfo } from '../utils/package-info.js';
|
|
5
|
+
import { logger } from '../utils/logger.js';
|
|
6
|
+
import crypto from 'crypto';
|
|
7
|
+
import { DEFAULT_EXTERNAL_LIST } from './default-external-list.js';
|
|
8
|
+
import { deriveInternalName, isSourceFile, rewriteChunkImports, } from '../utils/rewrite-chunk-imports.js';
|
|
9
|
+
import { cacheEntry, getChecksum, getFilename } from './../utils/bundle-caching.js';
|
|
10
|
+
import { fileURLToPath } from 'url';
|
|
11
|
+
export async function bundleShared(sharedBundles, config, fedOptions, externals, platform = 'browser', cacheOptions) {
|
|
12
|
+
const checksum = getChecksum(sharedBundles, fedOptions.dev ? '1' : '0');
|
|
16
13
|
const folder = fedOptions.packageJson
|
|
17
14
|
? path.dirname(fedOptions.packageJson)
|
|
18
15
|
: fedOptions.workspaceRoot;
|
|
19
|
-
const bundleCache =
|
|
16
|
+
const bundleCache = cacheEntry(cacheOptions.pathToCache, getFilename(cacheOptions.bundleName, fedOptions.dev));
|
|
20
17
|
if (fedOptions?.cacheExternalArtifacts) {
|
|
21
18
|
const cacheMetadata = bundleCache.getMetadata(checksum);
|
|
22
19
|
if (cacheMetadata) {
|
|
23
|
-
|
|
20
|
+
logger.debug(`Checksum of ${cacheOptions.bundleName} matched, Skipped artifact bundling`);
|
|
24
21
|
bundleCache.copyFiles(path.join(fedOptions.workspaceRoot, fedOptions.outputPath));
|
|
25
22
|
return cacheMetadata.externals;
|
|
26
23
|
}
|
|
27
24
|
}
|
|
28
25
|
bundleCache.clear();
|
|
29
26
|
const inferredPackageInfos = Object.keys(sharedBundles)
|
|
30
|
-
.filter(
|
|
31
|
-
.map(
|
|
32
|
-
.filter(
|
|
27
|
+
.filter(packageName => !sharedBundles[packageName]?.packageInfo)
|
|
28
|
+
.map(packageName => getPackageInfo(packageName, folder))
|
|
29
|
+
.filter(pi => !!pi);
|
|
33
30
|
const configuredPackageInfos = Object.keys(sharedBundles)
|
|
34
|
-
.filter(
|
|
35
|
-
.map(
|
|
31
|
+
.filter(packageName => !!sharedBundles[packageName]?.packageInfo)
|
|
32
|
+
.map(packageName => ({
|
|
36
33
|
packageName,
|
|
37
|
-
...sharedBundles[packageName]
|
|
34
|
+
...sharedBundles[packageName]?.packageInfo,
|
|
38
35
|
}));
|
|
39
36
|
const packageInfos = [...inferredPackageInfos, ...configuredPackageInfos];
|
|
37
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
40
38
|
const configState = 'BUNDLER_CHUNKS' + // TODO: Replace this with lib version
|
|
41
|
-
fs.readFileSync(path.join(
|
|
39
|
+
fs.readFileSync(path.join(path.dirname(__filename), '../../../package.json')) +
|
|
42
40
|
JSON.stringify(config);
|
|
43
|
-
const allEntryPoints = packageInfos.map(
|
|
41
|
+
const allEntryPoints = packageInfos.map(pi => {
|
|
44
42
|
const encName = pi.packageName.replace(/[^A-Za-z0-9]/g, '_');
|
|
45
43
|
const outName = createOutName(pi, configState, fedOptions, encName);
|
|
46
44
|
return { fileName: pi.entryPoint, outName };
|
|
47
45
|
});
|
|
48
46
|
const fullOutputPath = path.join(fedOptions.workspaceRoot, fedOptions.outputPath);
|
|
49
|
-
const expectedResults = allEntryPoints.map(
|
|
50
|
-
const entryPoints = allEntryPoints.filter(
|
|
47
|
+
const expectedResults = allEntryPoints.map(ep => path.join(fullOutputPath, ep.outName));
|
|
48
|
+
const entryPoints = allEntryPoints.filter(ep => !fs.existsSync(path.join(cacheOptions.pathToCache, ep.outName)));
|
|
51
49
|
// If we build for the browser and don't remote unused deps from the shared config,
|
|
52
50
|
// we need to exclude typical node libs to avoid compilation issues
|
|
53
51
|
const useDefaultExternalList = platform === 'browser' && !config.features.ignoreUnusedDeps;
|
|
54
|
-
const additionalExternals = useDefaultExternalList
|
|
55
|
-
? default_external_list_1.DEFAULT_EXTERNAL_LIST
|
|
56
|
-
: [];
|
|
52
|
+
const additionalExternals = useDefaultExternalList ? DEFAULT_EXTERNAL_LIST : [];
|
|
57
53
|
let bundleResult = null;
|
|
58
54
|
try {
|
|
59
|
-
bundleResult = await
|
|
55
|
+
bundleResult = await bundle({
|
|
60
56
|
entryPoints,
|
|
61
57
|
tsConfigPath: fedOptions.tsConfig,
|
|
62
58
|
external: [...additionalExternals, ...externals],
|
|
@@ -68,67 +64,65 @@ async function bundleShared(sharedBundles, config, fedOptions, externals, platfo
|
|
|
68
64
|
platform,
|
|
69
65
|
optimizedMappings: config.features.ignoreUnusedDeps,
|
|
70
66
|
});
|
|
71
|
-
const cachedFiles = bundleResult.map(
|
|
67
|
+
const cachedFiles = bundleResult.map(br => path.basename(br.fileName));
|
|
72
68
|
rewriteImports(cachedFiles, cacheOptions.pathToCache);
|
|
73
69
|
}
|
|
74
70
|
catch (e) {
|
|
75
|
-
|
|
71
|
+
logger.error('Error bundling shared npm package ');
|
|
76
72
|
if (e instanceof Error) {
|
|
77
|
-
|
|
73
|
+
logger.error(e.message);
|
|
78
74
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
75
|
+
logger.error('For more information, run in verbose mode');
|
|
76
|
+
logger.notice('');
|
|
77
|
+
logger.notice('');
|
|
78
|
+
logger.notice('** Important Information: ***');
|
|
79
|
+
logger.notice('The error message above shows an issue with bundling a node_module.');
|
|
80
|
+
logger.notice('In most cases this is because you (indirectly) shared a Node.js package,');
|
|
81
|
+
logger.notice('while Native Federation builds for the browser.');
|
|
82
|
+
logger.notice('You can move such packages into devDependencies or skip them in your federation.config.js.');
|
|
83
|
+
logger.notice('');
|
|
84
|
+
logger.notice('More Details: https://bit.ly/nf-issue');
|
|
85
|
+
logger.notice('');
|
|
86
|
+
logger.notice('');
|
|
87
|
+
logger.verbose(e);
|
|
92
88
|
throw e;
|
|
93
89
|
}
|
|
94
90
|
const outFileNames = [...expectedResults];
|
|
95
91
|
const result = buildResult(packageInfos, sharedBundles, outFileNames);
|
|
96
92
|
// TODO: Decide whether/when to add .map files
|
|
97
|
-
const chunks = bundleResult.filter(
|
|
98
|
-
!result.find(
|
|
99
|
-
addChunksToResult(chunks, result
|
|
93
|
+
const chunks = bundleResult.filter(br => !br.fileName.endsWith('.map') &&
|
|
94
|
+
!result.find(r => r.outFileName === path.basename(br.fileName)));
|
|
95
|
+
addChunksToResult(chunks, result);
|
|
100
96
|
bundleCache.persist({
|
|
101
97
|
checksum,
|
|
102
98
|
externals: result,
|
|
103
|
-
files: bundleResult.map(
|
|
99
|
+
files: bundleResult.map(r => r.fileName.split(path.sep).pop() ?? r.fileName),
|
|
104
100
|
});
|
|
105
101
|
bundleCache.copyFiles(path.join(fedOptions.workspaceRoot, fedOptions.outputPath));
|
|
106
102
|
return result;
|
|
107
103
|
}
|
|
108
104
|
function rewriteImports(cachedFiles, cachePath) {
|
|
109
|
-
const newSourceFiles = cachedFiles.filter(
|
|
105
|
+
const newSourceFiles = cachedFiles.filter(cf => isSourceFile(cf));
|
|
110
106
|
for (const sourceFile of newSourceFiles) {
|
|
111
107
|
const sourceFilePath = path.join(cachePath, sourceFile);
|
|
112
|
-
|
|
108
|
+
rewriteChunkImports(sourceFilePath);
|
|
113
109
|
}
|
|
114
110
|
}
|
|
115
111
|
function createOutName(pi, configState, fedOptions, encName) {
|
|
116
112
|
const hashBase = pi.version + '_' + pi.entryPoint + '_' + configState;
|
|
117
113
|
const hash = calcHash(hashBase);
|
|
118
|
-
const outName = fedOptions.dev
|
|
119
|
-
? `${encName}.${hash}-dev.js`
|
|
120
|
-
: `${encName}.${hash}.js`;
|
|
114
|
+
const outName = fedOptions.dev ? `${encName}.${hash}-dev.js` : `${encName}.${hash}.js`;
|
|
121
115
|
return outName;
|
|
122
116
|
}
|
|
123
117
|
function buildResult(packageInfos, sharedBundles, outFileNames) {
|
|
124
|
-
return packageInfos.map(
|
|
118
|
+
return packageInfos.map(pi => {
|
|
125
119
|
const shared = sharedBundles[pi.packageName];
|
|
126
120
|
return {
|
|
127
121
|
packageName: pi.packageName,
|
|
128
122
|
outFileName: path.basename(outFileNames.shift() || ''),
|
|
129
|
-
requiredVersion: shared
|
|
130
|
-
singleton: shared
|
|
131
|
-
strictVersion: shared
|
|
123
|
+
requiredVersion: shared?.requiredVersion,
|
|
124
|
+
singleton: shared?.singleton,
|
|
125
|
+
strictVersion: shared?.strictVersion,
|
|
132
126
|
version: pi.version,
|
|
133
127
|
// TODO: Decide whether/when we need debug infos
|
|
134
128
|
// dev: !fedOptions.dev
|
|
@@ -139,11 +133,11 @@ function buildResult(packageInfos, sharedBundles, outFileNames) {
|
|
|
139
133
|
};
|
|
140
134
|
});
|
|
141
135
|
}
|
|
142
|
-
function addChunksToResult(chunks, result
|
|
136
|
+
function addChunksToResult(chunks, result) {
|
|
143
137
|
for (const item of chunks) {
|
|
144
138
|
const fileName = path.basename(item.fileName);
|
|
145
139
|
result.push({
|
|
146
|
-
singleton:
|
|
140
|
+
singleton: false,
|
|
147
141
|
strictVersion: false,
|
|
148
142
|
// Here, the version does not matter because
|
|
149
143
|
// a) a chunk split off by the bundler does
|
|
@@ -153,8 +147,9 @@ function addChunksToResult(chunks, result, dev) {
|
|
|
153
147
|
//
|
|
154
148
|
// For the same reason, we don't need to
|
|
155
149
|
// take care of singleton and strictVersion.
|
|
150
|
+
version: '0.0.0',
|
|
156
151
|
requiredVersion: '0.0.0',
|
|
157
|
-
packageName:
|
|
152
|
+
packageName: deriveInternalName(fileName),
|
|
158
153
|
outFileName: fileName,
|
|
159
154
|
// dev: dev
|
|
160
155
|
// ? undefined
|
|
@@ -165,7 +160,7 @@ function addChunksToResult(chunks, result, dev) {
|
|
|
165
160
|
}
|
|
166
161
|
}
|
|
167
162
|
function calcHash(hashBase) {
|
|
168
|
-
const hash =
|
|
163
|
+
const hash = crypto
|
|
169
164
|
.createHash('sha256')
|
|
170
165
|
.update(hashBase)
|
|
171
166
|
.digest('base64')
|
|
@@ -175,4 +170,3 @@ function calcHash(hashBase) {
|
|
|
175
170
|
.substring(0, 10);
|
|
176
171
|
return hash;
|
|
177
172
|
}
|
|
178
|
-
//# sourceMappingURL=bundle-shared.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-external-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/default-external-list.ts"],"names":[],"mappings":"AA6BA,eAAO,MAAM,qBAAqB,UAGhC,CAAC"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_EXTERNAL_LIST = void 0;
|
|
4
1
|
const NODE_PACKAGES = [
|
|
5
2
|
'assert',
|
|
6
3
|
'buffer',
|
|
@@ -29,8 +26,7 @@ const NODE_PACKAGES = [
|
|
|
29
26
|
'vm',
|
|
30
27
|
'zlib',
|
|
31
28
|
];
|
|
32
|
-
|
|
29
|
+
export const DEFAULT_EXTERNAL_LIST = NODE_PACKAGES.flatMap((p) => [
|
|
33
30
|
p,
|
|
34
31
|
'node:' + p,
|
|
35
32
|
]);
|
|
36
|
-
//# sourceMappingURL=default-external-list.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-server-deps-list.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/default-server-deps-list.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,wBAAwB,EAAE,MAAM,EAI5C,CAAC;AAEF,eAAO,MAAM,uBAAuB,aAAoC,CAAC"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DEFAULT_SERVER_DEPS_SET = exports.DEFAULT_SERVER_DEPS_LIST = void 0;
|
|
4
|
-
exports.DEFAULT_SERVER_DEPS_LIST = [
|
|
1
|
+
export const DEFAULT_SERVER_DEPS_LIST = [
|
|
5
2
|
'@angular/platform-server',
|
|
6
3
|
'@angular/platform-server/init',
|
|
7
4
|
'@angular/ssr',
|
|
8
5
|
];
|
|
9
|
-
|
|
10
|
-
//# sourceMappingURL=default-server-deps-list.js.map
|
|
6
|
+
export const DEFAULT_SERVER_DEPS_SET = new Set(DEFAULT_SERVER_DEPS_LIST);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { FederationInfo } from '
|
|
2
|
-
import { NormalizedFederationConfig } from '../config/federation-config';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { FederationInfo } from '../domain/core/federation-info.contract.js';
|
|
2
|
+
import type { NormalizedFederationConfig } from '../domain/config/federation-config.contract.js';
|
|
3
|
+
import { type FederationOptions } from '../domain/core/federation-options.contract.js';
|
|
4
|
+
import type { NFBuildAdapter } from '../domain/core/build-adapter.contract.js';
|
|
5
5
|
export interface BuildHelperParams {
|
|
6
6
|
options: FederationOptions;
|
|
7
|
-
adapter:
|
|
7
|
+
adapter: NFBuildAdapter;
|
|
8
8
|
}
|
|
9
9
|
declare function init(params: BuildHelperParams): Promise<void>;
|
|
10
|
-
declare function build(buildParams?: import("
|
|
10
|
+
declare function build(buildParams?: import("../../domain.js").BuildParams): Promise<void>;
|
|
11
11
|
export declare const federationBuilder: {
|
|
12
12
|
init: typeof init;
|
|
13
13
|
build: typeof build;
|
|
@@ -16,3 +16,4 @@ export declare const federationBuilder: {
|
|
|
16
16
|
readonly config: NormalizedFederationConfig;
|
|
17
17
|
};
|
|
18
18
|
export {};
|
|
19
|
+
//# sourceMappingURL=federation-builder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"federation-builder.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/federation-builder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAEjF,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAGjG,OAAO,EAAE,KAAK,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAGvF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0CAA0C,CAAC;AAE/E,MAAM,WAAW,iBAAiB;IAChC,OAAO,EAAE,iBAAiB,CAAC;IAC3B,OAAO,EAAE,cAAc,CAAC;CACzB;AAOD,iBAAe,IAAI,CAAC,MAAM,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAQ5D;AAED,iBAAe,KAAK,CAAC,WAAW,wCAAqB,GAAG,OAAO,CAAC,IAAI,CAAC,CAEpE;AAED,eAAO,MAAM,iBAAiB;;;;wBAMX,MAAM,EAAE;qBAGX,0BAA0B;CAGzC,CAAC"}
|
|
@@ -1,29 +1,25 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const build_for_federation_1 = require("./build-for-federation");
|
|
7
|
-
const get_externals_1 = require("./get-externals");
|
|
8
|
-
const load_federation_config_1 = require("./load-federation-config");
|
|
1
|
+
import { getConfigContext, usePackageJson, useWorkspace } from '../config/configuration-context.js';
|
|
2
|
+
import { setBuildAdapter } from './build-adapter.js';
|
|
3
|
+
import { buildForFederation, defaultBuildParams } from './build-for-federation.js';
|
|
4
|
+
import { getExternals } from './get-externals.js';
|
|
5
|
+
import { loadFederationConfig } from './load-federation-config.js';
|
|
9
6
|
let externals = [];
|
|
10
7
|
let config;
|
|
11
8
|
let fedOptions;
|
|
12
9
|
let fedInfo;
|
|
13
10
|
async function init(params) {
|
|
14
|
-
|
|
11
|
+
setBuildAdapter(params.adapter);
|
|
15
12
|
fedOptions = params.options;
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
config = await
|
|
19
|
-
params.options.workspaceRoot =
|
|
20
|
-
|
|
21
|
-
externals = (0, get_externals_1.getExternals)(config);
|
|
13
|
+
useWorkspace(params.options.workspaceRoot);
|
|
14
|
+
usePackageJson(params.options.packageJson);
|
|
15
|
+
config = await loadFederationConfig(fedOptions);
|
|
16
|
+
params.options.workspaceRoot = getConfigContext().workspaceRoot ?? params.options.workspaceRoot;
|
|
17
|
+
externals = getExternals(config);
|
|
22
18
|
}
|
|
23
|
-
async function build(buildParams =
|
|
24
|
-
fedInfo = await
|
|
19
|
+
async function build(buildParams = defaultBuildParams) {
|
|
20
|
+
fedInfo = await buildForFederation(config, fedOptions, externals, buildParams);
|
|
25
21
|
}
|
|
26
|
-
|
|
22
|
+
export const federationBuilder = {
|
|
27
23
|
init,
|
|
28
24
|
build,
|
|
29
25
|
get federationInfo() {
|
|
@@ -36,4 +32,3 @@ exports.federationBuilder = {
|
|
|
36
32
|
return config;
|
|
37
33
|
},
|
|
38
34
|
};
|
|
39
|
-
//# sourceMappingURL=federation-builder.js.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { NormalizedFederationConfig } from '../config/federation-config';
|
|
1
|
+
import type { NormalizedFederationConfig } from '../domain/config/federation-config.contract.js';
|
|
2
2
|
export declare function getExternals(config: NormalizedFederationConfig): string[];
|
|
3
|
+
//# sourceMappingURL=get-externals.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-externals.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/get-externals.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAEjG,wBAAgB,YAAY,CAAC,MAAM,EAAE,0BAA0B,YAK9D"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getExternals = getExternals;
|
|
4
|
-
function getExternals(config) {
|
|
1
|
+
export function getExternals(config) {
|
|
5
2
|
const shared = Object.keys(config.shared);
|
|
6
|
-
const sharedMappings = config.sharedMappings.map(
|
|
3
|
+
const sharedMappings = config.sharedMappings.map(m => m.key);
|
|
7
4
|
const externals = [...shared, ...sharedMappings, ...config.externals];
|
|
8
5
|
return externals;
|
|
9
6
|
}
|
|
10
|
-
//# sourceMappingURL=get-externals.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { NormalizedFederationConfig } from '../config/federation-config';
|
|
2
|
-
import { FederationOptions } from '
|
|
1
|
+
import type { NormalizedFederationConfig } from '../domain/config/federation-config.contract.js';
|
|
2
|
+
import type { FederationOptions } from '../domain/core/federation-options.contract.js';
|
|
3
3
|
export declare function loadFederationConfig(fedOptions: FederationOptions): Promise<NormalizedFederationConfig>;
|
|
4
|
+
//# sourceMappingURL=load-federation-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"load-federation-config.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/load-federation-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AACjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAKvF,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,iBAAiB,GAC5B,OAAO,CAAC,0BAA0B,CAAC,CAsBrC"}
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const path = tslib_1.__importStar(require("path"));
|
|
6
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
-
const remove_unused_deps_1 = require("./remove-unused-deps");
|
|
8
|
-
async function loadFederationConfig(fedOptions) {
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
import { removeUnusedDeps } from './remove-unused-deps.js';
|
|
4
|
+
export async function loadFederationConfig(fedOptions) {
|
|
9
5
|
const fullConfigPath = path.join(fedOptions.workspaceRoot, fedOptions.federationConfig);
|
|
10
6
|
if (!fs.existsSync(fullConfigPath)) {
|
|
11
7
|
throw new Error('Expected ' + fullConfigPath);
|
|
12
8
|
}
|
|
13
|
-
const config = (await
|
|
14
|
-
?.default;
|
|
9
|
+
const config = (await import(fullConfigPath))?.default;
|
|
15
10
|
if (config.features.ignoreUnusedDeps && !fedOptions.entryPoint) {
|
|
16
11
|
throw new Error(`The feature ignoreUnusedDeps needs the application's entry point. Please set it in your federation options!`);
|
|
17
12
|
}
|
|
18
13
|
if (config.features.ignoreUnusedDeps) {
|
|
19
14
|
// const entryPoint = path.join(fedOptions.workspaceRoot, fedOptions.entryPoint ?? '');
|
|
20
|
-
return
|
|
15
|
+
return removeUnusedDeps(config, fedOptions.entryPoint ?? '', fedOptions.workspaceRoot);
|
|
21
16
|
}
|
|
22
17
|
return config;
|
|
23
18
|
}
|
|
24
|
-
//# sourceMappingURL=load-federation-config.js.map
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { NormalizedFederationConfig } from '../config/federation-config';
|
|
1
|
+
import type { NormalizedFederationConfig } from '../domain/config/federation-config.contract.js';
|
|
2
2
|
export declare function removeUnusedDeps(config: NormalizedFederationConfig, main: string, workspaceRoot: string): NormalizedFederationConfig;
|
|
3
|
+
//# sourceMappingURL=remove-unused-deps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remove-unused-deps.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/remove-unused-deps.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAMjG,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,0BAA0B,EAClC,IAAI,EAAE,MAAM,EACZ,aAAa,EAAE,MAAM,GACpB,0BAA0B,CAiB5B"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
const
|
|
10
|
-
const get_external_imports_1 = require("../utils/get-external-imports");
|
|
11
|
-
const normalize_1 = require("../utils/normalize");
|
|
12
|
-
function removeUnusedDeps(config, main, workspaceRoot) {
|
|
13
|
-
const fileInfos = (0, sheriff_core_1.getProjectData)(main, (0, process_1.cwd)(), {
|
|
1
|
+
import { getProjectData } from '@softarc/sheriff-core';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import fs from 'fs';
|
|
4
|
+
import { cwd } from 'process';
|
|
5
|
+
import { getPackageInfo } from '../utils/package-info.js';
|
|
6
|
+
import { getExternalImports as extractExternalImports } from '../utils/get-external-imports.js';
|
|
7
|
+
import { normalizePackageName } from '../utils/normalize.js';
|
|
8
|
+
export function removeUnusedDeps(config, main, workspaceRoot) {
|
|
9
|
+
const fileInfos = getProjectData(main, cwd(), {
|
|
14
10
|
includeExternalLibraries: true,
|
|
15
11
|
});
|
|
16
12
|
const usedDeps = findUsedDeps(fileInfos, workspaceRoot, config);
|
|
@@ -37,15 +33,12 @@ function findUsedDeps(fileInfos, workspaceRoot, config) {
|
|
|
37
33
|
if (!fileInfo) {
|
|
38
34
|
continue;
|
|
39
35
|
}
|
|
40
|
-
const libs = [
|
|
41
|
-
...(fileInfo.externalLibraries || []),
|
|
42
|
-
...(fileInfo.unresolvedImports || []),
|
|
43
|
-
];
|
|
36
|
+
const libs = [...(fileInfo.externalLibraries || []), ...(fileInfo.unresolvedImports || [])];
|
|
44
37
|
for (const pckg of libs) {
|
|
45
38
|
usedPackageNames.add(pckg);
|
|
46
39
|
}
|
|
47
|
-
const fullFileName =
|
|
48
|
-
const mappings = config.sharedMappings.filter(
|
|
40
|
+
const fullFileName = path.join(workspaceRoot, fileName);
|
|
41
|
+
const mappings = config.sharedMappings.filter(sm => fullFileName.startsWith(sm.path));
|
|
49
42
|
for (const mapping of mappings) {
|
|
50
43
|
usedMappings.add(mapping);
|
|
51
44
|
}
|
|
@@ -61,7 +54,7 @@ function addTransientDeps(packages, workspaceRoot) {
|
|
|
61
54
|
if (!dep) {
|
|
62
55
|
continue;
|
|
63
56
|
}
|
|
64
|
-
const pInfo =
|
|
57
|
+
const pInfo = getPackageInfo(dep, workspaceRoot);
|
|
65
58
|
if (!pInfo) {
|
|
66
59
|
continue;
|
|
67
60
|
}
|
|
@@ -77,20 +70,19 @@ function addTransientDeps(packages, workspaceRoot) {
|
|
|
77
70
|
return packagesAndPeers;
|
|
78
71
|
}
|
|
79
72
|
function getExternalImports(pInfo, workspaceRoot) {
|
|
80
|
-
const encodedPackageName =
|
|
73
|
+
const encodedPackageName = normalizePackageName(pInfo.packageName);
|
|
81
74
|
const cacheFileName = `${encodedPackageName}-${pInfo.version}.deps.json`;
|
|
82
|
-
const cachePath =
|
|
83
|
-
const cacheFilePath =
|
|
84
|
-
const cacheHit =
|
|
75
|
+
const cachePath = path.join(workspaceRoot, 'node_modules/.cache/native-federation/_externals-metadata');
|
|
76
|
+
const cacheFilePath = path.join(cachePath, cacheFileName);
|
|
77
|
+
const cacheHit = fs.existsSync(cacheFilePath);
|
|
85
78
|
let peerDeps;
|
|
86
79
|
if (cacheHit) {
|
|
87
|
-
peerDeps = JSON.parse(
|
|
80
|
+
peerDeps = JSON.parse(fs.readFileSync(cacheFilePath, 'utf-8'));
|
|
88
81
|
}
|
|
89
82
|
else {
|
|
90
|
-
peerDeps = (
|
|
91
|
-
|
|
92
|
-
|
|
83
|
+
peerDeps = extractExternalImports(pInfo.entryPoint);
|
|
84
|
+
fs.mkdirSync(cachePath, { recursive: true });
|
|
85
|
+
fs.writeFileSync(cacheFilePath, JSON.stringify(peerDeps, undefined, 2), 'utf-8');
|
|
93
86
|
}
|
|
94
87
|
return peerDeps;
|
|
95
88
|
}
|
|
96
|
-
//# sourceMappingURL=remove-unused-deps.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { FederationInfo } from '
|
|
2
|
-
import { FederationOptions } from '
|
|
1
|
+
import type { FederationInfo } from '../domain/core/federation-info.contract.js';
|
|
2
|
+
import type { FederationOptions } from '../domain/core/federation-options.contract.js';
|
|
3
3
|
export declare function writeFederationInfo(federationInfo: FederationInfo, fedOptions: FederationOptions): void;
|
|
4
|
+
//# sourceMappingURL=write-federation-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-federation-info.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/write-federation-info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4CAA4C,CAAC;AAGjF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,cAAc,EAAE,UAAU,EAAE,iBAAiB,QAOhG"}
|
|
@@ -1,11 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
6
|
-
const path = tslib_1.__importStar(require("path"));
|
|
7
|
-
function writeFederationInfo(federationInfo, fedOptions) {
|
|
1
|
+
import * as fs from 'fs';
|
|
2
|
+
import * as path from 'path';
|
|
3
|
+
export function writeFederationInfo(federationInfo, fedOptions) {
|
|
8
4
|
const metaDataPath = path.join(fedOptions.workspaceRoot, fedOptions.outputPath, 'remoteEntry.json');
|
|
9
5
|
fs.writeFileSync(metaDataPath, JSON.stringify(federationInfo, null, 2));
|
|
10
6
|
}
|
|
11
|
-
//# sourceMappingURL=write-federation-info.js.map
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import { SharedInfo } from '
|
|
2
|
-
import { FederationOptions } from '
|
|
1
|
+
import type { SharedInfo } from '../domain/core/federation-info.contract.js';
|
|
2
|
+
import type { FederationOptions } from '../domain/core/federation-options.contract.js';
|
|
3
3
|
export declare function writeImportMap(sharedInfo: SharedInfo[], fedOption: FederationOptions): void;
|
|
4
|
+
//# sourceMappingURL=write-import-map.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"write-import-map.d.ts","sourceRoot":"","sources":["../../../../src/lib/core/write-import-map.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAC7E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAC;AAEvF,wBAAgB,cAAc,CAAC,UAAU,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,iBAAiB,QAWpF"}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const path = tslib_1.__importStar(require("path"));
|
|
6
|
-
const fs = tslib_1.__importStar(require("fs"));
|
|
7
|
-
function writeImportMap(sharedInfo, fedOption) {
|
|
1
|
+
import * as path from 'path';
|
|
2
|
+
import * as fs from 'fs';
|
|
3
|
+
export function writeImportMap(sharedInfo, fedOption) {
|
|
8
4
|
const imports = sharedInfo.reduce((acc, cur) => {
|
|
9
5
|
return {
|
|
10
6
|
...acc,
|
|
@@ -15,4 +11,3 @@ function writeImportMap(sharedInfo, fedOption) {
|
|
|
15
11
|
const importMapPath = path.join(fedOption.workspaceRoot, fedOption.outputPath, 'importmap.json');
|
|
16
12
|
fs.writeFileSync(importMapPath, JSON.stringify(importMap, null, 2));
|
|
17
13
|
}
|
|
18
|
-
//# sourceMappingURL=write-import-map.js.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export interface ExternalConfig {
|
|
2
|
+
singleton?: boolean;
|
|
3
|
+
strictVersion?: boolean;
|
|
4
|
+
requiredVersion?: string;
|
|
5
|
+
version?: string;
|
|
6
|
+
includeSecondaries?: boolean;
|
|
7
|
+
platform?: 'browser' | 'node';
|
|
8
|
+
build?: 'default' | 'separate';
|
|
9
|
+
packageInfo?: {
|
|
10
|
+
entryPoint: string;
|
|
11
|
+
version?: string;
|
|
12
|
+
esm?: boolean;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface NormalizedExternalConfig {
|
|
16
|
+
singleton: boolean;
|
|
17
|
+
strictVersion: boolean;
|
|
18
|
+
requiredVersion: string;
|
|
19
|
+
version?: string;
|
|
20
|
+
includeSecondaries?: boolean;
|
|
21
|
+
platform: 'browser' | 'node';
|
|
22
|
+
build: 'default' | 'separate' | 'package';
|
|
23
|
+
packageInfo?: {
|
|
24
|
+
entryPoint: string;
|
|
25
|
+
version: string;
|
|
26
|
+
esm: boolean;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export type IncludeSecondariesOptions = {
|
|
30
|
+
skip: string | string[];
|
|
31
|
+
resolveGlob?: boolean;
|
|
32
|
+
keepAll?: boolean;
|
|
33
|
+
} | boolean;
|
|
34
|
+
export type SharedExternalsConfig = Record<string, ExternalConfig>;
|
|
35
|
+
export type NormalizedSharedExternalsConfig = Record<string, NormalizedExternalConfig>;
|
|
36
|
+
export type ShareAllExternalsOptions = ExternalConfig & {
|
|
37
|
+
includeSecondaries?: IncludeSecondariesOptions;
|
|
38
|
+
};
|
|
39
|
+
export type ShareExternalsOptions = Record<string, ShareAllExternalsOptions>;
|
|
40
|
+
//# sourceMappingURL=external-config.contract.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"external-config.contract.d.ts","sourceRoot":"","sources":["../../../../../src/lib/domain/config/external-config.contract.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,cAAc;IAC7B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,GAAG,UAAU,CAAC;IAC/B,WAAW,CAAC,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,GAAG,CAAC,EAAE,OAAO,CAAC;KACf,CAAC;CACH;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,EAAE,OAAO,CAAC;IACnB,aAAa,EAAE,OAAO,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;IAC7B,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,CAAC;IAC1C,WAAW,CAAC,EAAE;QACZ,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,OAAO,CAAC;KACd,CAAC;CACH;AAED,MAAM,MAAM,yBAAyB,GACjC;IAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GACrE,OAAO,CAAC;AAEZ,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;AAEnE,MAAM,MAAM,+BAA+B,GAAG,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;AAEvF,MAAM,MAAM,wBAAwB,GAAG,cAAc,GAAG;IACtD,kBAAkB,CAAC,EAAE,yBAAyB,CAAC;CAChD,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|