Reverting breaking changes with npmScript parameter name
This commit is contained in:
parent
c398361412
commit
102bcf6739
|
|
@ -26,15 +26,15 @@ namespace Microsoft.AspNetCore.SpaServices.AngularCli
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Constructs an instance of <see cref="AngularCliBuilder"/>.
|
/// Constructs an instance of <see cref="AngularCliBuilder"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="scriptName">The name of the script in your package.json file that builds the server-side bundle for your Angular application.</param>
|
/// <param name="npmScript">The name of the script in your package.json file that builds the server-side bundle for your Angular application.</param>
|
||||||
public AngularCliBuilder(string scriptName)
|
public AngularCliBuilder(string npmScript)
|
||||||
{
|
{
|
||||||
if (string.IsNullOrEmpty(scriptName))
|
if (string.IsNullOrEmpty(npmScript))
|
||||||
{
|
{
|
||||||
throw new ArgumentException("Cannot be null or empty.", nameof(scriptName));
|
throw new ArgumentException("Cannot be null or empty.", nameof(npmScript));
|
||||||
}
|
}
|
||||||
|
|
||||||
_scriptName = scriptName;
|
_scriptName = npmScript;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <inheritdoc />
|
/// <inheritdoc />
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ namespace Microsoft.AspNetCore.SpaServices.AngularCli
|
||||||
/// sure not to enable the Angular CLI server.
|
/// sure not to enable the Angular CLI server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
|
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
|
||||||
/// <param name="scriptName">The name of the script in your package.json file that launches the Angular CLI process.</param>
|
/// <param name="npmScript">The name of the script in your package.json file that launches the Angular CLI process.</param>
|
||||||
public static void UseAngularCliServer(
|
public static void UseAngularCliServer(
|
||||||
this ISpaBuilder spaBuilder,
|
this ISpaBuilder spaBuilder,
|
||||||
string scriptName)
|
string npmScript)
|
||||||
{
|
{
|
||||||
if (spaBuilder == null)
|
if (spaBuilder == null)
|
||||||
{
|
{
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.SpaServices.AngularCli
|
||||||
throw new InvalidOperationException($"To use {nameof(UseAngularCliServer)}, you must supply a non-empty value for the {nameof(SpaOptions.SourcePath)} property of {nameof(SpaOptions)} when calling {nameof(SpaApplicationBuilderExtensions.UseSpa)}.");
|
throw new InvalidOperationException($"To use {nameof(UseAngularCliServer)}, you must supply a non-empty value for the {nameof(SpaOptions.SourcePath)} property of {nameof(SpaOptions)} when calling {nameof(SpaApplicationBuilderExtensions.UseSpa)}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
AngularCliMiddleware.Attach(spaBuilder, scriptName);
|
AngularCliMiddleware.Attach(spaBuilder, npmScript);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -20,10 +20,10 @@ namespace Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer
|
||||||
/// sure not to enable the create-react-app server.
|
/// sure not to enable the create-react-app server.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
|
/// <param name="spaBuilder">The <see cref="ISpaBuilder"/>.</param>
|
||||||
/// <param name="scriptName">The name of the script in your package.json file that launches the create-react-app server.</param>
|
/// <param name="npmScript">The name of the script in your package.json file that launches the create-react-app server.</param>
|
||||||
public static void UseReactDevelopmentServer(
|
public static void UseReactDevelopmentServer(
|
||||||
this ISpaBuilder spaBuilder,
|
this ISpaBuilder spaBuilder,
|
||||||
string scriptName)
|
string npmScript)
|
||||||
{
|
{
|
||||||
if (spaBuilder == null)
|
if (spaBuilder == null)
|
||||||
{
|
{
|
||||||
|
|
@ -37,7 +37,7 @@ namespace Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer
|
||||||
throw new InvalidOperationException($"To use {nameof(UseReactDevelopmentServer)}, you must supply a non-empty value for the {nameof(SpaOptions.SourcePath)} property of {nameof(SpaOptions)} when calling {nameof(SpaApplicationBuilderExtensions.UseSpa)}.");
|
throw new InvalidOperationException($"To use {nameof(UseReactDevelopmentServer)}, you must supply a non-empty value for the {nameof(SpaOptions.SourcePath)} property of {nameof(SpaOptions)} when calling {nameof(SpaApplicationBuilderExtensions.UseSpa)}.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ReactDevelopmentServerMiddleware.Attach(spaBuilder, scriptName);
|
ReactDevelopmentServerMiddleware.Attach(spaBuilder, npmScript);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue