From 151b83ad2bee73c13371df8c56211db49acb3db3 Mon Sep 17 00:00:00 2001 From: Maikel Brons Date: Mon, 3 Apr 2023 12:55:05 +0200 Subject: [PATCH 01/11] Fix for issue #222 --- src/helpers/build.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/helpers/build.js b/src/helpers/build.js index a9ca3170..35db2be0 100644 --- a/src/helpers/build.js +++ b/src/helpers/build.js @@ -40,6 +40,18 @@ const findFile = (parent, filePath, depthCount = 0) => { return findFile(path.join(parent, '..'), filePath, ++depthCount) } +const findBinary = binary => { + const binaryPath = path.join(__dirname, '../..', `node_modules/.bin/${binary}`) + const npxPath = path.join(__dirname, '../../../..', `.bin/${binary}`) + return fs.existsSync(binaryPath) + ? binaryPath + : fs.existsSync(npxPath) + ? npxPath + : (() => { + throw new Error(`Required binary (${binary}) not found`) + })() +} + const removeFolder = folder => { spinner.start('Removing "' + folder.split('/').pop() + '" folder') shell.rm('-rf', folder) @@ -212,7 +224,7 @@ const bundleAppRollup = (folder, metadata, type, options) => { const levelsDown = isLocallyInstalled() ? findFile(process.cwd(), 'node_modules/.bin/rollup') - : path.join(__dirname, '../..', 'node_modules/.bin/rollup') + : findBinary('rollup') process.env.LNG_BUILD_FAIL_ON_WARNINGS === 'true' ? args.push('--failAfterWarnings') : '' return execa(levelsDown, args) .then(() => { From 89a7f338fc5c8567ee40321e3367f98a73823c68 Mon Sep 17 00:00:00 2001 From: Chris Lorenzo Date: Wed, 12 Apr 2023 11:24:48 -0400 Subject: [PATCH 02/11] fix #226: remove license from app files --- fixtures/js/lightning-app/src/App.js | 19 ------------------- fixtures/ts/lightning-app/src/App.ts | 18 ------------------ 2 files changed, 37 deletions(-) diff --git a/fixtures/js/lightning-app/src/App.js b/fixtures/js/lightning-app/src/App.js index da0ef4a9..983185cf 100644 --- a/fixtures/js/lightning-app/src/App.js +++ b/fixtures/js/lightning-app/src/App.js @@ -1,22 +1,3 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Metrological - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - import { Lightning, Utils } from '@lightningjs/sdk' export default class App extends Lightning.Component { diff --git a/fixtures/ts/lightning-app/src/App.ts b/fixtures/ts/lightning-app/src/App.ts index 691fecd3..3d769e3c 100644 --- a/fixtures/ts/lightning-app/src/App.ts +++ b/fixtures/ts/lightning-app/src/App.ts @@ -1,21 +1,3 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2022 Metrological - * - * Licensed under the Apache License, Version 2.0 (the License); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ import { Lightning, Utils } from '@lightningjs/sdk' interface AppTemplateSpec extends Lightning.Component.TemplateSpec { From 97f6d1e7ee3fa91cbb8d6af5c0ad04123cf01ac8 Mon Sep 17 00:00:00 2001 From: Cidevant Von Goethe Date: Fri, 7 Apr 2023 01:37:25 +0200 Subject: [PATCH 03/11] feat(serve): adds 'LNG_SERVE_CORS' to enable CORS --- docs/environmentvariables.md | 1 + src/actions/serve.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/environmentvariables.md b/docs/environmentvariables.md index c0584af9..40e97c99 100644 --- a/docs/environmentvariables.md +++ b/docs/environmentvariables.md @@ -42,6 +42,7 @@ You can use the following environment variables to customize the behavior of the | `LNG_SERVE_OPEN` | true | Indicates whether or not the Lightning CLI opens a browser window when running `lng serve` or `lng dev`. Possible values: `true`, `false`. | | `LNG_SERVE_PORT` | auto-incrementing, start at '8080' | Specifies on which port the Lightning CLI must serve when running `lng serve` or `lng dev`. Auto-incrementing and starting port (see Default) depend on available ports. | | `LNG_SERVE_PROXY` | (N.A.) | Proxies all requests that cannot be resolved locally to the given URL. | +| `LNG_SERVE_CORS` | false | Enables CORS via the `Access-Control-Allow-Origin` header. Bypasses value to [http-server](https://github.com/http-party/http-server). Possible values: Boolean (`true` is equivalent of `*`) or any string. | | `LNG_BUILD_SOURCEMAP` | true | Instructs the Lightning CLI whether or not and if so, *how* to generate sourcemaps. Possible values: `true`, `false`, `inline`. The value `true` generates the sourcemaps in a separate file (**appBundle.js.map**). The value `inline` appends the sourcemaps to the **appBundle.js** itself as a data URI. | | `LNG_BUILD_FOLDER` | build | Specifies the folder in which the built App (using `lng build`) will be generated. | | `LNG_DIST_FOLDER` | dist | Specifies the folder in which the standalone, distributable App (using `lng dist`) will be generated. | diff --git a/src/actions/serve.js b/src/actions/serve.js index 0d6a110c..4d64eefa 100644 --- a/src/actions/serve.js +++ b/src/actions/serve.js @@ -30,12 +30,17 @@ module.exports = () => { return sequence([ () => buildHelpers.ensureLightningApp(), () => { + const cors = (process.env.LNG_SERVE_CORS == null || process.env.LNG_SERVE_CORS === 'false') + ? false + : (process.env.LNG_SERVE_CORS === 'true' ? '*' : `'${process.env.LNG_SERVE_CORS}'`) + const args = [ process.env.LNG_BUILD_FOLDER ? `./${process.env.LNG_BUILD_FOLDER}` : './build', process.env.LNG_SERVE_OPEN === 'false' ? false : '-o', process.env.LNG_SERVE_CACHE_TIME ? '-c' + process.env.LNG_SERVE_CACHE_TIME : '-c-1', process.env.LNG_SERVE_PORT ? '-p' + process.env.LNG_SERVE_PORT : false, process.env.LNG_SERVE_PROXY ? '-P' + process.env.LNG_SERVE_PROXY : false, + cors, ].filter(val => val) const levelsDown = isLocallyInstalled() From 86f3eaa1d1d37fb6df5b153b64e397285d5b3d47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?U=C4=9Fur=20Aslan?= Date: Mon, 17 Apr 2023 12:53:35 +0200 Subject: [PATCH 04/11] updated package.json & package-lock.json for v2.11.0 release --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index bc22d56a..3bb4d530 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lightningjs/cli", - "version": "2.10.0", + "version": "2.11.0", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "@lightningjs/cli", - "version": "2.10.0", + "version": "2.11.0", "license": "Apache-2", "dependencies": { "@babel/core": "^7.11.6", diff --git a/package.json b/package.json index b7025dc1..fbe2151c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Michiel van der Geest ", "license": "Apache-2", "name": "@lightningjs/cli", - "version": "2.10.0", + "version": "2.11.0", "description": "Lightning-CLI: Command Line Interface tool for a seamless Lightning App Development flow", "bin": { "lightning": "./bin/index.js", From 6a015a07b1784e4bd1bd16ef3a9062029da8b542 Mon Sep 17 00:00:00 2001 From: sandeep-vedam Date: Tue, 18 Apr 2023 14:19:58 +0530 Subject: [PATCH 05/11] Updated configs to make sure sourcemap is build by default --- src/configs/esbuild.es5.config.js | 10 ++++++---- src/configs/esbuild.es6.config.js | 8 +++++--- src/configs/rollup.es5.config.js | 9 ++++++++- 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/configs/esbuild.es5.config.js b/src/configs/esbuild.es5.config.js index c6ac0df1..28b79e27 100644 --- a/src/configs/esbuild.es5.config.js +++ b/src/configs/esbuild.es5.config.js @@ -31,11 +31,13 @@ const babelPluginInlineJsonImport = require('babel-plugin-inline-json-import') module.exports = (folder, globalName) => { const sourcemap = - process.env.LNG_BUILD_SOURCEMAP === 'true' - ? true + process.env.NODE_ENV === 'production' + ? 'external' : process.env.LNG_BUILD_SOURCEMAP === 'inline' ? 'inline' - : false + : process.env.LNG_BUILD_SOURCEMAP === 'false' + ? '' + : 'external' // Load .env config every time build is triggered const appVars = { @@ -101,7 +103,7 @@ module.exports = (folder, globalName) => { target: 'es5', mainFields: buildHelpers.getResolveConfigForBundlers(), outfile: `${folder}/appBundle.es5.js`, - sourcemap, + sourcemap: sourcemap, format: 'iife', define: defined, globalName, diff --git a/src/configs/esbuild.es6.config.js b/src/configs/esbuild.es6.config.js index 7d100743..99b21375 100644 --- a/src/configs/esbuild.es6.config.js +++ b/src/configs/esbuild.es6.config.js @@ -29,11 +29,13 @@ const babelPluginInlineJsonImport = require('babel-plugin-inline-json-import') module.exports = (folder, globalName) => { const sourcemap = - process.env.LNG_BUILD_SOURCEMAP === 'true' - ? true + process.env.NODE_ENV === 'production' + ? 'external' : process.env.LNG_BUILD_SOURCEMAP === 'inline' ? 'inline' - : false + : process.env.LNG_BUILD_SOURCEMAP === 'false' + ? '' + : 'external' //Load .env config every time build is triggered const appVars = { diff --git a/src/configs/rollup.es5.config.js b/src/configs/rollup.es5.config.js index 2eab6ecf..a16ffa84 100644 --- a/src/configs/rollup.es5.config.js +++ b/src/configs/rollup.es5.config.js @@ -116,6 +116,13 @@ module.exports = { output: { format: 'iife', inlineDynamicImports: true, - sourcemap: true, + sourcemap: + process.env.NODE_ENV === 'production' + ? true + : process.env.LNG_BUILD_SOURCEMAP === undefined + ? true + : process.env.LNG_BUILD_SOURCEMAP === 'false' + ? false + : process.env.LNG_BUILD_SOURCEMAP, }, } From 7b567bc34b8be3fb43796402966a7b6191eb1614 Mon Sep 17 00:00:00 2001 From: sandeep-vedam Date: Tue, 18 Apr 2023 14:50:27 +0530 Subject: [PATCH 06/11] Updated with minor change --- src/configs/esbuild.es6.config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/configs/esbuild.es6.config.js b/src/configs/esbuild.es6.config.js index 99b21375..21b100d0 100644 --- a/src/configs/esbuild.es6.config.js +++ b/src/configs/esbuild.es6.config.js @@ -92,7 +92,7 @@ module.exports = (folder, globalName) => { bundle: true, outfile: `${folder}/appBundle.js`, mainFields: buildHelpers.getResolveConfigForBundlers(), - sourcemap, + sourcemap: sourcemap, format: 'iife', define: defined, target: process.env.LNG_BUNDLER_TARGET || '', From 8bc1bfc908b4deef6aafb6d50bf2ab4a5a51df28 Mon Sep 17 00:00:00 2001 From: sandeep-vedam Date: Tue, 18 Apr 2023 20:04:03 +0530 Subject: [PATCH 07/11] Updated as per review comments --- src/configs/esbuild.es5.config.js | 2 +- src/configs/esbuild.es6.config.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/configs/esbuild.es5.config.js b/src/configs/esbuild.es5.config.js index 28b79e27..e51c6e6d 100644 --- a/src/configs/esbuild.es5.config.js +++ b/src/configs/esbuild.es5.config.js @@ -103,7 +103,7 @@ module.exports = (folder, globalName) => { target: 'es5', mainFields: buildHelpers.getResolveConfigForBundlers(), outfile: `${folder}/appBundle.es5.js`, - sourcemap: sourcemap, + sourcemap, format: 'iife', define: defined, globalName, diff --git a/src/configs/esbuild.es6.config.js b/src/configs/esbuild.es6.config.js index 21b100d0..99b21375 100644 --- a/src/configs/esbuild.es6.config.js +++ b/src/configs/esbuild.es6.config.js @@ -92,7 +92,7 @@ module.exports = (folder, globalName) => { bundle: true, outfile: `${folder}/appBundle.js`, mainFields: buildHelpers.getResolveConfigForBundlers(), - sourcemap: sourcemap, + sourcemap, format: 'iife', define: defined, target: process.env.LNG_BUNDLER_TARGET || '', From d189d84867fb1164daa850af7c9196669df1205e Mon Sep 17 00:00:00 2001 From: sandeep-vedam Date: Tue, 18 Apr 2023 20:54:17 +0530 Subject: [PATCH 08/11] Updated PR with comments --- docs/environmentvariables.md | 8 ++++---- src/actions/serve.js | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/docs/environmentvariables.md b/docs/environmentvariables.md index 40e97c99..a40947df 100644 --- a/docs/environmentvariables.md +++ b/docs/environmentvariables.md @@ -42,7 +42,6 @@ You can use the following environment variables to customize the behavior of the | `LNG_SERVE_OPEN` | true | Indicates whether or not the Lightning CLI opens a browser window when running `lng serve` or `lng dev`. Possible values: `true`, `false`. | | `LNG_SERVE_PORT` | auto-incrementing, start at '8080' | Specifies on which port the Lightning CLI must serve when running `lng serve` or `lng dev`. Auto-incrementing and starting port (see Default) depend on available ports. | | `LNG_SERVE_PROXY` | (N.A.) | Proxies all requests that cannot be resolved locally to the given URL. | -| `LNG_SERVE_CORS` | false | Enables CORS via the `Access-Control-Allow-Origin` header. Bypasses value to [http-server](https://github.com/http-party/http-server). Possible values: Boolean (`true` is equivalent of `*`) or any string. | | `LNG_BUILD_SOURCEMAP` | true | Instructs the Lightning CLI whether or not and if so, *how* to generate sourcemaps. Possible values: `true`, `false`, `inline`. The value `true` generates the sourcemaps in a separate file (**appBundle.js.map**). The value `inline` appends the sourcemaps to the **appBundle.js** itself as a data URI. | | `LNG_BUILD_FOLDER` | build | Specifies the folder in which the built App (using `lng build`) will be generated. | | `LNG_DIST_FOLDER` | dist | Specifies the folder in which the standalone, distributable App (using `lng dist`) will be generated. | @@ -51,9 +50,10 @@ You can use the following environment variables to customize the behavior of the | `LNG_BUILD_FAIL_ON_WARNINGS` | false | Specifies whether or not to show the warning to the user when a build warning occurs. Note that the build process is triggered in several commands (`lng build`, `lng dev`, `lng watch` and `lng dist`) | | `LNG_BUNDLER` | rollup | Specify which bundler the CLI should use to bundle the app. Possible values: `rollup`, `esbuild`. | | `LNG_BROWSER_BUILD` | false | Specify whether or not browser build is to be generated. Possible values: `true`, `false`. | -| `LNG_LIVE_RELOAD` | false | Instructs your browser to reload the location when a new app bundle is created (using `lng dev`). When the watcher resolves, `document.location.reload()` is called in the browser (tab) that serves your app. Possible value:  `true`, `false`. | -| `LNG_LIVE_RELOAD_PORT` | 8888 | Specifies the port Websocket is listening on. Live reload communication is driven by WebSockets. Possible values: Any numeric value. | - +| `LNG_LIVE_RELOAD` | false | Instructs your browser to reload the location when a new app bundle is created (using `lng dev`). When the watcher resolves, `document.location.reload()` is called in the browser (tab) that serves your app. Live reload communication is driven by WebSockets. Possible value: `true`, `false`. | +| `LNG_LIVE_RELOAD_HOST` | localhost | Specifies the Websocket host your application will attempt to connect to listen for livereload events. Possible values: ip or host. | +| `LNG_LIVE_RELOAD_PORT` | 8991 | Specifies the port Websocket is listening on. Possible values: Any numeric value. | +| `LNG_SERVE_CORS` | disabled | Enables CORS with the `Access-Control-Allow-Origin` header to `*` and sets the provided value to `Access-Control-Allow-Headers` . Possible values: Any string. For Ex: `--cors='X-Custom-Header'`| #### `LNG_SETTINGS_ENV` Specifies which environment to be used. User need to have `settings.{env}.json` file in the Project home folder with different settings. This will build/dist the application with `settings.{env}.json`. diff --git a/src/actions/serve.js b/src/actions/serve.js index 4d64eefa..4615fd97 100644 --- a/src/actions/serve.js +++ b/src/actions/serve.js @@ -30,17 +30,13 @@ module.exports = () => { return sequence([ () => buildHelpers.ensureLightningApp(), () => { - const cors = (process.env.LNG_SERVE_CORS == null || process.env.LNG_SERVE_CORS === 'false') - ? false - : (process.env.LNG_SERVE_CORS === 'true' ? '*' : `'${process.env.LNG_SERVE_CORS}'`) - const args = [ process.env.LNG_BUILD_FOLDER ? `./${process.env.LNG_BUILD_FOLDER}` : './build', process.env.LNG_SERVE_OPEN === 'false' ? false : '-o', process.env.LNG_SERVE_CACHE_TIME ? '-c' + process.env.LNG_SERVE_CACHE_TIME : '-c-1', process.env.LNG_SERVE_PORT ? '-p' + process.env.LNG_SERVE_PORT : false, process.env.LNG_SERVE_PROXY ? '-P' + process.env.LNG_SERVE_PROXY : false, - cors, + process.env.LNG_SERVE_CORS ? '--cors=' + process.env.LNG_SERVE_CORS : '', ].filter(val => val) const levelsDown = isLocallyInstalled() From 7cc52cae192049c0c5d079a76096a93eb78ede5f Mon Sep 17 00:00:00 2001 From: sandeep-vedam Date: Thu, 20 Apr 2023 15:14:49 +0530 Subject: [PATCH 09/11] Updated as per code review comments --- docs/environmentvariables.md | 2 +- src/actions/serve.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/environmentvariables.md b/docs/environmentvariables.md index a40947df..bf25a7fe 100644 --- a/docs/environmentvariables.md +++ b/docs/environmentvariables.md @@ -53,7 +53,7 @@ You can use the following environment variables to customize the behavior of the | `LNG_LIVE_RELOAD` | false | Instructs your browser to reload the location when a new app bundle is created (using `lng dev`). When the watcher resolves, `document.location.reload()` is called in the browser (tab) that serves your app. Live reload communication is driven by WebSockets. Possible value: `true`, `false`. | | `LNG_LIVE_RELOAD_HOST` | localhost | Specifies the Websocket host your application will attempt to connect to listen for livereload events. Possible values: ip or host. | | `LNG_LIVE_RELOAD_PORT` | 8991 | Specifies the port Websocket is listening on. Possible values: Any numeric value. | -| `LNG_SERVE_CORS` | disabled | Enables CORS with the `Access-Control-Allow-Origin` header to `*` and sets the provided value to `Access-Control-Allow-Headers` . Possible values: Any string. For Ex: `--cors='X-Custom-Header'`| +| `LNG_SERVE_CORS` | disabled | Enables CORS with the `Access-Control-Allow-Origin` header to `*` and sets the provided value to `Access-Control-Allow-Headers` . Possible values: `true`, `false`, `Any String` . The value `true` sets the --cors flag to empty i.e `--cors=''`. The value `false` does not set any value to cors flag. Any string can be set to the --cors flag. For Ex: `--cors='X-Custom-Header'` or `--cors='Authorization,X-Debug'`| #### `LNG_SETTINGS_ENV` Specifies which environment to be used. User need to have `settings.{env}.json` file in the Project home folder with different settings. This will build/dist the application with `settings.{env}.json`. diff --git a/src/actions/serve.js b/src/actions/serve.js index 4615fd97..9c7f8b20 100644 --- a/src/actions/serve.js +++ b/src/actions/serve.js @@ -36,7 +36,8 @@ module.exports = () => { process.env.LNG_SERVE_CACHE_TIME ? '-c' + process.env.LNG_SERVE_CACHE_TIME : '-c-1', process.env.LNG_SERVE_PORT ? '-p' + process.env.LNG_SERVE_PORT : false, process.env.LNG_SERVE_PROXY ? '-P' + process.env.LNG_SERVE_PROXY : false, - process.env.LNG_SERVE_CORS ? '--cors=' + process.env.LNG_SERVE_CORS : '', + process.env.LNG_SERVE_CORS ? process.env.LNG_SERVE_CORS == 'false' ? '' + : '--cors=' + (process.env.LNG_SERVE_CORS == 'true' ? '' : process.env.LNG_SERVE_CORS) : '' ].filter(val => val) const levelsDown = isLocallyInstalled() From 587912041e12cb05ac8fac65260dcdf96cfaf696 Mon Sep 17 00:00:00 2001 From: sandeep-vedam Date: Fri, 21 Apr 2023 13:09:01 +0530 Subject: [PATCH 10/11] Updated documentation and minor changes --- docs/environmentvariables.md | 2 +- src/actions/serve.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/environmentvariables.md b/docs/environmentvariables.md index bf25a7fe..873f3209 100644 --- a/docs/environmentvariables.md +++ b/docs/environmentvariables.md @@ -53,7 +53,7 @@ You can use the following environment variables to customize the behavior of the | `LNG_LIVE_RELOAD` | false | Instructs your browser to reload the location when a new app bundle is created (using `lng dev`). When the watcher resolves, `document.location.reload()` is called in the browser (tab) that serves your app. Live reload communication is driven by WebSockets. Possible value: `true`, `false`. | | `LNG_LIVE_RELOAD_HOST` | localhost | Specifies the Websocket host your application will attempt to connect to listen for livereload events. Possible values: ip or host. | | `LNG_LIVE_RELOAD_PORT` | 8991 | Specifies the port Websocket is listening on. Possible values: Any numeric value. | -| `LNG_SERVE_CORS` | disabled | Enables CORS with the `Access-Control-Allow-Origin` header to `*` and sets the provided value to `Access-Control-Allow-Headers` . Possible values: `true`, `false`, `Any String` . The value `true` sets the --cors flag to empty i.e `--cors=''`. The value `false` does not set any value to cors flag. Any string can be set to the --cors flag. For Ex: `--cors='X-Custom-Header'` or `--cors='Authorization,X-Debug'`| +| `LNG_SERVE_CORS` | false | When set to `true`, CORS is enabled by allowing all origins (Access-Control-Allow-Origin: *) and default headers (Origin, X-Requested-With, Content-Type, Accept, Range). To allow additional headers, provide comma-separated header names as the value (e.g. Authorization, X-Debug). This both enables CORS and appends the provided headers to Access-Control-Allow-Headers #### `LNG_SETTINGS_ENV` Specifies which environment to be used. User need to have `settings.{env}.json` file in the Project home folder with different settings. This will build/dist the application with `settings.{env}.json`. diff --git a/src/actions/serve.js b/src/actions/serve.js index 9c7f8b20..b52343e9 100644 --- a/src/actions/serve.js +++ b/src/actions/serve.js @@ -36,8 +36,8 @@ module.exports = () => { process.env.LNG_SERVE_CACHE_TIME ? '-c' + process.env.LNG_SERVE_CACHE_TIME : '-c-1', process.env.LNG_SERVE_PORT ? '-p' + process.env.LNG_SERVE_PORT : false, process.env.LNG_SERVE_PROXY ? '-P' + process.env.LNG_SERVE_PROXY : false, - process.env.LNG_SERVE_CORS ? process.env.LNG_SERVE_CORS == 'false' ? '' - : '--cors=' + (process.env.LNG_SERVE_CORS == 'true' ? '' : process.env.LNG_SERVE_CORS) : '' + process.env.LNG_SERVE_CORS && process.env.LNG_SERVE_CORS !== 'false' ? process.env.LNG_SERVE_CORS === 'true' + ? '--cors' : '--cors='+ process.env.LNG_SERVE_CORS : '', ].filter(val => val) const levelsDown = isLocallyInstalled() From eefc1cc1e58dba138ce07a4992ad6f41d0bd9e55 Mon Sep 17 00:00:00 2001 From: Michiel van der Geest Date: Fri, 28 Apr 2023 09:33:14 +0200 Subject: [PATCH 11/11] Updated changelog for 2.11.0. --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c440abf6..5d69988d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## v2.11.0 + +*28 apr 2023* + +- Removed license texts from fixtures, so new Apps created with the CLI don't come with unnecessary licenses anymore ([#226](https://github.com/rdkcentral/Lightning-CLI/issues/226)) +- Fixed build issue related to rollup path when using NPX. Solves issue for Metrological CLI. ([#222](https://github.com/rdkcentral/Lightning-CLI/issues/222)) +- Fixed issue where sourcemap files were not generated when using esbuild ([#228](https://github.com/rdkcentral/Lightning-CLI/issues/228)) +- Added support for CORS in `lng serve` via a new environment variable (`LNG_SERVE_CORS`) + ## v2.10.0 *15 feb 2023*