salesforce-ux / theo

Theo is a an abstraction for transforming and formatting Design Tokens

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing dependency to "optimist" package

notbear opened this issue · comments

The theo.js script requires an optimist package but optimist is not listed as a direct dependency in package.json.

It usually works because optimist can be installed via transitive dependency from handlebars package.

It fails when using latest handlebars (4.7.4+) as they migrated from deprecated optimist to yargs

is this fixed?

Nope. Waiting for merge. I can confirm the fix in the pull request works.

can anyone make a version with this fix?

Can confirm I am still seeing this issue

I am also still seeing this issue - when will this be resolved @zahnster

Merged in #217 but still waiting for a new version to be published.

For anyone having problems, the temp fix is to install Theo and then edit node_modules/theo/bin/theo.js on L5 from const argv = require("optimist").argv; to const argv = require("yargs").argv;. You may need to npm install yargs depending on what other modules you have installed.

@frebro modifying node_modules files directly is not a temp fix since on every npm install on CI machines that change will be removed

Can we please reopen this issue until someone care enough to make a release ?
It's been fixed more that 4 month ago, all we need is a release on npm, this is getting ridiculous at this point...

@zahnster @aputinski any chance for the release?

BTW What are Salesforce's plans regarding this project? Is it abandoned?
It's really nice tool. IMO better than Style Dictionary for example. But I'd have to consider migration if Theo stays unmaintained.

@frebro modifying node_modules files directly is not a temp fix since on every npm install on CI machines that change will be removed

Sorry, I was being unclear. A temp fix when using Theo CLI manually from the command line is to install yargs and edit theo.js. It works, but will not persist on CI obviously.

npm i of theo version 8.1.5 doesn't have the merged change for some reason so:
const argv = require("optimist").argv; to <--- that's in 8.1.5
const argv = require("yargs").argv; <-- should be that

Can you (re)publish the npm again ?

@ringodotnl My fix was merged long time ago. But there was no release from January. Seems the project has been abandoned by its maintainers. Sad.

@notbear cheers for the reply.
Hopefully they find the time to make a new release, for now we apply a patch.