Skip to content

refactor(dependencies): add missing packages and fix import paths - #248

Open
maurodesouza wants to merge 1 commit into
Ashutosh00710:mainfrom
maurodesouza:fix/node-modules-paths
Open

refactor(dependencies): add missing packages and fix import paths#248
maurodesouza wants to merge 1 commit into
Ashutosh00710:mainfrom
maurodesouza:fix/node-modules-paths

Conversation

@maurodesouza

Copy link
Copy Markdown

Description

This PR addresses dependency management issues and improves import path stability for the node-chartist library, specifically to resolve installation failures when using this project as a dependency in a GitHub Action.

Problem

When attempting to use this project as a library within a GitHub Action (via github:Ashutosh00710/github-readme-activity-graph), the action failed during the pnpm install step because several packages were being imported in the code but were not declared in package.json. This caused the dependency resolution to fail, preventing the action from running.

Additionally, node-chartist imports were using relative paths to internal library files (node-chartist/lib/...), which is fragile and could break if the library's internal structure changes in future versions.

Changes

1. Added missing dependencies to package.json

  • @panosoft/ramda-utils: Used in createChart.ts for functional programming utilities (Ru.defaults)
  • co: Used for generator-based async/await patterns (co.wrap)
  • is_js: Used for type checking utilities (is.function, is.not.json)
  • ramda: Used for functional programming patterns (R.curryN)

These packages were already being imported and used in the code but were missing from the dependency declarations. This caused installation failures when the project was consumed as a dependency via pnpm, as the package manager could not resolve these implicit dependencies.

2. Updated node-chartist imports

Changed from relative path imports:

const chartist = require('node-chartist/lib/chartist');
const generateChart = require('node-chartist/lib/chart');
const generateLegend = require('node-chartist/lib/legend');

To standard module path imports (using the package's main entry point):

const chartist = require('node-chartist');
const generateChart = require('node-chartist').chart;
const generateLegend = require('node-chartist').legend;

This change makes the imports more resilient to internal library restructuring and follows better Node.js module resolution practices.

Impact

  • GitHub Action compatibility: The project can now be successfully installed as a dependency in GitHub Actions without missing package errors
  • Dependency completeness: All required dependencies are now properly declared, ensuring consistent installations across environments
  • Maintainability: Standard module paths are less likely to break with library updates
  • Build stability: Reduces risk of runtime errors from missing packages or broken import paths

All Submissions

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions

  1. Does your submission pass tests?
  2. Have you lint your code locally prior to submission?

Changes to Core Features

  • Have you added an explanation of what your changes do and why you'd like us to include them?
  • Have you written new tests for your core changes, as applicable?
  • Have you successfully ran tests with your changes locally?

- Add @panosoft/ramda-utils, co, is_js, and ramda dependencies
- Update node-chartist imports to use standard module paths instead of relative paths
@vercel

vercel Bot commented May 11, 2026

Copy link
Copy Markdown

@maurodesouza is attempting to deploy a commit to the ashutosh00710's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant