Compare commits

..

No commits in common. "master" and "v1.0.16" have entirely different histories.

12 changed files with 131 additions and 378 deletions

View File

@ -26,7 +26,6 @@ mirror:
snyk: snyk:
stage: security stage: security
script: script:
- npmci npm prepare
- npmci command npm install -g snyk - npmci command npm install -g snyk
- npmci command npm install --ignore-scripts - npmci command npm install --ignore-scripts
- npmci command snyk test - npmci command snyk test
@ -34,39 +33,24 @@ snyk:
- docker - docker
- notpriv - notpriv
sast:
stage: security
image: registry.gitlab.com/hosttoday/ht-docker-dbase:npmci
variables:
DOCKER_DRIVER: overlay2
allow_failure: true
services:
- docker:stable-dind
script:
- npmci npm prepare
- npmci npm install
- npmci command npm run build
- export SP_VERSION=$(echo "$CI_SERVER_VERSION" | sed 's/^\([0-9]*\)\.\([0-9]*\).*/\1-\2-stable/')
- docker run
--env SAST_CONFIDENCE_LEVEL="${SAST_CONFIDENCE_LEVEL:-3}"
--volume "$PWD:/code"
--volume /var/run/docker.sock:/var/run/docker.sock
"registry.gitlab.com/gitlab-org/security-products/sast:$SP_VERSION" /app/bin/run /code
artifacts:
reports:
sast: gl-sast-report.json
tags:
- docker
- priv
# ==================== # ====================
# test stage # test stage
# ==================== # ====================
testLEGACY:
stage: test
script:
- npmci node install legacy
- npmci npm install
- npmci npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- docker
- notpriv
allow_failure: true
testLTS: testLTS:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install lts - npmci node install lts
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -78,7 +62,6 @@ testLTS:
testSTABLE: testSTABLE:
stage: test stage: test
script: script:
- npmci npm prepare
- npmci node install stable - npmci node install stable
- npmci npm install - npmci npm install
- npmci npm test - npmci npm test
@ -134,10 +117,8 @@ pages:
image: hosttoday/ht-docker-node:npmci image: hosttoday/ht-docker-node:npmci
stage: metadata stage: metadata
script: script:
- npmci command npm install -g typedoc typescript - npmci command npm install -g npmpage
- npmci npm prepare - npmci command npmpage
- npmci npm install
- npmci command typedoc --module "commonjs" --target "ES2016" --out public/ ts/
tags: tags:
- docker - docker
- notpriv - notpriv
@ -148,3 +129,13 @@ pages:
paths: paths:
- public - public
allow_failure: true allow_failure: true
windowsCompatibility:
image: stefanscherer/node-windows:10-build-tools
stage: metadata
script:
- npm install & npm test
coverage: /\d+.?\d+?\%\s*coverage/
tags:
- windows
allow_failure: true

View File

