15 Commits

Author SHA1 Message Date
a26b36fbed 1.0.9 2019-04-16 08:26:17 +02:00
3e91a37247 fix(core): update 2019-04-16 08:26:16 +02:00
4f0923a4c1 1.0.8 2018-05-22 17:06:28 +02:00
0cbc8d267a 1.0.7 2018-05-22 13:59:17 +02:00
8d8cde1447 fix(ci): fix npmextra 2018-05-22 13:59:17 +02:00
53f01903db 1.0.6 2018-05-22 13:44:58 +02:00
831bbd2488 fix(ci): fix ci 2018-05-22 13:44:58 +02:00
b26b03f04b 1.0.5 2018-05-22 13:42:21 +02:00
cb1ee35f2e fix(ci): better deal with ci environments 2018-05-22 13:42:21 +02:00
9681acdcc4 1.0.4 2018-05-22 13:29:50 +02:00
1498f6c2b2 fix(core): switch from typings-global to @types/node 2018-05-22 13:29:49 +02:00
0430397e4f 1.0.3 2017-08-17 09:03:20 +02:00
82672e191e update to latest standards 2017-08-17 09:03:16 +02:00
b4d368e118 1.0.2 2017-03-12 21:23:19 +01:00
a6ea56845a add npmextra.json 2017-03-12 21:23:16 +01:00
11 changed files with 1839 additions and 65 deletions

View File

@ -3,69 +3,123 @@ image: hosttoday/ht-docker-node:npmci
cache:
paths:
- .yarn/
- .npmci_cache/
key: "$CI_BUILD_STAGE"
stages:
- security
- test
- release
- trigger
- pages
- metadata
testLEGACY:
stage: test
# ====================
# security stage
# ====================
mirror:
stage: security
script:
- npmci test legacy
coverage: /\d+.?\d+?\%\s*coverage/
- npmci git mirror
tags:
- docker
allow_failure: true
- 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
# ====================
testLTS:
stage: test
script:
- npmci test lts
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
testSTABLE:
stage: test
script:
- npmci test stable
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
release:
stage: release
script:
- npmci publish
- npmci node install stable
- npmci npm publish
only:
- tags
tags:
- docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
image: docker:stable
allow_failure: true
services:
- docker:stable-dind
script:
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SOURCE_CODE="$PWD"
--volume "$PWD":/code
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/codequality:$SP_VERSION" /code
artifacts:
paths: [codeclimate.json]
tags:
- docker
- priv
trigger:
stage: trigger
stage: metadata
script:
- npmci trigger
only:
- tags
tags:
- docker
- notpriv
pages:
image: hosttoday/ht-docker-node:npmci
stage: pages
stage: metadata
script:
- npmci commadn yarn global add npmpage
- npmci command npmpage --publish gitlab
- npmci command npm install -g typedoc typescript
- npmci npm prepare
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags:
- docker
- notpriv
only:
- tags
artifacts:
expire_in: 1 week
paths:
- public
allow_failure: true

View File

