Coder Social home page Coder Social logo

neutralinojs-cli's Introduction

Neutralinojs logo

GitHub release (latest by date) GitHub last commit Build status FOSSA Status

Neutralinojs is a lightweight and portable desktop application development framework. It lets you develop lightweight cross-platform desktop applications using JavaScript, HTML and CSS. Apps built with Neutralinojs can run on Linux, macOS, Windows, Web, and Chrome. Also, you can extend Neutralinojs with any programming language (via extensions IPC) and use Neutralinojs as a part of any source file (via child processes IPC).

Get started with the neu CLI:

 # Creating a new app
 npm i -g @neutralinojs/neu
 neu create hello-world
 cd hello-world
 neu run
 
 # Building your app (No compilation - takes less than a second)
 neu build

You can use your favorite frontend frameworks:

# Creating a new React-based app
neu create hello-react -t codezri/neutralinojs-react

Start building apps: neutralino.js.org/docs

Why Neutralinojs?

In Electron and NWjs, you have to install NodeJs and hundreds of dependency libraries. Embedded Chromium and Node make simple apps bloaty. Neutralinojs offers a lightweight and portable SDK which is an alternative for Electron and NW.js. Neutralinojs doesn't bundle Chromium and uses the existing web browser library in the operating system (Eg: gtk-webkit2 on Linux). Neutralinojs implements a WebSocket connection for native operations and embeds a static web server to serve the web content. Also, it offers a built-in JavaScript client library for developers.

Ask questions on StackOverflow using tag neutralinojs

Contributing

Please check the contribution guide. We use GitHub Discussions and Discord for quick discussions.

Neutralinojs contributors:

Image created with contributors-img.

Subprojects

Sponsors and Donators

Organizations and individuals support Neutralinojs development. See: https://codezri.org/sponsors

If you like to support our work, you can donate to Neutralinojs via Patreon or GitHub Sponsors.

Become a Patreon

Licenses and Copyrights

  • Neutralinojs core: MIT. Copyright (c) 2021 Neutralinojs and contributors.
  • C++ websocket client/server library: BSD-3-Clause from zaphoyd/websocketpp. Copyright (c) 2014, Peter Thorson. All rights reserved.
  • JSON parser library: MIT from nlohmann/json. Copyright (c) 2013-2022 Niels Lohmann.
  • Cross-platform webview library: MIT from webview/webview. Copyright (c) 2017 Serge Zaitsev.
  • Cross-platform tray library: MIT from zserge/tray. Copyright (c) 2017 Serge Zaitsev.
  • Cross-platform GUI dialogs library: WTFPL from samhocevar/portable-file-dialogs. Copyright (c) 2018—2020 Sam Hocevar
  • Base64 encoder/decoder library: MIT from tobiaslocker/base64. Copyright (c) 2019 Tobias Locker.
  • Cross-platform known platform directories API: MIT from sago007/PlatformFolders. Copyright (c) 2015 Poul Sander.
  • C++ logging library: MIT from amrayn/easyloggingpp. Copyright (c) 2012-2018 Amrayn Web Services. Copyright (c) 2012-2018 @abumusamq
  • Cross-platform process library: MIT from eidheim/tiny-process-library. Copyright (c) 2015-2020 Ole Christian Eidheim.
  • Asio standalone C++ library: Boost License v1.0 from chriskohlhoff/asio. Copyright (c) 2003-2021 Christopher M. Kohlhoff
  • Cross-platform C++ clipboard library: MIT from dacap/clip. Copyright (c) 2015-2021 David Capello
  • Cross-platform C++ system information library: CC0 1.0 Universal from ThePhD/infoware. Written in 2016-2020 by nabijaczleweli and ThePhD
  • Cross-platform C++ filesystem watcher library: MIT from SpartanJ/efsw. Copyright (c) 2020 Martín Lucas Golini
  • Logo design credits: IconsPng. Copyright free as mentioned in their website.

See the complete license file

FOSSA Status

neutralinojs-cli's People

Contributors

abhaysinghs772 avatar alsuren avatar aronhetlam avatar ayman161803 avatar bhuvanade avatar codernex avatar dependabot[bot] avatar eldonad avatar github-actions[bot] avatar gravllift avatar jschyra avatar ktibow avatar kwiateusz avatar malipetek avatar nicorac avatar noahcoolboy avatar pathange-s avatar pegvin avatar sachith-1 avatar sadaf-a avatar salihudickson avatar shalithasuranga avatar simomat avatar slonkazoid avatar thanoshanmv avatar themer-works avatar viralgupta avatar waghcwb avatar williamrijksen avatar yash-271120 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

