Compare commits

...

8 Commits

Author SHA1 Message Date
87155900e1 4.0.8 2019-11-15 20:59:04 +01:00
d24b11f737 fix(core): update 2019-11-15 20:59:02 +01:00
17ebd58951 4.0.7 2019-08-22 00:20:11 +02:00
32bd229f91 fix(core): update 2019-08-22 00:20:10 +02:00
4e5ddf8411 4.0.6 2019-06-17 08:54:47 +02:00
701c7c1b8b fix(core): update 2019-06-17 08:54:46 +02:00
9a272def16 4.0.5 2019-06-17 08:51:04 +02:00
0213950aae fix(core): update 2019-06-17 08:51:03 +02:00
7 changed files with 369 additions and 487 deletions

View File

@ -1,5 +1,7 @@
# gitzone ci_default
image: hosttoday/ht-docker-node:npmci
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
variables:
GIT_STRATEGY: clone
cache:
paths:
@ -48,15 +50,15 @@ testLTS:
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
- priv
testSTABLE:
testBuild:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci node install lts
- npmci npm install
- npmci npm test
- npmci command npm run build
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
@ -65,7 +67,7 @@ testSTABLE:
release:
stage: release
script:
- npmci node install stable
- npmci node install lts
- npmci npm publish
only:
- tags
@ -98,7 +100,9 @@ trigger:
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
image: hosttoday/ht-docker-dbase:npmci
services:
- docker:18-dind
stage: metadata
script:
- npmci command npm install -g @gitzone/tsdoc

View File

@ -23,6 +23,6 @@ Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this readme.
> MIT licensed | **©** [Lossless GmbH](https://lossless.gmbh)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)
[![repo-footer](https://lossless.gitlab.io/publicrelations/repofooter.svg)](https://maintainedby.lossless.com)

View File

@ -1,11 +1,7 @@
{
"npmts": {
"coverageTreshold": 60
},
"npmci": {
"npmGlobalTools": [
"npmts"
]
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"gitzone": {
"module": {

758
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartenv",
"version": "4.0.4",
"version": "4.0.8",
"description": "store things about your environment and let them travel across modules",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@ -24,24 +24,26 @@
"homepage": "https://gitlab.com/pushrocks/smartenv",
"dependencies": {
"@pushrocks/smartparam": "^1.0.4",
"@pushrocks/smartpromise": "^3.0.2",
"@types/node": "^12.0.8"
"@pushrocks/smartpromise": "^3.0.6",
"@types/node": "^12.12.7",
"is-wsl": "^2.1.1"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.11",
"@gitzone/tsrun": "^1.2.6",
"@gitzone/tstest": "^1.0.24",
"@pushrocks/tapbundle": "^3.0.9",
"@types/npm": "^2.0.29",
"tslint": "^5.17.0",
"@gitzone/tsbuild": "^2.1.17",
"@gitzone/tsrun": "^1.2.8",
"@gitzone/tstest": "^1.0.28",
"@pushrocks/tapbundle": "^3.0.13",
"@types/npm": "^2.0.31",
"tslint": "^5.20.1",
"tslint-config-prettier": "^1.18.0"
},
"private": true,
"private": false,
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"dist_ts_web/*",
"assets/*",
"cli.js",
"npmextra.json",

View File

@ -11,7 +11,7 @@ export interface IEnvObject {
* Smartenv class that makes it easy
*/
export class Smartenv {
get runtimeEnv() {
public get runtimeEnv() {
if (typeof window !== 'undefined') {
return 'browser';
} else if (typeof process !== 'undefined') {
@ -19,11 +19,11 @@ export class Smartenv {
}
}
get isBrowser(): boolean {
public get isBrowser(): boolean {
return !this.isNode;
}
get userAgent(): string {
public get userAgent(): string {
if (this.isBrowser) {
// make sure we are in Browser
return navigator.userAgent;
@ -32,15 +32,19 @@ export class Smartenv {
}
}
get isNode(): boolean {
public get isNode(): boolean {
return this.runtimeEnv === 'node';
}
get nodeVersion(): string {
public get isWsl(): boolean {
return plugins.isWsl;
}
public get nodeVersion(): string {
return process.version;
}
get isCI(): boolean {
public get isCI(): boolean {
if (this.isNode) {
if (process.env.CI) {
return true;
@ -52,27 +56,27 @@ export class Smartenv {
}
}
async isMacAsync(): Promise<boolean> {
public async isMacAsync(): Promise<boolean> {
if (this.isNode) {
let os = await import('os');
const os = await import('os');
return os.platform() === 'darwin';
} else {
return false;
}
}
async isWindowsAsync(): Promise<boolean> {
public async isWindowsAsync(): Promise<boolean> {
if (this.isNode) {
let os = await import('os');
const os = await import('os');
return os.platform() === 'win32';
} else {
return false;
}
}
async isLinuxAsync(): Promise<boolean> {
public async isLinuxAsync(): Promise<boolean> {
if (this.isNode) {
let os = await import('os');
const os = await import('os');
return os.platform() === 'linux';
} else {
return false;
@ -90,10 +94,10 @@ export class Smartenv {
/**
* prints the environment to console
*/
async printEnv() {
public async printEnv() {
if (this.isNode) {
console.log('running on NODE');
let smartenvVersion = require('../package.json').version;
const smartenvVersion = require('../package.json').version;
console.log(
'node version is ' + this.nodeVersion + ' and smartenv version is ' + smartenvVersion
);

View File

@ -1,4 +1,12 @@
import * as smartparam from '@pushrocks/smartparam';
import * as smartq from '@pushrocks/smartpromise';
import * as smartpromise from '@pushrocks/smartpromise';
export { smartparam, smartq };
export { smartparam, smartpromise };
// third party scope
import isWsl from 'is-wsl';
export {
isWsl
};