@ -1,29 +1,28 @@
# smartopen
# @pushrocks/smartopen
open things
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartopen)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartopen)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartopen)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartopen/)
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartopen)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartopen)
* [github.com (source mirror)](https://github.com/pushrocks/smartopen)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartopen/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartopen/badges/master/build.svg)](https://GitLab.com/pushrocks/smartopen/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartopen/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartopen/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartopen.svg)](https://www.npmjs.com/package/smartopen)
[![Dependency Status](https://david-dm.org/pushrocks/smartopen.svg)](https://david-dm.org/pushrocks/smartopen)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartopen/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartopen/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartopen/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartopen)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%206.x.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg)](http://standardjs.com/)
[![build status](https://gitlab.com/pushrocks/smartopen/badges/master/build.svg)](https://gitlab.com/pushrocks/smartopen/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartopen/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartopen/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartopen.svg)](https://www.npmjs.com/package/@pushrocks/smartopen)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartopen/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartopen)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
## Usage
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)
| By using this npm module you agree to our [privacy policy](https://lossless.gmbH/privacy.html)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)
[![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://maintainedby.lossless.com)

4
dist/index.d.ts vendored
View File

@ -1 +1,3 @@
export declare let openUrl: (urlArg: any) => Promise<void>;
/// <reference types="node" />
import { ChildProcess } from 'child_process';
export declare let openUrl: (urlArg: any) => Promise<ChildProcess>;

14
dist/index.js vendored
View File

@ -8,8 +8,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const open = require("open");
const open = require("opn");
exports.openUrl = (urlArg) => __awaiter(this, void 0, void 0, function* () {
open(urlArg);
if (!(process.env.CI === 'true')) {
const childProcess = yield open(urlArg, {
wait: false
});
return childProcess;
}
else {
return null;
}
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsNkJBQTZCO0FBRWxCLFFBQUEsT0FBTyxHQUFHLENBQU8sTUFBTTtJQUNoQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUE7QUFDZCxDQUFDLENBQUEsQ0FBQSJ9
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsNEJBQTZCO0FBR2xCLFFBQUEsT0FBTyxHQUFHLENBQU0sTUFBTSxFQUFDLEVBQUU7SUFDbEMsSUFBRyxDQUFDLENBQUMsT0FBTyxDQUFDLEdBQUcsQ0FBQyxFQUFFLEtBQUssTUFBTSxDQUFDLEVBQUU7UUFDL0IsTUFBTSxZQUFZLEdBQUcsTUFBTSxJQUFJLENBQUMsTUFBTSxFQUFFO1lBQ3RDLElBQUksRUFBRSxLQUFLO1NBQ1osQ0FBQyxDQUFDO1FBQ0gsT0FBTyxZQUFZLENBQUM7S0FDckI7U0FBTTtRQUNMLE9BQU8sSUFBSSxDQUFBO0tBQ1o7QUFDSCxDQUFDLENBQUEsQ0FBQyJ9

23
npmextra.json Normal file
View File

@ -0,0 +1,23 @@
{
"npmci": {
"npmGlobalTools": [
"npmts",
"ts-node",
"typescript"
],
"npmAccessLevel": "public"
},
"npmts": {
"coverageTreshold": 60
},
"gitzone": {
"module": {
"githost": "gitlab.com",
"gitscope": "pushrocks",
"gitrepo": "smartopen",
"shortDescription": "open things",
"npmPackagename": "@pushrocks/smartopen",
"license": "MIT"
}
}
}

1659
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
{
"name": "smartopen",
"version": "1.0.1",
"name": "@pushrocks/smartopen",
"version": "1.0.9",
"description": "open things",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"scripts": {
"test": "(npmts)"
"test": "tstest test/",
"build": "tsbuild"
},
"repository": {
"type": "git",
@ -22,6 +23,14 @@
"homepage": "https://gitlab.com/pushrocks/smartopen#README",
"dependencies": {
"@types/open": "^0.0.29",
"open": "^0.0.5"
}
"@types/opn": "^5.1.0",
"opn": "^5.3.0"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.8",
"@gitzone/tstest": "^1.0.20",
"@types/node": "^10.1.2",
"tapbundle": "^2.0.0"
},
"private": true
}

9
test/test.ts Normal file
View File

@ -0,0 +1,9 @@
import { expect, tap } from 'tapbundle';
import * as smartopen from '../ts/index';
tap.test('should open a webpage', async () => {
await smartopen.openUrl('https://lossless.com');
});
tap.start();

View File

@ -1,5 +1,13 @@
import open = require('open')
import open = require('opn');
import { ChildProcess } from 'child_process';
export let openUrl = async (urlArg) => {
open(urlArg)
}
export let openUrl = async urlArg => {
if (!(process.env.CI === 'true')) {
const childProcess = await open(urlArg, {
wait: false
});
return childProcess;
} else {
return null;
}
};

View File

@ -1,3 +1,17 @@
{
"extends": "tslint-config-standard"
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}

View File

@ -1,11 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/open@^0.0.29":
version "0.0.29"
resolved "https://registry.yarnpkg.com/@types/open/-/open-0.0.29.tgz#3de910012674909db14d608d1fde44ffa7a9ecea"
open@^0.0.5:
version "0.0.5"
resolved "https://registry.yarnpkg.com/open/-/open-0.0.5.tgz#42c3e18ec95466b6bf0dc42f3a2945c3f0cad8fc"