UNPKG

@boost/core

Version:

Robust pipeline for creating dev tools that separate logic into routines and tasks.

356 lines (228 loc) 11.1 kB
## 1.12.0 - 2019-06-21 #### 🎉 Release In an effort to modularize Boost even further, 3 new packages have been created! #### 🚀 Updates - Added a new package, [@boost/log](https://www.npmjs.com/package/@boost/log), to provide a logger with common log level functionality. - Added a new package, [@boost/debug](https://www.npmjs.com/package/@boost/debug), to provide debugging and crash reporting capabilities. - The new `createDebugger` function supersedes the `Tool#createDebugger` method. - Added a new package, [@boost/translate](https://www.npmjs.com/package/@boost/translate), to provide easy package level internationalization (i18n). - The new `createTranslator` function supersedes the `Tool#createTranslator` method. - Updated the crash log to report more information (like binary paths). #### 📦 Dependencies - Updated `cli-truncate` to v2.0 from v1.1. - Updated `env-ci` to v4.1 from v3.2. - Updated `fast-glob` to v3.0 from v2.2. - Updated `i18next` to v17.0 from v15.1. - Updated `os-locale` to v4.0 from v3.1. - Updated `pluralize` to v8.0 from v7.0. - Updated `wrap-ansi` to v6.0 from v5.1. #### 🛠 Internals - Added debugging to all new packages. Can be enabled with `DEBUG=boost:*`. - Deprecated `Tool#createDebugger`, `Tool#log`, `Tool#logLive`, and `Tool#logError` methods. - Renamed the `resources` folder to `res`. - **[TS]** Updated to support TypeScript v3.5. ### 1.11.1 - 2019-05-09 #### 📦 Dependencies - Updated `i18next` to v15.1. - Updated `optimal` to v3.2. - Updated `pretty-ms` to v5.0. - Updated `term-size` to v2.0. - Updated `yargs-parser` to v13.1. ## 1.11.0 - 2019-04-16 #### 🚀 Updates - Added a new package, [@boost/common](https://www.npmjs.com/package/@boost/common), to house common utilities and helpers for building Boost or general purpose applications. - Added a `Contract` abstract class. - Added a new package, [@boost/event](https://www.npmjs.com/package/@boost/event), to provide a type-safe static event system. The old event emitter is deprecated, so please migrate to the new system! - Added `onError`, `onRoutine`, `onRoutines`, `onStart`, `onStop`, `onTask`, and `onTasks` events to `Console`. - Added `onRoutine`, `onRoutines`,`onTask`, and `onTasks` events to `Executor`. - Added `onCommand` and `onCommandData` events to `Routine`. - Added `onFail`, `onPass`, `onRun`, and `onSkip` to `Task` and `Routine`. - Added `onExit`, `onInit`, and `onLoadPlugin` to `Tool`. - Updated `Routine#execute` to serialize tasks by default. - Tasks and Routines can be skipped during their run process if an `onRun` event listener returns `false`. #### 🛠 Internals - Started writing [documentation using GitBook](https://milesj.gitbook.io/boost/). - Updated dependencies. - **[ts]** Switched to project references. - **[ts]** Reworked how options objects are handled. - **[ts]** Marked `Plugin` and `Reporter` as abstract. - **[ts]** Unmarked `Routine#execute` as abstract. ### 1.10.1 - 2019-03-24 #### 🐞 Fixes - Fixed and improved the test utils generics. ## 1.10.0 - 2019-03-23 #### 🚀 Updates - Added `@boost/core/test-utils`, in which mocks, stubs, and test types can be utilized. - When a SIGINT or SIGTERM occurs, a `SignalError` is now thrown. This can be used for easier failure detection. #### 🛠 Internals - Migrated to `Map` and `Set` for performance improvements (where applicable). - Updated dependencies. ### 1.9.3 - 2019-03-11 #### 🐞 Fixes - Fixed in issue where `Context#clone` was destroying class instances. #### 🛠 Internals - Reduced console FPS from 16 to 8. ### 1.9.2 - 2019-03-08 #### 🐞 Fixes - Fixed some invalid validation patterns. #### 🛠 Internals - Improved `ToolOptions` type. - Updated dependencies. ### 1.9.1 - 2019-02-22 #### 🛠 Internals - Updated dependencies. ## 1.9.0 - 2019-02-10 #### 🎉 Release Added a new type of output to concurrently render progress bars in a handful of different styles. #### 🚀 Updates - Added `ProgressOutput` class. - Added `Output#onStart`, `onComplete`, `onFirst`, `onLast` lifecycle methods for sub-classes. - Added `Reporter#createProgressOutput` to instantiate a concurrent progress bar output. - Added a `scope` argument to `Routine#task` to control the `this` of task actions. #### 🛠 Internals - Updated `Tool#msg` to lazy-load the translator. - Updated `i18next` to v15.0. - Improved Jest performance. ## 1.8.0 - 2019-02-06 #### 🚀 Updates - Optimal predicates are now passed to `Plugin#blueprint` and `Routine#blueprint`, allowing consumers to destructure from an argument instead of importing from `optimal` directly. - Added `Context#clone` so contexts can easily be cloned within the pipeline. #### 🛠 Internals - Removed `optimal` as a peer dependency. - Updated `optimal` to v2.1 from v1. - Updated `yargs-parser` to v13.0 from v11 (this may be a breaking change depending on your usage). ### 1.7.2 - 2019-01-28 #### 🐞 Fixes - Fixed multiline error messages displaying multiple times in the reporter error stack output. ### 1.7.1 - 2019-01-25 #### 🐞 Fixes - Quick render loop fix to avoid tearing. ## 1.7.0 - 2019-01-25 #### 🎉 Release Added concurrent rendering which will render the first output and all concurrent outputs in parallel until they complete. Also updated the render loop to only run when output has been enqueued, otherwise, streams flush immediately. #### 🚀 Updates - Added `Output#concurrent` to mark an output as concurrent. - Added `Reporter#createConcurrentOutput` to instantiate a concurrent output. - Added `Reporter#hideCursor`, `Reporter#resetCursor`, and `Reporter#showCursor` methods. #### 🐞 Fixes - Fixed some issues where the tool would crash before config has been loaded. #### 🛠 Internals - Deprecated `Console#logLive`. A new system will be replacing it in v2.0. - Deprecated `Console#hideCursor`, `Console#resetCursor`, and `Console#showCursor`. Use `Reporter` equivalent methods instead. - Updated `i18next` to v14.0. - TS: `Executor` and `Routine` have been marked abstract. ## 1.6.0 - 2019-01-17 #### 🎉 Release A new package `@boost/test-utils` has been added for easily testing Boost applications. #### 🚀 Updates - Constants are now exported from the index. - Added `Console#enable`, `disable`, and `isDisabled` to control the render loop. - Added an `exit` handler option to `Pipeline` to support a custom exit strategy. #### 🐞 Fixes - Fixed some cross-realm `instanceof` check issues. - Fixed a bug in which the render loop was still running during `--silent`. #### 🛠 Internals - TS: `TaskAction` is now exported. ## 1.5.0 - 2019-01-13 #### 🎉 Release In an effort to test the new CLI rendering engine, this release includes a new [nyan cat](http://www.nyan.cat/) reporter! Install with `@boost/reporter-nyan` and enable with `--reporter=nyan`. #### 🚀 Updates - Added `Tool#isCI` method to check if in a CI environment. - Added `Tool#isPluginEnabled` method to check if a plugin by type has been enabled. - Added `Console#isFinalRender` and `Reporter#isFinalRender` methods to check whether it's the final render or not. - Added `Plugin#blueprint`, `Reporter#blueprint`, and `Routine#blueprint` as a means to validate and build options passed to the constructor. - Added `Reporter#hasColorSupport` to check for terminal color support. - Added an `ExitError` class. - Updated `Tool#exit` to accept an exit code as the 2nd argument. - Registered plugins can now define a list of custom NPM `scopes` to lookup modules in. #### 🐞 Fixes - `ctrl + c` should now exit the render loop properly. #### 🛠 Internals - Deprecated `Tool#loadWorkspacePackages`. Use `Tool#getWorkspacePackages` instead. - TS: `Tool#loadConfig`, `loadPlugins`, `loadReporters` have been marked `protected`. - TS: `Console#final`, `started`, `stopped` have been marked `protected`. ### 1.4.1 - 2019-01-08 #### 🐞 Fixes - Fixed `--debug` not enabling in some situations. ## 1.4.0 - 2019-01-07 #### 🎉 Release Complete rewrite of the console rendering layer, which now utilizes a render loop that continuously renders "blocks" or "lines" of output at 16 FPS. Implementation is much faster, much cleaner, more customizable, and properly handles outside interferrence, like `console` logs or `stderr` writes. #### 🚀 Updates - Added `routine.skip` and `task.skip` events to executors. - Added `Routine#metadata` and `Task#metadata` property objects, which includes: - `depth` (number) - The routine hierarchy depth. - `index` (number) - The index within its parent collection. - `startTime`, `stopTime` - Execution timestamps. - Added `Routine#isComplete()` and `Task#isComplete()` methods. - Added `Reporter.BUFFER`, `OUTPUT_COMPACT`, `OUTPUT_NORMAL`, `OUTPUT_VERBOSE` static properties. - Added `Reporter#calculateTaskCompletion`, `getOutputLevel`, `getRootParent`, `isSilent` methods. #### 🐞 Fixes - Updated `Reporter#displayError` to write to `stderr`. - Updated `Reporter#indent` to properly handle negative numbers. #### 🛠 Internals - Changed default output level to `2` (normal) from `3` (verbose). - TS: Added generics to `Tool#loadWorkspacePackages()` to customize additional package config fields. - TS: `execute()` and `run()` methods now type the value as `any` instead of using generics. ## 1.3.0 - 2019-01-01 #### 🚀 Updates - Added `Tool#getWorkspacePaths`, `getWorkspacePackagePaths`, and `loadWorkspacePackages` helper methods. - TS: Added `CLI` generic for Yargs typings. ### 1.2.1 - 2018-12-28 #### 🐞 Fixes - Reverted some typing issues in relation to partial options. ## 1.2.0 - 2018-12-26 #### 🚀 Updates - Added `Reporter#size` to gather terminal information, like the column and row count. - Updated `Reporter#truncate` and `wrap` to default column count automatically. - Updated `Reporter#out` and `err` to always be defined, but a no-op if no stream available. - Updated `Task` and `Routine` to extend from `Emitter` so they may emit events. - Added `run`, `skip`, `pass`, and `fail` events. #### 🐞 Fixes - Fixed a reporter bug in which task statuses were not wrapping properly, causing subsequent renders to get out of sync. - Refactored executors to be slightly more performant. #### 🛠 Internals - Updated console output to use `ansi-escapes` package. - Updated dependencies. ## 1.1.0 - 2018-12-12 #### 🚀 Updates - Added `Tool#logLive` to display live messages during a running process. These messages will be removed on the success or failure of the process. #### 🛠 Internals - Updated dependencies. ### 1.0.4 - 2018-11-27 #### 🛠 Internals - Updated dependencies. ### 1.0.3 - 2018-10-30 #### 🐞 Fixes - Added an `exiting` boolean to the console to handle multiple calls to `exit`. ### 1.0.2 - 2018-10-29 #### 🐞 Fixes - Added a delay before exiting the console so that CIs can buffer output effectively. ### 1.0.1 - 2018-10-23 #### 🐞 Fixes - Fixed an issue where console signals were causing re-render issues. # 1.0.0 - 2018-10-19 #### 🎉 Release - Initial release!