diff --git a/package-lock.json b/package-lock.json index 178e2703..dede00a4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "dependencies": { "@deephaven-enterprise/auth-nodejs": "^1.20240723.113-beta", "@deephaven-enterprise/query-utils": "^1.20240723.113-beta", - "@deephaven/require-jsapi": "file:./packages/require-jsapi", + "@deephaven/jsapi-nodejs": "^0.98.0", "nanoid": "^5.0.7" }, "devDependencies": { @@ -466,6 +466,20 @@ "shortid": "^2.2.16" } }, + "node_modules/@deephaven/jsapi-nodejs": { + "version": "0.98.0", + "resolved": "https://registry.npmjs.org/@deephaven/jsapi-nodejs/-/jsapi-nodejs-0.98.0.tgz", + "integrity": "sha512-ttLGy7282zIpIsc6pe7WwlU1SNeYcY5/aBxaq8tB4A4Q1xVVEwetSFmdPmn1sMB5kW3aVwzHoKYQXuyV1C1qDw==", + "dependencies": { + "ws": "^8.18.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "esbuild": "^0.24.0" + } + }, "node_modules/@deephaven/jsapi-types": { "version": "1.0.0-dev0.36.1", "resolved": "https://registry.npmjs.org/@deephaven/jsapi-types/-/jsapi-types-1.0.0-dev0.36.1.tgz", @@ -482,10 +496,6 @@ "node": ">=16" } }, - "node_modules/@deephaven/require-jsapi": { - "resolved": "packages/require-jsapi", - "link": true - }, "node_modules/@deephaven/utils": { "version": "0.97.0", "resolved": "https://registry.npmjs.org/@deephaven/utils/-/utils-0.97.0.tgz", @@ -501,7 +511,6 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "aix" @@ -517,7 +526,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "android" @@ -533,7 +541,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "android" @@ -549,7 +556,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "android" @@ -565,7 +571,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -581,7 +586,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "darwin" @@ -597,7 +601,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -613,7 +616,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "freebsd" @@ -629,7 +631,6 @@ "cpu": [ "arm" ], - "dev": true, "optional": true, "os": [ "linux" @@ -645,7 +646,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -661,7 +661,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "linux" @@ -677,7 +676,6 @@ "cpu": [ "loong64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -693,7 +691,6 @@ "cpu": [ "mips64el" ], - "dev": true, "optional": true, "os": [ "linux" @@ -709,7 +706,6 @@ "cpu": [ "ppc64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -725,7 +721,6 @@ "cpu": [ "riscv64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -741,7 +736,6 @@ "cpu": [ "s390x" ], - "dev": true, "optional": true, "os": [ "linux" @@ -757,7 +751,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "linux" @@ -773,7 +766,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "netbsd" @@ -789,7 +781,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "openbsd" @@ -805,7 +796,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "openbsd" @@ -821,7 +811,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "sunos" @@ -837,7 +826,6 @@ "cpu": [ "arm64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -853,7 +841,6 @@ "cpu": [ "ia32" ], - "dev": true, "optional": true, "os": [ "win32" @@ -869,7 +856,6 @@ "cpu": [ "x64" ], - "dev": true, "optional": true, "os": [ "win32" @@ -6198,7 +6184,6 @@ "version": "0.24.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", - "dev": true, "hasInstallScript": true, "bin": { "esbuild": "bin/esbuild" @@ -15548,6 +15533,7 @@ "packages/require-jsapi": { "name": "@deephaven/require-jsapi", "version": "0.0.1", + "extraneous": true, "license": "SEE LICENSE IN LICENSE.md", "dependencies": { "ws": "^8.18.0" @@ -15909,6 +15895,14 @@ "shortid": "^2.2.16" } }, + "@deephaven/jsapi-nodejs": { + "version": "0.98.0", + "resolved": "https://registry.npmjs.org/@deephaven/jsapi-nodejs/-/jsapi-nodejs-0.98.0.tgz", + "integrity": "sha512-ttLGy7282zIpIsc6pe7WwlU1SNeYcY5/aBxaq8tB4A4Q1xVVEwetSFmdPmn1sMB5kW3aVwzHoKYQXuyV1C1qDw==", + "requires": { + "ws": "^8.18.0" + } + }, "@deephaven/jsapi-types": { "version": "1.0.0-dev0.36.1", "resolved": "https://registry.npmjs.org/@deephaven/jsapi-types/-/jsapi-types-1.0.0-dev0.36.1.tgz", @@ -15922,13 +15916,6 @@ "event-target-shim": "^6.0.2" } }, - "@deephaven/require-jsapi": { - "version": "file:packages/require-jsapi", - "requires": { - "@deephaven-enterprise/jsapi-types": "^1.20240723.113-beta", - "ws": "^8.18.0" - } - }, "@deephaven/utils": { "version": "0.97.0", "resolved": "https://registry.npmjs.org/@deephaven/utils/-/utils-0.97.0.tgz", @@ -15938,168 +15925,144 @@ "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.24.0.tgz", "integrity": "sha512-WtKdFM7ls47zkKHFVzMz8opM7LkcsIp9amDUBIAWirg70RM71WRSjdILPsY5Uv1D42ZpUfaPILDlfactHgsRkw==", - "dev": true, "optional": true }, "@esbuild/android-arm": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.24.0.tgz", "integrity": "sha512-arAtTPo76fJ/ICkXWetLCc9EwEHKaeya4vMrReVlEIUCAUncH7M4bhMQ+M9Vf+FFOZJdTNMXNBrWwW+OXWpSew==", - "dev": true, "optional": true }, "@esbuild/android-arm64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.24.0.tgz", "integrity": "sha512-Vsm497xFM7tTIPYK9bNTYJyF/lsP590Qc1WxJdlB6ljCbdZKU9SY8i7+Iin4kyhV/KV5J2rOKsBQbB77Ab7L/w==", - "dev": true, "optional": true }, "@esbuild/android-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.24.0.tgz", "integrity": "sha512-t8GrvnFkiIY7pa7mMgJd7p8p8qqYIz1NYiAoKc75Zyv73L3DZW++oYMSHPRarcotTKuSs6m3hTOa5CKHaS02TQ==", - "dev": true, "optional": true }, "@esbuild/darwin-arm64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.24.0.tgz", "integrity": "sha512-CKyDpRbK1hXwv79soeTJNHb5EiG6ct3efd/FTPdzOWdbZZfGhpbcqIpiD0+vwmpu0wTIL97ZRPZu8vUt46nBSw==", - "dev": true, "optional": true }, "@esbuild/darwin-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.24.0.tgz", "integrity": "sha512-rgtz6flkVkh58od4PwTRqxbKH9cOjaXCMZgWD905JOzjFKW+7EiUObfd/Kav+A6Gyud6WZk9w+xu6QLytdi2OA==", - "dev": true, "optional": true }, "@esbuild/freebsd-arm64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.24.0.tgz", "integrity": "sha512-6Mtdq5nHggwfDNLAHkPlyLBpE5L6hwsuXZX8XNmHno9JuL2+bg2BX5tRkwjyfn6sKbxZTq68suOjgWqCicvPXA==", - "dev": true, "optional": true }, "@esbuild/freebsd-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.24.0.tgz", "integrity": "sha512-D3H+xh3/zphoX8ck4S2RxKR6gHlHDXXzOf6f/9dbFt/NRBDIE33+cVa49Kil4WUjxMGW0ZIYBYtaGCa2+OsQwQ==", - "dev": true, "optional": true }, "@esbuild/linux-arm": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.24.0.tgz", "integrity": "sha512-gJKIi2IjRo5G6Glxb8d3DzYXlxdEj2NlkixPsqePSZMhLudqPhtZ4BUrpIuTjJYXxvF9njql+vRjB2oaC9XpBw==", - "dev": true, "optional": true }, "@esbuild/linux-arm64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.24.0.tgz", "integrity": "sha512-TDijPXTOeE3eaMkRYpcy3LarIg13dS9wWHRdwYRnzlwlA370rNdZqbcp0WTyyV/k2zSxfko52+C7jU5F9Tfj1g==", - "dev": true, "optional": true }, "@esbuild/linux-ia32": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.24.0.tgz", "integrity": "sha512-K40ip1LAcA0byL05TbCQ4yJ4swvnbzHscRmUilrmP9Am7//0UjPreh4lpYzvThT2Quw66MhjG//20mrufm40mA==", - "dev": true, "optional": true }, "@esbuild/linux-loong64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.24.0.tgz", "integrity": "sha512-0mswrYP/9ai+CU0BzBfPMZ8RVm3RGAN/lmOMgW4aFUSOQBjA31UP8Mr6DDhWSuMwj7jaWOT0p0WoZ6jeHhrD7g==", - "dev": true, "optional": true }, "@esbuild/linux-mips64el": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.24.0.tgz", "integrity": "sha512-hIKvXm0/3w/5+RDtCJeXqMZGkI2s4oMUGj3/jM0QzhgIASWrGO5/RlzAzm5nNh/awHE0A19h/CvHQe6FaBNrRA==", - "dev": true, "optional": true }, "@esbuild/linux-ppc64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.24.0.tgz", "integrity": "sha512-HcZh5BNq0aC52UoocJxaKORfFODWXZxtBaaZNuN3PUX3MoDsChsZqopzi5UupRhPHSEHotoiptqikjN/B77mYQ==", - "dev": true, "optional": true }, "@esbuild/linux-riscv64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.24.0.tgz", "integrity": "sha512-bEh7dMn/h3QxeR2KTy1DUszQjUrIHPZKyO6aN1X4BCnhfYhuQqedHaa5MxSQA/06j3GpiIlFGSsy1c7Gf9padw==", - "dev": true, "optional": true }, "@esbuild/linux-s390x": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.24.0.tgz", "integrity": "sha512-ZcQ6+qRkw1UcZGPyrCiHHkmBaj9SiCD8Oqd556HldP+QlpUIe2Wgn3ehQGVoPOvZvtHm8HPx+bH20c9pvbkX3g==", - "dev": true, "optional": true }, "@esbuild/linux-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.24.0.tgz", "integrity": "sha512-vbutsFqQ+foy3wSSbmjBXXIJ6PL3scghJoM8zCL142cGaZKAdCZHyf+Bpu/MmX9zT9Q0zFBVKb36Ma5Fzfa8xA==", - "dev": true, "optional": true }, "@esbuild/netbsd-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.24.0.tgz", "integrity": "sha512-hjQ0R/ulkO8fCYFsG0FZoH+pWgTTDreqpqY7UnQntnaKv95uP5iW3+dChxnx7C3trQQU40S+OgWhUVwCjVFLvg==", - "dev": true, "optional": true }, "@esbuild/openbsd-arm64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.24.0.tgz", "integrity": "sha512-MD9uzzkPQbYehwcN583yx3Tu5M8EIoTD+tUgKF982WYL9Pf5rKy9ltgD0eUgs8pvKnmizxjXZyLt0z6DC3rRXg==", - "dev": true, "optional": true }, "@esbuild/openbsd-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.24.0.tgz", "integrity": "sha512-4ir0aY1NGUhIC1hdoCzr1+5b43mw99uNwVzhIq1OY3QcEwPDO3B7WNXBzaKY5Nsf1+N11i1eOfFcq+D/gOS15Q==", - "dev": true, "optional": true }, "@esbuild/sunos-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.24.0.tgz", "integrity": "sha512-jVzdzsbM5xrotH+W5f1s+JtUy1UWgjU0Cf4wMvffTB8m6wP5/kx0KiaLHlbJO+dMgtxKV8RQ/JvtlFcdZ1zCPA==", - "dev": true, "optional": true }, "@esbuild/win32-arm64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.24.0.tgz", "integrity": "sha512-iKc8GAslzRpBytO2/aN3d2yb2z8XTVfNV0PjGlCxKo5SgWmNXx82I/Q3aG1tFfS+A2igVCY97TJ8tnYwpUWLCA==", - "dev": true, "optional": true }, "@esbuild/win32-ia32": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.24.0.tgz", "integrity": "sha512-vQW36KZolfIudCcTnaTpmLQ24Ha1RjygBo39/aLkM2kmjkWmZGEJ5Gn9l5/7tzXA42QGIoWbICfg6KLLkIw6yw==", - "dev": true, "optional": true }, "@esbuild/win32-x64": { "version": "0.24.0", "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.24.0.tgz", "integrity": "sha512-7IAFPrjSQIJrGsK6flwg7NFmwBoSTyF3rl7If0hNUFQU4ilTsEPL6GuMuU9BfIWVVGuRnuIidkSMC+c0Otu8IA==", - "dev": true, "optional": true }, "@eslint-community/eslint-utils": { @@ -20020,7 +19983,6 @@ "version": "0.24.0", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.24.0.tgz", "integrity": "sha512-FuLPevChGDshgSicjisSooU0cemp/sGXR841D5LHMB7mTVOmsEHcAxaH3irL53+8YDIeVNQEySh4DaYU/iuPqQ==", - "dev": true, "requires": { "@esbuild/aix-ppc64": "0.24.0", "@esbuild/android-arm": "0.24.0", diff --git a/package.json b/package.json index 8c06ee2a..f27f8cec 100644 --- a/package.json +++ b/package.json @@ -821,7 +821,7 @@ "dependencies": { "@deephaven-enterprise/auth-nodejs": "^1.20240723.113-beta", "@deephaven-enterprise/query-utils": "^1.20240723.113-beta", - "@deephaven/require-jsapi": "file:./packages/require-jsapi", + "@deephaven/jsapi-nodejs": "^0.98.0", "nanoid": "^5.0.7" }, "devDependencies": { diff --git a/packages/require-jsapi/LICENSE b/packages/require-jsapi/LICENSE deleted file mode 100644 index c61b6639..00000000 --- a/packages/require-jsapi/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - -TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - -1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - -2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - -3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - -4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - -5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - -6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - -7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - -8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - -9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - -END OF TERMS AND CONDITIONS - -APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - -Copyright [yyyy] [name of copyright owner] - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/packages/require-jsapi/README.md b/packages/require-jsapi/README.md deleted file mode 100644 index 4aab4972..00000000 --- a/packages/require-jsapi/README.md +++ /dev/null @@ -1,2 +0,0 @@ -# Deephaven Require Jsapi -This package allows downloading `jsapi` modules from a running Deephaven server. It should eventually be moved to a different repo and become a formal `npm` package. See https://github.com/deephaven/deephaven-core/issues/5537. For now it exists to internally serve the `vscode` extension and has been split out into an internal package to keep encapsulation boundaries cleaner. \ No newline at end of file diff --git a/packages/require-jsapi/package.json b/packages/require-jsapi/package.json deleted file mode 100644 index 054bd067..00000000 --- a/packages/require-jsapi/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@deephaven/require-jsapi", - "version": "0.0.1", - "description": "Deephaven dynamic import utils for Jsapi", - "author": "Deephaven Data Labs LLC", - "license": "SEE LICENSE IN LICENSE.md", - "type": "commonjs", - "private": false, - "source": "src/index.ts", - "main": "dist/index.js", - "types": "dist/index.d.ts", - "files": [ - "dist" - ], - "sideEffects": false, - "scripts": { - "build": "tsc --build" - }, - "dependencies": { - "ws": "^8.18.0" - }, - "devDependencies": { - "@deephaven-enterprise/jsapi-types": "^1.20240723.113-beta" - } -} diff --git a/packages/require-jsapi/src/dhc.ts b/packages/require-jsapi/src/dhc.ts deleted file mode 100644 index 036e66c9..00000000 --- a/packages/require-jsapi/src/dhc.ts +++ /dev/null @@ -1,82 +0,0 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import type { dh as DhType } from '@deephaven/jsapi-types'; -import { polyfillDh } from './polyfill'; -import { downloadFromURL, hasStatusCode } from './serverUtils'; - -/** - * Check if a given server is running by checking if the `dh-core.js` file is - * accessible. - * @param serverUrl - */ -export async function isDhcServerRunning(serverUrl: URL): Promise { - try { - return await hasStatusCode( - new URL('jsapi/dh-core.js', serverUrl.toString()), - [200, 204] - ); - } catch { - return false; - } -} - -/** - * Polyfill browser apis, download jsapi to a local directory, and return the - * default export. - * @param serverUrl URL of the server to download the jsapi from - * @param storageDir Directory to save the downloaded jsapi - * @returns Default export of downloaded jsapi - */ -export async function initDhcApi( - serverUrl: URL, - storageDir: string -): Promise { - polyfillDh(); - return getDhc(serverUrl, true, storageDir); -} - -/** - * Download and import the Deephaven JS API from the server. - * 1. Download `dh-internal.js` and `dh-core.js` from the server and save them - * to `out/tmp` as `.cjs` files (renaming of import / export to cjs compatible code). - * 2. requires `dh-core.mjs` and return the default export. - * Copy / modified from https://github.com/deephaven/deephaven.io/blob/main/tools/run-examples/includeAPI.mjs - * NOTE: there is a limitation in current vscode extension apis such that es6 imports are not supported. This is why - * we have to save / convert to .cjs. - * See https://stackoverflow.com/questions/70620025/how-do-i-import-an-es6-javascript-module-in-my-vs-code-extension-written-in-type - */ -async function getDhc( - serverUrl: URL, - download: boolean, - storageDir: string -): Promise { - if (download) { - const dhInternal = await downloadFromURL( - path.join(serverUrl.toString(), 'jsapi/dh-internal.js') - ); - // Convert to .cjs - fs.writeFileSync( - path.join(storageDir, 'dh-internal.cjs'), - dhInternal.replace( - `export{__webpack_exports__dhinternal as dhinternal};`, - `module.exports={dhinternal:__webpack_exports__dhinternal};` - ) - ); - - const dhCore = await downloadFromURL( - path.join(serverUrl.toString(), 'jsapi/dh-core.js') - ); - fs.writeFileSync( - path.join(storageDir, 'dh-core.cjs'), - // Convert to .cjs - dhCore - .replace( - `import {dhinternal} from './dh-internal.js';`, - `const {dhinternal} = require("./dh-internal.cjs");` - ) - .replace(`export default dh;`, `module.exports = dh;`) - ); - } - - return require(path.join(storageDir, 'dh-core.cjs')); -} diff --git a/packages/require-jsapi/src/dhe.ts b/packages/require-jsapi/src/dhe.ts deleted file mode 100644 index ab7b65c0..00000000 --- a/packages/require-jsapi/src/dhe.ts +++ /dev/null @@ -1,69 +0,0 @@ -import * as fs from 'node:fs'; -import * as path from 'node:path'; -import type { EnterpriseDhType as DheType } from '@deephaven-enterprise/jsapi-types'; -import { polyfillDh } from './polyfill'; -import { downloadFromURL, hasStatusCode } from './serverUtils'; - -/** - * Check if a given server is running by checking if the `irisapi/irisapi.nocache.js` - * file is accessible. - * @param serverUrl - */ -export async function isDheServerRunning(serverUrl: URL): Promise { - try { - return await hasStatusCode( - new URL('irisapi/irisapi.nocache.js', serverUrl.toString()), - [200, 204] - ); - } catch { - return false; - } -} - -/** - * Polyfill browser apis, download jsapi to a local directory, and return the - * default export. - * @param serverUrl URL of the server to download the jsapi from - * @param storageDir Directory to save the downloaded jsapi - * @returns Default export of downloaded jsapi - */ -export async function initDheApi( - serverUrl: URL, - storageDir: string -): Promise { - polyfillDh(); - return getDhe(serverUrl, true, storageDir); -} - -declare global { - export const iris: DheType; -} - -/** - * Returns a CJS module that exports the Deephaven JS API. If the download flag - * is true, the API is downloaded from the server and saved to a local storage - * directory. If it is false, it will be returned from the local storage directory. - * @param serverUrl URL of the server to download the jsapi from - * @param download Whether to download the jsapi from the server - * @param storageDir Directory to save the downloaded jsapi and load it from - * @returns Default export of downloaded jsapi - */ -async function getDhe( - serverUrl: URL, - download: boolean, - storageDir: string -): Promise { - const dheFilePath = path.join(storageDir, 'irisapi.nocache.js'); - - if (download) { - const dhe = await downloadFromURL( - path.join(serverUrl.toString(), 'irisapi/irisapi.nocache.js') - ); - - fs.writeFileSync(dheFilePath, dhe); - } - - require(dheFilePath); - - return iris; -} diff --git a/packages/require-jsapi/src/errorUtils.ts b/packages/require-jsapi/src/errorUtils.ts deleted file mode 100644 index e71ec2a5..00000000 --- a/packages/require-jsapi/src/errorUtils.ts +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Return true if given error has a code:string prop. Optionally check if the - * code matches a given value. - * @param err Error to check - * @param code Optional code to check - */ -export function hasErrorCode( - err: unknown, - code?: string -): err is { code: string } { - if ( - err != null && - typeof err === 'object' && - 'code' in err && - typeof err.code === 'string' - ) { - return code == null || err.code === code; - } - - return false; -} - -/** - * Returns true if the given error is an AggregateError. Optionally checks if - * a given code matches the error's code. - * @param err Error to check - * @param code Optional code to check - */ -export function isAggregateError( - err: unknown, - code?: string -): err is { code: string } { - return hasErrorCode(err, code) && String(err) === 'AggregateError'; -} diff --git a/packages/require-jsapi/src/index.ts b/packages/require-jsapi/src/index.ts deleted file mode 100644 index 91f10d26..00000000 --- a/packages/require-jsapi/src/index.ts +++ /dev/null @@ -1,15 +0,0 @@ -export * from './dhc'; -export * from './dhe'; -export * from './errorUtils'; -export * from './polyfill'; -export * from './serverUtils'; - -// TODO: https://github.com/deephaven/deephaven-core/issues/5911 to address the -// underlying issue of jsapi-types being unaware of `dhinternal`. Once that is -// addressed, this can be removed. -declare global { - // eslint-disable-next-line no-unused-vars - module dhinternal.io.deephaven.proto.ticket_pb { - export type TypedTicket = unknown; - } -} diff --git a/packages/require-jsapi/src/polyfill.ts b/packages/require-jsapi/src/polyfill.ts deleted file mode 100644 index 2a0a1786..00000000 --- a/packages/require-jsapi/src/polyfill.ts +++ /dev/null @@ -1,50 +0,0 @@ -import ws from 'ws'; - -class Event { - type: string; - detail: unknown; - - constructor(type: string, dict: { detail: unknown }) { - this.type = type; - if (dict) { - this.detail = dict.detail; - } - } -} - -export class CustomEvent extends Event { - constructor(...args: ConstructorParameters) { - super(...args); - } -} - -export function polyfillDh(): void { - // Copilot will look for `window.document.currentScript` if it finds `window`. - // Since we are polyfilling `window` below, we also need to set `document` to - // avoid a "Cannot read properties of undefined (reading 'currentScript')" - // error when Copilot extension is activated. Note that this scenario is only - // hit if the polyfill runs before Copilot extension is activated. - /* @ts-ignore */ - global.document = {}; - - // Copied from https://github.com/deephaven/deephaven.io/blob/main/tools/run-examples/includeAPI.mjs - /* @ts-ignore */ - global.self = global; - /* @ts-ignore */ - global.window = global; - /* @ts-ignore */ - global.this = global; - /* @ts-ignore */ - global.Event = Event; - /* @ts-ignore */ - global.CustomEvent = CustomEvent; - - global.WebSocket = ws as unknown as (typeof global)['WebSocket']; - - // This is needed to mimic running in a local http browser environment when - // making requests to the server. This at least impacts websocket connections. - // Not sure if it is needed for other requests. The url is an arbitrary - // non-https url just to make it stand out in logs. - // @ts-ignore - global.window.location = new URL('http://vscode-deephaven.localhost/'); -} diff --git a/packages/require-jsapi/src/serverUtils.ts b/packages/require-jsapi/src/serverUtils.ts deleted file mode 100644 index 117b6e99..00000000 --- a/packages/require-jsapi/src/serverUtils.ts +++ /dev/null @@ -1,135 +0,0 @@ -import * as http from 'node:http'; -import * as https from 'node:https'; -import { hasErrorCode, isAggregateError } from './errorUtils'; - -export const SERVER_STATUS_CHECK_TIMEOUT = 3000; - -/** - * Require a JS module from a URL. Loads the module in memory and returns its exports - * Copy / modified from https://github.com/deephaven/deephaven.io/blob/main/tools/run-examples/includeAPI.mjs - * - * @param url The URL with protocol to require from. Supports http or https - * @param retries The number of retries on failure - * @param retryDelay The delay between retries in milliseconds - * @param logger An optional logger object. Defaults to `console` - * @returns Promise which resolves to the module's exports - */ -export async function downloadFromURL( - url: string, - retries = 10, - retryDelay = 1000, - logger: { error: (...args: unknown[]) => void } = console -): Promise { - return new Promise((resolve, reject) => { - const urlObj = new URL(url); - - let transporter: typeof http | typeof https; - if (urlObj.protocol === 'http:') { - transporter = http; - } else if (urlObj.protocol === 'https:') { - transporter = https; - } else { - reject( - `Only http: and https: protocols are supported. Received ${urlObj.protocol}` - ); - return; - } - - transporter - .get(url, { timeout: 5000 }, res => { - let file = ''; - res.on('data', d => { - file += d; - }); - - res.on('end', async () => { - if (res.statusCode === 404) { - reject(`File not found: "${url}"`); - return; - } - - resolve(file); - }); - }) - .on('timeout', () => { - logger.error('Failed download of url:', url); - reject(); - }) - .on('error', e => { - if (retries > 0) { - logger.error('Retrying url:', url); - setTimeout( - () => - downloadFromURL(url, retries - 1, retryDelay, logger).then( - resolve, - reject - ), - retryDelay - ); - } else { - logger.error( - `Hit retry limit. Stopping attempted include from ${url} with error` - ); - logger.error(e); - reject(e); - } - }); - }); -} - -/** - * Check if a given url returns an expected status code. - * @param url The URL to check - * @param statusCodes The expected status codes - * @param logger An optional logger object. Defaults to `console` - * @returns Promise which resolves to true if the status code matches, false otherwise - */ -export async function hasStatusCode( - url: URL, - statusCodes: number[], - logger: { error: (...args: unknown[]) => void } = console -): Promise { - return new Promise(resolve => { - const transporter = url.protocol === 'http:' ? http : https; - - const request = transporter - .request( - url, - // Using OPTIONS method to avoid downloading the entire file. Could also - // use HEAD, but the response seems slightly smaller for OPTIONS. - { method: 'OPTIONS', timeout: SERVER_STATUS_CHECK_TIMEOUT }, - res => { - removeListenersAndResolve( - statusCodes.includes(res.statusCode as number) - ); - } - ) - .on('timeout', () => { - removeListenersAndResolve(false); - }) - .on('error', err => { - // Expected errors for non-existing / stopped servers. - const isServerStoppedError = isAggregateError(err, 'ECONNREFUSED'); - const isServerNotFoundError = hasErrorCode(err, 'ENOTFOUND'); - - if (!isServerStoppedError && !isServerNotFoundError) { - logger.error('Error when checking:', url.toString(), err); - } - - removeListenersAndResolve(false); - }) - .end(); - - /** - * Any time we resolve the Promise, remove listeners to avoid handling - * additional events and destroy the request stream to avoid any additional - * processing. - */ - function removeListenersAndResolve(value: boolean): void { - request.removeAllListeners(); - request.destroy(); - - resolve(value); - } - }); -} diff --git a/packages/require-jsapi/tsconfig.json b/packages/require-jsapi/tsconfig.json deleted file mode 100644 index d5b0579d..00000000 --- a/packages/require-jsapi/tsconfig.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "extends": "../../tsconfig.json", - "compilerOptions": { - "composite": true, - "rootDir": "src", - "outDir": "dist", - "types": ["node"] - }, - "include": ["src/**/*.ts"], - "exclude": ["node_modules"] -} diff --git a/scripts/esbuild.js b/scripts/esbuild.js index a28bbc63..a0f69e02 100644 --- a/scripts/esbuild.js +++ b/scripts/esbuild.js @@ -44,7 +44,7 @@ async function main() { sourcesContent: false, platform: 'node', outfile: 'out/extension.js', - external: ['vscode'], + external: ['esbuild', 'vscode'], logLevel: 'silent', plugins: [ /* add to the end of plugins array */ diff --git a/src/controllers/PipServerController.ts b/src/controllers/PipServerController.ts index 14858ec5..303c281c 100644 --- a/src/controllers/PipServerController.ts +++ b/src/controllers/PipServerController.ts @@ -1,6 +1,5 @@ import * as vscode from 'vscode'; import * as fs from 'node:fs'; -import { isDhcServerRunning } from '@deephaven/require-jsapi'; import { getPipServerUrl, getPipStatusFilePath, @@ -15,6 +14,7 @@ import { PYTHON_ENV_WAIT, } from '../common'; import { pollUntilTrue, waitFor } from '../util/promiseUtils'; +import { isDhcServerRunning } from '../dh/dhc'; const logger = new Logger('PipServerController'); diff --git a/src/dh/dhc.ts b/src/dh/dhc.ts index 0dc40ffc..3aba031e 100644 --- a/src/dh/dhc.ts +++ b/src/dh/dhc.ts @@ -4,6 +4,7 @@ import type { CoreAuthenticatedClient, CoreUnauthenticatedClient, } from '../types'; +import { hasStatusCode, loadModules } from '@deephaven/jsapi-nodejs'; export const AUTH_HANDLER_TYPE_ANONYMOUS = 'io.deephaven.auth.AnonymousAuthenticationHandler'; @@ -19,6 +20,48 @@ export type ConnectionAndSession = { session: TSession; }; +// TODO: https://github.com/deephaven/deephaven-core/issues/5911 to address the +// underlying issue of jsapi-types being unaware of `dhinternal`. Once that is +// addressed, this can be removed. +declare global { + // eslint-disable-next-line no-unused-vars + namespace dhinternal.io.deephaven.proto.ticket_pb { + export type TypedTicket = unknown; + } +} + +/** + * Download the DH Core jsapi from a running server and return the `dh` object. + * @param serverUrl URL of the DH Core server to download the api from. + * @param storageDir Directory to store downloaded jsapi files. + * @returns A promise that resolves to the DH Core jsapi. + */ +export async function getDhc( + serverUrl: URL, + storageDir: string +): Promise { + // Download jsapi `ESM` files from DH Community server. + const coreModule = await loadModules<{ default: typeof DhType }>({ + serverUrl, + serverPaths: ['jsapi/dh-core.js', 'jsapi/dh-internal.js'], + download: true, + storageDir, + sourceModuleType: 'esm', + targetModuleType: 'cjs', + esbuildOptions: { + tsconfigRaw: { + compilerOptions: { + // This needs to be set to avoid adding `use strict` to the output + // which hits a protobuf bug. https://github.com/protocolbuffers/protobuf-javascript/issues/8 + strict: false, + }, + }, + }, + }); + + return coreModule.default; +} + /** * Get embed widget url for a widget. * @param serverUrl Server URL @@ -77,6 +120,22 @@ export async function initDhcSession( return { cn, session }; } +/** + * Check if a given server is running by checking if the `dh-core.js` file is + * accessible. + * @param serverUrl + */ +export async function isDhcServerRunning(serverUrl: URL): Promise { + try { + return await hasStatusCode( + new URL('jsapi/dh-core.js', serverUrl.toString()), + [200, 204] + ); + } catch { + return false; + } +} + /** * Login a given unauthenticated client with the given credentials. * @param client The client to login. diff --git a/src/dh/dhe.ts b/src/dh/dhe.ts index c891e6ed..94af90e4 100644 --- a/src/dh/dhe.ts +++ b/src/dh/dhe.ts @@ -6,6 +6,8 @@ import type { TypeSpecificFields, } from '@deephaven-enterprise/jsapi-types'; import { DraftQuery, QueryScheduler } from '@deephaven-enterprise/query-utils'; +import type { AuthenticatedClient as DheAuthenticatedClient } from '@deephaven-enterprise/auth-nodejs'; +import { hasStatusCode, loadModules } from '@deephaven/jsapi-nodejs'; import type { ConsoleType, IdeURL, @@ -21,13 +23,43 @@ import { INTERACTIVE_CONSOLE_QUERY_TYPE, INTERACTIVE_CONSOLE_TEMPORARY_QUEUE_NAME, } from '../common'; -import type { AuthenticatedClient as DheAuthenticatedClient } from '@deephaven-enterprise/auth-nodejs'; export type IDraftQuery = EditableQueryInfo & { isClientSide: boolean; draftOwner: string; }; +declare global { + // This gets added by the DHE jsapi. + // eslint-disable-next-line no-unused-vars + const iris: DheType; +} + +/** + * Download the DHE jsapi from a running server and return the global `iris` object. + * @param serverUrl URL of the DHE server to download the api from. + * @param storageDir Directory to store downloaded jsapi files. + * @returns A promise that resolves to the DHE jsapi. + */ +export async function getDhe( + serverUrl: URL, + storageDir: string +): Promise { + polyfillDhe(); + + // Download jsapi `ESM` files from DH Community server. + await loadModules({ + serverUrl, + serverPaths: ['irisapi/irisapi.nocache.js'], + download: true, + storageDir, + sourceModuleType: 'cjs', + }); + + // DHE currently exposes the jsapi via the global `iris` object. + return iris; +} + /** * Get credentials for a Core+ worker associated with a given DHE client. * @param client The DHE client. @@ -65,6 +97,22 @@ export async function hasInteractivePermission( return isSuperUser || isInteractive; } +/** + * Check if a given server is running by checking if the `irisapi/irisapi.nocache.js` + * file is accessible. + * @param serverUrl + */ +export async function isDheServerRunning(serverUrl: URL): Promise { + try { + return await hasStatusCode( + new URL('irisapi/irisapi.nocache.js', serverUrl.toString()), + [200, 204] + ); + } catch { + return false; + } +} + /** * Create a query of type `InteractiveConsole`. * @param tagId Unique tag id to include in the query name. @@ -234,3 +282,22 @@ export async function getWorkerInfoFromQuery( workerName, }; } + +/** + * Polyfill some things needed by the DHE jsapi. The need for this should go + * away once DH-17942 is completed and the jsapi no longer relies on `window` + * or `self`. + */ +export function polyfillDhe(): void { + // @ts-ignore + globalThis.self = globalThis; + // @ts-ignore + globalThis.window = globalThis; + + // This is needed to mimic running in a local http browser environment when + // making requests to the server. This at least impacts websocket connections. + // Not sure if it is needed for other requests. The url is an arbitrary + // non-https url just to make it stand out in logs. + // @ts-ignore + global.window.location = new URL('http://vscode-deephaven.localhost/'); +} diff --git a/src/services/DhcService.ts b/src/services/DhcService.ts index 3ea133ca..cab2920e 100644 --- a/src/services/DhcService.ts +++ b/src/services/DhcService.ts @@ -1,6 +1,6 @@ import * as vscode from 'vscode'; +import { isAggregateError } from '@deephaven/jsapi-nodejs'; import type { dh as DhcType } from '@deephaven/jsapi-types'; -import { isAggregateError } from '@deephaven/require-jsapi'; import { formatTimestamp, getCombinedSelectedLinesText, Logger } from '../util'; import { initDhcSession, type ConnectionAndSession } from '../dh/dhc'; import type { diff --git a/src/services/ServerManager.ts b/src/services/ServerManager.ts index cac841df..de13a235 100644 --- a/src/services/ServerManager.ts +++ b/src/services/ServerManager.ts @@ -2,10 +2,6 @@ import * as vscode from 'vscode'; import { randomUUID } from 'node:crypto'; import type { dh as DhcType } from '@deephaven/jsapi-types'; import type { AuthenticatedClient as DheAuthenticatedClient } from '@deephaven-enterprise/auth-nodejs'; -import { - isDhcServerRunning, - isDheServerRunning, -} from '@deephaven/require-jsapi'; import { UnsupportedConsoleTypeError } from '../common'; import type { ConsoleType, @@ -34,7 +30,8 @@ import { import { URLMap } from './URLMap'; import { URIMap } from './URIMap'; import { DhcService } from './DhcService'; -import { getWorkerCredentials } from '../dh/dhe'; +import { getWorkerCredentials, isDheServerRunning } from '../dh/dhe'; +import { isDhcServerRunning } from '../dh/dhc'; const logger = new Logger('ServerManager'); diff --git a/src/services/cache/CoreJsApiCache.ts b/src/services/cache/CoreJsApiCache.ts index 5adb54f4..a85c90ff 100644 --- a/src/services/cache/CoreJsApiCache.ts +++ b/src/services/cache/CoreJsApiCache.ts @@ -1,7 +1,7 @@ -import { initDhcApi } from '@deephaven/require-jsapi'; import type { dh as DhcType } from '@deephaven/jsapi-types'; import { getTempDir, urlToDirectoryName } from '../../util'; import { ByURLAsyncCache } from './ByURLAsyncCache'; +import { getDhc } from '../../dh/dhc'; /** * Cache Core jsapi instances by URL. @@ -9,7 +9,7 @@ import { ByURLAsyncCache } from './ByURLAsyncCache'; export class CoreJsApiCache extends ByURLAsyncCache { constructor() { super(async url => - initDhcApi(url, getTempDir({ subDirectory: urlToDirectoryName(url) })) + getDhc(url, getTempDir({ subDirectory: urlToDirectoryName(url) })) ); } } diff --git a/src/services/cache/DheJsApiCache.ts b/src/services/cache/DheJsApiCache.ts index 2fd3f82f..bb89fdae 100644 --- a/src/services/cache/DheJsApiCache.ts +++ b/src/services/cache/DheJsApiCache.ts @@ -1,7 +1,7 @@ -import { initDheApi } from '@deephaven/require-jsapi'; import type { EnterpriseDhType as DheType } from '@deephaven-enterprise/jsapi-types'; import { getTempDir, urlToDirectoryName } from '../../util'; import { ByURLAsyncCache } from './ByURLAsyncCache'; +import { getDhe } from '../../dh/dhe'; /** * Cache DHE jsapi instances by URL. @@ -9,7 +9,7 @@ import { ByURLAsyncCache } from './ByURLAsyncCache'; export class DheJsApiCache extends ByURLAsyncCache { constructor() { super(async url => - initDheApi(url, getTempDir({ subDirectory: urlToDirectoryName(url) })) + getDhe(url, getTempDir({ subDirectory: urlToDirectoryName(url) })) ); } } diff --git a/tsconfig.json b/tsconfig.json index 15fb1870..4df0b2ce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -20,6 +20,5 @@ // Exclude tests as they have their own tsconfigs. "e2e", "**/*.spec.ts" - ], - "references": [{ "path": "./packages/require-jsapi" }] + ] } diff --git a/tsconfig.unit.json b/tsconfig.unit.json index 4201089a..fe24b2a6 100644 --- a/tsconfig.unit.json +++ b/tsconfig.unit.json @@ -2,6 +2,5 @@ "extends": "./tsconfig.json", "include": ["src/**/*.spec.ts", "src/dh/modules.d.ts"], // Override ./tsconfig `exclude` so that *.spec.ts files are included - "exclude": ["node_modules"], - "references": [{ "path": "./packages/require-jsapi" }] + "exclude": ["node_modules"] }