zarro 1.170.14 → 1.170.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -805,6 +805,25 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
805
805
  }
806
806
  return finalResult;
807
807
  }
808
+ async function installPackage(opts) {
809
+ if (!opts) {
810
+ throw new Error(`no options passed to 'installPackage' - target project and package name not specified`);
811
+ }
812
+ if (!`${opts.projectFile}`.trim()) {
813
+ throw new Error(`projectFile not specified`);
814
+ }
815
+ if (!`${opts.id}`.trim()) {
816
+ throw new Error(`package id not specified`);
817
+ }
818
+ const args = ["add", "package", opts.projectFile, opts.id];
819
+ pushIfSet(args, opts.version, "--version");
820
+ pushIfSet(args, opts.framework, "--framework");
821
+ pushFlag(args, opts.noRestore, "--no-restore");
822
+ pushIfSet(args, opts.source, "--source");
823
+ pushIfSet(args, opts.packageDirectory, "--package-directory");
824
+ pushFlag(args, opts.preRelease, "--prerelease");
825
+ await runDotNetWith(args, opts);
826
+ }
808
827
  module.exports = {
809
828
  test,
810
829
  build,
@@ -821,6 +840,7 @@ WARNING: 'dotnet pack' ignores --version-suffix when a nuspec file is provided.
821
840
  enableNugetSource,
822
841
  tryFindConfiguredNugetSource,
823
842
  incrementTempDbPortHintIfFound,
824
- searchPackages
843
+ searchPackages,
844
+ installPackage
825
845
  };
826
846
  })();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zarro",
3
- "version": "1.170.14",
3
+ "version": "1.170.16",
4
4
  "description": "Some glue to make gulp easier, perhaps even zero- or close-to-zero-conf",
5
5
  "bin": {
6
6
  "zarro": "./index.js"
package/types.d.ts CHANGED
@@ -1512,6 +1512,17 @@ declare global {
1512
1512
  configFile?: string;
1513
1513
  }
1514
1514
 
1515
+ interface DotNetInstallNugetPackageOption extends DotNetBaseOptions {
1516
+ id: string;
1517
+ projectFile: string;
1518
+ version?: string;
1519
+ framework?: string;
1520
+ noRestore?: boolean;
1521
+ source?: string;
1522
+ packageDirectory?: string;
1523
+ preRelease?: boolean;
1524
+ }
1525
+
1515
1526
  interface IoConsumers {
1516
1527
  stdout?: IoConsumer;
1517
1528
  stderr?: IoConsumer;
@@ -1573,6 +1584,7 @@ declare global {
1573
1584
  type DotNetDisableNugetSourceFunction = (source: string | NugetSource) => Promise<void>;
1574
1585
  type DotNetTryMatchNugetSourceFunction = (nameOrUrlOrHostOrSpec: string | Partial<NugetSource> | RegExp) => Promise<Optional<NugetSource>>;
1575
1586
  type DotNetSearchNugetPackagesFunction = (opts: DotNetSearchPackagesOptions | string) => Promise<PackageInfo[]>;
1587
+ type DotNetInstallNugetPackageFunction = (opts: DotNetInstallNugetPackageOption | string) => Promise<void>;
1576
1588
 
1577
1589
  interface DotNetCli {
1578
1590
  clean: DotNetCleanFunction;
@@ -1591,6 +1603,7 @@ declare global {
1591
1603
  tryFindConfiguredNugetSource: DotNetTryMatchNugetSourceFunction;
1592
1604
  incrementTempDbPortHintIfFound: (env: Dictionary<string>) => void;
1593
1605
  searchPackages: DotNetSearchNugetPackagesFunction;
1606
+ installPackage: DotNetInstallNugetPackageFunction;
1594
1607
  }
1595
1608
 
1596
1609
  type ReadCsProjNode = (csproj: string) => Promise<string>;