Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
87155900e1 | |||
d24b11f737 | |||
17ebd58951 | |||
32bd229f91 |
@ -1,5 +1,7 @@
|
|||||||
# gitzone ci_default
|
# gitzone ci_default
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
variables:
|
||||||
|
GIT_STRATEGY: clone
|
||||||
|
|
||||||
cache:
|
cache:
|
||||||
paths:
|
paths:
|
||||||
@ -48,15 +50,15 @@ testLTS:
|
|||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
- notpriv
|
- priv
|
||||||
|
|
||||||
testSTABLE:
|
testBuild:
|
||||||
stage: test
|
stage: test
|
||||||
script:
|
script:
|
||||||
- npmci npm prepare
|
- npmci npm prepare
|
||||||
- npmci node install stable
|
- npmci node install lts
|
||||||
- npmci npm install
|
- npmci npm install
|
||||||
- npmci npm test
|
- npmci command npm run build
|
||||||
coverage: /\d+.?\d+?\%\s*coverage/
|
coverage: /\d+.?\d+?\%\s*coverage/
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
@ -65,7 +67,7 @@ testSTABLE:
|
|||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
script:
|
script:
|
||||||
- npmci node install stable
|
- npmci node install lts
|
||||||
- npmci npm publish
|
- npmci npm publish
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
||||||
@ -98,7 +100,9 @@ trigger:
|
|||||||
- notpriv
|
- notpriv
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
image: hosttoday/ht-docker-node:npmci
|
image: hosttoday/ht-docker-dbase:npmci
|
||||||
|
services:
|
||||||
|
- docker:18-dind
|
||||||
stage: metadata
|
stage: metadata
|
||||||
script:
|
script:
|
||||||
- npmci command npm install -g @gitzone/tsdoc
|
- npmci command npm install -g @gitzone/tsdoc
|
||||||
|
@ -23,6 +23,6 @@ Use TypeScript for best in class instellisense.
|
|||||||
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)
|
||||||
| 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)
|
||||||
|
|
||||||
[](https://maintainedby.lossless.com)
|
[](https://maintainedby.lossless.com)
|
||||||
|
758
package-lock.json
generated
758
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
20
package.json
20
package.json
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@pushrocks/smartenv",
|
"name": "@pushrocks/smartenv",
|
||||||
"version": "4.0.6",
|
"version": "4.0.8",
|
||||||
"description": "store things about your environment and let them travel across modules",
|
"description": "store things about your environment and let them travel across modules",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"typings": "dist/index.d.ts",
|
"typings": "dist/index.d.ts",
|
||||||
@ -24,16 +24,17 @@
|
|||||||
"homepage": "https://gitlab.com/pushrocks/smartenv",
|
"homepage": "https://gitlab.com/pushrocks/smartenv",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@pushrocks/smartparam": "^1.0.4",
|
"@pushrocks/smartparam": "^1.0.4",
|
||||||
"@pushrocks/smartpromise": "^3.0.2",
|
"@pushrocks/smartpromise": "^3.0.6",
|
||||||
"@types/node": "^12.0.8"
|
"@types/node": "^12.12.7",
|
||||||
|
"is-wsl": "^2.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.11",
|
"@gitzone/tsbuild": "^2.1.17",
|
||||||
"@gitzone/tsrun": "^1.2.6",
|
"@gitzone/tsrun": "^1.2.8",
|
||||||
"@gitzone/tstest": "^1.0.24",
|
"@gitzone/tstest": "^1.0.28",
|
||||||
"@pushrocks/tapbundle": "^3.0.9",
|
"@pushrocks/tapbundle": "^3.0.13",
|
||||||
"@types/npm": "^2.0.29",
|
"@types/npm": "^2.0.31",
|
||||||
"tslint": "^5.17.0",
|
"tslint": "^5.20.1",
|
||||||
"tslint-config-prettier": "^1.18.0"
|
"tslint-config-prettier": "^1.18.0"
|
||||||
},
|
},
|
||||||
"private": false,
|
"private": false,
|
||||||
@ -42,6 +43,7 @@
|
|||||||
"ts_web/*",
|
"ts_web/*",
|
||||||
"dist/*",
|
"dist/*",
|
||||||
"dist_web/*",
|
"dist_web/*",
|
||||||
|
"dist_ts_web/*",
|
||||||
"assets/*",
|
"assets/*",
|
||||||
"cli.js",
|
"cli.js",
|
||||||
"npmextra.json",
|
"npmextra.json",
|
||||||
|
@ -11,7 +11,7 @@ export interface IEnvObject {
|
|||||||
* Smartenv class that makes it easy
|
* Smartenv class that makes it easy
|
||||||
*/
|
*/
|
||||||
export class Smartenv {
|
export class Smartenv {
|
||||||
get runtimeEnv() {
|
public get runtimeEnv() {
|
||||||
if (typeof window !== 'undefined') {
|
if (typeof window !== 'undefined') {
|
||||||
return 'browser';
|
return 'browser';
|
||||||
} else if (typeof process !== 'undefined') {
|
} else if (typeof process !== 'undefined') {
|
||||||
@ -19,11 +19,11 @@ export class Smartenv {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get isBrowser(): boolean {
|
public get isBrowser(): boolean {
|
||||||
return !this.isNode;
|
return !this.isNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
get userAgent(): string {
|
public get userAgent(): string {
|
||||||
if (this.isBrowser) {
|
if (this.isBrowser) {
|
||||||
// make sure we are in Browser
|
// make sure we are in Browser
|
||||||
return navigator.userAgent;
|
return navigator.userAgent;
|
||||||
@ -32,15 +32,19 @@ export class Smartenv {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get isNode(): boolean {
|
public get isNode(): boolean {
|
||||||
return this.runtimeEnv === 'node';
|
return this.runtimeEnv === 'node';
|
||||||
}
|
}
|
||||||
|
|
||||||
get nodeVersion(): string {
|
public get isWsl(): boolean {
|
||||||
|
return plugins.isWsl;
|
||||||
|
}
|
||||||
|
|
||||||
|
public get nodeVersion(): string {
|
||||||
return process.version;
|
return process.version;
|
||||||
}
|
}
|
||||||
|
|
||||||
get isCI(): boolean {
|
public get isCI(): boolean {
|
||||||
if (this.isNode) {
|
if (this.isNode) {
|
||||||
if (process.env.CI) {
|
if (process.env.CI) {
|
||||||
return true;
|
return true;
|
||||||
@ -52,27 +56,27 @@ export class Smartenv {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async isMacAsync(): Promise<boolean> {
|
public async isMacAsync(): Promise<boolean> {
|
||||||
if (this.isNode) {
|
if (this.isNode) {
|
||||||
let os = await import('os');
|
const os = await import('os');
|
||||||
return os.platform() === 'darwin';
|
return os.platform() === 'darwin';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async isWindowsAsync(): Promise<boolean> {
|
public async isWindowsAsync(): Promise<boolean> {
|
||||||
if (this.isNode) {
|
if (this.isNode) {
|
||||||
let os = await import('os');
|
const os = await import('os');
|
||||||
return os.platform() === 'win32';
|
return os.platform() === 'win32';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async isLinuxAsync(): Promise<boolean> {
|
public async isLinuxAsync(): Promise<boolean> {
|
||||||
if (this.isNode) {
|
if (this.isNode) {
|
||||||
let os = await import('os');
|
const os = await import('os');
|
||||||
return os.platform() === 'linux';
|
return os.platform() === 'linux';
|
||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
@ -90,10 +94,10 @@ export class Smartenv {
|
|||||||
/**
|
/**
|
||||||
* prints the environment to console
|
* prints the environment to console
|
||||||
*/
|
*/
|
||||||
async printEnv() {
|
public async printEnv() {
|
||||||
if (this.isNode) {
|
if (this.isNode) {
|
||||||
console.log('running on NODE');
|
console.log('running on NODE');
|
||||||
let smartenvVersion = require('../package.json').version;
|
const smartenvVersion = require('../package.json').version;
|
||||||
console.log(
|
console.log(
|
||||||
'node version is ' + this.nodeVersion + ' and smartenv version is ' + smartenvVersion
|
'node version is ' + this.nodeVersion + ' and smartenv version is ' + smartenvVersion
|
||||||
);
|
);
|
||||||
|
@ -1,4 +1,12 @@
|
|||||||
import * as smartparam from '@pushrocks/smartparam';
|
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
|
||||||
|
};
|
||||||
|
Reference in New Issue
Block a user