Skip to content

Commit

Permalink
Merge pull request webpack#11105 from webpack/mf/semver
Browse files Browse the repository at this point in the history
add full Semantic Versioning for Shared Modules
  • Loading branch information
sokra authored Jul 6, 2020
2 parents e8ed3d8 + 767ac32 commit e27eb83
Show file tree
Hide file tree
Showing 37 changed files with 1,724 additions and 879 deletions.
1 change: 1 addition & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@
"darkblue",
"darkgreen",
"darkred",
"eqeqeq",

"webassemblyjs",
"fsevents",
Expand Down
8 changes: 2 additions & 6 deletions declarations/_sharing.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Shared = (SharedItem | SharedObject)[] | SharedObject;
* A module that should be shared in the share scope.
*/
export type SharedItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

export interface _Sharing {
[k: string]: any;
Expand Down Expand Up @@ -48,7 +44,7 @@ export interface SharedConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand All @@ -68,5 +64,5 @@ export interface SharedConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
8 changes: 2 additions & 6 deletions declarations/plugins/container/ModuleFederationPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,6 @@ export type Shared = (SharedItem | SharedObject)[] | SharedObject;
* A module that should be shared in the share scope.
*/
export type SharedItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

export interface ModuleFederationPluginOptions {
/**
Expand Down Expand Up @@ -265,7 +261,7 @@ export interface SharedConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand All @@ -285,5 +281,5 @@ export interface SharedConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
6 changes: 1 addition & 5 deletions declarations/plugins/sharing/ConsumeSharedPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Consumes = (ConsumesItem | ConsumesObject)[] | ConsumesObject;
* A module that should be consumed from share scope.
*/
export type ConsumesItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

/**
* Options for consuming shared modules.
Expand Down Expand Up @@ -58,7 +54,7 @@ export interface ConsumesConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand Down
6 changes: 1 addition & 5 deletions declarations/plugins/sharing/ProvideSharedPlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Provides = (ProvidesItem | ProvidesObject)[] | ProvidesObject;
* Request to a module that should be provided as shared module to the share scope (will be resolved when relative).
*/
export type ProvidesItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

export interface ProvideSharedPluginOptions {
/**
Expand Down Expand Up @@ -55,5 +51,5 @@ export interface ProvidesConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
8 changes: 2 additions & 6 deletions declarations/plugins/sharing/SharePlugin.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export type Shared = (SharedItem | SharedObject)[] | SharedObject;
* A module that should be shared in the share scope.
*/
export type SharedItem = string;
/**
* Version number as array. Numbers and strings are accepted. Strings are treated as tags, which only match exactly. Numbers can match higher numbers.
*/
export type SharedVersionArray = (number | string)[];

/**
* Options for shared modules.
Expand Down Expand Up @@ -58,7 +54,7 @@ export interface SharedConfig {
/**
* Version requirement from module in share scope.
*/
requiredVersion?: false | string | SharedVersionArray;
requiredVersion?: false | string;
/**
* Module is looked up under this key from the share scope.
*/
Expand All @@ -78,5 +74,5 @@ export interface SharedConfig {
/**
* Version of the provided module. Will replace lower matching versions, but not higher.
*/
version?: false | string | SharedVersionArray;
version?: false | string;
}
Loading

0 comments on commit e27eb83

Please sign in to comment.