neutralinojs-cli's Issues

React Typescript Template

I have been trying to figure out how to setup a React-Typescript project today. I thought opening this issue may bring the point up and maybe something like --template ts-react may be added. I'm not sure how problematic that'd be but for someone like me who creates projects very often for various work-related stuff, having this shorthand would be invaluable and time-saving.

Run basic setup on win64 don't start

Expected Behavior
Run basic setup on win64

Actual Behavior
Don't works

Steps to Reproduce the Problem

  1. npm install -g @neutralinojs/neu
  2. neu create myapp
  3. cd myapp
  4. neu run

Specifications

  • NeutralinoJs Version: last
  • NeutralinoJs CLI version: last
  • Platform: win10 64

image

Improve config file handling

  • Show a friendly message when project-related commands are executed globally.
  • Do refactorings to make code better

Error when building js template out-of-the-box

Steps to reproduce:
enter following commands into command-line:
neu create hello_world_app --template js
cd hello_world_app && neu build
run neutralino-win.exe

Am I missing something here? I did install the npm dependencies and built the project again yielding the same result.

However replacing the index.html, app.css and app.js files inside /app with the code shown at https://neutralino.js.org/docs/#/gettingstarted solves the problem

image

neu version

Add a neu version command that only print the currently installed version of Neutralino.

neu run

execute correct binary according to the platform

Weird MacOS binary behavior

Expected Behavior
When running neu build --release and copying the dist folder to a mac machine, I expect to be able to run the app as is

Actual Behavior
The binary opens with Text Editor. To get it to run, you have to run the following command through the terminal chmod +x appnamehere

Along with this, opening the binary also opens a terminal window that stays open, even after the app is closed. I had another mac user confirm this behavior and they've been able to replicate it

Steps to Reproduce the Problem

  1. Create a new neutralinojs app
  2. Run neu build --release
  3. Copy the dist folder to a mac machine
  4. Try to open the mac binary. It should open with text editor
  5. Run command chmod +x binaryname from a terminal inside the dist folder
  6. The app now runs, but opens a terminal window that stays open after closing the app

Specifications

  • NeutralinoJs Version: Built from Master branch, but has been present in 2.x
  • NeutralinoJs CLI version: 4.0.0
  • Platform: MacOS Big Sur 11.4

Debug mode on server side (CLI) ?

I think a debug mode on the command line is needed to debug errors which are not related to the JS scripts (i.e. which are not "client-side"), but to anything else: e.g. : Configuration scripts (json files), for instance to avoid.

For instance : a typo in config.json will make the executable fail silently (at least on Windows 10).

it could be passed as an option to the executable, lilke neutralino-win.exe --debug, for instance.

That's what a regular server does by default (Express, for instance).

ES6 module template

As of now, only a "minimal" template can be generated, which consists of a var library from https://github.com/neutralinojs/neutralino.jshttps://github.com/neutralinojs/neutralino.js generated by webpack hosted on
https://github.com/neutralinojs/neutralinojs-minimal.

A "module" template can be created from the same source by editing the webpack config, and hosted as "neutralinojs-module". This template will allow selective imports from the Neutrino API instead of loading the entire library through a <script> tag.

If these changes are approved, I'll make a PR.

Set appname and title based on user input

These files: app/settings.json, app/settings-browser.json, app/settings-cloud.json are using "my app" as appname and title.

Shouln't better if we use the name we included in neu create command?

Terminate the listen process on window close

It would be great if the cli process detects window close and terminates the cli process.

Expected Behavior
Detect window close and terminate the running cli neu listen process.

Actual Behavior
Need to manually terminate the neu listen process.

Feb-22-2021 15-23-54

Specifications

  • NeutralinoJs Version: v1.5
  • NeutralinoJs CLI version: 2.3.1
  • Platform: macOS Catalina v10.15.7

neu patch

Patch /dist/index.html with Neutralino JavaScript files and binaries.

My plan is to run these concurrently

  • vue-cli-service build --watch
  • neu patch && neu run

Add CLI plugin support

  • neu add <plugin-npm-package>
  • Search for plugins and register
  • Once plugin is linked. developers will be able to add custom commands to neu-cli

