Reverting breaking changes with npmScript parameter name

This commit is contained in:
Justin Robb 2019-08-01 12:13:37 -07:00
parent c398361412
commit 102bcf6739
3 changed files with 11 additions and 11 deletions

View File

@ -26,15 +26,15 @@ namespace Microsoft.AspNetCore.SpaServices.AngularCli
/// <summary>
/// Constructs an instance of <see cref="AngularCliBuilder"/>.
/// </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>
public AngularCliBuilder(string scriptName)
/// <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 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 />

View File

@ -20,10 +20,10 @@ namespace Microsoft.AspNetCore.SpaServices.AngularCli
/// sure not to enable the Angular CLI server.
/// </summary>
/// <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(
this ISpaBuilder spaBuilder,
string scriptName)
string npmScript)
{
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)}.");
}
AngularCliMiddleware.Attach(spaBuilder, scriptName);
AngularCliMiddleware.Attach(spaBuilder, npmScript);
}
}
}

View File

@ -20,10 +20,10 @@ namespace Microsoft.AspNetCore.SpaServices.ReactDevelopmentServer
/// sure not to enable the create-react-app server.
/// </summary>
/// <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(
this ISpaBuilder spaBuilder,
string scriptName)
string npmScript)
{
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)}.");
}
ReactDevelopmentServerMiddleware.Attach(spaBuilder, scriptName);
ReactDevelopmentServerMiddleware.Attach(spaBuilder, npmScript);
}
}
}