Skip to content

Commit 10d6416

Browse files
committed
fix(nf-core): typo in info about caching shared bundles
1 parent 7e2fa2f commit 10d6416

File tree

10 files changed

+212
-16
lines changed

10 files changed

+212
-16
lines changed

libs/mf/src/schematics/mf/schematic.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ async function generateWebpackConfig(
171171
projectSourceRoot,
172172
remoteMap,
173173
...options,
174+
tmpl: '',
174175
}),
175176
move(projectRoot),
176177
]);

libs/native-federation-core/src/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,4 +22,4 @@ export {
2222
BuildHelperParams,
2323
} from './lib/core/federation-builder';
2424
export { logger, setLogLevel } from './lib/utils/logger';
25-
export { hashFile } from './lib/utils/hash-file';
25+
export { hashFile } from './lib/utils/hash-file';

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

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,15 @@ export async function bundleShared(
2020
.map((packageName) => getPackageInfo(packageName, fedOptions.workspaceRoot))
2121
.filter((pi) => !!pi) as PackageInfo[];
2222

23-
logger.notice('Shared packages are only bundles once as they are cached');
23+
logger.notice('Shared packages are only bundled once as they are cached');
2424
logger.notice(
25-
'Make sure, you skip all unneeded packages in your federation.config.js'
25+
'Make sure, you skip all unneeded packages in your federation.config.js!'
2626
);
2727

28-
const federationConfigPath = path.join(fedOptions.workspaceRoot, fedOptions.federationConfig);
28+
const federationConfigPath = path.join(
29+
fedOptions.workspaceRoot,
30+
fedOptions.federationConfig
31+
);
2932
const hash = hashFile(federationConfigPath);
3033

3134
for (const pi of packageInfos) {

libs/native-federation-runtime/src/lib/init-federation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ async function processRemoteInfos(
4545
const remoteMap = await processRemoteInfo(url, remoteName);
4646
importMap = mergeImportMaps(importMap, remoteMap);
4747
} catch (e) {
48-
console.error(`Error loading remote entry for ${remoteName} from file ${remotes[remoteName]}`);
48+
console.error(
49+
`Error loading remote entry for ${remoteName} from file ${remotes[remoteName]}`
50+
);
4951
}
5052
}
5153

libs/native-federation/src/builders/build/builder.ts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,11 @@ function runNgccIfNeeded(fedOptions: FederationOptions, workspaceRoot: string) {
7272
function runNgcc(workspaceRoot: string) {
7373
logger.verbose('Running ngcc');
7474
const command = getNpxCommand(workspaceRoot);
75-
const result = crossSpawn.sync(command, [
76-
'ngcc',
77-
'--async',
78-
'--create-ivy-entry-points',
79-
'--first-only'
80-
], { stdio: 'inherit' });
75+
const result = crossSpawn.sync(
76+
command,
77+
['ngcc', '--async', '--create-ivy-entry-points', '--first-only'],
78+
{ stdio: 'inherit' }
79+
);
8180

8281
if (result.status !== 0) {
8382
const error = result.error || '';
@@ -94,7 +93,6 @@ function getLockFileHash(fedOptions: FederationOptions) {
9493
const NGCC_LOCK_DIR = 'node_modules/.cache/native-federation/ngcc';
9594

9695
function skipNgcc(hash: string, workspaceRoot: string) {
97-
9896
const ngccLockFileDir = path.join(workspaceRoot, NGCC_LOCK_DIR);
9997
const ngccLockFileName = path.join(ngccLockFileDir, hash + '.lock');
10098

@@ -129,10 +127,14 @@ function getLockFileName(workspaceRoot: string) {
129127

130128
function getNpxCommand(workspaceRoot: string): string {
131129
switch (getLockFileName(workspaceRoot)) {
132-
case 'package-lock.json': return 'npx';
133-
case 'yarn.lock': return 'yarn';
134-
case 'pnpm-lock.yaml': return 'pnpx';
135-
default: return 'npx';
130+
case 'package-lock.json':
131+
return 'npx';
132+
case 'yarn.lock':
133+
return 'yarn';
134+
case 'pnpm-lock.yaml':
135+
return 'pnpx';
136+
default:
137+
return 'npx';
136138
}
137139
}
138140

libs/native-federation/src/schematics/init/schematic.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ async function generateFederationConfig(
265265
projectSourceRoot,
266266
remoteMap,
267267
...options,
268+
tmpl: '',
268269
}),
269270
move(projectRoot),
270271
]);

package-lock.json

Lines changed: 185 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
"dep-graph": "nx dep-graph",
2929
"help": "nx help"
3030
},
31+
"precommit": "format:write",
3132
"private": true,
3233
"dependencies": {
3334
"@angular-architects/module-federation": "file:angular-architects-module-federation-14.3.10.tgz",
@@ -105,6 +106,7 @@
105106
"postcss-import": "14.1.0",
106107
"postcss-preset-env": "7.5.0",
107108
"postcss-url": "10.1.3",
109+
"pre-commit": "^1.2.2",
108110
"prettier": "2.6.2",
109111
"rollup": "^2.79.0",
110112
"rollup-plugin-node-externals": "^4.1.1",

0 commit comments

Comments
 (0)