use cases

Able to create some tools like https://github.com/jiahaog/nativefier
Eg:- neu nativefy <url> will generate something similar to above solution

ERROR: template AngularJs

Don't import package.json file into my folder application

$path\template-angular>neu build
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path $path\template-angular\package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open '$path\template-angular\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

Building for Linux and Windows for Distribution

Just found this project. Looks very promising being a slimmed down SDK for apps.

I do have a couple of question, I've got it to work fine locally, but for apps that I would like to distribute, when doing the build process. Is there anyway that I could have the target result be an AppImage for Linux and a binary archive or single portable exe file for Windows builds?

The other question, since I work off Linux (and my typical Linux Electron dev is in a VM), is it possible to build for Windows on Linux? If so, do we need WINE or will the CLI be able to handle things without WINE?

Thanks for the help and keep up with the project. I've been a fan of Electron, but having an alternative be less resource intensive would be great.

"EACCES: permission denied" received when building "Getting Started" app

  • I am starting out with neutralino to see if I like it. I have a fresh install of neutralino 2.3.0 (yarn global add @neutralinojs/neu) on macOS 10.15.7

  • neu create firstneuapp worked as described in the "Getting Started". So did cd firstneuapp && neu run

  • I then entered neu build --release and got this error:

Error: EACCES: permission denied, copyfile 'bin/neutralino-mac' -> 'dist/firstneuapp/firstneuapp-mac'

Expected Behavior
I had expected to build the binaries without error

Actual Behavior
The full output from the build step is below. Linux & Win10 binaries seem to be present (although I have not tested them). No macOS binary.

Steps to Reproduce the Problem

  1. See description above
  2. Note the permissions on the neutralino-mac file in the ./bin directory

Specifications

  • NeutralinoJs Version: [Version number of NeutralinoJs framework] 2.3.0
  • NeutralinoJs CLI version: [neu-cli version] 5.0.0
  • Platform: [Platform specifications] macOS 10.15.7

Full error log

