Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
7b777ea1a9 | |||
faec3d38bc | |||
a2ff76dc78 | |||
7e973c906a |
54
.snyk
54
.snyk
@@ -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
3
cli.js
@@ -1,3 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
require('./dist/index');
|
||||
const cliTool = require('./dist_ts/index');
|
||||
cliTool.runCli();
|
||||
|
@@ -1,4 +1,5 @@
|
||||
#!/usr/bin/env node
|
||||
process.env.CLI_CALL = 'true';
|
||||
require('@gitzone/tsrun');
|
||||
require('./ts/index');
|
||||
const cliTool = require('./ts/index');
|
||||
cliTool.runCli();
|
||||
|
3571
package-lock.json
generated
3571
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
24
package.json
24
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@gitzone/tswatch",
|
||||
"version": "1.0.45",
|
||||
"version": "1.0.47",
|
||||
"private": false,
|
||||
"description": "watch typescript projects during development",
|
||||
"main": "dist_ts/index.js",
|
||||
@@ -11,27 +11,27 @@
|
||||
"tswatch": "cli.js"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "(tstest test/)",
|
||||
"build": "(tsbuild)"
|
||||
"test": "(tstest test/ --web)",
|
||||
"build": "(tsbuild --web)"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@gitzone/tsbuild": "^2.1.24",
|
||||
"@gitzone/tstest": "^1.0.28",
|
||||
"@gitzone/tstest": "^1.0.33",
|
||||
"@pushrocks/tapbundle": "^3.2.1",
|
||||
"@types/node": "^14.0.5",
|
||||
"@types/node": "^14.0.14",
|
||||
"tslint": "^6.1.2",
|
||||
"tslint-config-prettier": "^1.18.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@gitzone/tsrun": "^1.2.8",
|
||||
"@gitzone/tsrun": "^1.2.12",
|
||||
"@pushrocks/early": "^3.0.3",
|
||||
"@pushrocks/lik": "^4.0.0",
|
||||
"@pushrocks/lik": "^4.0.13",
|
||||
"@pushrocks/smartchok": "^1.0.23",
|
||||
"@pushrocks/smartcli": "^3.0.11",
|
||||
"@pushrocks/smartdelay": "^2.0.6",
|
||||
"@pushrocks/smartlog": "^2.0.21",
|
||||
"@pushrocks/smartlog-destination-local": "^8.0.2",
|
||||
"@pushrocks/smartserve": "^1.1.39",
|
||||
"@pushrocks/smartcli": "^3.0.12",
|
||||
"@pushrocks/smartdelay": "^2.0.9",
|
||||
"@pushrocks/smartlog": "^2.0.35",
|
||||
"@pushrocks/smartlog-destination-local": "^8.0.8",
|
||||
"@pushrocks/smartserve": "^1.1.41",
|
||||
"@pushrocks/smartshell": "^2.0.26",
|
||||
"@pushrocks/taskbuffer": "^2.1.1",
|
||||
"@types/parcel-bundler": "^1.12.1",
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import * as early from '@pushrocks/early';
|
||||
early.start('tswatch');
|
||||
export * from './tswatch.classes.tswatch';
|
||||
import './tswatch.cli';
|
||||
export * from './tswatch.cli';
|
||||
early.stop();
|
||||
|
@@ -2,12 +2,8 @@ import * as plugins from './tswatch.plugins';
|
||||
import * as paths from './tswatch.paths';
|
||||
|
||||
export class Parcel {
|
||||
public async start() {
|
||||
const entryFiles = plugins.path.join(paths.cwd, './html/index.html');
|
||||
|
||||
// Bundler options
|
||||
const options: plugins.parcel.ParcelOptions = {
|
||||
outDir: './dist_watch', // The out directory to put the build files in, defaults to dist
|
||||
private defaultOptions: plugins.parcel.ParcelOptions = {
|
||||
outDir: plugins.path.join(process.cwd(), './dist_watch'), // The out directory to put the build files in, defaults to dist
|
||||
outFile: 'index.html', // The name of the outputFile
|
||||
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'
|
||||
@@ -27,11 +23,23 @@ export class Parcel {
|
||||
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
|
||||
};
|
||||
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
|
||||
// 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);
|
||||
}
|
||||
|
||||
constructor(fromArg: string | string[], outputDirArg: string, outputFileArg: string) {
|
||||
this.entryFiles = fromArg;
|
||||
this.options = {
|
||||
...this.defaultOptions,
|
||||
outDir: outputDirArg,
|
||||
outFile: outputFileArg
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@@ -24,7 +24,7 @@ export class TsWatch {
|
||||
new Watcher({
|
||||
filePathToWatch: paths.cwd,
|
||||
commandToExecute: 'npm run test2',
|
||||
timeout: null
|
||||
timeout: null,
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -33,7 +33,7 @@ export class TsWatch {
|
||||
new Watcher({
|
||||
filePathToWatch: paths.cwd,
|
||||
commandToExecute: 'npm run test',
|
||||
timeout: null
|
||||
timeout: null,
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -42,7 +42,11 @@ export class TsWatch {
|
||||
console.log(
|
||||
'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();
|
||||
break;
|
||||
case 'gitzone_website':
|
||||
@@ -50,25 +54,23 @@ export class TsWatch {
|
||||
new Watcher({
|
||||
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||
commandToExecute: 'npm run startTs',
|
||||
timeout: null
|
||||
timeout: null,
|
||||
})
|
||||
);
|
||||
|
||||
// client directory
|
||||
this.watcherMap.add(
|
||||
new Watcher({
|
||||
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
|
||||
commandToExecute: 'npm run build',
|
||||
timeout: null
|
||||
})
|
||||
const parcelWebsite = new Parcel(
|
||||
plugins.path.join(process.cwd(), './ts_web/index.ts'),
|
||||
plugins.path.join(process.cwd(), './dist_serve'),
|
||||
'bundle.js'
|
||||
);
|
||||
break;
|
||||
await parcelWebsite.start();
|
||||
case 'gitzone_service':
|
||||
this.watcherMap.add(
|
||||
new Watcher({
|
||||
filePathToWatch: plugins.path.join(paths.cwd, './ts/'),
|
||||
commandToExecute: 'npm run startTs',
|
||||
timeout: null
|
||||
timeout: null,
|
||||
})
|
||||
);
|
||||
break;
|
||||
@@ -76,14 +78,14 @@ export class TsWatch {
|
||||
const tsWatchInstanceEchoSomething = new Watcher({
|
||||
filePathToWatch: plugins.path.join(paths.cwd, './ts'),
|
||||
commandToExecute: 'npm -v',
|
||||
timeout: null
|
||||
timeout: null,
|
||||
});
|
||||
this.watcherMap.add(tsWatchInstanceEchoSomething);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
this.watcherMap.forEach(async watcher => {
|
||||
this.watcherMap.forEach(async (watcher) => {
|
||||
await watcher.start();
|
||||
});
|
||||
if (this.smartserve) {
|
||||
@@ -98,7 +100,7 @@ export class TsWatch {
|
||||
if (this.smartserve) {
|
||||
await this.smartserve.stop();
|
||||
}
|
||||
this.watcherMap.forEach(async watcher => {
|
||||
this.watcherMap.forEach(async (watcher) => {
|
||||
await watcher.stop();
|
||||
});
|
||||
}
|
||||
|
@@ -38,4 +38,6 @@ tswatchCli.addCommand('website').subscribe(async argvArg => {
|
||||
await tsWatch.start();
|
||||
});
|
||||
|
||||
tswatchCli.startParse();
|
||||
export const runCli = async () => {
|
||||
tswatchCli.startParse();
|
||||
};
|
||||
|
Reference in New Issue
Block a user