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

createSkyInspector #12

Merged
merged 6 commits into from
Feb 9, 2024
Merged

createSkyInspector #12

merged 6 commits into from
Feb 9, 2024

Conversation

mellson
Copy link
Member

@mellson mellson commented Jan 26, 2024

This PR adds createSkyInspector, which allows you to inspect machines in Node or the browser. The inspection will send the events to a server backend through websockets and allows you to open and share a live inspection URL.

@mellson mellson requested a review from davidkpiano January 26, 2024 11:58
@@ -30,7 +34,8 @@
"prepublishOnly": "tsup src/index.ts --dts",
"changeset": "changeset",
"release": "changeset publish",
"version": "changeset version"
"version": "changeset version",
"dev": "yarn build && ./scripts/dev.sh"
Copy link
Member Author

Choose a reason for hiding this comment

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

The dev script will build and copy the package to destinations defined in a root .env file. Let's say you wanted to try this package in two other projects (studio and sky-starter-app) located in the same directory as inspect. Then you would add this to your .env file:

DEV_DESTINATIONS="../sky-starter-app,../studio"

serialize(event) {
if (!filter || filter(event)) {
const skyEvent = apiKey ? { apiKey, ...event } : event;
socket.send(stringify(skyEvent));
Copy link
Member

@davidkpiano davidkpiano Jan 26, 2024

Choose a reason for hiding this comment

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

This is in the wrong place - we should repurpose createWebsocketInspector for this

(I say "wrong" because this option is only meant for serializing the event; it should be pure)

Copy link
Member Author

Choose a reason for hiding this comment

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

Makes sense; this was just me exploiting what I had available 😅 I've tried to update the browser inspector to match what we need in the latest; see if this looks okay to you.

@davidkpiano davidkpiano merged commit dadc388 into main Feb 9, 2024
@github-actions github-actions bot mentioned this pull request Feb 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants