diff --git a/README.md b/README.md index 23a83a0..b4d12d7 100644 --- a/README.md +++ b/README.md @@ -70,15 +70,20 @@ Each function will throw if its environment variable is not set and `opts.defaul ### Register -Runtime hook for: +Runtime hook for import paths relative to `/src`. -- Import paths relative to `/src` -- Stack traces that map back to your `.ts` sources - -Make a side-effectful import at the top of your entry point, e.g. `/src/app.ts`: +Make a side-effectful import at the top of your entry point(s): ```typescript +// /src/register.ts + import 'skuba-dive/register'; +``` + +```typescript +// /src/app.ts + +import './register'; import { config } from 'src/config'; diff --git a/package.json b/package.json index 650601d..be9a275 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,16 @@ "url": "https://github.com/seek-oss/skuba-dive/issues" }, "dependencies": { - "module-alias": "^2.2.2", - "source-map-support": "^0.5.16" + "module-alias": "^2.2.2" }, "description": "Minimal runtime for skuba", "devDependencies": { "@types/module-alias": "2.0.1", "skuba": "3.17.2" }, + "engines": { + "node": ">=14.18" + }, "files": [ "lib/**/*.d.ts", "lib/**/*.js", diff --git a/register.js b/register.js index d447dfb..8bfd991 100644 --- a/register.js +++ b/register.js @@ -1,11 +1,3 @@ -// istanbul ignore if -/** - * @see {@link https://github.com/kulshekhar/ts-jest/issues/727#issuecomment-422743605} - */ -if (typeof jest === 'undefined') { - require('source-map-support/register'); -} - /** * @see {@link https://nodejs.org/api/deprecations.html#DEP0144} */ diff --git a/yarn.lock b/yarn.lock index 3b4490e..537559d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4912,76 +4912,76 @@ npm@^7.0.0: resolved "https://registry.yarnpkg.com/npm/-/npm-7.24.2.tgz#861117af8241bea592289f22407230e5300e59ca" integrity sha512-120p116CE8VMMZ+hk8IAb1inCPk4Dj3VZw29/n2g6UI77urJKVYb7FZUDW8hY+EBnfsjI/2yrobBgFyzo7YpVQ== dependencies: - "@isaacs/string-locale-compare" "*" - "@npmcli/arborist" "*" - "@npmcli/ci-detect" "*" - "@npmcli/config" "*" - "@npmcli/map-workspaces" "*" - "@npmcli/package-json" "*" - "@npmcli/run-script" "*" - abbrev "*" - ansicolors "*" - ansistyles "*" - archy "*" - cacache "*" - chalk "*" - chownr "*" - cli-columns "*" - cli-table3 "*" - columnify "*" - fastest-levenshtein "*" - glob "*" - graceful-fs "*" - hosted-git-info "*" - ini "*" - init-package-json "*" - is-cidr "*" - json-parse-even-better-errors "*" - libnpmaccess "*" - libnpmdiff "*" - libnpmexec "*" - libnpmfund "*" - libnpmhook "*" - libnpmorg "*" - libnpmpack "*" - libnpmpublish "*" - libnpmsearch "*" - libnpmteam "*" - libnpmversion "*" - make-fetch-happen "*" - minipass "*" - minipass-pipeline "*" - mkdirp "*" - mkdirp-infer-owner "*" - ms "*" - node-gyp "*" - nopt "*" - npm-audit-report "*" - npm-install-checks "*" - npm-package-arg "*" - npm-pick-manifest "*" - npm-profile "*" - npm-registry-fetch "*" - npm-user-validate "*" - npmlog "*" - opener "*" - pacote "*" - parse-conflict-json "*" - qrcode-terminal "*" - read "*" - read-package-json "*" - read-package-json-fast "*" - readdir-scoped-modules "*" - rimraf "*" - semver "*" - ssri "*" - tar "*" - text-table "*" - tiny-relative-date "*" - treeverse "*" - validate-npm-package-name "*" - which "*" - write-file-atomic "*" + "@isaacs/string-locale-compare" "^1.1.0" + "@npmcli/arborist" "^2.9.0" + "@npmcli/ci-detect" "^1.2.0" + "@npmcli/config" "^2.3.0" + "@npmcli/map-workspaces" "^1.0.4" + "@npmcli/package-json" "^1.0.1" + "@npmcli/run-script" "^1.8.6" + abbrev "~1.1.1" + ansicolors "~0.3.2" + ansistyles "~0.1.3" + archy "~1.0.0" + cacache "^15.3.0" + chalk "^4.1.2" + chownr "^2.0.0" + cli-columns "^3.1.2" + cli-table3 "^0.6.0" + columnify "~1.5.4" + fastest-levenshtein "^1.0.12" + glob "^7.2.0" + graceful-fs "^4.2.8" + hosted-git-info "^4.0.2" + ini "^2.0.0" + init-package-json "^2.0.5" + is-cidr "^4.0.2" + json-parse-even-better-errors "^2.3.1" + libnpmaccess "^4.0.2" + libnpmdiff "^2.0.4" + libnpmexec "^2.0.1" + libnpmfund "^1.1.0" + libnpmhook "^6.0.2" + libnpmorg "^2.0.2" + libnpmpack "^2.0.1" + libnpmpublish "^4.0.1" + libnpmsearch "^3.1.1" + libnpmteam "^2.0.3" + libnpmversion "^1.2.1" + make-fetch-happen "^9.1.0" + minipass "^3.1.3" + minipass-pipeline "^1.2.4" + mkdirp "^1.0.4" + mkdirp-infer-owner "^2.0.0" + ms "^2.1.2" + node-gyp "^7.1.2" + nopt "^5.0.0" + npm-audit-report "^2.1.5" + npm-install-checks "^4.0.0" + npm-package-arg "^8.1.5" + npm-pick-manifest "^6.1.1" + npm-profile "^5.0.3" + npm-registry-fetch "^11.0.0" + npm-user-validate "^1.0.1" + npmlog "^5.0.1" + opener "^1.5.2" + pacote "^11.3.5" + parse-conflict-json "^1.1.1" + qrcode-terminal "^0.12.0" + read "~1.0.7" + read-package-json "^4.1.1" + read-package-json-fast "^2.0.3" + readdir-scoped-modules "^1.1.0" + rimraf "^3.0.2" + semver "^7.3.5" + ssri "^8.0.1" + tar "^6.1.11" + text-table "~0.2.0" + tiny-relative-date "^1.3.0" + treeverse "^1.0.4" + validate-npm-package-name "~3.0.0" + which "^2.0.2" + write-file-atomic "^3.0.3" npmlog@*, npmlog@^6.0.0: version "6.0.0" @@ -5978,7 +5978,7 @@ socks@^2.6.1: ip "^1.1.5" smart-buffer "^4.1.0" -source-map-support@^0.5.12, source-map-support@^0.5.16, source-map-support@^0.5.17, source-map-support@^0.5.6: +source-map-support@^0.5.12, source-map-support@^0.5.17, source-map-support@^0.5.6: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" integrity sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==