fix(core): update

This commit is contained in:
Philipp Kunz 2020-07-04 10:45:56 +00:00
parent 7b777ea1a9
commit ed91da6e3f
8 changed files with 28 additions and 21 deletions

View File

@ -49,4 +49,4 @@
"npmextra.json", "npmextra.json",
"readme.md" "readme.md"
] ]
} }

View File

@ -8,13 +8,20 @@ watch typescript projects during development
* [docs (typedoc)](https://gitzone.gitlab.io/tswatch/) * [docs (typedoc)](https://gitzone.gitlab.io/tswatch/)
## Status for master ## Status for master
[![pipeline status](https://gitlab.com/gitzone/tswatch/badges/master/pipeline.svg)](https://gitlab.com/gitzone/tswatch/commits/master)
[![coverage report](https://gitlab.com/gitzone/tswatch/badges/master/coverage.svg)](https://gitlab.com/gitzone/tswatch/commits/master) Status Category | Status Badge
[![npm downloads per month](https://img.shields.io/npm/dm/@gitzone/tswatch.svg)](https://www.npmjs.com/package/@gitzone/tswatch) -- | --
[![Known Vulnerabilities](https://snyk.io/test/npm/@gitzone/tswatch/badge.svg)](https://snyk.io/test/npm/@gitzone/tswatch) GitLab Pipelines | [![pipeline status](https://gitlab.com/gitzone/tswatch/badges/master/pipeline.svg)](https://lossless.cloud)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) GitLab Pipline Test Coverage | [![coverage report](https://gitlab.com/gitzone/tswatch/badges/master/coverage.svg)](https://lossless.cloud)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) npm | [![npm downloads per month](https://badgen.net/npm/dy/@gitzone/tswatch)](https://lossless.cloud)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/) Snyk | [![Known Vulnerabilities](https://badgen.net/snyk/gitzone/tswatch)](https://lossless.cloud)
TypeScript Support | [![TypeScript](https://badgen.net/badge/TypeScript/>=%203.x/blue?icon=typescript)](https://lossless.cloud)
node Support | [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
Code Style | [![Code Style](https://badgen.net/badge/style/prettier/purple)](https://lossless.cloud)
PackagePhobia (total standalone install weight) | [![PackagePhobia](https://badgen.net/packagephobia/install/@gitzone/tswatch)](https://lossless.cloud)
PackagePhobia (package size on registry) | [![PackagePhobia](https://badgen.net/packagephobia/publish/@gitzone/tswatch)](https://lossless.cloud)
BundlePhobia (total size when bundled) | [![BundlePhobia](https://badgen.net/bundlephobia/minzip/@gitzone/tswatch)](https://lossless.cloud)
Platform support | [![Supports Windows 10](https://badgen.net/badge/supports%20Windows%2010/yes/green?icon=windows)](https://lossless.cloud) [![Supports Mac OS X](https://badgen.net/badge/supports%20Mac%20OS%20X/yes/green?icon=apple)](https://lossless.cloud)
## Usage ## Usage

View File

@ -12,7 +12,7 @@ tap.test('should start the tswatch instance', async () => {
await testTsWatchInstance.start(); await testTsWatchInstance.start();
}); });
tap.test('should stop the instance', async tools => { tap.test('should stop the instance', async (tools) => {
tools.delayFor(2000); tools.delayFor(2000);
testTsWatchInstance.stop(); testTsWatchInstance.stop();
}); });

View File

@ -21,10 +21,10 @@ export class Parcel {
hmrPort: 3003, // The port the HMR socket runs on, defaults to a random free port (0 in node.js resolves to a random free port) hmrPort: 3003, // The port the HMR socket runs on, defaults to a random free port (0 in node.js resolves to a random free port)
sourceMaps: true, // Enable or disable sourcemaps, defaults to enabled (minified builds currently always create sourcemaps) sourceMaps: true, // Enable or disable sourcemaps, defaults to enabled (minified builds currently always create sourcemaps)
hmrHostname: '', // A hostname for hot module reload, default to '' hmrHostname: '', // A hostname for hot module reload, default to ''
detailedReport: false // Prints a detailed report of the bundles, assets, filesizes and times, defaults to false, reports are only printed if watch is disabled detailedReport: false, // Prints a detailed report of the bundles, assets, filesizes and times, defaults to false, reports are only printed if watch is disabled
}; };
public options: plugins.parcel.ParcelOptions; public options: plugins.parcel.ParcelOptions;
public entryFiles: string | string [] = plugins.path.join(paths.cwd, './html/index.html'); public entryFiles: string | string[] = plugins.path.join(paths.cwd, './html/index.html');
public async start() { public async start() {
const bundler = new plugins.parcel(this.entryFiles, this.options); const bundler = new plugins.parcel(this.entryFiles, this.options);
@ -39,7 +39,7 @@ export class Parcel {
this.options = { this.options = {
...this.defaultOptions, ...this.defaultOptions,
outDir: outputDirArg, outDir: outputDirArg,
outFile: outputFileArg outFile: outputFileArg,
}; };
} }
} }

View File

@ -17,7 +17,7 @@ export class Watcher {
* used to execute shell commands * used to execute shell commands
*/ */
private smartshellInstance = new plugins.smartshell.Smartshell({ private smartshellInstance = new plugins.smartshell.Smartshell({
executor: 'bash' executor: 'bash',
}); });
private currentExecution: plugins.smartshell.IExecResultStreaming; private currentExecution: plugins.smartshell.IExecResultStreaming;

View File

@ -8,31 +8,31 @@ const tswatchCli = new plugins.smartcli.Smartcli();
// standard behaviour will assume gitzone setup // standard behaviour will assume gitzone setup
tswatchCli.addCommand('element').subscribe(async argvArg => { tswatchCli.addCommand('element').subscribe(async (argvArg) => {
logger.log('info', `running watch task for a gitzone element project`); logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new TsWatch('gitzone_element'); const tsWatch = new TsWatch('gitzone_element');
await tsWatch.start(); await tsWatch.start();
}); });
tswatchCli.addCommand('npm').subscribe(async argvArg => { tswatchCli.addCommand('npm').subscribe(async (argvArg) => {
logger.log('info', `running watch task for a gitzone element project`); logger.log('info', `running watch task for a gitzone element project`);
const tsWatch = new TsWatch('gitzone_npm'); const tsWatch = new TsWatch('gitzone_npm');
await tsWatch.start(); await tsWatch.start();
}); });
tswatchCli.addCommand('service').subscribe(async argvArg => { tswatchCli.addCommand('service').subscribe(async (argvArg) => {
logger.log('info', `running test task`); logger.log('info', `running test task`);
const tsWatch = new TsWatch('gitzone_service'); const tsWatch = new TsWatch('gitzone_service');
await tsWatch.start(); await tsWatch.start();
}); });
tswatchCli.addCommand('test').subscribe(async argvArg => { tswatchCli.addCommand('test').subscribe(async (argvArg) => {
logger.log('info', `running test task`); logger.log('info', `running test task`);
const tsWatch = new TsWatch('test'); const tsWatch = new TsWatch('test');
await tsWatch.start(); await tsWatch.start();
}); });
tswatchCli.addCommand('website').subscribe(async argvArg => { tswatchCli.addCommand('website').subscribe(async (argvArg) => {
logger.log('info', `running watch task for a gitzone website project`); logger.log('info', `running watch task for a gitzone website project`);
const tsWatch = new TsWatch('gitzone_website'); const tsWatch = new TsWatch('gitzone_website');
await tsWatch.start(); await tsWatch.start();

View File

@ -7,9 +7,9 @@ export const logger = new plugins.smartlog.Smartlog({
containerName: 'Some Containername', containerName: 'Some Containername',
environment: 'local', environment: 'local',
runtime: 'node', runtime: 'node',
zone: 'gitzone' zone: 'gitzone',
}, },
minimumLogLevel: 'silly' minimumLogLevel: 'silly',
}); });
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal()); logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());

View File

@ -21,7 +21,7 @@ export {
smartlogDestinationLocal, smartlogDestinationLocal,
smartserve, smartserve,
smartshell, smartshell,
taskbuffer taskbuffer,
}; };
// third party scope // third party scope