Compare commits

...

16 Commits

Author SHA1 Message Date
408b6f8fc5 1.0.39 2020-03-13 18:44:22 +00:00
80dd3ee970 fix(core): update 2020-03-13 18:44:21 +00:00
717e1d29ed 1.0.38 2020-03-13 18:19:01 +00:00
a8254e6962 fix(core): update 2020-03-13 18:19:00 +00:00
35ee69981d 1.0.37 2020-03-13 18:07:45 +00:00
bd66e9a897 fix(core): update 2020-03-13 18:07:45 +00:00
fc356e62f4 1.0.36 2020-03-13 17:48:20 +00:00
a34d98b840 fix(core): update 2020-03-13 17:48:19 +00:00
9525f28507 1.0.35 2020-03-13 17:46:58 +00:00
787aae63d7 fix(core): update 2020-03-13 17:46:57 +00:00
bf2a32a5d5 1.0.34 2020-03-13 17:43:58 +00:00
7ced66fc28 fix(core): update 2020-03-13 17:43:57 +00:00
d01905ae99 1.0.33 2020-03-09 15:08:06 +00:00
59c744cc5e fix(core): update 2020-03-09 15:08:05 +00:00
4d23145529 1.0.32 2020-03-09 14:52:38 +00:00
27e0d7588d fix(core): update 2020-03-09 14:52:37 +00:00
12 changed files with 5700 additions and 1620 deletions

View File

@@ -3,14 +3,14 @@ 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
@@ -18,21 +18,11 @@ stages:
mirror: mirror:
stage: security stage: security
script: script:
- npmci git mirror - npmci git mirror
tags: tags:
- docker - lossless
- notpriv - docker
- notpriv
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
tags:
- docker
- notpriv
# ==================== # ====================
# test stage # test stage
@@ -41,37 +31,40 @@ snyk:
testStable: testStable:
stage: test stage: test
script: script:
- npmci npm prepare - npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - lossless
- priv - docker
- priv
testBuild: testBuild:
stage: test stage: test
script: script:
- npmci npm prepare - npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci command npm run build - npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - lossless
- notpriv - docker
- notpriv
release: release:
stage: release stage: release
script: script:
- npmci node install stable - npmci node install stable
- npmci npm publish - npmci npm publish
only: only:
- tags - tags
tags: tags:
- docker - lossless
- notpriv - docker
- notpriv
# ==================== # ====================
# metadata stage # metadata stage
@@ -85,30 +78,31 @@ codequality:
- npmci npm install - npmci npm install
- npmci command "tslint -c tslint.json ./ts/**/*.ts" - npmci command "tslint -c tslint.json ./ts/**/*.ts"
tags: tags:
- docker - lossless
- priv - docker
- priv
trigger: trigger:
stage: metadata stage: metadata
script: script:
- npmci trigger - npmci trigger
only: only:
- tags - tags
tags: tags:
- docker - lossless
- notpriv - docker
- 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:
@@ -116,5 +110,5 @@ pages:
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
paths: paths:
- public - public
allow_failure: true allow_failure: true

54
.snyk Normal file
View File

@@ -0,0 +1,54 @@
# 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: {}

29
.vscode/launch.json vendored Normal file
View 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
View 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"]
}
}
}
}
}
}
]
}

View File

