Git Product home page Git Product logo

osjs-cli's Introduction

OS.js Logo

OS.js is an open-source web desktop platform with a window manager, application APIs, GUI toolkit, filesystem abstractions and much more.

Test Coverage Maintainability

Support Support Donate Donate

OS.js CLI Module

This is the CLI module for OS.js. Runs common tasks for managing an installation.

Contribution

Documentation

See the Official Manuals for articles, tutorials and guides.

Links

osjs-cli's People

Contributors

ajmeese7 avatar andersevenrud avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

osjs-cli's Issues

Package:discover not working after update

After updating to the latest version, package:discover is no longer working (on Windows 10).

The issue is traced to line 38 of utils.js which returns an empty array on my machine.

const globs = await globby(root + '/**/package.json', {deep: 3});

Create a clean remove package from CLI

Need a clean way to remove packages that were installed whether using npm or manually. A CLI command that can handle both cases would be nice. 👍

Per Anders:

Anders Evenrud @andersevenrud 13:14
npm remove mypackage npm run package:discover
mkdir src/packages.disabled mv src/packages/MyPakage src/packages.disabled/ npm run package:discover
I can probably add a shortcut script or something though.

Customize output directory of `package:discover`

For the sounds package I would like the sound files to be output directly into the sounds directory, instead of sounds/Sounds. I have a few other things in this vein that I would like to accomplish. but guidance on how to accomplish this task should suffice.

Do you have any ideas on how I can modify this?

Directories that already exist

I think it'd be easier for people who want to make applications if the make:application action checked if the directory exists or not.

Possible issue with path resolution in discovery

A user reported a strange issue when doing package discovery. I added a patch to not make it crash, and this was the response.


  package:discover Initialized timer...
[package:discover] › …  awaiting  Discovering packages
[package:discover] › …  watching  Using /home/smrsan/src/Clones/Web/OS.js/src/packages
[package:discover] › …  watching  Using /home/smrsan/src/Clones/Web/OS.js/node_modules
[package:discover] › …  awaiting  Flushing out old discoveries
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/fonts']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/fonts' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/sounds']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/sounds' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/icons']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/icons' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/styles']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/styles' }
{ [Error: EISDIR: illegal operation on a directory, unlink '/home/smrsan/src/Clones/Web/OS.js/dist/themes/wallpapers']
  errno: -21,
  code: 'EISDIR',
  syscall: 'unlink',
  path: '/home/smrsan/src/Clones/Web/OS.js/dist/themes/wallpapers' }
[package:discover] › …  awaiting  Discovering packages
[package:discover] › ✔  success   12 package(s) discovered.
[package:discover] › ℹ  info      Discovered @osjs/calculator-application as Calculator
[package:discover] › ℹ  info      Discovered @osjs/draw-application as Draw
[package:discover] › ℹ  info      Discovered @osjs/filemanager-application as FileManager
[package:discover] › ℹ  info      Discovered @osjs/freedesktop-sounds as FreedesktopSounds
[package:discover] › ℹ  info      Discovered @osjs/gnome-icons as Gnome
[package:discover] › ℹ  info      Discovered @osjs/htmlviewer-application as HTMLViewer
[package:discover] › ℹ  info      Discovered @osjs/musicplayer-application as MusicPlayer
[package:discover] › ℹ  info      Discovered @osjs/preview-application as Preview
[package:discover] › ℹ  info      Discovered @osjs/settings-application as Settings
[package:discover] › ℹ  info      Discovered @osjs/standard-theme as Standard
[package:discover] › ℹ  info      Discovered @osjs/textpad-application as Textpad
[package:discover] › ℹ  info      Discovered @osjs/xterm-application as Xterm
◼  package:discover Timer run for: 424ms

I've just done this instruction to install os.js and it's third-party package:

  1. git clone [email protected]:os-js/OS.js.git
  2. git checkout v3
  3. npm i
  4. npm i -S @osjs/xterm-application
  5. npm run package:discover
  6. npm run build
  7. npm run serve

Ref: os-js/osjs-xterm-application#4

get package from gitlab not just github

@aherreraGH wrote:

currently, I have to manually git clone the git repo and run the npm i command.

Would be nice if the same npm run install:package -- https://github.com/os-js/osjs-example-application.git would work on a gitlab repo as well.

Cannot find pre installed applications

▶  package:discover Initialized timer...
[package:discover] › …  awaiting  Discovering packages
[package:discover] › ℹ  info      Using /opt/os.js/packages.json
[package:discover] › ℹ  info      Using /opt/os.js/dist
[package:discover] › …  watching  Using /opt/os.js/src/packages
[package:discover] › …  watching  Using /opt/os.js/node_modules
[package:discover] › …  awaiting  Flushing out old discoveries
[package:discover] › …  awaiting  Discovering packages
[package:discover] › ✔  success   1 package(s) discovered.
[package:discover] › ℹ  info      Discovered osjs-sysinfo-application as SystemInfo [symlink]
◼  package:discover Timer run for: 400ms

