rdkcentral / lightning-cli Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
We're observing the following problems:
(node:1198) UnhandledPromiseRejectionWarning: TypeError: PromiseReject called on non-object
at reject (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1198) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To termi
nate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1198) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
The first problem is that lng
doesn't seem to use --unhandled-rejections=strict
option which means that bundling creation fails but remains unnoticed from the rest of the build process. We would need to have non-zero
exit code in all that cases.
The second problem is why this actually happens?
What we're trying to do is to compile: refapp + PR13.
The full recipe can be found here: https://code.rdkcentral.com/r/#/c/components/generic/rdk-oe/meta-cmf-video-restricted/+/38330/2/
do_configure log:
DEBUG: Executing python function sysroot_cleansstate
DEBUG: Removing manifest: /data/dwrobel1/rdkv/rpi-refapp2/build-raspberrypirdkhybrefapp/tmp/sysroots/raspberrypirdkhybrefapp/sysroot-providers/refapp2
DEBUG: Removing manifest: /data/dwrobel1/rdkv/rpi-refapp2/build-raspberrypirdkhybrefapp/tmp/sysroots/raspberrypirdkhybrefapp/sysroot-providers/
DEBUG: Python function sysroot_cleansstate finished
DEBUG: Executing shell function do_configure
Using npm version : 6.14.4
npm WARN com.metrological.app.myawesomeapp@ No repository field.
npm WARN com.metrological.app.myawesomeapp@ No license field.
audited 3954 packages in 3.163s
33 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-babel.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-commonjs.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve.
npm WARN com.metrological.app.myawesomeapp@ No repository field.
npm WARN com.metrological.app.myawesomeapp@ No license field.
+ [email protected]
updated 1 package and audited 3954 packages in 9.014s
27 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
DEBUG: Shell function do_configure finished
DEBUG: Executing python function do_qa_configure
DEBUG: Python function do_qa_configure finished
do_compile log:
DEBUG: Executing shell function do_compile
Using node version : v12.16.3
- Removing "dist" folder
✔ Removing "dist" folder
- Ensuring "dist" folder exists
✔ Ensuring "dist" folder exists
- Copying support files to "dist"
✔ Copying support files to "dist"
- Copying static assets to "dist"
✔ Copying static assets to "dist"
- Copying settings.json "dist"
✔ Copying settings.json "dist"
- Copying metadata.json "dist"
✔ Copying metadata.json "dist"
- Building ES6 appBundle and saving to "dist"
✖ Error while creating ES6 bundle (see log)
(node:1198) UnhandledPromiseRejectionWarning: TypeError: PromiseReject called on non-object
at reject (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:1198) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:1198) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
+ mkdir dist/img
+ mkdir dist/cache
+ mkdir dist/fonts
+ cp -avr ./src/img/. dist/img/.
‘./src/img/./default-poster.jpg’ -> ‘dist/img/././default-poster.jpg’
‘./src/img/./movies’ -> ‘dist/img/././movies’
‘./src/img/./movies/movie_01.png’ -> ‘dist/img/././movies/movie_01.png’
‘./src/img/./movies/movie_02.png’ -> ‘dist/img/././movies/movie_02.png’
‘./src/img/./movies/movie_03.png’ -> ‘dist/img/././movies/movie_03.png’
‘./src/img/./movies/movie_04.png’ -> ‘dist/img/././movies/movie_04.png’
‘./src/img/./movies/movie_05.png’ -> ‘dist/img/././movies/movie_05.png’
‘./src/img/./movies/movie_06.png’ -> ‘dist/img/././movies/movie_06.png’
‘./src/img/./movies/movie_07.png’ -> ‘dist/img/././movies/movie_07.png’
‘./src/img/./node’ -> ‘dist/img/././node’
‘./src/img/./node/border.png’ -> ‘dist/img/././node/border.png’
‘./src/img/./posters’ -> ‘dist/img/././posters’
‘./src/img/./posters/poster_01.png’ -> ‘dist/img/././posters/poster_01.png’
‘./src/img/./posters/poster_02.png’ -> ‘dist/img/././posters/poster_02.png’
‘./src/img/./posters/poster_03.png’ -> ‘dist/img/././posters/poster_03.png’
‘./src/img/./posters/poster_04.png’ -> ‘dist/img/././posters/poster_04.png’
‘./src/img/./posters/poster_05.png’ -> ‘dist/img/././posters/poster_05.png’
‘./src/img/./posters/poster_06.png’ -> ‘dist/img/././posters/poster_06.png’
‘./src/img/./posters/poster_07.png’ -> ‘dist/img/././posters/poster_07.png’
‘./src/img/./rdk-logo.png’ -> ‘dist/img/././rdk-logo.png’
‘./src/img/./tvchannels’ -> ‘dist/img/././tvchannels’
‘./src/img/./tvchannels/1.png’ -> ‘dist/img/././tvchannels/1.png’
‘./src/img/./tvchannels/10.png’ -> ‘dist/img/././tvchannels/10.png’
‘./src/img/./tvchannels/11.png’ -> ‘dist/img/././tvchannels/11.png’
‘./src/img/./tvchannels/12.png’ -> ‘dist/img/././tvchannels/12.png’
‘./src/img/./tvchannels/13.png’ -> ‘dist/img/././tvchannels/13.png’
‘./src/img/./tvchannels/14.png’ -> ‘dist/img/././tvchannels/14.png’
‘./src/img/./tvchannels/15.png’ -> ‘dist/img/././tvchannels/15.png’
‘./src/img/./tvchannels/16.png’ -> ‘dist/img/././tvchannels/16.png’
‘./src/img/./tvchannels/17.png’ -> ‘dist/img/././tvchannels/17.png’
‘./src/img/./tvchannels/18.png’ -> ‘dist/img/././tvchannels/18.png’
‘./src/img/./tvchannels/19.png’ -> ‘dist/img/././tvchannels/19.png’
‘./src/img/./tvchannels/2.png’ -> ‘dist/img/././tvchannels/2.png’
‘./src/img/./tvchannels/20.png’ -> ‘dist/img/././tvchannels/20.png’
‘./src/img/./tvchannels/3.png’ -> ‘dist/img/././tvchannels/3.png’
‘./src/img/./tvchannels/4.png’ -> ‘dist/img/././tvchannels/4.png’
‘./src/img/./tvchannels/5.png’ -> ‘dist/img/././tvchannels/5.png’
‘./src/img/./tvchannels/6.png’ -> ‘dist/img/././tvchannels/6.png’
‘./src/img/./tvchannels/7.png’ -> ‘dist/img/././tvchannels/7.png’
‘./src/img/./tvchannels/8.png’ -> ‘dist/img/././tvchannels/8.png’
‘./src/img/./tvchannels/9.png’ -> ‘dist/img/././tvchannels/9.png’
+ cp -avr ./src/cache/. dist/cache/.
‘./src/cache/./apps.json’ -> ‘dist/cache/././apps.json’
‘./src/cache/./appsLogos’ -> ‘dist/cache/././appsLogos’
‘./src/cache/./appsLogos/default_app_collection.png’ -> ‘dist/cache/././appsLogos/default_app_collection.png’
‘./src/cache/./appsLogos/metrological.png’ -> ‘dist/cache/././appsLogos/metrological.png’
‘./src/cache/./appsLogos/spark.png’ -> ‘dist/cache/././appsLogos/spark.png’
‘./src/cache/./config.json’ -> ‘dist/cache/././config.json’
‘./src/cache/./demo-ssm’ -> ‘dist/cache/././demo-ssm’
‘./src/cache/./demo-ssm/channelsV2.json’ -> ‘dist/cache/././demo-ssm/channelsV2.json’
‘./src/cache/./demo-ssm/movies.json’ -> ‘dist/cache/././demo-ssm/movies.json’
‘./src/cache/./demo’ -> ‘dist/cache/././demo’
‘./src/cache/./demo/channelsV2.json’ -> ‘dist/cache/././demo/channelsV2.json’
‘./src/cache/./demo/movies.json’ -> ‘dist/cache/././demo/movies.json’
‘./src/cache/./eventsV2.json’ -> ‘dist/cache/././eventsV2.json’
‘./src/cache/./menu.json’ -> ‘dist/cache/././menu.json’
+ cp -avr ./src/fonts/. dist/fonts/.
‘./src/fonts/./DejaVuSerif.ttf’ -> ‘dist/fonts/././DejaVuSerif.ttf’
DEBUG: Shell function do_compile finished
It seems adding a library like Commitizen or commitLint breaks ES5 applications. ES6 applications seem to be unaffected. This is the error I'm seeing when trying to launch the application;
Steps to reproduce
lng create
(eslint=yes, install npm dependencies=yes, init empty git=yes)platformSettings/esEnv
to "es5" inside settings.jsonnpm i commitizen -g
commitizen init cz-conventional-changelog --save-dev --save-exact
lng dev
and open the console in DevToolsIt will be nice to have a feature to auto-update version inside metadata.json
Running npm install -g wpe-lightning-cli
.
npm ERR! code E404
npm ERR! 404 Not Found - GET https://registry.npmjs.org/wpe-lightning-cli - Not found
npm ERR! 404
npm ERR! 404 'wpe-lightning-cli@latest' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\matti\AppData\Roaming\npm-cache\_logs\2020-01-23T11_58_16_967Z-debug.log
Actually, running lng dev
:
√ Removing "dist" folder
√ Ensuring "dist" folder exists
√ Copying support files to "dist"
√ Copying static assets to "dist"
√ Copying settings.json "dist"
√ Copying metadata.json "dist"
√ Building ES6 appBundle and saving to "dist"
√ Building ES5 appBundle and saving to "dist"
Starting up http-server, serving ./dist
Available on:
http://192.168.0.103:8080
http://127.0.0.1:8080
Hit CTRL-C to stop the server
open: http://127.0.0.1:8080
√ Ensuring "dist" folder exists
Reload your webbrowser to see the changes
but the changes is not correctly showed after refreshing browser.
You have to run lng build; lng serve;
to correctly rebuild and re render the app.
combine lng build; lng serve;
in a single npm script command out of the box.
lng dev
is mentioned in 2 section in the readme, should be the Doc section reference to anorther command or is it right?
Hi,
I'm trying to use https://xstate.js.org/docs/ and I'm experiencing an issue:
environment.js:3 Uncaught ReferenceError: process is not defined
at environment.js:3
at createCommonjsModule (index.js:9)
at constants.js:6
at index.js:6
(anonymous) @ environment.js:3
createCommonjsModule @ index.js:9
(anonymous) @ constants.js:6
(anonymous) @ index.js:6
Seems this is connected with Rollup.
Here some similar issues:
Can You fix this in the CLI or Can I extends the configuration of Rollup?
Hi @MattiaPontonioKineton,
Based on the output i can see that you are still using both an old version of the SDK as of the CLI.
To update the SDK delete the Package-lock.json, and the node_modules and run npm i again.
To update the CLI run its installer again:
npm install -g WebPlatformForEmbedded/Lightning-CLI
Originally posted by @Thomvl in #34 (comment)
Is possible to run lng create
without creating a folder like com.company.app.name
?
This is for when the repository is already initialized.
Hello,
I've created externals .mjs
modules for my App (for defining custom classes).
They are not in the src
folder.
Can I ensure/watch these files that the apps realods in lng dev
mode?
Maybe If I try to make them node_modules
it will works?
Hello,
regarding this block of code I've 2 issues:
https://github.com/WebPlatformForEmbedded/Lightning-CLI/blob/16cdea600acc8019e7b942f7ad56c412904897cb/src/helpers/build.js#L44
The if condition should not be the correct way to check the version of the SDK because it results true if the "finding of the file" fails.
Problems with use as a dependency
Actually I'm receiving this error in the build:
⚠️ You are using an older version of the Lightning SDK. Please consider upgrading to the latest version. ⚠️
cp: no such file or directory: ./node_modules/wpe-lightning/dist/lightning.js
cp: no such file or directory: ./node_modules/wpe-lightning/devtools/lightning-inspect.js
cp: no such file or directory: ./node_modules/wpe-lightning-sdk/support/*
I'm using this kind of architecture:
"scripts": {
"preinstall": "npm explore tic-tac-toe-client npm install",
"start": "npm run build:client & npm explore tic-tac-toe-server npm run start",
"dev": "npm run build:client & npm explore tic-tac-toe-server npm run dev",
"debug": "npm run build:client & npm explore tic-tac-toe-server npm run start:debug",
"build:client": "npm explore tic-tac-toe-client npm run build"
}
After investigation, I found that when You use a project ad a dependency the node_modules are "packed" in one folder on top so exploring the module and running commands try to find node_modules in the root may results in errors.
I'm looking to a workaround but I think that the CLI should consider this case.
I'm also looking to a Native npm way to point to an "agnostic" node_modules folder.
This results in a "bad build" without the index.html.
REF: #8
I think that the correct approaches that Lightning-CLI
strict depends on specific versions (tags) of wpe-lightning
and wpe-lightning-sdk
so You do not have to check the modules and if You need to use some functionality address an issue to expose that from the package at this version.
Hello,
I'm experiencing an issue.
Before this error I've moved some directories and deleted maybe the dist folder, client is the lightning
project.
lightning
projectmatti@LAPTOP-FKK5J5IS MINGW64 ~/OneDrive/Documenti/projects/GitLab/com.company.app.TicTacToe/client (13-terzo-o-quarto-client)
$ lng dev
√ Removing "dist" folder
√ Ensuring "dist" folder exists
- Copying support files to "dist"
⚠️ You are using an older version of the Lightning SDK. Please consider upgrading to the latest version. ⚠️
cp: no such file or directory: ./node_modules/wpe-lightning/dist/lightning.js
cp: no such file or directory: ./node_modules/wpe-lightning/devtools/lightning-inspect.js
cp: no such file or directory: ./node_modules/wpe-lightning-sdk/support/*
√ Copying support files to "dist"
√ Copying static assets to "dist"
√ Copying settings.json "dist"
√ Copying metadata.json "dist"
√ Building ES5 appBundle and saving to "dist"
Starting up http-server, serving ./dist
Available on:
http://127.0.0.1:8081
Hit CTRL-C to stop the server
open: http://127.0.0.1:8081
[2020-03-25T09:02:19.807Z] "GET /" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
[2020-03-25T09:02:20.243Z] "GET /favicon.ico" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
[2020-03-25T09:02:20.246Z] "GET /favicon.ico" Error (404): "Not found"
[2020-03-25T09:02:48.106Z] "GET /metadata.json" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
[2020-03-25T09:03:26.739Z] "GET /" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.149 Safari/537.36"
Here I'm expecting the app running but there is no index....
| (drw-rw-rw-) | | static/
-- | -- | -- | --
| (-rw-rw-rw-) | 29.4k | appBundle.es5.js
| (-rw-rw-rw-) | 35.4k | appBundle.es5.js.map
| (-rw-rw-rw-) | 132B | metadata.json
| (-rw-rw-rw-) | 471B | settings.json
I'm studying a way to manage fetch loading and errors inside Lightning
but how about the fetches before the app is instantiated?
For example a spinner not in canvas?
DevTools failed to load SourceMap: Could not load content for chrome-extension://hdokiejnpimakedhajhdlcegeplioahd/sourcemaps/onloadwff.js.map: HTTP error: status code 404, net::ERR_UNKNOWN_URL_SCHEME
startApp.js:199 loadJS ./polyfills/babel-polyfill.js
startApp.js:199 loadJS ./polyfills/url.js
startApp.js:199 loadJS ./lib/lightning.es5.js
startApp.js:199 loadJS ./appBundle.es5.js
helpers.js:52 [Violation] Only request geolocation information in response to a user gesture.
(anonymous) @ helpers.js:51
getLatLon @ helpers.js:36
(anonymous) @ defaults.js:3
(anonymous) @ index.js:20
lightning.es5.js:16144 Using image worker!
index.js:137 [Intervention] Slow network is detected. See https://www.chromestatus.com/feature/5636954674692096 for more details. Fallback font will be used while loading: http://127.0.0.1:8084/static/fonts/pixel.ttf
lightning.es5.js:19984 FOCUS :[R]#1:[0]App:[0]#3
lightning.es5.js:19984 FOCUS :[R]#1:[0]App:[1]#5:[0]#6:[0]Items:[0]#9
Applications launched from local storage (using file:// locator) does not work.
Chrome, Version 83.0.4103.61 (Official Build) (64-bit) generates the following message/errors:
startApp.js:130 Fetch API cannot load file:///home/sw/public_html/refapp2-2/settings.json. URL scheme must be "http" or "https" for CORS request.
getSettings @ startApp.js:130
(anonymous) @ startApp.js:46
(anonymous) @ startApp.js:221
Promise.then (async)
(anonymous) @ startApp.js:218
sequence @ startApp.js:213
startApp @ startApp.js:41
(anonymous) @ startApp.js:251
startApp.js:137 No settings.json found. Using defaults.
(anonymous) @ startApp.js:137
Promise.catch (async)
getSettings @ startApp.js:134
(anonymous) @ startApp.js:46
(anonymous) @ startApp.js:221
Promise.then (async)
(anonymous) @ startApp.js:218
sequence @ startApp.js:213
startApp @ startApp.js:41
(anonymous) @ startApp.js:251
startApp.js:113 Fetch API cannot load file:///home/sw/public_html/refapp2-2/metadata.json. URL scheme must be "http" or "https" for CORS request.
getAppMetadata @ startApp.js:113
(anonymous) @ startApp.js:56
(anonymous) @ startApp.js:221
Promise.then (async)
(anonymous) @ startApp.js:218
sequence @ startApp.js:213
startApp @ startApp.js:41
(anonymous) @ startApp.js:251
startApp.js:113 Uncaught (in promise) TypeError: Failed to fetch
at getAppMetadata (startApp.js:113)
at startApp.js:56
at startApp.js:221
getAppMetadata @ startApp.js:113
(anonymous) @ startApp.js:56
(anonymous) @ startApp.js:221
Promise.then (async)
(anonymous) @ startApp.js:218
sequence @ startApp.js:213
startApp @ startApp.js:41
(anonymous) @ startApp.js:251
@michielvandergeest thanks. Is possible to evaluate to pass the port as a parameter of lng serve
?
Originally posted by @mattiapontonio in #39 (comment)
Running lng dev
I got this warning:
⚠️ You are using an older version of the Lightning SDk. Please consider upgrading to the latest version. ⚠️
My questions are:
lng create
?npm list
i got [email protected] (git+https://github.com/WebPlatformForEmbedded/Lightning-SDK.git#9a1480d32d1824f78466ddec924cfc112a082f41) that is higher than "1.1.3" from current SDK release. It sound strange, probably a npm issue.Best regards,
Mattia
Hello!
I'm looking for a way to declare different API URLs for local development build and production build.
Is it possible to set the environment variables in package.json or via CLI?
Is possible to make the url of dev to be constant in order to put that in a readme?
Es: http://127.0.0.1:8081/
Hello,
is safe to change the name of the folder?
For example, I need to change com.sky.app.lightning.demo.app
to com.skyita.lightning
.
There are other points where the CLI use this name?
Best regards
Should be good if when You run lng dev
the apps rebuilds and the browser even reloads.
Working in a TV should be frustrating because You have to relaunch the app every change with command line or other methods.
Feature Request: Lightning is really good. I would love if it supported development in Typescript
Is possible to change the background color of the app that is black by default?
Where is the correct point for setting this?
Is it an App setting?
import { Lightning } from 'wpe-lightning-sdk'
export default class App extends Lightning.Component {
static _template() {
return {
w: 1920,
h: 1080,
color: 0xFFFFFFFF,
UsingShorthand:{ x: 250, y: 100, src: 'https://webplatformforembedded.github.io/Lightning/img/LngDocs_LilLightningIdle.png' },
Toolbox:{
x: 50,
y: 50,
RoundRectangle: {
zIndex: 2,
texture: lng.Tools.getRoundRect(200, 40, 4, 3, 0xffff00ff, true, 0xff00ffff),
},
Shadow: {
x: 10,
y: 10,
zIndex: 1,
color: 0xFFFFFFFF,
texture: lng.Tools.getShadowRect(150, 40, 4, 10, 15),
}
}
}
}
}
import { Launch } from 'wpe-lightning-sdk'
import App from './App.js'
export default function() {
return Launch(App, ...arguments)
}
Referencing this:
rdkcentral/Lightning#99
in order to suggest to provide a way to bundling features in a unified way via CLI in custom projects.
Main topic: Compatibility (es. https://babeljs.io/ features).
Proposal for documenting how it works and where to put the static assets like svg files and images in the source code.
I'm working on an app that involves an HTML app running on a mobile or desktop device and a Lightning app running on a TV. I'd like the two apps to share the same common app dependencies via an import
Directory structure
/common
- /SocketClient.js
/tv-app
- /src
- /App.js
/mobile-app
I'm trying to import SocketClient.js from the Lightning app's App.js like so:
import SocketClient from '../../common/SocketClient.js'
However when I run lng build
, rollup seems to hang indefinitely with no error or warning.
Attached is a sample project to reproduce. Simply extract, go to the "tv-app" directory. Run npm install
, and then lng build
lightning-common-rollup-hang.zip
If any of you know another pattern you can recommend to achieve the same "commonality" I'd love to hear about it. Thanks!
Should be good if I can specify optionally the path in the system of the dist folder.
This is because I have an express server and I need to configure the static root.
https://expressjs.com/it/starter/static-files.html
1 Express server
/
--> point to the dist
and serves the SPA app./api/something
--> point to my custom APIsdist
into a browser.favicon.ico
filedist
folder the issue solvesfavicon.ico
went deleted and the issue went reopenedFailed to load resource: the server responded with a status of 403 (denied)
http://data.oscdn.any.sky.it/favicon.ico
More generally this issue addresses to the need of have more control over the features of the HTML document.
lng dev ask for continue without internet connection. Then, It deletes dist folder and then exit the process.
Documenting that the code is under:
npm root -g
=> wpe-lightning-cli
Example:
file:///C:/Users/matti/AppData/Roaming/npm/node_modules/wpe-lightning-cli/
For debugging reason.
Is possible to add Lightning-CLI ad a dev dependency?
What's the correct syntax?
I need to map the lng
commands to npm scripts so I need to be safe that the package is installed.
I am facing issue while running lng build command, How can i fix this issue?
$ lng build
√ Removing "E:\workspace\xxx\xxx\build" folder
√ Ensuring "E:\workspace\xxx\xxx\build" folder exists
√ Copying support files to "E:\workspace\xxx\xxx\build"
√ Copying settings.json to "E:\workspace\xxx\xxx\build"
√ Copying metadata.json to "E:\workspace\xxx\xxx\build"
× Error while creating ES6 bundle (see log)
E:\workspace\xxx\xxx\src\index.js → build\appBundle.js...
[!] (plugin Rollup Core) Error: Could not load /Users/Naseem/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js (imported by E:\workspace\xxx\xxx\node_modules\wpe-lightning-sdk\src\Lightning\index.js): ENOENT: no such file or directory, open 'E:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\alias\wpe-lightning.js'
Error: Could not load /Users/Naseem/AppData/Roaming/npm/node_modules/wpe-lightning-cli/src/alias/wpe-lightning.js (imported by E:\workspace\xxx\xxx\node_modules\wpe-lightning-sdk\src\Lightning\index.js): ENOENT: no such file or directory, open 'E:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\alias\wpe-lightning.js'
(node:7472) UnhandledPromiseRejectionWarning: Error: Error: Command failed with exit code 1: C:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\node_modules.bin\rollup -c C:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\configs\rollup.es6.config.js --input E:\workspace\xxx\xxx\src\index.js
--file E:\workspace\xxx\xxx\build\appBundle.js --name APP_com_epam_lgi
at execa.then.catch.e (C:\Users\Naseem\AppData\Roaming\npm\node_modules\wpe-lightning-cli\src\helpers\build.js:150:13)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:7472) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:7472) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
using npm -v > 6.13.4
using node -v > v10.19.0
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-commonjs.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve.
PS C:\Users\matti\OneDrive\Documenti\projects\GitLab\lightning-demo-app> npm install -g WebPlatformForEmbedded/Lightning-CLI
npm WARN deprecated [email protected]: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-node-resolve.
npm ERR! Unexpected end of JSON input while parsing near '...curity":"^1.4.0","esl'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\matti\AppData\Roaming\npm-cache\_logs\2020-01-23T11_17_43_713Z-debug.log
Can You please documenting the available options to date?
Best regards
lng crete
(typo of create)
Issuing the above command - just quietly ignores the command.
A error message like ...
'lng crete' is not a recognized command. typo ?
... would be useful.
I've run lng dev
in a wrong folder, without node_modules
or other files of Lightning
and the messages seem refer to an installation (es:
matti@LAPTOP-FKK5J5IS MINGW64 ~/OneDrive/Documenti/projects/GitLab/com.company.app.TicTacToe (13-terzo-o-quarto-client)
$ lng dev
√ Removing "dist" folder
√ Ensuring "dist" folder exists
- Copying support files to "dist"
⚠️ You are using an older version of the Lightning SDK. Please consider upgrading to the latest version. ⚠️
cp: no such file or directory: ./node_modules/wpe-lightning/dist/lightning.js
cp: no such file or directory: ./node_modules/wpe-lightning/devtools/lightning-inspect.js
cp: no such file or directory: ./node_modules/wpe-lightning-sdk/support/*
√ Copying support files to "dist"
- Copying static assets to "dist"cp: no such file or directory: ./static
√ Copying static assets to "dist"
× Copying static assets to "dist"
A command similar or equal to lng dev
but thought to be mapped to https://docs.npmjs.com/cli/start.
When creating a new Lightning app using PNPM as our node cli and the strictPeerDependencies option enabled, I get the following error trying to install the lightning cli:
wpe-lightning-cli: [email protected] requires a peer of rollup@^2.0.0 but version 1.32.1 was installed
Any chance we could update the rollup version used in the CLI (and Lightning) packages to use rollup 2.0.0 and avoid this invalid versioning?
While working with large codebase that includes third-party libraries(state management, video players, analytics systems), code splitting allows to reduce time required to load an app. Utilization of the SDK's routing mechanism may be a very good option to split code on which each route depends + generic vendor bundles. A Next.js per-page code splitting is a very good example.
The index.js fails this ESLint rule.
Can You fix this?
import { Launch } from 'wpe-lightning-sdk';
import App from './App';
export default function () {
return Launch(App, ...arguments);
}
Installation fails if executed in a npm script.
"scripts": {
"preinstall": "npm install -g WebPlatformForEmbedded/Lightning-CLI"
}
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli 'install',
1 verbose cli '-g',
1 verbose cli 'WebPlatformForEmbedded/Lightning-CLI'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 69ee69ac1c9553ed
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for github:WebPlatformForEmbedded/Lightning-CLI Command failed: git submodule update -q --init --recursive
7 silly fetchPackageMetaData C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 21: .: git-sh-setup: file not found
8 timing stage:rollbackFailedOptional Completed in 0ms
9 timing stage:runTopLevelLifecycles Completed in 1838ms
10 verbose stack Error: Command failed: git submodule update -q --init --recursive
10 verbose stack C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 21: .: git-sh-setup: file not found
10 verbose stack
10 verbose stack at ChildProcess.exithandler (child_process.js:295:12)
10 verbose stack at ChildProcess.emit (events.js:223:5)
10 verbose stack at maybeClose (internal/child_process.js:1021:16)
10 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
11 verbose cwd C:\Users\matti\OneDrive\Documenti\projects\GitLab\com.company.app.tictactoe
12 verbose Windows_NT 10.0.18362
13 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "WebPlatformForEmbedded/Lightning-CLI"
14 verbose node v12.14.1
15 verbose npm v6.13.4
16 error code 1
17 error Command failed: git submodule update -q --init --recursive
17 error C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 21: .: git-sh-setup: file not found
18 verbose exit [ 1, true ]
Ensuring someone can simply clone
my project, install
that and start
.
Related: #20
The same type of error happens even if I use npm explore
in the project that it is expected to run the build.
Example, a preinstall
script where I expect to build before starting
$ npm i
> [email protected] preinstall C:\Users\matti\OneDrive\Documenti\projects\GitLab\com.company.app.tictactoe
> npm explore tic-tac-toe-client npm install
npm ERR! code 1
npm ERR! Command failed: git submodule update -q --init --recursive
npm ERR! C:/Program Files/Git/mingw64/libexec/git-core\git-submodule: line 21: .: git-sh-setup: file not found
npm ERR!
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\matti\AppData\Roaming\npm-cache\_logs\2020-05-07T15_13_16_881Z-debug.log
npm ERR! weird error 1
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] preinstall: `npm explore tic-tac-toe-client npm install`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] preinstall 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! C:\Users\matti\AppData\Roaming\npm-cache\_logs\2020-05-07T15_13_24_676Z-debug.log
Seems that the build needs to be installed (installed means that have to have the node_modules inside the folder, even if the folder is into another node_modules folder 🤪) before being executed.
Whenever i am running lng serve it uses/creates new port every time
Ex:
first time > http://localhost:8080
second time > http://localhost:8081
third time > http://localhost:8082
Same this is happening with lng dev, it uses/creates new port every time after file save file changes
There should be a command available to kill all the running http-server
I'm not a fan of installing CLI tools globally when I can get away with not doing so. So I prefer installing them locally into my project and relying on NPM script commands or NPX to run those cli scripts. Obviously this is just a preference. The problem is, Lightning-CLI does not seem to work when installed locally. See command logs below:
fweind200@HQSML-1720180 tv-app % npx lng dist
✔ Removing "static" folder
✔ Copying static assets to "es6"
✖ Error while creating ES6 bundle (see log)
(node:51964) UnhandledPromiseRejectionWarning: TypeError: PromiseReject called on non-object
at reject (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:51964) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 5)
(node:51964) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
fweind200@HQSML-1720180 tv-app % npx lng dev
✔ Removing "build" folder
✔ Ensuring "build" folder exists
✔ Copying support files to "build"
✔ Copying static assets to "build"
✔ Copying settings.json to "build"
✔ Copying metadata.json to "build"
✖ Error while creating ES6 bundle (see log)
✖ Building ES6 appBundle and saving to "build"
(Not sure where the log is)
These commands work fine with a globally installed Lightning-CLI.
proposed fix in the following pull request #72
Actually, when You run lng build
all added files in the ./dist
folder are cancelled.
Should be good if they are preserved in order to have the possibility to setup html files for distribution.
Hello,
I've registered here: https://dashboard.metrological.com/
If i generate the API key and upload the app, what I'm expecting to see?
There is some staging environment?
How about my express server?
Best regards
Mattia
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.