Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
1b54d2ca30 | |||
691e78ecbc | |||
e42cdcf339 | |||
49c56c3d53 | |||
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/
|
||||
public/
|
||||
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
|
||||
|
||||
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
|
||||
allow_failure: true
|
||||
script:
|
||||
- npm install -g tslint typescript
|
||||
- tslint -c tslint.json ./ts/**/*.ts
|
||||
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 @gitzone/tsdoc
|
||||
- npmci npm prepare
|
||||
- npmci npm install
|
||||
- npmci command tsdoc
|
||||
tags:
|
||||
- docker
|
||||
- notpriv
|
||||
only:
|
||||
- tags
|
||||
artifacts:
|
||||
expire_in: 1 week
|
||||
paths:
|
||||
- public
|
||||
allow_failure: true
|
||||
|
41
README.md
41
README.md
@ -1,29 +1,36 @@
|
||||
# smartopen
|
||||
# @pushrocks/smartopen
|
||||
open things
|
||||
|
||||
## Availabililty
|
||||
[](https://www.npmjs.com/package/smartopen)
|
||||
[](https://GitLab.com/pushrocks/smartopen)
|
||||
[](https://github.com/pushrocks/smartopen)
|
||||
[](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
|
||||
[](https://GitLab.com/pushrocks/smartopen/commits/master)
|
||||
[](https://GitLab.com/pushrocks/smartopen/commits/master)
|
||||
[](https://www.npmjs.com/package/smartopen)
|
||||
[](https://david-dm.org/pushrocks/smartopen)
|
||||
[](https://www.bithound.io/github/pushrocks/smartopen/master/dependencies/npm)
|
||||
[](https://www.bithound.io/github/pushrocks/smartopen)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v6.x/docs/api/)
|
||||
[](http://standardjs.com/)
|
||||
[](https://gitlab.com/pushrocks/smartopen/commits/master)
|
||||
[](https://gitlab.com/pushrocks/smartopen/commits/master)
|
||||
[](https://www.npmjs.com/package/@pushrocks/smartopen)
|
||||
[](https://snyk.io/test/npm/@pushrocks/smartopen)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://nodejs.org/dist/latest-v10.x/docs/api/)
|
||||
[](https://prettier.io/)
|
||||
|
||||
## Usage
|
||||
|
||||
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)
|
||||
| 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,19 @@
|
||||
{
|
||||
"npmci": {
|
||||
"globalNpmTools": [
|
||||
"npmts"
|
||||
]
|
||||
"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
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",
|
||||
"version": "1.0.2",
|
||||
"name": "@pushrocks/smartopen",
|
||||
"version": "1.0.19",
|
||||
"description": "open things",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"test": "(npmts)"
|
||||
"test": "tstest test/",
|
||||
"build": "tsbuild"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@ -21,7 +22,25 @@
|
||||
},
|
||||
"homepage": "https://gitlab.com/pushrocks/smartopen#README",
|
||||
"dependencies": {
|
||||
"@types/open": "^0.0.29",
|
||||
"open": "^0.0.5"
|
||||
}
|
||||
"opn": "^6.0.0"
|
||||
},
|
||||
"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": false,
|
||||
"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();
|
16
ts/index.ts
16
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) => {
|
||||
open(urlArg)
|
||||
}
|
||||
export let openUrl = async 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