Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release - v2.11.1 #238

Closed
wants to merge 14 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## v2.12.0

*27 jul 2023*

- Fixed issue with rollup typescript project throwing error when accessing process env ([#235](https://github.com/rdkcentral/Lightning-CLI/issues/235))
- Added "include" config in tsconfig.json for lng create command
- Added support for getting "esEnv" from settings.json file for lng dist ([#224](https://github.com/rdkcentral/Lightning-CLI/issues/224))
- Added support for transpiling .mjs files to ES5 with rollup
- Fixed the issue related to Babel ignore is not possible to use in a babel.config.json ([#177](https://github.com/rdkcentral/Lightning-CLI/issues/177))

## v2.11.0

*28 apr 2023*
Expand Down
2 changes: 1 addition & 1 deletion bin/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ program
.action(options => {
const input = options.opts()

const defaultTypes = ['es6']
const defaultTypes = ['defaults']
const isWatchEnabled = input.watch ? input.watch : false
delete input.watch

Expand Down
3 changes: 2 additions & 1 deletion fixtures/ts/lightning-app/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
"strict": true,
"noUncheckedIndexedAccess": true,
"noImplicitOverride": true
}
},
"include": ["src/**/*.ts"]
}
166 changes: 142 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "Michiel van der Geest <m.van.der.geest@metrological.com>",
"license": "Apache-2",
"name": "@lightningjs/cli",
"version": "2.11.0",
"version": "2.12.0",
"description": "Lightning-CLI: Command Line Interface tool for a seamless Lightning App Development flow",
"bin": {
"lightning": "./bin/index.js",
Expand Down Expand Up @@ -37,6 +37,7 @@
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^9.0.0",
"@rollup/plugin-virtual": "^2.0.3",
"@rollup/plugin-typescript": "^11.1.1",
"babel-plugin-inline-json-import": "^0.3.2",
"chalk": "^4.1.0",
"commander": "^6.1.0 ",
Expand Down
15 changes: 15 additions & 0 deletions src/actions/dist.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ module.exports = options => {
const baseDistDir = path.join(process.cwd(), process.env.LNG_DIST_FOLDER || 'dist')

let metadata
let settingsFileName = buildHelpers.getSettingsFileName()
let settings

const buildES = (type, esEnv) => {
return !!(type || esEnv)
}

const dist = (type, config) => {
let distDir
Expand All @@ -36,6 +42,13 @@ module.exports = options => {
() => distHelpers.moveOldDistFolderToBuildFolder(),
() => buildHelpers.ensureCorrectGitIgnore(),
() => buildHelpers.readMetadata().then(result => (metadata = result)),
() => buildHelpers.readSettings(settingsFileName).then(result => (settings = result)),
() =>
(type = !type.includes('defaults')
? type
: settings.platformSettings.esEnv
? settings.platformSettings.esEnv
: 'es6'),
() => {
distDir = path.join(baseDistDir, type)
},
Expand All @@ -53,9 +66,11 @@ module.exports = options => {
() => buildHelpers.copyStaticFolder(distDir),
() =>
type === 'es6' &&
buildES('es6', settings.platformSettings.esEnv) &&
buildHelpers.bundleEs6App(path.join(distDir, 'js'), metadata, { sourcemaps: false }),
() =>
type === 'es5' &&
buildES('es5', settings.platformSettings.esEnv) &&
buildHelpers.bundleEs5App(path.join(distDir, 'js'), metadata, { sourcemaps: false }),
() => type === 'es5' && buildHelpers.bundlePolyfills(path.join(distDir, 'js')),
() => config.isWatchEnabled && distWatch(type),
Expand Down
5 changes: 4 additions & 1 deletion src/configs/rollup.es5.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

const path = require('path')
const process = require('process')
const fs = require('fs')
const babel = require('@rollup/plugin-babel').babel
const resolve = require('@rollup/plugin-node-resolve').nodeResolve
const commonjs = require('@rollup/plugin-commonjs')
Expand All @@ -32,11 +33,12 @@ const json = require('@rollup/plugin-json')
const virtual = require('@rollup/plugin-virtual')
const inject = require('@rollup/plugin-inject')
const image = require('@rollup/plugin-image')
const typescript = require('@rollup/plugin-typescript')
const buildHelpers = require(path.join(__dirname, '../helpers/build'))
const minify = require('rollup-plugin-terser').terser
const license = require('rollup-plugin-license')
const os = require('os')
const extensions = ['.js', '.ts']
const extensions = ['.js', '.ts', '.mjs']

module.exports = {
onwarn(warning, warn) {
Expand All @@ -47,6 +49,7 @@ module.exports = {
plugins: [
json(),
image(),
fs.existsSync(path.join(process.cwd(), 'tsconfig.json')) && typescript(),
inject({
'process.env': 'processEnv',
}),
Expand Down
Loading