31 Commits

Author SHA1 Message Date
e42cdcf339 1.0.18 2019-06-04 11:33:38 +02:00
49c56c3d53 fix(core): update 2019-06-04 11:33:38 +02:00
18454e53dc 1.0.17 2019-06-04 11:27:28 +02:00
4d219d37d7 1.0.16 2019-06-04 11:25:51 +02:00
42e6898dc5 fix(core): update 2019-06-04 11:25:51 +02:00
67b0d0bd37 1.0.15 2019-05-23 15:53:30 +02:00
f9054f6bfd fix(core): remove obsolete @types/open 2019-05-23 15:53:30 +02:00
b959d8566e 1.0.14 2019-05-23 15:52:30 +02:00
86632619fd fix(core): update 2019-05-23 15:52:30 +02:00
ac05c11927 1.0.13 2019-05-23 15:50:48 +02:00
4cab83991b 1.0.12 2019-04-16 08:28:49 +02:00
33f76aeca8 fix(core): update 2019-04-16 08:28:49 +02:00
36fd64f0e7 1.0.11 2019-04-16 08:27:54 +02:00
7256714541 fix(core): update 2019-04-16 08:27:54 +02:00
00dc400849 1.0.10 2019-04-16 08:27:12 +02:00
bd17352fd4 fix(core): update 2019-04-16 08:27:12 +02:00
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
12 changed files with 2116 additions and 80 deletions

20
.gitignore vendored
View File

@ -1,4 +1,22 @@
node_modules/ .nogit/
# artifacts
coverage/ coverage/
public/ public/
pages/ pages/
# installs
node_modules/
# caches
.yarn/
.cache/
.rpt2_cache
# builds
dist/
dist_web/
dist_serve/
dist_ts_web/
# custom

View File

@ -1,71 +1,116 @@
# gitzone standard # gitzone ci_default
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
cache: cache:
paths: paths:
- .yarn/ - .npmci_cache/
key: "$CI_BUILD_STAGE" key: "$CI_BUILD_STAGE"
stages: stages:
- security
- test - test
- release - release
- trigger - metadata
- pages
testLEGACY: # ====================
stage: test # security stage
# ====================
mirror:
stage: security
script: script:
- npmci test legacy - npmci git mirror
coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - 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: testLTS:
stage: test stage: test
script: script:
- npmci test lts - npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
testSTABLE: testSTABLE:
stage: test stage: test
script: script:
- npmci test stable - npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/ coverage: /\d+.?\d+?\%\s*coverage/
tags: tags:
- docker - docker
- notpriv
release: release:
stage: release stage: release
script: script:
- npmci publish - npmci node install stable
- npmci npm publish
only: only:
- tags - tags
tags: tags:
- docker - docker
- notpriv
# ====================
# metadata stage
# ====================
codequality:
stage: metadata
allow_failure: true
script:
- npm install -g tslint typescript
- tslint -c tslint.json ./ts/**/*.ts
tags:
- docker
- priv
trigger: trigger:
stage: trigger stage: metadata
script: script:
- npmci trigger - npmci trigger
only: only:
- tags - tags
tags: tags:
- docker - docker
- notpriv
pages: pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
stage: pages stage: metadata
script: script:
- npmci commadn yarn global add npmpage - npmci command npm install -g @gitzone/tsdoc
- npmci command npmpage --publish gitlab - npmci npm prepare
- npmci npm install
- npmci command tsdoc
tags: tags:
- docker - docker
- notpriv
only: only:
- tags - tags
artifacts: artifacts:
expire_in: 1 week expire_in: 1 week
paths: paths:
- public - public
allow_failure: true

View File

@ -1,29 +1,36 @@
# smartopen # @pushrocks/smartopen
open things open things
## Availabililty ## Availabililty and Links
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartopen) * [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartopen)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartopen) * [gitlab.com (source)](https://gitlab.com/pushrocks/smartopen)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartopen) * [github.com (source mirror)](https://github.com/pushrocks/smartopen)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartopen/) * [docs (typedoc)](https://pushrocks.gitlab.io/smartopen/)
## Status for master ## Status for master
[![build status](https://GitLab.com/pushrocks/smartopen/badges/master/build.svg)](https://GitLab.com/pushrocks/smartopen/commits/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) [![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) [![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartopen.svg)](https://www.npmjs.com/package/@pushrocks/smartopen)
[![Dependency Status](https://david-dm.org/pushrocks/smartopen.svg)](https://david-dm.org/pushrocks/smartopen) [![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartopen/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartopen)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartopen/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartopen/master/dependencies/npm) [![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartopen/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartopen) [![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/)
[![TypeScript](https://img.shields.io/badge/TypeScript-2.x-blue.svg)](https://nodejs.org/dist/latest-v6.x/docs/api/) [![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/)
[![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/)
## Usage ## Usage
Use TypeScript for best in class instellisense. Use TypeScript for best in class instellisense.
For further information read the linked docs at the top of this README. ```typescript
import * as smartopen from '@pushrocks/smartopen';
const run = async () => {
await smartopen.openUrl('https://lossless.com');
};
run();
```
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.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)

1
dist/index.d.ts vendored
View File

@ -1 +0,0 @@
export declare let openUrl: (urlArg: any) => Promise<void>;

15
dist/index.js vendored
View File

@ -1,15 +0,0 @@
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
const open = require("open");
exports.openUrl = (urlArg) => __awaiter(this, void 0, void 0, function* () {
open(urlArg);
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7O0FBQUEsNkJBQTZCO0FBRWxCLFFBQUEsT0FBTyxHQUFHLENBQU8sTUFBTTtJQUNoQyxJQUFJLENBQUMsTUFBTSxDQUFDLENBQUE7QUFDZCxDQUFDLENBQUEsQ0FBQSJ9

19
npmextra.json Normal file
View File

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

1924
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,11 +1,12 @@
{ {
"name": "smartopen", "name": "@pushrocks/smartopen",
"version": "1.0.1", "version": "1.0.18",
"description": "open things", "description": "open things",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
"scripts": { "scripts": {
"test": "(npmts)" "test": "tstest test/",
"build": "tsbuild"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -21,7 +22,25 @@
}, },
"homepage": "https://gitlab.com/pushrocks/smartopen#README", "homepage": "https://gitlab.com/pushrocks/smartopen#README",
"dependencies": { "dependencies": {
"@types/open": "^0.0.29", "opn": "^6.0.0"
"open": "^0.0.5" },
} "devDependencies": {
"@gitzone/tsbuild": "^2.1.11",
"@gitzone/tstest": "^1.0.24",
"@types/node": "^12.0.4",
"tapbundle": "^2.0.0",
"tslint": "^5.17.0",
"tslint-config-prettier": "^1.18.0"
},
"private": true,
"files": [
"ts/*",
"ts_web/*",
"dist/*",
"dist_web/*",
"assets/*",
"cli.js",
"npmextra.json",
"readme.md"
]
} }

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 from 'opn';
import { ChildProcess } from 'child_process';
export let openUrl = async (urlArg) => { export let openUrl = async urlArg => {
open(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"