Compare commits

...

8 Commits

Author SHA1 Message Date
7b777ea1a9 1.0.47 2020-07-04 10:35:16 +00:00
faec3d38bc fix(core): update 2020-07-04 10:35:16 +00:00
a2ff76dc78 1.0.46 2020-05-22 08:15:00 +00:00
7e973c906a fix(core): update 2020-05-22 08:14:59 +00:00
6c109cb381 1.0.45 2020-05-22 07:59:06 +00:00
2266813faf fix(core): update 2020-05-22 07:59:05 +00:00
bf7a2c9146 1.0.44 2020-05-22 07:58:02 +00:00
1a4ada879d fix(core): update 2020-05-22 07:58:01 +00:00
12 changed files with 2559 additions and 1233 deletions

4
.gitignore vendored
View File

@@ -15,8 +15,6 @@ node_modules/
# builds # builds
dist/ dist/
dist_web/ dist_*/
dist_serve/
dist_ts_web/
# custom # custom

View File

@@ -24,6 +24,19 @@ mirror:
- docker - docker
- notpriv - notpriv
audit:
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
tags:
- lossless
- docker
- notpriv
# ==================== # ====================
# test stage # test stage
# ==================== # ====================

54
.snyk
View File

@@ -1,54 +0,0 @@
# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities.
version: v1.13.5
# ignores vulnerabilities until expiry date; change duration by modifying expiry date
ignore:
SNYK-JS-MINIMIST-559764:
- parcel-bundler > @babel/core > json5 > minimist:
reason: None given
expires: '2020-04-12T17:46:49.672Z'
- parcel-bundler > mkdirp > minimist:
reason: None given
expires: '2020-04-12T17:46:49.672Z'
- parcel-bundler > @parcel/fs > mkdirp > minimist:
reason: None given
expires: '2020-04-12T17:46:49.672Z'
- parcel-bundler > htmlnano > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T17:46:49.672Z'
- parcel-bundler > cssnano > cssnano-preset-default > postcss-svgo > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T17:46:49.672Z'
- parcel-bundler > htmlnano > cssnano > cssnano-preset-default > postcss-svgo > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T17:46:49.672Z'
- parcel-bundler > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:01:44.139Z'
- parcel-bundler > @parcel/fs > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:01:44.139Z'
- parcel-bundler > htmlnano > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:01:44.139Z'
- parcel-bundler > cssnano > cssnano-preset-default > postcss-svgo > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:01:44.139Z'
- parcel-bundler > htmlnano > cssnano > cssnano-preset-default > postcss-svgo > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:01:44.139Z'
- parcel-bundler > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:07:10.923Z'
- parcel-bundler > @parcel/fs > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:07:10.923Z'
- parcel-bundler > htmlnano > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:07:10.923Z'
- parcel-bundler > cssnano > cssnano-preset-default > postcss-svgo > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:07:10.923Z'
- parcel-bundler > htmlnano > cssnano > cssnano-preset-default > postcss-svgo > svgo > mkdirp > minimist:
reason: None given
expires: '2020-04-12T18:07:10.923Z'
patch: {}

3
cli.js
View File

@@ -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 = require('./dist_ts/index');
cliTool.runCli();

View File

@@ -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('@gitzone/tsrun');
require('./ts/index'); const cliTool = require('./ts/index');
cliTool.runCli();