?130 firstneuapp % neu build --release
Bundling app...
Generating res.neu...
Copying binaries...
Error: EACCES: permission denied, copyfile 'bin/neutralino-mac' -> 'dist/firstneuapp/firstneuapp-mac'
    at Object.copyFileSync (fs.js:1941:3)
    at copyFile (/Users/richb/.config/yarn/global/node_modules/fs-extra/lib/copy-sync/copy-sync.js:67:6)
    at onFile (/Users/richb/.config/yarn/global/node_modules/fs-extra/lib/copy-sync/copy-sync.js:53:25)
    at getStats (/Users/richb/.config/yarn/global/node_modules/fs-extra/lib/copy-sync/copy-sync.js:48:44)
    at startCopy (/Users/richb/.config/yarn/global/node_modules/fs-extra/lib/copy-sync/copy-sync.js:38:10)
    at handleFilterAndCopy (/Users/richb/.config/yarn/global/node_modules/fs-extra/lib/copy-sync/copy-sync.js:33:10)
    at Object.copySync (/Users/richb/.config/yarn/global/node_modules/fs-extra/lib/copy-sync/copy-sync.js:26:10)
    at Object.module.exports.bundleApp (/Users/richb/.config/yarn/global/node_modules/@neutralinojs/neu/src/modules/bundler.js:34:13)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at async Command.<anonymous> (/Users/richb/.config/yarn/global/node_modules/@neutralinojs/neu/src/commands/build.js:11:13) {
  errno: -13,
  syscall: 'copyfile',
  code: 'EACCES',
  path: 'bin/neutralino-mac',
  dest: 'dist/firstneuapp/firstneuapp-mac'
}
  _   _            _             _ _             _
 | \ | | ___ _   _| |_ _ __ __ _| (_)_ __   ___ (_)___
 |  \| |/ _ \ | | | __| '__/ _` | | | '_ \ / _ \| / __|
 | |\  |  __/ |_| | |_| | | (_| | | | | | | (_) | \__ \
 |_| \_|\___|\__,_|\__|_|  \__,_|_|_|_| |_|\___// |___/
                                              |__/
Please check the ./dist directory!

√ firstneuapp % ll
total 32
drwxr-xr-x   11 richb  staff   352B Jun 19 07:33 .
drwxr-xr-x  307 richb  staff   9.6K Jun 19 07:28 ..
-rw-r--r--    1 richb  staff   137B Jun 19 07:28 .gitignore
-rw-r--r--    1 richb  staff   1.1K Jun 19 07:28 LICENSE
-rw-r--r--    1 richb  staff   379B Jun 19 07:28 README.md
drwxr-xr-x    6 richb  staff   192B Jun 19 07:28 bin
drwxr-xr-x    3 richb  staff    96B Jun 19 07:33 dist
-rw-r--r--    1 richb  staff   785B Jun 19 07:28 neutralino.config.json
-rw-r--r--    1 richb  staff     0B Jun 19 07:29 neutralinojs.log
drwxr-xr-x    6 richb  staff   192B Jun 19 07:28 resources
drwxr-xr-x    4 richb  staff   128B Jun 19 07:33 temp

√ firstneuapp % ll dist
total 0
drwxr-xr-x   3 richb  staff    96B Jun 19 07:33 .
drwxr-xr-x  11 richb  staff   352B Jun 19 07:33 ..
drwxr-xr-x   5 richb  staff   160B Jun 19 07:33 firstneuapp

√ firstneuapp % ll dist/firstneuapp
total 9736
drwxr-xr-x  5 richb  staff   160B Jun 19 07:33 .
drwxr-xr-x  3 richb  staff    96B Jun 19 07:33 ..
-rw-r--r--  1 richb  staff   3.2M Jun 19 07:33 firstneuapp-linux
-rw-r--r--  1 richb  staff   1.5M Jun 19 07:33 firstneuapp-win.exe
-rw-r--r--  1 richb  staff    28K Jun 19 07:33 res.neu

?130 firstneuapp % ll bin
total 12456
drwxr-xr-x   6 richb  staff   192B Jun 19 07:28 .
drwxr-xr-x  11 richb  staff   352B Jun 19 07:33 ..
-rw-r--r--   1 richb  staff   418K Jun 19 07:28 WebView2Loader.dll
-rw-r--r--   1 richb  staff   3.2M Jun 19 07:28 neutralino-linux
--wxrw--wt   1 richb  staff   968K Jun 19 07:28 neutralino-mac
-rw-r--r--   1 richb  staff   1.5M Jun 19 07:28 neutralino-win.exe

?1 firstneuapp % neu version
  _   _            _             _ _             _
 | \ | | ___ _   _| |_ _ __ __ _| (_)_ __   ___ (_)___
 |  \| |/ _ \ | | | __| '__/ _` | | | '_ \ / _ \| / __|
 | |\  |  __/ |_| | |_| | | (_| | | | | | | (_) | \__ \
 |_| \_|\___|\__,_|\__|_|  \__,_|_|_|_| |_|\___// |___/
                                              |__/
--- Global ---
Neutralinojs binaries: v2.3.0
neu CLI: v5.0.0

--- Project: firstneuapp (js.neutralino.sample) ---
Neutralinojs binaries: v2.3.0
√ firstneuapp %

storage folder should be copied from dev path to dist on build process

Discussed in neutralinojs/neutralinojs#544

Originally posted by rince1984 August 5, 2021
Actually after build process (CLI: neu build) the storage folder does not exist in the dist folder.
It would be nice if the storage folder would be created automatically through build process (in the dist folder). Much better would be a copy of the existing storage folder from app path itself. So I could store default values in it before build process. In that case the storage folder would only be copied if it exists in the app path (development path).

How I came to this:
I have an app where I need to store global settings in the storage. On app start I check the storage for a setting. If the storage entry is set to true I will display a modal window on app start. That works great in development. But after run the CLI build process neu build the .storage folder does not exist and I get an error.

EACCES permission denied, syscall: copyfile when "neu build --release"

Greetings neutralinojs team

This problem is most likely entirely my fault, however I'd like another pair of eyes on it.

I have a working desktop application as the screenshot shows:

Screenshot from 2021-07-10 22-17-22

However, the issue occurs upon executing the CLI command:

neu build --release

I receive the below EACCES permission denied error:

Screenshot from 2021-07-10 22-24-41

I cannot seem to copy over the Linux binaries..

A temp folder is created that is an exact copy of the /frontend/ folder.

You can also see in the folder directory that I am not using the /resources/ folder, and have instead created my own /frontend/ folder.

I will also include an image of my config file:

Screenshot from 2021-07-10 22-27-09

I cannot seem to fix this issue, another opinion on the subject would be of great help to me.

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.