fix(core): update
This commit is contained in:
		@@ -19,23 +19,35 @@ mirror:
 | 
				
			|||||||
  stage: security
 | 
					  stage: security
 | 
				
			||||||
  script:
 | 
					  script:
 | 
				
			||||||
    - npmci git mirror
 | 
					    - npmci git mirror
 | 
				
			||||||
 | 
					  only:
 | 
				
			||||||
 | 
					    - tags
 | 
				
			||||||
  tags:
 | 
					  tags:
 | 
				
			||||||
    - lossless
 | 
					    - lossless
 | 
				
			||||||
    - docker
 | 
					    - docker
 | 
				
			||||||
    - notpriv
 | 
					    - notpriv
 | 
				
			||||||
 | 
					
 | 
				
			||||||
audit:
 | 
					auditProductionDependencies:
 | 
				
			||||||
 | 
					  image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
 | 
				
			||||||
 | 
					  stage: security
 | 
				
			||||||
 | 
					  script:
 | 
				
			||||||
 | 
					    - npmci npm prepare
 | 
				
			||||||
 | 
					    - npmci command npm install --production --ignore-scripts
 | 
				
			||||||
 | 
					    - npmci command npm config set registry https://registry.npmjs.org
 | 
				
			||||||
 | 
					    - npmci command npm audit --audit-level=high --only=prod --production
 | 
				
			||||||
 | 
					  tags:
 | 
				
			||||||
 | 
					    - docker
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					auditDevDependencies:
 | 
				
			||||||
  image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
 | 
					  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 --ignore-scripts
 | 
					    - npmci command npm install --ignore-scripts
 | 
				
			||||||
    - npmci command npm config set registry https://registry.npmjs.org
 | 
					    - npmci command npm config set registry https://registry.npmjs.org
 | 
				
			||||||
    - npmci command npm audit --audit-level=high
 | 
					    - npmci command npm audit --audit-level=high --only=dev
 | 
				
			||||||
  tags:
 | 
					  tags:
 | 
				
			||||||
    - lossless
 | 
					 | 
				
			||||||
    - docker
 | 
					    - docker
 | 
				
			||||||
    - notpriv
 | 
					  allow_failure: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# ====================
 | 
					# ====================
 | 
				
			||||||
# test stage
 | 
					# test stage
 | 
				
			||||||
@@ -50,9 +62,7 @@ testStable:
 | 
				
			|||||||
    - npmci npm test
 | 
					    - npmci npm test
 | 
				
			||||||
  coverage: /\d+.?\d+?\%\s*coverage/
 | 
					  coverage: /\d+.?\d+?\%\s*coverage/
 | 
				
			||||||
  tags:
 | 
					  tags:
 | 
				
			||||||
    - lossless
 | 
					 | 
				
			||||||
    - docker
 | 
					    - docker
 | 
				
			||||||
    - priv
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
testBuild:
 | 
					testBuild:
 | 
				
			||||||
  stage: test
 | 
					  stage: test
 | 
				
			||||||
@@ -63,9 +73,7 @@ testBuild:
 | 
				
			|||||||
    - npmci command npm run build
 | 
					    - npmci command npm run build
 | 
				
			||||||
  coverage: /\d+.?\d+?\%\s*coverage/
 | 
					  coverage: /\d+.?\d+?\%\s*coverage/
 | 
				
			||||||
  tags:
 | 
					  tags:
 | 
				
			||||||
    - lossless
 | 
					 | 
				
			||||||
    - docker
 | 
					    - docker
 | 
				
			||||||
    - notpriv
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
release:
 | 
					release:
 | 
				
			||||||
  stage: release
 | 
					  stage: release
 | 
				
			||||||
