diff --git a/package-lock.json b/package-lock.json index 7c187472..5bb49e9e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,6 @@ "dependencies": { "@sentry/node": "^5.15.5", "@types/glob": "^7.1.1", - "@types/puppeteer": "^5.4.0", "argparse": "^1.0.10", "axe-core": "^4.1.1", "chokidar": "^3.4.2", @@ -18,7 +17,7 @@ "emailjs-imap-client": "^3.0.7", "emailjs-mime-parser": "^2.0.5", "errorstacks": "^1.1.5", - "esbuild": "^0.9.3", + "esbuild": "^0.9.6", "esbuild-register": "^2.3.0", "form-data": "^2.3.3", "glob": "^7.1.6", @@ -53,7 +52,7 @@ "prettier": "^2.0.5", "puppeteer": "^8.0.0", "rimraf": "^3.0.2", - "ts-node": "^9.0.0", + "ts-node": "^9.1.1", "typedoc": "^0.17.4", "typescript": "^4.2.3" }, @@ -831,14 +830,6 @@ "@types/node": "*" } }, - "node_modules/@types/puppeteer": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.0.tgz", - "integrity": "sha512-zTYDLjnHjgzokrwKt7N0rgn7oZPYo1J0m8Ghu+gXqzLCEn8RWbELa2uprE2UFJ0jU/Sk0x9jXXdOH/5QQLFHhQ==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/sharp": { "version": "0.27.1", "resolved": "https://registry.npmjs.org/@types/sharp/-/sharp-0.27.1.tgz", @@ -1704,6 +1695,12 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "node_modules/create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "node_modules/cross-spawn": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", @@ -2046,9 +2043,10 @@ "integrity": "sha512-ANB+6I4d0oULE2lEEXOJNvH0mpZ5YhFUhzEhJRB2v+FJzmJYRFei2fHS755gsJ+F20exLVNS2ND9xvZ2oYGhvQ==" }, "node_modules/esbuild": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.3.tgz", - "integrity": "sha512-G8k0olucZp3LJ7I/p8y388t+IEyb2Y78nHrLeIxuqZqh6TYqDYP/B/7drAvYKfh83CGwKal9txVP+FTypsPJug==", + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.7.tgz", + "integrity": "sha512-VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg==", + "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" } @@ -5792,12 +5790,13 @@ } }, "node_modules/ts-node": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", - "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", "dev": true, "dependencies": { "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "source-map-support": "^0.5.17", @@ -5811,6 +5810,9 @@ }, "engines": { "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" } }, "node_modules/tslib": { @@ -7024,14 +7026,6 @@ "@types/node": "*" } }, - "@types/puppeteer": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@types/puppeteer/-/puppeteer-5.4.0.tgz", - "integrity": "sha512-zTYDLjnHjgzokrwKt7N0rgn7oZPYo1J0m8Ghu+gXqzLCEn8RWbELa2uprE2UFJ0jU/Sk0x9jXXdOH/5QQLFHhQ==", - "requires": { - "@types/node": "*" - } - }, "@types/sharp": { "version": "0.27.1", "resolved": "https://registry.npmjs.org/@types/sharp/-/sharp-0.27.1.tgz", @@ -7756,6 +7750,12 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, + "create-require": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", + "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", + "dev": true + }, "cross-spawn": { "version": "7.0.2", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.2.tgz", @@ -8044,9 +8044,9 @@ "integrity": "sha512-ANB+6I4d0oULE2lEEXOJNvH0mpZ5YhFUhzEhJRB2v+FJzmJYRFei2fHS755gsJ+F20exLVNS2ND9xvZ2oYGhvQ==" }, "esbuild": { - "version": "0.9.3", - "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.3.tgz", - "integrity": "sha512-G8k0olucZp3LJ7I/p8y388t+IEyb2Y78nHrLeIxuqZqh6TYqDYP/B/7drAvYKfh83CGwKal9txVP+FTypsPJug==" + "version": "0.9.7", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.9.7.tgz", + "integrity": "sha512-VtUf6aQ89VTmMLKrWHYG50uByMF4JQlVysb8dmg6cOgW8JnFCipmz7p+HNBl+RR3LLCuBxFGVauAe2wfnF9bLg==" }, "esbuild-register": { "version": "2.3.0", @@ -11070,12 +11070,13 @@ } }, "ts-node": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", - "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", "dev": true, "requires": { "arg": "^4.1.0", + "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", "source-map-support": "^0.5.17", diff --git a/package.json b/package.json index 65f0f7d7..1f3c6690 100644 --- a/package.json +++ b/package.json @@ -96,7 +96,6 @@ "dependencies": { "@sentry/node": "^5.15.5", "@types/glob": "^7.1.1", - "@types/puppeteer": "^5.4.0", "argparse": "^1.0.10", "axe-core": "^4.1.1", "chokidar": "^3.4.2", @@ -104,7 +103,7 @@ "emailjs-imap-client": "^3.0.7", "emailjs-mime-parser": "^2.0.5", "errorstacks": "^1.1.5", - "esbuild": "^0.9.3", + "esbuild": "^0.9.6", "esbuild-register": "^2.3.0", "form-data": "^2.3.3", "glob": "^7.1.6", @@ -136,7 +135,7 @@ "prettier": "^2.0.5", "puppeteer": "^8.0.0", "rimraf": "^3.0.2", - "ts-node": "^9.0.0", + "ts-node": "^9.1.1", "typedoc": "^0.17.4", "typescript": "^4.2.3" }, diff --git a/src/index.js b/src/index.js index d77d728d..e3cea4bd 100644 --- a/src/index.js +++ b/src/index.js @@ -1,6 +1,8 @@ -const { register } = require('esbuild-register/dist/node'); +const {register} = require('esbuild-register/dist/node'); register({ - sourcemap:true + sourcemap: true, + minify: false, + keepNames: false, }); const {main} = require('./main'); diff --git a/tests/selftest_ts_esbuild.js b/tests/selftest_ts_esbuild.js deleted file mode 100644 index ba56791a..00000000 --- a/tests/selftest_ts_esbuild.js +++ /dev/null @@ -1,24 +0,0 @@ -const assert = require('assert').strict; -const path = require('path'); -const child_process = require('child_process'); - -async function run() { - const script = path.join(__dirname, '..', 'bin', 'cli.js'); - const {stderr} = await new Promise((resolve, reject) => { - child_process.execFile( - 'node', - [script, '--exit-zero', '--no-screenshots', '--no-pdf'], - (err, stdout, stderr) => { - if (err) reject(err); - else resolve({stdout, stderr}); - } - ); - }); - - assert(/1 tests passed/.test(stderr), 'Did run any tests'); -} - -module.exports = { - description: 'Support node require hooks', - run, -}; diff --git a/tsconfig.json b/tsconfig.json index 7122f428..5b48b2a9 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,7 @@ { "compilerOptions": { "module": "CommonJS", + "moduleResolution": "Node", "allowJs": true, "alwaysStrict": true, "strict": true,