Code Monkey home page Code Monkey logo

cables-cli's People

Contributors

anticore avatar pandrr avatar steam0r avatar timpulver avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

cables-cli's Issues

Cli crash

Hello,
I tried to simply download and run the cli by typing cables.
This is what I get:

internal/util.js:209
    throw new errors.TypeError('ERR_INVALID_ARG_TYPE', 'original', 'function');
    ^

TypeError [ERR_INVALID_ARG_TYPE]: The "original" argument must be of type function
    at promisify (internal/util.js:209:11)
    at Object.<anonymous> (/usr/local/lib/node_modules/@cables/cables/node_modules/extract-zip/index.js:11:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/@cables/cables/index.js:9:17)

The error seems to come from the extract-zip package.

remove index html parameter

api now supports url query param removeIndexHtml to remove index.html from export

should be implemented as cmdline option

Cables node API error when using command line arguments

I run cables.export from @cables/cables as part of a script that I run in the following way:

joaor@DESKTOP-N0D1MFF MINGW64 /c/safe/longe (main)
$ npm run dev

> [email protected] dev
> tsx scripts/cli.ts dev

However, since @cables/cables uses command-line-args which is called at the top-level, the CLI argument dev incorrectly gets caught by command-line-args parse even though the script is not a CLI usage of the cables CLI.

> tsx scripts/cli.ts dev

C:\safe\longe\node_modules\@cables\cables\node_modules\command-line-args\dist\index.js:1369
        const err = new Error(`Unknown value: ${arg}`);
                    ^

UNKNOWN_VALUE: Unknown value: dev
    at commandLineArgs (C:\safe\longe\node_modules\@cables\cables\node_modules\command-line-args\dist\index.js:1369:21)
    at Object.<anonymous> (C:\safe\longe\node_modules\@cables\cables\index.js:94:17)
    at Module._compile (node:internal/modules/cjs/loader:1376:14)
    at Object.S (C:\safe\longe\node_modules\tsx\dist\cjs\index.cjs:1:1292)
    at Module.load (node:internal/modules/cjs/loader:1207:32)
    at Module._load (node:internal/modules/cjs/loader:1023:12)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at fs (c:\safe\longe\scripts\utils\exportCables.ts:1:20)
    at Object.<anonymous> (c:\safe\longe\scripts\utils\exportCables.ts:33:25) {
  value: 'dev'
}

Arg parser fails when patch ID starts with '-'

Hey there :)

Not sure, how common this is, but I have a patch ID beginning with a hyphen '-', followed by 'K'. This causes the command line arg parser to interpret this as '-K' which is not a valid option.

My quick fix was to clone the patch, but is not ideal imho.

I had a look into the source, but not sure what to suggest in terms of arg parsing choice, NodeJS versions to support (there is a native arg parser since 18.3), etc.

The error is UNKNOWN_OPTION: Unknown option: -K. Can't share any further details because private project.

Security Issues because of deprecated packages

When installation the CLI, this is what I get:

❯ npm install @cables/cables
npm WARN deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated [email protected]: Please update to ini >=1.3.6 to avoid a prototype pollution issue
npm WARN deprecated [email protected]: flatten is deprecated in favor of utility frameworks such as lodash.
npm WARN deprecated [email protected]: this library is no longer supported
npm WARN deprecated [email protected]: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
+ @cables/[email protected]
added 275 packages from 245 contributors and audited 275 packages in 7.815s

24 packages are looking for funding
  run `npm fund` for details

found 1 high severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

Would it be possible to upgrade the dependencies of the CLI?

Thanks

Export Code (-C) uknown error

Got the cables-cli working on my shared server. Wanting to use --code so I can embed multiple patches on a page without using iframes.

I can --export successfully

but when I try -C / --code [PATCH ID],[PATCH ID],[PATCH ID] with one or more patches it throws an error:

requesting export...
downloading from https://cables.gl/api/projects/WL0Cia/export_code ...
ERROR: unknown error, maybe try again {
  headers: {
    apikey: 'hidden_the_apikey_for_this_post'
  }
}

json filename parameter support

cables export api now supports query param jsonName

e.g. ?jsonName=main produces a zip file containing main.json and not projectname.json

the cli tool should support that

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.