From 3bb7623ade684588b4002bc4a02684414f150006 Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Fri, 30 Jun 2023 14:59:29 +0100 Subject: [PATCH 1/7] deps: add esbuild dependency --- package-lock.json | 574 ++++++++++++++++++++++++++++++++++++++++++++++ package.json | 1 + 2 files changed, 575 insertions(+) diff --git a/package-lock.json b/package-lock.json index ee1341051c..5d47210e39 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,6 +25,7 @@ "chai": "^4.2.0", "copy-webpack-plugin": "^11.0.0", "cors": "~2.7", + "esbuild": "^0.18.10", "eslint": "^7.13.0", "eslint-plugin-jsdoc": "^40.0.0", "eslint-plugin-security": "^1.4.0", @@ -136,6 +137,358 @@ "node": "^14 || ^16 || ^17 || ^18 || ^19" } }, + "node_modules/@esbuild/android-arm": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.10.tgz", + "integrity": "sha512-3KClmVNd+Fku82uZJz5C4Rx8m1PPmWUFz5Zkw8jkpZPOmsq+EG1TTOtw1OXkHuX3WczOFQigrtf60B1ijKwNsg==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.10.tgz", + "integrity": "sha512-ynm4naLbNbK0ajf9LUWtQB+6Vfg1Z/AplArqr4tGebC00Z6m9Y91OVIcjDa461wGcZwcaHYaZAab4yJxfhisTQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/android-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.10.tgz", + "integrity": "sha512-vFfXj8P9Yfjh54yqUDEHKzqzYuEfPyAOl3z7R9hjkwt+NCvbn9VMxX+IILnAfdImRBfYVItgSUsqGKhJFnBwZw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.10.tgz", + "integrity": "sha512-k2OJQ7ZxE6sVc91+MQeZH9gFeDAH2uIYALPAwTjTCvcPy9Dzrf7V7gFUQPYkn09zloWhQ+nvxWHia2x2ZLR0sQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.10.tgz", + "integrity": "sha512-tnz/mdZk1L1Z3WpGjin/L2bKTe8/AKZpI8fcCLtH+gq8WXWsCNJSxlesAObV4qbtTl6pG5vmqFXfWUQ5hV8PAQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.10.tgz", + "integrity": "sha512-QJluV0LwBrbHnYYwSKC+K8RGz0g/EyhpQH1IxdoFT0nM7PfgjE+aS8wxq/KFEsU0JkL7U/EEKd3O8xVBxXb2aA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.10.tgz", + "integrity": "sha512-Hi/ycUkS6KTw+U9G5PK5NoK7CZboicaKUSVs0FSiPNtuCTzK6HNM4DIgniH7hFaeuszDS9T4dhAHWiLSt/Y5Ng==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.10.tgz", + "integrity": "sha512-HfFoxY172tVHPIvJy+FHxzB4l8xU7e5cxmNS11cQ2jt4JWAukn/7LXaPdZid41UyTweqa4P/1zs201gRGCTwHw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.10.tgz", + "integrity": "sha512-Nz6XcfRBOO7jSrVpKAyEyFOPGhySPNlgumSDhWAspdQQ11ub/7/NZDMhWDFReE9QH/SsCOCLQbdj0atAk/HMOQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.10.tgz", + "integrity": "sha512-otMdmSmkMe+pmiP/bZBjfphyAsTsngyT9RCYwoFzqrveAbux9nYitDTpdgToG0Z0U55+PnH654gCH2GQ1aB6Yw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.10.tgz", + "integrity": "sha512-t8tjFuON1koxskzQ4VFoh0T5UDUMiLYjwf9Wktd0tx8AoK6xgU+5ubKOpWpcnhEQ2tESS5u0v6QuN8PX/ftwcQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.10.tgz", + "integrity": "sha512-+dUkcVzcfEJHz3HEnVpIJu8z8Wdn2n/nWMWdl6FVPFGJAVySO4g3+XPzNKFytVFwf8hPVDwYXzVcu8GMFqsqZw==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.10.tgz", + "integrity": "sha512-sO3PjjxEGy+PY2qkGe2gwJbXdZN9wAYpVBZWFD0AwAoKuXRkWK0/zaMQ5ekUFJDRDCRm8x5U0Axaub7ynH/wVg==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.10.tgz", + "integrity": "sha512-JDtdbJg3yjDeXLv4lZYE1kiTnxv73/8cbPHY9T/dUKi8rYOM/k5b3W4UJLMUksuQ6nTm5c89W1nADsql6FW75A==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.10.tgz", + "integrity": "sha512-NLuSKcp8WckjD2a7z5kzLiCywFwBTMlIxDNuud1AUGVuwBBJSkuubp6cNjJ0p5c6CZaA3QqUGwjHJBiG1SoOFw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.10.tgz", + "integrity": "sha512-wj2KRsCsFusli+6yFgNO/zmmLslislAWryJnodteRmGej7ZzinIbMdsyp13rVGde88zxJd5vercNYK9kuvlZaQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.10.tgz", + "integrity": "sha512-pQ9QqxEPI3cVRZyUtCoZxhZK3If+7RzR8L2yz2+TDzdygofIPOJFaAPkEJ5rYIbUO101RaiYxfdOBahYexLk5A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.10.tgz", + "integrity": "sha512-k8GTIIW9I8pEEfoOUm32TpPMgSg06JhL5DO+ql66aLTkOQUs0TxCA67Wi7pv6z8iF8STCGcNbm3UWFHLuci+ag==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.10.tgz", + "integrity": "sha512-vIGYJIdEI6d4JBucAx8py792G8J0GP40qSH+EvSt80A4zvGd6jph+5t1g+eEXcS2aRpgZw6CrssNCFZxTdEsxw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.10.tgz", + "integrity": "sha512-kRhNcMZFGMW+ZHCarAM1ypr8OZs0k688ViUCetVCef9p3enFxzWeBg9h/575Y0nsFu0ZItluCVF5gMR2pwOEpA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.10.tgz", + "integrity": "sha512-AR9PX1whYaYh9p0EOaKna0h48F/A101Mt/ag72+kMkkBZXPQ7cjbz2syXI/HI3OlBdUytSdHneljfjvUoqwqiQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.10.tgz", + "integrity": "sha512-5sTkYhAGHNRr6bVf4RM0PsscqVr6/DBYdrlMh168oph3usid3lKHcHEEHmr34iZ9GHeeg2juFOxtpl6XyC3tpw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -2075,6 +2428,43 @@ "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", "dev": true }, + "node_modules/esbuild": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.10.tgz", + "integrity": "sha512-33WKo67auOXzZHBY/9DTJRo7kIvfU12S+D4sp2wIz39N88MDIaCGyCwbW01RR70pK6Iya0I74lHEpyLfFqOHPA==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.18.10", + "@esbuild/android-arm64": "0.18.10", + "@esbuild/android-x64": "0.18.10", + "@esbuild/darwin-arm64": "0.18.10", + "@esbuild/darwin-x64": "0.18.10", + "@esbuild/freebsd-arm64": "0.18.10", + "@esbuild/freebsd-x64": "0.18.10", + "@esbuild/linux-arm": "0.18.10", + "@esbuild/linux-arm64": "0.18.10", + "@esbuild/linux-ia32": "0.18.10", + "@esbuild/linux-loong64": "0.18.10", + "@esbuild/linux-mips64el": "0.18.10", + "@esbuild/linux-ppc64": "0.18.10", + "@esbuild/linux-riscv64": "0.18.10", + "@esbuild/linux-s390x": "0.18.10", + "@esbuild/linux-x64": "0.18.10", + "@esbuild/netbsd-x64": "0.18.10", + "@esbuild/openbsd-x64": "0.18.10", + "@esbuild/sunos-x64": "0.18.10", + "@esbuild/win32-arm64": "0.18.10", + "@esbuild/win32-ia32": "0.18.10", + "@esbuild/win32-x64": "0.18.10" + } + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -7518,6 +7908,160 @@ "jsdoc-type-pratt-parser": "~3.1.0" } }, + "@esbuild/android-arm": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.18.10.tgz", + "integrity": "sha512-3KClmVNd+Fku82uZJz5C4Rx8m1PPmWUFz5Zkw8jkpZPOmsq+EG1TTOtw1OXkHuX3WczOFQigrtf60B1ijKwNsg==", + "dev": true, + "optional": true + }, + "@esbuild/android-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.18.10.tgz", + "integrity": "sha512-ynm4naLbNbK0ajf9LUWtQB+6Vfg1Z/AplArqr4tGebC00Z6m9Y91OVIcjDa461wGcZwcaHYaZAab4yJxfhisTQ==", + "dev": true, + "optional": true + }, + "@esbuild/android-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.18.10.tgz", + "integrity": "sha512-vFfXj8P9Yfjh54yqUDEHKzqzYuEfPyAOl3z7R9hjkwt+NCvbn9VMxX+IILnAfdImRBfYVItgSUsqGKhJFnBwZw==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.18.10.tgz", + "integrity": "sha512-k2OJQ7ZxE6sVc91+MQeZH9gFeDAH2uIYALPAwTjTCvcPy9Dzrf7V7gFUQPYkn09zloWhQ+nvxWHia2x2ZLR0sQ==", + "dev": true, + "optional": true + }, + "@esbuild/darwin-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.18.10.tgz", + "integrity": "sha512-tnz/mdZk1L1Z3WpGjin/L2bKTe8/AKZpI8fcCLtH+gq8WXWsCNJSxlesAObV4qbtTl6pG5vmqFXfWUQ5hV8PAQ==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.18.10.tgz", + "integrity": "sha512-QJluV0LwBrbHnYYwSKC+K8RGz0g/EyhpQH1IxdoFT0nM7PfgjE+aS8wxq/KFEsU0JkL7U/EEKd3O8xVBxXb2aA==", + "dev": true, + "optional": true + }, + "@esbuild/freebsd-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.18.10.tgz", + "integrity": "sha512-Hi/ycUkS6KTw+U9G5PK5NoK7CZboicaKUSVs0FSiPNtuCTzK6HNM4DIgniH7hFaeuszDS9T4dhAHWiLSt/Y5Ng==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.18.10.tgz", + "integrity": "sha512-HfFoxY172tVHPIvJy+FHxzB4l8xU7e5cxmNS11cQ2jt4JWAukn/7LXaPdZid41UyTweqa4P/1zs201gRGCTwHw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.18.10.tgz", + "integrity": "sha512-Nz6XcfRBOO7jSrVpKAyEyFOPGhySPNlgumSDhWAspdQQ11ub/7/NZDMhWDFReE9QH/SsCOCLQbdj0atAk/HMOQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ia32": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.18.10.tgz", + "integrity": "sha512-otMdmSmkMe+pmiP/bZBjfphyAsTsngyT9RCYwoFzqrveAbux9nYitDTpdgToG0Z0U55+PnH654gCH2GQ1aB6Yw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.18.10.tgz", + "integrity": "sha512-t8tjFuON1koxskzQ4VFoh0T5UDUMiLYjwf9Wktd0tx8AoK6xgU+5ubKOpWpcnhEQ2tESS5u0v6QuN8PX/ftwcQ==", + "dev": true, + "optional": true + }, + "@esbuild/linux-mips64el": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.18.10.tgz", + "integrity": "sha512-+dUkcVzcfEJHz3HEnVpIJu8z8Wdn2n/nWMWdl6FVPFGJAVySO4g3+XPzNKFytVFwf8hPVDwYXzVcu8GMFqsqZw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-ppc64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.18.10.tgz", + "integrity": "sha512-sO3PjjxEGy+PY2qkGe2gwJbXdZN9wAYpVBZWFD0AwAoKuXRkWK0/zaMQ5ekUFJDRDCRm8x5U0Axaub7ynH/wVg==", + "dev": true, + "optional": true + }, + "@esbuild/linux-riscv64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.18.10.tgz", + "integrity": "sha512-JDtdbJg3yjDeXLv4lZYE1kiTnxv73/8cbPHY9T/dUKi8rYOM/k5b3W4UJLMUksuQ6nTm5c89W1nADsql6FW75A==", + "dev": true, + "optional": true + }, + "@esbuild/linux-s390x": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.18.10.tgz", + "integrity": "sha512-NLuSKcp8WckjD2a7z5kzLiCywFwBTMlIxDNuud1AUGVuwBBJSkuubp6cNjJ0p5c6CZaA3QqUGwjHJBiG1SoOFw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.18.10.tgz", + "integrity": "sha512-wj2KRsCsFusli+6yFgNO/zmmLslislAWryJnodteRmGej7ZzinIbMdsyp13rVGde88zxJd5vercNYK9kuvlZaQ==", + "dev": true, + "optional": true + }, + "@esbuild/netbsd-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.18.10.tgz", + "integrity": "sha512-pQ9QqxEPI3cVRZyUtCoZxhZK3If+7RzR8L2yz2+TDzdygofIPOJFaAPkEJ5rYIbUO101RaiYxfdOBahYexLk5A==", + "dev": true, + "optional": true + }, + "@esbuild/openbsd-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.18.10.tgz", + "integrity": "sha512-k8GTIIW9I8pEEfoOUm32TpPMgSg06JhL5DO+ql66aLTkOQUs0TxCA67Wi7pv6z8iF8STCGcNbm3UWFHLuci+ag==", + "dev": true, + "optional": true + }, + "@esbuild/sunos-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.18.10.tgz", + "integrity": "sha512-vIGYJIdEI6d4JBucAx8py792G8J0GP40qSH+EvSt80A4zvGd6jph+5t1g+eEXcS2aRpgZw6CrssNCFZxTdEsxw==", + "dev": true, + "optional": true + }, + "@esbuild/win32-arm64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.18.10.tgz", + "integrity": "sha512-kRhNcMZFGMW+ZHCarAM1ypr8OZs0k688ViUCetVCef9p3enFxzWeBg9h/575Y0nsFu0ZItluCVF5gMR2pwOEpA==", + "dev": true, + "optional": true + }, + "@esbuild/win32-ia32": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.18.10.tgz", + "integrity": "sha512-AR9PX1whYaYh9p0EOaKna0h48F/A101Mt/ag72+kMkkBZXPQ7cjbz2syXI/HI3OlBdUytSdHneljfjvUoqwqiQ==", + "dev": true, + "optional": true + }, + "@esbuild/win32-x64": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.18.10.tgz", + "integrity": "sha512-5sTkYhAGHNRr6bVf4RM0PsscqVr6/DBYdrlMh168oph3usid3lKHcHEEHmr34iZ9GHeeg2juFOxtpl6XyC3tpw==", + "dev": true, + "optional": true + }, "@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -9001,6 +9545,36 @@ "integrity": "sha512-9978wrXM50Y4rTMmW5kXIC09ZdXQZqkE4mxhwkd8VbzsGkXGPgV4zWuqQJgCEzYngdo2dYDa0l8xhX4fkSwJSg==", "dev": true }, + "esbuild": { + "version": "0.18.10", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.10.tgz", + "integrity": "sha512-33WKo67auOXzZHBY/9DTJRo7kIvfU12S+D4sp2wIz39N88MDIaCGyCwbW01RR70pK6Iya0I74lHEpyLfFqOHPA==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.18.10", + "@esbuild/android-arm64": "0.18.10", + "@esbuild/android-x64": "0.18.10", + "@esbuild/darwin-arm64": "0.18.10", + "@esbuild/darwin-x64": "0.18.10", + "@esbuild/freebsd-arm64": "0.18.10", + "@esbuild/freebsd-x64": "0.18.10", + "@esbuild/linux-arm": "0.18.10", + "@esbuild/linux-arm64": "0.18.10", + "@esbuild/linux-ia32": "0.18.10", + "@esbuild/linux-loong64": "0.18.10", + "@esbuild/linux-mips64el": "0.18.10", + "@esbuild/linux-ppc64": "0.18.10", + "@esbuild/linux-riscv64": "0.18.10", + "@esbuild/linux-s390x": "0.18.10", + "@esbuild/linux-x64": "0.18.10", + "@esbuild/netbsd-x64": "0.18.10", + "@esbuild/openbsd-x64": "0.18.10", + "@esbuild/sunos-x64": "0.18.10", + "@esbuild/win32-arm64": "0.18.10", + "@esbuild/win32-ia32": "0.18.10", + "@esbuild/win32-x64": "0.18.10" + } + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", diff --git a/package.json b/package.json index 1c0a2d9914..6e36d9be39 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,7 @@ "chai": "^4.2.0", "copy-webpack-plugin": "^11.0.0", "cors": "~2.7", + "esbuild": "^0.18.10", "eslint": "^7.13.0", "eslint-plugin-jsdoc": "^40.0.0", "eslint-plugin-security": "^1.4.0", From 27d065361cbe4b1b9f745f31915c9095e9817f4c Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Fri, 7 Jul 2023 16:14:57 +0100 Subject: [PATCH 2/7] deps: add esbuild-plugin-umd-wrapper dependency this is needed for legacy platform support - esbuild only supports iife, esm, and commonjs out of the box --- package-lock.json | 13 +++++++++++++ package.json | 1 + 2 files changed, 14 insertions(+) diff --git a/package-lock.json b/package-lock.json index 5d47210e39..8a6f6b3d33 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "copy-webpack-plugin": "^11.0.0", "cors": "~2.7", "esbuild": "^0.18.10", + "esbuild-plugin-umd-wrapper": "^1.0.7", "eslint": "^7.13.0", "eslint-plugin-jsdoc": "^40.0.0", "eslint-plugin-security": "^1.4.0", @@ -2465,6 +2466,12 @@ "@esbuild/win32-x64": "0.18.10" } }, + "node_modules/esbuild-plugin-umd-wrapper": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/esbuild-plugin-umd-wrapper/-/esbuild-plugin-umd-wrapper-1.0.7.tgz", + "integrity": "sha512-Jo1S3rczXupUzPGt4eXF643FF/J7nDkwwwHH2PS6ic1l0ye7kTS0plAJQoD9u349ybLyt4wyG9fFa/RCuI2dXw==", + "dev": true + }, "node_modules/escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", @@ -9575,6 +9582,12 @@ "@esbuild/win32-x64": "0.18.10" } }, + "esbuild-plugin-umd-wrapper": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/esbuild-plugin-umd-wrapper/-/esbuild-plugin-umd-wrapper-1.0.7.tgz", + "integrity": "sha512-Jo1S3rczXupUzPGt4eXF643FF/J7nDkwwwHH2PS6ic1l0ye7kTS0plAJQoD9u349ybLyt4wyG9fFa/RCuI2dXw==", + "dev": true + }, "escalade": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", diff --git a/package.json b/package.json index 6e36d9be39..f147f333f2 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "copy-webpack-plugin": "^11.0.0", "cors": "~2.7", "esbuild": "^0.18.10", + "esbuild-plugin-umd-wrapper": "^1.0.7", "eslint": "^7.13.0", "eslint-plugin-jsdoc": "^40.0.0", "eslint-plugin-security": "^1.4.0", From 9212a9100f664f5419d76dd41d4a7a13b1533b67 Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Fri, 7 Jul 2023 16:17:49 +0100 Subject: [PATCH 3/7] refactor: use named exports for web entrypoint keeping the default export too since webpack still uses this entry point for webworkers --- src/platform/web/index.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/platform/web/index.ts b/src/platform/web/index.ts index 378e987d25..b98d70f7f0 100644 --- a/src/platform/web/index.ts +++ b/src/platform/web/index.ts @@ -46,6 +46,8 @@ if (Platform.Config.noUpgrade) { Platform.Defaults.upgradeTransports = []; } +export { Rest, Realtime, msgpack }; + export default { Rest, Realtime, From 102c7334e14f3ae647ca2a77451f74cbc1658580 Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Fri, 7 Jul 2023 16:18:04 +0100 Subject: [PATCH 4/7] refactor: use instanceof for isErrorInfoOrPartialErrorInfo --- src/common/lib/util/utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/lib/util/utils.ts b/src/common/lib/util/utils.ts index 52a5e5f6e0..6d0c839494 100644 --- a/src/common/lib/util/utils.ts +++ b/src/common/lib/util/utils.ts @@ -418,7 +418,7 @@ export function isErrorInfoOrPartialErrorInfo(err: unknown): err is ErrorInfo | return ( typeof err == 'object' && err !== null && - (err.constructor.name == 'ErrorInfo' || err.constructor.name == 'PartialErrorInfo') + (err instanceof ErrorInfo || err instanceof PartialErrorInfo) ); } From d9b0d3624e353b17f2238b59e362780e651a0072 Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Fri, 7 Jul 2023 16:18:38 +0100 Subject: [PATCH 5/7] refactor: avoid unguarded `global` access --- src/common/lib/transport/connectionmanager.ts | 4 +++- src/common/lib/util/logger.ts | 2 +- src/common/lib/util/utils.ts | 8 ++------ src/platform/web/lib/util/webstorage.ts | 12 +++++++----- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/common/lib/transport/connectionmanager.ts b/src/common/lib/transport/connectionmanager.ts index a3b98c9a53..92c87d1a0c 100644 --- a/src/common/lib/transport/connectionmanager.ts +++ b/src/common/lib/transport/connectionmanager.ts @@ -21,6 +21,8 @@ import HttpStatusCodes from 'common/constants/HttpStatusCodes'; type Realtime = any; type ClientOptions = any; +let globalObject = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : self; + const haveWebStorage = () => typeof Platform.WebStorage !== 'undefined' && Platform.WebStorage?.localSupported; const haveSessionStorage = () => typeof Platform.WebStorage !== 'undefined' && Platform.WebStorage?.sessionSupported; const actions = ProtocolMessage.Action; @@ -1136,7 +1138,7 @@ class ConnectionManager extends EventEmitter { setSessionRecoverData({ recoveryKey: recoveryKey, disconnectedAt: Utils.now(), - location: global.location, + location: globalObject.location, clientId: this.realtime.auth.clientId, }); } diff --git a/src/common/lib/util/logger.ts b/src/common/lib/util/logger.ts index 8ce22c8b88..bfafe2c500 100644 --- a/src/common/lib/util/logger.ts +++ b/src/common/lib/util/logger.ts @@ -8,7 +8,7 @@ type LoggerFunction = (...args: string[]) => void; // Workaround for salesforce lightning locker compatibility // This is a shorthand version of Utils.getGlobalObject (which we can't use here without creating a circular import) -let globalObject = global || (typeof window !== 'undefined' ? window : self); +let globalObject = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : self; enum LogLevels { None = 0, diff --git a/src/common/lib/util/utils.ts b/src/common/lib/util/utils.ts index 6d0c839494..303d961d13 100644 --- a/src/common/lib/util/utils.ts +++ b/src/common/lib/util/utils.ts @@ -415,11 +415,7 @@ export const now = }; export function isErrorInfoOrPartialErrorInfo(err: unknown): err is ErrorInfo | PartialErrorInfo { - return ( - typeof err == 'object' && - err !== null && - (err instanceof ErrorInfo || err instanceof PartialErrorInfo) - ); + return typeof err == 'object' && err !== null && (err instanceof ErrorInfo || err instanceof PartialErrorInfo); } export function inspectError(err: unknown): string { @@ -535,7 +531,7 @@ export function getJitterCoefficient() { } export function getGlobalObject() { - if (global) { + if (typeof global !== 'undefined') { return global; } diff --git a/src/platform/web/lib/util/webstorage.ts b/src/platform/web/lib/util/webstorage.ts index d1ac7e4ec2..010bff419b 100644 --- a/src/platform/web/lib/util/webstorage.ts +++ b/src/platform/web/lib/util/webstorage.ts @@ -3,6 +3,8 @@ import IWebStorage from 'common/types/IWebStorage'; const test = 'ablyjs-storage-test'; +let globalObject = typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : self; + class Webstorage implements IWebStorage { sessionSupported: boolean; localSupported: boolean; @@ -14,16 +16,16 @@ class Webstorage implements IWebStorage { * somewhat roundabout way. (If unsupported or no global object, * will throw on accessing a property of undefined) */ try { - global.sessionStorage.setItem(test, test); - global.sessionStorage.removeItem(test); + globalObject.sessionStorage.setItem(test, test); + globalObject.sessionStorage.removeItem(test); this.sessionSupported = true; } catch (e) { this.sessionSupported = false; } try { - global.localStorage.setItem(test, test); - global.localStorage.removeItem(test); + globalObject.localStorage.setItem(test, test); + globalObject.localStorage.removeItem(test); this.localSupported = true; } catch (e) { this.localSupported = false; @@ -80,7 +82,7 @@ class Webstorage implements IWebStorage { } private storageInterface(session?: boolean) { - return session ? global.sessionStorage : global.localStorage; + return session ? globalObject.sessionStorage : globalObject.localStorage; } } From ed9be585cd51ba73529789714f398749a34b1413 Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Mon, 10 Jul 2023 16:42:56 +0100 Subject: [PATCH 6/7] ci: remove closure compiler check not needed since we are no longer targeting lower ES levels --- .github/workflows/check.yml | 1 - CONTRIBUTING.md | 5 ++--- Gruntfile.js | 24 +----------------------- package.json | 3 --- 4 files changed, 3 insertions(+), 30 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 8247cb59b4..675343c945 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -21,6 +21,5 @@ jobs: - run: npm ci - run: npm run lint - run: npm run format:check - - run: npm run check-closure-compiler - run: npx tsc --noEmit ably.d.ts build/ably-webworker.min.d.ts - run: npm audit --production diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4faa7a424a..2c040df3e5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -8,9 +8,8 @@ 4. Commit your changes (`git commit -am 'Add some feature'`) 5. Ensure you have added suitable tests and the test suite is passing(`npm test`) 6. Ensure the [type definitions](https://github.com/ably/ably-js/blob/main/ably.d.ts) have been updated if the public API has changed -7. Ensure you stick to the version of JS used by the library (currently ES5). (The minfication task (`npm run grunt -- closureCompiler:ably.js`) will enforce that you stick to ES5 syntax, but will not enforce that you don't use, for example, new methods) -8. Push the branch (`git push origin my-new-feature`) -9. Create a new Pull Request +7. Push the branch (`git push origin my-new-feature`) +8. Create a new Pull Request ## Release Process diff --git a/Gruntfile.js b/Gruntfile.js index bf5ddfcc45..bf159a0ee9 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -6,7 +6,6 @@ var webpackConfig = require('./webpack.config'); module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-concat'); - grunt.loadNpmTasks('grunt-closure-tools'); grunt.loadNpmTasks('grunt-bump'); grunt.loadNpmTasks('grunt-webpack'); @@ -16,7 +15,6 @@ module.exports = function (grunt) { fragments: 'src/platform/web/fragments', static: 'build', dest: 'build', - tools_compiler: __dirname + '/node_modules/google-closure-compiler/compiler.jar', }; function compilerSpec(src, dest) { @@ -51,24 +49,6 @@ module.exports = function (grunt) { }, }; - gruntConfig['closureCompiler'] = { - options: { - compilerFile: dirs.tools_compiler, - compilerOpts: { - compilation_level: 'SIMPLE_OPTIMIZATIONS', - /* By default, the compiler assumes you're using es6 and transpiles to - * es5, adding various (unnecessary and undesired) polyfills. Specify - * both in and out to es5 to avoid transpilation */ - language_in: 'ECMASCRIPT5', - language_out: 'ECMASCRIPT5', - strict_mode_input: true, - checks_only: true, - warning_level: 'QUIET', - }, - }, - 'ably.js': compilerSpec('<%= dirs.static %>/ably.js'), - }; - gruntConfig.bump = { options: { files: ['package.json', 'README.md'], @@ -112,9 +92,7 @@ module.exports = function (grunt) { grunt.registerTask('build:browser', ['checkGitSubmodules', 'webpack:browser']); - grunt.registerTask('check-closure-compiler', ['build', 'closureCompiler:ably.js']); - - grunt.registerTask('all', ['build', 'check-closure-compiler', 'requirejs']); + grunt.registerTask('all', ['build', 'requirejs']); grunt.loadTasks('test/tasks'); diff --git a/package.json b/package.json index f147f333f2..4c62961d7d 100644 --- a/package.json +++ b/package.json @@ -44,11 +44,9 @@ "eslint-plugin-security": "^1.4.0", "express": "^4.17.1", "glob": "~4.4", - "google-closure-compiler": "^20180610.0.1", "grunt": "^1.4.1", "grunt-bump": "^0.3.1", "grunt-cli": "~1.2.0", - "grunt-closure-tools": "^1.0.0", "grunt-contrib-concat": "~0.5", "grunt-shell": "~1.1", "grunt-webpack": "^5.0.0", @@ -93,7 +91,6 @@ "requirejs": "grunt requirejs", "lint": "eslint .", "lint:fix": "eslint --fix .", - "check-closure-compiler": "grunt check-closure-compiler", "prepare": "npm run build", "format": "prettier --write --ignore-path .gitignore --ignore-path .prettierignore src test ably.d.ts webpack.config.js Gruntfile.js scripts/cdn_deploy.js docs/chrome-mv3.md", "format:check": "prettier --check --ignore-path .gitignore --ignore-path .prettierignore src test ably.d.ts webpack.config.js Gruntfile.js scripts/cdn_deploy.js", From 4d22ee275b572fe8d24e91e693ba763b3a0cbd1c Mon Sep 17 00:00:00 2001 From: Owen Pearson Date: Fri, 30 Jun 2023 14:59:38 +0100 Subject: [PATCH 7/7] build: use esbuild for browser bundles --- Gruntfile.js | 44 +++++++++++++++++++++++++++++++++++++++++++- webpack.config.js | 42 ------------------------------------------ 2 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index bf159a0ee9..ca1f636f9a 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,6 +3,9 @@ var fs = require('fs'); var path = require('path'); var webpackConfig = require('./webpack.config'); +var esbuild = require('esbuild'); +var umdWrapper = require('esbuild-plugin-umd-wrapper'); +var banner = require('./src/fragments/license'); module.exports = function (grunt) { grunt.loadNpmTasks('grunt-contrib-concat'); @@ -86,7 +89,7 @@ module.exports = function (grunt) { }); }); - grunt.registerTask('build', ['checkGitSubmodules', 'webpack:all']); + grunt.registerTask('build', ['checkGitSubmodules', 'webpack:all', 'build:browser']); grunt.registerTask('build:node', ['checkGitSubmodules', 'webpack:node']); @@ -94,6 +97,45 @@ module.exports = function (grunt) { grunt.registerTask('all', ['build', 'requirejs']); + grunt.registerTask('build:browser', function () { + var done = this.async(); + + var baseConfig = { + entryPoints: ['src/platform/web/index.ts'], + outfile: 'build/ably.js', + bundle: true, + sourcemap: true, + format: 'umd', + banner: { js: '/*' + banner + '*/' }, + plugins: [umdWrapper.default()], + target: 'es6', + }; + + Promise.all([ + esbuild.build(baseConfig), + esbuild.build({ + ...baseConfig, + outfile: 'build/ably.min.js', + minify: true, + }), + esbuild.build({ + ...baseConfig, + entryPoints: ['src/platform/web-noencryption/index.ts'], + outfile: 'build/ably.noencryption.js', + }), + + esbuild.build({ + ...baseConfig, + entryPoints: ['src/platform/web-noencryption/index.ts'], + outfile: 'build/ably.noencryption.min.js', + minify: true, + }), + ]).then(() => { + console.log('esbuild succeeded'); + done(true); + }); + }); + grunt.loadTasks('test/tasks'); grunt.registerTask('test', ['test:node']); diff --git a/webpack.config.js b/webpack.config.js index 2c0c981ca7..c569d64272 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -137,21 +137,6 @@ const reactNativeConfig = { }, }; -const browserMinConfig = { - ...browserConfig, - output: { - ...baseConfig.output, - filename: 'ably.min.js', - }, - optimization: { - minimize: true, - }, - performance: { - hints: 'warning', - }, - devtool: 'source-map', -}; - const webworkerConfig = { target: ['webworker', 'es5'], ...browserConfig, @@ -181,36 +166,9 @@ const webworkerConfig = { ], }; -const noEncryptionConfig = { - ...browserConfig, - entry: { - index: platformPath('web-noencryption'), - }, - output: { - ...baseConfig.output, - filename: 'ably.noencryption.js', - }, -}; - -const noEncryptionMinConfig = { - ...browserMinConfig, - entry: { - index: platformPath('web-noencryption'), - }, - output: { - ...baseConfig.output, - filename: 'ably.noencryption.min.js', - }, - devtool: 'source-map', -}; - module.exports = { node: nodeConfig, - browser: browserConfig, - browserMin: browserMinConfig, webworker: webworkerConfig, nativeScript: nativeScriptConfig, reactNative: reactNativeConfig, - noEncryption: noEncryptionConfig, - noEncryptionMin: noEncryptionMinConfig, };