@ -1,28 +1,33 @@
# @pushrocks/smartinject # smartinject
inject modules into node inject modules into node
## Availabililty and Links ## Availabililty
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartinject)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartinject) [![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartinject)
* [github.com (source mirror)](https://github.com/pushrocks/smartinject) [![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartinject)
* [docs (typedoc)](https://pushrocks.gitlab.io/smartinject/) [![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartinject)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartinject/)
## Status for master ## Status for master
[![build status](https://gitlab.com/pushrocks/smartinject/badges/master/build.svg)](https://gitlab.com/pushrocks/smartinject/commits/master)
[![coverage report](https://gitlab.com/pushrocks/smartinject/badges/master/coverage.svg)](https://gitlab.com/pushrocks/smartinject/commits/master) [![build status](https://GitLab.com/pushrocks/smartinject/badges/master/build.svg)](https://GitLab.com/pushrocks/smartinject/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/@pushrocks/smartinject.svg)](https://www.npmjs.com/package/@pushrocks/smartinject) [![coverage report](https://GitLab.com/pushrocks/smartinject/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartinject/commits/master)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartinject/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartinject) [![npm downloads per month](https://img.shields.io/npm/dm/smartinject.svg)](https://www.npmjs.com/package/smartinject)
[![TypeScript](https://img.shields.io/badge/TypeScript->=%203.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) [![Dependency Status](https://david-dm.org/pushrocks/smartinject.svg)](https://david-dm.org/pushrocks/smartinject)
[![node](https://img.shields.io/badge/node->=%2010.x.x-blue.svg)](https://nodejs.org/dist/latest-v10.x/docs/api/) [![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartinject/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartinject/master/dependencies/npm)
[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-prettier-ff69b4.svg)](https://prettier.io/) [![bitHound Code](https://www.bithound.io/github/pushrocks/smartinject/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartinject)
[![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/)
## 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. 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://maintainedby.lossless.com) [![repo-footer](https://pushrocks.gitlab.io/assets/repo-footer.svg)](https://push.rocks)

33
docs/index.md Normal file
View File

@ -0,0 +1,33 @@
# smartinject
inject modules into node
## Availabililty
[![npm](https://pushrocks.gitlab.io/assets/repo-button-npm.svg)](https://www.npmjs.com/package/smartinject)
[![git](https://pushrocks.gitlab.io/assets/repo-button-git.svg)](https://GitLab.com/pushrocks/smartinject)
[![git](https://pushrocks.gitlab.io/assets/repo-button-mirror.svg)](https://github.com/pushrocks/smartinject)
[![docs](https://pushrocks.gitlab.io/assets/repo-button-docs.svg)](https://pushrocks.gitlab.io/smartinject/)
## Status for master
[![build status](https://GitLab.com/pushrocks/smartinject/badges/master/build.svg)](https://GitLab.com/pushrocks/smartinject/commits/master)
[![coverage report](https://GitLab.com/pushrocks/smartinject/badges/master/coverage.svg)](https://GitLab.com/pushrocks/smartinject/commits/master)
[![npm downloads per month](https://img.shields.io/npm/dm/smartinject.svg)](https://www.npmjs.com/package/smartinject)
[![Dependency Status](https://david-dm.org/pushrocks/smartinject.svg)](https://david-dm.org/pushrocks/smartinject)
[![bitHound Dependencies](https://www.bithound.io/github/pushrocks/smartinject/badges/dependencies.svg)](https://www.bithound.io/github/pushrocks/smartinject/master/dependencies/npm)
[![bitHound Code](https://www.bithound.io/github/pushrocks/smartinject/badges/code.svg)](https://www.bithound.io/github/pushrocks/smartinject)
[![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/)
## Usage
Use TypeScript for best in class instellisense.
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)

View File

@ -1,19 +1,7 @@
{ {
"npmci": { "npmci": {
"npmGlobalTools": [], "globalNpmTools": [
"npmAccessLevel": "public" "npmts"
}, ]
"gitzone": {
"module": {
"githost": "code.foss.global",
"gitscope": "push.rocks",
"gitrepo": "smartinject",
"shortDescription": "inject modules into node",
"npmPackagename": "@push.rocks/smartinject",
"license": "MIT"
}
},
"tsdocs": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
} }
} }

279
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "@pushrocks/smartinject", "name": "@pushrocks/smartinject",
"version": "1.0.19", "version": "1.0.16",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
@ -40,22 +40,6 @@
"typescript": "^3.0.1" "typescript": "^3.0.1"
} }
}, },
"@gitzone/tstest": {
"version": "1.0.18",
"resolved": "https://verdaccio.lossless.one/@gitzone%2ftstest/-/tstest-1.0.18.tgz",
"integrity": "sha512-/owFKFsiFWh6miL+G/DYxBr+B6mgy9WzthLTqNyC7xriYoymvBgnmm5Wo3bo1NQN+1GY83zKeSpY7JB4r2LuEQ==",
"dev": true,
"requires": {
"@gitzone/tsrun": "^1.1.17",
"@pushrocks/consolecolor": "^2.0.1",
"@pushrocks/smartfile": "^6.0.11",
"@pushrocks/smartlog": "^2.0.9",
"@pushrocks/smartpromise": "^2.0.5",
"@pushrocks/smartshell": "^2.0.11",
"@types/figures": "^2.0.0",
"figures": "^2.0.0"
}
},
"@pushrocks/consolecolor": { "@pushrocks/consolecolor": {
"version": "2.0.1", "version": "2.0.1",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fconsolecolor/-/consolecolor-2.0.1.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fconsolecolor/-/consolecolor-2.0.1.tgz",
@ -201,17 +185,6 @@
"rxjs": "^6.3.3" "rxjs": "^6.3.3"
} }
}, },
"@pushrocks/smartshell": {
"version": "2.0.13",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartshell/-/smartshell-2.0.13.tgz",
"integrity": "sha512-jLfAhLxMVKAScKdln1QrQqBI7A7INhMNHIq28fJEBi0BNDUS0eerw4yMAnR4CRmcrh4xFp1z+ju1kaPO3I/4MA==",
"dev": true,
"requires": {
"@pushrocks/smartpromise": "^2.0.5",
"@types/which": "^1.3.1",
"which": "^1.3.1"
}
},
"@pushrocks/smarttime": { "@pushrocks/smarttime": {
"version": "3.0.5", "version": "3.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.5.tgz", "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.5.tgz",
@ -260,12 +233,6 @@
"@types/chai": "*" "@types/chai": "*"
} }
}, },
"@types/figures": {
"version": "2.0.0",
"resolved": "https://verdaccio.lossless.one/@types%2ffigures/-/figures-2.0.0.tgz",
"integrity": "sha512-mcRgJ+ncKuNI+Dwac7omO18B8C8u+YBS+AU/oyLhEyjAnT3cUUThhHgZpbiIvu5ZqSvdD30BXtrqg9nxc3OKMg==",
"dev": true
},
"@types/form-data": { "@types/form-data": {
"version": "2.2.1", "version": "2.2.1",
"resolved": "https://verdaccio.lossless.one/@types%2fform-data/-/form-data-2.2.1.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fform-data/-/form-data-2.2.1.tgz",
@ -326,12 +293,6 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"@types/which": {
"version": "1.3.1",
"resolved": "https://verdaccio.lossless.one/@types%2fwhich/-/which-1.3.1.tgz",
"integrity": "sha512-ZrJDWpvg75LTGX4XwuneY9s6bF3OeZcGTpoGh3zDV9ytzcHMFsRrMIaLBRJZQMBoGyKs6unBQfVdrLZiYfb1zQ==",
"dev": true
},
"@types/yargs": { "@types/yargs": {
"version": "12.0.9", "version": "12.0.9",
"resolved": "https://verdaccio.lossless.one/@types%2fyargs/-/yargs-12.0.9.tgz", "resolved": "https://verdaccio.lossless.one/@types%2fyargs/-/yargs-12.0.9.tgz",
@ -350,15 +311,9 @@
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"dev": true "dev": true
}, },
"ansi-styles": {
"version": "2.2.1",
"resolved": "https://verdaccio.lossless.one/ansi-styles/-/ansi-styles-2.2.1.tgz",
"integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=",
"dev": true
},
"argparse": { "argparse": {
"version": "1.0.10", "version": "1.0.10",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "resolved": "https://verdaccio.lossless.one/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -383,50 +338,9 @@
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
"dev": true "dev": true
}, },
"babel-code-frame": {
"version": "6.26.0",
"resolved": "https://verdaccio.lossless.one/babel-code-frame/-/babel-code-frame-6.26.0.tgz",
"integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=",
"dev": true,
"requires": {
"chalk": "^1.1.3",
"esutils": "^2.0.2",
"js-tokens": "^3.0.2"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://verdaccio.lossless.one/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
},
"chalk": {
"version": "1.1.3",
"resolved": "https://verdaccio.lossless.one/chalk/-/chalk-1.1.3.tgz",
"integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=",
"dev": true,
"requires": {
"ansi-styles": "^2.2.1",
"escape-string-regexp": "^1.0.2",
"has-ansi": "^2.0.0",
"strip-ansi": "^3.0.0",
"supports-color": "^2.0.0"
}
},
"strip-ansi": {
"version": "3.0.1",
"resolved": "https://verdaccio.lossless.one/strip-ansi/-/strip-ansi-3.0.1.tgz",
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"dev": true,
"requires": {
"ansi-regex": "^2.0.0"
}
}
}
},
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true "dev": true
}, },
@ -441,7 +355,7 @@
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -454,12 +368,6 @@
"resolved": "https://verdaccio.lossless.one/buffer-from/-/buffer-from-1.1.1.tgz", "resolved": "https://verdaccio.lossless.one/buffer-from/-/buffer-from-1.1.1.tgz",
"integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A=="
}, },
"builtin-modules": {
"version": "1.1.1",
"resolved": "https://verdaccio.lossless.one/builtin-modules/-/builtin-modules-1.1.1.tgz",
"integrity": "sha1-Jw8HbFpywC9bZaR9+Uxf46J4iS8=",
"dev": true
},
"camelcase": { "camelcase": {
"version": "5.0.0", "version": "5.0.0",
"resolved": "https://verdaccio.lossless.one/camelcase/-/camelcase-5.0.0.tgz", "resolved": "https://verdaccio.lossless.one/camelcase/-/camelcase-5.0.0.tgz",
@ -495,37 +403,6 @@
"integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==", "integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==",
"dev": true "dev": true
}, },
"chalk": {
"version": "2.4.2",
"resolved": "https://verdaccio.lossless.one/chalk/-/chalk-2.4.2.tgz",
"integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==",
"dev": true,
"requires": {
"ansi-styles": "^3.2.1",
"escape-string-regexp": "^1.0.5",
"supports-color": "^5.3.0"
},
"dependencies": {
"ansi-styles": {
"version": "3.2.1",
"resolved": "https://verdaccio.lossless.one/ansi-styles/-/ansi-styles-3.2.1.tgz",
"integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==",
"dev": true,
"requires": {
"color-convert": "^1.9.0"
}
},
"supports-color": {
"version": "5.5.0",
"resolved": "https://verdaccio.lossless.one/supports-color/-/supports-color-5.5.0.tgz",
"integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==",
"dev": true,
"requires": {
"has-flag": "^3.0.0"
}
}
}
},
"check-error": { "check-error": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://verdaccio.lossless.one/check-error/-/check-error-1.0.2.tgz", "resolved": "https://verdaccio.lossless.one/check-error/-/check-error-1.0.2.tgz",
@ -578,21 +455,6 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"dev": true "dev": true
}, },
"color-convert": {
"version": "1.9.3",
"resolved": "https://verdaccio.lossless.one/color-convert/-/color-convert-1.9.3.tgz",
"integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==",
"dev": true,
"requires": {
"color-name": "1.1.3"
}
},
"color-name": {
"version": "1.1.3",
"resolved": "https://verdaccio.lossless.one/color-name/-/color-name-1.1.3.tgz",
"integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=",
"dev": true
},
"combined-stream": { "combined-stream": {
"version": "1.0.7", "version": "1.0.7",
"resolved": "https://verdaccio.lossless.one/combined-stream/-/combined-stream-1.0.7.tgz", "resolved": "https://verdaccio.lossless.one/combined-stream/-/combined-stream-1.0.7.tgz",
@ -602,15 +464,9 @@
"delayed-stream": "~1.0.0" "delayed-stream": "~1.0.0"
} }
}, },
"commander": {
"version": "2.19.0",
"resolved": "https://verdaccio.lossless.one/commander/-/commander-2.19.0.tgz",
"integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==",
"dev": true
},
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "resolved": "https://verdaccio.lossless.one/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true "dev": true
}, },
@ -674,24 +530,12 @@
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
"dev": true "dev": true
}, },
"escape-string-regexp": {
"version": "1.0.5",
"resolved": "https://verdaccio.lossless.one/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
"integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=",
"dev": true
},
"esprima": { "esprima": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://verdaccio.lossless.one/esprima/-/esprima-4.0.1.tgz", "resolved": "https://verdaccio.lossless.one/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true "dev": true
}, },
"esutils": {
"version": "2.0.2",
"resolved": "https://verdaccio.lossless.one/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
"execa": { "execa": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/execa/-/execa-1.0.0.tgz", "resolved": "https://verdaccio.lossless.one/execa/-/execa-1.0.0.tgz",
@ -707,15 +551,6 @@
"strip-eof": "^1.0.0" "strip-eof": "^1.0.0"
} }
}, },
"figures": {
"version": "2.0.0",
"resolved": "https://verdaccio.lossless.one/figures/-/figures-2.0.0.tgz",
"integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
"dev": true,
"requires": {
"escape-string-regexp": "^1.0.5"
}
},
"file-uri-to-path": { "file-uri-to-path": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", "resolved": "https://verdaccio.lossless.one/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
@ -764,7 +599,7 @@
}, },
"fs.realpath": { "fs.realpath": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "resolved": "https://verdaccio.lossless.one/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true "dev": true
}, },
@ -809,32 +644,9 @@
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
"dev": true "dev": true
}, },
"has-ansi": {
"version": "2.0.0",
"resolved": "https://verdaccio.lossless.one/has-ansi/-/has-ansi-2.0.0.tgz",
"integrity": "sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=",
"dev": true,
"requires": {
"ansi-regex": "^2.0.0"
},
"dependencies": {
"ansi-regex": {
"version": "2.1.1",
"resolved": "https://verdaccio.lossless.one/ansi-regex/-/ansi-regex-2.1.1.tgz",
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"dev": true
}
}
},
"has-flag": {
"version": "3.0.0",
"resolved": "https://verdaccio.lossless.one/has-flag/-/has-flag-3.0.0.tgz",
"integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
"dev": true
},
"inflight": { "inflight": {
"version": "1.0.6", "version": "1.0.6",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "resolved": "https://verdaccio.lossless.one/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -888,12 +700,6 @@
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"dev": true "dev": true
}, },
"js-tokens": {
"version": "3.0.2",
"resolved": "https://verdaccio.lossless.one/js-tokens/-/js-tokens-3.0.2.tgz",
"integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=",
"dev": true
},
"js-yaml": { "js-yaml": {
"version": "3.12.1", "version": "3.12.1",
"resolved": "https://verdaccio.lossless.one/js-yaml/-/js-yaml-3.12.1.tgz", "resolved": "https://verdaccio.lossless.one/js-yaml/-/js-yaml-3.12.1.tgz",
@ -1006,7 +812,7 @@
}, },
"minimatch": { "minimatch": {
"version": "3.0.4", "version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "resolved": "https://verdaccio.lossless.one/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1021,7 +827,7 @@
}, },
"mkdirp": { "mkdirp": {
"version": "0.5.1", "version": "0.5.1",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "resolved": "https://verdaccio.lossless.one/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1030,7 +836,7 @@
"dependencies": { "dependencies": {
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true "dev": true
} }
@ -1065,7 +871,7 @@
}, },
"once": { "once": {
"version": "1.4.0", "version": "1.4.0",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "resolved": "https://verdaccio.lossless.one/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true, "dev": true,
"requires": { "requires": {
@ -1133,7 +939,7 @@
}, },
"path-is-absolute": { "path-is-absolute": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "resolved": "https://verdaccio.lossless.one/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true "dev": true
}, },
@ -1143,12 +949,6 @@
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"dev": true "dev": true
}, },
"path-parse": {
"version": "1.0.6",
"resolved": "https://verdaccio.lossless.one/path-parse/-/path-parse-1.0.6.tgz",
"integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
"dev": true
},
"pathval": { "pathval": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/pathval/-/pathval-1.1.0.tgz", "resolved": "https://verdaccio.lossless.one/pathval/-/pathval-1.1.0.tgz",
@ -1220,15 +1020,6 @@
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
"dev": true "dev": true
}, },
"resolve": {
"version": "1.10.0",
"resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.10.0.tgz",
"integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==",
"dev": true,
"requires": {
"path-parse": "^1.0.6"
}
},
"rxjs": { "rxjs": {
"version": "6.4.0", "version": "6.4.0",
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz", "resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz",
@ -1306,7 +1097,7 @@
}, },
"sprintf-js": { "sprintf-js": {
"version": "1.0.3", "version": "1.0.3",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "resolved": "https://verdaccio.lossless.one/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true "dev": true
}, },
@ -1371,12 +1162,6 @@
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"dev": true "dev": true
}, },
"supports-color": {
"version": "2.0.0",
"resolved": "https://verdaccio.lossless.one/supports-color/-/supports-color-2.0.0.tgz",
"integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=",
"dev": true
},
"symbol-tree": { "symbol-tree": {
"version": "3.2.2", "version": "3.2.2",
"resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.2.tgz", "resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.2.tgz",
@ -1414,42 +1199,6 @@
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
"dev": true "dev": true
}, },
"tslint": {
"version": "5.13.0",
"resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.13.0.tgz",
"integrity": "sha512-ECOOQRxXCYnUUePG5h/+Z1Zouobk3KFpIHA9aKBB/nnMxs97S1JJPDGt5J4cGm1y9U9VmVlfboOxA8n1kSNzGw==",
"dev": true,
"requires": {
"babel-code-frame": "^6.22.0",
"builtin-modules": "^1.1.1",
"chalk": "^2.3.0",
"commander": "^2.12.1",
"diff": "^3.2.0",
"glob": "^7.1.1",
"js-yaml": "^3.7.0",
"minimatch": "^3.0.4",
"mkdirp": "^0.5.1",
"resolve": "^1.3.2",
"semver": "^5.3.0",
"tslib": "^1.8.0",
"tsutils": "^2.27.2"
}
},
"tslint-config-prettier": {
"version": "1.18.0",
"resolved": "https://verdaccio.lossless.one/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz",
"integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==",
"dev": true
},
"tsutils": {
"version": "2.29.0",
"resolved": "https://verdaccio.lossless.one/tsutils/-/tsutils-2.29.0.tgz",
"integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==",
"dev": true,
"requires": {
"tslib": "^1.8.1"
}
},
"type-detect": { "type-detect": {
"version": "4.0.8", "version": "4.0.8",
"resolved": "https://verdaccio.lossless.one/type-detect/-/type-detect-4.0.8.tgz", "resolved": "https://verdaccio.lossless.one/type-detect/-/type-detect-4.0.8.tgz",
@ -1564,7 +1313,7 @@
}, },
"wrappy": { "wrappy": {
"version": "1.0.2", "version": "1.0.2",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "resolved": "https://verdaccio.lossless.one/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true "dev": true
}, },

View File

@ -1,7 +1,7 @@
{ {
"name": "@push.rocks/smartinject", "name": "@pushrocks/smartinject",
"private": false, "private": false,
"version": "1.0.19", "version": "1.0.16",
"description": "inject modules into node", "description": "inject modules into node",
"main": "dist/index.js", "main": "dist/index.js",
"typings": "dist/index.d.ts", "typings": "dist/index.d.ts",
@ -9,8 +9,8 @@
"test": "test" "test": "test"
}, },
"scripts": { "scripts": {
"test": "tstest test/", "test": "tsrun test/test.ts",
"build": "(tsbuild)" "build": "(npmts --nocoverage)"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@ -33,12 +33,8 @@
"through2": "^3.0.0" "through2": "^3.0.0"
}, },
"devDependencies": { "devDependencies": {
"@gitzone/tsbuild": "^2.1.8",
"@gitzone/tsrun": "^1.1.17", "@gitzone/tsrun": "^1.1.17",
"@gitzone/tstest": "^1.0.18",
"@pushrocks/tapbundle": "^3.0.7", "@pushrocks/tapbundle": "^3.0.7",
"@types/node": "^11.9.5", "@types/node": "^11.9.5"
"tslint": "^5.13.0",
"tslint-config-prettier": "^1.18.0"
} }
} }

