Forge Overview
Forge: Asset Management SDK
Section titled βForge: Asset Management SDKβCore SDK for managing project assets across multiple version control systems.
Forge is a powerful SDK for managing project assets (bundles and starters) with a plugin-based resolver architecture that supports GitHub, GitLab, Bitbucket, and custom source control providers.
Core SDK
Section titled βCore SDKβThe Forge SDK (@fractary/forge) provides reusable components for asset resolution, caching, configuration management, and file operations.
npm install @fractary/forgeKey Features
Section titled βKey Featuresβπ Plugin-Based Resolvers
Section titled βπ Plugin-Based ResolversβExtensible architecture for multiple VCS providers. Register custom resolvers for any source control system.
π Multi-VCS Support
Section titled βπ Multi-VCS SupportβBuilt-in support for GitHub, static catalogs, and local/embedded assets. Add support for GitLab, Bitbucket, or custom providers.
π¦ Asset Management
Section titled βπ¦ Asset ManagementβManage bundles and starters with ownership rules and intelligent file filtering.
πΎ Smart Caching
Section titled βπΎ Smart CachingβIntelligent caching with configurable TTL:
- 1 hour for branches (frequently updated)
- 24 hours for releases (stable versions)
π§ Flexible Configuration
Section titled βπ§ Flexible ConfigurationβMulti-source configuration with global and project-level settings.
π TypeScript First
Section titled βπ TypeScript FirstβFull TypeScript support with comprehensive type definitions and subpath exports.
Quick Start
Section titled βQuick Startβimport { ResolverManager, GitHubResolver } from '@fractary/forge';
// Initialize resolver managerconst manager = new ResolverManager();
// Register GitHub resolvermanager.registerResolver(new GitHubResolver({ token: process.env.GITHUB_TOKEN, defaultOrg: 'fractary'}));
// Resolve and fetch an assetconst asset = await manager.resolveAsset('fractary/forge-bundle-auth@v1.0.0');
console.log(asset.manifest.name);console.log(`${asset.files.size} files`);Architecture
Section titled βArchitectureβββββββββββββββββββββββββββββββββββββββββββββ ResolverManager ββ (Routes requests to resolvers) βββββββ¬ββββββββββββ¬βββββββββββββ¬ββββββββββββ β β β βΌ βΌ βΌββββββββββββ ββββββββββ ββββββββββββ GitHub β βCatalog β β Local ββResolver β βResolverβ β Resolverβββββββββββββ ββββββββββ βββββββββββSupported Resolvers
Section titled βSupported ResolversβGitHub Resolver
Section titled βGitHub ResolverβFetch assets from GitHub repositories via API:
- Tarball download and extraction
- Smart caching (1hr for branches, 24hr for releases)
- File filtering based on manifest patterns
- Authentication via GitHub tokens
Catalog Resolver
Section titled βCatalog ResolverβStatic JSON catalog for asset discovery:
- Multi-catalog management
- Asset search and discovery
- Offline support with disk caching
Local Resolver
Section titled βLocal ResolverβLocal filesystem and embedded assets:
file://URL support- Embedded asset loading
- Development and testing
Custom Resolvers
Section titled βCustom ResolversβImplement the IResolver interface for custom sources like:
- GitLab
- Bitbucket
- S3 buckets
- Custom registries
Asset Identifier Formats
Section titled βAsset Identifier Formatsβ// Explicit resolver prefix'github:owner/repo@ref' β GitHubResolver'catalog:asset-id' β CatalogResolver'file:///path/to/asset' β LocalResolver
// Default resolver (configured)'owner/repo@ref' β Default resolverConfiguration
Section titled βConfigurationβimport { ConfigManager } from '@fractary/forge';
const configMgr = new ConfigManager();const config = await configMgr.loadGlobalConfig();
// Configure multiple resolversconfig.resolvers.github = { token: process.env.GITHUB_TOKEN, defaultOrg: 'fractary'};
config.resolvers.default = 'github';Module Exports
Section titled βModule ExportsβThe SDK provides subpath exports for granular imports:
import { ResolverManager } from '@fractary/forge';import { GitHubResolver } from '@fractary/forge/resolvers';import { ForgeConfig } from '@fractary/forge/types';import { ConfigManager } from '@fractary/forge/config';import { CacheManager } from '@fractary/forge/cache';import { ForgeError } from '@fractary/forge/errors';Use Cases
Section titled βUse Casesβ- Bundle Distribution - Distribute pre-configured component bundles
- Project Scaffolding - Initialize new projects from starter templates
- Multi-Repo Management - Sync assets across multiple repositories
- Development Tooling - Build CLIs and automation tools
Current Version: 1.0.0 Status: Production Ready License: MIT
The SDK is complete and published to GitHub Package Registry. Additional features planned for v1.1.0.
Next Steps
Section titled βNext StepsβRelated Projects
Section titled βRelated Projectsβ- forge-cli - CLI tool built on Forge SDK
- forge-bundle-* - Pre-built bundles for common use cases
- forge-catalog - Public catalog of Forge assets