3571
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,37 +1,37 @@
{ {
"name": "@gitzone/tswatch", "name": "@gitzone/tswatch",
"version": "1.0.43", "version": "1.0.47",
"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",
"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)"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.24", "@gitzone/tsbuild": "^2.1.24",
"@gitzone/tstest": "^1.0.28", "@gitzone/tstest": "^1.0.33",
"@pushrocks/tapbundle": "^3.2.1", "@pushrocks/tapbundle": "^3.2.1",
"@types/node": "^14.0.5", "@types/node": "^14.0.14",
"tslint": "^6.1.2", "tslint": "^6.1.2",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@gitzone/tsrun": "^1.2.8", "@gitzone/tsrun": "^1.2.12",
"@pushrocks/early": "^3.0.3", "@pushrocks/early": "^3.0.3",
"@pushrocks/lik": "^4.0.0", "@pushrocks/lik": "^4.0.13",
"@pushrocks/smartchok": "^1.0.23", "@pushrocks/smartchok": "^1.0.23",
"@pushrocks/smartcli": "^3.0.11", "@pushrocks/smartcli": "^3.0.12",
"@pushrocks/smartdelay": "^2.0.6", "@pushrocks/smartdelay": "^2.0.9",
"@pushrocks/smartlog": "^2.0.21", "@pushrocks/smartlog": "^2.0.35",
"@pushrocks/smartlog-destination-local": "^8.0.2", "@pushrocks/smartlog-destination-local": "^8.0.8",
"@pushrocks/smartserve": "^1.1.39", "@pushrocks/smartserve": "^1.1.41",
"@pushrocks/smartshell": "^2.0.26", "@pushrocks/smartshell": "^2.0.26",
"@pushrocks/taskbuffer": "^2.1.1", "@pushrocks/taskbuffer": "^2.1.1",
"@types/parcel-bundler": "^1.12.1", "@types/parcel-bundler": "^1.12.1",
@@ -41,7 +41,8 @@
"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",

View File

@@ -18,6 +18,7 @@ watch typescript projects during development
## Usage ## Usage
Use TypeScript for best in class intellisense
## Contribution ## Contribution

View File

@@ -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';
import './tswatch.cli'; export * from './tswatch.cli';
early.stop(); early.stop();

View File

@@ -2,12 +2,8 @@ import * as plugins from './tswatch.plugins';
import * as paths from './tswatch.paths'; import * as paths from './tswatch.paths';
export class Parcel { export class Parcel {
public async start() { private defaultOptions: plugins.parcel.ParcelOptions = {
const entryFiles = plugins.path.join(paths.cwd, './html/index.html'); outDir: plugins.path.join(process.cwd(), './dist_watch'), // The out directory to put the build files in, defaults to dist
// Bundler options
const options: plugins.parcel.ParcelOptions = {
outDir: './dist_watch', // The out directory to put the build files in, defaults to dist
outFile: 'index.html', // The name of the outputFile outFile: 'index.html', // The name of the outputFile
publicUrl: '/', // The url to serve on, defaults to '/' publicUrl: '/', // The url to serve on, defaults to '/'
watch: true, // Whether to watch the files and rebuild them on change, defaults to process.env.NODE_ENV !== 'production' watch: true, // Whether to watch the files and rebuild them on change, defaults to process.env.NODE_ENV !== 'production'
@@ -27,11 +23,23 @@ export class Parcel {
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 entryFiles: string | string [] = plugins.path.join(paths.cwd, './html/index.html');
const bundler = new plugins.parcel(entryFiles, options); public async start() {
const bundler = new plugins.parcel(this.entryFiles, this.options);
// Run the bundler, this returns the main bundle // 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 // 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); const bundle = await bundler.serve(3002);
} }
constructor(fromArg: string | string[], outputDirArg: string, outputFileArg: string) {
this.entryFiles = fromArg;
this.options = {
...this.defaultOptions,
outDir: outputDirArg,
outFile: outputFileArg
};
}
} }

View File

@@ -24,7 +24,7 @@ export class TsWatch {
new Watcher({ new Watcher({
filePathToWatch: paths.cwd, filePathToWatch: paths.cwd,
commandToExecute: 'npm run test2', commandToExecute: 'npm run test2',
timeout: null timeout: null,
}) })
); );
break; break;
@@ -33,7 +33,7 @@ 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;
@@ -42,7 +42,11 @@ export class TsWatch {
console.log( console.log(
'bundling TypeScript files to "dist_watch" Note: This is for development only!' 'bundling TypeScript files to "dist_watch" Note: This is for development only!'
); );
const parcel = new Parcel(); const parcel = new Parcel(
plugins.path.join(process.cwd(), './html/index.html'),
plugins.path.join(process.cwd(), './dist_watch'),
'index.html'
);
await parcel.start(); await parcel.start();
break; break;
case 'gitzone_website': case 'gitzone_website':
@@ -50,25 +54,23 @@ export class TsWatch {
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,
}) })
); );
// client directory // client directory
this.watcherMap.add( const parcelWebsite = new Parcel(
new Watcher({ plugins.path.join(process.cwd(), './ts_web/index.ts'),
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'), plugins.path.join(process.cwd(), './dist_serve'),
commandToExecute: 'npm run build', 'bundle.js'
timeout: null
})
); );
break; await parcelWebsite.start();
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;
@@ -76,14 +78,14 @@ 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) {
@@ -98,7 +100,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();
}); });
} }

View File

@@ -38,4 +38,6 @@ tswatchCli.addCommand('website').subscribe(async argvArg => {
await tsWatch.start(); await tsWatch.start();
}); });
tswatchCli.startParse(); export const runCli = async () => {
tswatchCli.startParse();
};