View File

@ -27,10 +27,12 @@ tap.test('should get a string for a filePath from a .js file', async () => {
console.log(fileString); console.log(fileString);
}); });
tap.test('should accept a typescript registration', async () => {}); tap.test('should accept a typescript registration', async () => {
})
tap.test('should get a string for a file path from a .ts file', async () => { tap.test('should get a string for a file path from a .ts file', async () => {
let fileString = smartinject.getFileString(path.join(__dirname, 'typescript.example.ts')); let fileString = smartinject.getFileString(path.join(__dirname, 'typescript.example.ts'));
}); })
tap.start(); tap.start();

View File

@ -2,20 +2,20 @@ import * as through2 from 'through2';
import { cache } from './injection'; import { cache } from './injection';
import { Transform } from 'stream'; // needed for types import { Transform } from 'stream'; // needed for types
export const gulpPipe = () => { export let gulpPipe = function() {
return through2.obj((file, enc, cb) => { return through2.obj(function(file, enc, cb) {
cache[file.path] = file; cache[file.path] = file;
return cb(null, file); return cb(null, file);
}); });
}; };
export interface IFileObject { export interface fileObject {
path: string; path: string;
contents: Buffer; contents: Buffer;
} }
export const injectFileArray = async (fileArray: IFileObject[]) => { export let injectFileArray = async (fileArray: fileObject[]) => {
for (const fileObject of fileArray) { for (let fileObject of fileArray) {
/* if (/[yourTestFilenameHere.js]/.test(request)) { /* if (/[yourTestFilenameHere.js]/.test(request)) {
// console.log('injected:' + fileObject.path) // console.log('injected:' + fileObject.path)
} */ } */
@ -24,7 +24,7 @@ export const injectFileArray = async (fileArray: IFileObject[]) => {
return fileArray; return fileArray;
}; };
export const getFileString = (filePathArg: string) => { export let getFileString = (filePathArg: string) => {
if (cache[filePathArg]) { if (cache[filePathArg]) {
return cache[filePathArg].contents.toString(); return cache[filePathArg].contents.toString();
} }

View File

@ -1,18 +1,18 @@
const Module = require('module'); let Module = require('module');
import path = require('path'); import path = require('path');
import sourceMap = require('source-map-support'); import sourceMap = require('source-map-support');
import vm = require('vm'); import vm = require('vm');
export const cache = {}; export const cache = {};
export const extensionMap: { [key: string]: () => string } = {}; export const extensionMap: {[key: string]: () => string} = {}
const originalLoader = Module._extensions['.js']; let originalLoader = Module._extensions['.js'];
/** /**
* ensure sourcemap support works with the cache * ensure sourcemap support works with the cache
*/ */
sourceMap.install({ sourceMap.install({
retrieveFile: (path) => { retrieveFile: function(path) {
if (cache[path]) { if (cache[path]) {
return cache[path].contents.toString(); return cache[path].contents.toString();
} else if (cache[path + '.js']) { } else if (cache[path + '.js']) {
@ -22,8 +22,8 @@ sourceMap.install({
}); });
Module._extensions['.js'] = function(module, filename) { Module._extensions['.js'] = function(module, filename) {
const file = cache[filename]; let file = cache[filename];
const file2 = cache[filename + '.js']; let file2 = cache[filename + '.js'];
if (file) { if (file) {
module._compile(file.contents.toString(), filename); module._compile(file.contents.toString(), filename);
} else if (file2) { } else if (file2) {
@ -33,11 +33,11 @@ Module._extensions['.js'] = function(module, filename) {
} }
}; };
for (const extension in extensionMap) { for (let extension in extensionMap) {
if (extensionMap[extension]) { if(extensionMap[extension]) {
Module._extensions[extension] = function(module, filename) { Module._extensions[extension] = function(module, filename) {
const file = cache[filename]; let file = cache[filename];
const file2 = cache[filename + '.ts']; let file2 = cache[filename + '.ts'];
if (file) { if (file) {
module._compile(file.contents.toString(), filename); module._compile(file.contents.toString(), filename);
} else if (file2) { } else if (file2) {
@ -49,12 +49,12 @@ for (const extension in extensionMap) {
} }
} }
const originalModuleResolve = Module._resolveFilename; let originalModuleResolve = Module._resolveFilename;
Module._resolveFilename = function(request, parent, isMain) { Module._resolveFilename = function(request, parent, isMain) {
let resolvedRequest: string; let resolvedRequest: string;
if (parent && /^\./.test(request)) { if (parent && /^\./.test(request)) {
const resolvedDir = path.parse(parent.filename).dir; let resolvedDir = path.parse(parent.filename).dir;
resolvedRequest = path.join('/', resolvedDir, request); resolvedRequest = path.join('/', resolvedDir, request);
} else { } else {
resolvedRequest = request; resolvedRequest = request;
@ -66,8 +66,8 @@ Module._resolveFilename = function(request, parent, isMain) {
console.log(parent) console.log(parent)
} */ } */
const file = cache[resolvedRequest]; let file = cache[resolvedRequest];
const file2 = cache[resolvedRequest + '.js']; let file2 = cache[resolvedRequest + '.js'];
if (file || file2) { if (file || file2) {
return resolvedRequest; return resolvedRequest;
} else { } else {

View File

@ -1,5 +1,5 @@
import { extensionMap } from './injection'; import {extensionMap} from './injection';
export const registerExtension = (extensionName: string, compilerFunction) => { export const registerExtension = (extensionName: string, compilerFunction) => {
extensionMap[extensionName] = compilerFunction; extensionMap[extensionName] = compilerFunction;
}; }

View File

@ -1,14 +0,0 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "NodeNext",
"moduleResolution": "NodeNext",
"esModuleInterop": true,
"verbatimModuleSyntax": true
},
"exclude": [
"dist_*/**/*.d.ts"
]
}

3
tslint.json Normal file
View File

@ -0,0 +1,3 @@
{
"extends": "tslint-config-standard"
}