Skip to content
This repository was archived by the owner on Mar 7, 2026. It is now read-only.

fix: resolve package installation issues for consumers (fixes #36)#37

Merged
christoph2806 merged 2 commits intodevelopfrom
fix/package-installation-issue-36
May 30, 2025
Merged

fix: resolve package installation issues for consumers (fixes #36)#37
christoph2806 merged 2 commits intodevelopfrom
fix/package-installation-issue-36

Conversation

@christoph2806
Copy link
Copy Markdown
Member

Fix Package Installation Issues for Consumers

Resolves #36 - Package installation fails when used as dependency - blocks all consumers

Problem Summary

The @etherisc/ui-kit package could not be installed as a dependency in consumer projects due to several critical issues:

  1. Husky prepare script failing in consumer environments
  2. Package marked as private preventing npm publishing
  3. Monorepo structure confusion for consumers
  4. Missing proper peer dependencies configuration

Solution Overview

This PR implements a comprehensive fix with 6 main components:

1. Fixed Husky Prepare Script

  • Made prepare script conditional to prevent failures when package is installed as dependency
  • Script now checks for .git directory existence and handles missing husky gracefully

2. Made UI Kit Package Publishable

  • Removed "private": true flag from package.json
  • Added proper peer dependencies for React >=18.0.0 and React-DOM >=18.0.0
  • Moved testing dependencies to devDependencies where they belong

3. Configured npm Publishing

  • Updated changesets configuration for public access
  • Enhanced GitHub Actions release workflow for dual publishing
  • Set up publishing to both npm registry and GitHub Packages

4. Optimized Package for Consumers

  • Release workflow removes development scripts and devDependencies from published package
  • Only essential files included in published package
  • Reduced overhead for consumers

5. Tested Package Installation

  • Created test consumer project to verify installation works
  • Confirmed components can be imported and used correctly
  • Verified no installation errors occur

6. Updated Documentation

  • Added comprehensive installation instructions to README.md
  • Updated CONTRIBUTING.md with new publishing workflow
  • Included usage examples and peer dependency requirements

Technical Changes

Files Modified:

  • package.json - Fixed husky prepare script
  • packages/ui-kit/package.json - Removed private flag, added peer deps, optimized dependencies
  • .changeset/config.json - Set access to public
  • .github/workflows/release.yml - Enhanced for dual npm/GitHub publishing
  • README.md - Added installation and usage instructions
  • CONTRIBUTING.md - Updated release process documentation

Expected Consumer Experience After Fix:

# Install from npm registry (recommended)
npm install @etherisc/ui-kit

# Install from GitHub Packages (alternative)
npm install @etherisc/ui-kit --registry=https://npm.pkg.github.com

# Use components immediately
import { Button, TextInput, AppShell } from '@etherisc/ui-kit';
import '@etherisc/ui-kit/dist/style.css';

Testing

  • ✅ All existing tests pass
  • ✅ Package builds successfully
  • ✅ Installation tested in sample consumer project
  • ✅ Components import and render correctly
  • ✅ Lint checks pass
  • ✅ Accessibility tests pass (257/257)

Breaking Changes

None - this is purely a fix that makes the package installable without changing any APIs.

Dependencies

  • Requires npm registry secrets to be configured (✅ Done)
  • Ready for immediate publishing once merged

This fix completely resolves the critical blocker preventing consumers from using the UI kit package.

@christoph2806 christoph2806 merged commit 9923404 into develop May 30, 2025
8 checks passed
@christoph2806 christoph2806 deleted the fix/package-installation-issue-36 branch May 30, 2025 08:07
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Package installation fails when used as dependency - blocks all consumers

1 participant