Skip to content

Conversation

@grypez
Copy link
Contributor

@grypez grypez commented Nov 25, 2024

Closes #233

Adds the new @ocap/cli package and includes an ocap binary in the monorepo top level.

ocap bundle

Use the endo bundler to prepare the given .js file, or every .js file in the given directory.

$ yarn ocap bundle packages/extension/src/vats/
> bundling dir ~/ocap-kernel/packages/extension/src/vats
> ~/ocap-kernel/packages/extension/src/vats/sample-vat.js
> wrote ~/ocap-kernel/packages/extension/src/vats/sample-vat.bundle: 2552 bytes

ocap serve

Serve .bundle files from the given directory, addressed relative to the directory.

$ yarn ocap serve packages/extension/src/vats/
> serving packages/extension/src/vats/ on localhost:3000

@socket-security
Copy link

socket-security bot commented Nov 25, 2024

New dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@types/serve-handler@6.1.4 None +2 2.12 MB types
npm/@types/yargs@17.0.33 None +1 69.1 kB types
npm/serve-handler@6.1.6 environment, filesystem +7 292 kB vercel-release-bot

View full report↗︎

@grypez grypez force-pushed the grypez/ahoy branch 3 times, most recently from 653aeb0 to 9b9f851 Compare December 2, 2024 14:00
@grypez grypez marked this pull request as ready for review December 2, 2024 14:22
@grypez grypez requested a review from a team as a code owner December 2, 2024 14:22
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

Nice! See inline comments for various suggestions.

Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

In addition, the package should be added to the root tsconfig.json references field. If the package is built using ts-bridge (which I'm not sure should be the case), it should also be added to the root tsconfig.build.json. As long as we can build the CLI via yarn build and the run commands using yarn ocap <command>, we're good.

Copy link
Contributor

@sirtimid sirtimid left a comment

Choose a reason for hiding this comment

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

@grypez can you also fix the E2E test workflow and the start:server command which is used in the playwright config?

@grypez
Copy link
Contributor Author

grypez commented Dec 4, 2024

@grypez can you also fix the E2E test workflow and the start:server command which is used in the playwright config?

moved to #265

@grypez grypez changed the title Establish simple CLI for serving user code feat: Establish simple CLI for serving user code Dec 4, 2024
@grypez grypez requested a review from rekmarks December 5, 2024 20:36
@grypez grypez enabled auto-merge (squash) December 5, 2024 20:37
Copy link
Member

@rekmarks rekmarks left a comment

Choose a reason for hiding this comment

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

LGTM!

@grypez grypez merged commit 2826c94 into main Dec 5, 2024
15 checks passed
@grypez grypez deleted the grypez/ahoy branch December 5, 2024 22:17
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.

Establish simple CLI for serving user code

4 participants