package.json:

  "dependencies": {
    "@osjs/calculator-application": "^1.2.1",
    "@osjs/cli": "^3.0.5",
    "@osjs/client": "^3.0.24",
    "@osjs/dbus-provider": "git+https://github.com/andersevenrud/osjs-dbus-provider.git",
    "@osjs/dialogs": "^3.0.4",
    "@osjs/draw-application": "^1.2.0",
    "@osjs/filemanager-application": "^1.2.4",
    "@osjs/freedesktop-sounds": "^3.0.0",
    "@osjs/gnome-icons": "^4.0.1",
    "@osjs/gui": "^4.0.11",
    "@osjs/htmlviewer-application": "^1.2.0",
    "@osjs/musicplayer-application": "^1.2.2",
    "@osjs/pam-auth": "^1.0.4",
    "@osjs/panels": "^3.0.6",
    "@osjs/preview-application": "^1.1.9",
    "@osjs/server": "^3.0.11",
    "@osjs/settings-application": "^1.0.8",
    "@osjs/standard-theme": "^4.0.2",
    "@osjs/textpad-application": "^1.2.1",
    "@osjs/xterm-application": "^1.1.7",
    "osjs-browser-application": "^1.0.0",
    "osjs-devices-adapter": "^1.0.1",
    "osjs-hardware-provider": "^1.0.1",
    "osjs-sysinfo-application": "^1.0.2"
  },

It installed the apps but it cannot find the ones that start with @osjs/.

sh: 1: osjs-cli: not found

$ npm run package:discover

> @osjs/[email protected] package:discover /opt/os.js
> osjs-cli package:discover

sh: 1: osjs-cli: not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! @osjs/[email protected] package:discover: `osjs-cli package:discover`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the @osjs/[email protected] package:discover script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/osjs/.npm/_logs/2018-12-07T18_16_23_396Z-debug.log

Broken links in the custom authentication adapter

Hello all,

I generated a new authentication adapter using npm run make:auth and realized that the links provided in the generated file are not accessible:

Can that be resolved please? The links are to provide more information about authentication adapters and therefore very crucial, especially for those like me who are just getting started with OS.js.

Regards.

Add support for configuration via CLI

In v2, configuration was all stored as JSON files, which made it very easy to manipulate.

Now, in v3 all configurations comes by default as .js files.

They use regular exports, so it should be easy to make a script that makes changes to these files as well -- though this might require some heavy dependencies.

I see that maybe adding JSON file support as an alternative and have the CLI files write to these. Example src/conf/client.json which is prioritized lower than the .js file(s).

A big reason why this is useful is because of deployment and automated installers.

Thanks to @aherreraGH for bringing this up.

have a way to deploy/install all or one src/package

Just a feature request... to have some REST API to submit a JSON object to, and have the information inside that to download from a repo with ssh keys or token - if needed. Or be able to upload a *.gz file containing the entire repo and OS.js uploads/downloads it to its staging directory, extracts the contents and goes through the motions of npm install or npm package:install

package:discover fails

When trying to run osjs-cli package:discover, this error appeared:

> @bluelightos/[email protected] package:discover /home/spaceboyross/Projects/pacman-repo/bluelight-base/pkg/bluelight-base/opt/os.js
> osjs-cli package:discover

/home/spaceboyross/Projects/pacman-repo/bluelight-base/pkg/bluelight-base/opt/os.js/node_modules/ajv/lib/keyword.js:65
      throw new Error('custom keyword definition is invalid: '  + this.errorsText(validateDefinition.errors));
      ^

Error: custom keyword definition is invalid: data/errors should be boolean
    at Ajv.addKeyword (/home/spaceboyross/Projects/pacman-repo/bluelight-base/pkg/bluelight-base/opt/os.js/node_modules/ajv/lib/keyword.js:65:13)
    at module.exports (/home/spaceboyross/Projects/pacman-repo/bluelight-base/pkg/bluelight-base/opt/os.js/node_modules/ajv-errors/index.js:10:7)
    at Object.<anonymous> (/home/spaceboyross/Projects/pacman-repo/bluelight-base/pkg/bluelight-base/opt/os.js/node_modules/schema-utils/src/validateOptions.js:22:1)
    at Module._compile (internal/modules/cjs/loader.js:734:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
    at Module.load (internal/modules/cjs/loader.js:626:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
    at Function.Module._load (internal/modules/cjs/loader.js:558:3)
    at Module.require (internal/modules/cjs/loader.js:663:17)
    at require (internal/modules/cjs/helpers.js:20:18)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @bluelightos/[email protected] package:discover: `osjs-cli package:discover`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @bluelightos/[email protected] package:discover script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/spaceboyross/.npm/_logs/2019-02-10T01_05_53_646Z-debug.log

Windows symlink resolution issues using npm link

On Windows, using npm link will cause some resolution problems in Webpack/Babel that causes some bad compilation errors.

Temporary solution is to add this to webpack.js:

resolve: {
  symlinks: false
}

Watching seems to be still working fine.

Even the manual for webpack says: https://webpack.js.org/configuration/resolve/#resolve-symlinks

When enabled, symlinked resources are resolved to their real path, not their symlinked location. Note that this may cause module resolution to fail when using tools that symlink packages (like npm link).

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.