npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@uipath/solutionpackager-tool-core

v0.0.26

Published

UiPath contracts for solution packager tools

Readme

UiPath Solution Packager Tool Core

Core contracts and interfaces for building UiPath Solution Packager tools. This package provides the type definitions and base classes for creating tools that restore, validate, build, and pack UiPath projects and solutions.

Installation

From GitHub Packages

Prerequisites

Create a GitHub Personal Access Token with read:packages permission:

  1. Go to GitHub → Settings → Developer settings → Personal access tokens → Tokens (classic)
  2. Generate new token with read:packages scope
  3. Set as environment variable:

Windows (PowerShell):

$env:GH_NPM_REGISTRY_TOKEN = "your-token-here"

Linux/macOS:

export GH_NPM_REGISTRY_TOKEN="your-token-here"

Install

Create .npmrc in your project root:

@uipath:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=${GH_NPM_REGISTRY_TOKEN}

Then install:

npm install @uipath/solutionpackager-tool-core

Quick Start

1. Implement a Project Tool

Extend ProjectTool and override the operations you need:

import {
  ProjectTool,
  type IProjectBuildOptions,
  type IProjectRestoreOptions,
  ToolResult,
  type IToolLogger,
  type IFileSystem,
  Path,
} from "@uipath/solutionpackager-tool-core";

export class ApiWorkflowsTool extends ProjectTool {
  constructor(fileSystem: IFileSystem, logger: IToolLogger) {
    super(fileSystem, logger);
  }

  override async restoreAsync(
    options: IProjectRestoreOptions,
    cancellationToken?: AbortSignal
  ): Promise<ToolResult> {
    this.logger.info("Restoring dependencies...");
    return ToolResult.success();
  }

  override async buildAsync(
    options: IProjectBuildOptions,
    cancellationToken?: AbortSignal
  ): Promise<ToolResult> {
    this.logger.info("Building project...");
    const outputFolder = Path.join(options.outputPath, "output");

    await this.fileSystem.mkdir(outputFolder);
    await this.fileSystem.writeFile(
      Path.join(outputFolder, "artifact.txt"),
      "Build Artifact"
    );

    return new ToolResult(ToolErrorCodes.Success, "Build completed", [outputFolder]);
  }

  override async dispose(): Promise<void> {
    // Cleanup resources
  }
}

2. Create a Tool Factory

Implement IProjectToolFactory:

import {
  type IProjectToolFactory,
  type ProjectTool,
  ProjectTypes,
  type ProjectType,
  type IToolLogger,
  type IFileSystem,
} from "@uipath/solutionpackager-tool-core";

export class ApiWorkflowToolFactory implements IProjectToolFactory {
  readonly supportedTypes: readonly ProjectType[] = [ProjectTypes.Api];

  constructor(private readonly fileSystem: IFileSystem) {}

  async createAsync(logger: IToolLogger): Promise<ProjectTool> {
    return new ApiWorkflowsTool(this.fileSystem, logger);
  }
}

3. Register Your Tool

Register with the SolutionPackager instance:

import type { IToolsFactoryRepositoryConfigurator } from "@uipath/solutionpackager-tool-core";

export function registerProjectToolFactory(
  configurator: IToolsFactoryRepositoryConfigurator,
  fileSystem: IFileSystem
): void {
  configurator.registerProjectToolFactory(
    new ApiWorkflowToolFactory(fileSystem)
  );
}

// Usage:
// const solutionPackager = await createBrowserSolutionPackager();
// registerApiWorkflowTool(solutionPackager, solutionPackager.fileSystem);

Core Concepts

Tool Base Classes

ProjectTool - Override operations your tool supports:

  • restoreAsync() - Restore dependencies
  • validateAsync() - Validate project
  • buildAsync() - Build/compile
  • packAsync() - Package project
  • dispose() - Cleanup

SolutionTool - Similar to ProjectTool but operates at solution level.

Logging

Access logger via this.logger:

this.logger.info("Starting build");
this.logger.progress("Building", 50);
this.logger.warn("Deprecated API");
this.logger.error("Build failed", { code: "BUILD_001" });

File System

Access via this.fileSystem with consistent API across Node.js and Browser:

// Read file
const content = await this.fileSystem.readFile("path/to/file.json");

// Write file
await this.fileSystem.writeFile("output/config.xml", "<config></config>");

// Create directory (recursive)
await this.fileSystem.mkdir("dist/assets/images");

// Check existence
if (await this.fileSystem.exists("entrypoints.json")) { }

// List directory
const files = await this.fileSystem.readdir("src/components");

// Delete (recursive for directories)
await this.fileSystem.rm("temp_build");

Tool Results

// Success
return ToolResult.success();

// Error with code and message
return ToolResult.error(ToolErrorCodes.InternalError, "Syntax error");

// With package paths
return new ToolResult(ToolErrorCodes.Success, "done", [packagePath]);

Built-in Types

Project Types

  • ProjectTypes.Agent
  • ProjectTypes.Api
  • ProjectTypes.Connector
  • ProjectTypes.Process
  • ProjectTypes.Library
  • ProjectTypes.WebApp
  • ProjectTypes.Tests

Error Codes

  • ToolErrorCodes.Success
  • ToolErrorCodes.InternalError

Extend with custom codes:

type MyToolErrorCode = ToolErrorCode | "COMPILATION_FAILED" | "VALIDATION_ERROR";

Utilities

Path Utilities

import { Path } from "@uipath/solutionpackager-tool-core";
const fullPath = Path.join(basePath, "subfolder", "file.json");

NuGet Constants

import { NugetConstants } from "@uipath/solutionpackager-tool-core";

NugetConstants.OutputFolderName;           // "bundle"
NugetConstants.ContentFolderName;          // "content"
NugetConstants.OperateFileName;            // "operate.json"
NugetConstants.EntryPointsFileName;        // "entrypoints.json"
NugetConstants.PackageDescriptorFileName;  // "package-descriptor.json"

Architecture

┌─────────────────────────────────────────────────────────────┐
│              tool.core (contracts)                          │
│  IToolLogger  IFileSystem  ProjectTool  SolutionTool        │
└─────────────────────────────────────────────────────────────┘
                          ▲
          implements/uses │
┌─────────────────────────┼───────────────────────────────────┐
│              solutionpackager                               │
│  ToolLogger  FileSystem  ToolsFactory            │
└─────────────────────────────────────────────────────────────┘
  1. tool.core provides interfaces and base classes
  2. Tools implement interfaces and register factories
  3. SolutionPackager discovers and creates tool instances
  4. Tools execute operations with injected logger and file system

Development

# Build
npm run build

# Run tests
npm test

# Pack
npm pack

# Publish
npm publish

Troubleshooting

Installation Issues

404 Not Found:

401 Unauthorized:

  • Verify token hasn't expired
  • Check environment variable: echo $env:GH_NPM_REGISTRY_TOKEN (Windows) or echo $GH_NPM_REGISTRY_TOKEN (Linux/macOS)

Examples

See @uipath/tool-apiworkflow for a complete reference implementation.

Package Information