qooxdoo / qooxdoo-compiler

Compiler for Qooxdoo, 100% javascript
MIT License
36 stars 23 forks source link

Add (npm) scripts to a qooxdoo app #74

Open cboulanger opened 6 years ago

cboulanger commented 6 years ago

@derrell and I have talked about how to most efficiently add external non-qooxdoo libraries to qooxdoo applications. Here is what we came up with. We add two commands:

1) qx add script path/to/script.js [--path=<resource path, defaults to source/resource/js>]: adds a script to the application setup (copying it into resources, adapting the externalResources in Manifest.json) 2) qx add npm-package <npm package name> [—entry=<entry script, defaults to browser.js>], which does the following:

for example, if you need a JsonRpc client (that was the initial question), you could do qx add npm-package raptor-client to install https://github.com/LinusU/raptor-client and then, in your qooxdoo code, you can do let raptor = window.raptor_client; let client = new raptor(url)...

derrell commented 6 years ago

The idea here is that any browserify-able or webpack-able NPM package can be trivially added to a desktop qx app, and used. That would greatly expand the available capabilities for a qx app.

hkollmann commented 6 years ago

Great idea. Would make adding npm packages much more easy Needs an option to update the Version in some kind