Compare commits
27 Commits
Author | SHA1 | Date | |
---|---|---|---|
18454e53dc | |||
4d219d37d7 | |||
42e6898dc5 | |||
67b0d0bd37 | |||
f9054f6bfd | |||
b959d8566e | |||
86632619fd | |||
ac05c11927 | |||
4cab83991b | |||
33f76aeca8 | |||
36fd64f0e7 | |||
7256714541 | |||
00dc400849 | |||
bd17352fd4 | |||
a26b36fbed | |||
3e91a37247 | |||
4f0923a4c1 | |||
0cbc8d267a | |||
8d8cde1447 | |||
53f01903db | |||
831bbd2488 | |||
b26b03f04b | |||
cb1ee35f2e | |||
9681acdcc4 | |||
1498f6c2b2 | |||
0430397e4f | |||
82672e191e |
20
.gitignore
vendored
20
.gitignore
vendored
@ -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
|
@ -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
|
||||||
|
41
README.md
41
README.md
@ -1,29 +1,36 @@
|
|||||||
# smartopen
|
# @pushrocks/smartopen
|
||||||
open things
|
open things
|
||||||
|
|
||||||
## Availabililty
|
## Availabililty and Links
|
||||||
[](https://www.npmjs.com/package/smartopen)
|
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartopen)
|
||||||
[](https://GitLab.com/pushrocks/smartopen)
|
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartopen)
|
||||||
[](https://github.com/pushrocks/smartopen)
|
* [github.com (source mirror)](https://github.com/pushrocks/smartopen)
|
||||||
[](https://pushrocks.gitlab.io/smartopen/)
|
* [docs (typedoc)](https://pushrocks.gitlab.io/smartopen/)
|
||||||
|
|
||||||
## Status for master
|
## Status for master
|
||||||
[](https://GitLab.com/pushrocks/smartopen/commits/master)
|
[](https://gitlab.com/pushrocks/smartopen/commits/master)
|
||||||
[](https://GitLab.com/pushrocks/smartopen/commits/master)
|
[](https://gitlab.com/pushrocks/smartopen/commits/master)
|
||||||
[](https://www.npmjs.com/package/smartopen)
|
[](https://www.npmjs.com/package/@pushrocks/smartopen)
|
||||||
[](https://david-dm.org/pushrocks/smartopen)
|
[](https://snyk.io/test/npm/@pushrocks/smartopen)
|
||||||
[](https://www.bithound.io/github/pushrocks/smartopen/master/dependencies/npm)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://www.bithound.io/github/pushrocks/smartopen)
|
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
[](https://prettier.io/)
|
||||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
|
||||||
[](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)
|
||||||
|
|
||||||
[](https://push.rocks)
|
[](https://maintainedby.lossless.com)
|
||||||
|
1
dist/index.d.ts
vendored
1
dist/index.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
export declare let openUrl: (urlArg: any) => Promise<void>;
|
|
15
dist/index.js
vendored
15
dist/index.js
vendored
@ -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
|
|
@ -1,7 +1,23 @@
|
|||||||
{
|
{
|
||||||
"npmci": {
|
"npmci": {
|
||||||
"globalNpmTools": [
|
"npmGlobalTools": [
|
||||||
"npmts"
|
"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"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
1924
package-lock.json
generated
Normal file
1924
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
package.json
31
package.json
@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "smartopen",
|
"name": "@pushrocks/smartopen",
|
||||||
"version": "1.0.2",
|
"version": "1.0.17",
|
||||||
"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
9
test/test.ts
Normal 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();
|
14
ts/index.ts
14
ts/index.ts
@ -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;
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
16
tslint.json
16
tslint.json
@ -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"
|
||||||
}
|
}
|
||||||
|
11
yarn.lock
11
yarn.lock
@ -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"
|
|
Reference in New Issue
Block a user