Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Split out packages #133

Merged
merged 11 commits into from
Sep 20, 2024
Prev Previous commit
Next Next commit
Updated ignore files (#79-1)
bmingles committed Sep 20, 2024
commit 19b8ed415a1cb4e72c8a17d501a2168645f91f83
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -5,4 +5,5 @@ node_modules
.DS_Store
.wdio-vscode-service
e2e/reports/
test-reports/
test-reports/
tsconfig.tsbuildinfo
2 changes: 2 additions & 0 deletions .vscodeignore
Original file line number Diff line number Diff line change
@@ -3,11 +3,13 @@ _ignore/**
.vscode/**
.vscode-test/**
src/**
packages/**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if instead of a vscodeignore we should only be including certain paths? Seems like we're excluding a lot more than we're including, and we need to exclude more stuff everytime we add new things.

Also I'd add a .venv here - I sometimes create a venv when testing this stuff, and then packaging takes forever if I forget I did that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just now saw this comment. I'll look into these things. Curious if there's a whitelist approach instead of ignore.

.gitignore
.yarnrc
vsc-extension-quickstart.md
**/tsconfig.json
**/tsconfig.unit.json
**/tsconfig.tsbuildinfo
**/.eslintrc.json
**/*.map
**/*.ts
2 changes: 2 additions & 0 deletions packages/require-jsapi/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# 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.
3 changes: 2 additions & 1 deletion packages/require-jsapi/src/errorUtils.ts
Original file line number Diff line number Diff line change
@@ -51,7 +51,8 @@ export function hasErrorCode(

/**
* Parse a server error string into a key-value object.
* @param error
* @param error Error string to parse.
* @param logger Optional logger for debugging. Defaluts to console.
*/
export function parseServerError(
error: string,
14 changes: 9 additions & 5 deletions packages/require-jsapi/src/serverUtils.ts
Original file line number Diff line number Diff line change
@@ -8,11 +8,11 @@ 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 {string} url The URL with protocol to require from. Supports http or https
* @param {number} retries The number of retries on failure
* @param {number} retryDelay The delay between retries in milliseconds
* @param {object} logger An optional logger object. Defaults to `console`
* @returns {Promise<string>} Promise which resolves to the module's exports
* @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,
@@ -74,6 +74,10 @@ export async function downloadFromURL(

/**
* 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,
1 change: 0 additions & 1 deletion packages/require-jsapi/tsconfig.tsbuildinfo

This file was deleted.