Skip to content

Commit c77a7d3

Browse files
committed
fix(all): Fixed audit vulnerabilities + moved cache options
1 parent 18d061b commit c77a7d3

10 files changed

Lines changed: 1756 additions & 1842 deletions

File tree

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export interface FederationConfig {
2727
features?: {
2828
mappingVersion?: boolean;
2929
ignoreUnusedDeps?: boolean;
30-
cacheExternalArtifacts: boolean;
3130
};
3231
}
3332

@@ -56,6 +55,5 @@ export interface NormalizedFederationConfig {
5655
features: {
5756
mappingVersion: boolean;
5857
ignoreUnusedDeps: boolean;
59-
cacheExternalArtifacts: boolean;
6058
};
6159
}

libs/native-federation-core/src/lib/config/with-native-federation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ export function withNativeFederation(
2828
features: {
2929
mappingVersion: config.features?.mappingVersion ?? false,
3030
ignoreUnusedDeps: config.features?.ignoreUnusedDeps ?? false,
31-
cacheExternalArtifacts: config.features?.cacheExternalArtifacts ?? false,
3231
},
3332
};
3433

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export async function bundleShared(
3737
getFilename(cacheOptions.bundleName),
3838
);
3939

40-
if (config?.features?.cacheExternalArtifacts) {
40+
if (fedOptions?.cacheExternalArtifacts) {
4141
const cacheMetadata = bundleCache.getMetadata(checksum);
4242
if (cacheMetadata) {
4343
logger.debug(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export interface FederationOptions {
44
workspaceRoot: string;
55
outputPath: string;
66
federationConfig: string;
7-
cacheExternals: boolean;
7+
cacheExternalArtifacts?: boolean;
88
tsConfig?: string;
99
verbose?: boolean;
1010
dev?: boolean;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ export async function* runBuilder(
226226
dev: !!nfOptions.dev,
227227
entryPoint,
228228
buildNotifications: nfOptions.buildNotifications,
229+
cacheExternalArtifacts: nfOptions.cacheExternalArtifacts,
229230
};
230231

231232
const activateSsr = nfOptions.ssr && !nfOptions.dev;

libs/native-federation/src/builders/build/schema.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,5 @@ export interface NfBuilderSchema extends JsonObject {
1717
outputPath?: string;
1818
ssr: boolean;
1919
devServer?: boolean;
20+
cacheExternalArtifacts?: boolean;
2021
} // eslint-disable-line

libs/native-federation/src/schematics/init/files/federation.config.js__tmpl__

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,6 @@ module.exports = withNativeFederation({
2828
// New feature for more performance and avoiding
2929
// issues with node libs. Comment this out to
3030
// get the traditional behavior:
31-
ignoreUnusedDeps: true,
32-
33-
// Will use a checksum to verify if compiled (external)
34-
// artifacts were unchanged since last build (based on
35-
// name and version). If so it will reuse the compiled ones.
36-
cacheExternalArtifacts: true
31+
ignoreUnusedDeps: true
3732
}
3833
});

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ function updateWorkspaceConfig(
302302
target: `${projectName}:serve-original:development`,
303303
rebuildDelay: 500,
304304
dev: true,
305+
cacheExternalArtifacts: false,
305306
port: 0,
306307
},
307308
};

0 commit comments

Comments
 (0)