Skip to content

Commit 0813a76

Browse files
committed
feat(nf-core): improve error messages
1 parent c20e004 commit 0813a76

File tree

12 files changed

+22
-19
lines changed

12 files changed

+22
-19
lines changed
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "@softarc/native-federation",
3-
"version": "1.0.0-beta.2",
3+
"version": "1.0.0-beta.3",
44
"type": "commonjs",
55
"dependencies": {
66
"json5": "^2.2.0",
77
"npmlog": "^6.0.2",
8-
"@softarc/native-federation-runtime": "1.0.0-beta.2"
8+
"@softarc/native-federation-runtime": "1.0.0-beta.3"
99
}
1010
}

libs/native-federation-core/src/lib/core/bundle-exposed.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ export async function bundleExposed(
5656
});
5757
} catch (e) {
5858
logger.error('Error bundling exposed module ' + entryPoint);
59+
logger.notice('Please check the `exposes` section in your federation.config.js');
5960
logger.error(e);
6061
}
6162
}

libs/native-federation-core/src/lib/core/bundle-shared-mappings.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,10 @@ export async function bundleSharedMappings(
5454
},
5555
});
5656
} catch (e) {
57-
// TODO: add logger
5857
logger.error('Error bundling shared mapping ' + m.key);
58+
logger.notice(
59+
`Please check this shared mapping in the 'path' section or your tsconfig.(app|base).json`
60+
);
5961
logger.notice(
6062
`If you don't need this mapping to shared, you can skip it in your federation.config.js`
6163
);

libs/native-federation-core/src/lib/core/bundle-shared.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,12 @@ export async function bundleShared(
5151
const cachedFile = path.join(cachePath, outFileName);
5252

5353
if (!fs.existsSync(cachedFile)) {
54-
5554
if (first) {
5655
logger.notice('Preparing shared npm packages');
5756
logger.notice('This only needs to be done once');
58-
logger.notice('Skip packages you don\'t want to share in your federation config');
57+
logger.notice(
58+
"Skip packages you don't want to share in your federation config"
59+
);
5960
}
6061
first = false;
6162

@@ -73,7 +74,7 @@ export async function bundleShared(
7374
kind: 'shared-package',
7475
});
7576
} catch (e) {
76-
logger.error('Error bundling ' + pi.packageName);
77+
logger.error('Error bundling npm package ' + pi.packageName);
7778
if (e instanceof Error) {
7879
logger.error(e.message);
7980
}

libs/native-federation-core/src/lib/core/federation-builder.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1-
import { SharedInfo } from '@softarc/native-federation';
21
import { NormalizedFederationConfig } from '../config/federation-config';
32
import { BuildAdapter, setBuildAdapter } from './build-adapter';
43
import {
54
buildForFederation,
6-
BuildParams,
75
defaultBuildParams,
86
} from './build-for-federation';
9-
import { bundleShared } from './bundle-shared';
107
import { FederationOptions } from './federation-options';
118
import { getExternals } from './get-externals';
129
import { loadFederationConfig } from './load-federation-config';

libs/native-federation-core/src/lib/core/federation-options.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ export interface FederationOptions {
55
tsConfig?: string;
66
verbose?: boolean;
77
dev?: boolean;
8+
watch?: boolean;
89
}

libs/native-federation-core/stack.png

6.89 KB
Loading

libs/native-federation-esbuild/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@softarc/native-federation-esbuild",
3-
"version": "1.0.0-beta.2",
3+
"version": "1.0.0-beta.3",
44
"type": "commonjs",
55
"dependencies": {
66
"@rollup/plugin-commonjs": "^22.0.2",

libs/native-federation-runtime/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@softarc/native-federation-runtime",
3-
"version": "1.0.0-beta.2",
3+
"version": "1.0.0-beta.3",
44
"peerDependencies": {},
55
"dependencies": {
66
"tslib": "^2.3.0"

libs/native-federation/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@angular-architects/native-federation",
3-
"version": "0.9.3",
3+
"version": "0.9.4",
44
"main": "src/index.js",
55
"generators": "./collection.json",
66
"builders": "./builders.json",
@@ -23,8 +23,8 @@
2323
"rollup-plugin-node-externals": "^4.1.1",
2424
"esbuild": "^0.15.5",
2525
"@babel/core": "^7.19.0",
26-
"@softarc/native-federation": "1.0.0-beta.2",
27-
"@softarc/native-federation-runtime": "1.0.0-beta.2",
26+
"@softarc/native-federation": "1.0.0-beta.3",
27+
"@softarc/native-federation-runtime": "1.0.0-beta.3",
2828
"@rollup/plugin-json": "^4.1.0",
2929
"cross-spawn": "^7.0.3",
3030
"rollup-plugin-terser": "^7.0.2",

0 commit comments

Comments
 (0)