Open zach-is-my-name opened 2 years ago
Yargs has been pulled as a core dependency, due to security warnings... thus you cannot currently install -g
.
I will update the docs shortly... for now just use the experimental CL with npm install -g ascii-art-cl
which will be the mainline for commandline use going forward.
Hello @khrome ! I'm interested in using your library and possibly contributing to it. The images on the readme look really good!
Installing like you said on the comment of this thread
npm install -g ascii-art-cl
and trying the readme examples yields another error
me@computer:~/$ ascii-art image -B 32 -a solid ./escher.jpeg
logging conf:
[String: '{\n' +
' // defaults go here.\n' +
' "bitdepth": 2,\n' +
' //request-as-request, fetch-as-request, axios-as-request\n' +
' "requestlib": "request-as-request",\n' +
' "artwork": []\n' +
'}']
/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/bin/ascii-art:250
conf.artwork.forEach(function(source){
^
TypeError: Cannot read properties of undefined (reading 'forEach')
at /home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/bin/ascii-art:250:34
at done (/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:508:16)
at CLApp.plugins (/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:513:10)
at /home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/bin/ascii-art:240:21
at /home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:365:9
at Timeout._onTimeout (/home/me/.nvm/versions/node/v17.3.0/lib/node_modules/ascii-art-cl/node_modules/app-term-kit/app.js:305:20)
at listOnTimeout (node:internal/timers:568:17)
at processTimers (node:internal/timers:510:7)
Node.js v17.3.0
Am I missing something? Did the CLI's API change on this experimental version?
(I put a console.log on the conf object that raises the error, maybe it helps)
If you just want to use it, try npm install -g asciiart@2.7.0
(the last version to bundle yargs), if you want to dev pull the ascii-art-cl
repo and do a dev install. Either way should work.
The specific error you're getting is related to plugin support which allows you to 1) fetch remote URLs and 2) install plugins for particular ascii-art sources. (the last release was the first feature complete version for this change, so it's likely that this broke something).
The good news is come 3.0 there will be command line tests, to limit this (currently tests are for the API only)
Hi, I was wondering if there are any plans to still release version 3.0 or another version that solves these errors? Is there anything I can do to help work on it?
Hi there, I'm currently working on a rebuild for 3.0 under /ansi-art which uses a more maintainable structure (via ESM from UMD), makes Color
a non-static interface and improves the interface for using subcomponents piecemeal (without altering the top level interface) among other improvements. The "fix" is a downgrade to 2.7.0 or any version prior, unless you want to play with the plugin system (which is probably a nest of complexity you don't want to take on, runs in multiple targets, and is EOL in favor of ESM for 3.0).
If you really want to contribute I'd be happy to take a few smaller contributions in the ansi-art
namespace then we can do something like go through a roadmap (most of the modules left are clean ports of what's already there and the base components and interfaces are all done, then a top level wrapper to tie it all together).
Thanks for the interest!
Thanks. That sounds like a reasonable approach for 3.0. Would you also be open to a version 2.7.1 that would at least update the dependencies with security fixes (and fix this yargs
issue)?
I actually started down that path working on a fork of the code, but I couldn't get the browser tests to run. Were these actually passing in 2.7.0? If they were, is there a way to get them working in 2024? (It seems like they depend on very old versions of things, and Karma itself is deprecated.)
Yes, I would be open to a patch fix, but only if it works in the browser, in node and on command line. The karma tests do not work currently, but I have an ESM harness for 3.0 forward that runs everything in different environments using a common suite and also transpiles source to cjs and tests that, too. more here
Given that karma is EOL, and the pain of getting the tests running on a single suite originally, I'm reticent to attempt to port them to another test runner for the point release. I'm somewhat flexible on this, but I don't want to double the test surface in the process, but would be OK with most any mocha/should compatible(Really just basic syntax) solution.