@@ -4,6 +4,7 @@
"npmAccessLevel": "public" "npmAccessLevel": "public"
}, },
"gitzone": { "gitzone": {
"projectType": "npm",
"module": { "module": {
"githost": "gitlab.com", "githost": "gitlab.com",
"gitscope": "gitzone", "gitscope": "gitzone",

7006
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,6 +1,6 @@
{ {
"name": "@gitzone/tswatch", "name": "@gitzone/tswatch",
"version": "1.0.31", "version": "1.0.39",
"private": false, "private": false,
"description": "watch typescript projects during development", "description": "watch typescript projects during development",
"main": "dist/index.js", "main": "dist/index.js",
@@ -18,12 +18,11 @@
"@gitzone/tsbuild": "^2.1.17", "@gitzone/tsbuild": "^2.1.17",
"@gitzone/tstest": "^1.0.28", "@gitzone/tstest": "^1.0.28",
"@pushrocks/tapbundle": "^3.2.0", "@pushrocks/tapbundle": "^3.2.0",
"@types/node": "^13.7.7", "@types/node": "^13.9.0",
"tslint": "^6.0.0", "tslint": "^6.0.0",
"tslint-config-prettier": "^1.18.0" "tslint-config-prettier": "^1.18.0"
}, },
"dependencies": { "dependencies": {
"@gitzone/tsbundle": "^1.0.50",
"@gitzone/tsrun": "^1.2.8", "@gitzone/tsrun": "^1.2.8",
"@pushrocks/early": "^3.0.3", "@pushrocks/early": "^3.0.3",
"@pushrocks/lik": "^3.0.19", "@pushrocks/lik": "^3.0.19",
@@ -34,7 +33,9 @@
"@pushrocks/smartlog-destination-local": "^8.0.2", "@pushrocks/smartlog-destination-local": "^8.0.2",
"@pushrocks/smartserve": "^1.1.39", "@pushrocks/smartserve": "^1.1.39",
"@pushrocks/smartshell": "^2.0.25", "@pushrocks/smartshell": "^2.0.25",
"@pushrocks/taskbuffer": "^2.1.1" "@pushrocks/taskbuffer": "^2.1.1",
"@types/parcel-bundler": "^1.12.1",
"parcel-bundler": "^1.12.4"
}, },
"files": [ "files": [
"ts/**/*", "ts/**/*",

View File

@@ -8,7 +8,7 @@ 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
[![build status](https://gitlab.com/gitzone/tswatch/badges/master/build.svg)](https://gitlab.com/gitzone/tswatch/commits/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) [![coverage report](https://gitlab.com/gitzone/tswatch/badges/master/coverage.svg)](https://gitlab.com/gitzone/tswatch/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@gitzone/tswatch.svg)](https://www.npmjs.com/package/@gitzone/tswatch) [![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) [![Known Vulnerabilities](https://snyk.io/test/npm/@gitzone/tswatch/badge.svg)](https://snyk.io/test/npm/@gitzone/tswatch)
@@ -18,6 +18,11 @@ watch typescript projects during development
## Usage ## Usage
## 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)

View File

@@ -0,0 +1,37 @@
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
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'
cache: true, // Enabled or disables caching, defaults to true
cacheDir: '.nogit/.parcelcache', // The directory cache gets put in, defaults to .cache
contentHash: false, // Disable content hash from being included on the filename
global: 'moduleName', // Expose modules as UMD under this name, disabled by default
minify: false, // Minify files, enabled if process.env.NODE_ENV === 'production'
scopeHoist: false, // Turn on experimental scope hoisting/tree shaking flag, for smaller production bundles
target: 'browser', // Browser/node/electron, defaults to browser
bundleNodeModules: true, // By default, package.json dependencies are not included when using 'node' or 'electron' with 'target' option above. Set to true to adds them to the bundle, false by default
https: null,
logLevel: 3, // 5 = save everything to a file, 4 = like 3, but with timestamps and additionally log http requests to dev server, 3 = log info, warnings & errors, 2 = log warnings & errors, 1 = log errors, 0 = log nothing
hmr: true, // Enable or disable HMR while watching
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)
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
};
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);
}
}

View File

@@ -3,6 +3,7 @@ import * as paths from './tswatch.paths';
import * as interfaces from './interfaces'; import * as interfaces from './interfaces';
import { Watcher } from './tswatch.classes.watcher'; import { Watcher } from './tswatch.classes.watcher';
import { Parcel } from './tswatch.classes.parcel';
export class TsWatch { export class TsWatch {
public watchmode: interfaces.TWatchModes; public watchmode: interfaces.TWatchModes;
@@ -38,23 +39,11 @@ export class TsWatch {
break; break;
case 'gitzone_element': case 'gitzone_element':
// lets create a standard server // lets create a standard server
this.smartserve = new plugins.smartserve.SmartServe({ console.log(
port: 3001, 'bundling TypeScript files to "dist_watch" Note: This is for development only!'
injectReload: true,
serveDir: plugins.path.join(paths.cwd, './dist_web/')
});
this.watcherMap.add(
new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts_web/'),
commandToExecute: async () => {
const tsbundle = new plugins.tsbundle.TsBundle();
const htmlHandler = new plugins.tsbundle.HtmlHandler();
await tsbundle.buildProduction('./ts_web/index.ts', './dist_web/bundle.js');
await htmlHandler.copyHtml();
},
timeout: null
})
); );
const parcel = new Parcel();
await parcel.start();
break; break;
case 'gitzone_website': case 'gitzone_website':
this.watcherMap.add( this.watcherMap.add(
@@ -75,14 +64,14 @@ export class TsWatch {
); );
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;
case 'echoSomething': case 'echoSomething':
const tsWatchInstanceEchoSomething = new Watcher({ const tsWatchInstanceEchoSomething = new Watcher({
filePathToWatch: plugins.path.join(paths.cwd, './ts'), filePathToWatch: plugins.path.join(paths.cwd, './ts'),

View File

@@ -21,7 +21,7 @@ export class Watcher {
}); });
/** /**
* used to execute * used to execute
*/ */
private executionTask: plugins.taskbuffer.Task = new plugins.taskbuffer.Task({ private executionTask: plugins.taskbuffer.Task = new plugins.taskbuffer.Task({
name: 'watcherCommandFunctionTask', name: 'watcherCommandFunctionTask',

View File

@@ -1,13 +1,6 @@
import * as path from 'path'; import * as path from 'path';
export { path }; export { path };
// @gitzone scope
import * as tsbundle from '@gitzone/tsbundle';
export {
tsbundle
};
// @pushrocks scope // @pushrocks scope
import * as lik from '@pushrocks/lik'; import * as lik from '@pushrocks/lik';
import * as smartchok from '@pushrocks/smartchok'; import * as smartchok from '@pushrocks/smartchok';
@@ -19,4 +12,19 @@ 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,
smartserve,
smartshell,
taskbuffer
};
// third party scope
import parcel from 'parcel-bundler';
export { parcel };