Skip to content

Commit

Permalink
add code examples to YarnRunner methods' xml
Browse files Browse the repository at this point in the history
  • Loading branch information
MilovanovM committed Nov 5, 2016
1 parent abb7c3c commit d3870d9
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cake.yarn",
"version": "0.1.0",
"version": "0.1.1",
"description": "",
"main": "index.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/Cake.Yarn/Cake.Yarn.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>A set of aliases for Cake to help with running Yarn (node package manager from Facebook) commands</description>
<tags>Cake Script Build Yarn</tags>
<version>0.1.0</version>
<version>0.1.1</version>
</metadata>
<files>
<file src="..\..\artifacts\build\Cake.Yarn.xml" target="lib\net45" />
Expand Down
6 changes: 3 additions & 3 deletions src/Cake.Yarn/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("Cake.Yarn.Tests")]
[assembly: AssemblyVersion("0.1.0")]
[assembly: AssemblyFileVersion("0.1.0")]
[assembly: AssemblyInformationalVersion("0.1.0")]
[assembly: AssemblyVersion("0.1.1")]
[assembly: AssemblyFileVersion("0.1.1")]
[assembly: AssemblyInformationalVersion("0.1.1")]
57 changes: 57 additions & 0 deletions src/Cake.Yarn/YarnRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,28 @@ public IYarnRunnerCommands FromPath(DirectoryPath path)
/// execute 'yarn install' with options
/// </summary>
/// <param name="configure">options when running 'yarn install'</param>
/// <example>
/// <para>Run 'yarn install'</para>
/// <code>
/// <![CDATA[
/// Task("Yarn-FromPath")
/// .Does(() =>
/// {
/// Yarn.FromPath("./dir-with-packagejson").Install();
/// });
/// ]]>
/// </code>
/// <para>Run 'yarn install'</para>
/// <code>
/// <![CDATA[
/// Task("Yarn-Install")
/// .Does(() =>
/// {
/// Yarn.Install();
/// });
/// ]]>
/// </code>
/// </example>
public IYarnRunnerCommands Install(Action<YarnInstallSettings> configure = null)
{
var settings = new YarnInstallSettings();
Expand All @@ -80,10 +102,33 @@ private static ProcessArgumentBuilder GetYarnInstallArguments(YarnInstallSetting
#endregion

#region yarn add

/// <summary>
/// execute 'yarn add' with options
/// </summary>
/// <param name="configure">options when running 'yarn install'</param>
/// <example>
/// <para>Run 'yarn add gulp'</para>
/// <code>
/// <![CDATA[
/// Task("Yarn-Add-Gulp")
/// .Does(() =>
/// {
/// Yarn.Add(settings => settings.Package("gulp"));
/// });
/// ]]>
/// </code>
/// <para>Run 'yarn global add gulp'</para>
/// <code>
/// <![CDATA[
/// Task("Yarn-Add-Gulp")
/// .Does(() =>
/// {
/// Yarn.Add(settings => settings.Package("gulp").Globally());
/// });
/// ]]>
/// </code>
/// </example>
public IYarnRunnerCommands Add(Action<YarnAddSettings> configure = null)
{
var settings = new YarnAddSettings();
Expand Down Expand Up @@ -115,6 +160,18 @@ private static ProcessArgumentBuilder GetYarnAddArguments(YarnAddSettings settin
/// </summary>
/// <param name="scriptName">name of the </param>
/// <param name="configure"></param>
/// <example>
/// <para>Run 'yarn run hello'</para>
/// <code>
/// <![CDATA[
/// Task("Yarn-Run")
/// .Does(() =>
/// {
/// Yarn.Run("hello");
/// });
/// ]]>
/// </code>
/// </example>
public IYarnRunnerCommands RunScript(string scriptName, Action<YarnRunSettings> configure = null)
{
var settings = new YarnRunSettings(scriptName);
Expand Down
4 changes: 2 additions & 2 deletions src/Cake.Yarn/YarnRunnerAliases.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public static class YarnRunnerAliases
/// Task("Yarn-Add-Gulp")
/// .Does(() =>
/// {
/// Yarn.Add(settings => settings.Package("package"));
/// Yarn.Add(settings => settings.Package("gulp"));
/// });
/// ]]>
/// </code>
Expand All @@ -56,7 +56,7 @@ public static class YarnRunnerAliases
/// Task("Yarn-Add-Gulp")
/// .Does(() =>
/// {
/// Yarn.Add(settings => settings.Package("package").Globally());
/// Yarn.Add(settings => settings.Package("gulp").Globally());
/// });
/// ]]>
/// </code>
Expand Down
2 changes: 1 addition & 1 deletion usage/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cake.yarn",
"version": "0.1.0",
"version": "0.1.1",
"description": "changing working directory for tool",
"main": "index.js",
"scripts": {
Expand Down

0 comments on commit d3870d9

Please sign in to comment.