Compare commits

...

10 Commits

Author SHA1 Message Date
4e11198cc5 update npmextra.json: githost 2024-04-01 21:35:31 +02:00
406d1a9c45 update npmextra.json: githost 2024-04-01 19:58:28 +02:00
7af6c87772 update npmextra.json: githost 2024-03-30 21:47:26 +01:00
8c00da9ebe switch to new org scheme 2023-07-10 02:56:23 +02:00
75f5204bee 1.0.19 2019-02-27 23:44:13 +01:00
2f2014e332 fix(npm): fix access level 2019-02-27 23:44:12 +01:00
b825a0820b 1.0.18 2019-02-24 23:18:01 +01:00
fecbeb0afc fix(core): update 2019-02-24 23:18:01 +01:00
fd7c7b6c8c 1.0.17 2019-02-24 23:14:47 +01:00
cd1c41b513 fix(core): update 2019-02-24 23:14:47 +01:00
12 changed files with 378 additions and 131 deletions

View File

@ -26,6 +26,7 @@ mirror:
snyk:
stage: security
script:
- npmci npm prepare
- npmci command npm install -g snyk
- npmci command npm install --ignore-scripts
- npmci command snyk test
@ -33,24 +34,39 @@ snyk:
- docker
- 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
# ====================
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:
stage: test
script:
- npmci npm prepare
- npmci node install lts
- npmci npm install
- npmci npm test
@ -62,6 +78,7 @@ testLTS:
testSTABLE:
stage: test
script:
- npmci npm prepare
- npmci node install stable
- npmci npm install
- npmci npm test
@ -117,8 +134,10 @@ pages:
image: hosttoday/ht-docker-node:npmci
stage: metadata
script:
- npmci command npm install -g npmpage
- npmci command npmpage
- 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
@ -129,13 +148,3 @@ pages:
paths:
- public
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,33 +1,28 @@
# smartinject
# @pushrocks/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/)
## Availabililty and Links
* [npmjs.org (npm package)](https://www.npmjs.com/package/@pushrocks/smartinject)
* [gitlab.com (source)](https://gitlab.com/pushrocks/smartinject)
* [github.com (source mirror)](https://github.com/pushrocks/smartinject)
* [docs (typedoc)](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/)
[![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/@pushrocks/smartinject.svg)](https://www.npmjs.com/package/@pushrocks/smartinject)
[![Known Vulnerabilities](https://snyk.io/test/npm/@pushrocks/smartinject/badge.svg)](https://snyk.io/test/npm/@pushrocks/smartinject)
[![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)
| 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)

View File

@ -1,33 +0,0 @@
# 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,7 +1,19 @@
{
"npmci": {
"globalNpmTools": [
"npmts"
]
"npmGlobalTools": [],
"npmAccessLevel": "public"
},
"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",
"version": "1.0.16",
"version": "1.0.19",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -40,6 +40,22 @@
"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": {
"version": "2.0.1",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fconsolecolor/-/consolecolor-2.0.1.tgz",
@ -185,6 +201,17 @@
"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": {
"version": "3.0.5",
"resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmarttime/-/smarttime-3.0.5.tgz",
@ -233,6 +260,12 @@
"@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": {
"version": "2.2.1",
"resolved": "https://verdaccio.lossless.one/@types%2fform-data/-/form-data-2.2.1.tgz",
@ -293,6 +326,12 @@
"@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": {
"version": "12.0.9",
"resolved": "https://verdaccio.lossless.one/@types%2fyargs/-/yargs-12.0.9.tgz",
@ -311,9 +350,15 @@
"integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
"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": {
"version": "1.0.10",
"resolved": "https://verdaccio.lossless.one/argparse/-/argparse-1.0.10.tgz",
"resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz",
"integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==",
"dev": true,
"requires": {
@ -338,9 +383,50 @@
"integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=",
"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": {
"version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/balanced-match/-/balanced-match-1.0.0.tgz",
"resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"dev": true
},
@ -355,7 +441,7 @@
},
"brace-expansion": {
"version": "1.1.11",
"resolved": "https://verdaccio.lossless.one/brace-expansion/-/brace-expansion-1.1.11.tgz",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"dev": true,
"requires": {
@ -368,6 +454,12 @@
"resolved": "https://verdaccio.lossless.one/buffer-from/-/buffer-from-1.1.1.tgz",
"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": {
"version": "5.0.0",
"resolved": "https://verdaccio.lossless.one/camelcase/-/camelcase-5.0.0.tgz",
@ -403,6 +495,37 @@
"integrity": "sha512-sydDC3S3pNAQMYwJrs6dQX0oBQ6KfIPuOZ78n7rocW0eJJlsHPh2t3kwW7xfwYA/1Bf6/arGtSUo16rxR2JFlw==",
"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": {
"version": "1.0.2",
"resolved": "https://verdaccio.lossless.one/check-error/-/check-error-1.0.2.tgz",
@ -455,6 +578,21 @@
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"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": {
"version": "1.0.7",
"resolved": "https://verdaccio.lossless.one/combined-stream/-/combined-stream-1.0.7.tgz",
@ -464,9 +602,15 @@
"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": {
"version": "0.0.1",
"resolved": "https://verdaccio.lossless.one/concat-map/-/concat-map-0.0.1.tgz",
"resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"dev": true
},
@ -530,12 +674,24 @@
"integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==",
"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": {
"version": "4.0.1",
"resolved": "https://verdaccio.lossless.one/esprima/-/esprima-4.0.1.tgz",
"integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==",
"dev": true
},
"esutils": {
"version": "2.0.2",
"resolved": "https://verdaccio.lossless.one/esutils/-/esutils-2.0.2.tgz",
"integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=",
"dev": true
},
"execa": {
"version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/execa/-/execa-1.0.0.tgz",
@ -551,6 +707,15 @@
"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": {
"version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz",
@ -599,7 +764,7 @@
},
"fs.realpath": {
"version": "1.0.0",
"resolved": "https://verdaccio.lossless.one/fs.realpath/-/fs.realpath-1.0.0.tgz",
"resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"dev": true
},
@ -644,9 +809,32 @@
"integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==",
"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": {
"version": "1.0.6",
"resolved": "https://verdaccio.lossless.one/inflight/-/inflight-1.0.6.tgz",
"resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz",
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"dev": true,
"requires": {
@ -700,6 +888,12 @@
"integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=",
"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": {
"version": "3.12.1",
"resolved": "https://verdaccio.lossless.one/js-yaml/-/js-yaml-3.12.1.tgz",
@ -812,7 +1006,7 @@
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://verdaccio.lossless.one/minimatch/-/minimatch-3.0.4.tgz",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"dev": true,
"requires": {
@ -827,7 +1021,7 @@
},
"mkdirp": {
"version": "0.5.1",
"resolved": "https://verdaccio.lossless.one/mkdirp/-/mkdirp-0.5.1.tgz",
"resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz",
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"dev": true,
"requires": {
@ -836,7 +1030,7 @@
"dependencies": {
"minimist": {
"version": "0.0.8",
"resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz",
"resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz",
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"dev": true
}
@ -871,7 +1065,7 @@
},
"once": {
"version": "1.4.0",
"resolved": "https://verdaccio.lossless.one/once/-/once-1.4.0.tgz",
"resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"dev": true,
"requires": {
@ -939,7 +1133,7 @@
},
"path-is-absolute": {
"version": "1.0.1",
"resolved": "https://verdaccio.lossless.one/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz",
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"dev": true
},
@ -949,6 +1143,12 @@
"integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=",
"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": {
"version": "1.1.0",
"resolved": "https://verdaccio.lossless.one/pathval/-/pathval-1.1.0.tgz",
@ -1020,6 +1220,15 @@
"integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=",
"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": {
"version": "6.4.0",
"resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz",
@ -1097,7 +1306,7 @@
},
"sprintf-js": {
"version": "1.0.3",
"resolved": "https://verdaccio.lossless.one/sprintf-js/-/sprintf-js-1.0.3.tgz",
"resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz",
"integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=",
"dev": true
},
@ -1162,6 +1371,12 @@
"integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=",
"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": {
"version": "3.2.2",
"resolved": "https://verdaccio.lossless.one/symbol-tree/-/symbol-tree-3.2.2.tgz",
@ -1199,6 +1414,42 @@
"integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==",
"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": {
"version": "4.0.8",
"resolved": "https://verdaccio.lossless.one/type-detect/-/type-detect-4.0.8.tgz",
@ -1313,7 +1564,7 @@
},
"wrappy": {
"version": "1.0.2",
"resolved": "https://verdaccio.lossless.one/wrappy/-/wrappy-1.0.2.tgz",
"resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz",
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"dev": true
},

View File

@ -1,7 +1,7 @@
{
"name": "@pushrocks/smartinject",
"name": "@push.rocks/smartinject",
"private": false,
"version": "1.0.16",
"version": "1.0.19",
"description": "inject modules into node",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
@ -9,8 +9,8 @@
"test": "test"
},
"scripts": {
"test": "tsrun test/test.ts",
"build": "(npmts --nocoverage)"
"test": "tstest test/",
"build": "(tsbuild)"
},
"repository": {
"type": "git",
@ -33,8 +33,12 @@
"through2": "^3.0.0"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.8",
"@gitzone/tsrun": "^1.1.17",
"@gitzone/tstest": "^1.0.18",
"@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,12 +27,10 @@ tap.test('should get a string for a filePath from a .js file', async () => {
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 () => {
let fileString = smartinject.getFileString(path.join(__dirname, 'typescript.example.ts'));
})
});
tap.start();

View File

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

View File

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

View File

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

14
tsconfig.json Normal file
View File

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

View File

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