Compare commits
74 Commits
Author | SHA1 | Date | |
---|---|---|---|
d0d158ee87 | |||
3ada286495 | |||
0514a74a07 | |||
587d08239a | |||
7ee934eb46 | |||
ebcd8d4b51 | |||
27477253ee | |||
9ed461e1e4 | |||
b854a161f3 | |||
0598357010 | |||
9dae6dcda1 | |||
4cf71d2edc | |||
0eec0c04e8 | |||
ef5d4d2a9c | |||
f05481a267 | |||
d66a88538a | |||
1c1a110ca3 | |||
3f7790e8c8 | |||
2018b27a4b | |||
3b8ac18a6c | |||
e36af800a3 | |||
76b810663f | |||
9950661a36 | |||
6fa461aff5 | |||
4ca73a77f9 | |||
2d4d243454 | |||
f77f36312f | |||
c508c85473 | |||
50a0cadd11 | |||
d5cb794ea6 | |||
3bb65bedf6 | |||
53147a8812 | |||
c63a5f88d5 | |||
f039ace7bc | |||
bbc34ad98b | |||
c699954d08 | |||
1c84726ed8 | |||
c589e20222 | |||
f170cb8909 | |||
ca1d058789 | |||
4423631fa9 | |||
5e62fa2124 | |||
8ef3b47e76 | |||
ed91da6e3f | |||
7b777ea1a9 | |||
faec3d38bc | |||
a2ff76dc78 | |||
7e973c906a | |||
6c109cb381 | |||
2266813faf | |||
bf7a2c9146 | |||
1a4ada879d | |||
0046985b82 | |||
d876b09337 | |||
f48ba50236 | |||
f04833d5b5 | |||
073685e683 | |||
b91b3e0a0c | |||
12d31533f5 | |||
f9b8a356e4 | |||
408b6f8fc5 | |||
80dd3ee970 | |||
717e1d29ed | |||
a8254e6962 | |||
35ee69981d | |||
bd66e9a897 | |||
fc356e62f4 | |||
a34d98b840 | |||
9525f28507 | |||
787aae63d7 | |||
bf2a32a5d5 | |||
7ced66fc28 | |||
d01905ae99 | |||
59c744cc5e |
4
.gitignore
vendored
4
.gitignore
vendored
@@ -15,8 +15,6 @@ node_modules/
|
|||||||
|
|
||||||
# builds
|
# builds
|
||||||
dist/
|
dist/
|
||||||
dist_web/
|
dist_*/
|
||||||
dist_serve/
|
|
||||||
dist_ts_web/
|
|
||||||
|
|
||||||
# custom
|
# custom
|
@@ -4,13 +4,13 @@ image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
|||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
- .npmci_cache/
|
- .npmci_cache/
|
||||||
key: "$CI_BUILD_STAGE"
|
key: '$CI_BUILD_STAGE'
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- security
|
- security
|
||||||
- test
|
- test
|
||||||
- release
|
- release
|
||||||
- metadata
|
- metadata
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# security stage
|
# security stage
|
||||||
@@ -19,20 +19,36 @@ mirror:
|
|||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci git mirror
|
- npmci git mirror
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
snyk:
|
auditProductionDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
stage: security
|
stage: security
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci command npm install -g snyk
|
- npmci command npm install --production --ignore-scripts
|
||||||
- npmci command npm install --ignore-scripts
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
- npmci command snyk test
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
allow_failure: true
|
||||||
|
|
||||||
|
auditDevDependencies:
|
||||||
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
stage: security
|
||||||
|
script:
|
||||||
|
- npmci npm prepare
|
||||||
|
- npmci command npm install --ignore-scripts
|
||||||
|
- npmci command npm config set registry https://registry.npmjs.org
|
||||||
|
- npmci command npm audit --audit-level=high --only=dev
|
||||||
|
tags:
|
||||||
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
# ====================
|
# ====================
|
||||||
# test stage
|
# test stage
|
||||||
@@ -48,7 +64,6 @@ testStable:
|
|||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- priv
|
|
||||||
|
|
||||||
testBuild:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
@@ -60,7 +75,6 @@ testBuild:
|
|||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
@@ -70,6 +84,7 @@ release:
|
|||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
@@ -79,12 +94,15 @@ release:
|
|||||||
codequality:
|
codequality:
|
||||||
stage: metadata
|
stage: metadata
|
||||||
allow_failure: true
|
allow_failure: true
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g tslint typescript
|
- npmci command npm install -g tslint typescript
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
- npmci command "tslint -c tslint.json ./ts/**/*.ts"
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- priv
|
- priv
|
||||||
|
|
||||||
@@ -95,20 +113,20 @@ trigger:
|
|||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-dbase:npmci
|
|
||||||
services:
|
|
||||||
- docker:stable-dind
|
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
|
- npmci node install lts
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci command tsdoc
|
- npmci command tsdoc
|
||||||
tags:
|
tags:
|
||||||
|
- lossless
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- notpriv
|
||||||
only:
|
only:
|
||||||
|
29
.vscode/launch.json
vendored
Normal file
29
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "current file",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"${relativeFile}"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "test.ts",
|
||||||
|
"type": "node",
|
||||||
|
"request": "launch",
|
||||||
|
"args": [
|
||||||
|
"test/test.ts"
|
||||||
|
],
|
||||||
|
"runtimeArgs": ["-r", "@gitzone/tsrun"],
|
||||||
|
"cwd": "${workspaceRoot}",
|
||||||
|
"protocol": "inspector",
|
||||||
|
"internalConsoleOptions": "openOnSessionStart"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
26
.vscode/settings.json
vendored
Normal file
26
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
{
|
||||||
|
"json.schemas": [
|
||||||
|
{
|
||||||
|
"fileMatch": ["/npmextra.json"],
|
||||||
|
"schema": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"npmci": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for npmci"
|
||||||
|
},
|
||||||
|
"gitzone": {
|
||||||
|
"type": "object",
|
||||||
|
"description": "settings for gitzone",
|
||||||
|
"properties": {
|
||||||
|
"projectType": {
|
||||||
|
"type": "string",
|
||||||
|
"enum": ["website", "element", "service", "npm", "wcc"]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
4
cli.child.ts
Normal file
4
cli.child.ts
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
#!/usr/bin/env node
|
||||||
|
process.env.CLI_CALL = 'true';
|
||||||
|
import * as cliTool from './ts/index.js';
|
||||||
|
cliTool.runCli();
|
3
cli.js
3
cli.js
@@ -1,3 +1,4 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
process.env.CLI_CALL = 'true';
|
process.env.CLI_CALL = 'true';
|
||||||
require('./dist/index');
|
const cliTool = await import('./dist_ts/index.js');
|
||||||
|
cliTool.runCli();
|
||||||
|
@@ -1,4 +1,5 @@
|
|||||||
#!/usr/bin/env node
|
#!/usr/bin/env node
|
||||||
process.env.CLI_CALL = 'true';
|
process.env.CLI_CALL = 'true';
|
||||||
require('@gitzone/tsrun');
|
|
||||||
require('./ts/index');
|
import * as tsrun from '@gitzone/tsrun';
|
||||||
|
tsrun.runPath('./cli.child.js', import.meta.url);
|
||||||
|
2
dist_ts/index.d.ts
vendored
Normal file
2
dist_ts/index.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './tswatch.classes.tswatch.js';
|
||||||
|
export * from './tswatch.cli.js';
|
6
dist_ts/index.js
Normal file
6
dist_ts/index.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import * as early from '@pushrocks/early';
|
||||||
|
early.start('tswatch');
|
||||||
|
export * from './tswatch.classes.tswatch.js';
|
||||||
|
export * from './tswatch.cli.js';
|
||||||
|
early.stop();
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssS0FBSyxNQUFNLGtCQUFrQixDQUFDO0FBQzFDLEtBQUssQ0FBQyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7QUFDdkIsY0FBYyw4QkFBOEIsQ0FBQztBQUM3QyxjQUFjLGtCQUFrQixDQUFDO0FBQ2pDLEtBQUssQ0FBQyxJQUFJLEVBQUUsQ0FBQyJ9
|
1
dist_ts/interfaces/index.d.ts
vendored
Normal file
1
dist_ts/interfaces/index.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export * from './interfaces.watchmodes.js';
|
2
dist_ts/interfaces/index.js
Normal file
2
dist_ts/interfaces/index.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export * from './interfaces.watchmodes.js';
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi90cy9pbnRlcmZhY2VzL2luZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLGNBQWMsNEJBQTRCLENBQUMifQ==
|
1
dist_ts/interfaces/interfaces.watchmodes.d.ts
vendored
Normal file
1
dist_ts/interfaces/interfaces.watchmodes.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export declare type TWatchModes = 'test' | 'gitzone_npm' | 'gitzone_service' | 'gitzone_element' | 'gitzone_website' | 'echoSomething';
|
2
dist_ts/interfaces/interfaces.watchmodes.js
Normal file
2
dist_ts/interfaces/interfaces.watchmodes.js
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
export {};
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW50ZXJmYWNlcy53YXRjaG1vZGVzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vdHMvaW50ZXJmYWNlcy9pbnRlcmZhY2VzLndhdGNobW9kZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiJ9
|
3
dist_ts/tswatch.classes.parcel.d.ts
vendored
Normal file
3
dist_ts/tswatch.classes.parcel.d.ts
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
export declare class Parcel {
|
||||||
|
start(): Promise<void>;
|
||||||
|
}
|
44
dist_ts/tswatch.classes.parcel.js
Normal file
44
dist_ts/tswatch.classes.parcel.js
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
"use strict";
|
||||||
|
var __importStar = (this && this.__importStar) || function (mod) {
|
||||||
|
if (mod && mod.__esModule) return mod;
|
||||||
|
var result = {};
|
||||||
|
if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
|
||||||
|
result["default"] = mod;
|
||||||
|
return result;
|
||||||
|
};
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
const plugins = __importStar(require("./tswatch.plugins"));
|
||||||
|
const paths = __importStar(require("./tswatch.paths"));
|
||||||
|
class Parcel {
|
||||||
|
async start() {
|
||||||
|
const entryFiles = plugins.path.join(paths.cwd, './html/index.html');
|
||||||
|
// Bundler options
|
||||||
|
const options = {
|
||||||
|
outDir: './dist_watch',
|
||||||
|
outFile: 'index.html',
|
||||||
|
publicUrl: '/',
|
||||||
|
watch: true,
|
||||||
|
cache: true,
|
||||||
|
cacheDir: '.nogit/.parcelcache',
|
||||||
|
contentHash: false,
|
||||||
|
global: 'moduleName',
|
||||||
|
minify: false,
|
||||||
|
scopeHoist: false,
|
||||||
|
target: 'browser',
|
||||||
|
bundleNodeModules: true,
|
||||||
|
https: null,
|
||||||
|
logLevel: 3,
|
||||||
|
hmr: true,
|
||||||
|
hmrPort: 3003,
|
||||||
|
sourceMaps: true,
|
||||||
|
hmrHostname: '',
|
||||||
|
detailedReport: false // Prints a detailed report of the bundles, assets, filesizes and times, defaults to false, reports are only printed if watch is disabled
|
||||||
|
};
|
||||||
|
const bundler = new plugins.parcel(entryFiles, options);
|
||||||
|
// Run the bundler, this returns the main bundle
|
||||||
|
// Use the events if you're using watch mode as this promise will only trigger once and not for every rebuild
|
||||||
|
const bundle = await bundler.serve(3002);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
exports.Parcel = Parcel;
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGFzc2VzLnBhcmNlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rzd2F0Y2guY2xhc3Nlcy5wYXJjZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7O0FBQUEsMkRBQTZDO0FBQzdDLHVEQUF5QztBQUV6QyxNQUFhLE1BQU07SUFDVixLQUFLLENBQUMsS0FBSztRQUNoQixNQUFNLFVBQVUsR0FBRyxPQUFPLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxFQUFFLG1CQUFtQixDQUFDLENBQUM7UUFFckUsa0JBQWtCO1FBQ2xCLE1BQU0sT0FBTyxHQUFpQztZQUM1QyxNQUFNLEVBQUUsY0FBYztZQUN0QixPQUFPLEVBQUUsWUFBWTtZQUNyQixTQUFTLEVBQUUsR0FBRztZQUNkLEtBQUssRUFBRSxJQUFJO1lBQ1gsS0FBSyxFQUFFLElBQUk7WUFDWCxRQUFRLEVBQUUscUJBQXFCO1lBQy9CLFdBQVcsRUFBRSxLQUFLO1lBQ2xCLE1BQU0sRUFBRSxZQUFZO1lBQ3BCLE1BQU0sRUFBRSxLQUFLO1lBQ2IsVUFBVSxFQUFFLEtBQUs7WUFDakIsTUFBTSxFQUFFLFNBQVM7WUFDakIsaUJBQWlCLEVBQUUsSUFBSTtZQUN2QixLQUFLLEVBQUUsSUFBSTtZQUNYLFFBQVEsRUFBRSxDQUFDO1lBQ1gsR0FBRyxFQUFFLElBQUk7WUFDVCxPQUFPLEVBQUUsSUFBSTtZQUNiLFVBQVUsRUFBRSxJQUFJO1lBQ2hCLFdBQVcsRUFBRSxFQUFFO1lBQ2YsY0FBYyxFQUFFLEtBQUssQ0FBQyx5SUFBeUk7U0FDaEssQ0FBQztRQUVGLE1BQU0sT0FBTyxHQUFHLElBQUksT0FBTyxDQUFDLE1BQU0sQ0FBQyxVQUFVLEVBQUUsT0FBTyxDQUFDLENBQUM7UUFFeEQsZ0RBQWdEO1FBQ2hELDZHQUE2RztRQUM3RyxNQUFNLE1BQU0sR0FBRyxNQUFNLE9BQU8sQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLENBQUM7SUFDM0MsQ0FBQztDQUNGO0FBakNELHdCQWlDQyJ9
|
17
dist_ts/tswatch.classes.tswatch.d.ts
vendored
Normal file
17
dist_ts/tswatch.classes.tswatch.d.ts
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
import * as interfaces from './interfaces/index.js';
|
||||||
|
import { Watcher } from './tswatch.classes.watcher.js';
|
||||||
|
export declare class TsWatch {
|
||||||
|
watchmode: interfaces.TWatchModes;
|
||||||
|
watcherMap: plugins.lik.ObjectMap<Watcher>;
|
||||||
|
smartserve: plugins.smartserve.SmartServe;
|
||||||
|
constructor(watchmodeArg: interfaces.TWatchModes);
|
||||||
|
/**
|
||||||
|
* starts the TsWatch instance
|
||||||
|
*/
|
||||||
|
start(): Promise<void>;
|
||||||
|
/**
|
||||||
|
* stops the execution of any active Watchers
|
||||||
|
*/
|
||||||
|
stop(): Promise<void>;
|
||||||
|
}
|
115
dist_ts/tswatch.classes.tswatch.js
Normal file
115
dist_ts/tswatch.classes.tswatch.js
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
import * as paths from './tswatch.paths.js';
|
||||||
|
import './interfaces/index.js';
|
||||||
|
import { Watcher } from './tswatch.classes.watcher.js';
|
||||||
|
export class TsWatch {
|
||||||
|
constructor(watchmodeArg) {
|
||||||
|
this.watcherMap = new plugins.lik.ObjectMap();
|
||||||
|
this.watchmode = watchmodeArg;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* starts the TsWatch instance
|
||||||
|
*/
|
||||||
|
async start() {
|
||||||
|
switch (this.watchmode) {
|
||||||
|
case 'test':
|
||||||
|
this.watcherMap.add(new Watcher({
|
||||||
|
filePathToWatch: paths.cwd,
|
||||||
|
commandToExecute: 'npm run test2',
|
||||||
|
timeout: null,
|
||||||
|
}));
|
||||||
|
break;
|
||||||
|
case 'gitzone_npm':
|
||||||
|
this.watcherMap.add(new Watcher({
|
||||||
|
filePathToWatch: paths.cwd,
|
||||||
|
commandToExecute: 'npm run test',
|
||||||
|
timeout: null,
|
||||||
|
}));
|
||||||
|
break;
|
||||||
|
case 'gitzone_element':
|
||||||
|
// lets create a standard server
|
||||||
|
console.log('bundling TypeScript files to "dist_watch" Note: This is for development only!');
|
||||||
|
const smartserve = new plugins.smartserve.SmartServe({
|
||||||
|
injectReload: true,
|
||||||
|
serveDir: plugins.path.join(paths.cwd, './dist_watch/'),
|
||||||
|
port: 3002,
|
||||||
|
});
|
||||||
|
const tsbundle = new plugins.tsbundle.TsBundle();
|
||||||
|
const bundleAndReload = async () => {
|
||||||
|
await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_watch/bundle.js', {
|
||||||
|
bundler: 'esbuild'
|
||||||
|
});
|
||||||
|
await smartserve.reload();
|
||||||
|
};
|
||||||
|
this.watcherMap.add(new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
||||||
|
functionToCall: async () => {
|
||||||
|
await bundleAndReload();
|
||||||
|
},
|
||||||
|
timeout: null,
|
||||||
|
}));
|
||||||
|
await smartserve.start();
|
||||||
|
/* const parcel = new plugins.smartparcel.Parcel(
|
||||||
|
plugins.path.join(process.cwd(), './html/index.html'),
|
||||||
|
plugins.path.join(process.cwd(), './dist_watch'),
|
||||||
|
'index.html'
|
||||||
|
);
|
||||||
|
await parcel.watchAndServe(); */
|
||||||
|
break;
|
||||||
|
case 'gitzone_website':
|
||||||
|
this.watcherMap.add(new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||||
|
commandToExecute: 'npm run startTs',
|
||||||
|
timeout: null,
|
||||||
|
}));
|
||||||
|
this.watcherMap.add(new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
||||||
|
commandToExecute: 'npm run bundle',
|
||||||
|
timeout: null,
|
||||||
|
}));
|
||||||
|
// client directory
|
||||||
|
/* const parcelWebsite = new plugins.smartparcel.Parcel(
|
||||||
|
plugins.path.join(process.cwd(), './html/index.html'),
|
||||||
|
plugins.path.join(process.cwd(), './dist_serve'),
|
||||||
|
'bundle.js'
|
||||||
|
);
|
||||||
|
await parcelWebsite.watchAndServe(); */
|
||||||
|
break;
|
||||||
|
case 'gitzone_service':
|
||||||
|
this.watcherMap.add(new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||||
|
commandToExecute: 'npm run startTs',
|
||||||
|
timeout: null,
|
||||||
|
}));
|
||||||
|
break;
|
||||||
|
case 'echoSomething':
|
||||||
|
const tsWatchInstanceEchoSomething = new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts'),
|
||||||
|
commandToExecute: 'npm -v',
|
||||||
|
timeout: null,
|
||||||
|
});
|
||||||
|
this.watcherMap.add(tsWatchInstanceEchoSomething);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
this.watcherMap.forEach(async (watcher) => {
|
||||||
|
await watcher.start();
|
||||||
|
});
|
||||||
|
if (this.smartserve) {
|
||||||
|
await this.smartserve.start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* stops the execution of any active Watchers
|
||||||
|
*/
|
||||||
|
async stop() {
|
||||||
|
if (this.smartserve) {
|
||||||
|
await this.smartserve.stop();
|
||||||
|
}
|
||||||
|
this.watcherMap.forEach(async (watcher) => {
|
||||||
|
await watcher.stop();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGFzc2VzLnRzd2F0Y2guanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90c3dhdGNoLmNsYXNzZXMudHN3YXRjaC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLHNCQUFzQixDQUFDO0FBQ2hELE9BQU8sS0FBSyxLQUFLLE1BQU0sb0JBQW9CLENBQUM7QUFDNUMsT0FBNEIsdUJBQXVCLENBQUM7QUFFcEQsT0FBTyxFQUFFLE9BQU8sRUFBRSxNQUFNLDhCQUE4QixDQUFDO0FBRXZELE1BQU0sT0FBTyxPQUFPO0lBS2xCLFlBQVksWUFBb0M7UUFIekMsZUFBVSxHQUFHLElBQUksT0FBTyxDQUFDLEdBQUcsQ0FBQyxTQUFTLEVBQVcsQ0FBQztRQUl2RCxJQUFJLENBQUMsU0FBUyxHQUFHLFlBQVksQ0FBQztJQUNoQyxDQUFDO0lBRUQ7O09BRUc7SUFDSSxLQUFLLENBQUMsS0FBSztRQUNoQixRQUFRLElBQUksQ0FBQyxTQUFTLEVBQUU7WUFDdEIsS0FBSyxNQUFNO2dCQUNULElBQUksQ0FBQyxVQUFVLENBQUMsR0FBRyxDQUNqQixJQUFJ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UFDLFVBQVUsRUFBRTtZQUNuQixNQUFNLElBQUksQ0FBQyxVQUFVLENBQUMsSUFBSSxFQUFFLENBQUM7U0FDOUI7UUFDRCxJQUFJLENBQUMsVUFBVSxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUUsT0FBTyxFQUFFLEVBQUU7WUFDeEMsTUFBTSxPQUFPLENBQUMsSUFBSSxFQUFFLENBQUM7UUFDdkIsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDO0NBQ0YifQ==
|
35
dist_ts/tswatch.classes.watcher.d.ts
vendored
Normal file
35
dist_ts/tswatch.classes.watcher.d.ts
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
export interface IWatcherConstructorOptions {
|
||||||
|
filePathToWatch: string;
|
||||||
|
commandToExecute?: string;
|
||||||
|
functionToCall?: () => Promise<any>;
|
||||||
|
timeout?: number;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* A watcher keeps track of one child execution
|
||||||
|
*/
|
||||||
|
export declare class Watcher {
|
||||||
|
/**
|
||||||
|
* used to execute shell commands
|
||||||
|
*/
|
||||||
|
private smartshellInstance;
|
||||||
|
private currentExecution;
|
||||||
|
private smartchokWatcher;
|
||||||
|
private options;
|
||||||
|
constructor(optionsArg: IWatcherConstructorOptions);
|
||||||
|
/**
|
||||||
|
* start the file
|
||||||
|
*/
|
||||||
|
start(): Promise<void>;
|
||||||
|
/**
|
||||||
|
* updates the current execution
|
||||||
|
*/
|
||||||
|
private updateCurrentExecution;
|
||||||
|
/**
|
||||||
|
* this method sets up a clean exit strategy
|
||||||
|
*/
|
||||||
|
private setupCleanup;
|
||||||
|
/**
|
||||||
|
* stops the watcher
|
||||||
|
*/
|
||||||
|
stop(): Promise<void>;
|
||||||
|
}
|
90
dist_ts/tswatch.classes.watcher.js
Normal file
90
dist_ts/tswatch.classes.watcher.js
Normal file
@@ -0,0 +1,90 @@
|
|||||||
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
import { logger } from './tswatch.logging.js';
|
||||||
|
/**
|
||||||
|
* A watcher keeps track of one child execution
|
||||||
|
*/
|
||||||
|
export class Watcher {
|
||||||
|
constructor(optionsArg) {
|
||||||
|
/**
|
||||||
|
* used to execute shell commands
|
||||||
|
*/
|
||||||
|
this.smartshellInstance = new plugins.smartshell.Smartshell({
|
||||||
|
executor: 'bash',
|
||||||
|
});
|
||||||
|
this.smartchokWatcher = new plugins.smartchok.Smartchok([], {});
|
||||||
|
this.options = optionsArg;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* start the file
|
||||||
|
*/
|
||||||
|
async start() {
|
||||||
|
await this.setupCleanup();
|
||||||
|
console.log(`Looking at ${this.options.filePathToWatch} for changes`);
|
||||||
|
this.smartchokWatcher.add([this.options.filePathToWatch]); // __dirname refers to the directory of this very file
|
||||||
|
await this.smartchokWatcher.start();
|
||||||
|
const changeObservable = await this.smartchokWatcher.getObservableFor('change');
|
||||||
|
changeObservable.subscribe(() => {
|
||||||
|
this.updateCurrentExecution();
|
||||||
|
});
|
||||||
|
await this.updateCurrentExecution();
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* updates the current execution
|
||||||
|
*/
|
||||||
|
async updateCurrentExecution() {
|
||||||
|
if (this.options.commandToExecute) {
|
||||||
|
if (this.currentExecution) {
|
||||||
|
logger.log('ok', `reexecuting ${this.options.commandToExecute}`);
|
||||||
|
this.currentExecution.kill();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
logger.log('ok', `executing ${this.options.commandToExecute} for the first time`);
|
||||||
|
}
|
||||||
|
this.currentExecution = await this.smartshellInstance.execStreaming(this.options.commandToExecute);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('no executionCommand set');
|
||||||
|
}
|
||||||
|
if (this.options.functionToCall) {
|
||||||
|
this.options.functionToCall();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
console.log('no functionToCall set.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* this method sets up a clean exit strategy
|
||||||
|
*/
|
||||||
|
async setupCleanup() {
|
||||||
|
process.on('exit', () => {
|
||||||
|
console.log('');
|
||||||
|
console.log('now exiting!');
|
||||||
|
this.stop();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
process.on('SIGINT', () => {
|
||||||
|
console.log('');
|
||||||
|
console.log('ok! got SIGINT We are exiting! Just cleaning up to exit neatly :)');
|
||||||
|
this.stop();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
// handle timeout
|
||||||
|
if (this.options.timeout) {
|
||||||
|
plugins.smartdelay.delayFor(this.options.timeout).then(() => {
|
||||||
|
console.log(`timed out afer ${this.options.timeout} milliseconds! exiting!`);
|
||||||
|
this.stop();
|
||||||
|
process.exit(0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* stops the watcher
|
||||||
|
*/
|
||||||
|
async stop() {
|
||||||
|
await this.smartchokWatcher.stop();
|
||||||
|
if (this.currentExecution && !this.currentExecution.childProcess.killed) {
|
||||||
|
this.currentExecution.kill();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5jbGFzc2VzLndhdGNoZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90c3dhdGNoLmNsYXNzZXMud2F0Y2hlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssT0FBTyxNQUFNLHNCQUFzQixDQUFDO0FBQ2hELE9BQU8sRUFBRSxNQUFNLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQVM5Qzs7R0FFRztBQUNILE1BQU0sT0FBTyxPQUFPO0lBWWxCLFlBQVksVUFBc0M7UUFYbEQ7O1dBRUc7UUFDSyx1QkFBa0IsR0FBRyxJQUFJLE9BQU8sQ0FBQyxVQUFVLENBQUMsVUFBVSxDQU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.cli.d.ts
vendored
Normal file
1
dist_ts/tswatch.cli.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export declare const runCli: () => Promise<void>;
|
35
dist_ts/tswatch.cli.js
Normal file
35
dist_ts/tswatch.cli.js
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
import './tswatch.paths.js';
|
||||||
|
import { logger } from './tswatch.logging.js';
|
||||||
|
import { TsWatch } from './tswatch.classes.tswatch.js';
|
||||||
|
const tswatchCli = new plugins.smartcli.Smartcli();
|
||||||
|
// standard behaviour will assume gitzone setup
|
||||||
|
tswatchCli.addCommand('element').subscribe(async (argvArg) => {
|
||||||
|
logger.log('info', `running watch task for a gitzone element project`);
|
||||||
|
const tsWatch = new TsWatch('gitzone_element');
|
||||||
|
await tsWatch.start();
|
||||||
|
});
|
||||||
|
tswatchCli.addCommand('npm').subscribe(async (argvArg) => {
|
||||||
|
logger.log('info', `running watch task for a gitzone element project`);
|
||||||
|
const tsWatch = new TsWatch('gitzone_npm');
|
||||||
|
await tsWatch.start();
|
||||||
|
});
|
||||||
|
tswatchCli.addCommand('service').subscribe(async (argvArg) => {
|
||||||
|
logger.log('info', `running test task`);
|
||||||
|
const tsWatch = new TsWatch('gitzone_service');
|
||||||
|
await tsWatch.start();
|
||||||
|
});
|
||||||
|
tswatchCli.addCommand('test').subscribe(async (argvArg) => {
|
||||||
|
logger.log('info', `running test task`);
|
||||||
|
const tsWatch = new TsWatch('test');
|
||||||
|
await tsWatch.start();
|
||||||
|
});
|
||||||
|
tswatchCli.addCommand('website').subscribe(async (argvArg) => {
|
||||||
|
logger.log('info', `running watch task for a gitzone website project`);
|
||||||
|
const tsWatch = new TsWatch('gitzone_website');
|
||||||
|
await tsWatch.start();
|
||||||
|
});
|
||||||
|
export const runCli = async () => {
|
||||||
|
tswatchCli.startParse();
|
||||||
|
};
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjoz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BQy9CLFVBQVUsQ0FBQyxVQUFVLEVBQUUsQ0FBQztBQUMxQixDQUFDLENBQUMifQ==
|
2
dist_ts/tswatch.logging.d.ts
vendored
Normal file
2
dist_ts/tswatch.logging.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
export declare const logger: plugins.smartlog.Smartlog;
|
14
dist_ts/tswatch.logging.js
Normal file
14
dist_ts/tswatch.logging.js
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
export const logger = new plugins.smartlog.Smartlog({
|
||||||
|
logContext: {
|
||||||
|
company: 'Some Company',
|
||||||
|
companyunit: 'Some CompanyUnit',
|
||||||
|
containerName: 'Some Containername',
|
||||||
|
environment: 'local',
|
||||||
|
runtime: 'node',
|
||||||
|
zone: 'gitzone',
|
||||||
|
},
|
||||||
|
minimumLogLevel: 'silly',
|
||||||
|
});
|
||||||
|
logger.addLogDestination(new plugins.smartlogDestinationLocal.DestinationLocal());
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5sb2dnaW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHN3YXRjaC5sb2dnaW5nLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sS0FBSyxPQUFPLE1BQU0sc0JBQXNCLENBQUM7QUFFaEQsTUFBTSxDQUFDLE1BQU0sTUFBTSxHQUFHLElBQUksT0FBTyxDQUFDLFFBQVEsQ0FBQyxRQUFRLENBQUM7SUFDbEQsVUFBVSxFQUFFO1FBQ1YsT0FBTyxFQUFFLGNBQWM7UUFDdkIsV0FBVyxFQUFFLGtCQUFrQjtRQUMvQixhQUFhLEVBQUUsb0JBQW9CO1FBQ25DLFdBQVcsRUFBRSxPQUFPO1FBQ3BCLE9BQU8sRUFBRSxNQUFNO1FBQ2YsSUFBSSxFQUFFLFNBQVM7S0FDaEI7SUFDRCxlQUFlLEVBQUUsT0FBTztDQUN6QixDQUFDLENBQUM7QUFFSCxNQUFNLENBQUMsaUJBQWlCLENBQUMsSUFBSSxPQUFPLENBQUMsd0JBQXdCLENBQUMsZ0JBQWdCLEVBQUUsQ0FBQyxDQUFDIn0=
|
1
dist_ts/tswatch.paths.d.ts
vendored
Normal file
1
dist_ts/tswatch.paths.d.ts
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
export declare const cwd: string;
|
3
dist_ts/tswatch.paths.js
Normal file
3
dist_ts/tswatch.paths.js
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
import './tswatch.plugins.js';
|
||||||
|
export const cwd = process.cwd();
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5wYXRocy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rzd2F0Y2gucGF0aHMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBeUIsc0JBQXNCLENBQUM7QUFFaEQsTUFBTSxDQUFDLE1BQU0sR0FBRyxHQUFHLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQyJ9
|
15
dist_ts/tswatch.plugins.d.ts
vendored
Normal file
15
dist_ts/tswatch.plugins.d.ts
vendored
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import * as path from 'path';
|
||||||
|
export { path };
|
||||||
|
import * as tsbundle from '@gitzone/tsbundle';
|
||||||
|
export { tsbundle };
|
||||||
|
import * as lik from '@pushrocks/lik';
|
||||||
|
import * as smartchok from '@pushrocks/smartchok';
|
||||||
|
import * as smartcli from '@pushrocks/smartcli';
|
||||||
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
|
import * as smartlog from '@pushrocks/smartlog';
|
||||||
|
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
||||||
|
import * as smartparcel from '@pushrocks/smartparcel';
|
||||||
|
import * as smartserve from '@pushrocks/smartserve';
|
||||||
|
import * as smartshell from '@pushrocks/smartshell';
|
||||||
|
import * as taskbuffer from '@pushrocks/taskbuffer';
|
||||||
|
export { lik, smartchok, smartcli, smartdelay, smartlog, smartlogDestinationLocal, smartparcel, smartserve, smartshell, taskbuffer, };
|
19
dist_ts/tswatch.plugins.js
Normal file
19
dist_ts/tswatch.plugins.js
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
// node native scope
|
||||||
|
import * as path from 'path';
|
||||||
|
export { path };
|
||||||
|
// @gitzone scope
|
||||||
|
import * as tsbundle from '@gitzone/tsbundle';
|
||||||
|
export { tsbundle };
|
||||||
|
// @pushrocks scope
|
||||||
|
import * as lik from '@pushrocks/lik';
|
||||||
|
import * as smartchok from '@pushrocks/smartchok';
|
||||||
|
import * as smartcli from '@pushrocks/smartcli';
|
||||||
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
|
import * as smartlog from '@pushrocks/smartlog';
|
||||||
|
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
||||||
|
import * as smartparcel from '@pushrocks/smartparcel';
|
||||||
|
import * as smartserve from '@pushrocks/smartserve';
|
||||||
|
import * as smartshell from '@pushrocks/smartshell';
|
||||||
|
import * as taskbuffer from '@pushrocks/taskbuffer';
|
||||||
|
export { lik, smartchok, smartcli, smartdelay, smartlog, smartlogDestinationLocal, smartparcel, smartserve, smartshell, taskbuffer, };
|
||||||
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHN3YXRjaC5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdHN3YXRjaC5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLG9CQUFvQjtBQUNwQixPQUFPLEtBQUssSUFBSSxNQUFNLE1BQU0sQ0FBQztBQUM3QixPQUFPLEVBQUUsSUFBSSxFQUFFLENBQUM7QUFFaEIsaUJBQWlCO0FBQ2pCLE9BQU8sS0FBSyxRQUFRLE1BQU0sbUJBQW1CLENBQUM7QUFDOUMsT0FBTyxFQUNMLFFBQVEsRUFDVCxDQUFBO0FBRUQsbUJBQW1CO0FBQ25CLE9BQU8sS0FBSyxHQUFHLE1BQU0sZ0JBQWdCLENBQUM7QUFDdEMsT0FBTyxLQUFLLFNBQVMsTUFBTSxzQkFBc0IsQ0FBQztBQUNsRCxPQUFPLEtBQUssUUFBUSxNQUFNLHFCQUFxQixDQUFDO0FBQ2hELE9BQU8sS0FBSyxVQUFVLE1BQU0sdUJBQXVCLENBQUM7QUFDcEQsT0FBTyxLQUFLLFFBQVEsTUFBTSxxQkFBcUIsQ0FBQztBQUNoRCxPQUFPLEtBQUssd0JBQXdCLE1BQU0sdUNBQXVDLENBQUM7QUFDbEYsT0FBTyxLQUFLLFdBQVcsTUFBTSx3QkFBd0IsQ0FBQztBQUN0RCxPQUFPLEtBQUssVUFBVSxNQUFNLHVCQUF1QixDQUFDO0FBQ3BELE9BQU8sS0FBSyxVQUFVLE1BQU0sdUJBQXVCLENBQUM7QUFDcEQsT0FBTyxLQUFLLFVBQVUsTUFBTSx1QkFBdUIsQ0FBQztBQUVwRCxPQUFPLEVBQ0wsR0FBRyxFQUNILFNBQVMsRUFDVCxRQUFRLEVBQ1IsVUFBVSxFQUNWLFFBQVEsRUFDUix3QkFBd0IsRUFDeEIsV0FBVyxFQUNYLFVBQVUsRUFDVixVQUFVLEVBQ1YsVUFBVSxHQUNYLENBQUMifQ==
|
@@ -4,6 +4,7 @@
|
|||||||
"npmAccessLevel": "public"
|
"npmAccessLevel": "public"
|
||||||
},
|
},
|
||||||
"gitzone": {
|
"gitzone": {
|
||||||
|
"projectType": "npm",
|
||||||
"module": {
|
"module": {
|
||||||
"githost": "gitlab.com",
|
"githost": "gitlab.com",
|
||||||
"gitscope": "gitzone",
|
"gitscope": "gitzone",
|
||||||
|
18478
package-lock.json
generated
18478
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
47
package.json
47
package.json
@@ -1,50 +1,53 @@
|
|||||||
{
|
{
|
||||||
"name": "@gitzone/tswatch",
|
"name": "@gitzone/tswatch",
|
||||||
"version": "1.0.32",
|
"version": "1.0.70",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "watch typescript projects during development",
|
"description": "watch typescript projects during development",
|
||||||
"main": "dist/index.js",
|
"main": "dist_ts/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist_ts/index.d.ts",
|
||||||
|
"type": "module",
|
||||||
"author": "Lossless GmbH",
|
"author": "Lossless GmbH",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"bin": {
|
"bin": {
|
||||||
"tswatch": "cli.js"
|
"tswatch": "cli.js"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild)"
|
"build": "(tsbuild --web --skiplibcheck --allowimplicitany)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.17",
|
"@gitzone/tsbuild": "^2.1.59",
|
||||||
"@gitzone/tstest": "^1.0.28",
|
"@gitzone/tstest": "^1.0.69",
|
||||||
"@pushrocks/tapbundle": "^3.2.0",
|
"@pushrocks/tapbundle": "^5.0.2",
|
||||||
"@types/node": "^13.9.0",
|
"@types/node": "^17.0.21"
|
||||||
"tslint": "^6.0.0",
|
|
||||||
"tslint-config-prettier": "^1.18.0"
|
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@gitzone/tsbundle": "^1.0.51",
|
"@gitzone/tsbundle": "^1.0.100",
|
||||||
"@gitzone/tsrun": "^1.2.8",
|
"@gitzone/tsrun": "^1.2.31",
|
||||||
"@pushrocks/early": "^3.0.3",
|
"@pushrocks/early": "^3.0.3",
|
||||||
"@pushrocks/lik": "^3.0.19",
|
"@pushrocks/lik": "^5.0.4",
|
||||||
"@pushrocks/smartchok": "^1.0.23",
|
"@pushrocks/smartchok": "^1.0.23",
|
||||||
"@pushrocks/smartcli": "^3.0.7",
|
"@pushrocks/smartcli": "^3.0.14",
|
||||||
"@pushrocks/smartdelay": "^2.0.6",
|
"@pushrocks/smartdelay": "^2.0.13",
|
||||||
"@pushrocks/smartlog": "^2.0.21",
|
"@pushrocks/smartlog": "^2.0.44",
|
||||||
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
"@pushrocks/smartlog-destination-local": "^8.0.8",
|
||||||
"@pushrocks/smartserve": "^1.1.39",
|
"@pushrocks/smartserve": "^2.0.2",
|
||||||
"@pushrocks/smartshell": "^2.0.25",
|
"@pushrocks/smartshell": "^2.0.30",
|
||||||
"@pushrocks/taskbuffer": "^2.1.1"
|
"@pushrocks/taskbuffer": "^2.1.17"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
"ts_web/**/*",
|
"ts_web/**/*",
|
||||||
"dist/**/*",
|
"dist/**/*",
|
||||||
"dist_web/**/*",
|
"dist_*/**/*",
|
||||||
|
"dist_ts/**/*",
|
||||||
"dist_ts_web/**/*",
|
"dist_ts_web/**/*",
|
||||||
"assets/**/*",
|
"assets/**/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
"readme.md"
|
"readme.md"
|
||||||
|
],
|
||||||
|
"browserslist": [
|
||||||
|
"last 1 chrome versions"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
27
readme.md
27
readme.md
@@ -8,16 +8,29 @@ 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
|
||||||
[](https://gitlab.com/gitzone/tswatch/commits/master)
|
|
||||||
[](https://gitlab.com/gitzone/tswatch/commits/master)
|
Status Category | Status Badge
|
||||||
[](https://www.npmjs.com/package/@gitzone/tswatch)
|
-- | --
|
||||||
[](https://snyk.io/test/npm/@gitzone/tswatch)
|
GitLab Pipelines | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
GitLab Pipline Test Coverage | [](https://lossless.cloud)
|
||||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
npm | [](https://lossless.cloud)
|
||||||
[](https://prettier.io/)
|
Snyk | [](https://lossless.cloud)
|
||||||
|
TypeScript Support | [](https://lossless.cloud)
|
||||||
|
node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
|
Code Style | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
|
||||||
|
PackagePhobia (package size on registry) | [](https://lossless.cloud)
|
||||||
|
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
|
||||||
|
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
|
Use TypeScript for best in class intellisense
|
||||||
|
|
||||||
|
## Contribution
|
||||||
|
|
||||||
|
We are always happy for code contributions. If you are not the code contributing type that is ok. Still, maintaining Open Source repositories takes considerable time and thought. If you like the quality of what we do and our modules are useful to you we would appreciate a little monthly contribution: You can [contribute one time](https://lossless.link/contribute-onetime) or [contribute monthly](https://lossless.link/contribute). :)
|
||||||
|
|
||||||
For further information read the linked docs at the top of this readme.
|
For further information read the linked docs at the top of this readme.
|
||||||
|
|
||||||
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
// tslint:disable-next-line: no-implicit-dependencies
|
// tslint:disable-next-line: no-implicit-dependencies
|
||||||
import { expect, tap } from '@pushrocks/tapbundle';
|
import { expect, expectAsync, tap } from '@pushrocks/tapbundle';
|
||||||
import * as tswatch from '../ts/index';
|
import * as tswatch from '../ts/index.js';
|
||||||
|
|
||||||
let testTsWatchInstance: tswatch.TsWatch;
|
let testTsWatchInstance: tswatch.TsWatch;
|
||||||
|
|
||||||
@@ -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();
|
||||||
});
|
});
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import * as early from '@pushrocks/early';
|
import * as early from '@pushrocks/early';
|
||||||
early.start('tswatch');
|
early.start('tswatch');
|
||||||
export * from './tswatch.classes.tswatch';
|
export * from './tswatch.classes.tswatch.js';
|
||||||
import './tswatch.cli';
|
export * from './tswatch.cli.js';
|
||||||
early.stop();
|
early.stop();
|
||||||
|
@@ -1 +1 @@
|
|||||||
export * from './interfaces.watchmodes';
|
export * from './interfaces.watchmodes.js';
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
import * as plugins from './tswatch.plugins';
|
import * as plugins from './tswatch.plugins.js';
|
||||||
import * as paths from './tswatch.paths';
|
import * as paths from './tswatch.paths.js';
|
||||||
import * as interfaces from './interfaces';
|
import * as interfaces from './interfaces/index.js';
|
||||||
|
|
||||||
import { Watcher } from './tswatch.classes.watcher';
|
import { Watcher } from './tswatch.classes.watcher.js';
|
||||||
|
|
||||||
export class TsWatch {
|
export class TsWatch {
|
||||||
public watchmode: interfaces.TWatchModes;
|
public watchmode: interfaces.TWatchModes;
|
||||||
public watcherMap = new plugins.lik.Objectmap<Watcher>();
|
public watcherMap = new plugins.lik.ObjectMap<Watcher>();
|
||||||
public smartserve: plugins.smartserve.SmartServe;
|
public smartserve: plugins.smartserve.SmartServe;
|
||||||
|
|
||||||
constructor(watchmodeArg: interfaces.TWatchModes) {
|
constructor(watchmodeArg: interfaces.TWatchModes) {
|
||||||
@@ -17,13 +17,15 @@ export class TsWatch {
|
|||||||
* starts the TsWatch instance
|
* starts the TsWatch instance
|
||||||
*/
|
*/
|
||||||
public async start() {
|
public async start() {
|
||||||
|
const tsbundle = new plugins.tsbundle.TsBundle();
|
||||||
|
const htmlHandler = new plugins.tsbundle.HtmlHandler();
|
||||||
switch (this.watchmode) {
|
switch (this.watchmode) {
|
||||||
case 'test':
|
case 'test':
|
||||||
this.watcherMap.add(
|
this.watcherMap.add(
|
||||||
new Watcher({
|
new Watcher({
|
||||||
filePathToWatch: paths.cwd,
|
filePathToWatch: paths.cwd,
|
||||||
commandToExecute: 'npm run test2',
|
commandToExecute: 'npm run test2',
|
||||||
timeout: null
|
timeout: null,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -32,55 +34,119 @@ export class TsWatch {
|
|||||||
new Watcher({
|
new Watcher({
|
||||||
filePathToWatch: paths.cwd,
|
filePathToWatch: paths.cwd,
|
||||||
commandToExecute: 'npm run test',
|
commandToExecute: 'npm run test',
|
||||||
timeout: null
|
timeout: null,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
case 'gitzone_element':
|
case 'gitzone_element':
|
||||||
// lets create a standard server
|
// lets create a standard server
|
||||||
console.log('bundling TypeScript files to "dist_watch" Note: This is for development only!');
|
console.log(
|
||||||
this.smartserve = new plugins.smartserve.SmartServe({
|
'bundling TypeScript files to "dist_watch" Note: This is for development only!'
|
||||||
port: 3001,
|
);
|
||||||
|
const smartserve = new plugins.smartserve.SmartServe({
|
||||||
injectReload: true,
|
injectReload: true,
|
||||||
serveDir: plugins.path.join(paths.cwd, './dist_watch/')
|
serveDir: plugins.path.join(paths.cwd, './dist_watch/'),
|
||||||
|
port: 3002,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const bundleAndReload = async () => {
|
||||||
|
await tsbundle.build(paths.cwd, './html/index.ts', './dist_watch/bundle.js', {
|
||||||
|
bundler: 'esbuild'
|
||||||
|
});
|
||||||
|
await smartserve.reload();
|
||||||
|
}
|
||||||
this.watcherMap.add(
|
this.watcherMap.add(
|
||||||
new Watcher({
|
new Watcher({
|
||||||
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
||||||
commandToExecute: async () => {
|
functionToCall: async () => {
|
||||||
const tsbundle = new plugins.tsbundle.TsBundle();
|
await bundleAndReload();
|
||||||
const htmlHandler = new plugins.tsbundle.HtmlHandler();
|
|
||||||
await tsbundle.buildTest('./ts_web/index.ts', './dist_watch/bundle.js');
|
|
||||||
await htmlHandler.copyHtml(plugins.path.join(process.cwd(), './dist_watch/index.html'));
|
|
||||||
},
|
},
|
||||||
timeout: null
|
timeout: null,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
this.watcherMap.add(
|
||||||
|
new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './html/'),
|
||||||
|
functionToCall: async () => {
|
||||||
|
await htmlHandler.copyHtml(
|
||||||
|
plugins.path.join(
|
||||||
|
paths.cwd,
|
||||||
|
'./html/index.html'
|
||||||
|
),
|
||||||
|
plugins.path.join(
|
||||||
|
paths.cwd,
|
||||||
|
'./dist_watch/index.html'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
await bundleAndReload();
|
||||||
|
},
|
||||||
|
timeout: null,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
await smartserve.start();
|
||||||
|
/* const parcel = new plugins.smartparcel.Parcel(
|
||||||
|
plugins.path.join(process.cwd(), './html/index.html'),
|
||||||
|
plugins.path.join(process.cwd(), './dist_watch'),
|
||||||
|
'index.html'
|
||||||
|
);
|
||||||
|
await parcel.watchAndServe(); */
|
||||||
break;
|
break;
|
||||||
case 'gitzone_website':
|
case 'gitzone_website':
|
||||||
this.watcherMap.add(
|
this.watcherMap.add(
|
||||||
new Watcher({
|
new Watcher({
|
||||||
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||||
commandToExecute: 'npm run startTs',
|
commandToExecute: 'npm run startTs',
|
||||||
timeout: null
|
timeout: null,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
const bundleAndReload2 = async () => {
|
||||||
|
await tsbundle.build(paths.cwd, './ts_web/index.ts', './dist_serve/bundle.js', {
|
||||||
|
bundler: 'esbuild'
|
||||||
|
});
|
||||||
|
}
|
||||||
|
this.watcherMap.add(
|
||||||
|
new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
||||||
|
functionToCall: async () => {
|
||||||
|
await bundleAndReload2();
|
||||||
|
},
|
||||||
|
timeout: null,
|
||||||
|
})
|
||||||
|
);
|
||||||
|
this.watcherMap.add(
|
||||||
|
new Watcher({
|
||||||
|
filePathToWatch: plugins.path.join(paths.cwd, './html/'),
|
||||||
|
functionToCall: async () => {
|
||||||
|
await htmlHandler.copyHtml(
|
||||||
|
plugins.path.join(
|
||||||
|
paths.cwd,
|
||||||
|
'./html/index.html'
|
||||||
|
),
|
||||||
|
plugins.path.join(
|
||||||
|
paths.cwd,
|
||||||
|
'./dist_watch/index.html'
|
||||||
|
)
|
||||||
|
);
|
||||||
|
await bundleAndReload();
|
||||||
|
},
|
||||||
|
timeout: null,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
// client directory
|
// client directory
|
||||||
this.watcherMap.add(
|
/* const parcelWebsite = new plugins.smartparcel.Parcel(
|
||||||
new Watcher({
|
plugins.path.join(process.cwd(), './html/index.html'),
|
||||||
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
plugins.path.join(process.cwd(), './dist_serve'),
|
||||||
commandToExecute: 'npm run build',
|
'bundle.js'
|
||||||
timeout: null
|
|
||||||
})
|
|
||||||
);
|
);
|
||||||
|
await parcelWebsite.watchAndServe(); */
|
||||||
break;
|
break;
|
||||||
case 'gitzone_service':
|
case 'gitzone_service':
|
||||||
this.watcherMap.add(
|
this.watcherMap.add(
|
||||||
new Watcher({
|
new Watcher({
|
||||||
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||||
commandToExecute: 'npm run startTs',
|
commandToExecute: 'npm run startTs',
|
||||||
timeout: null
|
timeout: null,
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
@@ -88,18 +154,17 @@ export class TsWatch {
|
|||||||
const tsWatchInstanceEchoSomething = new Watcher({
|
const tsWatchInstanceEchoSomething = new Watcher({
|
||||||
filePathToWatch: plugins.path.join(paths.cwd, './ts'),
|
filePathToWatch: plugins.path.join(paths.cwd, './ts'),
|
||||||
commandToExecute: 'npm -v',
|
commandToExecute: 'npm -v',
|
||||||
timeout: null
|
timeout: null,
|
||||||
});
|
});
|
||||||
this.watcherMap.add(tsWatchInstanceEchoSomething);
|
this.watcherMap.add(tsWatchInstanceEchoSomething);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
this.watcherMap.forEach(async watcher => {
|
this.watcherMap.forEach(async (watcher) => {
|
||||||
await watcher.start();
|
await watcher.start();
|
||||||
});
|
});
|
||||||
if (this.smartserve) {
|
if (this.smartserve) {
|
||||||
|
|
||||||
await this.smartserve.start();
|
await this.smartserve.start();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -111,7 +176,7 @@ export class TsWatch {
|
|||||||
if (this.smartserve) {
|
if (this.smartserve) {
|
||||||
await this.smartserve.stop();
|
await this.smartserve.stop();
|
||||||
}
|
}
|
||||||
this.watcherMap.forEach(async watcher => {
|
this.watcherMap.forEach(async (watcher) => {
|
||||||
await watcher.stop();
|
await watcher.stop();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@@ -1,11 +1,10 @@
|
|||||||
import * as plugins from './tswatch.plugins';
|
import * as plugins from './tswatch.plugins.js';
|
||||||
import { logger } from './tswatch.logging';
|
import { logger } from './tswatch.logging.js';
|
||||||
|
|
||||||
export type TCommandFunction = () => Promise<void>;
|
|
||||||
|
|
||||||
export interface IWatcherConstructorOptions {
|
export interface IWatcherConstructorOptions {
|
||||||
filePathToWatch: string;
|
filePathToWatch: string;
|
||||||
commandToExecute: string | TCommandFunction;
|
commandToExecute?: string;
|
||||||
|
functionToCall?: () => Promise<any>;
|
||||||
timeout?: number;
|
timeout?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -17,22 +16,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',
|
||||||
});
|
|
||||||
|
|
||||||
/**
|
|
||||||
* used to execute
|
|
||||||
*/
|
|
||||||
private executionTask: plugins.taskbuffer.Task = new plugins.taskbuffer.Task({
|
|
||||||
name: 'watcherCommandFunctionTask',
|
|
||||||
taskFunction: async () => {
|
|
||||||
if (typeof this.options.commandToExecute === 'string') {
|
|
||||||
throw new Error('cannot execute string as task');
|
|
||||||
}
|
|
||||||
await this.options.commandToExecute();
|
|
||||||
},
|
|
||||||
buffered: true,
|
|
||||||
bufferMax: 1
|
|
||||||
});
|
});
|
||||||
|
|
||||||
private currentExecution: plugins.smartshell.IExecResultStreaming;
|
private currentExecution: plugins.smartshell.IExecResultStreaming;
|
||||||
@@ -62,19 +46,23 @@ export class Watcher {
|
|||||||
* updates the current execution
|
* updates the current execution
|
||||||
*/
|
*/
|
||||||
private async updateCurrentExecution() {
|
private async updateCurrentExecution() {
|
||||||
if (typeof this.options.commandToExecute === 'string') {
|
if (this.options.commandToExecute) {
|
||||||
if (this.currentExecution) {
|
if (this.currentExecution) {
|
||||||
logger.log('ok', `reexecuting ${this.options.commandToExecute}`);
|
logger.log('ok', `reexecuting ${this.options.commandToExecute}`);
|
||||||
process.kill(-this.currentExecution.childProcess.pid);
|
this.currentExecution.kill();
|
||||||
} else {
|
} else {
|
||||||
logger.log('ok', `executing ${this.options.commandToExecute} for the first time`);
|
logger.log('ok', `executing ${this.options.commandToExecute} for the first time`);
|
||||||
}
|
}
|
||||||
this.currentExecution = await this.smartshellInstance.execStreaming(
|
this.currentExecution = await this.smartshellInstance.execStreaming(
|
||||||
this.options.commandToExecute
|
this.options.commandToExecute
|
||||||
);
|
);
|
||||||
this.currentExecution = null;
|
|
||||||
} else {
|
} else {
|
||||||
await this.executionTask.trigger();
|
console.log('no executionCommand set');
|
||||||
|
}
|
||||||
|
if (this.options.functionToCall) {
|
||||||
|
this.options.functionToCall();
|
||||||
|
} else {
|
||||||
|
console.log('no functionToCall set.')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -82,21 +70,16 @@ export class Watcher {
|
|||||||
* this method sets up a clean exit strategy
|
* this method sets up a clean exit strategy
|
||||||
*/
|
*/
|
||||||
private async setupCleanup() {
|
private async setupCleanup() {
|
||||||
const cleanup = () => {
|
|
||||||
if (this.currentExecution) {
|
|
||||||
process.kill(-this.currentExecution.childProcess.pid);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
process.on('exit', () => {
|
process.on('exit', () => {
|
||||||
console.log('');
|
console.log('');
|
||||||
console.log('now exiting!');
|
console.log('now exiting!');
|
||||||
cleanup();
|
this.stop();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
process.on('SIGINT', () => {
|
process.on('SIGINT', () => {
|
||||||
console.log('');
|
console.log('');
|
||||||
console.log('ok! got SIGINT We are exiting! Just cleaning up to exit neatly :)');
|
console.log('ok! got SIGINT We are exiting! Just cleaning up to exit neatly :)');
|
||||||
cleanup();
|
this.stop();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -104,7 +87,7 @@ export class Watcher {
|
|||||||
if (this.options.timeout) {
|
if (this.options.timeout) {
|
||||||
plugins.smartdelay.delayFor(this.options.timeout).then(() => {
|
plugins.smartdelay.delayFor(this.options.timeout).then(() => {
|
||||||
console.log(`timed out afer ${this.options.timeout} milliseconds! exiting!`);
|
console.log(`timed out afer ${this.options.timeout} milliseconds! exiting!`);
|
||||||
cleanup();
|
this.stop();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -116,7 +99,7 @@ export class Watcher {
|
|||||||
public async stop() {
|
public async stop() {
|
||||||
await this.smartchokWatcher.stop();
|
await this.smartchokWatcher.stop();
|
||||||
if (this.currentExecution && !this.currentExecution.childProcess.killed) {
|
if (this.currentExecution && !this.currentExecution.childProcess.killed) {
|
||||||
process.kill(-this.currentExecution.childProcess.pid);
|
this.currentExecution.kill();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,41 +1,43 @@
|
|||||||
import * as plugins from './tswatch.plugins';
|
import * as plugins from './tswatch.plugins.js';
|
||||||
import * as paths from './tswatch.paths';
|
import * as paths from './tswatch.paths.js';
|
||||||
import { logger } from './tswatch.logging';
|
import { logger } from './tswatch.logging.js';
|
||||||
|
|
||||||
import { TsWatch } from './tswatch.classes.tswatch';
|
import { TsWatch } from './tswatch.classes.tswatch.js';
|
||||||
|
|
||||||
const tswatchCli = new plugins.smartcli.Smartcli();
|
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();
|
||||||
});
|
});
|
||||||
|
|
||||||
tswatchCli.startParse();
|
export const runCli = async () => {
|
||||||
|
tswatchCli.startParse();
|
||||||
|
};
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
import * as plugins from './tswatch.plugins';
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
|
||||||
export const logger = new plugins.smartlog.Smartlog({
|
export const logger = new plugins.smartlog.Smartlog({
|
||||||
logContext: {
|
logContext: {
|
||||||
@@ -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());
|
||||||
|
@@ -1,3 +1,3 @@
|
|||||||
import * as plugins from './tswatch.plugins';
|
import * as plugins from './tswatch.plugins.js';
|
||||||
|
|
||||||
export const cwd = process.cwd();
|
export const cwd = process.cwd();
|
||||||
|
@@ -1,12 +1,12 @@
|
|||||||
|
// node native scope
|
||||||
import * as path from 'path';
|
import * as path from 'path';
|
||||||
export { path };
|
export { path };
|
||||||
|
|
||||||
// @gitzone scope
|
// @gitzone scope
|
||||||
import * as tsbundle from '@gitzone/tsbundle';
|
import * as tsbundle from '@gitzone/tsbundle';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
tsbundle
|
tsbundle
|
||||||
};
|
}
|
||||||
|
|
||||||
// @pushrocks scope
|
// @pushrocks scope
|
||||||
import * as lik from '@pushrocks/lik';
|
import * as lik from '@pushrocks/lik';
|
||||||
@@ -15,8 +15,20 @@ import * as smartcli from '@pushrocks/smartcli';
|
|||||||
import * as smartdelay from '@pushrocks/smartdelay';
|
import * as smartdelay from '@pushrocks/smartdelay';
|
||||||
import * as smartlog from '@pushrocks/smartlog';
|
import * as smartlog from '@pushrocks/smartlog';
|
||||||
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
import * as smartlogDestinationLocal from '@pushrocks/smartlog-destination-local';
|
||||||
|
import * as smartparcel from '@pushrocks/smartparcel';
|
||||||
import * as smartserve from '@pushrocks/smartserve';
|
import * as smartserve from '@pushrocks/smartserve';
|
||||||
import * as smartshell from '@pushrocks/smartshell';
|
import * as smartshell from '@pushrocks/smartshell';
|
||||||
import * as taskbuffer from '@pushrocks/taskbuffer';
|
import * as taskbuffer from '@pushrocks/taskbuffer';
|
||||||
|
|
||||||
export { lik, smartchok, smartcli, smartdelay, smartlog, smartlogDestinationLocal, smartserve, smartshell, taskbuffer };
|
export {
|
||||||
|
lik,
|
||||||
|
smartchok,
|
||||||
|
smartcli,
|
||||||
|
smartdelay,
|
||||||
|
smartlog,
|
||||||
|
smartlogDestinationLocal,
|
||||||
|
smartparcel,
|
||||||
|
smartserve,
|
||||||
|
smartshell,
|
||||||
|
taskbuffer,
|
||||||
|
};
|
||||||
|
17
tslint.json
17
tslint.json
@@ -1,17 +0,0 @@
|
|||||||
{
|
|
||||||
"extends": ["tslint:latest", "tslint-config-prettier"],
|
|
||||||
"rules": {
|
|
||||||
"semicolon": [true, "always"],
|
|
||||||
"no-console": false,
|
|
||||||
"ordered-imports": false,
|
|
||||||
"object-literal-sort-keys": false,
|
|
||||||
"member-ordering": {
|
|
||||||
"options":{
|
|
||||||
"order": [
|
|
||||||
"static-method"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"defaultSeverity": "warning"
|
|
||||||
}
|
|
Reference in New Issue
Block a user