@@ -85,6 +93,8 @@ 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
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										2
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								.vscode/settings.json
									
									
									
									
										vendored
									
									
								
							@@ -15,7 +15,7 @@
 | 
				
			|||||||
            "properties": {
 | 
					            "properties": {
 | 
				
			||||||
              "projectType": {
 | 
					              "projectType": {
 | 
				
			||||||
                "type": "string",
 | 
					                "type": "string",
 | 
				
			||||||
                "enum": ["website", "element", "service", "npm"]
 | 
					                "enum": ["website", "element", "service", "npm", "wcc"]
 | 
				
			||||||
              }
 | 
					              }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          }
 | 
					          }
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										11098
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										11098
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										27
									
								
								package.json
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								package.json
									
									
									
									
									
								
							@@ -26,21 +26,21 @@
 | 
				
			|||||||
  },
 | 
					  },
 | 
				
			||||||
  "homepage": "https://gitlab.com/pushrocks/smartcli",
 | 
					  "homepage": "https://gitlab.com/pushrocks/smartcli",
 | 
				
			||||||
  "dependencies": {
 | 
					  "dependencies": {
 | 
				
			||||||
    "@pushrocks/lik": "^4.0.13",
 | 
					    "@pushrocks/lik": "^4.0.20",
 | 
				
			||||||
    "@pushrocks/smartlog": "^2.0.21",
 | 
					    "@pushrocks/smartlog": "^2.0.39",
 | 
				
			||||||
    "@pushrocks/smartparam": "^1.1.6",
 | 
					    "@pushrocks/smartparam": "^1.1.6",
 | 
				
			||||||
    "@pushrocks/smartpromise": "^3.0.6",
 | 
					    "@pushrocks/smartpromise": "^3.1.3",
 | 
				
			||||||
    "@types/yargs": "^15.0.5",
 | 
					    "@types/yargs": "^16.0.1",
 | 
				
			||||||
    "rxjs": "^6.5.5",
 | 
					    "rxjs": "^6.6.7",
 | 
				
			||||||
    "yargs": "^15.3.1"
 | 
					    "yargs": "^16.2.0"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "devDependencies": {
 | 
					  "devDependencies": {
 | 
				
			||||||
    "@gitzone/tsbuild": "^2.1.24",
 | 
					    "@gitzone/tsbuild": "^2.1.25",
 | 
				
			||||||
    "@gitzone/tsrun": "^1.2.8",
 | 
					    "@gitzone/tsrun": "^1.2.12",
 | 
				
			||||||
    "@gitzone/tstest": "^1.0.28",
 | 
					    "@gitzone/tstest": "^1.0.52",
 | 
				
			||||||
    "@pushrocks/tapbundle": "^3.2.1",
 | 
					    "@pushrocks/tapbundle": "^3.2.14",
 | 
				
			||||||
    "@types/node": "^14.0.5",
 | 
					    "@types/node": "^14.14.37",
 | 
				
			||||||
    "tslint": "^6.1.2",
 | 
					    "tslint": "^6.1.3",
 | 
				
			||||||
    "tslint-config-prettier": "^1.18.0"
 | 
					    "tslint-config-prettier": "^1.18.0"
 | 
				
			||||||
  },
 | 
					  },
 | 
				
			||||||
  "files": [
 | 
					  "files": [
 | 
				
			||||||
@@ -54,5 +54,8 @@
 | 
				
			|||||||
    "cli.js",
 | 
					    "cli.js",
 | 
				
			||||||
    "npmextra.json",
 | 
					    "npmextra.json",
 | 
				
			||||||
    "readme.md"
 | 
					    "readme.md"
 | 
				
			||||||
 | 
					  ],
 | 
				
			||||||
 | 
					  "browserslist": [
 | 
				
			||||||
 | 
					    "last 1 chrome versions"
 | 
				
			||||||
  ]
 | 
					  ]
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
@@ -19,7 +19,7 @@ TypeScript Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
 | 
					node Support | [](https://nodejs.org/dist/latest-v10.x/docs/api/)
 | 
				
			||||||
Code Style | [](https://lossless.cloud)
 | 
					Code Style | [](https://lossless.cloud)
 | 
				
			||||||
PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
 | 
					PackagePhobia (total standalone install weight) | [](https://lossless.cloud)
 | 
				
			||||||
PackagePhobia (package size on registry) | [](https://lossless.cloud)
 | 
					PackagePhobia (package size on registry) | [](https://lossless.cloud)
 | 
				
			||||||
BundlePhobia (total size when bundled) | [](https://lossless.cloud)
 | 
					BundlePhobia (total size when bundled) | [](https://lossless.cloud)
 | 
				
			||||||
Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
 | 
					Platform support | [](https://lossless.cloud) [](https://lossless.cloud)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -46,11 +46,11 @@ except when of the options is -v, --version or --help.
 | 
				
			|||||||
```javascript
 | 
					```javascript
 | 
				
			||||||
import { Smartcli } from 'smartcli';
 | 
					import { Smartcli } from 'smartcli';
 | 
				
			||||||
mySmartcli = new Smartcli();
 | 
					mySmartcli = new Smartcli();
 | 
				
			||||||
mySmartcli.standardTask().then(argvArg => {
 | 
					mySmartcli.standardTask().then((argvArg) => {
 | 
				
			||||||
  // do something if program is called without an command
 | 
					  // do something if program is called without an command
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mySmartcli.addCommand({ commandname: 'install' }).then(argvArg => {
 | 
					mySmartcli.addCommand({ commandname: 'install' }).then((argvArg) => {
 | 
				
			||||||
  // do something if program is called with command "install"
 | 
					  // do something if program is called with command "install"
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -58,7 +58,7 @@ mySmartcli.addVersion('1.0.0'); // -v and --version options will display the spe
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
mySmartCli.addHelp({
 | 
					mySmartCli.addHelp({
 | 
				
			||||||
  // is triggered by help command and --help option
 | 
					  // is triggered by help command and --help option
 | 
				
			||||||
  helpText: 'some help text to print' // the helpText to display
 | 
					  helpText: 'some help text to print', // the helpText to display
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
mySmartcli.startParse(); // starts the evaluation and fullfills or rejects promises.
 | 
					mySmartcli.startParse(); // starts the evaluation and fullfills or rejects promises.
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -17,6 +17,8 @@ export interface ITriggerObservableObject {
 | 
				
			|||||||
  subject: Subject<any>;
 | 
					  subject: Subject<any>;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					const logger = new plugins.smartlog.ConsoleLog();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/**
 | 
					/**
 | 
				
			||||||
 * class to create a new instance of Smartcli. Handles parsing of command line arguments.
 | 
					 * class to create a new instance of Smartcli. Handles parsing of command line arguments.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@@ -80,7 +82,7 @@ export class Smartcli {
 | 
				
			|||||||
    if (!this.getTriggerSubject(triggerNameArg)) {
 | 
					    if (!this.getTriggerSubject(triggerNameArg)) {
 | 
				
			||||||
      this.allTriggerObservablesMap.add({
 | 
					      this.allTriggerObservablesMap.add({
 | 
				
			||||||
        triggerName: triggerNameArg,
 | 
					        triggerName: triggerNameArg,
 | 
				
			||||||
        subject: triggerSubject
 | 
					        subject: triggerSubject,
 | 
				
			||||||
      });
 | 
					      });
 | 
				
			||||||
    } else {
 | 
					    } else {
 | 
				
			||||||
      throw new Error(`you can't add a trigger twice`);
 | 
					      throw new Error(`you can't add a trigger twice`);
 | 
				
			||||||
@@ -100,7 +102,7 @@ export class Smartcli {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  getTriggerSubject(triggerName: string) {
 | 
					  getTriggerSubject(triggerName: string) {
 | 
				
			||||||
    const triggerObservableObject = this.allTriggerObservablesMap.find(
 | 
					    const triggerObservableObject = this.allTriggerObservablesMap.find(
 | 
				
			||||||
      triggerObservableObjectArg => {
 | 
					      (triggerObservableObjectArg) => {
 | 
				
			||||||
        return triggerObservableObjectArg.triggerName === triggerName;
 | 
					        return triggerObservableObjectArg.triggerName === triggerName;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
    );
 | 
					    );
 | 
				
			||||||
@@ -115,8 +117,8 @@ export class Smartcli {
 | 
				
			|||||||
   * allows to specify help text to be printed above the rest of the help text
 | 
					   * allows to specify help text to be printed above the rest of the help text
 | 
				
			||||||
   */
 | 
					   */
 | 
				
			||||||
  addHelp(optionsArg: { helpText: string }) {
 | 
					  addHelp(optionsArg: { helpText: string }) {
 | 
				
			||||||
    this.addCommand('help').subscribe(argvArg => {
 | 
					    this.addCommand('help').subscribe((argvArg) => {
 | 
				
			||||||
      plugins.smartlog.defaultLogger.log('info', optionsArg.helpText);
 | 
					      logger.log('info', optionsArg.helpText);
 | 
				
			||||||
    });
 | 
					    });
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user