Skip to content

Commit dc78cd9

Browse files
Interfacedl1bbcsg
authored andcommitted
Version 2.7.3
GitOrigin-RevId: 68cf83f19134d1dc4d15469fd9423ea9b8825b1e
1 parent eb7ecbb commit dc78cd9

28 files changed

+1240
-1310
lines changed

.eslintrc.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module.exports = {
2828
'',
2929
' * This file is part of the ZombieBox package.',
3030
' *',
31-
{pattern: `\\* Copyright © 2012\\-${(new Date).getFullYear()}, Interfaced`},
31+
{pattern: `\\* Copyright © 2012\\-${(new Date()).getFullYear()}, Interfaced`},
3232
' *',
3333
' * For the full copyright and license information, please view the LICENSE',
3434
' * file that was distributed with this source code.',

.gitlab-ci.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
image: registry.gitlab.com/interfaced/dev-server/base-ci-image:zb
2+
workflow:
3+
rules:
4+
- if: $CI_MERGE_REQUEST_IID
5+
- if: $CI_COMMIT_TAG
6+
- if: $CI_COMMIT_BRANCH == 'develop'
7+
8+
before_script:
9+
- npm ci
10+
11+
lint:
12+
stage: test
13+
script:
14+
- npm run lint
15+
16+
test_tools:
17+
stage: test
18+
script:
19+
- npm run test.tools
20+
21+
test_framework:
22+
stage: test
23+
script:
24+
- npm run test.framework

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Change log
22

3+
## 2.7.3 (release date: 05.08.2020)
4+
5+
### Framework
6+
* Added export if `NativeReadyState` to `StatefulHtml5Video`
7+
8+
### Tools
9+
* Replaced `chalk` with `kleur`
10+
* Improved output of `--help` option for CLI tools
11+
312
## 2.7.2 (release date: 22.04.2020)
413

514
### Framework

bin/cli.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
*/
1111
const path = require('path');
1212
const fs = require('fs');
13-
const chalk = require('chalk');
13+
const kleur = require('kleur');
1414
const yargs = require('yargs');
1515
const {findPackageJson} = require('../lib/utils');
1616
const Application = require('../lib/application');
@@ -159,7 +159,7 @@ class CLI {
159159
logger.error(`Error writing aliases map: ${error.message}`);
160160
process.exit(1);
161161
} else {
162-
logger.output(`Aliases map generated in ${chalk.underline(filename)}`);
162+
logger.output(`Aliases map generated in ${kleur.underline(filename)}`);
163163
}
164164
});
165165
});
@@ -170,6 +170,10 @@ class CLI {
170170
* @protected
171171
*/
172172
_setupYargs() {
173+
// Disable built-in help to prevent early processing and unexpected process end.
174+
// Will be enabled before the last argv call.
175+
yargs.help(false);
176+
173177
/* eslint-disable newline-per-chained-call */
174178
yargs
175179
.array('config').default('config', [])
@@ -245,7 +249,7 @@ class CLI {
245249
default: process.cwd()
246250
});
247251
},
248-
(yargv) => this.init(yargv.name, yargv.root)
252+
(argv) => this.init(argv.name, argv.root)
249253
)
250254
.command(
251255
'addScene <name> [path]',
@@ -338,7 +342,7 @@ class CLI {
338342
(packageJson) => packageJson.dependencies && packageJson.dependencies.hasOwnProperty('zombiebox')
339343
);
340344

341-
logger.debug(`Application package.json path: ${chalk.underline(packageJson)}`);
345+
logger.debug(`Application package.json path: ${kleur.underline(packageJson)}`);
342346

343347
if (!packageJson) {
344348
return null;

docs/video/index.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,10 @@ Aborts playback and frees resources occupied by Media File.
199199
| getVolume ||||||||||||
200200
| isMuted ||||||||||||
201201
| prepare || | | | | | | || | |
202-
| pause | | | || | | | || | |
203-
| play | | | | | | | | || | |
202+
| pause | | | || | | | || | |
203+
| play | | | | | | | | || | |
204204
| setPlaybackRate | |||||||||||
205-
| setPosition | | | || | |||| | |
205+
| setPosition | | | || | |||| | |
206206
| setVolume ||||||||||||
207207
| stop | ||||||||| | |
208208
| toggleMuted ||||||||||||

lib/addons/loader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88
*/
99
const fs = require('fs');
1010
const path = require('path');
11-
const chalk = require('chalk');
11+
const kleur = require('kleur');
1212

1313
const {findPackageJson} = require('../utils');
1414
const AbstractAddon = require('./abstract-addon');
1515
const AbstractPlatform = require('./abstract-platform');
1616
const AbstractExtension = require('./abstract-extension');
1717
const logger = require('../logger').createChild('AddonLoader');
1818

19-
/* eslint-disable global-require */
19+
/* eslint-disable node/global-require */
2020

2121

2222
/**
@@ -87,7 +87,7 @@ class AddonLoader {
8787
* @param {string} addonPath
8888
*/
8989
loadAddon(addonPath) {
90-
logger.debug(`Loading addon from ${chalk.underline(addonPath)}`);
90+
logger.debug(`Loading addon from ${kleur.underline(addonPath)}`);
9191

9292
const Addon = require(addonPath);
9393

@@ -109,7 +109,7 @@ class AddonLoader {
109109
}
110110

111111
if (this._isLoaded(addon)) {
112-
throw new Error(`Addon with name ${chalk.bold(addon.getName())} is already loaded`);
112+
throw new Error(`Addon with name ${kleur.bold(addon.getName())} is already loaded`);
113113
}
114114

115115
this._loadedAddons.push({instance: addon, packageJson});
@@ -119,7 +119,7 @@ class AddonLoader {
119119
addon instanceof AbstractExtension ? 'extension' :
120120
'addon';
121121

122-
logger.info(`Loaded ${type} ${chalk.green(addon.getName())}`);
122+
logger.info(`Loaded ${type} ${kleur.green(addon.getName())}`);
123123
}
124124

125125
/**

lib/application.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
const fs = require('fs');
1010
const fse = require('fs-extra');
1111
const path = require('path');
12-
const chalk = require('chalk');
12+
const kleur = require('kleur');
1313
const _ = require('lodash');
1414
const EventEmitter = require('events').EventEmitter;
1515

@@ -25,7 +25,7 @@ const TemplateHelper = require('./template-helper');
2525
const VersionsChecker = require('./versions-checker');
2626
const logger = require('./logger').createChild('APP');
2727

28-
/* eslint-disable global-require */
28+
/* eslint-disable node/global-require */
2929

3030

3131
/**
@@ -156,7 +156,7 @@ class Application extends EventEmitter {
156156
(filename) => {
157157
const exists = fs.existsSync(filename);
158158
if (!exists) {
159-
logger.warn(`File ${chalk.underline(filename)} does not exist`);
159+
logger.warn(`File ${kleur.underline(filename)} does not exist`);
160160
}
161161
return exists;
162162
}
@@ -200,7 +200,7 @@ class Application extends EventEmitter {
200200
.filter((filename) => {
201201
const exists = fs.existsSync(filename);
202202
if (!exists) {
203-
logger.warn(`File ${chalk.underline(filename)} does not exist`);
203+
logger.warn(`File ${kleur.underline(filename)} does not exist`);
204204
}
205205
return exists;
206206
});
@@ -414,7 +414,7 @@ class Application extends EventEmitter {
414414
// Highlight zombiebox package name
415415
const filename = message.source && message.source.replace(
416416
/(?<=\/)zombiebox.+?(?=\/)/g,
417-
(name) => chalk.bold(name)
417+
(name) => kleur.bold(name)
418418
);
419419

420420
const logLine = [
@@ -480,15 +480,15 @@ class Application extends EventEmitter {
480480
if (fs.existsSync(absolutePath)) {
481481
server.serveStatic(alias, absolutePath);
482482
} else {
483-
logger.warn(`Can't serve static path ${chalk.green(alias)} from ${chalk.underline(absolutePath)}`);
483+
logger.warn(`Can't serve static path ${kleur.green(alias)} from ${kleur.underline(absolutePath)}`);
484484
}
485485
}
486486

487487
this._codeSource.watch();
488488

489489
server.start(serverConfig.port)
490490
.then((addresss) => {
491-
logger.output(`Server started at ${chalk.underline(addresss)}`);
491+
logger.output(`Server started at ${kleur.underline(addresss)}`);
492492
}, (err) => {
493493
logger.error(`Error starting server: ${err.toString()}`);
494494
logger.debug(err.stack);
@@ -553,7 +553,7 @@ class Application extends EventEmitter {
553553
.filter((filename) => {
554554
const exists = fs.existsSync(filename);
555555
if (!exists) {
556-
logger.warn(`File ${chalk.underline(filename)} does not exist`);
556+
logger.warn(`File ${kleur.underline(filename)} does not exist`);
557557
}
558558
return exists;
559559
})
@@ -596,7 +596,7 @@ class Application extends EventEmitter {
596596
if (fs.existsSync(projectConfigPath)) {
597597
this._config.loadFile(projectConfigPath);
598598
} else {
599-
logger.debug(`Default application config does not exist at ${chalk.underline(projectConfigPath)}`);
599+
logger.debug(`Default application config does not exist at ${kleur.underline(projectConfigPath)}`);
600600
}
601601

602602
this._loadCustomConfigs(customConfigs);
@@ -728,7 +728,7 @@ class Application extends EventEmitter {
728728
platformName: platform.getName()
729729
});
730730

731-
// eslint-disable-next-line global-require
731+
// eslint-disable-next-line node/global-require
732732
const externalCallback = require(file);
733733
await new Promise((resolve) => {
734734
externalCallback(resolve, {

lib/build-helper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const ClosureCompiler = require('google-closure-compiler').compiler;
2121
const Application = require('./application');
2222
const PathHelper = require('./path-helper');
2323
const logger = require('./logger').createChild('Build');
24-
const chalk = require('chalk');
24+
const kleur = require('kleur');
2525

2626

2727
/**
@@ -144,7 +144,7 @@ class BuildHelper {
144144

145145
const processFile = async (processor, fsPath) => {
146146
const pluginNames = processor.plugins.map((plugin) => plugin && plugin.postcssPlugin).join(', ');
147-
logger.silly(`Running ${chalk.cyan(pluginNames)} on ${chalk.underline(fsPath)}`);
147+
logger.silly(`Running ${kleur.cyan(pluginNames)} on ${kleur.underline(fsPath)}`);
148148
const content = await fse.readFile(fsPath, 'utf-8');
149149
const result = await processor.process(content, {from: fsPath, to});
150150
return result.css;
@@ -162,7 +162,7 @@ class BuildHelper {
162162
}
163163

164164
const pluginNames = finalProcessor.plugins.map((plugin) => plugin && plugin.postcssPlugin).join(', ');
165-
logger.silly(`Running ${chalk.cyan(pluginNames)} on bundle`);
165+
logger.silly(`Running ${kleur.cyan(pluginNames)} on bundle`);
166166
return finalProcessor.process(bundle, {from: to, to});
167167
}
168168

lib/config/config.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*/
99

1010
/* eslint interfaced/lines-between-props: "off" */
11-
const chalk = require('chalk');
11+
const kleur = require('kleur');
1212
const _ = require('lodash');
1313
const {mergeConfigs} = require('../utils');
1414
const {Validator} = require('jsonschema');
@@ -42,7 +42,7 @@ class Config {
4242
*/
4343
loadFile(src) {
4444
logger.debug(`Loading config file ${src}`);
45-
// eslint-disable-next-line global-require
45+
// eslint-disable-next-line node/global-require
4646
this.appendObject(require(src)(this._config));
4747
}
4848

@@ -106,9 +106,9 @@ class Config {
106106
}
107107

108108
logger.warn(
109-
`Configuration key ${chalk.bold(key)}` +
110-
`${type ? ` with type ${chalk.bold(type)} ` : ' '}` +
111-
`is deprecated, use ${chalk.bold(newKey)} instead`
109+
`Configuration key ${kleur.bold(key)}` +
110+
`${type ? ` with type ${kleur.bold(type)} ` : ' '}` +
111+
`is deprecated, use ${kleur.bold(newKey)} instead`
112112
);
113113

114114
// Move the value to the new key

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable global-require */
1+
/* eslint-disable node/global-require */
22

33
module.exports = {
44
Application: require('./application'),

0 commit comments

Comments
 (0)